Douyin short video matrix number system open source deployment and sharing (2)

Development background: Douyin seo source code, Douyin matrix system source code. Douyin customer acquisition system source code, short video matrix system source code open source construction (MySQL database, NGINX, PHP7.4, MySQL5.7, redis)

 Technical points:

  • server configuration
  • Server cluster processing
  • API interface call
  • server user concurrency
  • Server video storage

1. Server configuration:

Source code required server configuration

1. Specifications: minimum 8-core 16G

2. Hard disk: system disk 40-100G, data disk no less than 100G

3. Bandwidth: 10M

4. System: CentOS7 (must choose 7.*)

2. Server cluster processing

The Douyin short video matrix number system adopts cluster deployment and development during the development process, which can improve the reliability and stability of the system. When a server fails, other servers can automatically take over its work, thus ensuring the continuous operation of the system. This automatic backup mechanism can improve the stability and reliability of the system and avoid service interruption caused by a single server failure.

Second, server clustering can improve system performance and scalability. By increasing the server nodes, the processing capability and throughput of the system can be improved, and the performance degradation caused by the performance bottleneck of a single server can be avoided. In addition, server clustering can dynamically adjust the number of nodes to achieve elastic expansion of the system to meet the needs of different scales and loads.

3. API interface call (display part)

Download and install the Douyin SDK, and then develop according to the Douyin API interface document. The main API interfaces used are as follows:

Account Authorization

API

describe

Douyin obtains the authorization code

This interface is only applicable to Douyin to obtain authorization temporary tickets (code).

get access_token

This interface is used to obtain the credential access_token that the user authorizes third-party interface calls.

This interface is applicable to Douyin authorization.

Refresh refresh_token

This interface is used to refresh the validity period of refresh_token.

This interface is applicable to Douyin authorization.

Generate client_token

This interface is used to obtain the credential client_access_token for interface calls.

This interface is applicable to Douyin authorization.

refresh access_token

This interface is used to refresh the validity period of access_token.

This interface is applicable to Douyin authorization.

User Management

API

describe

Obtain user public information

This interface obtains the user's Douyin public information, including nickname, avatar, gender and region.

Applies to Douyin.

fan judgment

The Douyin account authorized under the developer application can judge whether other users follow the current Douyin account according to the openid of other users, that is, they are fans of the current Douyin account.

interaction management

API

describe

comment list

This interface is used to get the list of comments.

Comment reply list

This interface is used to get the comment reply list.

Reply to video comments

This interface is used to reply to video comments, and only the videos posted by authorized users can be replied.

Receive comment reply event

This interface is used to receive comment reply events.

Send a private message

This interface is used to send private messages to users.

Withdrawal of private messages

This interface is used to withdraw private chat messages.

send group message

This interface is used to send group messages.

Withdraw group message

This interface is used to withdraw group messages.

Create/update retention card

This interface is used to create/update retention cards.

Query retention card

This interface is used to query the reserved funds card.

delete card

This interface is used to delete reserved funds card.

Create/Update Mini Program Bootstrap Card Template

This interface is used to create/update Mini Program guide card templates.

Query Mini Program Guidance Card Template

This interface is used for.

Delete Mini Program Guide Card Template

This interface is used to delete the Mini Program guide card template.

upload picture

This interface is used to upload pictures.

open data service

API

describe

Get user video status

This interface is used to obtain user video status.

Get the number of user followers

This interface is used to obtain the number of followers of a user.

Get the number of user likes

This interface is used to get the number of user likes.

Get the number of user comments

This interface is used to obtain the number of user comments.

Get the number of user shares

This interface is used to obtain the number of user shares.

Get the number of visits to the user's homepage

This interface is used to obtain the number of visits to the user's homepage.

Get video basic data

This interface is used to obtain basic video data.

Get video like data

This interface is used to obtain video like data.

Get video comment data

This interface is used to obtain video comment data.

Get video playback data

This interface is used to obtain video playback data.

Get video sharing data

This interface is used to obtain video sharing data.

4. Server user concurrent processing

  1. Load balancing: By distributing user requests to multiple servers, the load of the servers is balanced, thereby improving the concurrency of the system.

  2. Database clustering: the database is also made into a cluster, and multiple servers can simultaneously perform read and write operations on the database, thereby improving the system's concurrency capability.

  3. Cache mechanism: By caching frequently used data in memory, the number of visits to the database can be reduced and concurrency can be improved.

  4. Distributed file system: By storing files on multiple servers, files can be read and written concurrently, improving the concurrent capabilities of the system.

  5. Asynchronous processing: By placing some time-consuming operations in the background for asynchronous processing, the user's waiting time can be reduced and the concurrency capability can be improved.

The above methods are mainly used in combination according to the user's situation to achieve the optimal concurrent processing effect.

5. Server video storage

The server video is stored in the cloud, and services are provided through cloud service providers, such as Alibaba Cloud, Tencent Cloud, Huawei Cloud, etc. The video adopts an automatic destruction and on-demand generation mechanism, and users can make an appointment to generate video combinations according to demand. After use, it is automatically destroyed from the cloud, effectively deduplicating videos and reducing server storage pressure. In the actual operation process, service providers can also flexibly adjust according to actual needs to reduce operating costs.

Basic Information

HTTP URL

https://open.douyin.com/oauth/access_token/

HTTP Method

POST

 

Guess you like

Origin blog.csdn.net/buda_l/article/details/131470605