A method, device, system, equipment and medium for live data transmission
Through the dual-stream transmission channel mechanism, the combination of reliable and unreliable streams solves the playback problem caused by network delay in live data transmission and improves the user experience of the live broadcast client.
Patent Information
- Application Number
- CN202210515125.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-11
- Publication Date
- 2024-09-03
- Estimated Expiration
- 2042-05-11
AI Technical Summary
In live broadcast application scenarios, reliable transmission protocols based on TCP or QUIC protocols cause network transmission delays, affecting the live broadcast screen playback effect and reducing user experience.
A dual-stream transmission channel mechanism is adopted to transmit live playback requests and response information through a reliable first-stream transmission channel, and transmit live data frames through an unreliable second-stream transmission channel to avoid data packet loss and delay problems caused by network delays.
It improves the playback fluency and user experience of live broadcast data, and avoids the problems of live screen freezes and delays caused by network delays.
Smart Images

Figure CN114979793B
Abstract
Description
Technical Field
[0001] The embodiments of the present disclosure relate to Internet technologies, and more particularly to a method, apparatus, system, device and medium for transmitting live data. Background Art
[0002] In the live broadcast application scenario, the server needs to transmit the live broadcast data to the live broadcast client. Generally, the transmission of live broadcast data depends on the transmission protocol of the transport layer. Using different transmission protocols is equivalent to using different data transmission methods to transmit live broadcast data. At present, the transmission protocols that can be used for live broadcast data transmission at the transport layer include TCP (Transmission Control Protocol) protocol or QUIC (Quick UDP Internet Connection) protocol.
[0003] Among them, TCP-based transmission is reliable transmission, and the QUIC protocol is also reliable transmission in essence. When the live data stream is transmitted reliably through the above protocol, the live client will be affected by the network transmission delay and the live screen playback will be affected, thereby affecting the playback effect of the live data and reducing the user experience of the live client. Summary of the invention
[0004] The embodiments of the present disclosure provide a method, apparatus, system, device and medium for transmitting live data, so as to realize unreliable transmission of live data, ensure the playback effect of live data and improve user experience.
[0005] In a first aspect, an embodiment of the present disclosure provides a live data transmission method, which is applied to a live server, comprising:
[0006] Receiving a live broadcast request sent by a live broadcast client, and determining a live broadcast data stream matching the live broadcast request, wherein the live broadcast request is transmitted through a first stream transmission channel of a reliable type established by the live broadcast client;
[0007] Creating a second stream transmission channel of an unreliable type and associating it with the first stream transmission channel;
[0008] Sending the response information of the live broadcast request and the key information of the live broadcast data frame in the live broadcast data stream to the live broadcast client through the first stream transmission channel;
[0009] Each live data frame in the live data stream is sent to the live client through the second stream transmission channel.
[0010] In a second aspect, the embodiment of the present disclosure further provides a live data transmission method, which is applied to a live client, comprising:
[0011] Sending a live broadcast request to the live broadcast server through the established reliable first stream transmission channel;
[0012] Receiving a data packet sent by the live broadcast server through the first stream transmission channel and the second stream transmission channel in response to the live broadcast request, wherein the second stream transmission channel is an unreliable stream transmission channel created by the live broadcast server;
[0013] By analyzing the data packets received from the first stream transmission channel and the second stream transmission channel, the live broadcast data to be played that matches the live broadcast request is determined.
[0014] In a third aspect, the embodiment of the present disclosure further provides a live data transmission device, which is integrated in a live server, including:
[0015] A request receiving module, used for receiving a live broadcast request sent by a live broadcast client, and determining a live broadcast data stream matching the live broadcast request, wherein the live broadcast request is transmitted through a first stream transmission channel of a reliable type established by the live broadcast client;
[0016] A channel creation module, used to create an unreliable second stream transmission channel and associate it with the first stream transmission channel;
[0017] An information sending module, used for sending the response information of the live broadcast request and the key information of the live data frame in the live data stream to the live broadcast client through the first stream transmission channel;
[0018] The data frame sending module is used to send each live data frame in the live data stream to the live client through the second stream transmission channel.
[0019] In a fourth aspect, the embodiments of the present disclosure further provide a live data transmission device, which is integrated in a live client, and includes:
[0020] A request sending module, used for sending a live broadcast request to a live broadcast server through the established reliable first stream transmission channel;
[0021] A data packet receiving module, used for receiving data packets sent by the live broadcast server through the first stream transmission channel and the second stream transmission channel in response to the live broadcast request, wherein the second stream transmission channel is an unreliable stream transmission channel created by the live broadcast server;
[0022] The live broadcast data determination module is used to determine the live broadcast data to be played that matches the live broadcast request by analyzing the data packets received from the first stream transmission channel and the second stream transmission channel.
[0023] In a fifth aspect, the embodiments of the present disclosure further provide a live broadcast data transmission system, the system comprising: a live broadcast server and a live broadcast client;
[0024] Wherein, the live broadcast server is used to implement the live broadcast data transmission method provided in the first aspect;
[0025] The live broadcast client is used to implement the live broadcast data transmission method provided in the second aspect.
[0026] In a sixth aspect, an embodiment of the present disclosure further provides an electronic device, the electronic device comprising:
[0027] one or more processors;
[0028] A memory for storing one or more programs;
[0029] When the one or more programs are executed by the one or more processors, the one or more processors implement the live data transmission method provided by any embodiment of the present disclosure.
[0030] In a seventh aspect, an embodiment of the present disclosure further provides a computer-readable storage medium on which a computer program is stored, and when the program is executed by a processor, a live data transmission method as provided in any embodiment of the present disclosure is implemented.
[0031] The live broadcast server in the disclosed embodiment receives a live broadcast request sent by a live broadcast client, determines a live broadcast data stream that matches the live broadcast request, and the live broadcast request is transmitted through a reliable first stream transmission channel established by the live broadcast client. Then the live broadcast server creates an unreliable second stream transmission channel and establishes an association with the first stream transmission channel. The live broadcast server sends the response information of the live broadcast request and the key information of the live data frame in the live data stream to the live broadcast client through the first stream transmission channel; and sends each live data frame in the live data stream to the live broadcast client through the second stream transmission channel. The above technical solution, based on the unreliable second stream transmission channel created by the live broadcast server, can realize the unreliable transmission of the live broadcast data frame, avoid the impact of network transmission delay on the live screen playback, ensure the playback effect of the live data, and improve the user experience of the live broadcast client. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the accompanying drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and the originals and elements are not necessarily drawn to scale.
[0033] Figure 1is a flow chart of a live broadcast data transmission method provided by Embodiment 1 of the present disclosure;
[0034] Figure 2 is a flow chart of a live broadcast data transmission method provided by Embodiment 2 of the present disclosure;
[0035] Figure 3 This is an example diagram of a live data transmission process involved in the second embodiment of the present disclosure;
[0036] Figure 4 is a flow chart of a live data transmission method provided by Embodiment 3 of the present disclosure;
[0037] Figure 5 is a flow chart of a live data transmission method provided by Embodiment 4 of the present disclosure;
[0038] Figure 6 This is an example diagram of cache offset pointer movement involved in the fourth embodiment of the present disclosure;
[0039] Figure 7 It is a structural diagram of a live broadcast data transmission device provided in Embodiment 5 of the present disclosure;
[0040] Figure 8 It is a structural diagram of a live broadcast data transmission device provided by Embodiment 6 of the present disclosure;
[0041] Fig. 9 It is a structural diagram of a live broadcast data transmission system provided by Embodiment 7 of the present disclosure;
[0042] Fig.10 It is a structural diagram of an electronic device provided in Embodiment 8 of the present disclosure. DETAILED DESCRIPTION
[0043] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.
[0044] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.
[0045] The term "including" and its variations used herein are open inclusions, i.e., "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description.
[0046] It should be noted that the concepts such as "first" and "second" mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.
[0047] It should be noted that the modifications of "one" and "plurality" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".
[0048] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.
[0049] Embodiment 1
[0050] Figure 1 This is a flowchart of a live data transmission method provided in the first embodiment of the present disclosure. This embodiment can be applied to the case where live data is transmitted through an unreliable streaming channel to ensure the live data playback effect. The method can be executed by a live data transmission device, which can be implemented by software and / or hardware and integrated into a live server. Figure 1 As shown, the method specifically comprises the following steps:
[0051] S110: Receive a live broadcast request sent by a live broadcast client, and determine a live broadcast data stream that matches the live broadcast request.
[0052] The live broadcast request is transmitted through a reliable first stream transmission channel established by the live broadcast client.
[0053] It is clear that with the development of Internet technology and smart mobile terminal devices, live broadcasting is a popular form of entertainment and learning, which can bring people a more real-time social experience. Live broadcasting is a way of publishing information on the development of events on the spot, which is a two-way flow process. For a better user experience, it is necessary to ensure that there is no delay in the live broadcast screen.
[0054] In the live broadcast scene, it generally includes a live broadcast client, a live broadcast server, and an anchor client. Among them, the live broadcast client refers to the client used by the audience user, and the audience user refers to the user who watches the live broadcast content of the anchor user; the anchor client refers to the client used by the anchor user, and the anchor user refers to the user who broadcasts the live broadcast content; the live broadcast server refers to the server that provides information interaction services between the live broadcast client and the anchor client. The client may include but is not limited to: terminal devices such as smart phones, tablet computers, laptops, and desktop computers, or APPs (applications) with live broadcast functions running in terminal devices. The anchor client can upload the live broadcast content of the anchor user to the live broadcast server in real time, and the live broadcast server sends the live broadcast content to the live broadcast client for display, so that the audience users can watch the live broadcast content of the anchor user in real time. This embodiment mainly describes the interaction between the live broadcast client and the live broadcast server.
[0055] Among them, when the user has a need to watch live broadcast, a live broadcast request is generated by operating the live broadcast client for the live broadcast viewing prompt information. The live broadcast request may include content such as the identifier of the data stream to be broadcasted, and the present embodiment does not specifically limit the composition form of the live broadcast request. For example, it may be a message containing the identifier of the data stream to be broadcasted. Before sending the live broadcast request, a connection should be established between the live broadcast client and the live broadcast server. The live broadcast client needs to first establish a stream transmission channel with the live broadcast server based on a preset transmission protocol to realize communication between the live broadcast client and the live broadcast server.
[0056] In this embodiment, the stream transmission channel includes a reliable stream transmission channel and an unreliable stream transmission channel. The reliable stream transmission channel can be understood as that after the receiving end receives a data packet sent by the sending end, it can send a confirmation message corresponding to the received packet to the sending end or send a confirmation frame, so that the sending end continues to send the next data packet after receiving the confirmation message or the confirmation frame, thereby ensuring that after the receiving end receives the data packet, the sending end continues to send the next data packet. In this step, the live broadcast client can be relatively regarded as the sending end, and the live broadcast server can be relatively regarded as the receiving end.
[0057] In this embodiment, the streaming transmission channel established by the live broadcast client is a reliable type of streaming data transmission channel, which is recorded as the first streaming transmission channel. Considering that the live broadcast request is a relatively critical information, it is necessary to know whether the live broadcast request is sent successfully, which can also be understood as the need to get a response from the live broadcast server. Therefore, the live broadcast request sent by the live broadcast client is transmitted through the reliable type of the first streaming transmission channel established by the live broadcast client.
[0058] It should be noted that the anchor client can upload the anchor user's live content to the live server in real time, that is, the live server needs to obtain the data stream from the anchor client. The live data stream refers to the continuous data stream required for continuous live broadcast, and the live data stream mainly includes audio and video data streams. Specifically, when the live client sends a live broadcast request through the first stream transmission channel, the live server receives the live broadcast request. The live server parses the live broadcast request and obtains the identifier of the data stream to be broadcast contained in the live broadcast request. It can be understood that the live server continuously obtains the live data stream from the anchor client, and each live data stream corresponds to a unique identifier. According to the parsed identifier of the data stream to be broadcast, the matching data stream identifier is queried from the live server, and the live data stream that matches the live broadcast request can be determined. The determined live data stream will be used as the object to be transmitted for subsequent transmission.
[0059] S120: Create a second stream transmission channel of an unreliable type and associate it with the first stream transmission channel.
[0060] Among them, the unreliable type of streaming transmission channel is relative to the reliable type of transmission channel. The unreliable type of transmission channel can be understood as after data is transmitted through the transmission channel, the receiving end does not need to send a corresponding confirmation to the sending end for the successfully received data, and it is allowed to abandon the retransmission of lost packet data and send the new data that has been generated. In this step, the live broadcast client can be relatively regarded as the sending end, and the live broadcast server can be relatively regarded as the receiving end. The unreliable type of streaming transmission channel can realize the unreliable transmission of data, thereby ensuring the real-time nature of the data.
[0061] In this step, the live broadcast server creates an unreliable type of stream transmission channel as the second stream transmission channel according to the preset transmission protocol. In order to ensure that the content related to the live broadcast request is transmitted through the first stream transmission channel and the second stream transmission channel corresponding to the live broadcast request, the second stream transmission channel needs to establish an association with the first stream transmission channel. The way to establish the association can be to bind the identifier of the first stream transmission channel with the identifier of the second stream transmission channel so that they have a one-to-one correspondence. In this way, when the identifier of one of the stream transmission channels is known, the other stream transmission channel associated with it can be determined. The identifier of the stream transmission channel can be understood as the unique identifier of the stream transmission channel, and the stream transmission channel and the identifier have a one-to-one correspondence.
[0062] Specifically, this step is performed after the above step S110, and the live broadcast server creates a second stream transmission channel of an unreliable type according to a preset transmission protocol, and establishes an association with the first stream transmission channel.
[0063] After executing step S110 and step S120, two stream transmission channels are established between the live broadcast client and the live broadcast server, including a first stream transmission channel and a second stream transmission channel, for interactive communication between the live broadcast client and the live broadcast server. Step S130 and step S140 will specifically introduce what information is transmitted through the first stream transmission channel and the second stream transmission channel respectively.
[0064] S130: Send the response information of the live broadcast request and the key information of the live data frame in the live broadcast data stream to the live broadcast client through the first stream transmission channel.
[0065] The response information of the live broadcast request indicates that the live broadcast server has received the response information generated by the live broadcast request sent by the live broadcast client. In this embodiment, the information to be sent by the live broadcast server to the live broadcast client is transmitted through the two stream transmission channels created in the above steps respectively, wherein the response information of the live broadcast request is sent to the live broadcast client through the first stream transmission channel to inform the live broadcast client that the live broadcast server has successfully received the live broadcast request.
[0066] In this embodiment, the live data stream refers to the continuous data stream required for continuous live broadcasting, and the live data stream is composed of multiple live data frames, and each live data frame can be divided into one or more data packets. In this step, the information of the live data frame in the live data stream is divided into two parts, one of which is the key information of the live data frame, and the other is the audio and video data in the live data frame. Among them, the key information refers to the information that must be sent successfully without packet loss, such as header files and audio and video decoding key data.
[0067] In this embodiment, the key information of the live data frame in the live data stream is sent to the live client through the first stream transmission channel. The first stream transmission channel is a reliable stream transmission channel. By transmitting the key information through this channel, it can be ensured that the live server can continue to send the next data packet after the live client receives the data packet, thereby ensuring that no packet is lost.
[0068] It is understandable that in order to transmit the response information of the live broadcast request and the key information of the live data frame in the live data stream through the first stream transmission channel, the response information of the live broadcast request needs to be encapsulated in accordance with the reliable type message format of the preset transmission protocol to form a message, and the key information of the live data frame in the live data stream needs to be encapsulated in accordance with the reliable type message format of the preset transmission protocol to form a data packet. Preferably, the preset transmission protocol in this embodiment uses the QUIC protocol, which includes a reliable stream type and an unreliable stream type. The formed message and data packet are notified to the first stream transmission channel for transmission.
[0069] S140: Send each live data frame in the live data stream to the live client through the second stream transmission channel.
[0070] In the prior art, the communication between the live broadcast client and the live broadcast server is based on a reliable type of stream transmission channel. Each live broadcast data frame in the live broadcast data stream is transmitted through a reliable type of stream transmission channel in accordance with the reliable type message format of the preset transmission protocol. In this way, when the live broadcast client is receiving a data packet in a live broadcast data frame, if a data packet is lost and has not been received completely or the network speed is slow, the live broadcast client will always wait to receive the data packet to be received, and will not encapsulate the received frame data and upload it to the application layer, and will not form the live broadcast picture corresponding to this live broadcast data frame, resulting in the live broadcast picture staying on the picture corresponding to the previous live broadcast data frame, resulting in the phenomenon of live broadcast picture freeze and delay.
[0071] Considering that even if one or several live data frames are lost and not transmitted to the live client, it will not have a great impact on the final live picture. In this embodiment, each live data frame in the live data stream is sent to the live client through the second stream transmission channel. The second stream transmission channel is an unreliable stream transmission channel. When transmitting data packets through this channel, packet loss can be allowed. It is not necessary to ensure that the live client receives the data packet before the live server can continue to send the next data packet. It can also be understood that the live server can continuously send data packets without confirming whether the previous data packet is successfully received by the live client.
[0072] In this embodiment, if the live broadcast client fails to receive all the data packets of a live broadcast data frame within a set time, the frame will be discarded. This will prevent the screen from being delayed or stuck due to the inability to receive the next live broadcast data frame due to waiting for a certain data packet. Even if there is a delay in network transmission, the live broadcast screen playback will not be affected, ensuring the smooth playback of the live broadcast data.
[0073] It should be noted that there is no specific restriction on the execution order of step S130 and step S140. The information sent through the first stream transmission channel may reach the live broadcast client first, or the information sent through the second stream transmission channel may reach the live broadcast client first, or the information sent through the first stream transmission channel and the information sent through the second stream transmission channel may reach the live broadcast client at the same time.
[0074] In this embodiment, the live data stream can be understood as a data set containing several live data frames, and the live data frames are output in a flowing manner. The live data frame contains one or more data packets. The data packet can refer to the data sent by the live server to the live client each time, such as a QUIC packet.
[0075] Specifically, the live broadcast server can divide and pack each live broadcast data frame in the determined live broadcast data stream based on the preset data packet size and the size of each live broadcast data frame in the live broadcast data stream to obtain each data packet corresponding to the live broadcast data stream. If the size of a live broadcast data frame is larger than the preset data packet size, the live broadcast data frame can be packed into at least two data packets for transmission. The live broadcast server sends each data packet corresponding to the live broadcast data stream to the live broadcast client through the second stream transmission channel in sequence according to the order in which the data packets are packed.
[0076] According to the technical solution of the disclosed embodiment, the live broadcast server receives the live broadcast request sent by the live broadcast client, determines the live broadcast data stream that matches the live broadcast request, and the live broadcast request is transmitted through the first stream transmission channel of the reliable type established by the live broadcast client. Then the live broadcast server creates an unreliable second stream transmission channel and establishes an association with the first stream transmission channel. The live broadcast server sends the response information of the live broadcast request and the key information of the live data frame in the live data stream to the live broadcast client through the first stream transmission channel; and sends each live data frame in the live data stream to the live broadcast client through the second stream transmission channel. The above technical solution, based on the unreliable second stream transmission channel of the live broadcast server, can realize the unreliable transmission of the live broadcast data frame, avoid the impact of network transmission delay on the live screen playback, ensure the playback effect of the live data, and improve the user experience of the live broadcast client.
[0077] On the basis of the above technical solution, after creating a second stream transmission channel of an unreliable type associated with the first stream transmission channel, the method also includes: sending an association frame characterizing the association between the second stream transmission channel and the first stream transmission channel to the live broadcast client through the first stream transmission channel, so that the live broadcast client determines that there is an association between the first stream transmission channel and the second stream transmission channel through the association frame.
[0078] Specifically, in the above embodiment, in order to ensure that the content related to the live broadcast request is transmitted through the first stream transmission channel and the second stream transmission channel corresponding to the live broadcast request, the second stream transmission channel needs to be associated with the first stream transmission channel. Accordingly, after the live broadcast server creates a second transmission channel of an unreliable type associated with the first stream transmission channel, the association relationship established between the second stream transmission channel and the first stream transmission channel needs to be sent to the live broadcast client, so that the live broadcast client determines that the first stream transmission channel is associated with the second stream transmission channel through an association frame.
[0079] In this step, the association relationship between the first stream transmission channel and the second stream transmission channel can be represented in the form of an association frame. Among them, the association frame includes: the association mapping information of the stream transmission channel, and the association mapping information includes the channel identifiers of the first stream transmission channel and the second stream transmission channel respectively. It can be understood that the channel identifier can be used as the identity identifier of the stream transmission channel, and each stream transmission channel corresponds to a unique channel identifier. Specifically, the association frame representing the association between the second stream transmission channel and the first stream transmission channel is sent to the live broadcast client through the first stream transmission channel. In this way, the live broadcast client can ensure that the received data is synthesized for the same data frame based on the key frame.
[0080] By associating an unreliable stream transmission channel with a reliable stream transmission channel, it is determined which information transmitted through different stream transmission channels is for the same live data frame, so as to correctly determine the live data frame.
[0081] Embodiment 2
[0082] Figure 2 This is a flowchart of a live data transmission method provided in the second embodiment of the present disclosure. Based on the above embodiment one, this embodiment further optimizes "creating a second stream transmission channel of an unreliable type and establishing an association with the first stream transmission channel", "sending the response information of the live broadcast request and the key information of the live data frame in the live data stream to the live client through the first stream transmission channel", and "sending each live data frame in the live data stream to the live client through the second stream transmission channel". The explanations of the terms that are the same or corresponding to the above embodiments are not repeated here.
[0083] See also Figure 2 The live data transmission method provided in this embodiment specifically includes the following steps:
[0084] S210: Receive a live broadcast request sent by a live broadcast client, and determine a live broadcast data stream that matches the live broadcast request.
[0085] The live broadcast request is transmitted through a reliable first stream transmission channel established by the live broadcast client.
[0086] S220. Construct a stream transmission channel required for unreliable data stream transmission based on a preset transmission protocol, which is recorded as a second stream transmission channel.
[0087] Among them, the preset transmission protocol refers to the standard for transmitting information between the live broadcast client and the live broadcast server. Preferably, the preset transmission protocol in this embodiment selects the QUIC protocol. The QUIC protocol includes reliable stream types and unreliable stream types. The reliable stream type means that it is not allowed to abandon the retransmission of lost packet data, and only after the receiving end receives the complete data can the new data generated be sent. The unreliable stream type refers to a new stream type added to the QUIC protocol. An unreliable stream may mean that it is allowed to abandon the retransmission of lost packet data and send the new data that has been generated, thereby realizing unreliable transmission and ensuring the real-time nature of the data.
[0088] It can be known that, so far, in this embodiment, a first stream transmission channel and a second stream transmission channel are constructed between the live broadcast client and the live broadcast server, wherein the first stream transmission channel is used to transmit reliable type data stream, and the second stream transmission channel is used to transmit unreliable type data stream.
[0089] S230: Obtain a first channel identifier of a first stream transmission channel and a second channel identifier of a second stream transmission channel.
[0090] In this embodiment, after the first stream transmission channel and the second stream transmission channel are constructed, the first stream transmission channel and the second stream transmission channel need to be bound to indicate that the data sent through the two channels are related. It can be understood that the channel identifier can be used as the identity identifier of the stream transmission channel, and each stream transmission channel corresponds to a unique channel identifier. Specifically, the channel identifier of the first stream transmission channel is obtained, which is recorded as the first channel identifier; the channel identifier of the second stream transmission channel is obtained, which is recorded as the second channel identifier.
[0091] S240: Based on the first channel identifier and the second channel identifier, generate association mapping information representing an association relationship between the second stream transmission channel and the first stream transmission channel.
[0092] Specifically, after obtaining the first channel identifier and the second channel identifier, the first channel identifier and the second channel identifier can be bound, and a group of the first channel identifier and the second channel identifier have a one-to-one correspondence. When there are multiple groups of associated first stream transmission channels and second stream transmission channels, multiple association mapping information characterizing the association relationship between the second stream transmission channel and the first stream transmission channel will be formed. When the first channel identifier is known, the second channel identifier corresponding to the first channel identifier can be obtained by querying the association mapping information. Similarly, when the second channel identifier is known, the first channel identifier corresponding to the second channel identifier can be obtained by querying the association mapping information.
[0093] S250: encapsulate the response information of the live broadcast request according to the reliable type message format of the preset transmission protocol to form a response message, and send it to the live broadcast client through the first stream transmission channel.
[0094] It is understandable that the live broadcast request is sent from the live broadcast client to the live broadcast server through the first stream transmission channel, and the first stream transmission channel is a reliable type of transmission channel. After successfully receiving the live broadcast request, the live broadcast server needs to generate a response message of the live broadcast request. The response message of the live broadcast request indicates that the live broadcast server has successfully received the live broadcast request sent by the live broadcast client. Afterwards, the live broadcast server needs to encapsulate and send the response message of the live broadcast request to the live broadcast client to inform the live broadcast client that "the live broadcast server has successfully received the live broadcast request".
[0095] Similarly, whether the live broadcast request is successfully received by the live broadcast server needs to be informed to the live broadcast client, and the packet cannot be lost. Therefore, the response information of the live broadcast request is encapsulated according to the reliable type message format of the preset transmission protocol to form a response message. Preferably, the preset transmission protocol in this embodiment uses the QUIC protocol, and the QUIC protocol includes a reliable stream type and an unreliable stream type. In this step, the response information of the live broadcast request is encapsulated based on the reliable stream type. It is known that the first stream transmission channel is a reliable type channel, and the encapsulated response message is sent to the live broadcast client through the first stream transmission channel.
[0096] After completing the construction of the first stream transmission channel and the second stream transmission channel, and after the live broadcast server sends the response message of the live broadcast service request to the live broadcast client, the live broadcast server can send the relevant information of the live broadcast data stream to the live broadcast client through the two constructed stream transmission channels.
[0097] In the prior art, the live data frames in the live data stream are encapsulated in a reliable type message format to form a data packet, which is sent to the live client through a reliable type stream transmission channel. The live client then delivers the data packet corresponding to the received live data frame to the application layer. It should be noted that the timing for the live client to deliver to the application layer is when a complete live data frame is received, and then the live data frame will be delivered to the application layer. When the network transmission is delayed, it may cause data packet loss or transmission delay. Data packet transmission is only performed through a reliable type stream transmission channel. If the data packet is lost or the transmission is delayed, the live client will wait to receive the remaining data packets in the frame, and the live client cannot deliver the data frame to the application layer, resulting in the final live screen staying on the live screen corresponding to the previous live data frame, and the live interface will be delayed or stuck.
[0098] In view of this problem, the present embodiment separates the information of the live data frame in the live data stream, and transmits them through a reliable type of stream transmission channel and an unreliable type of stream transmission channel respectively. The first stream transmission channel is a reliable type of stream transmission channel, and the second stream transmission channel is an unreliable type of stream transmission channel. The live data frame is divided into two parts: the file header of the live data frame and the key information required for decoding are one part, and the audio and video data in the live data frame are one part. Considering that the file header of the live data frame and the key information required for decoding are very important information, data packet loss and the like cannot occur. Therefore, the file header of the live data frame and the key information required for decoding are encapsulated and transmitted through a reliable type of stream transmission channel, that is, transmitted through the first stream transmission channel. As for the audio and video data in the live data frame, even if one or several packets of data are lost, it will not affect the display of the final live interface. Therefore, the audio and video data of the live data frame are encapsulated and transmitted through an unreliable type of stream transmission channel, that is, transmitted through the second stream transmission channel.
[0099] The following steps S260-S270 are an introduction to encapsulating and transmitting the file header and key data required for decoding in the live data frame, and steps S280-S290 are an introduction to encapsulating and transmitting the audio and video data in the live data frame.
[0100] S260: For each live data frame in the live data stream, determine the file header of the live data frame and key data required for decoding.
[0101] It is understandable that in order to finally display the live screen, the information received by the client needs to be decoded to restore the original audio and video, so the key data required for decoding is very important. Specifically, the live data stream contains several live data frames. For each live data frame in the live data stream, it is necessary to first determine the file header of the data frame and the key data required for decoding.
[0102] S270: Encapsulate the file header and key data according to a reliable type message format to form a key information data packet relative to the live broadcast data frame, and send it to the live broadcast client through the first stream transmission channel.
[0103] Specifically, the file header and key data are encapsulated in a reliable type message format to form a key information data packet relative to the live data frame. The live broadcast server can divide and pack the data of each live data frame in the live data stream based on the preset data packet size and the size of each live data frame in the live data stream to obtain each key information data packet corresponding to the live data stream. If the size of a live data frame is larger than the preset data packet size, the live data frame can be packed into at least two key information data packets for transmission. The live broadcast server sends each key information data packet corresponding to the live data stream to the live broadcast client in sequence according to the order in which the key information data packets are packed.
[0104] S280: For each live data frame in the live data stream, encapsulate the audio and video data in the live data frame according to an unreliable type message format of a preset transmission protocol to form at least one live data packet.
[0105] Similarly, the live broadcast server can divide and package each live broadcast data frame in the live broadcast data stream based on the preset data packet size and the size of each live broadcast data frame in the live broadcast data stream to obtain each live broadcast data packet corresponding to the live broadcast data stream. If the size of a live broadcast data frame is larger than the preset data packet size, the live broadcast data frame can be packaged into at least two live broadcast data packets for transmission.
[0106] S290. Send each live broadcast data packet to the live broadcast client through the second stream transmission channel.
[0107] Specifically, the live broadcast server sends each live broadcast data packet corresponding to the live broadcast data stream to the live broadcast client in sequence according to the order in which the live broadcast data packets are packaged.
[0108] The technical solution of this embodiment is that the live broadcast server receives the live broadcast request sent by the live broadcast client, determines the live broadcast data stream that matches the live broadcast request, and then constructs the stream transmission channel required for the transmission of the unreliable type of data stream based on the preset transmission protocol, which is recorded as the second stream transmission channel; and associates the second stream transmission channel with the first stream transmission channel to form a mapping relationship; the live broadcast server divides the content of each live data frame in the live data stream into the file header of the live data frame and the key data required for decoding, and the audio and video data of the live data frame. These two parts of data are encapsulated separately, and the encapsulated results are transmitted to the live broadcast client through the first stream transmission channel and the second stream transmission channel respectively. The above technical solution adds an unreliable second stream transmission channel, which can realize the unreliable transmission of audio and video data in the live data frame, avoid the loss of audio and video data packets due to network transmission delays, and affect the live screen playback, ensure the playback effect of the live data, and improve the user experience of the live broadcast client.
[0109] On the basis of the above technical solution, the method also includes, during the process of sending each live data frame in the live data stream to the live client through the second stream transmission channel: determining the expiration time of the live data frame for each live data frame in the live data stream, and when there is a retransmission operation of the data packet related to the live data frame, executing the discard processing logic of the live data frame according to the expiration time.
[0110] The expiration time of the live data frame can be used as a time reference for discarding the data packet if the data packet cannot be received. The expiration time can be set according to user needs. For example, assuming that the time for the data packet to be sent from the live server to the live client is T, the expiration time of the live data frame can be set to 5T.
[0111] Specifically, for each live data frame in the live data stream, the expiration time of the live data frame is determined. If a data packet is lost during the transmission process, the live server will retransmit the relevant data packet. If the lost data packet is not received after the retransmission operation execution time exceeds the expiration time, the incomplete live data frame can be discarded.
[0112] Furthermore, when there is a retransmission operation of a data packet related to a live data frame, the discard processing logic of the live data frame is executed according to the expiration time, including:
[0113] a) If it is determined that the live data packet related to the live data frame is lost during the transmission process, the related live data packet is resent through the second stream transmission channel, and the retransmission timer is started when the data packet retransmission of the live data frame occurs for the first time.
[0114] Among them, the method of determining that the relevant live data packet of the live data frame is lost during the transmission process can be: determining that the live client does not receive the data packet within the time when the data packet is normally sent from the live server to the live client, then it can be determined that the data packet is lost during the transmission process.
[0115] Specifically, if it is determined that a live data packet of a live data frame is lost during transmission, the relevant live data packet is resent through the second stream transmission channel, and the live data packet can be understood as a lost data packet. In addition, when the data packet of the live data frame is retransmitted for the first time, the retransmission timer is started to determine the retransmission duration.
[0116] b) If the accumulated duration of the retransmission timing exceeds the expiration duration, an expiration information data packet relative to the live broadcast data frame is formed and sent to the live broadcast client, so that the live broadcast client discards the relevant data of the live broadcast data frame from the data cache list.
[0117] Specifically, if the accumulated duration of the retransmission timing exceeds the expiration duration, the live broadcast client may be notified to discard the relevant data of the live broadcast data frame with packet loss so as to transmit the next live broadcast data frame. The method of notifying the live broadcast client to discard the relevant data of the live broadcast data frame may be that the live broadcast server forms an expiration information data packet relative to the live broadcast data frame and sends it to the live broadcast client.
[0118] For example, Figure 3 This is an example diagram of a live data transmission process involved in the second embodiment of the present disclosure, such as Figure 3 As shown, 1. The live broadcast client and the live broadcast server establish a connection normally, and the live broadcast client creates a reliable first stream transmission channel named "rs"; 2. The live broadcast client sends a live broadcast request to the live broadcast server through the first stream transmission channel rs; 3. After receiving the request, the live broadcast server determines the live broadcast data stream that matches the live broadcast request, and creates an unreliable second stream transmission channel named "us" associated with the first stream transmission channel; 4. The live broadcast server transmits an association frame representing the association between the second stream transmission channel and the first stream transmission channel to the live broadcast client through the first stream transmission channel rs, and notifies the live broadcast client to associate us with rs; 5. The live broadcast server returns the response information of the live broadcast request, the file header of the live data frame, and the key data required for decoding to the live broadcast client through the first stream transmission channel rs; 6. The live broadcast server sends audio and video data to the live broadcast client through the second stream transmission channel us.
[0119] This optional embodiment, in the process of sending each live data frame in the live data stream to the live client through the second stream transmission channel, also includes: for each live data frame in the live data stream, determining the expiration time of the live data frame, and when there is a retransmission operation of the data packet related to the live data frame, executing the discard processing logic of the live data frame according to the expiration time. In the prior art, the head of the data stream list of the cached streaming data will be blocked when the network quality is poor, and the head of the line blocking will cause a significant delay in the live picture. The picture / voice in the latest live data may have been cached in the data stream list of the live client, but it cannot be played normally, thereby affecting the playback effect of the live data and reducing the user experience of the live client. The technical solution of this optional embodiment ensures the normal playback of the live broadcast by discarding the live data frame corresponding to the packet loss.
[0120] Embodiment 3
[0121] Figure 4This is a flowchart of a live data transmission method provided in Embodiment 3 of the present disclosure. This embodiment can be applied to the case where live data is transmitted via an unreliable streaming channel to ensure the live data playback effect. The method can be executed by a live data transmission device, which can be implemented by software and / or hardware and integrated into a live client. Figure 4 As shown, the method specifically comprises the following steps:
[0122] S310: Send a live broadcast request to a live broadcast server through the established reliable first stream transmission channel.
[0123] Among them, when the user has a need to watch live broadcast, a live broadcast request is generated by operating the live broadcast client for the live broadcast viewing prompt information. The live broadcast request may include content such as the identifier of the data stream to be broadcasted, and the present embodiment does not specifically limit the composition form of the live broadcast request. For example, it may be a message containing the identifier of the data stream to be broadcasted. Before sending the live broadcast request, a connection should be established between the live broadcast client and the live broadcast server. The live broadcast client needs to first establish a stream transmission channel with the live broadcast server based on a preset transmission protocol to realize communication between the live broadcast client and the live broadcast server.
[0124] Specifically, the live broadcast client establishes a reliable first stream transmission channel so that the live broadcast client and the live broadcast server can establish a normal connection. The live broadcast client sends a live broadcast request to the live broadcast server through the first stream transmission channel.
[0125] S320, receiving data packets sent by the live broadcast server via the first stream transmission channel and the second stream transmission channel in response to the live broadcast request.
[0126] In this embodiment, the second stream transmission channel is an unreliable stream transmission channel created by the live broadcast server. It is clear that after receiving the live broadcast request, the live broadcast server creates an unreliable second stream transmission channel.
[0127] Among them, the data packets received through the first stream transmission channel are: a response message relative to the live broadcast request, a key information data packet of the live broadcast data frame in the live broadcast data stream matched by the live broadcast request, and an association frame representing the association relationship between the first stream transmission channel and the second stream transmission channel; the data packets received through the second stream transmission channel are: a live broadcast data packet of the live broadcast data frame in the live broadcast data stream matched by the live broadcast request, and the live broadcast data packet contains audio and video data of the live broadcast data frame.
[0128] In this step, the process of determining and sending the data packet can refer to the relevant description in the above embodiment 1, which will not be repeated here.
[0129] S330: Determine the live broadcast data to be played that matches the live broadcast request by analyzing the data packets received from the first stream transmission channel and the second stream transmission channel.
[0130] Specifically, a response message to the live broadcast request, a key information data packet of the live data frame in the live data stream matched by the live broadcast request, and an associated frame representing the association relationship between the first stream transmission channel and the second stream transmission channel are received from the first stream transmission channel. Through the response message to the live broadcast request, the live broadcast client can learn that the live broadcast server has successfully received the live broadcast request. By decapsulating the key information data packet, the file header of the live data frame and the key data required for decoding can be obtained. By decapsulating the associated frame, the association relationship between the first stream transmission channel and the second stream transmission channel can be obtained, and the data packet received by the corresponding second stream transmission channel can be determined as associated data according to the recorded identifier of the second stream transmission channel corresponding to the identifier of the first stream transmission channel.
[0131] A live data packet of a live data frame in a live data stream matching the live broadcast request is received from the second stream transmission channel, and the live data packet contains audio and video data of the live data frame. The audio and video data can be obtained by analyzing the live data packet, that is, decapsulating it.
[0132] After the data packet received from the first stream transmission channel is a response message of the live broadcast request, the subsequent operation is determined by analyzing the sequence of the key information data packet of the live broadcast data frame associated with the live broadcast request received from the first stream transmission channel, the association frame representing the association between the second stream transmission channel and the first stream transmission channel received from the first stream transmission channel, and the live data packet of the live broadcast data frame in the live broadcast data stream matched with the live broadcast request received from the second stream transmission channel. It can be understood that the sequence of the key information data packet of the live broadcast data frame and the association frame representing the association relationship between the first stream transmission channel and the second stream transmission channel arriving at the live broadcast client is not specifically limited, but only after both of them reach the live broadcast client, can the data (i.e., audio and video data) transmitted from the unreliable transmission channel be processed.
[0133] If the processing conditions are met, the live data frame can be delivered to the application layer based on the transmitted data. If the processing conditions are not met, the transmitted data can be cached for backup.
[0134] According to the technical solution of the embodiment of the present disclosure, the live broadcast client sends a live broadcast request to the live broadcast server through the established reliable first stream transmission channel. The live broadcast server receives the live broadcast request sent by the live broadcast client and determines the live broadcast data stream that matches the live broadcast request. Then the live broadcast server creates an unreliable second stream transmission channel and establishes an association with the first stream transmission channel. The live broadcast server sends the response information of the live broadcast request and the key information of the live broadcast data frame in the live broadcast data stream to the live broadcast client through the first stream transmission channel; sends each live broadcast data frame in the live broadcast data stream to the live broadcast client through the second stream transmission channel. The live broadcast client determines the live broadcast data to be played that matches the live broadcast request by analyzing the data packets received from the first stream transmission channel and the second stream transmission channel. The above technical solution, based on the live broadcast server creating an unreliable second stream transmission channel, can realize the unreliable transmission of the live broadcast data frame, avoid the impact of network transmission delay on the live screen playback, ensure the playback effect of the live data, and improve the user experience of the live broadcast client.
[0135] Embodiment 4
[0136] Figure 5 This is a flowchart of a live data transmission method provided in the fourth embodiment of the present disclosure. Based on the above third embodiment, this embodiment further optimizes the step of "determining the live data to be played that matches the live broadcast request by analyzing the data packets received from the first stream transmission channel and the second stream transmission channel". The explanations of the terms that are the same or corresponding to the above embodiments are not repeated here.
[0137] See also Figure 5 The data transmission method provided in this embodiment specifically includes the following steps:
[0138] S410: Send a live broadcast request to a live broadcast server through the established reliable first stream transmission channel.
[0139] S420: Receive a data packet sent by the live broadcast server via the first stream transmission channel and the second stream transmission channel in response to the live broadcast request.
[0140] The second stream transmission channel is an unreliable stream transmission channel created by the live broadcast server.
[0141] S430: Receive data packets from the first stream transmission channel and the second stream transmission channel, and analyze data contents of the received data packets.
[0142] Specifically, a response message to the live broadcast request, a key information data packet of the live data frame in the live data stream matched by the live broadcast request, and an associated frame representing the association relationship between the first stream transmission channel and the second stream transmission channel are received from the first stream transmission channel. Through the response message to the live broadcast request, the live broadcast client can learn that the live broadcast server has successfully received the live broadcast request. By decapsulating the key information data packet, the file header of the live data frame and the key data required for decoding can be obtained. By decapsulating the associated frame, the association relationship between the first stream transmission channel and the second stream transmission channel can be obtained, and the data packet received by the corresponding second stream transmission channel can be determined as associated data according to the recorded identifier of the second stream transmission channel corresponding to the identifier of the first stream transmission channel.
[0143] A live data packet of a live data frame in a live data stream matching the live broadcast request is received from the second stream transmission channel, and the live data packet contains audio and video data of the live data frame. The audio and video data can be obtained by analyzing the live data packet, that is, decapsulating it.
[0144] It is understandable that there is no specific restriction on the order in which the key information data packets of the live data frame and the associated frames representing the association between the first stream transmission channel and the second stream transmission channel arrive at the live client, but only after both have reached the live client can the data (i.e., audio and video data) transmitted from the unreliable transmission channel be processed. When the associated frame arrives, the reliable type of stream data channel (i.e., the first stream transmission channel) and the unreliable type of stream transmission channel (i.e., the second stream transmission channel) will be mapped; when the first frame of data of the reliable type of stream is received, the data packet transmitted from the second stream transmission channel that has completed the mapping is marked and determined to be in a working state. When the key information data packet of the live data frame or the associated frame representing the association between the first stream transmission channel and the second stream transmission channel has not arrived at the live client, but the data packet transmitted from the second stream transmission channel arrives first, it is determined that the state is in a blocked state.
[0145] S440, analyzing and determining whether the received data packet meets the status trigger condition, if not, executing step S450, if satisfied, executing step S460.
[0146] Among them, the status trigger condition is: after the data packet received from the first stream transmission channel is a response message to the live broadcast request, a key information data packet of the live data frame associated with the live broadcast request is received from the first stream transmission channel; and an association frame representing the association between the second stream transmission channel and the first stream transmission channel is also received from the first stream transmission channel.
[0147] Specifically, the order in which the data transmitted through the two stream transmission channels arrives at the live broadcast client is analyzed to determine whether the state trigger condition is met. If not, step S450 is executed, and if so, step S460 is executed.
[0148] S450. When the analysis determines that the received data packet does not meet the state triggering condition, it is determined that the stream transmission is in a blocked state, data information related to the live data frame in the received data packet is cached into a data cache list, and step S430 is continued.
[0149] Specifically, when the analysis determines that the received data packet does not meet the status trigger condition, it can also be understood that after the data packet received from the first stream transmission channel is a response message to the live broadcast request, the key information data packet of the live data frame associated with the live broadcast request is not received from the first stream transmission channel; or the association frame representing the association between the second stream transmission channel and the first stream transmission channel is not received from the first stream transmission channel, then it is determined that the stream transmission is in a blocked state, the data information related to the live data frame in the received data packet is cached in the data cache list, and data packets continue to be received from the first stream transmission channel and the second stream transmission channel, and the analysis operation of the received data packets is performed.
[0150] S460: When the analysis determines that the received data meets the status trigger condition, it is determined that the current state is working, and the live broadcast data to be played that matches the live broadcast request is determined from the data cache list.
[0151] The live broadcast data frame is a data frame in the live broadcast data stream that matches the live broadcast request.
[0152] Specifically, when the analysis determines that the received data packet meets the status trigger condition, it can also be understood that after the data packet received from the first stream transmission channel is a response message to the live broadcast request, a key information data packet of the live data frame associated with the live broadcast request is received from the first stream transmission channel; and an association frame representing the association between the second stream transmission channel and the first stream transmission channel is received from the first stream transmission channel, it is determined that the stream transmission is in a normal state, and the live broadcast data to be played that matches the live broadcast request is determined from the data cache list.
[0153] The technical solution of this embodiment refines the analysis of the data packets received from the first stream transmission channel and the second stream transmission channel by the live broadcast client to determine whether the received data packets meet the state triggering condition. When the analysis determines that the received data packets do not meet the state triggering condition, it is determined that the stream transmission is in a blocked state, and the data information related to the live broadcast data frame in the received data packet is cached in the data cache list, and the analysis operation of the received data packet is continued; otherwise, it is determined that it is currently in a working state, and the live broadcast data to be played that matches the live broadcast request is determined from the data cache list. The above technical solution refines the state triggering condition restrictions, and can realize the determination of the timing of transmitting data to the user application layer.
[0154] On the basis of the above technical solution, data information related to the live data frame in the received data packet is cached in a data cache list, including: if the received data packet is a live data packet received by the second stream transmission channel, data information related to the live data frame in the received data packet is determined, and the data information is stored in the data cache list.
[0155] The live data packet received from the second stream transmission channel is audio and video data, that is, the basic data required for the live screen display. When the analysis determines that the received data packet does not meet the state trigger condition, it is determined that the stream transmission is in a blocked state, and then the data information related to the live data frame in the received data packet is determined, and the data information is stored in the data cache list. The data cache list is used to provide the live data to be played later.
[0156] On the basis of the above technical solution, determining the live broadcast data to be played that matches the live broadcast request from the preset data cache list includes:
[0157] a2) Determine the live data frame header pointed to by the cache offset pointer in the data cache list.
[0158] The cache offset frame may refer to a frame type used for actively expiration information data packets. The cache offset frame may carry an offset value to notify the live broadcast client and the live broadcast server not to retransmit all data before the offset value.
[0159] b2) If the data content of the target live data frame corresponding to the live data frame header is complete, the live data frame is determined as the live data to be played.
[0160] Specifically, whether the data content of the target live data frame is complete can be determined by whether the end mark of the target live data frame is received. If the data content of the target live data frame corresponding to the live data frame header is complete, the live data frame is determined as the live data to be played.
[0161] c2) Otherwise, re-execute the content integrity determination of the target live broadcast data frame at a set interval until an expiration information data packet sent by the live broadcast server relative to the target live broadcast data frame is received.
[0162] Specifically, if the end mark of the target live data frame is not received, that is, the data content of the target live data frame corresponding to the live data frame header is incomplete, the target live data frame content complete segmentation is re-executed at a set interval until an expiration information data packet sent by the live server relative to the target live data frame is received. The generation and sending process of the expiration information data packet can refer to the relevant description in the above-mentioned embodiment 3, which will not be repeated here.
[0163] d2) Move the cache offset pointer to the live data frame header of the next frame of the target live data frame as the new target live data frame, and return to re-determine the content integrity.
[0164] Specifically, after receiving the expiration information data packet sent by the live broadcast server relative to the target live broadcast data frame, the cache offset pointer is moved to the live broadcast data frame header of the next frame of the target live broadcast data frame as the new target live broadcast data frame, and returned to re-determine the content completeness.
[0165] For example, Figure 6 FIG. 4 is an example diagram of cache offset pointer movement involved in the fourth embodiment of the present disclosure. Figure 6 As shown, the data boundary frame corresponding to A ( Figure 6 A's boundary frame is used to represent it) and some data packets of A ( Figure 6 In the example above, the live client uses part 1 and part 2 of A to represent the frame, and the same is true for other frames. Assume that at time 1, the live client has completely received the C and D frame data, but has not received the complete A and B frames. At time 2, the expired information packet is received. When the expired information packet is received, the live client moves the cache offset pointer to point to the live data frame header position of frame C, and returns the C and D frame data to the application layer to avoid the head-of-line blocking problem.
[0166] This optional embodiment includes a process of caching data information related to the live data frame in the received data packet into a data cache list, and a process of determining the live data to be played that matches the live broadcast request from the preset data cache list. The technical solution of the optional embodiment can automatically discard expired data after the expiration time has expired, avoid head-of-line blocking problems, ensure the playback effect of the live data, and improve the user experience of the live broadcast client.
[0167] The following is an embodiment of a live data transmission device provided by an embodiment of the present disclosure. The device and the live data transmission method of the above-mentioned embodiment 1 or embodiment 2 belong to the same inventive concept. For details not described in detail in the embodiment of the live data transmission device, please refer to the above-mentioned embodiment 1 or embodiment 2.
[0168] Embodiment 5
[0169] Figure 7 This is a structural diagram of a live data transmission device provided in Embodiment 5 of the present disclosure. This embodiment is applicable to the case where live data is transmitted through an unreliable stream transmission channel to ensure the live data playback effect. Figure 7 As shown, the device is integrated in the live broadcast server, and specifically includes: a request receiving module 510, a channel creation module 520, an information sending module 530 and a data frame sending module 540.
[0170] Among them, the request receiving module 510 is used to receive the live broadcast request sent by the live broadcast client, and determine the live broadcast data stream that matches the live broadcast request, wherein the live broadcast request is transmitted through a reliable first stream transmission channel established by the live broadcast client; the channel creation module 520 is used to create an unreliable second stream transmission channel and establish an association with the first stream transmission channel; the information sending module 530 is used to send the response information of the live broadcast request and the key information of the live data frame in the live data stream to the live broadcast client through the first stream transmission channel; the data frame sending module 540 is used to send each live data frame in the live data stream to the live broadcast client through the second stream transmission channel.
[0171] According to the technical solution of the embodiment of the present disclosure, the live broadcast server receives the live broadcast request sent by the live broadcast client, determines the live broadcast data stream that matches the live broadcast request, and the live broadcast request is transmitted through the first stream transmission channel of the reliable type established by the live broadcast client. Then the live broadcast server creates an unreliable second stream transmission channel and establishes an association with the first stream transmission channel. The live broadcast server sends the response information of the live broadcast request and the key information of the live data frame in the live data stream to the live broadcast client through the first stream transmission channel; and sends each live data frame in the live data stream to the live broadcast client through the second stream transmission channel. The above technical solution, based on the live broadcast server creating an unreliable second stream transmission channel of the unreliable type, can realize the unreliable transmission of the live broadcast data frame, avoid the impact of network transmission delay on the live screen playback, ensure the playback effect of the live data, and improve the user experience of the live broadcast client.
[0172] On the basis of the above technical solution, the device also includes:
[0173] The association frame sending module is used to send an association frame representing the association between the second stream transmission channel and the first stream transmission channel to the live broadcast client through the first stream transmission channel, so that the live broadcast client determines that the first stream transmission channel and the second stream transmission channel are associated through the association frame.
[0174] Preferably, the association frame includes: association mapping information of the stream transmission channel, and the association mapping information includes channel identifiers respectively possessed by the first stream transmission channel and the second stream transmission channel.
[0175] Based on the above technical solution, the channel creation module 510 is specifically used to:
[0176] Building a stream transmission channel required for unreliable data stream transmission based on a preset transmission protocol, which is recorded as a second stream transmission channel;
[0177] Obtaining a first channel identifier of a first stream transmission channel and a second channel identifier of a second stream transmission channel;
[0178] Based on the first channel identifier and the second channel identifier, association mapping information representing an association relationship between the second stream transmission channel and the first stream transmission channel is formed.
[0179] Based on the above technical solution, the information sending module 520 is specifically used for:
[0180] Encapsulating the response information of the live broadcast request according to the reliable type message format of the preset transmission protocol to form a response message, and sending it to the live broadcast client through the first stream transmission channel;
[0181] For each live data frame in the live data stream, determine the file header of the live data frame and key data required for decoding;
[0182] The file header and key data are encapsulated in a reliable type message format to form a key information data packet relative to the live broadcast data frame, and sent to the live broadcast client through the first stream transmission channel.
[0183] On the basis of the above technical solution, the data frame sending module 540 is specifically used for:
[0184] For each live data frame in the live data stream, encapsulate the audio and video data in the live data frame according to an unreliable type message format of a preset transmission protocol to form at least one live data packet;
[0185] Each live broadcast data packet is sent to the live broadcast client through the second stream transmission channel.
[0186] On the basis of the above technical solutions, the device further includes a logic execution module, which includes:
[0187] An expiration duration determining unit, used to determine the expiration duration of the live data frame for each live data frame in the live data stream;
[0188] The discard processing logic execution unit is used to execute the discard processing logic of the live data frame according to the expiration time when there is a retransmission operation of the data packet related to the live data frame.
[0189] Furthermore, the discard processing logic execution unit is specifically used to:
[0190] If it is determined that a live data packet related to the live data frame is lost during transmission, the related live data packet is resent through the second stream transmission channel, and a retransmission timer is started when a data packet retransmission of the live data frame occurs for the first time;
[0191] If the accumulated duration of the retransmission timing exceeds the expiration duration, an expiration information data packet relative to the live broadcast data frame is formed and sent to the live broadcast client, so that the live broadcast client discards the relevant data of the live broadcast data frame from the data cache list.
[0192] The live data transmission device provided in the embodiment of the present disclosure can execute the live data transmission method provided in the first or second embodiment of the present disclosure, and has the corresponding functional modules and beneficial effects for executing the live data transmission method.
[0193] It is worth noting that in the embodiment of the above-mentioned live data transmission device, the various units and modules included are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this disclosure.
[0194] The following is an embodiment of a live data transmission device provided by an embodiment of the present disclosure. The device and the live data transmission method of the above-mentioned embodiment three or embodiment four belong to the same inventive concept. For details not described in detail in the embodiment of the live data transmission device, please refer to the above-mentioned embodiment three or embodiment four.
[0195] Embodiment 6
[0196] Figure 8 This is a schematic diagram of the structure of a live data transmission device provided in Embodiment 6 of the present disclosure. This embodiment is applicable to the case where live data is transmitted through an unreliable stream transmission channel to ensure the live data playback effect. Figure 8 As shown, the device is integrated in the live broadcast client, and specifically includes: a request sending module 610, a data packet receiving module 620 and a live broadcast data determination module 630.
[0197] Among them, the request sending module 610 is used to send a live broadcast request to the live broadcast server through the established reliable type of first stream transmission channel; the data packet receiving module 620 is used to receive data packets sent by the live broadcast server through the first stream transmission channel and the second stream transmission channel relative to the live broadcast request, wherein the second stream transmission channel is an unreliable type of stream transmission channel created by the live broadcast server; the live broadcast data determination module 630 is used to determine the live broadcast data to be played that matches the live broadcast request by analyzing the data packets received from the first stream transmission channel and the second stream transmission channel.
[0198] According to the technical solution of the embodiment of the present disclosure, the live broadcast client sends a live broadcast request to the live broadcast server through the established reliable first stream transmission channel. The live broadcast server receives the live broadcast request sent by the live broadcast client and determines the live broadcast data stream that matches the live broadcast request. Then the live broadcast server creates an unreliable second stream transmission channel and establishes an association with the first stream transmission channel. The live broadcast server sends the response information of the live broadcast request and the key information of the live broadcast data frame in the live broadcast data stream to the live broadcast client through the first stream transmission channel; sends each live broadcast data frame in the live broadcast data stream to the live broadcast client through the second stream transmission channel. The live broadcast client determines the live broadcast data to be played that matches the live broadcast request by analyzing the data packets received from the first stream transmission channel and the second stream transmission channel. The above technical solution, based on the live broadcast server creating an unreliable second stream transmission channel, can realize the unreliable transmission of the live broadcast data frame, avoid the impact of network transmission delay on the live screen playback, ensure the playback effect of the live data, and improve the user experience of the live broadcast client.
[0199] On the basis of the above technical solution, the data packets received through the first stream transmission channel are: a response message relative to the live broadcast request, a key information data packet of the live data frame in the live data stream matched by the live broadcast request, and an association frame representing the association relationship between the first stream transmission channel and the second stream transmission channel;
[0200] The data packet received through the second stream transmission channel is: a live data packet of a live data frame in the live data stream matched by the live broadcast request, and the live data packet contains audio and video data of the live data frame.
[0201] Based on the above technical solution, the live broadcast data determination module 630 includes:
[0202] An analyzing unit, configured to receive data packets from the first stream transmission channel and the second stream transmission channel, and analyze data contents of the received data packets;
[0203] The state determination unit is used to determine that the stream transmission is in a blocked state when the received data packet is determined by analysis to not meet the state triggering condition, cache the data information related to the live data frame in the received data packet into the data cache list, and continue to perform the analysis operation of the received data packet; otherwise,
[0204] A live broadcast data determination unit, used to determine the current working state, and determine the live broadcast data to be played that matches the live broadcast request from the data cache list;
[0205] The live broadcast data frame is a data frame in the live broadcast data stream that matches the live broadcast request.
[0206] Furthermore, the status trigger condition is: after the data packet received from the first stream transmission channel is a response message to the live broadcast request, a key information data packet of the live broadcast data frame associated with the live broadcast request is received from the first stream transmission channel; and an association frame representing the association between the second stream transmission channel and the first stream transmission channel is also received from the first stream transmission channel.
[0207] On the basis of the above technical solution, the state determination unit is used to execute the step of caching data information related to the live data frame in the received data packet into the data cache list, including:
[0208] If the received data packet is a live data packet received by the second stream transmission channel, data information related to the live data frame in the received data packet is determined, and the data information is stored in a data cache list.
[0209] On the basis of the above technical solution, the live broadcast data determination unit is specifically used to:
[0210] Determine the live data frame header pointed to by the cache offset pointer in the data cache list;
[0211] If the data content of the target live data frame corresponding to the live data frame header is complete, the live data frame is determined as the live data to be played; otherwise,
[0212] Re-execute the content integrity determination of the target live broadcast data frame at a set interval until receiving an expiration information data packet sent by the live broadcast server relative to the target live broadcast data frame;
[0213] Move the cache offset pointer to the live data frame header of the next frame of the target live data frame as the new target live data frame, and return to re-determine the content completeness.
[0214] The live data transmission device provided in the embodiment of the present disclosure can execute the live data transmission method provided in the third or fourth embodiment of the present disclosure, and has the corresponding functional modules and beneficial effects for executing the data transmission method.
[0215] It is worth noting that in the embodiment of the above-mentioned live data transmission device, the various units and modules included are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this disclosure.
[0216] Embodiment 7
[0217] Fig. 9 This is a structural diagram of a live data transmission system provided by Embodiment 7 of the present disclosure. This embodiment is applicable to the case where live data is transmitted through an unreliable stream transmission channel to ensure the live data playback effect. Fig. 9 As shown, the system specifically includes: a live broadcast server 710 and a live broadcast client 720.
[0218] The live broadcast server 710 is used to implement the live broadcast data transmission method provided in the first or second embodiment; the live broadcast client 720 is used to implement the live broadcast data transmission method provided in the third or fourth embodiment.
[0219] The live broadcast data transmission system in the embodiment of the present disclosure, the technical solution of the embodiment of the present disclosure, the live broadcast client sends a live broadcast request to the live broadcast server through the established reliable first stream transmission channel, the live broadcast server receives the live broadcast request sent by the live broadcast client, and determines the live broadcast data stream that matches the live broadcast request. Then the live broadcast server creates an unreliable second stream transmission channel and establishes an association with the first stream transmission channel. The live broadcast server sends the response information of the live broadcast request and the key information of the live broadcast data frame in the live broadcast data stream to the live broadcast client through the first stream transmission channel; sends each live data frame in the live broadcast data stream to the live broadcast client through the second stream transmission channel, and the live broadcast client determines the live broadcast data to be played that matches the live broadcast request by analyzing the data packets received from the first stream transmission channel and the second stream transmission channel. The above technical solution, based on the live broadcast server creating an unreliable second stream transmission channel, can realize the unreliable transmission of the live broadcast data frame, avoid the impact of network transmission delay on the live screen playback, ensure the playback effect of the live data, and improve the user experience of the live broadcast client.
[0220] Embodiment 8
[0221] Reference below Fig.10 , which shows a structural schematic diagram of an electronic device 800 suitable for implementing an embodiment of the present disclosure. Fig.10 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0222] like Fig.10As shown, the electronic device 800 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 801, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 802 or a program loaded from a storage device 808 into a random access memory (RAM) 803. In the RAM 803, various programs and data required for the operation of the electronic device 800 are also stored. The processing device 801, the ROM 802, and the RAM 803 are connected to each other via a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.
[0223] Typically, the following devices may be connected to the I / O interface 805: input devices 806 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; output devices 807 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 808 including, for example, a magnetic tape, a hard disk, etc.; and communication devices 809. The communication device 809 may allow the electronic device 800 to communicate with other devices wirelessly or by wire to exchange data. Although Fig.10 The electronic device 800 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.
[0224] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device 809, or installed from a storage device 808, or installed from a ROM 802. When the computer program is executed by the processing device 801, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.
[0225] The electronic device provided in the embodiment of the present disclosure and the live data transmission method provided in the above embodiment belong to the same inventive concept. The technical details not fully described in the embodiment of the present disclosure can be referred to the above embodiment, and the embodiment of the present disclosure has the same beneficial effects as the above embodiment.
[0226] Embodiment 9
[0227] The embodiment of the present disclosure provides a computer storage medium on which a computer program is stored. When the program is executed by a processor, the live data transmission method provided by the above embodiment is implemented.
[0228] It should be noted that the computer-readable medium disclosed above may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
[0229] In some embodiments, the receiving end and the sending end can communicate using any currently known or future developed network protocol such as HTTP (HyperText Transfer Protocol), and can be interconnected with digital data communication (e.g., communication network) of any form or medium. Examples of communication networks include local area networks ("LAN"), wide area networks ("WAN"), internets (e.g., the Internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future developed networks.
[0230] The computer-readable medium may be included in the live broadcast server; or it may exist independently without being assembled into the live broadcast server.
[0231] The computer-readable medium carries one or more programs. When the one or more programs are executed by the live broadcast server, the live broadcast server: receives a live broadcast request sent by a live broadcast client, determines a live broadcast data stream that matches the live broadcast request, wherein the live broadcast request is transmitted through a first stream transmission channel of a reliable type established by the live broadcast client; creates an unreliable second stream transmission channel and establishes an association with the first stream transmission channel; sends the response information of the live broadcast request and the key information of the live data frame in the live data stream to the live broadcast client through the first stream transmission channel; and sends each live data frame in the live data stream to the live broadcast client through the second stream transmission channel.
[0232] The computer-readable medium may be included in the live broadcast client; or may exist independently without being assembled into the live broadcast client.
[0233] The above-mentioned computer-readable medium carries one or more programs. When the above-mentioned one or more programs are executed by the live broadcast client, the live broadcast client: sends a live broadcast request to the live broadcast server through the established reliable first stream transmission channel; receives data packets sent by the live broadcast server through the first stream transmission channel and the second stream transmission channel in response to the live broadcast request, wherein the second stream transmission channel is an unreliable stream transmission channel created by the live broadcast server; and determines the live broadcast data to be played that matches the live broadcast request by analyzing the data packets received from the first stream transmission channel and the second stream transmission channel.
[0234] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages or a combination thereof, including, but not limited to, object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on the remote computer or the sending end. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).
[0235] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0236] The units involved in the embodiments described in the present disclosure may be implemented by software or hardware. The name of a unit does not limit the unit itself in some cases. For example, an editable content display unit may also be described as an "editing unit".
[0237] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.
[0238] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0239] According to one or more embodiments of the present disclosure, [Example 1] provides a live data transmission method, which is applied to a live server, including:
[0240] Receiving a live broadcast request sent by a live broadcast client, and determining a live broadcast data stream matching the live broadcast request, wherein the live broadcast request is transmitted through a first stream transmission channel of a reliable type established by the live broadcast client;
[0241] Creating a second stream transmission channel of an unreliable type and associating it with the first stream transmission channel;
[0242] Sending the response information of the live broadcast request and the key information of the live broadcast data frame in the live broadcast data stream to the live broadcast client through the first stream transmission channel;
[0243] Each live data frame in the live data stream is sent to the live client through the second stream transmission channel.
[0244] According to one or more embodiments of the present disclosure, [Example 2] provides a live data transmission method, which is applied to a live server, and further includes:
[0245] Optionally, after creating a second stream transmission channel of an unreliable type associated with the first stream transmission channel, the method further includes:
[0246] An association frame indicating that the second stream transmission channel is associated with the first stream transmission channel is sent to the live client through the first stream transmission channel, so that the live client determines that the first stream transmission channel is associated with the second stream transmission channel through the association frame.
[0247] According to one or more embodiments of the present disclosure, [Example 3] provides a live data transmission method, which is applied to a live server, and further includes:
[0248] Optionally, the association frame includes: association mapping information of stream transmission channels, and the association mapping information includes channel identifiers respectively possessed by the first stream transmission channel and the second stream transmission channel.
[0249] According to one or more embodiments of the present disclosure, [Example 4] provides a live data transmission method, which is applied to a live server, and further includes:
[0250] Optionally, the creating a second stream transmission channel of an unreliable type and associating it with the first stream transmission channel includes:
[0251] Building a stream transmission channel required for unreliable data stream transmission based on a preset transmission protocol, which is recorded as a second stream transmission channel;
[0252] Obtaining a first channel identifier of the first stream transmission channel and a second channel identifier of the second stream transmission channel;
[0253] Based on the first channel identifier and the second channel identifier, association mapping information representing an association relationship between the second stream transmission channel and the first stream transmission channel is formed.
[0254] According to one or more embodiments of the present disclosure, [Example 5] provides a live data transmission method, which is applied to a live server, and further includes:
[0255] Optionally, sending the response information of the live broadcast request and key information of the live broadcast data frame in the live broadcast data stream to the live broadcast client through the first stream transmission channel includes:
[0256] Encapsulating the response information of the live broadcast request according to the reliable type message format of the preset transmission protocol to form a response message, and sending it to the live broadcast client through the first stream transmission channel;
[0257] For each live data frame in the live data stream, determine the file header of the live data frame and key data required for decoding;
[0258] The file header and key data are encapsulated according to the reliable type message format to form a key information data packet relative to the live broadcast data frame, and sent to the live broadcast client through the first stream transmission channel.
[0259] According to one or more embodiments of the present disclosure, [Example 6] provides a live data transmission method, which is applied to a live server, and further includes:
[0260] Optionally, sending each live data frame in the live data stream to the live client through the second stream transmission channel includes:
[0261] For each live data frame in the live data stream, encapsulate the audio and video data in the live data frame according to an unreliable type message format of a preset transmission protocol to form at least one live data packet;
[0262] Each of the live broadcast data packets is sent to the live broadcast client through the second stream transmission channel.
[0263] According to one or more embodiments of the present disclosure, [Example 7] provides a live data transmission method, which is applied to a live server, and further includes:
[0264] Optionally, in the process of sending each live data frame in the live data stream to the live client through the second stream transmission channel, the process further includes:
[0265] For each live data frame in the live data stream, the expiration time of the live data frame is determined, and when there is a retransmission operation of the data packet related to the live data frame, the discard processing logic of the live data frame is executed according to the expiration time.
[0266] According to one or more embodiments of the present disclosure, [Example 8] provides a live data transmission method, which is applied to a live server, and further includes:
[0267] Optionally, when there is a retransmission operation of the data packet related to the live data frame, executing the discard processing logic of the live data frame according to the expiration time, includes:
[0268] If it is determined that a live data packet related to the live data frame is lost during transmission, the related live data packet is resent through the second stream transmission channel, and a retransmission timer is started when a data packet retransmission of the live data frame occurs for the first time;
[0269] If the accumulated duration of the retransmission timing exceeds the expiration duration, an expiration information data packet relative to the live data frame is formed and sent to the live client, so that the live client discards the relevant data of the live data frame from the data cache list.
[0270] According to one or more embodiments of the present disclosure, [Example 9] provides a live data transmission method, which is applied to a live client, including:
[0271] Sending a live broadcast request to the live broadcast server through the established reliable first stream transmission channel;
[0272] Receiving a data packet sent by the live broadcast server through the first stream transmission channel and the second stream transmission channel in response to the live broadcast request, wherein the second stream transmission channel is an unreliable stream transmission channel created by the live broadcast server;
[0273] By analyzing the data packets received from the first stream transmission channel and the second stream transmission channel, the live broadcast data to be played that matches the live broadcast request is determined.
[0274] According to one or more embodiments of the present disclosure, [Example 10] provides a live data transmission method, which is applied to a live client, and further includes:
[0275] Optionally, the data packets received through the first stream transmission channel are: a response message relative to the live broadcast request, a key information data packet of a live data frame in a live data stream matched with the live broadcast request, and an association frame representing an association relationship between the first stream transmission channel and the second stream transmission channel;
[0276] The data packet received through the second stream transmission channel is: a live data packet of a live data frame in the live data stream matched by the live broadcast request, and the live data packet contains audio and video data of the live data frame.
[0277] According to one or more embodiments of the present disclosure, [Example 11] provides a live data transmission method, which is applied to a live client, and further includes:
[0278] Optionally, the determining the to-be-played live broadcast data matching the live broadcast request by analyzing the data packets received from the first stream transmission channel and the second stream transmission channel includes:
[0279] receiving data packets from the first stream transmission channel and the second stream transmission channel, and analyzing data contents of the received data packets;
[0280] When the analysis determines that the received data packet does not meet the state triggering condition, it is determined that the stream transmission is in a blocked state, the data information related to the live data frame in the received data packet is cached in the data cache list, and the analysis operation of the received data packet is continued; otherwise,
[0281] Determine that the current state is working, and determine the live broadcast data to be played that matches the live broadcast request from the data cache list;
[0282] The live broadcast data frame is a data frame in the live broadcast data stream that matches the live broadcast request.
[0283] According to one or more embodiments of the present disclosure, [Example 12] provides a live data transmission method, which is applied to a live client, and further includes:
[0284] Optionally, the state triggering condition is:
[0285] After the data packet received from the first stream transmission channel is a response message to the live broadcast request, a key information data packet of the live broadcast data frame associated with the live broadcast request is received from the first stream transmission channel; and an association frame representing the association between the second stream transmission channel and the first stream transmission channel is also received from the first stream transmission channel.
[0286] According to one or more embodiments of the present disclosure, [Example 13] provides a live data transmission method, which is applied to a live client, and further includes:
[0287] The step of caching data information related to the live broadcast data frame in the received data packet into a data cache list includes:
[0288] If the received data packet is a live data packet received by the second stream transmission channel, data information related to the live data frame in the received data packet is determined, and the data information is stored in the data cache list.
[0289] According to one or more embodiments of the present disclosure, [Example 14] provides a live data transmission method, which is applied to a live client, and further includes:
[0290] Optionally, determining the live broadcast data to be played that matches the live broadcast request from a preset data cache list includes:
[0291] Determine the live data frame header pointed to by the cache offset pointer in the data cache list;
[0292] If the data content of the target live data frame corresponding to the live data frame header is complete, the live data frame is determined as the live data to be played; otherwise,
[0293] Re-execute the content integrity determination of the target live broadcast data frame at a set interval until receiving an expiration information data packet sent by the live broadcast server relative to the target live broadcast data frame;
[0294] The cache offset pointer is moved to the live data frame header of the next frame of the target live data frame as a new target live data frame, and the content is returned to be re-determined to be complete.
[0295] According to one or more embodiments of the present disclosure, [Example 15] provides a live data transmission device, which is integrated in a live server, including:
[0296] A request receiving module, used for receiving a live broadcast request sent by a live broadcast client, and determining a live broadcast data stream matching the live broadcast request, wherein the live broadcast request is transmitted through a first stream transmission channel of a reliable type established by the live broadcast client;
[0297] A channel creation module, used to create an unreliable second stream transmission channel and associate it with the first stream transmission channel;
[0298] An information sending module, used for sending the response information of the live broadcast request and the key information of the live data frame in the live data stream to the live broadcast client through the first stream transmission channel;
[0299] The data frame sending module is used to send each live data frame in the live data stream to the live client through the second stream transmission channel.
[0300] According to one or more embodiments of the present disclosure, [Example 16] provides a live data transmission device, which is integrated in a live client, including:
[0301] A request sending module, used for sending a live broadcast request to a live broadcast server through the established reliable first stream transmission channel;
[0302] A data packet receiving module, used for receiving data packets sent by the live broadcast server through the first stream transmission channel and the second stream transmission channel in response to the live broadcast request, wherein the second stream transmission channel is an unreliable stream transmission channel created by the live broadcast server;
[0303] The live broadcast data determination module is used to determine the live broadcast data to be played that matches the live broadcast request by analyzing the data packets received from the first stream transmission channel and the second stream transmission channel.
[0304] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other.
[0305] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details are included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.
[0306] Although the subject matter has been described in language specific to structural features and / or methodological logical actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. On the contrary, the specific features and actions described above are merely example forms of implementing the claims.
Claims
1. A live data transmission method, characterized in that: Applied to live broadcast servers, including: Receiving a live broadcast request sent by a live broadcast client, and determining a live broadcast data stream matching the live broadcast request, wherein the live broadcast request is transmitted through a first stream transmission channel of a reliable type established by the live broadcast client; Creating a second stream transmission channel of an unreliable type and associating it with the first stream transmission channel; Sending the response information of the live broadcast request and the key information of the live broadcast data frame in the live broadcast data stream to the live broadcast client through the first stream transmission channel; Sending the audio and video data of each live data frame in the live data stream to the live client through the second stream transmission channel; The live broadcast client analyzes the data content of the received data packet; When the analysis determines that the received data packet does not meet the state triggering condition, it is determined that the stream transmission is in a blocked state, the data information related to the live data frame in the received data packet is cached in the data cache list, and the analysis operation of the received data packet is continued; otherwise, Determine that the current state is working, and determine the live broadcast data to be played that matches the live broadcast request from the data cache list; The live broadcast data frame is a data frame in the live broadcast data stream that matches the live broadcast request; The state triggering condition is: after the data packet received from the first stream transmission channel is a response message to the live broadcast request, a key information data packet of a live broadcast data frame associated with the live broadcast request is received from the first stream transmission channel; and an association frame indicating that the second stream transmission channel is associated with the first stream transmission channel is also received from the first stream transmission channel; The receiving a live broadcast request sent by a live broadcast client and determining a live broadcast data stream matching the live broadcast request includes: The live broadcast server parses the live broadcast request to obtain an identifier of the data stream to be broadcasted contained in the live broadcast request; According to the parsed data stream identifier to be broadcast live, querying a data stream identifier matching the data stream identifier to be broadcast live from a live broadcast server, so as to determine a live broadcast data stream matching the live broadcast request; The live broadcast data frame includes a key information data packet transmitted through a first stream transmission channel and a live broadcast data packet transmitted through a second stream transmission channel. The key information data packet is obtained by encapsulating a file header of the live broadcast data frame and key data required for decoding. The live broadcast data packet is obtained by encapsulating audio and video data in the live broadcast data frame. When the live broadcast client fails to receive all data packets of the live broadcast data frame within a set time, the frame is discarded.
2. The method according to claim 1, characterized in that After creating a second stream transmission channel of an unreliable type associated with the first stream transmission channel, the method further includes: An association frame indicating that the second stream transmission channel is associated with the first stream transmission channel is sent to the live client through the first stream transmission channel, so that the live client determines that the first stream transmission channel is associated with the second stream transmission channel through the association frame.
3. The method according to claim 2, characterized in that The association frame includes: association mapping information of stream transmission channels, and the association mapping information includes channel identifiers respectively possessed by the first stream transmission channel and the second stream transmission channel.
4. The method according to claim 1, characterized in that: The step of creating a second stream transmission channel of an unreliable type and associating the second stream transmission channel with the first stream transmission channel includes: Building a stream transmission channel required for unreliable data stream transmission based on a preset transmission protocol, which is recorded as a second stream transmission channel; Acquire a first channel identifier of the first stream transmission channel and a second channel identifier of the second stream transmission channel; Based on the first channel identifier and the second channel identifier, association mapping information representing an association relationship between the second stream transmission channel and the first stream transmission channel is formed.
5. The method according to claim 1, characterized in that The step of sending the response information of the live broadcast request and key information of the live broadcast data frame in the live broadcast data stream to the live broadcast client through the first stream transmission channel includes: Encapsulating the response information of the live broadcast request according to the reliable type message format of the preset transmission protocol to form a response message, and sending it to the live broadcast client through the first stream transmission channel; For each live data frame in the live data stream, determine the file header of the live data frame and key data required for decoding; The file header and key data are encapsulated according to the reliable type message format to form a key information data packet relative to the live broadcast data frame, and sent to the live broadcast client through the first stream transmission channel.
6. The method according to claim 1, characterized in that The step of sending the audio and video data of each live data frame in the live data stream to the live client through the second stream transmission channel includes: For each live data frame in the live data stream, encapsulate the audio and video data in the live data frame according to an unreliable type message format of a preset transmission protocol to form at least one live data packet; Each of the live broadcast data packets is sent to the live broadcast client through the second stream transmission channel.
7. The method according to any one of claims 1 to 6, characterized in that: In the process of sending the audio and video data of each live data frame in the live data stream to the live client through the second stream transmission channel, the process further includes: For each live data frame in the live data stream, the expiration time of the live data frame is determined, and when there is a retransmission operation of a data packet related to the live data frame, the discard processing logic of the live data frame is executed according to the expiration time.
8. The method according to claim 7, characterized in that When there is a retransmission operation of the data packet related to the live data frame, the discard processing logic of the live data frame is executed according to the expiration time, including: If it is determined that a live data packet related to the live data frame is lost during transmission, the related live data packet is resent through the second stream transmission channel, and a retransmission timer is started when a data packet retransmission of the live data frame occurs for the first time; If the accumulated duration of the retransmission timing exceeds the expiration duration, an expiration information data packet relative to the live data frame is formed and sent to the live client, so that the live client discards the relevant data of the live data frame from the data cache list.
9. A live data transmission method, characterized in that: Applied to live broadcast clients, including: Sending a live broadcast request to the live broadcast server through the established reliable first stream transmission channel; Receiving a data packet sent by the live broadcast server through the first stream transmission channel and the second stream transmission channel in response to the live broadcast request, wherein the second stream transmission channel is an unreliable stream transmission channel created by the live broadcast server; Determining the live broadcast data to be played that matches the live broadcast request by analyzing the data packets received from the first stream transmission channel and the second stream transmission channel; The live broadcast request includes an identifier of the data stream to be broadcasted; The data packet transmitted through the first stream transmission channel is a key information data packet of the live data frame, and the data packet transmitted through the second stream transmission channel is a live data packet of the live data frame. The key information data packet is obtained by encapsulating the file header of the live data frame and the key data required for decoding, and the live data packet is obtained by encapsulating the audio and video data in the live data frame. When the live client fails to receive all the data packets of the live data frame within a set time, the frame is discarded; The step of determining the live broadcast data to be played that matches the live broadcast request by analyzing the data packets received from the first stream transmission channel and the second stream transmission channel includes: receiving data packets from the first stream transmission channel and the second stream transmission channel, and analyzing data contents of the received data packets; When the analysis determines that the received data packet does not meet the state triggering condition, it is determined that the stream transmission is in a blocked state, the data information related to the live data frame in the received data packet is cached in the data cache list, and the analysis operation of the received data packet is continued; otherwise, Determine that the current state is working, and determine the live broadcast data to be played that matches the live broadcast request from the data cache list; The live broadcast data frame is a data frame in the live broadcast data stream that matches the live broadcast request; The status trigger condition is: after the data packet received from the first stream transmission channel is a response message to the live broadcast request, a key information data packet of the live data frame associated with the live broadcast request is received from the first stream transmission channel; and an association frame representing the association between the second stream transmission channel and the first stream transmission channel is also received from the first stream transmission channel.
10. The method according to claim 9, characterized in that The data packets received through the first stream transmission channel are: a response message to the live broadcast request, a key information data packet of a live broadcast data frame in a live broadcast data stream matched with the live broadcast request, and an association frame representing an association relationship between the first stream transmission channel and the second stream transmission channel; The data packet received through the second stream transmission channel is: a live data packet of a live data frame in the live data stream matched by the live broadcast request, and the live data packet contains audio and video data of the live data frame.
11. The method according to claim 9, characterized in that The step of caching data information related to the live broadcast data frame in the received data packet into a data cache list includes: If the received data packet is a live data packet received by the second stream transmission channel, data information related to the live data frame in the received data packet is determined, and the data information is stored in the data cache list.
12. The method according to claim 9, characterized in that The determining, from the data cache list, the live broadcast data to be played that matches the live broadcast request comprises: Determine the live data frame header pointed to by the cache offset pointer in the data cache list; If the data content of the target live data frame corresponding to the live data frame header is complete, the live data frame is determined as the live data to be played; otherwise, Re-execute the content integrity determination of the target live broadcast data frame at a set interval until receiving an expiration information data packet sent by the live broadcast server relative to the target live broadcast data frame; The cache offset pointer is moved to the live data frame header of the next frame of the target live data frame as a new target live data frame, and the content is returned to be re-determined to be complete.
13. A live data transmission device, characterized in that: Integrated in the live streaming server, including: A request receiving module, used for receiving a live broadcast request sent by a live broadcast client, and determining a live broadcast data stream matching the live broadcast request, wherein the live broadcast request is transmitted through a first stream transmission channel of a reliable type established by the live broadcast client; A channel creation module, used to create an unreliable second stream transmission channel and associate it with the first stream transmission channel; An information sending module, used for sending the response information of the live broadcast request and the key information of the live data frame in the live data stream to the live broadcast client through the first stream transmission channel; A data frame sending module, used for sending the audio and video data of each live data frame in the live data stream to the live client through the second stream transmission channel; The live broadcast client analyzes the data content of the received data packet; When the analysis determines that the received data packet does not meet the state triggering condition, it is determined that the stream transmission is in a blocked state, the data information related to the live data frame in the received data packet is cached in the data cache list, and the analysis operation of the received data packet is continued; otherwise, Determine that the current state is working, and determine the live broadcast data to be played that matches the live broadcast request from the data cache list; The live broadcast data frame is a data frame in the live broadcast data stream that matches the live broadcast request; The state triggering condition is: after the data packet received from the first stream transmission channel is a response message to the live broadcast request, a key information data packet of a live broadcast data frame associated with the live broadcast request is received from the first stream transmission channel; and an association frame indicating that the second stream transmission channel is associated with the first stream transmission channel is also received from the first stream transmission channel; The request receiving module is further used to parse the live broadcast request through the live broadcast server to obtain the identifier of the data stream to be broadcasted contained in the live broadcast request; According to the parsed data stream identifier to be broadcast live, querying a data stream identifier matching the data stream identifier to be broadcast live from a live broadcast server, so as to determine a live broadcast data stream matching the live broadcast request; The live broadcast data frame includes a key information data packet transmitted through a first stream transmission channel and a live broadcast data packet transmitted through a second stream transmission channel. The key information data packet is obtained by encapsulating a file header of the live broadcast data frame and key data required for decoding. The live broadcast data packet is obtained by encapsulating audio and video data in the live broadcast data frame. When the live broadcast client fails to receive all data packets of the live broadcast data frame within a set time, the frame is discarded.
14. A live data transmission device, characterized in that: Integrated into the live streaming client, including: A request sending module, used for sending a live broadcast request to a live broadcast server through the established reliable first stream transmission channel; A data packet receiving module, used for receiving data packets sent by the live broadcast server through the first stream transmission channel and the second stream transmission channel in response to the live broadcast request, wherein the second stream transmission channel is an unreliable stream transmission channel created by the live broadcast server; A live broadcast data determination module, configured to determine the live broadcast data to be played that matches the live broadcast request by analyzing the data packets received from the first stream transmission channel and the second stream transmission channel; The live broadcast request includes an identifier of the data stream to be broadcasted; The data packet transmitted through the first stream transmission channel is a key information data packet of the live data frame, and the data packet transmitted through the second stream transmission channel is a live data packet of the live data frame. The key information data packet is obtained by encapsulating the file header of the live data frame and the key data required for decoding, and the live data packet is obtained by encapsulating the audio and video data in the live data frame. When the live client fails to receive all the data packets of the live data frame within a set time, the frame is discarded; The live broadcast data determination module includes: an analyzing unit, configured to receive data packets from the first stream transmission channel and the second stream transmission channel, and analyze data contents of the received data packets; The state determination unit is used to determine that the stream transmission is in a blocked state when the received data packet is determined by analysis to not meet the state triggering condition, cache the data information related to the live data frame in the received data packet into the data cache list, and continue to perform the analysis operation of the received data packet; otherwise, A live broadcast data determination unit, used to determine the current working state, and determine the live broadcast data to be played that matches the live broadcast request from the data cache list; The live broadcast data frame is a data frame in the live broadcast data stream that matches the live broadcast request; The status trigger condition is: after the data packet received from the first stream transmission channel is a response message to the live broadcast request, a key information data packet of the live data frame associated with the live broadcast request is received from the first stream transmission channel; and an association frame representing the association between the second stream transmission channel and the first stream transmission channel is also received from the first stream transmission channel.
15. A live data transmission system, characterized in that: include: A live broadcast server and a live broadcast client, wherein the live broadcast server is used to implement the live broadcast data transmission method described in any one of claims 1-8; and the live broadcast client is used to implement the live broadcast data transmission method described in any one of claims 9-12.
16. An electronic device, characterized in that: The electronic device comprises: one or more processors; A memory for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the live data transmission method as described in any one of claims 1-12.
17. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the live data transmission method as described in any one of claims 1 to 12 is implemented.
