A method and system for processing live video data
By establishing a communication channel between users and the live broadcast room in the live broadcast system or calling data from the cache server, the problem of server overload under massive user requests is solved, and the stability of the live broadcast and user experience are improved.
Patent Information
- Application Number
- CN202410470323.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-18
- Publication Date
- 2024-10-29
- Estimated Expiration
- 2044-04-18
AI Technical Summary
When a large number of users in the existing live broadcast system send live broadcast data acquisition requests at the same time, the server is overloaded, resulting in a decrease in live broadcast stability, and users may face problems such as lags.
By detecting the user's request to enter the live broadcast room, the identification information of the device and the live broadcast room is obtained. After verification, a communication channel is established to transmit the live broadcast data, or data is called from the cache server when the verification value is low to share the server load.
Ensure the quality and stability of live broadcast, reduce the occurrence of freezes, effectively cope with server performance degradation during high concurrency, and improve user experience.
Smart Images

Figure CN118474402B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of live broadcast data processing, and in particular to a method and system for processing live video data. Background Art
[0002] With the improvement and development of network infrastructure and the hardware upgrade of terminals, live broadcasting has become a popular way of interaction between users. Users can become anchors and create virtual live broadcast rooms through live broadcast platforms. Other users can also enter the live broadcast room through live broadcast platforms to watch. There are two main ways for users to access multiple live broadcast rooms. One is to visit each live broadcast room one by one and open a web page window for each live broadcast room. The other is to switch directly from one live broadcast room to another.
[0003] As for the latter, in the current live broadcast system, the live broadcast server obtains the live broadcast data of the anchor in real time and sends it to the server corresponding to the database. When the user needs to switch the live broadcast room, the server corresponding to the database needs to store the live broadcast data, respond to the user's live broadcast data acquisition request, and feed back the live broadcast data of the corresponding live broadcast room to the user. In this way, while the server corresponding to the database undertakes multiple tasks, it also bears a large load. When a large number of users send live broadcast data acquisition requests at the same time, the performance of the server is likely to decline, and the user end will face problems such as live broadcast freezes, affecting the stability of the live broadcast. Summary of the invention
[0004] The present invention provides a video live broadcast data processing method and system to solve the technical problem of how to improve the stability of live broadcast.
[0005] In order to solve the above technical problems, an embodiment of the present invention provides a method for processing live video data, which is applied to a live broadcast server. The method for processing live video data includes:
[0006] When detecting a request from a user to enter the first live broadcast room, responding to a data acquisition instruction of the user and acquiring a device identifier of the user;
[0007] Acquire the location information of the user according to the device identifier; acquire the location information and the live broadcast identifier of the first live broadcast room according to the data acquisition instruction;
[0008] According to the device identifier, query the corresponding identifier group, and verify the identifier group and the live broadcast identifier of the first live broadcast room to obtain a verification value;
[0009] When the check value is greater than or equal to a preset check threshold, the location information of the first live broadcast room, the live broadcast identification and the location information of the user are sent to the data center, so that the data center establishes a communication channel between the first live broadcast room and the user according to the location information of the first live broadcast room and the location information of the user, generates a channel number, and sends the channel number to the first live broadcast room and the user; so that the first live broadcast room sends the corresponding live broadcast data to the client of the user through the communication channel according to the live broadcast identification, so that the client switches from the initial live broadcast room to the first live broadcast room and uses the live broadcast data for playback;
[0010] When the verification value is less than the verification threshold, a call instruction and the live broadcast identifier of the first live broadcast room are sent to the storage server; so that the storage server responds to the call instruction, calls the live broadcast data from the cache server according to the live broadcast identifier of the first live broadcast room, and sends it to the user's client, so that the client switches from the initial live broadcast room to the first live broadcast room and uses the live broadcast data for playback; wherein, the storage server communicates with the first live broadcast room in real time.
[0011] As a preferred solution, the live broadcast data includes transport stream data, and the live broadcast data is used for playing, specifically:
[0012] receiving the transport stream data;
[0013] The transport stream data is segmented with a preset time period as a period to obtain each first data split data;
[0014] Repackaging each first data split stream data to obtain corresponding second data split stream data;
[0015] Determine a storage address of the second data offload data according to a preset rule, and store the second data offload data in the determined storage address;
[0016] Updating the storage address of the live segment in the preset path file to the storage address of the second data diversion data;
[0017] The preset path file is obtained, and according to the storage address of the second data diversion data in the preset path file, the live segment of the corresponding time in the transport stream data is obtained to realize the playback of the live data.
[0018] As a preferred solution, the identification group includes multiple verification identifications; each verification identification corresponds to each preset live broadcast room; the verification of the identification group and the live broadcast identification of the first live broadcast room to obtain the verification value is specifically:
[0019] Acquire a mapping relationship associated with the verification identifier from a preset mapping database;
[0020] According to the mapping relationship, a target polynomial is obtained, and then corresponding coded data is obtained according to the target polynomial; wherein the coded data is hexadecimal data;
[0021] Convert the live broadcast identifier of the first live broadcast room into hexadecimal data to be verified;
[0022] The data to be verified is taken as the dividend, and the encoded data is taken as the divisor. A division operation is performed on the data to be verified and the encoded data, and the obtained remainder is encrypted using the MD5 algorithm to generate a check value.
[0023] As a preferred solution, the data acquisition instruction includes a positioning instruction and a data conversion instruction, and the positioning instruction is a heartbeat signal sent by the user to the live broadcast server;
[0024] The step of obtaining the location information and the live broadcast identifier of the first live broadcast room according to the data acquisition instruction is specifically as follows:
[0025] In response to the heartbeat signal, obtaining the longitude information and latitude information of the first live broadcast room according to the heartbeat interval of the heartbeat signal;
[0026] In response to the data conversion instruction, obtaining the live broadcast number of the first live broadcast room;
[0027] Acquire corresponding timestamp information according to the live broadcast number, and then acquire the live broadcast record of the first live broadcast room based on the timestamp information;
[0028] Generate a live broadcast identifier of the first live broadcast room according to the time information of each live broadcast session in the live broadcast record.
[0029] As a preferred solution, calling the live broadcast data from the cache server according to the live broadcast identifier of the first live broadcast room is specifically:
[0030] Sending data call requests to a plurality of cache servers according to priorities from high to low; wherein the storage server and the plurality of cache servers belong to the same pre-built tree topology structure; the storage server is a root node of the tree topology structure, and the cache server is a child node of the tree topology structure; the priority of the cache server is measured by a central server outside the tree topology structure by traversing and accessing the cache servers;
[0031] So that the cache server responds to the data call request in order from high to low priority and determines the corresponding source data; when the cache server detects that the source data exists locally, it obtains the source data locally and forwards it to the storage server, so that the storage server obtains the live broadcast data.
[0032] As a preferred solution, the storage server is connected to each cache server via Ethernet; cache servers with a priority in the first interval are connected via Ethernet, and cache servers with a priority in the second interval are connected via a wide area network; the first interval and the second interval are both pre-set intervals.
[0033] Correspondingly, an embodiment of the present invention further provides a video live broadcast data processing system, which is applied to a live broadcast server. The video live broadcast data processing system includes a first acquisition module, a second acquisition module, a verification module and a playback module; wherein,
[0034] The first acquisition module is used to respond to the data acquisition instruction of the user and acquire the device identification of the user when detecting the user's request to enter the first live broadcast room;
[0035] The second acquisition module is used to acquire the location information of the user according to the device identifier; and acquire the location information and the live broadcast identifier of the first live broadcast room according to the data acquisition instruction;
[0036] The verification module is used to query the corresponding identification group according to the device identification, and verify the identification group and the live broadcast identification of the first live broadcast room to obtain a verification value;
[0037] The playback module is used to send the location information of the first live broadcast room, the live broadcast identification and the location information of the user to the data center when the check value is greater than or equal to a preset check threshold, so that the data center establishes a communication channel between the first live broadcast room and the user according to the location information of the first live broadcast room and the location information of the user, generates a channel number, and sends the channel number to the first live broadcast room and the user; so that the first live broadcast room sends the corresponding live broadcast data to the client of the user through the communication channel according to the live broadcast identification, so that the client switches from the initial live broadcast room to the first live broadcast room and uses the live broadcast data for playback;
[0038] When the verification value is less than the verification threshold, a call instruction and the live broadcast identifier of the first live broadcast room are sent to the storage server; so that the storage server responds to the call instruction, calls the live broadcast data from the cache server according to the live broadcast identifier of the first live broadcast room, and sends it to the user's client, so that the client switches from the initial live broadcast room to the first live broadcast room and uses the live broadcast data for playback; wherein, the storage server communicates with the first live broadcast room in real time.
[0039] As a preferred solution, the live broadcast data includes transport stream data, and the playback module uses the live broadcast data for playback, specifically:
[0040] The playing module receives the transport stream data;
[0041] The transport stream data is segmented with a preset time period as a period to obtain each first data split data;
[0042] Repackaging each first data split stream data to obtain corresponding second data split stream data;
[0043] Determine a storage address of the second data offload data according to a preset rule, and store the second data offload data in the determined storage address;
[0044] Updating the storage address of the live segment in the preset path file to the storage address of the second data diversion data;
[0045] The preset path file is obtained, and according to the storage address of the second data diversion data in the preset path file, the live segment of the corresponding time in the transport stream data is obtained to realize the playback of the live data.
[0046] As a preferred solution, the identification group includes multiple verification identifications; each verification identification corresponds to each preset live broadcast room; the verification module verifies the live broadcast identification of the identification group and the first live broadcast room to obtain a verification value, which is specifically:
[0047] The verification module obtains a mapping relationship associated with the verification identifier from a preset mapping database;
[0048] According to the mapping relationship, a target polynomial is obtained, and then corresponding coded data is obtained according to the target polynomial; wherein the coded data is hexadecimal data;
[0049] Convert the live broadcast identifier of the first live broadcast room into hexadecimal data to be verified;
[0050] The data to be verified is taken as the dividend, and the encoded data is taken as the divisor. A division operation is performed on the data to be verified and the encoded data, and the obtained remainder is encrypted using the MD5 algorithm to generate a check value.
[0051] As a preferred solution, the data acquisition instruction includes a positioning instruction and a data conversion instruction, and the positioning instruction is a heartbeat signal sent by the user to the live broadcast server;
[0052] The second acquisition module acquires the location information and the live broadcast identifier of the first live broadcast room according to the data acquisition instruction, specifically:
[0053] The second acquisition module responds to the heartbeat signal and acquires the longitude information and latitude information of the first live broadcast room according to the heartbeat interval of the heartbeat signal;
[0054] In response to the data conversion instruction, obtaining the live broadcast number of the first live broadcast room;
[0055] Acquire corresponding timestamp information according to the live broadcast number, and then acquire the live broadcast record of the first live broadcast room based on the timestamp information;
[0056] Generate a live broadcast identifier of the first live broadcast room according to the time information of each live broadcast session in the live broadcast record.
[0057] As a preferred solution, the playback module calls the live broadcast data from the cache server according to the live broadcast identifier of the first live broadcast room, specifically:
[0058] The playback module sends data call requests to a plurality of cache servers according to the priority from high to low; wherein the storage server and the plurality of cache servers belong to the same pre-built tree topology structure; the storage server is the root node of the tree topology structure, and the cache server is the child node of the tree topology structure; the priority of the cache server is measured by a central server outside the tree topology structure by traversing and accessing the cache server;
[0059] So that the cache server responds to the data call request in order from high to low priority and determines the corresponding source data; when the cache server detects that the source data exists locally, it obtains the source data locally and forwards it to the storage server, so that the storage server obtains the live broadcast data.
[0060] As a preferred solution, the storage server is connected to each cache server via Ethernet; cache servers with a priority in the first interval are connected via Ethernet, and cache servers with a priority in the second interval are connected via a wide area network; the first interval and the second interval are both pre-set intervals.
[0061] Compared with the prior art, the embodiments of the present invention have the following beneficial effects:
[0062] The embodiment of the present invention provides a method and system for processing video live broadcast data, which is applied to a live broadcast server. The method for processing video live broadcast data includes: when a user's request to enter a first live broadcast room is detected, responding to the user's data acquisition instruction to obtain the user's device identification; obtaining the user's location information according to the device identification; obtaining the location information and live broadcast identification of the first live broadcast room according to the data acquisition instruction; querying the corresponding identification group according to the device identification, and verifying the identification group and the live broadcast identification of the first live broadcast room to obtain a verification value; when the verification value is greater than or equal to a preset verification threshold, sending the location information of the first live broadcast room, the live broadcast identification and the location information of the user to a data center, so that the data center establishes the first live broadcast room according to the location information of the first live broadcast room and the location information of the user A communication channel between the live broadcast room and the user, and generates a channel number, and sends the channel number to the first live broadcast room and the user; so that the first live broadcast room sends the corresponding live broadcast data to the user's client through the communication channel according to the live broadcast identifier, so that the client switches from the initial live broadcast room to the first live broadcast room and uses the live broadcast data for playback; when the verification value is less than the verification threshold, a call instruction and the live broadcast identifier of the first live broadcast room are sent to the storage server; so that the storage server responds to the call instruction, calls the live broadcast data from the cache server according to the live broadcast identifier of the first live broadcast room, and sends it to the user's client, so that the client switches from the initial live broadcast room to the first live broadcast room and uses the live broadcast data for playback; wherein the storage server communicates with the first live broadcast room in real time. In implementing the embodiments of the present invention, when the check value is greater than or equal to a preset check threshold, a communication channel is established between the first live broadcast room and the user through the data center, so that the live broadcast data is called and transmitted through the communication channel, which can ensure the live broadcast quality and stability when the user watches the first live broadcast room, and reduce the occurrence of live broadcast freezes or unsmoothness with the help of the dedicated communication channel; when the check value is less than the above-mentioned check threshold, a call instruction and a live broadcast identifier of the live broadcast room are sent to the storage server, and the storage server calls the live broadcast data from the cache server according to the identifier. Compared with the technology of storing, calling and responding data on the same server in the prior art, different servers can complete their respective links, and can effectively respond to high-concurrency live broadcast data calls, reduce the hardware performance degradation of the server equipment, further improve the stability of the live broadcast, and effectively improve the user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0063] Figure 1: A flow chart of an embodiment of a method for processing live video data provided by the present invention.
[0064] Figure 2 : A structural diagram of an embodiment of a live video data processing system provided by the present invention. DETAILED DESCRIPTION
[0065] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0066] Embodiment 1
[0067] Please refer to Figure 1 , Figure 1 A method for processing live video data is provided in an embodiment of the present invention, and the method for processing live video data includes steps S1 to S4; wherein:
[0068] Step S1, when detecting a user's request to enter a first live broadcast room, responding to the user's data acquisition instruction, acquiring the user's device identification.
[0069] In this embodiment, the video live broadcast data processing method is applied to a live broadcast server. The live broadcast server is part of the live broadcast system in this embodiment. In addition to the live broadcast server, the live broadcast system also includes a storage server, a cache server, a central server, and a data center. Among them, the execution subject of the video live broadcast data processing method in this embodiment is the live broadcast server, which interacts with the storage server and the data center to realize the processing of live broadcast data to meet the playback needs of users.
[0070] The user can send the data acquisition instruction to the live broadcast server through the client. The live broadcast server responds to the data acquisition instruction and obtains the device identification of the user. The device identification refers to the identification of the device running the client, which can be represented by a form including but not limited to a unique code.
[0071] Step S2, obtaining the user's location information according to the device identifier; obtaining the location information and live broadcast identifier of the first live broadcast room according to the data acquisition instruction.
[0072] In this embodiment, the data acquisition instruction includes a positioning instruction and a data conversion instruction, and the positioning instruction is a heartbeat signal sent by the user to the live broadcast server through the client.
[0073] The step of obtaining the location information and the live broadcast identifier of the first live broadcast room according to the data acquisition instruction is specifically as follows:
[0074] The live broadcast server responds to the heartbeat signal, and obtains the longitude and latitude information of the first live broadcast room according to the heartbeat interval of the heartbeat signal (for example, the heartbeat interval may be 0.5 seconds); responds to the data conversion instruction, and obtains the live broadcast number of the first live broadcast room; obtains the corresponding timestamp information according to the live broadcast number, and then obtains the live broadcast record of the first live broadcast room based on the timestamp information; generates a live broadcast identifier of the first live broadcast room according to the time information of each live broadcast session in the live broadcast record.
[0075] In the implementation of the embodiment of the present invention, the live broadcast identification of the first live broadcast room contains the live broadcast information of each session in the live broadcast record of the first live broadcast room, and the live broadcast information also contains the time information of each session. The live broadcast identification can be used for calling and transmitting the live broadcast data in the subsequent steps, improving the accuracy of the live broadcast data calling and the efficiency of data transmission.
[0076] Step S3: query the corresponding identification group according to the device identification, and verify the identification group and the live broadcast identification of the first live broadcast room to obtain a verification value.
[0077] In this embodiment, the identification group includes multiple verification identifications; each verification identification corresponds to a preset live broadcast room.
[0078] The verification of the identification group and the live broadcast identification of the first live broadcast room to obtain a verification value is specifically:
[0079] A mapping relationship associated with the verification identifier is obtained from a preset mapping database; the mapping relationship is preset and is mainly used to associate the verification identifier with a polynomial.
[0080] According to the mapping relationship, a target polynomial is obtained, and then corresponding coded data is obtained according to the target polynomial; wherein the coded data is hexadecimal data;
[0081] Convert the live broadcast identifier of the first live broadcast room into hexadecimal data to be verified;
[0082] The data to be verified is taken as the dividend, and the encoded data is taken as the divisor. A division operation is performed on the data to be verified and the encoded data, and the obtained remainder is encrypted using the MD5 algorithm to generate a check value.
[0083] Step S4, when the verification value is greater than or equal to a preset verification threshold, the location information of the first live broadcast room, the live broadcast identification and the location information of the user are sent to the data center, so that the data center establishes a communication channel between the first live broadcast room and the user according to the location information of the first live broadcast room and the location information of the user, generates a channel number, and sends the channel number to the first live broadcast room and the user; thereby, the first live broadcast room sends the corresponding live broadcast data to the user's client through the communication channel according to the live broadcast identification, so that the client switches from the initial live broadcast room to the first live broadcast room and uses the live broadcast data for playback.
[0084] When the verification value is less than the verification threshold, a call instruction and the live broadcast identifier of the first live broadcast room are sent to the storage server; so that the storage server responds to the call instruction, calls the live broadcast data from the cache server according to the live broadcast identifier of the first live broadcast room, and sends it to the user's client, so that the client switches from the initial live broadcast room to the first live broadcast room and uses the live broadcast data for playback; wherein, the storage server communicates with the first live broadcast room in real time.
[0085] In this embodiment, the check value can be used in step S4 to compare with the check threshold, so as to determine the calling method of the live broadcast data of the first live broadcast room. In this step, when the check value is greater than or equal to the check threshold, a communication channel between the first live broadcast room and the user is established through the data center, so that the live broadcast data is called and transmitted through the communication channel, which can ensure the live broadcast quality and stability when the user watches the first live broadcast room, and reduce the occurrence of live broadcast freezes or unsmoothness with the help of the dedicated communication channel.
[0086] When the verification value is less than the above verification threshold, a call instruction and the live broadcast room identifier are sent to the storage server, and the storage server calls the live broadcast data from the cache server according to the identifier. Different servers can complete their respective links (for example, the storage server and the cache server respectively implement different links), so that they can effectively respond to high-concurrency live broadcast data calls, reduce the hardware performance degradation of the server equipment, further improve the stability of the live broadcast, and effectively improve the user experience.
[0087] As a preferred implementation manner, calling the live broadcast data from the cache server according to the live broadcast identifier of the first live broadcast room is specifically:
[0088] Sending data call requests to a plurality of cache servers according to priorities from high to low; wherein the storage server and the plurality of cache servers belong to the same pre-built tree topology structure; the storage server is a root node of the tree topology structure, and the cache server is a child node of the tree topology structure; the priority of the cache server is measured by a central server outside the tree topology structure by traversing and accessing the cache servers;
[0089] So that the cache server responds to the data call request in order from high to low priority and determines the corresponding source data; when the cache server detects that the source data exists locally, it obtains the source data locally and forwards it to the storage server, so that the storage server obtains the live broadcast data.
[0090] The storage server is connected to each cache server via Ethernet; cache servers with a first priority interval are connected via Ethernet, and cache servers with a second priority interval are connected via a wide area network; the first interval and the second interval are both pre-set intervals.
[0091] By implementing the present invention, a tree topology including a cache server and a storage server can be pre-built according to actual needs, and different priorities can be assigned to different cache servers according to the needs of the application scenario. The priority can be represented by a numerical value. Exemplarily, the priority can be determined by the central server through traversal access according to the importance, urgency or performance requirements of the live data. By sending data call requests to different cache servers according to the priorities from high to low, the source data is obtained in turn for the acquisition of live data, which can ensure the call efficiency of the live data and effectively improve the data quality.
[0092] As a further preferred implementation, the live broadcast data includes transport stream data, and the live broadcast data is used for playback, specifically:
[0093] Receive the transport stream data; divide the transport stream data into first data diversion data based on a preset time period to obtain first data diversion data; transpack each first data diversion data to obtain corresponding second data diversion data; determine the storage address of the second data diversion data according to a preset rule, and store the second data diversion data in the determined storage address; update the storage address of the live broadcast segment in the preset path file to the storage address of the second data diversion data; obtain the preset path file, and according to the storage address of the second data diversion data in the preset path file, obtain the live broadcast segment of the corresponding time in the transport stream data to play the live broadcast data.
[0094] In the implementation method of the embodiment of the present application, the second data diversion data obtained after the transpackaging operation is stored in the determined address, and then the storage address of the live broadcast segment in the preset path file is updated to the storage address of the second data diversion data, and then the second data diversion data can be obtained by finding the path file, and the live broadcast segment of the corresponding time in the transmission stream data is obtained. Compared with the prior art, there is no need to fully obtain the transmission stream data, which can greatly reduce the processing time of encoding and decoding during the live broadcast process, reduce the resource consumption during the live broadcast process, and only require fewer resources to achieve stable and high-quality live broadcast.
[0095] Accordingly, refer to Figure 2 The embodiment of the present invention further provides a video live broadcast data processing system, which is applied to a live broadcast server. The video live broadcast data processing system includes a first acquisition module 101, a second acquisition module 102, a verification module 103 and a playback module 104; wherein,
[0096] The first acquisition module 101 is used to respond to the data acquisition instruction of the user and acquire the device identification of the user when detecting the user's request to enter the first live broadcast room;
[0097] The second acquisition module 102 is used to acquire the location information of the user according to the device identifier; and acquire the location information and the live broadcast identifier of the first live broadcast room according to the data acquisition instruction;
[0098] The verification module 103 is used to query the corresponding identification group according to the device identification, and verify the identification group and the live broadcast identification of the first live broadcast room to obtain a verification value;
[0099] The playback module 104 is configured to send the location information of the first live broadcast room, the live broadcast identifier, and the location information of the user to the data center when the check value is greater than or equal to a preset check threshold, so that the data center establishes a communication channel between the first live broadcast room and the user according to the location information of the first live broadcast room and the location information of the user, generates a channel number, and sends the channel number to the first live broadcast room and the user; so that the first live broadcast room sends the corresponding live broadcast data to the client of the user through the communication channel according to the live broadcast identifier, so that the client switches from the initial live broadcast room to the first live broadcast room and uses the live broadcast data for playback;
[0100] When the verification value is less than the verification threshold, a call instruction and the live broadcast identifier of the first live broadcast room are sent to the storage server; so that the storage server responds to the call instruction, calls the live broadcast data from the cache server according to the live broadcast identifier of the first live broadcast room, and sends it to the user's client, so that the client switches from the initial live broadcast room to the first live broadcast room and uses the live broadcast data for playback; wherein, the storage server communicates with the first live broadcast room in real time.
[0101] As a preferred solution, the live broadcast data includes transport stream data, and the playback module 104 uses the live broadcast data for playback, specifically:
[0102] The playing module 104 receives the transport stream data;
[0103] The transport stream data is segmented with a preset time period as a period to obtain each first data split data;
[0104] Repackaging each first data split stream data to obtain corresponding second data split stream data;
[0105] Determine a storage address of the second data offload data according to a preset rule, and store the second data offload data in the determined storage address;
[0106] Updating the storage address of the live segment in the preset path file to the storage address of the second data diversion data;
[0107] The preset path file is obtained, and according to the storage address of the second data diversion data in the preset path file, the live segment of the corresponding time in the transport stream data is obtained to realize the playback of the live data.
[0108] As a preferred solution, the identification group includes multiple verification identifications; each verification identification corresponds to each preset live broadcast room; the verification module 103 verifies the live broadcast identification of the identification group and the first live broadcast room to obtain a verification value, which is specifically:
[0109] The verification module 103 obtains a mapping relationship associated with the verification identifier from a preset mapping database;
[0110] According to the mapping relationship, a target polynomial is obtained, and then corresponding coded data is obtained according to the target polynomial; wherein the coded data is hexadecimal data;
[0111] Convert the live broadcast identifier of the first live broadcast room into hexadecimal data to be verified;
[0112] The data to be verified is taken as the dividend, and the encoded data is taken as the divisor. A division operation is performed on the data to be verified and the encoded data, and the obtained remainder is encrypted using the MD5 algorithm to generate a check value.
[0113] As a preferred solution, the data acquisition instruction includes a positioning instruction and a data conversion instruction, and the positioning instruction is a heartbeat signal sent by the user to the live broadcast server;
[0114] The second acquisition module 102 acquires the location information and the live broadcast identifier of the first live broadcast room according to the data acquisition instruction, specifically:
[0115] The second acquisition module 102 responds to the heartbeat signal and acquires the longitude information and latitude information of the first live broadcast room according to the heartbeat interval of the heartbeat signal;
[0116] In response to the data conversion instruction, obtaining the live broadcast number of the first live broadcast room;
[0117] Acquire corresponding timestamp information according to the live broadcast number, and then acquire the live broadcast record of the first live broadcast room based on the timestamp information;
[0118] Generate a live broadcast identifier of the first live broadcast room according to the time information of each live broadcast session in the live broadcast record.
[0119] As a preferred solution, the playback module 104 calls the live broadcast data from the cache server according to the live broadcast identifier of the first live broadcast room, specifically:
[0120] The playback module 104 sends data call requests to a plurality of cache servers according to the priority from high to low; wherein the storage server and the plurality of cache servers belong to the same pre-built tree topology structure; the storage server is the root node of the tree topology structure, and the cache server is the child node of the tree topology structure; the priority of the cache server is measured by the central server outside the tree topology structure by traversing and accessing the cache server;
[0121] So that the cache server responds to the data call request in order from high to low priority and determines the corresponding source data; when the cache server detects that the source data exists locally, it obtains the source data locally and forwards it to the storage server, so that the storage server obtains the live broadcast data.
[0122] As a preferred solution, the storage server is connected to each cache server via Ethernet; cache servers with a priority in the first interval are connected via Ethernet, and cache servers with a priority in the second interval are connected via a wide area network; the first interval and the second interval are both pre-set intervals.
[0123] Compared with the prior art, the embodiments of the present invention have the following beneficial effects:
[0124] The embodiment of the present invention provides a method and system for processing video live broadcast data, which is applied to a live broadcast server. The method for processing video live broadcast data includes: when a user's request to enter a first live broadcast room is detected, responding to the user's data acquisition instruction to obtain the user's device identification; obtaining the user's location information according to the device identification; obtaining the location information and live broadcast identification of the first live broadcast room according to the data acquisition instruction; querying the corresponding identification group according to the device identification, and verifying the identification group and the live broadcast identification of the first live broadcast room to obtain a verification value; when the verification value is greater than or equal to a preset verification threshold, sending the location information of the first live broadcast room, the live broadcast identification and the location information of the user to a data center, so that the data center establishes the first live broadcast room according to the location information of the first live broadcast room and the location information of the user A communication channel between the live broadcast room and the user, and generates a channel number, and sends the channel number to the first live broadcast room and the user; so that the first live broadcast room sends the corresponding live broadcast data to the user's client through the communication channel according to the live broadcast identifier, so that the client switches from the initial live broadcast room to the first live broadcast room and uses the live broadcast data for playback; when the verification value is less than the verification threshold, a call instruction and the live broadcast identifier of the first live broadcast room are sent to the storage server; so that the storage server responds to the call instruction, calls the live broadcast data from the cache server according to the live broadcast identifier of the first live broadcast room, and sends it to the user's client, so that the client switches from the initial live broadcast room to the first live broadcast room and uses the live broadcast data for playback; wherein the storage server communicates with the first live broadcast room in real time. In implementing the embodiments of the present invention, when the check value is greater than or equal to a preset check threshold, a communication channel is established between the first live broadcast room and the user through the data center, so that the live broadcast data is called and transmitted through the communication channel, which can ensure the live broadcast quality and stability when the user watches the first live broadcast room, and reduce the occurrence of live broadcast freezes or unsmoothness with the help of the dedicated communication channel; when the check value is less than the above-mentioned check threshold, a call instruction and a live broadcast identifier of the live broadcast room are sent to the storage server, and the storage server calls the live broadcast data from the cache server according to the identifier. Compared with the technology of storing, calling and responding data on the same server in the prior art, different servers can complete their respective links, and can effectively respond to high-concurrency live broadcast data calls, reduce the hardware performance degradation of the server equipment, further improve the stability of the live broadcast, and effectively improve the user experience.
[0125] The specific embodiments described above further illustrate the purpose, technical solutions and beneficial effects of the present invention. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. It is particularly pointed out that for those skilled in the art, any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention should be included in the scope of protection of the present invention.
Claims
1. A method for processing live video data. It is characterized in that Applied to a live broadcast server, the video live broadcast data processing method includes: When detecting a request from a user to enter the first live broadcast room, responding to a data acquisition instruction of the user and acquiring a device identifier of the user; Acquire the location information of the user according to the device identifier; acquire the location information and the live broadcast identifier of the first live broadcast room according to the data acquisition instruction; According to the device identifier, query the corresponding identifier group, and verify the identifier group and the live broadcast identifier of the first live broadcast room to obtain a verification value; When the check value is greater than or equal to a preset check threshold, the location information of the first live broadcast room, the live broadcast identification and the location information of the user are sent to the data center, so that the data center establishes a communication channel between the first live broadcast room and the user according to the location information of the first live broadcast room and the location information of the user, generates a channel number, and sends the channel number to the first live broadcast room and the user; so that the first live broadcast room sends the corresponding live broadcast data to the client of the user through the communication channel according to the live broadcast identification, so that the client switches from the initial live broadcast room to the first live broadcast room and uses the live broadcast data for playback; When the verification value is less than the verification threshold, a call instruction and the live broadcast identifier of the first live broadcast room are sent to the storage server; so that the storage server responds to the call instruction, calls the live broadcast data from the cache server according to the live broadcast identifier of the first live broadcast room, and sends it to the user's client, so that the client switches from the initial live broadcast room to the first live broadcast room and uses the live broadcast data for playback; wherein, the storage server communicates with the first live broadcast room in real time.
2. A method for processing live video data according to claim 1, It is characterized in that The identification group includes a plurality of verification identifications; each verification identification corresponds to each preset live broadcast room; the verification of the identification group and the live broadcast identification of the first live broadcast room to obtain a verification value is specifically: Acquire a mapping relationship associated with the verification identifier from a preset mapping database; According to the mapping relationship, a target polynomial is obtained, and then corresponding coded data is obtained according to the target polynomial; wherein the coded data is hexadecimal data; Convert the live broadcast identifier of the first live broadcast room into hexadecimal data to be verified; The data to be verified is taken as the dividend, and the encoded data is taken as the divisor. A division operation is performed on the data to be verified and the encoded data, and the obtained remainder is encrypted using the MD5 algorithm to generate a check value.
3. A method for processing live video data according to claim 1, It is characterized in that The data acquisition instruction includes a positioning instruction and a data conversion instruction, and the positioning instruction is a heartbeat signal sent by the user to the live broadcast server; The step of obtaining the location information and the live broadcast identifier of the first live broadcast room according to the data acquisition instruction is specifically as follows: In response to the heartbeat signal, obtaining the longitude information and latitude information of the first live broadcast room according to the heartbeat interval of the heartbeat signal; In response to the data conversion instruction, obtaining the live broadcast number of the first live broadcast room; Acquire corresponding timestamp information according to the live broadcast number, and then acquire the live broadcast record of the first live broadcast room based on the timestamp information; Generate a live broadcast identifier of the first live broadcast room according to the time information of each live broadcast session in the live broadcast record.
4. A method for processing live video data according to claim 1, It is characterized in that The calling of the live broadcast data from the cache server according to the live broadcast identifier of the first live broadcast room is specifically: Sending data call requests to a plurality of cache servers according to priorities from high to low; wherein the storage server and the plurality of cache servers belong to the same pre-built tree topology structure; the storage server is a root node of the tree topology structure, and the cache server is a child node of the tree topology structure; the priority of the cache server is measured by a central server outside the tree topology structure by traversing and accessing the cache servers; So that the cache server responds to the data call request in order from high to low priority and determines the corresponding source data; when the cache server detects that the source data exists locally, it obtains the source data locally and forwards it to the storage server, so that the storage server obtains the live broadcast data.
5. A method for processing live video data as claimed in claim 4, It is characterized in that The storage server is connected to each cache server via Ethernet; cache servers with a first priority range are connected via Ethernet, and cache servers with a second priority range are connected via a wide area network; the first range and the second range are both pre-set ranges.
6. A video live broadcast data processing system, It is characterized in that Applied to a live broadcast server, the video live broadcast data processing system includes a first acquisition module, a second acquisition module, a verification module and a playback module; wherein, The first acquisition module is used to respond to the data acquisition instruction of the user and acquire the device identification of the user when detecting the user's request to enter the first live broadcast room; The second acquisition module is used to acquire the location information of the user according to the device identifier; and acquire the location information and the live broadcast identifier of the first live broadcast room according to the data acquisition instruction; The verification module is used to query the corresponding identification group according to the device identification, and verify the identification group and the live broadcast identification of the first live broadcast room to obtain a verification value; The playback module is used to send the location information of the first live broadcast room, the live broadcast identification and the location information of the user to the data center when the check value is greater than or equal to a preset check threshold, so that the data center establishes a communication channel between the first live broadcast room and the user according to the location information of the first live broadcast room and the location information of the user, generates a channel number, and sends the channel number to the first live broadcast room and the user; so that the first live broadcast room sends the corresponding live broadcast data to the client of the user through the communication channel according to the live broadcast identification, so that the client switches from the initial live broadcast room to the first live broadcast room and uses the live broadcast data for playback; When the verification value is less than the verification threshold, a call instruction and the live broadcast identifier of the first live broadcast room are sent to the storage server; so that the storage server responds to the call instruction, calls the live broadcast data from the cache server according to the live broadcast identifier of the first live broadcast room, and sends it to the user's client, so that the client switches from the initial live broadcast room to the first live broadcast room and uses the live broadcast data for playback; wherein, the storage server communicates with the first live broadcast room in real time.
7. A live video data processing system as claimed in claim 6, It is characterized in that The identification group includes a plurality of verification identifications; each verification identification corresponds to each preset live broadcast room; the verification module verifies the live broadcast identification of the identification group and the first live broadcast room to obtain a verification value, which is specifically: The verification module obtains a mapping relationship associated with the verification identifier from a preset mapping database; According to the mapping relationship, a target polynomial is obtained, and then corresponding coded data is obtained according to the target polynomial; wherein the coded data is hexadecimal data; Convert the live broadcast identifier of the first live broadcast room into hexadecimal data to be verified; The data to be verified is taken as the dividend, and the encoded data is taken as the divisor. A division operation is performed on the data to be verified and the encoded data, and the obtained remainder is encrypted using the MD5 algorithm to generate a check value.
8. A live video data processing system as claimed in claim 6, It is characterized in that The data acquisition instruction includes a positioning instruction and a data conversion instruction, and the positioning instruction is a heartbeat signal sent by the user to the live broadcast server; The second acquisition module acquires the location information and the live broadcast identifier of the first live broadcast room according to the data acquisition instruction, specifically: The second acquisition module responds to the heartbeat signal and acquires the longitude information and latitude information of the first live broadcast room according to the heartbeat interval of the heartbeat signal; In response to the data conversion instruction, obtaining the live broadcast number of the first live broadcast room; Acquire corresponding timestamp information according to the live broadcast number, and then acquire the live broadcast record of the first live broadcast room based on the timestamp information; Generate a live broadcast identifier of the first live broadcast room according to the time information of each live broadcast session in the live broadcast record.
9. A live video data processing system as claimed in claim 6, It is characterized in that The playback module calls the live broadcast data from the cache server according to the live broadcast identifier of the first live broadcast room, specifically: The playback module sends data call requests to a plurality of cache servers according to the priority from high to low; wherein the storage server and the plurality of cache servers belong to the same pre-built tree topology structure; the storage server is the root node of the tree topology structure, and the cache server is the child node of the tree topology structure; the priority of the cache server is measured by a central server outside the tree topology structure by traversing and accessing the cache server; So that the cache server responds to the data call request in order from high to low priority and determines the corresponding source data; when the cache server detects that the source data exists locally, it obtains the source data locally and forwards it to the storage server, so that the storage server obtains the live broadcast data.
10. A live video data processing system as claimed in claim 9, It is characterized in that The storage server is connected to each cache server via Ethernet; cache servers with a first priority range are connected via Ethernet, and cache servers with a second priority range are connected via a wide area network; the first range and the second range are both pre-set ranges.
Citation Information
Patent Citations
Data live broadcast system and method
CN104301741A
Method for detecting popularity value of direct broadcasting room, client and computer device
CN108174250A
