CN108833930B - Live broadcast data transmission control method and device, live broadcast equipment and storage medium - Google Patents

Live broadcast data transmission control method and device, live broadcast equipment and storage medium Download PDF

Info

Publication number
CN108833930B
CN108833930B CN201810638178.7A CN201810638178A CN108833930B CN 108833930 B CN108833930 B CN 108833930B CN 201810638178 A CN201810638178 A CN 201810638178A CN 108833930 B CN108833930 B CN 108833930B
Authority
CN
China
Prior art keywords
retransmission
rate
network
packet
threshold
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201810638178.7A
Other languages
Chinese (zh)
Other versions
CN108833930A (en
Inventor
彭卓韬
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangzhou Cubesili Information Technology Co Ltd
Original Assignee
Guangzhou Huaduo Network Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangzhou Huaduo Network Technology Co Ltd filed Critical Guangzhou Huaduo Network Technology Co Ltd
Priority to CN201810638178.7A priority Critical patent/CN108833930B/en
Publication of CN108833930A publication Critical patent/CN108833930A/en
Application granted granted Critical
Publication of CN108833930B publication Critical patent/CN108833930B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/21Server components or server architectures
    • H04N21/218Source of audio or video content, e.g. local disk arrays
    • H04N21/2187Live feed
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/238Interfacing the downstream path of the transmission network, e.g. adapting the transmission rate of a video stream to network bandwidth; Processing of multiplex streams
    • H04N21/23805Controlling the feeding rate to the network, e.g. by controlling the video pump
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/24Monitoring of processes or resources, e.g. monitoring of server load, available bandwidth, upstream requests
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/60Network structure or processes for video distribution between server and client or between remote clients; Control signalling between clients, server and network components; Transmission of management data between server and client, e.g. sending from server to client commands for recording incoming content stream; Communication details between server and client 
    • H04N21/63Control signaling related to video distribution between client, server and network components; Network processes for video distribution between server and clients or between remote clients, e.g. transmitting basic layer and enhancement layers over different transmission paths, setting up a peer-to-peer communication via Internet between remote STB's; Communication protocols; Addressing
    • H04N21/637Control signals issued by the client directed to the server or network components
    • H04N21/6373Control signals issued by the client directed to the server or network components for rate control, e.g. request to the server to modify its transmission rate
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/60Network structure or processes for video distribution between server and client or between remote clients; Control signalling between clients, server and network components; Transmission of management data between server and client, e.g. sending from server to client commands for recording incoming content stream; Communication details between server and client 
    • H04N21/63Control signaling related to video distribution between client, server and network components; Network processes for video distribution between server and clients or between remote clients, e.g. transmitting basic layer and enhancement layers over different transmission paths, setting up a peer-to-peer communication via Internet between remote STB's; Communication protocols; Addressing
    • H04N21/637Control signals issued by the client directed to the server or network components
    • H04N21/6375Control signals issued by the client directed to the server or network components for requesting retransmission, e.g. of data packets lost or corrupted during transmission from server
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/60Network structure or processes for video distribution between server and client or between remote clients; Control signalling between clients, server and network components; Transmission of management data between server and client, e.g. sending from server to client commands for recording incoming content stream; Communication details between server and client 
    • H04N21/63Control signaling related to video distribution between client, server and network components; Network processes for video distribution between server and clients or between remote clients, e.g. transmitting basic layer and enhancement layers over different transmission paths, setting up a peer-to-peer communication via Internet between remote STB's; Communication protocols; Addressing
    • H04N21/643Communication protocols

Abstract

The embodiment of the invention discloses a live broadcast data transmission control method, a device, a live broadcast device and a storage medium, wherein data transmission is carried out based on a UDP protocol, by monitoring the network condition, under the condition of better network condition, the code rate is adjusted upwards according to the receiving rate of a detection confirmation packet and the adjustment mode of last code rate adjustment, when the network condition is worse, a threshold value evaluation method is adopted to determine the true and false value of an identifier representing the network congestion degree, the code rate is adjusted downwards according to the true and false value, and the live broadcast data to be transmitted are encoded and transmitted according to the adjusted code rate. The code rate is adaptively adjusted in real time according to the network condition, the historical adjustment mode of the code rate and the threshold evaluation strategy in the live broadcast process. The method and the device realize stable and high-speed transmission of audio and video data under the conditions of unstable networks such as outdoor and mobile live broadcasting, and greatly reduce the probability of the problems of audio and video blockage, blurred pictures, discontinuous audio and the like of the client.

Description

Live broadcast data transmission control method and device, live broadcast equipment and storage medium
Technical Field
The present invention relates to the field of information processing technologies, and in particular, to a live data transmission control method and apparatus, a live device, and a storage medium.
Background
With the development of internet technology and the increase of the interactive demand of people, live webcasting becomes a common intercommunication mode for people to transmit and exchange information.
The current network live broadcast mode is not limited to indoor live broadcast, outdoor live broadcast and mobile live broadcast, and is a common live broadcast mode. However, in an outdoor or mobile state, a network is usually unstable, and in a live broadcast process, the client is prone to problems of audio and video blocking, blurred pictures, discontinuous audio and the like.
Disclosure of Invention
The present invention is directed to a method and an apparatus for controlling live data transmission, a live device, and a storage medium, so as to overcome at least some of the problems in the prior art.
In order to achieve the purpose, the invention provides the following technical scheme:
a live data transmission control method includes:
monitoring the retransmission rate of a network packet sent to an aggregation server and the receiving rate of a detection confirmation packet corresponding to a detection packet bearing detection data in the network packet; the network packet comprises a live broadcast packet for bearing live broadcast data and the detection packet; the network packet and the detection confirmation packet are both UDP data packets;
if the retransmission rate of the network packet is smaller than a first retransmission rate threshold value and the current code rate is not a preset maximum code rate, the current code rate is adjusted upwards according to the receiving rate of the detection confirmation packet and the adjustment mode of the last code rate adjustment, and the live broadcast data to be transmitted are encoded into frame data according to the adjusted code rate to be transmitted;
if the retransmission rate of the network packet is greater than a second retransmission rate threshold, performing first evaluation on a true and false attribute of a third retransmission rate threshold, wherein a first evaluation result represents an adjustment direction of a value of the third retransmission rate threshold, adjusting the third retransmission rate threshold according to the first evaluation result, and determining a true and false value of an identifier representing network congestion degree according to the adjusted third retransmission rate threshold; the second retransmission rate threshold is greater than the first retransmission rate threshold;
and adjusting the current code rate down according to the true and false value of the identifier representing the network congestion degree, and encoding the live broadcast data to be transmitted into frame data according to the adjusted code rate for transmission.
Preferably, the method, wherein the adjusting the current code rate according to the receiving rate of the sounding acknowledgement packet and the adjustment mode of the last code rate adjustment includes:
if the last code rate is adjusted to be down-adjusted, the current code rate is adjusted up by a first adjustment amount;
if the last code rate is adjusted to be up-regulated, judging whether the receiving rate of the detection confirmation packet meets a preset network congestion condition or not;
if the network congestion condition is not met, adjusting the current code rate by a second adjustment amount; if the network congestion condition is met, comparing the average code rate within the latest third preset time with the current code rate, if the comparison result indicates that the average code rate is close to the current code rate, adjusting the current code rate up by the first adjustment quantity, otherwise, adjusting the current code rate up by the second adjustment quantity;
the second adjustment amount is greater than the first adjustment amount.
Preferably, if the previous code rate adjustment is an up-adjustment, before determining whether the receiving rate of the detection acknowledgement packet satisfies a preset network congestion condition, the method further includes:
judging whether the code rate is continuously adjusted up three times or not;
if so, adjusting the current code rate to the average code rate within the latest third preset time length;
and if the judgment result is negative, executing the step of judging whether the receiving rate of the detection confirmation packet meets the preset network congestion condition.
Preferably, the first evaluation of the true and false attribute of the third retransmission rate threshold includes:
acquiring a time interval between the sending time of a currently retransmitted network packet and the first sending time of the currently retransmitted network packet;
if the time interval is greater than a first interval threshold, determining that the attribute of the third retransmission rate threshold is false;
if the time interval is greater than a second interval threshold and less than the first interval threshold, determining that the attribute of the third retransmission rate threshold is true if the retransmission rate of the network packet is greater than a fourth retransmission rate threshold, and determining that the attribute of the third retransmission rate threshold is false if the retransmission rate of the network packet is less than or equal to the fourth retransmission rate threshold;
if the time interval is smaller than a third interval threshold, determining that the attribute of the third retransmission rate threshold is true if the current network has a frame loss, and determining that the attribute of the third retransmission rate threshold is false if the current network has no frame loss.
The method, preferably, for adjusting the third retransmission rate threshold according to the first evaluation result, includes:
if the retransmission rate of the network packet is greater than the third retransmission rate threshold when the first evaluation is performed on the true and false attribute of the third retransmission rate threshold at the previous time, if the first evaluation result is true, the third retransmission rate threshold is decreased by a first preset step length; if the first evaluation result is false, increasing the third retransmission rate threshold by the first preset step length;
if the retransmission rate of the network packet is less than or equal to the third retransmission rate threshold when the first evaluation is performed on the true and false attribute of the third retransmission rate threshold at the previous time, if the first evaluation result is true, the third retransmission rate threshold is reduced by a second preset step length; if the first evaluation result is false, keeping the third retransmission rate threshold unchanged;
the second preset step length is larger than the first preset step length.
In the above method, preferably, the first preset step length is: a sum of the first reference step size and the first random step size; the second preset step length is as follows: a sum of the second reference step size and the second random step size; the second reference step size is greater than the first reference step size.
The above method, preferably, further comprises: monitoring the receiving rate of the acknowledgement packets, wherein the receiving rate of the acknowledgement packets is the ratio of the number of the received acknowledgement packets corresponding to the non-retransmitted network packets to the number of the transmitted non-retransmitted network packets;
the determining, according to the adjusted third retransmission rate threshold, a true and false value of the identifier representing the network congestion degree includes:
if the retransmission rate of the network packet is greater than the adjusted third retransmission rate threshold and the acknowledgement packet receiving rate is less than the first ratio threshold, determining that the value of the first identifier is true;
if the retransmission rate of the network packet is greater than a fifth retransmission rate threshold value and the current network has a frame loss, determining that the value of the second identifier is true;
the network congestion degree represented by the fact that the value of the second identifier is true is larger than the network congestion degree represented by the fact that the value of the first identifier is true.
Preferably, the above method, adjusting the current code rate according to the true and false value of the identifier representing the network congestion degree, includes:
if the values of the first identification and the second identification are both false, the current code rate is adjusted downwards according to the adjustment mode of the last code rate adjustment;
under the condition that the value of the second identifier is true, if a first condition is met, the first condition is as follows: if the retransmission rate of the network packet is greater than a sixth retransmission rate threshold, the receiving rate of the acknowledgement packet is less than a second rate threshold, and the adjustment time interval is less than a fifth preset time length, the current code rate is adjusted by a third adjustment amount; if the first condition is not satisfied, if a second condition is satisfied, the second condition is: if the retransmission rate of the detection packet is greater than a sixth retransmission rate threshold, the receiving rate of the acknowledgement packet is less than a second rate threshold, and the adjustment time interval is greater than or equal to the fifth preset time length, then the current code rate is adjusted by a fourth adjustment amount;
if the value of the first identifier is true, reducing the current code rate to a preset minimum code rate, otherwise, reducing the current code rate by a fifth regulating quantity;
the fourth adjustment amount is smaller than the fifth adjustment amount, and the fifth adjustment amount is smaller than the third adjustment amount.
Preferably, the method, adjusting the current code rate downward according to the adjustment mode of the last code rate adjustment, includes:
if the last code rate is adjusted to be adjusted upwards, the current code rate is adjusted downwards by the fourth adjustment quantity;
and if the last code rate is adjusted to be adjusted downwards, the current code rate is adjusted downwards by the fifth adjustment quantity.
The above method, preferably, further comprises:
if the retransmission rate of the network packet is smaller than the second retransmission rate threshold and the retransmission rate of the network packet is larger than the seventh retransmission rate threshold, performing second evaluation on the true and false attribute of the eighth retransmission rate threshold, wherein a second evaluation result represents the adjustment direction of the value of the eighth retransmission rate threshold, adjusting the eighth retransmission rate threshold according to the second evaluation result, and setting the maximum retransmission times, the retransmission timeout duration, the frame loss mark and the retransmission interval time according to the adjusted eighth retransmission rate threshold.
Preferably, the second evaluation of the true and false attribute of the eighth retransmission rate threshold includes:
acquiring a time interval between the sending time of a currently retransmitted network packet and the first sending time of the currently retransmitted network packet;
if the time interval is greater than a first interval threshold, determining that the attribute of the eighth retransmission rate threshold is false;
if the time interval is greater than a second interval threshold and smaller than the first interval threshold, determining that the attribute of the eighth retransmission rate threshold is true if the retransmission rate of the current network packet is greater than 2 times of the retransmission rate of the network packet when the true and false attribute of the eighth retransmission rate threshold is subjected to the second evaluation last time, and determining that the attribute of the eighth retransmission rate threshold is false if the retransmission rate of the current network packet is less than or equal to 2 times of the retransmission rate of the network packet when the true and false attribute of the eighth retransmission rate threshold is subjected to the second evaluation last time;
if the time interval is smaller than a third interval threshold, determining that the attribute of the eighth retransmission rate threshold is true if the value of the identifier representing the network congestion degree is true, and otherwise, determining that the attribute of the eighth retransmission rate threshold is false.
The aforementioned method, preferably, adjusting the eighth retransmission rate threshold according to the second evaluation result includes:
if the retransmission rate of the network packet is greater than the eighth retransmission rate threshold when the second evaluation is performed on the true and false attribute of the eighth retransmission rate threshold at the previous time, if the second evaluation result is true, the eighth retransmission rate threshold is decreased by a first preset step length; if the second evaluation result is false, increasing the eighth retransmission rate threshold by the first preset step length;
if the retransmission rate of the network packet when the second evaluation is performed on the true and false attribute of the eighth retransmission rate threshold at the previous time is smaller than or equal to the eighth retransmission rate threshold, if the second evaluation result is true, reducing the eighth retransmission rate threshold by a second preset step length; if the second evaluation result is false, keeping the eighth retransmission rate threshold unchanged;
the second preset step length is larger than the first preset step length.
The above method, preferably, further comprises: monitoring the receiving rate of the acknowledgement packets, wherein the receiving rate of the acknowledgement packets is the ratio of the number of the received acknowledgement packets corresponding to the non-retransmitted network packets to the number of the transmitted non-retransmitted network packets;
the setting of the maximum retransmission times, the retransmission timeout duration, the frame loss flag and the retransmission interval time according to the adjusted eighth retransmission rate threshold includes:
and when the retransmission rate of the network packet is greater than the adjusted eighth retransmission rate threshold and the difference between 1 and the adjusted eighth retransmission rate threshold is greater than the receiving rate of the acknowledgement packet, setting the maximum retransmission times, the retransmission timeout duration, the frame loss mark and the retransmission interval time according to the ratio of the retransmission rate of the network packet to the receiving rate of the acknowledgement packet.
Preferably, the setting of the maximum retransmission times, the retransmission timeout duration, the frame loss flag and the retransmission interval time according to the ratio of the retransmission rate of the network packet to the reception rate of the acknowledgement packet includes:
if frame loss is monitored, the value of the frame loss mark is evaluated as true; if no frame loss is monitored in the continuous preset time, assigning the value of the frame loss mark as false;
if the ratio is smaller than a first ratio threshold, setting the maximum retransmission times of all the frames as first retransmission times, setting the retransmission timeout duration as first retransmission timeout duration, setting the retransmission interval time of the key frame and the audio frame as first retransmission interval time, setting the retransmission interval time of other frames as second retransmission interval time, and setting the first retransmission interval time to be larger than the second retransmission interval time;
if the ratio is greater than or equal to the first ratio threshold and smaller than a second ratio threshold, only setting the maximum retransmission times of the key frame and the audio frame as the first retransmission times, setting the retransmission timeout duration as the first retransmission timeout duration, setting the maximum retransmission times of other frames as the second retransmission times, and setting the retransmission timeout duration as the second retransmission timeout duration; setting the retransmission interval time of the key frame and the retransmission interval time of the audio frame as the first retransmission interval time, setting the retransmission interval time of other frames as a third retransmission interval time, wherein the third retransmission interval time is less than the second retransmission interval time; the second retransmission times are less than the first retransmission times, and the second retransmission timeout duration is less than the first retransmission timeout duration;
if the ratio is greater than or equal to the second ratio threshold, only setting the maximum retransmission times of the key frame and the audio frame as third retransmission times, setting the retransmission timeout duration as third retransmission timeout duration, setting the maximum retransmission times of other frames as fourth retransmission times, and setting the retransmission timeout duration as fourth retransmission timeout duration; setting the retransmission interval time of the key frame and the retransmission interval time of the audio frame as fourth retransmission interval time, and setting the retransmission interval time of other frames as the third retransmission interval time; the fourth retransmission interval time is between the first retransmission interval time and the third retransmission interval time; wherein the fourth retransmission interval time is between the first retransmission interval time and the third retransmission interval time; the fourth retransmission times are less than the third retransmission times, and the third retransmission times are less than the first retransmission times; the fourth retransmission timeout duration is less than the third retransmission timeout duration, and the third retransmission timeout duration is less than the first retransmission timeout duration.
Preferably, the method for sending the probe packet to the aggregation server includes:
monitoring whether a network channel meets a preset non-congestion state;
and when the monitoring result is yes, sending a detection packet to the aggregation server.
In the above method, preferably, the transmission process of the frame data includes:
splitting each frame of data into a plurality of network packets;
acquiring a network packet to be sent as a target network packet;
determining a network channel with the minimum congestion amount from the plurality of network channels as an optimal network channel;
and sending the target network packet to the aggregation server through the optimal network channel, and returning to execute the step of acquiring a network packet to be sent as the target network packet.
Preferably, the method further includes, after sending the target network packet to the aggregation server through the optimal network channel:
waiting for the aggregation server to send a confirmation packet corresponding to the target network packet through the optimal network channel;
if the acknowledgement packet corresponding to the target network packet is not received within the preset retransmission timeout duration, retransmitting the target network packet to the aggregation server through the optimal network channel, and returning to execute the step of waiting for the aggregation server to send the acknowledgement packet corresponding to the target network packet through the optimal network channel and the subsequent steps;
and if the confirmation packet corresponding to the target network packet is not received after the retransmission times of the target network packet reach the preset retransmission times, discarding the target network packet.
In the method, preferably, the acknowledgement packet corresponding to the target network packet includes: the aggregation server receives sequence numbers of a plurality of network packets, wherein the network packets comprise the target network packet.
A live data transfer control apparatus comprising:
the monitoring module is used for monitoring the retransmission rate of the network packet sent to the aggregation server and the receiving rate of the detection confirmation packet corresponding to the detection packet bearing the detection data in the network packet; the network packet comprises a live broadcast packet for bearing live broadcast data and the detection packet; the network packet and the detection confirmation packet are both UDP data packets;
the first control module is used for adjusting the current code rate according to the receiving rate of the detection confirmation packet and the adjustment mode of the last code rate adjustment if the retransmission rate of the network packet is smaller than a first retransmission rate threshold value and the current code rate is not the preset maximum code rate, and encoding the live broadcast data to be transmitted into frame data according to the adjusted code rate;
the second control module is used for performing first evaluation on the true and false attribute of a third retransmission rate threshold if the retransmission rate of the network packet is greater than a second retransmission rate threshold, wherein a first evaluation result represents the adjustment direction of the value of the third retransmission rate threshold, the third retransmission rate threshold is adjusted according to the first evaluation result, and the true and false value of the identifier representing the network congestion degree is determined according to the adjusted third retransmission rate threshold; the current code rate is adjusted downwards according to the true and false value of the identifier representing the network congestion degree, and the live broadcast data to be transmitted is encoded into frame data according to the adjusted code rate;
and the transmission module is used for transmitting the frame data obtained by coding.
A computer-readable storage medium having instructions stored therein, which, when run on a terminal device, cause the terminal device to perform a live data transmission control method disclosed herein.
A live device, comprising: the system comprises a memory, a processor and a computer program which is stored on the memory and can run on the processor, wherein when the processor executes the computer program, the live broadcast data transmission control method disclosed by the application is realized.
According to the live broadcast data transmission control method and device, live broadcast equipment and the storage medium, data transmission is carried out based on a UDP protocol, the code rate is adjusted upwards according to the receiving rate of a detection confirmation packet and the adjustment mode of last code rate adjustment under the condition of better network condition by monitoring the network condition, when the network condition is worse, a threshold value evaluation method is adopted to determine the true and false value of an identifier representing the network congestion degree, the code rate is adjusted downwards according to the true and false value, and the live broadcast data to be transmitted are encoded and transmitted according to the adjusted code rate. The code rate is adaptively adjusted in real time according to the network condition, the historical adjustment mode of the code rate and the threshold evaluation strategy in the live broadcast process. The method and the device realize stable and high-speed transmission of audio and video data under the conditions of unstable networks such as outdoor and mobile live broadcasting, and greatly reduce the probability of the problems of audio and video blockage, blurred pictures, discontinuous audio and the like of the client.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a schematic structural diagram of a UDP protocol-based live network system provided in the present application;
fig. 2 is a data transmission flow between a live broadcast terminal and an aggregation server according to an embodiment of the present disclosure;
fig. 3 is a flowchart of an implementation in which a live broadcast terminal sends a network packet to an aggregation server according to an embodiment of the present application;
fig. 4 is a flowchart of an implementation of a live data transmission control method provided in the present application;
fig. 5 is a flowchart illustrating an implementation of adjusting a current code rate according to an adjustment mode of a previous code rate adjustment according to an embodiment of the present application;
fig. 6 is a flowchart of another implementation of adjusting the current code rate according to the last adjustment mode of the code rate adjustment according to the present application;
FIG. 7 is a flow chart illustrating one implementation of code rate reduction provided in the practice of the present application;
FIG. 8 is a flow chart illustrating another implementation of code rate reduction provided in the practice of the present application;
fig. 9 is a flowchart of an implementation of setting transmission parameters according to an embodiment of the present disclosure;
fig. 10 is a schematic structural diagram of a live data transmission control apparatus according to an embodiment of the present disclosure.
The terms "first," "second," "third," "fourth," and the like in the description and in the claims, as well as in the drawings described above, if any, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It should be understood that the data so used may be interchanged under appropriate circumstances such that embodiments of the application described herein may be practiced otherwise than as specifically illustrated.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be obtained by a person skilled in the art without inventive effort based on the embodiments of the present invention, are within the scope of the present invention.
Referring to fig. 1, fig. 1 is a schematic structural diagram of a network live broadcast system based on a UDP protocol according to an embodiment of the present application, where the system may include:
a live broadcast terminal 11, an aggregation server 12; the live broadcast terminal 11 and the aggregation server 12 are connected via a network.
The live broadcast terminal 11 is configured to collect audio and video data of a live broadcast site, encode the collected audio and video data (i.e., live broadcast data to be transmitted) into frame data, split the frame data into a plurality of data packets according to a certain rule, package the data packets into network packets based on a User Datagram Protocol (UDP), and send the network packets to the aggregation server 12 through a network.
In the embodiment of the application, the live broadcast terminal 11 and the aggregation server 12 may be connected to each other through multiple networks (e.g., a 3G/4G/LTE cellular network, a 2.4GHz Wi-Fi, a 5GHz Wi-Fi, an ethernet, a satellite, etc.), and during a live broadcast process, an optimal network may be selected from the multiple networks to perform live broadcast data transmission. Of course, the live broadcast terminal 11 and the aggregation server 12 may also be connected through any one of the above networks, that is, during the live broadcast, the live broadcast terminal 11 and the aggregation server 12 only communicate through one network.
The aggregation server 12 receives the network packet and then analyzes the data therein, and distributes the analyzed data to the client to realize the live video broadcast of the client. In particular, the method comprises the following steps of,
based on the network live broadcast system shown in fig. 1, a data transmission flow between the live broadcast terminal and the aggregation server provided by the present application is shown in fig. 2, and may include:
an encoder of the live broadcast terminal 11 encodes the acquired audio/video data to obtain audio/video frame data (for convenience of description, frame data is hereinafter referred to simply as frame data). During encoding, the h.264 standard or the h.265 standard may be adopted to encode the acquired audio and video data.
Live broadcast terminal 11 packs frame data, specifically: the live broadcast terminal 11 splits each frame data into a plurality of data packets with a certain size according to a certain rule, encapsulates the data packets into network packets based on the UDP protocol, and adds the network packets into a sending queue to wait for sending.
The live broadcast terminal 11 extracts the network packet waiting for transmission from the transmission queue, the transmission thread transmits the extracted network packet to the aggregation server 12 through the network, and after the transmission thread transmits the network packet, the network packet is added to the confirmation queue and the check queue.
After receiving the network packet (which is normally sent or retransmitted by the live broadcast terminal), and confirming that the data of the network packet is complete and has no damage, the aggregation server 12 returns a corresponding confirmation packet, i.e., an ACK packet, to the live broadcast terminal 11 through the network. The aggregation server 12 may be a server group constituted by a plurality of servers. The server group may include a first type of server connected to the live terminal 11 through a network, and a second type of server connected to the first type of server. The first type of server is used for communicating with the live broadcast terminal (receiving a network packet sent by the live broadcast terminal 11 through at least one network channel or sending an ACK packet to the live broadcast terminal), and the second type of server is used for aggregating the live broadcast data received by the first type of server into complete live broadcast data and distributing the aggregated live broadcast data to the live broadcast client.
When returning the ACK packet, the aggregation server 12 may return a corresponding ACK packet to the live broadcast terminal 11 every time a network packet is received and it is determined that the data of the network packet is complete and non-damaged. Alternatively, the first and second electrodes may be,
after receiving N (N is an integer greater than 1, for example, N may be 64) network packets, the aggregation server 12 confirms that the data is complete and non-corrupted network packets, and generates an overall ACK packet according to the sequence number of the confirmed network packet, where the overall ACK packet carries an overall state list, and each row in the list records information related to one confirmed network packet, including information such as the sequence number of the network packet, the time when the network packet is received, the frame type of the network packet, and a return code corresponding to the network packet. Assuming that the number of network packets with complete and non-destructive data to be confirmed is M, where M is a positive integer less than or equal to N, different ACKs may carry some same information, such as packet headers, and therefore, if an ACK packet is sent corresponding to each network packet with complete and non-destructive data (that is, M ACK packets are sent, where each ACK packet includes two parts, namely a packet header and specific data), the M ACK packets need to send data of the M packet headers and specific data carried by the M network packets in total, and if an overall ACK packet is sent corresponding to the M network packets, only data of 1 packet header and specific data carried by the M network packets need to be sent, so that compared with sending an ACK packet corresponding to each network packet with complete and non-destructive data, the amount of data carried by one ACK packet sent corresponding to a plurality of network packets with complete and non-destructive data is less, and network bandwidth can be saved.
After receiving the ACK packet, the live broadcast terminal 11 deletes the network packet corresponding to the ACK packet in the acknowledgement queue. If the ACK packet received by the live broadcast terminal 11 is a whole ACK packet, the whole status list can be analyzed from the whole ACK packet, if the sequence number of the transmitted network packet (for convenience of description, denoted as a first network packet) is present in the whole status list, it is described that the first network packet is correctly received by the aggregation server 12, and if the sequence number of the transmitted network packet (for convenience of description, denoted as a second network packet) is not present in the whole status list, it is described that the second network packet is not correctly received by the aggregation server 12, and the second network packet is placed in the replay queue to wait for retransmission.
While live broadcast terminal 11 packages the frame data, another task (i.e., timeout retransmission) is also in progress: corresponding to each network packet in the check queue, the live broadcast terminal checks whether the preset Retransmission Timeout (RTO) duration is exceeded and the acknowledgement packet sent by the aggregation server 12 is still not received, and if the check result is yes, the checked network packet is placed in the retransmission queue to wait for retransmission. If the check result is no, the checked network packet is not processed, and the next check is waited. The live broadcast terminal 11 may check whether an ACK packet corresponding to a network packet (for convenience of description, denoted as a third network packet) in the check queue is still not received after the preset RTO duration: and searching the third network packet in the confirmation queue when the storage time of the third network packet in the check queue reaches the preset RTO time, if the third network packet is searched, indicating that the ACK packet corresponding to the first network packet is not received even if the third network packet exceeds the preset RTO time, otherwise, indicating that the ACK packet corresponding to the third network packet is received.
The live broadcast terminal 11 extracts the network packet to be retransmitted from the retransmission queue, the retransmission thread sends the extracted network packet to the aggregation server 12 through the network, and after the retransmission thread sends the network packet, the network packet is added to the confirmation queue and the check queue.
Obviously, the network packets that have been normally sent (i.e., sent by the sending thread) and retransmitted (i.e., sent by the retransmission thread) but have not received the corresponding ACK packet are stored in the acknowledgement queue. And checking whether the network packets which are normally sent and retransmitted but do not receive the corresponding ACK packets beyond the preset RTO time length are stored in the queue.
In the above embodiment, if the live broadcast terminal 11 and the aggregation server 12 are connected through multiple networks, for convenience of description, each network packet to be sent is recorded as a target network packet, and an implementation flowchart of sending, by the live broadcast terminal 11, the network packet to the aggregation server is shown in fig. 3, and may include:
step S31: and determining the network channel with the minimum congestion amount as the optimal network channel.
Optionally, before calculating the congestion amount of each network channel, it may be determined whether the signal strength of the network channel is smaller than a preset strength threshold, if the determination result is yes, the congestion amount of the network channel is considered to be larger, the congestion amount of the network channel is not calculated, and if the determination result is no, the congestion amount of the network channel is calculated. That is, only the amount of congestion of the network channel having a large signal strength is calculated, thereby reducing the amount of calculation.
Optionally, the congestion amount of the network channel may be calculated according to the total number of all network packets (including the network packet that is normally sent, the network packet that is retransmitted, and the probe packet if the probe packet is sent) sent, the total number of all received ACK packets, and Round-Trip Time (RTT) corresponding to all network packets that receive the ACK packets within a second preset Time period (e.g., 1 s). The round trip delay represents a time interval from when the live broadcast terminal normally transmits a network packet to when a corresponding ACK packet is received.
Specifically, the congestion amount of each network channel can be calculated by the following calculation formula:
Figure GDA0002598612150000121
wherein, CCongestionIndicates the amount of congestion, FRTTRepresenting an average RTT within the second preset time period, that is, an average value of all RTTs within the second preset time period; mSendingRepresents the total number of all network packets sent within the second preset time period, MACKAnd the total number of all the ACK packets received in the second preset time period is represented.
Step S32: the target network packet is sent to the aggregation server 12 over the optimal network channel.
If there are two or more optimal network channels (i.e., the two or more network channels have the smallest and equal amounts of congestion), one channel may be selected from the two or more network channels as the optimal network channel to transmit the target network packet.
Further, after sending the target network packet, the method may further include:
the live broadcast terminal 11 waits for the aggregation server 12 to send an ACK packet corresponding to the target network packet through the optimal network channel.
If the acknowledgement packet corresponding to the target network packet is not received within the preset RTO duration, the live broadcast terminal 11 retransmits the target network packet to the aggregation server 12 through the optimal network channel, and returns to execute the step of waiting for the aggregation server to send the acknowledgement packet corresponding to the target network packet through the optimal network channel and the subsequent steps;
and if the confirmation packet corresponding to the target network packet is not received after the retransmission times of the target network packet reach the preset retransmission times, discarding the target network packet, namely not retransmitting the target network packet.
In the embodiment of the present application, data transmission is performed between the live broadcast terminal 11 and the aggregation server 12 based on a UDP protocol, and on this basis, a response and retransmission mechanism between the live broadcast terminal 11 and the aggregation server 12 is defined, so that a relatively reliable guarantee is provided for data transmission between the live broadcast terminal 11 and the aggregation server 12. Compared with a TCP (Transmission Control Protocol), the UDP can provide higher throughput and lower delay, so that the data Transmission method between the live broadcast terminal 11 and the aggregation server 12 provided in the embodiment of the present application can provide higher throughput and lower delay while providing relatively reliable guarantee for data Transmission.
In the above embodiment, when the live broadcast terminal 11 encodes the live broadcast data to be transmitted into frame data, the live broadcast data to be transmitted is encoded according to a certain code rate. When outdoor live broadcast or mobile live broadcast is performed, since a network is usually unstable, if a fixed bit rate is used for encoding, it cannot be guaranteed that live broadcast is performed stably and smoothly, and thus, the bit rate needs to be dynamically adjusted. Based on this, an implementation flowchart of the live data transmission control method provided by the present application is shown in fig. 4, where the live data transmission control method is applied to a live terminal, and the method may include:
step S41: monitoring the retransmission rate of a network packet sent to the aggregation server and the receiving rate of a detection confirmation packet corresponding to a detection packet bearing detection data in the network packet; the network packet comprises a live broadcast packet for bearing live broadcast data and the detection packet; the network packet and the detection confirmation packet are both UDP data packets.
In this embodiment of the application, the network packets sent by the live broadcast terminal 11 to the aggregation server include two types, which are respectively a first type network packet for carrying live broadcast data and recorded as a live broadcast packet, and a second type network packet for carrying detection data and recorded as a detection packet. The live broadcast terminal 11 sends a live broadcast packet to the aggregation server in real time, namely, the live broadcast packet is sent to the aggregation server as long as audio and video data are collected; the probe packet may be sent when needed, and the purpose of sending the probe packet to the aggregation server is to evaluate the congestion status of the network channel.
The process of the live broadcast terminal 11 sending the detection packet to the aggregation server is as follows: the method includes the steps that at least one frame of video data for detection is split into a plurality of detection packets (namely network packets for detection) and sent to an aggregation server 12, after the aggregation server 12 receives the detection packets, if the data in the detection packets are confirmed to be complete and undamaged, an ACK packet (marked as a detection confirmation packet) is returned to a live broadcast terminal 11, and if the live broadcast terminal 11 does not receive the ACK packet sent by aiming at a first detection packet within a preset RTO time length, the first detection packet is retransmitted. The specific sending and retransmitting processes of the probe packets can refer to the foregoing embodiments, and are not described in detail here.
In the process of sending the network packet to the aggregation server, if the sent network packet only includes the live packet, the monitored retransmission rate of the network packet is actually the retransmission rate of the live packet, and at this time, the reception rate of the detection acknowledgement packet corresponding to the detection packet does not need to be monitored. If the transmitted network packet includes a detection packet in addition to the live packet, the receiving rate of the detection acknowledgement packet corresponding to the detection packet is counted in addition to the retransmission rate of the transmitted network packet.
For convenience of description, the retransmission rate of the network packet is denoted as PRetransmission
The retransmission rate of the network packet refers to: the number of retransmitted network packets in 1s is a ratio of the number of all network packets transmitted in 1 s. For example, assuming that the number of retransmitted network packets in 1s is RP1 and the number of non-retransmitted network packets is NP1, then:
Figure GDA0002598612150000141
step S42: if retransmission rate P of network packetRetransmissionAnd if the current code rate is smaller than the first retransmission rate threshold and is not the preset maximum code rate, the current code rate is adjusted upwards according to the receiving rate of the detection confirmation packet and the adjustment mode of the last code rate adjustment, and the direct broadcast data to be transmitted are encoded into frame data according to the adjusted code rate. The process advances to step S45.
Retransmission rate P of network packetsRetransmissionWhen the retransmission rate is smaller than the first retransmission rate threshold, the network condition is better, and the code rate can be adjusted upwards at the moment. Optionally, the first retransmission rate threshold may be 1/16.
The adjustment mode of code rate adjustment is as follows: up-regulation or down-regulation. The adjustment modes of the last code rate adjustment are different, and the adjustment quantity of the current code rate up-regulation may be different or the same.
Step S43: if retransmission rate P of network packetRetransmissionGreater than a second retransmission rate threshold PSevere and severeFor the third retransmission rate threshold XSevere and severeThe first evaluation result represents a third retransmission rate threshold value XSevere and severeAccording to the first evaluation result, the third retransmission rate threshold value is adjusted, and according to the adjusted third retransmission rate threshold value, the true and false value of the identifier representing the network congestion degree is determined.
Wherein the second retransmission rate threshold is greater than the first retransmission rate threshold.
Retransmission rate P of network packetsRetransmissionGreater than the second retransmission rate thresholdWhen the network condition is poor, the code rate needs to be adjusted downwards.
In the embodiment of the present application, a third retransmission rate threshold X is setSevere and severeThe congestion degree of the network is determined, and the congestion degree of the network is marked by the true and false value of the identifier representing the congestion degree of the network, that is, the third retransmission rate threshold is used for determining the true and false value of the identifier representing the congestion degree of the network. Specifically, if the first identifier represents that the network congestion degree is the first degree, it is assumed that the value of the first identifier is true, which indicates that the network congestion degree reaches the first degree, and if the value of the first identifier is false, which indicates that the network congestion degree does not reach the first degree.
In this embodiment, the third retransmission rate threshold XSevere and severeIs not fixed, but is instead applied to X according to network conditionsSevere and severeThe value of (a) is adjusted in real time to adapt to real-time network conditions. In particular, if PRetransmission>PSevere and severeThen to XSevere and severeThe first evaluation is performed. According to the first evaluation result to XSevere and severeAdjustment according to adjusted XSevere and severeAnd determining a true and false value of the identifier representing the network congestion degree, namely determining the congestion degree of the network.
XSevere and severeIs true or false attribute characterization XSevere and severeAdjustment direction of value, if XSevere and severeIs true, X is illustratedSevere and severeNeed to be reduced, otherwise, X is statedSevere and severeThe value of (a) needs to be increased or unchanged.
Second retransmission Rate threshold PSevere and severeIs generally between 20% and 30%, that is to say PSevere and severeThe value of (a) is at least 20% and at most 30%.
The identifiers representing the network congestion degree can be multiple, and different identifiers with true values represent different congestion degrees of the network.
Step S44: and adjusting the current code rate down according to the true and false value of the identifier representing the network congestion degree, and encoding the live broadcast data to be transmitted into frame data according to the adjusted code rate. The process advances to step S45.
Step S45: and transmitting the encoded frame data to an aggregation server.
The process of transmitting frame data specifically can refer to the foregoing embodiments, and is not described in detail here.
The live broadcast data transmission control method provided by the application carries out data transmission based on a UDP protocol, by monitoring the network condition, under the condition of better network condition, the code rate is adjusted upwards according to the receiving rate of a detection confirmation packet and the adjustment mode of last code rate adjustment, when the network condition is worse, a threshold value evaluation method is adopted to determine the true and false value of the identifier representing the network congestion degree, the code rate is adjusted downwards according to the true and false value, and the live broadcast data to be transmitted is encoded and transmitted according to the adjusted code rate. The code rate is adaptively adjusted in real time according to the network condition, the historical adjustment mode of the code rate and the threshold evaluation strategy in the live broadcast process. The method and the device realize stable and high-speed transmission of audio and video data under the conditions of unstable networks such as outdoor and mobile live broadcasting, and greatly reduce the probability of the problems of audio and video blockage, blurred pictures, discontinuous audio and the like of the client.
In an alternative embodiment, a flowchart of an implementation of the above adjusting the current code rate according to the receiving rate of the sounding acknowledgement packet and the adjustment manner of the last code rate adjustment is shown in fig. 5, and may include:
step S51: judging whether the adjustment quantity delta C during the last code rate adjustment is larger than zero, if the judgment result is that delta C is larger than 0, indicating that the last code rate adjustment is to adjust the code rate upwards, and executing the step S52; if the determination result is Δ C is less than or equal to 0, it indicates that the previous code rate adjustment is to lower the code rate, and step S55 is executed.
Step S52: and judging whether the receiving rate of the detection confirmation packet meets a preset network congestion condition, if so, indicating that the network is congested, executing step S53, otherwise, indicating that the network is not congested, and executing step S54.
One implementation manner of determining whether the receiving rate of the detection acknowledgement packet meets the preset network congestion condition may be:
and comparing the receiving rate of the detection confirmation packet with a preset receiving rate threshold (such as 80%), if the receiving rate of the detection confirmation packet is smaller than the receiving rate threshold, indicating that the preset network congestion condition is met, otherwise, indicating that the preset network congestion condition is not met.
Step S53: and comparing the average code rate in the latest third preset time with the current code rate, if the comparison result indicates that the average code rate is close to the current code rate, executing the step S55, otherwise, executing the step S54.
The average code rate in the latest third preset duration (denoted as T) is: the number of bits of the data transmitted per second in the third preset time period T is averaged, that is, the ratio of the number of bits of the data transmitted in the third preset time period T to the third preset time period T. Optionally, the third preset time period may be 30 s.
The average code rate is close to the current code rate: the average code rate and the current code rate satisfy the following association relationship: the ratio of the average code rate to the current code rate is greater than a third ratio threshold and less than a fourth ratio threshold. Wherein the fourth ratio threshold is greater than the third ratio threshold. For example, the third ratio threshold may be 0.8 and the fourth ratio threshold may be 1.2, i.e.
Figure GDA0002598612150000171
Step S54: and adjusting the current code rate by the second adjustment amount.
Step S55: and adjusting the current code rate by a first adjustment amount.
Wherein the second adjustment amount is greater than the first adjustment amount. Optionally, the second adjustment amount may be one eighth of the current code rate, and the first adjustment amount may be one sixteenth of the current code rate.
In the embodiment of the application, according to the receiving rate of the detection confirmation packet and the previous code rate adjustment mode (namely, up-regulation or down-regulation), a dichotomy adjustment strategy (namely, the previous code rate adjustment mode is an adjustment strategy of the current code rate during up-regulation and the previous code rate adjustment mode is an adjustment strategy of the current code rate during down-regulation) is adopted to adjust the current code rate, so that the code rate is adjusted according to the network congestion condition and the prior knowledge, and the stability of live broadcast is further improved.
In an optional embodiment, another implementation flowchart for adjusting the current code rate according to the receiving rate of the sounding confirmation packet and the adjustment manner of the last code rate adjustment provided by the present application is shown in fig. 6, in this embodiment, on the basis of the embodiment shown in fig. 5, if the last code rate adjustment is an up adjustment, before determining whether the receiving rate of the sounding confirmation packet meets the preset network congestion condition, the method may further include:
step S61: and judging whether the code rate is continuously adjusted up for three times, namely judging whether the code rate is continuously adjusted up for three times before the current code rate adjustment, namely judging whether the three code rate adjustments before the current code rate adjustment are all adjusted up.
If yes, go to step S62; if not, go to step S52 and the following steps.
Step S62: adjusting the current code rate to the average code rate within the latest third preset time length;
through the code rate adjustment of the embodiment, the stability of live broadcasting is further improved.
One implementation of the code rate down-regulation provided by the present application is described below with reference to fig. 7. Fig. 7 is a flow chart of an implementation of the code rate down-regulation provided by the present application. The realization process is as follows:
retransmission rate P of packets in a networkRetransmissionGreater than a second retransmission rate threshold PSevere and severeFor the case of the third retransmission rate threshold value XSevere and severeThe first evaluation is performed on the true and false attributes, and the third retransmission rate threshold is adjusted according to the first evaluation result, if the retransmission rate P of the network packet is determinedRetransmissionGreater than the adjusted third retransmission rate threshold XSevere and severeAnd an acknowledgement packet (i.e., an acknowledgement packet corresponding to the transmitted network packet) reception rate PackLess than a first ratio threshold Pack1Determining that the value of the first identifier bForceDrop is true; if retransmission rate P of network packetRetransmissionGreater than a fifth retransmission rate threshold PRetransmission 5And the current network has frame loss, and the value of the second identifier bfrcelost is determined to be true.
And adjusting the code rate under the condition that the value of the first identifier bForceDrop is true and/or the value of the second identifier bForceLost is true.
First ratio threshold value Pack1May be 90%, a fifth retransmission rate threshold PRetransmission 5Or may be 90%, although the first and fifth retransmission rate thresholds may be different.
In an alternative embodiment, the triple transmission rate may be preset by X based on the time interval between the retransmission occurrence time of a network packet in which retransmission occurs and the first transmission time of the network packet in a webcast systemSevere and severeThe first evaluation is performed on the true and false attributes, and the specific implementation manner may be:
acquiring a time interval between the sending time of a currently retransmitted network packet and the first sending time of the currently retransmitted network packet;
if the obtained time interval is greater than the first interval threshold, determining that the attribute of the third retransmission rate threshold is false. Alternatively, the first time interval threshold may be 3 s.
If the obtained time interval is greater than the second interval threshold and less than the first interval threshold, determining that the attribute of the third retransmission rate threshold is true if the retransmission rate of the network packet is greater than the fourth retransmission rate threshold, and determining that the attribute of the third retransmission rate threshold is false if the retransmission rate of the network packet is less than or equal to the fourth retransmission rate threshold. Optionally, the second time interval threshold may be 2s, and the fourth retransmission rate threshold may be 0.5.
If the acquired time interval is smaller than the third interval threshold, determining that the attribute of the third retransmission rate threshold is true if the current network has a frame loss, and determining that the attribute of the third retransmission rate threshold is false if the current network has no frame loss. Alternatively, the third time interval threshold may be 1 s.
Whether the current network has frame loss can be judged by the preset true and false values of the frame loss mark, specifically, if the value of the frame loss mark is true, the current network has frame loss, otherwise, the current network does not have frame loss.
The value of the frame loss mark can be determined according to a monitoring result of the network, if frame loss is monitored, the value of the frame loss mark is assigned to be true, and if frame loss is not monitored in a continuous fourth preset time period, the value of the frame loss mark is assigned to be false.
The process of monitoring whether the network loses frames can be carried out in real time, or the process of monitoring whether the network loses frames can be started when the congestion condition of the network is monitored, but the congestion is not serious yet. The specific process can be seen in the following examples.
In an alternative embodiment, the third retransmission rate threshold value X is determined according to the first evaluation resultSevere and severeOne implementation of the adjustment may be:
if the previous pair of third retransmission rate thresholds XSevere and severeThe retransmission rate of the network packet when the true and false attributes are first evaluated is greater than a third retransmission rate threshold value XSevere and severeThen, if the first evaluation result is true, the third retransmission rate threshold value X is setSevere and severeReducing the first preset step length; if the first evaluation result is false, the third retransmission rate threshold value X is usedSevere and severeAnd increasing the first preset step length.
Assume that "for the third retransmission rate threshold value X" in step S43Severe and severeThe first evaluation of the true and false attribute of the third retransmission rate threshold is performed for the nth time, and the previous first evaluation of the true and false attribute of the third retransmission rate threshold is performed for the (n-1) th time.
Previous to third retransmission rate threshold XSevere and severeThe retransmission rate of the network packet when the true and false attributes are first evaluated is greater than a third retransmission rate threshold value XSevere and severeMeans that the previous threshold value X of the third retransmission rateSevere and severeThe retransmission rate of the network packet at the first evaluation of the true and false attribute of (c) is greater than the current (i.e., at the nth evaluation of the true and false attribute of the third retransmission rate threshold) third retransmission rate threshold XSevere and severe
If the previous pair of third retransmission rate thresholds XSevere and severeThe retransmission rate of the network packet when the first evaluation is performed on the true and false attribute of (1) is less than or equal to a third retransmission rate threshold value XSevere and severeThen, if the first evaluation result is true, the third retransmission rate threshold value X is setSevere and severeReducing a second preset step length; if it is firstIf the evaluation result is false, the third retransmission rate threshold value X is setSevere and severeRemain unchanged.
Previous to third retransmission rate threshold XSevere and severeThe retransmission rate of the network packet when the first evaluation is performed on the true and false attribute of (1) is less than or equal to a third retransmission rate threshold value XSevere and severeMeans that the previous threshold value X of the third retransmission rateSevere and severeThe retransmission rate of the network packet when the first evaluation is performed is less than or equal to the current third retransmission rate threshold.
Wherein the second preset step length is larger than the first preset step length.
In the embodiment of the application, the third retransmission rate threshold is adjusted by combining the historical retransmission rate of the network packet, so that the adjusted third retransmission rate threshold is more suitable for the change condition of the network, and the adjusted code rate is more suitable for the real-time condition of the network.
In an alternative embodiment, the first preset step size is: a sum of the first reference step size and the first random step size; the second preset step length is as follows: a sum of the second reference step size and the second random step size;
wherein the second reference step size is greater than the first reference step size. For example, the first reference step size is 0.02 and the second reference step size is 0.05.
The first random step is a random number between 0 and a, the random number satisfies uniform distribution, the second step is a random number between 0 and a, and the random number satisfies uniform distribution. a is a positive number less than or equal to the first reference step. Both the first random step size and the second random step size may be obtained by the function random (a). For example, a may be 0.02.
In an alternative embodiment, in addition to counting the retransmission rate of the network packet, the receiving rate P of the acknowledgement packet corresponding to the network packet may also be countedackThe acknowledgment packet reception rate is the ratio of the number of acknowledgment packets received over a certain time period (e.g., 10s) to the number of non-retransmitted network packets transmitted. The non-retransmitted network packet herein includes: network packets for which no retransmission occurs, and although retransmission occurs, is the secondA network packet sent at a time.
Correspondingly, one implementation manner of determining the true and false values of the identifier representing the network congestion degree according to the adjusted third retransmission rate threshold may be:
if the retransmission rate of the network packet is greater than the adjusted third retransmission rate threshold and the packet receiving rate is confirmed to be smaller than the first ratio threshold, determining that the value of the first identifier is true;
if the retransmission rate of the network packet is greater than the fifth retransmission rate threshold value and the current network has a frame loss, determining that the value of the second identifier is true;
and the network congestion degree represented by the second identifier with the value being true is greater than the network congestion degree represented by the first identifier with the value being true.
In an alternative embodiment, please refer to fig. 8, fig. 8 is a flowchart illustrating another implementation of the code rate down-regulation provided by the present application. One implementation way of adjusting the current code rate downward according to the true and false values of the identifier representing the network congestion degree may be:
and if the values of the first identification and the second identification are both false, the current code rate is adjusted downwards according to the adjustment mode of the last code rate adjustment, and different adjustment modes of the last code rate correspond to different downward adjustment strategies.
If the value of the second identifier is true, if the first condition is satisfied, that is, if the retransmission rate of the network packet is greater than the sixth retransmission rate threshold PRetransmission 6The acknowledgement packet reception rate is less than a second rate threshold Pack2And the adjustment time interval (i.e. the time interval between the time of the current code rate adjustment and the time of the previous code rate adjustment) is less than a fifth preset time length delta t1, and the current code rate is adjusted down by a third adjustment amount; if the first condition is not satisfied, if the second condition is satisfied, the retransmission rate of the probe packet is greater than the sixth retransmission rate threshold PRetransmission 6The acknowledgement packet reception rate is less than a second rate threshold Pack2And adjusting the time interval to be greater than or equal to a fifth preset time duration delta t1, and adjusting the current code rate by a fourth adjustment amount. If the first condition and the second condition are not satisfied, if the value of the first identifier is true, the current code rate is reduced to a preset minimum code rate, otherwise, the current code rate is reduced to the preset minimum code rateAnd adjusting the current code rate by a fifth adjustment amount.
And under the condition that the second identifier is false, if the value of the first identifier is true, reducing the current code rate to a preset minimum code rate, otherwise, reducing the current code rate by a fifth regulating quantity.
And the fourth adjustment amount is smaller than the fifth adjustment amount, and the fifth adjustment amount is smaller than the third adjustment amount.
Optionally, the third adjustment amount may be 40% of the current code rate, the fourth adjustment amount may be 10% of the current code rate, and the fifth adjustment amount may be 20% of the current code rate.
Sixth retransmission Rate threshold PRetransmission 6May be 30%, the second ratio threshold Pack2May be 60%, and the fifth preset time period Δ t1 may be 2 s.
In an optional embodiment, an implementation manner of the adjusting the current code rate downward according to the adjustment manner of the previous code rate adjustment may be that:
if the last code rate is adjusted to be adjusted upwards, the current code rate is adjusted downwards by the fourth adjustment quantity;
and if the last code rate is adjusted to be adjusted downwards, the current code rate is adjusted downwards by the fifth adjustment quantity.
In an optional embodiment, the live data transmission control method provided by the present application may further include a transmission parameter setting process, as shown in fig. 9, which is an implementation flowchart for setting a transmission parameter provided by the embodiment of the present application, and the implementation flowchart may include:
retransmission rate P of packets in a networkRetransmissionLess than a second retransmission rate threshold PSevere and severeAnd the retransmission rate P of the network packetRetransmissionGreater than a seventh retransmission rate threshold PGeneral purposeIn the case of (1), i.e. in PSevere and severe>PRetransmission>PGeneral purposeIn the case of (3), for the eighth retransmission rate threshold value XGeneral purposeThe second evaluation result represents the adjustment direction of the value of the eighth retransmission rate threshold, and the eighth retransmission rate threshold X is subjected to the second evaluation according to the second evaluation resultGeneral purposeAdjusting the maximum retransmission times, the retransmission timeout duration, the frame loss mark and the retransmission interval time according to the adjusted eighth retransmission rate thresholdAnd (4) setting rows. In particular, the method comprises the following steps of,
retransmission rate P of packets in a networkRetransmissionGreater than the adjusted eighth retransmission rate threshold XGeneral purposeAnd the difference between 1 and the adjusted eighth retransmission rate threshold is greater than the acknowledgment packet reception rate, i.e., PRetransmission>XGeneral purposeAnd P isack<1-XGeneral purposeUnder the condition of (1), setting the maximum retransmission times, the retransmission timeout duration, the frame loss mark and the retransmission interval time.
In the embodiment of the present application, an eighth retransmission rate threshold X is setGeneral purposeTo judge whether to set the parameters of maximum retransmission times, retransmission overtime length, frame loss mark and retransmission interval time, etc.
In this embodiment, the eighth retransmission rate threshold XGeneral purposeIs not fixed, but is rather directed to X according to real-time network conditionsGeneral purposeThe value of (a) is adjusted in real time to adapt to real-time network conditions.
XGeneral purposeIs true or false attribute characterization XGeneral purposeAdjustment direction of value, if XGeneral purposeIs true, X is illustratedGeneral purposeNeed to be reduced, otherwise, X is statedGeneral purposeThe value of (a) needs to be increased or unchanged.
Seventh retransmission Rate threshold PGeneral purposeIs generally between 5% and 20%, that is to say PGeneral purposeThe value of (a) is 5% at minimum and 20% at maximum.
In an alternative embodiment, the eighth retransmission rate threshold X may be set based on a time interval between a retransmission occurrence time of a network packet in which retransmission occurs and a first transmission time of the network packet in the webcast systemGeneral purposeThe second evaluation is performed on the true and false attributes, and the specific implementation manner may be:
acquiring a time interval between the sending time of a currently retransmitted network packet and the first sending time of the currently retransmitted network packet;
if the obtained time interval is greater than the first interval threshold, determining that the attribute of the eighth retransmission rate threshold is false.
If the obtained time interval is greater than the second interval threshold and smaller than the first interval threshold, determining that the attribute of the eighth retransmission rate threshold is true if the retransmission rate of the current network packet is greater than 2 times of the retransmission rate of the network packet when the true and false attribute of the eighth retransmission rate threshold is subjected to the second evaluation last time, and determining that the attribute of the eighth retransmission rate threshold is false if the retransmission rate of the current network packet is less than or equal to 2 times of the retransmission rate of the network packet when the true and false attribute of the eighth retransmission rate threshold is subjected to the second evaluation last time.
If the acquired time interval is smaller than the third interval threshold, determining that the attribute of the eighth retransmission rate threshold is true if the value of the identifier representing the network congestion degree is true, and otherwise, determining that the attribute of the eighth retransmission rate threshold is false.
When the identifiers representing the network congestion degrees are multiple, the value of the identifier representing the network congestion degree is that: the value of at least one identifier representing the congestion degree of the network is true.
In an optional embodiment, the eighth retransmission rate threshold X is determined according to the second evaluation resultGeneral purposeOne implementation of the adjustment may be:
if the eighth retransmission rate threshold value X is processed in the previous timeGeneral purposeThe retransmission rate of the network packet when the true and false attribute of (2) is second evaluated is larger than an eighth retransmission rate threshold value XGeneral purposeThen, if the second evaluation result is true, the eighth retransmission rate threshold value X is setGeneral purposeReducing the first preset step length; if the second evaluation result is false, the eighth retransmission rate threshold value X is setGeneral purposeAnd increasing the first preset step length.
It is assumed that "second evaluation of true and false attribute of eighth retransmission rate threshold" in the foregoing embodiment is to perform the eighth retransmission rate threshold XGeneral purposeThe nth second evaluation of the true and false attribute of (2), the previous evaluation is performed on the eighth retransmission rate threshold value XGeneral purposeThe second evaluation of the true-false attribute of (2) is an (n-1) th evaluation of the true-false attribute of the eighth retransmission rate threshold.
Previous to eighth retransmission rate threshold XGeneral purposeThe retransmission rate of the network packet when the true and false attribute of (2) is second evaluated is larger than an eighth retransmission rate threshold value XGeneral purposeMeans that the previous time is to the second timeEight retransmission rate threshold XGeneral purposeThe retransmission rate of the network packet at the second evaluation of the true and false attribute of (b) is greater than the current eighth retransmission rate threshold value X (i.e., at the nth evaluation of the true and false attribute of the eighth retransmission rate threshold value)General purpose
If the eighth retransmission rate threshold value X is processed in the previous timeGeneral purposeThe retransmission rate of the network packet when the true and false attribute of (2) is second evaluated is less than or equal to an eighth retransmission rate threshold value XGeneral purposeThen, if the second evaluation result is true, the eighth retransmission rate threshold value X is setGeneral purposeReducing a second preset step length; if the second evaluation result is false, the eighth retransmission rate threshold value X is setGeneral purposeKeeping the same;
wherein the second preset step length is larger than the first preset step length. The composition of the first preset step and the second preset step can be referred to the foregoing embodiments, and will not be described in detail here.
In this embodiment, the eighth retransmission rate threshold is adjusted in combination with the historical network packet retransmission rate, so that the adjusted eighth retransmission rate threshold is more adaptive to the network change condition, and the adjusted code rate is more adaptive to the network real-time condition.
In an alternative embodiment, in addition to counting the retransmission rate of the network packet, the receiving rate P of the acknowledgement packet corresponding to the network packet may also be countedackThe acknowledgment packet reception rate is the ratio of the number of acknowledgment packets received over a certain time period (e.g., 10s) to the number of non-retransmitted network packets transmitted. The non-retransmitted network packet herein includes: network packets for which no retransmission occurs and network packets that are transmitted for the first time although a retransmission occurs.
Correspondingly, one implementation manner of setting the maximum retransmission times, the retransmission timeout duration, the frame loss flag and the retransmission interval time according to the adjusted eighth retransmission rate threshold may be as follows:
and when the retransmission rate of the network packet is greater than the adjusted eighth retransmission rate threshold and the difference value between the threshold value 1 and the adjusted eighth retransmission rate threshold is greater than the receiving rate of the acknowledgement packet, setting the maximum retransmission times, the retransmission timeout duration, the frame loss mark and the retransmission interval time according to the ratio of the retransmission rate of the network packet to the receiving rate of the acknowledgement packet. In particular, the method comprises the following steps of,
if frame loss is monitored, the value of the frame loss mark is evaluated as true; if no frame loss is monitored in the continuous preset time, assigning the value of the frame loss mark as false;
if the ratio is smaller than a first ratio threshold, setting the maximum retransmission times of all the frames as first retransmission times, setting the retransmission timeout duration as first retransmission timeout duration, setting the retransmission interval time of the key frame and the audio frame as first retransmission interval time, and setting the retransmission interval time of other frames as second retransmission interval time, wherein the first retransmission interval time is larger than the second retransmission interval time. Optionally, the first ratio threshold may be 0.8, the first retransmission interval time may be 3s, and the second retransmission interval time may be 2 s.
In the live data transmission process, sound data and image data are separately encoded, wherein the sound data is encoded to obtain audio frames and the image data is encoded to obtain video frames, which in turn comprise key frames (i.e., I-frames) and intermediate frames (i.e., P-frames and B-frames). The "other frame" described in the embodiments of the present application refers to an intermediate frame.
If the ratio is greater than or equal to a first ratio threshold and smaller than a second ratio threshold, only setting the maximum retransmission times of the key frame and the audio frame as first retransmission times, setting the retransmission timeout duration of the key frame and the audio frame as first retransmission timeout duration, setting the maximum retransmission times of other frames as second retransmission times, and setting the retransmission timeout duration of other frames as second retransmission timeout duration; the retransmission interval time of the key frame and the retransmission interval time of the audio frame are both set as first retransmission interval time, the retransmission interval time of other frames are both set as third retransmission interval time, and the third retransmission interval time is smaller than the second retransmission interval time; the second retransmission times are less than the first retransmission times, and the second retransmission timeout duration is less than the first retransmission timeout duration.
Alternatively, the second ratio threshold may be 1.2, and the third retransmission interval time may be 1.5 s.
If the ratio is greater than or equal to a second ratio threshold, only setting the maximum retransmission times of the key frame and the audio frame as third retransmission times, setting the retransmission timeout duration as third retransmission timeout duration, setting the maximum retransmission times of other frames as fourth retransmission times, and setting the retransmission timeout duration as fourth retransmission timeout duration; the retransmission interval time of the key frame and the retransmission interval time of the audio frame are both set as the fourth retransmission interval time, and the retransmission interval time of other frames are both set as the third retransmission interval time. Optionally, the fourth retransmission interval time may be 2.5 s.
Wherein the content of the first and second substances,
the fourth retransmission interval time is between the first retransmission interval time and the third retransmission interval time;
the fourth retransmission times are less than the third retransmission times, and the third retransmission times are less than the first retransmission times;
the fourth retransmission timeout duration is less than the third retransmission timeout duration, and the third retransmission timeout duration is less than the first retransmission timeout duration.
In an optional embodiment, an implementation manner of sending the probe packet to the aggregation server may be:
and monitoring whether the network channel meets a preset non-congestion state. The method specifically comprises the following steps:
counting the total number S of the retransmitted network packets in a sixth preset time lengthRetransmissionTotal number of normally transmitted network packets SSendingTotal number of transmitted probe packets SprobeThe ratio P of the packets acknowledged as received to the total normally transmitted networkack. Then, if
Figure GDA0002598612150000251
And P isack>Pack3The condition is satisfied, and
Figure GDA0002598612150000252
and when the conditions are met, determining that the network channel meets the preset non-congestion conditions, otherwise, determining that the network channel does not meet the preset non-congestion conditions. Wherein the content of the first and second substances,
Pprobelfor a preset ratio of allowed detections, the value is
Figure GDA0002598612150000253
To (c) to (d); pack3A preset third ratio threshold, which may take, for example, 80%; pS1The value of the preset probe packet transmission rate threshold may be 20%, for example.
Optionally, the sixth preset time period may be 10s, and the third ratio threshold Pack3May be 80%, and the threshold value P for the sending rate of the probe packet is setS1May be 20%.
And if so, sending a detection packet to the aggregation server.
That is, in the embodiment of the present application, the probe packet is sent only when the bandwidth of the network channel is relatively abundant, and otherwise, the probe packet is not sent. The situation that the network channel quality is further reduced because the bandwidth of the network channel is smaller and the probe packet is still sent is avoided.
Optionally, when the live broadcast terminal is connected to the aggregation server through a plurality of network channels, monitoring whether the network channels satisfy a preset non-congestion state may include:
respectively monitoring whether each network channel meets a preset non-congestion state;
correspondingly, if the monitoring result is yes, sending a detection packet to the aggregation server may specifically be:
and respectively sending detection packets to each network channel meeting the preset non-congestion state.
In conclusion, the method for efficiently and accurately adjusting the coding code rate and transmitting the live broadcast data according to the adjusted code rate in real time according to the change of the network environment is provided, and the method is particularly suitable for the live broadcast scenes of outdoor live broadcast and mobile live broadcast. The method can monitor the spare amount of the current bandwidth by means of bandwidth detection, provides basis for code rate up-regulation, and determines true and false values of at least two identifiers for representing network congestion states by adopting a threshold evaluation algorithm, so as to provide basis for code rate down-regulation. In addition, the method adopts dichotomy (namely, the adjustment amount or the adjustment method at this time is determined according to the last adjustment mode), priori knowledge (the last adjustment mode, the retransmission rate during the last evaluation and the like), the acknowledgement packet acceptance rate and the like to perform self-adaptive code rate adjustment, so that the method provided by the application can be stably and continuously developed under a severe network environment, the quality of live IP video streams is ensured under the condition of low delay, and the optimal online video watching experience is provided for users.
Corresponding to the method embodiment, the application also provides a live data transmission control device. As shown in fig. 10, a schematic structural diagram of a live data transmission control apparatus provided in the present application may include:
a monitoring module 101, a first control module 102, a second control module 103 and a transmission module 104; wherein the content of the first and second substances,
the monitoring module 101 is configured to monitor a retransmission rate of a network packet sent to the aggregation server and a reception rate of a probe acknowledgement packet corresponding to a probe packet carrying probe data in the network packet; the network packet comprises a live broadcast packet for bearing live broadcast data and the detection packet; the network packet and the detection confirmation packet are both UDP data packets;
the first control module 102 is used for determining the retransmission rate P of the network packetRetransmissionAnd if the current code rate is smaller than the first retransmission rate threshold and is not the preset maximum code rate, the current code rate is adjusted upwards according to the receiving rate of the detection confirmation packet and the adjustment mode of the last code rate adjustment, and the direct broadcast data to be transmitted are encoded into frame data according to the adjusted code rate.
The second control module 103 is used for determining the retransmission rate P of the network packetRetransmissionGreater than a second retransmission rate threshold PSevere and severeFor the third retransmission rate threshold XSevere and severeThe first evaluation result represents the adjustment direction of the value of the third retransmission rate threshold, the third retransmission rate threshold is adjusted according to the first evaluation result, and the true and false value of the identifier representing the network congestion degree is determined according to the adjusted third retransmission rate threshold; and adjusting the current code rate down according to the true and false value of the identifier representing the network congestion degree, and encoding the live broadcast data to be transmitted into frame data according to the adjusted code rate.
The transmission module 104 is configured to transmit the encoded frame data.
Wherein the second retransmission rate threshold is greater than the first retransmission rate threshold.
The live broadcast data transmission control device provided by the application carries out data transmission based on a UDP protocol, by monitoring the network condition, under the condition of better network condition, the code rate is adjusted upwards according to the receiving rate of a detection confirmation packet and the adjustment mode of last code rate adjustment, when the network condition is worse, a threshold value evaluation method is adopted to determine the true and false value of the identifier representing the network congestion degree, the code rate is adjusted downwards according to the true and false value, and the live broadcast data to be transmitted is encoded and transmitted according to the adjusted code rate. The code rate is adaptively adjusted in real time according to the network condition, the historical adjustment mode of the code rate and the threshold evaluation strategy in the live broadcast process. The method and the device realize stable and high-speed transmission of audio and video data under the conditions of unstable networks such as outdoor and mobile live broadcasting, and greatly reduce the probability of the problems of audio and video blockage, blurred pictures, discontinuous audio and the like of the client.
In the above embodiment, optionally, when the first control module 102 adjusts the current code rate according to the receiving rate of the sounding confirmation packet and the adjustment mode of the last code rate adjustment, the first control module may be specifically configured to:
if the last code rate is adjusted to be down-adjusted, the current code rate is adjusted up by a first adjustment amount;
if the last code rate is adjusted to be up-regulated, judging whether the receiving rate of the detection confirmation packet meets the preset network congestion condition or not;
if the network congestion condition is not met, adjusting the current code rate by a second adjustment amount; if the network congestion condition is met, comparing the average code rate within the latest third preset time with the current code rate, if the comparison result indicates that the average code rate is close to the current code rate, adjusting the current code rate up by the first adjustment quantity, otherwise, adjusting the current code rate up by the second adjustment quantity;
the second adjustment amount is greater than the first adjustment amount.
In an alternative embodiment, the first control module 102 may be further configured to:
if the last code rate is adjusted to be up-regulated, judging whether the code rate is up-regulated for three times continuously before judging whether the receiving rate of the detection confirmation packet meets the preset network congestion condition;
if so, adjusting the current code rate to the average code rate within the latest third preset time length;
and if not, executing the step of judging whether the receiving rate of the detection confirmation packet meets the preset network congestion condition.
In an alternative embodiment, the second control module 103 sets the third retransmission rate threshold XSevere and severeThe first evaluation may be specifically performed on the true and false attributes of (1):
acquiring a time interval between the sending time of a currently retransmitted network packet and the first sending time of the currently retransmitted network packet;
if the time interval is greater than a first interval threshold, determining that the attribute of the third retransmission rate threshold is false;
if the time interval is greater than a second interval threshold and less than the first interval threshold, determining that the attribute of the third retransmission rate threshold is true if the retransmission rate of the network packet is greater than a fourth retransmission rate threshold, and determining that the attribute of the third retransmission rate threshold is false if the retransmission rate of the network packet is less than or equal to the fourth retransmission rate threshold;
if the time interval is smaller than a third interval threshold, determining that the attribute of the third retransmission rate threshold is true if the current network has a frame loss, and determining that the attribute of the third retransmission rate threshold is false if the current network has no frame loss.
In an optional embodiment, when the second control module 103 adjusts the third retransmission rate threshold according to the first evaluation result, it may specifically be configured to:
if the retransmission rate of the network packet is greater than the third retransmission rate threshold when the first evaluation is performed on the true and false attribute of the third retransmission rate threshold at the previous time, if the first evaluation result is true, the third retransmission rate threshold is decreased by a first preset step length; if the first evaluation result is false, increasing the third retransmission rate threshold by the first preset step length;
if the retransmission rate of the network packet is less than or equal to the third retransmission rate threshold when the first evaluation is performed on the true and false attribute of the third retransmission rate threshold at the previous time, if the first evaluation result is true, the third retransmission rate threshold is reduced by a second preset step length; if the first evaluation result is false, keeping the third retransmission rate threshold unchanged;
the second preset step length is larger than the first preset step length.
In an optional embodiment, the first preset step size is: a sum of the first reference step size and the first random step size; the second preset step length is as follows: a sum of the second reference step size and the second random step size; the second reference step size is greater than the first reference step size.
In an optional embodiment, the monitoring module 101 is further configured to: monitoring the receiving rate of the acknowledgement packets, wherein the receiving rate of the acknowledgement packets is the ratio of the number of the received acknowledgement packets corresponding to the non-retransmitted network packets to the number of the transmitted non-retransmitted network packets;
when the second control module 103 determines the true and false value of the identifier representing the network congestion degree according to the adjusted third retransmission rate threshold, it may specifically be configured to:
if the retransmission rate of the network packet is greater than the adjusted third retransmission rate threshold and the acknowledgement packet receiving rate is less than the first ratio threshold, determining that the value of the first identifier is true;
if the retransmission rate of the network packet is greater than a fifth retransmission rate threshold value and the current network has a frame loss, determining that the value of the second identifier is true;
the network congestion degree represented by the fact that the value of the second identifier is true is larger than the network congestion degree represented by the fact that the value of the first identifier is true.
In an optional embodiment, when the second control module 103 down-regulates the current code rate according to the true and false value of the identifier representing the network congestion degree, the method may specifically be configured to:
if the values of the first identification and the second identification are both false, the current code rate is adjusted downwards according to the adjustment mode of the last code rate adjustment;
under the condition that the value of the second identifier is true, if a first condition is met, the first condition is as follows: if the retransmission rate of the network packet is greater than a sixth retransmission rate threshold, the receiving rate of the acknowledgement packet is less than a second rate threshold, and the adjustment time interval is less than a fifth preset time length, the current code rate is adjusted by a third adjustment amount; if the first condition is not satisfied, if a second condition is satisfied, the second condition is: if the retransmission rate of the detection packet is greater than a sixth retransmission rate threshold, the receiving rate of the acknowledgement packet is less than a second rate threshold, and the adjustment time interval is greater than or equal to the fifth preset time length, then the current code rate is adjusted by a fourth adjustment amount;
if the value of the first identifier is true, reducing the current code rate to a preset minimum code rate, otherwise, reducing the current code rate by a fifth regulating quantity;
the fourth adjustment amount is smaller than the fifth adjustment amount, and the fifth adjustment amount is smaller than the third adjustment amount.
In an optional embodiment, when the second control module 103 down-regulates the current code rate according to the adjustment mode of the last code rate adjustment, it may specifically be configured to:
if the last code rate is adjusted to be adjusted upwards, the current code rate is adjusted downwards by the fourth adjustment quantity;
and if the last code rate is adjusted to be adjusted downwards, the current code rate is adjusted downwards by the fifth adjustment quantity.
In an optional embodiment, the live data transmission control apparatus provided in the present application may further include:
a setting module, configured to determine whether the retransmission rate of the network packet is less than the second retransmission rate threshold PSevere and severeAnd the retransmission rate of the network packet is greater than a seventh retransmission rate threshold PGeneral purposeFor the eighth retransmission rate threshold XGeneral purposeThe second evaluation result represents the adjustment direction of the value of the eighth retransmission rate threshold, and the eighth retransmission rate threshold X is subjected to the second evaluation according to the second evaluation resultGeneral purposeAnd adjusting, namely setting the maximum retransmission times, the retransmission timeout duration, the frame loss mark and the retransmission interval time according to the adjusted eighth retransmission rate threshold.
In an alternative embodiment, the setting module sets the eighth retransmission rate threshold XGeneral purposeThe second evaluation of the true and false attributes may be specifically used to:
acquiring a time interval between the sending time of a currently retransmitted network packet and the first sending time of the currently retransmitted network packet;
if the time interval is greater than a first interval threshold, determining that the attribute of the eighth retransmission rate threshold is false;
if the time interval is greater than a second interval threshold and smaller than the first interval threshold, determining that the attribute of the eighth retransmission rate threshold is true if the retransmission rate of the current network packet is greater than 2 times of the retransmission rate of the network packet when the true and false attribute of the eighth retransmission rate threshold is subjected to the second evaluation last time, and determining that the attribute of the eighth retransmission rate threshold is false if the retransmission rate of the current network packet is less than or equal to 2 times of the retransmission rate of the network packet when the true and false attribute of the eighth retransmission rate threshold is subjected to the second evaluation last time;
if the time interval is smaller than a third interval threshold, determining that the attribute of the eighth retransmission rate threshold is true if the value of the identifier representing the network congestion degree is true, and otherwise, determining that the attribute of the eighth retransmission rate threshold is false.
In an optional embodiment, the setting module sets the eighth retransmission rate threshold X according to the second evaluation resultGeneral purposeDuring adjustment, the method can be specifically used for:
if the retransmission rate of the network packet is greater than the eighth retransmission rate threshold when the second evaluation is performed on the true and false attribute of the eighth retransmission rate threshold at the previous time, if the second evaluation result is true, the eighth retransmission rate threshold is decreased by a first preset step length; if the second evaluation result is false, increasing the eighth retransmission rate threshold by the first preset step length;
if the retransmission rate of the network packet when the second evaluation is performed on the true and false attribute of the eighth retransmission rate threshold at the previous time is smaller than or equal to the eighth retransmission rate threshold, if the second evaluation result is true, reducing the eighth retransmission rate threshold by a second preset step length; if the second evaluation result is false, keeping the eighth retransmission rate threshold unchanged;
the second preset step length is larger than the first preset step length.
In an optional embodiment, the monitoring module 101 is further configured to: monitoring the receiving rate of the acknowledgement packets, wherein the receiving rate of the acknowledgement packets is the ratio of the number of the received acknowledgement packets corresponding to the non-retransmitted network packets to the number of the transmitted non-retransmitted network packets;
the setting module may specifically be configured to, when setting the maximum retransmission times, the retransmission timeout duration, the frame loss flag, and the retransmission interval time according to the adjusted eighth retransmission rate threshold:
and when the retransmission rate of the network packet is greater than the adjusted eighth retransmission rate threshold and the difference between 1 and the adjusted eighth retransmission rate threshold is greater than the receiving rate of the acknowledgement packet, setting the maximum retransmission times, the retransmission timeout duration, the frame loss mark and the retransmission interval time according to the ratio of the retransmission rate of the network packet to the receiving rate of the acknowledgement packet.
In an optional embodiment, when the setting module sets the maximum retransmission times, the retransmission timeout duration, the frame loss flag, and the retransmission interval time according to the ratio of the retransmission rate of the probe packet to the reception rate of the acknowledgement packet, the setting module may be specifically configured to:
if frame loss is monitored, the value of the frame loss mark is evaluated as true; if no frame loss is monitored in the continuous preset time, assigning the value of the frame loss mark as false;
if the ratio is smaller than a first ratio threshold, setting the maximum retransmission times of all the frames as first retransmission times, setting the retransmission timeout duration as first retransmission timeout duration, setting the retransmission interval time of the key frame and the audio frame as first retransmission interval time, setting the retransmission interval time of other frames as second retransmission interval time, and setting the first retransmission interval time to be larger than the second retransmission interval time; optionally, the first ratio threshold may be 0.8.
If the ratio is greater than or equal to the first ratio threshold and smaller than a second ratio threshold, only setting the maximum retransmission times of the key frame and the audio frame as the first retransmission times, setting the retransmission timeout duration as the first retransmission timeout duration, setting the maximum retransmission times of other frames as the second retransmission times, and setting the retransmission timeout duration as the second retransmission timeout duration; setting the retransmission interval time of the key frame and the retransmission interval time of the audio frame as the first retransmission interval time, setting the retransmission interval time of other frames as a third retransmission interval time, wherein the third retransmission interval time is less than the second retransmission interval time; the second retransmission times are less than the first retransmission times, and the second retransmission timeout duration is less than the first retransmission timeout duration; alternatively, the second ratio threshold may be 1.2, and the third retransmission interval time may be 1.5 s.
If the ratio is greater than or equal to the second ratio threshold, only setting the maximum retransmission times of the key frame and the audio frame as third retransmission times, setting the retransmission timeout duration as third retransmission timeout duration, setting the maximum retransmission times of other frames as fourth retransmission times, and setting the retransmission timeout duration as fourth retransmission timeout duration; and the retransmission interval time of the key frame and the retransmission interval time of the audio frame are both set as fourth retransmission interval time, and the retransmission interval time of other frames are both set as the third retransmission interval time. Optionally, the fourth retransmission interval time may be 2.5 s.
Wherein the content of the first and second substances,
the fourth retransmission interval time is between the first retransmission interval time and the third retransmission interval time;
the fourth retransmission times are less than the third retransmission times, and the third retransmission times are less than the first retransmission times;
the fourth retransmission timeout duration is less than the third retransmission timeout duration, and the third retransmission timeout duration is less than the first retransmission timeout duration.
In an optional embodiment, the live data transmission control apparatus provided in the present application may further include:
the monitoring module is used for monitoring whether the network channel meets a preset non-congestion state;
and the detection module is used for sending a detection packet to the aggregation server when the monitoring result of the monitoring module is positive.
In an optional embodiment, the transmission module 104 may specifically be configured to:
splitting each frame of data into a plurality of network packets;
acquiring a network packet to be sent as a target network packet;
determining a network channel with the minimum congestion amount from the plurality of network channels as an optimal network channel;
and sending the target network packet to the aggregation server through the optimal network channel, and returning to execute the step of acquiring a network packet to be sent as the target network packet.
In an optional embodiment, the transmission module 104 may further be configured to:
after the target network packet is sent to the aggregation server through the optimal network channel, waiting for the aggregation server to send a confirmation packet corresponding to the target network packet through the optimal network channel;
if the acknowledgement packet corresponding to the target network packet is not received within the preset retransmission timeout duration, retransmitting the target network packet to the aggregation server through the optimal network channel, and returning to execute the step of waiting for the aggregation server to send the acknowledgement packet corresponding to the target network packet through the optimal network channel and the subsequent steps;
and if the confirmation packet corresponding to the target network packet is not received after the retransmission times of the target network packet reach the preset retransmission times, discarding the target network packet.
In an optional embodiment, the acknowledgement packet corresponding to the target network packet includes: the aggregation server receives sequence numbers of a plurality of network packets, wherein the network packets comprise the target network packet.
The present application further provides a computer-readable storage medium, in which instructions are stored, and when the instructions are run on a terminal device, the terminal device is caused to execute the live data transmission control method disclosed in the present application.
This application still provides a live equipment, includes: the system comprises a memory, a processor and a computer program which is stored on the memory and can run on the processor, wherein when the processor executes the computer program, the live broadcast data transmission control method disclosed by the application is realized.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems (if any), apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (21)

1. A live data transmission control method is characterized by comprising the following steps:
monitoring the retransmission rate of a network packet sent to an aggregation server and the receiving rate of a detection confirmation packet corresponding to a detection packet bearing detection data in the network packet; the network packet comprises a live broadcast packet for bearing live broadcast data and the detection packet; the network packet and the detection confirmation packet are both UDP data packets;
if the retransmission rate of the network packet is smaller than a first retransmission rate threshold value and the current code rate is not a preset maximum code rate, the current code rate is adjusted upwards according to the receiving rate of the detection confirmation packet and the adjustment mode of the last code rate adjustment, and the live broadcast data to be transmitted are encoded into frame data according to the adjusted code rate to be transmitted;
if the retransmission rate of the network packet is greater than a second retransmission rate threshold, performing first evaluation on the true and false attribute of a third retransmission rate threshold based on the time interval between the retransmission occurrence time of the network packet subjected to retransmission and the first transmission time of the network packet subjected to retransmission, if the attribute of the third retransmission rate threshold is true, reducing the value of the third retransmission rate threshold, otherwise, increasing or keeping the value of the third retransmission rate threshold unchanged, and determining the true and false value of the identifier representing the network congestion degree according to the adjusted third retransmission rate threshold; the second retransmission rate threshold is greater than the first retransmission rate threshold;
and adjusting the current code rate down according to the true and false value of the identifier representing the network congestion degree, and encoding the live broadcast data to be transmitted into frame data according to the adjusted code rate for transmission.
2. The method of claim 1, wherein the adjusting the current code rate according to the receiving rate of the sounding acknowledgement packet and the adjustment manner of the last code rate adjustment comprises:
if the last code rate is adjusted to be down-adjusted, the current code rate is adjusted up by a first adjustment amount;
if the last code rate is adjusted to be up-regulated, judging whether the receiving rate of the detection confirmation packet meets a preset network congestion condition or not;
if the network congestion condition is not met, adjusting the current code rate by a second adjustment amount; if the network congestion condition is met, comparing the average code rate within the latest third preset time with the current code rate, if the comparison result indicates that the average code rate is close to the current code rate, adjusting the current code rate up by the first adjustment quantity, otherwise, adjusting the current code rate up by the second adjustment quantity;
the second adjustment amount is greater than the first adjustment amount.
3. The method of claim 2, wherein if the previous bitrate is adjusted to be up-regulated, before determining whether the reception rate of the probe acknowledgement packet satisfies a preset network congestion condition, the method further comprises:
judging whether the code rate is continuously adjusted up three times or not;
if so, adjusting the current code rate to the average code rate within the latest third preset time length;
and if the judgment result is negative, executing the step of judging whether the receiving rate of the detection confirmation packet meets the preset network congestion condition.
4. The method of claim 1, wherein the first evaluating the true-false attribute of the third retransmission rate threshold based on a time interval between a retransmission occurrence time of a network packet in which the retransmission occurs and a first transmission time of the network packet in which the retransmission occurs comprises:
acquiring a time interval between the sending time of a currently retransmitted network packet and the first sending time of the currently retransmitted network packet;
if the time interval is greater than a first interval threshold, determining that the attribute of the third retransmission rate threshold is false;
if the time interval is greater than a second interval threshold and less than the first interval threshold, determining that the attribute of the third retransmission rate threshold is true if the retransmission rate of the network packet is greater than a fourth retransmission rate threshold, and determining that the attribute of the third retransmission rate threshold is false if the retransmission rate of the network packet is less than or equal to the fourth retransmission rate threshold;
if the time interval is smaller than a third interval threshold, determining that the attribute of the third retransmission rate threshold is true if the current network has a frame loss, and determining that the attribute of the third retransmission rate threshold is false if the current network has no frame loss.
5. The method of claim 1, wherein adjusting the third retransmission rate threshold based on the first evaluation comprises:
if the retransmission rate of the network packet is greater than the third retransmission rate threshold when the first evaluation is performed on the true and false attribute of the third retransmission rate threshold at the previous time, if the first evaluation result is true, the third retransmission rate threshold is decreased by a first preset step length; if the first evaluation result is false, increasing the third retransmission rate threshold by the first preset step length;
if the retransmission rate of the network packet is less than or equal to the third retransmission rate threshold when the first evaluation is performed on the true and false attribute of the third retransmission rate threshold at the previous time, if the first evaluation result is true, the third retransmission rate threshold is reduced by a second preset step length; if the first evaluation result is false, keeping the third retransmission rate threshold unchanged;
the second preset step length is larger than the first preset step length.
6. The method of claim 5, wherein the first preset step size is: a sum of the first reference step size and the first random step size; the second preset step length is as follows: a sum of the second reference step size and the second random step size; the second reference step size is greater than the first reference step size.
7. The method of claim 1, further comprising: monitoring the receiving rate of the acknowledgement packets, wherein the receiving rate of the acknowledgement packets is the ratio of the number of the received acknowledgement packets corresponding to the non-retransmitted network packets to the number of the transmitted non-retransmitted network packets;
the determining, according to the adjusted third retransmission rate threshold, a true and false value of the identifier representing the network congestion degree includes:
if the retransmission rate of the network packet is greater than the adjusted third retransmission rate threshold and the acknowledgement packet receiving rate is less than the first ratio threshold, determining that the value of the first identifier is true;
if the retransmission rate of the network packet is greater than a fifth retransmission rate threshold value and the current network has a frame loss, determining that the value of the second identifier is true;
the network congestion degree represented by the fact that the value of the second identifier is true is larger than the network congestion degree represented by the fact that the value of the first identifier is true.
8. The method of claim 7, wherein adjusting the current bitrate according to the true and false values of the identifier indicating the network congestion degree comprises:
if the values of the first identification and the second identification are both false, the current code rate is adjusted downwards according to the adjustment mode of the last code rate adjustment;
under the condition that the value of the second identifier is true, if a first condition is met, the first condition is as follows: if the retransmission rate of the network packet is greater than a sixth retransmission rate threshold, the receiving rate of the acknowledgement packet is less than a second rate threshold, and the adjustment time interval is less than a fifth preset time length, the current code rate is adjusted by a third adjustment amount; if the first condition is not satisfied, if a second condition is satisfied, the second condition is: if the retransmission rate of the detection packet is greater than a sixth retransmission rate threshold, the receiving rate of the acknowledgement packet is less than a second rate threshold, and the adjustment time interval is greater than or equal to the fifth preset time length, then the current code rate is adjusted by a fourth adjustment amount;
if the value of the first identifier is true, reducing the current code rate to a preset minimum code rate, otherwise, reducing the current code rate by a fifth regulating quantity;
the fourth adjustment amount is smaller than the fifth adjustment amount, and the fifth adjustment amount is smaller than the third adjustment amount.
9. The method of claim 8, wherein the adjusting the current code rate according to the previous code rate adjustment comprises:
if the last code rate is adjusted to be adjusted upwards, the current code rate is adjusted downwards by the fourth adjustment quantity;
and if the last code rate is adjusted to be adjusted downwards, the current code rate is adjusted downwards by the fifth adjustment quantity.
10. The method of claim 1, further comprising:
if the retransmission rate of the network packet is smaller than the second retransmission rate threshold and the retransmission rate of the network packet is larger than the seventh retransmission rate threshold, performing second evaluation on the true and false attribute of the eighth retransmission rate threshold, wherein a second evaluation result represents the adjustment direction of the value of the eighth retransmission rate threshold, adjusting the eighth retransmission rate threshold according to the second evaluation result, and setting the maximum retransmission times, the retransmission timeout duration, the frame loss mark and the retransmission interval time according to the adjusted eighth retransmission rate threshold.
11. The method of claim 10, wherein the second evaluating the true-false attribute of the eighth retransmission rate threshold comprises:
acquiring a time interval between the sending time of a currently retransmitted network packet and the first sending time of the currently retransmitted network packet;
if the time interval is greater than a first interval threshold, determining that the attribute of the eighth retransmission rate threshold is false;
if the time interval is greater than a second interval threshold and smaller than the first interval threshold, determining that the attribute of the eighth retransmission rate threshold is true if the retransmission rate of the current network packet is greater than 2 times of the retransmission rate of the network packet when the true and false attribute of the eighth retransmission rate threshold is subjected to the second evaluation last time, and determining that the attribute of the eighth retransmission rate threshold is false if the retransmission rate of the current network packet is less than or equal to 2 times of the retransmission rate of the network packet when the true and false attribute of the eighth retransmission rate threshold is subjected to the second evaluation last time;
if the time interval is smaller than a third interval threshold, determining that the attribute of the eighth retransmission rate threshold is true if the value of the identifier representing the network congestion degree is true, and otherwise, determining that the attribute of the eighth retransmission rate threshold is false.
12. The method of claim 10, wherein adjusting the eighth retransmission rate threshold according to the second evaluation comprises:
if the retransmission rate of the network packet is greater than the eighth retransmission rate threshold when the second evaluation is performed on the true and false attribute of the eighth retransmission rate threshold at the previous time, if the second evaluation result is true, the eighth retransmission rate threshold is decreased by a first preset step length; if the second evaluation result is false, increasing the eighth retransmission rate threshold by the first preset step length;
if the retransmission rate of the network packet when the second evaluation is performed on the true and false attribute of the eighth retransmission rate threshold at the previous time is smaller than or equal to the eighth retransmission rate threshold, if the second evaluation result is true, reducing the eighth retransmission rate threshold by a second preset step length; if the second evaluation result is false, keeping the eighth retransmission rate threshold unchanged;
the second preset step length is larger than the first preset step length.
13. The method of claim 10, further comprising: monitoring the receiving rate of the acknowledgement packets, wherein the receiving rate of the acknowledgement packets is the ratio of the number of the received acknowledgement packets corresponding to the non-retransmitted network packets to the number of the transmitted non-retransmitted network packets;
the setting of the maximum retransmission times, the retransmission timeout duration, the frame loss flag and the retransmission interval time according to the adjusted eighth retransmission rate threshold includes:
and when the retransmission rate of the network packet is greater than the adjusted eighth retransmission rate threshold and the difference between 1 and the adjusted eighth retransmission rate threshold is greater than the receiving rate of the acknowledgement packet, setting the maximum retransmission times, the retransmission timeout duration, the frame loss mark and the retransmission interval time according to the ratio of the retransmission rate of the network packet to the receiving rate of the acknowledgement packet.
14. The method of claim 13, wherein setting the maximum retransmission times, the retransmission timeout duration, the frame loss flag, and the retransmission interval time according to the ratio of the retransmission rate of the network packet to the reception rate of the acknowledgement packet comprises:
if frame loss is monitored, the value of the frame loss mark is evaluated as true; if no frame loss is monitored in the continuous preset time, assigning the value of the frame loss mark as false;
if the ratio is smaller than a first ratio threshold, setting the maximum retransmission times of all the frames as first retransmission times, setting the retransmission timeout duration as first retransmission timeout duration, setting the retransmission interval time of the key frame and the audio frame as first retransmission interval time, setting the retransmission interval time of other frames as second retransmission interval time, and setting the first retransmission interval time to be larger than the second retransmission interval time;
if the ratio is greater than or equal to the first ratio threshold and smaller than a second ratio threshold, only setting the maximum retransmission times of the key frame and the audio frame as the first retransmission times, setting the retransmission timeout duration as the first retransmission timeout duration, setting the maximum retransmission times of other frames as the second retransmission times, and setting the retransmission timeout duration as the second retransmission timeout duration; setting the retransmission interval time of the key frame and the retransmission interval time of the audio frame as the first retransmission interval time, setting the retransmission interval time of other frames as a third retransmission interval time, wherein the third retransmission interval time is less than the second retransmission interval time; the second retransmission times are less than the first retransmission times, and the second retransmission timeout duration is less than the first retransmission timeout duration;
if the ratio is greater than or equal to the second ratio threshold, only setting the maximum retransmission times of the key frame and the audio frame as third retransmission times, setting the retransmission timeout duration as third retransmission timeout duration, setting the maximum retransmission times of other frames as fourth retransmission times, and setting the retransmission timeout duration as fourth retransmission timeout duration; setting the retransmission interval time of the key frame and the retransmission interval time of the audio frame as fourth retransmission interval time, and setting the retransmission interval time of other frames as the third retransmission interval time; the fourth retransmission interval time is between the first retransmission interval time and the third retransmission interval time; wherein the fourth retransmission interval time is between the first retransmission interval time and the third retransmission interval time; the fourth retransmission times are less than the third retransmission times, and the third retransmission times are less than the first retransmission times; the fourth retransmission timeout duration is less than the third retransmission timeout duration, and the third retransmission timeout duration is less than the first retransmission timeout duration.
15. The method of claim 1, wherein sending probe packets to the aggregation server is implemented by:
monitoring whether a network channel meets a preset non-congestion state;
and when the monitoring result is yes, sending a detection packet to the aggregation server.
16. The method of claim 1, wherein the transmitting of the frame data comprises:
splitting each frame of data into a plurality of network packets;
acquiring a network packet to be sent as a target network packet;
determining a network channel with the minimum congestion amount from the plurality of network channels as an optimal network channel;
and sending the target network packet to the aggregation server through the optimal network channel, and returning to execute the step of acquiring a network packet to be sent as the target network packet.
17. The method of claim 16, further comprising, after sending the target network packet to the aggregation server over the optimal network channel:
waiting for the aggregation server to send a confirmation packet corresponding to the target network packet through the optimal network channel;
if the acknowledgement packet corresponding to the target network packet is not received within the preset retransmission timeout duration, retransmitting the target network packet to the aggregation server through the optimal network channel, and returning to execute the step of waiting for the aggregation server to send the acknowledgement packet corresponding to the target network packet through the optimal network channel and the subsequent steps;
and if the confirmation packet corresponding to the target network packet is not received after the retransmission times of the target network packet reach the preset retransmission times, discarding the target network packet.
18. The method of claim 17, wherein the acknowledgement packet corresponding to the target network packet comprises: the aggregation server receives sequence numbers of a plurality of network packets, wherein the network packets comprise the target network packet.
19. A live data transmission control apparatus, comprising:
the monitoring module is used for monitoring the retransmission rate of the network packet sent to the aggregation server and the receiving rate of the detection confirmation packet corresponding to the detection packet bearing the detection data in the network packet; the network packet comprises a live broadcast packet for bearing live broadcast data and the detection packet; the network packet and the detection confirmation packet are both UDP data packets;
the first control module is used for adjusting the current code rate according to the receiving rate of the detection confirmation packet and the adjustment mode of the last code rate adjustment if the retransmission rate of the network packet is smaller than a first retransmission rate threshold value and the current code rate is not the preset maximum code rate, and encoding the live broadcast data to be transmitted into frame data according to the adjusted code rate;
a second control module, configured to perform a first evaluation on a true-false attribute of a third retransmission rate threshold based on a time interval between a retransmission occurrence time of a network packet where retransmission occurs and a first transmission time of the network packet where retransmission occurs if a retransmission rate of the network packet is greater than a second retransmission rate threshold, decrease a value of the third retransmission rate threshold if the attribute of the third retransmission rate threshold is true, otherwise, increase or maintain the value of the third retransmission rate threshold, and determine a true-false value of an identifier representing a network congestion degree according to the adjusted third retransmission rate threshold; the current code rate is adjusted downwards according to the true and false value of the identifier representing the network congestion degree, and the live broadcast data to be transmitted is encoded into frame data according to the adjusted code rate;
and the transmission module is used for transmitting the frame data obtained by coding.
20. A computer-readable storage medium having stored therein instructions that, when run on a terminal device, cause the terminal device to perform a live data transmission control method as claimed in any one of claims 1-18.
21. A live device, comprising: a memory, a processor, and a computer program stored on the memory and executable on the processor, when executing the computer program, implementing a live data transfer control method as claimed in any one of claims 1-18.
CN201810638178.7A 2018-06-20 2018-06-20 Live broadcast data transmission control method and device, live broadcast equipment and storage medium Active CN108833930B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810638178.7A CN108833930B (en) 2018-06-20 2018-06-20 Live broadcast data transmission control method and device, live broadcast equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810638178.7A CN108833930B (en) 2018-06-20 2018-06-20 Live broadcast data transmission control method and device, live broadcast equipment and storage medium

Publications (2)

Publication Number Publication Date
CN108833930A CN108833930A (en) 2018-11-16
CN108833930B true CN108833930B (en) 2020-10-02

Family

ID=64142907

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810638178.7A Active CN108833930B (en) 2018-06-20 2018-06-20 Live broadcast data transmission control method and device, live broadcast equipment and storage medium

Country Status (1)

Country Link
CN (1) CN108833930B (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110391956B (en) * 2019-07-23 2021-08-13 中国工商银行股份有限公司 Method and device for identifying and monitoring state of network service process
CN112825204B (en) * 2019-11-20 2023-03-24 云丁网络技术(北京)有限公司 Access control method and device based on 2G network, readable medium and equipment
CN113271316B (en) * 2021-06-09 2022-09-13 腾讯科技(深圳)有限公司 Multimedia data transmission control method and device, storage medium and electronic equipment
CN113423008B (en) * 2021-08-20 2021-11-16 北京易真学思教育科技有限公司 Video data transmission method, server and viewer side equipment
CN114390005B (en) * 2022-01-12 2023-09-15 北京龙鼎源科技股份有限公司 Method and device for processing communication link blocking, electronic equipment and storage medium
CN114390320B (en) * 2022-02-18 2024-02-13 百果园技术(新加坡)有限公司 Data coding rate self-adaptive adjusting method, device, equipment and storage medium
CN115022730A (en) * 2022-06-13 2022-09-06 北京达佳互联信息技术有限公司 Data transmission method and device, electronic equipment and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1976535A (en) * 2006-12-12 2007-06-06 华为技术有限公司 Channel adaptive device and channel adaptive method
CN102256183A (en) * 2010-05-21 2011-11-23 上海捷骐数码科技有限公司 Mobile-communication-network-based audio and video signal real-time transmission method
CN107046712A (en) * 2016-02-05 2017-08-15 中兴通讯股份有限公司 A kind of data transmission processing method and device
CN107276910A (en) * 2017-06-07 2017-10-20 上海迪爱斯通信设备有限公司 The real-time adjusting apparatus of video code rate and system, video server
CN107295395A (en) * 2017-06-27 2017-10-24 武汉斗鱼网络科技有限公司 Code check adaptive regulation method, device and electronic equipment
CN107342848A (en) * 2017-08-24 2017-11-10 杭州联吉技术有限公司 A kind of adaptive code stream transmission method, device and equipment

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2014127834A1 (en) * 2013-02-22 2014-08-28 Telefonaktiebolaget L M Ericsson (Publ) Media distribution network system with media burst transmission via an access network
US9312918B2 (en) * 2014-01-15 2016-04-12 Cisco Technology, Inc. Phase selection for power line communication (PLC) links
US9755732B1 (en) * 2016-06-21 2017-09-05 Spire Global Inc. Systems and methods for satellite communications using a space tolerant protocol

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1976535A (en) * 2006-12-12 2007-06-06 华为技术有限公司 Channel adaptive device and channel adaptive method
CN102256183A (en) * 2010-05-21 2011-11-23 上海捷骐数码科技有限公司 Mobile-communication-network-based audio and video signal real-time transmission method
CN107046712A (en) * 2016-02-05 2017-08-15 中兴通讯股份有限公司 A kind of data transmission processing method and device
CN107276910A (en) * 2017-06-07 2017-10-20 上海迪爱斯通信设备有限公司 The real-time adjusting apparatus of video code rate and system, video server
CN107295395A (en) * 2017-06-27 2017-10-24 武汉斗鱼网络科技有限公司 Code check adaptive regulation method, device and electronic equipment
CN107342848A (en) * 2017-08-24 2017-11-10 杭州联吉技术有限公司 A kind of adaptive code stream transmission method, device and equipment

Also Published As

Publication number Publication date
CN108833930A (en) 2018-11-16

Similar Documents

Publication Publication Date Title
CN108833930B (en) Live broadcast data transmission control method and device, live broadcast equipment and storage medium
DE602006001019T2 (en) Communication processing apparatus, data transmission system and method for communication processing
EP1557982B1 (en) Method and system for admission control in communication networks
CN106385374B (en) Transmission control method and system for relieving network congestion at local area network sending end
RU2305908C2 (en) Adaptive method for evaluating multimedia data transmission speed
US9450701B2 (en) Data flow control method and apparatus
US9154396B2 (en) Passive measurement of available link bandwidth
KR101046105B1 (en) Computer program manufacturing, resource demand adjustment methods, and end systems
US9325628B2 (en) Packet handling method, forwarding device and system
US6853625B2 (en) Method of dynamically transmitting data packets using RTP and RTCP protocols
US10148598B2 (en) Efficient packet processing at video receiver in multimedia communications over packet networks
US7693058B2 (en) Method for enhancing transmission quality of streaming media
US20120300663A1 (en) Method and apparatus for retransmission decision making
US20060104313A1 (en) Method and apparatus for timeout reduction and improved wireless network performance by delay injection
US20060164987A1 (en) Adaptive dropping of prioritized transmission packets
CN101909060A (en) Qos control method suitable for real-time streaming media transmission of mobile videos
CN113271316A (en) Multimedia data transmission control method and device, storage medium and electronic equipment
Kuo et al. A QoE-based link adaptation scheme for H. 264/SVC video multicast over IEEE 802.11
CN113891172B (en) Adaptive code rate control method based on RTT (round trip time) and suitable for wireless Mesh network
WO2010092323A2 (en) Data transmission
CN115378832B (en) Congestion detection method and device, stream media transmission system, electronic equipment and medium
Kim et al. UDP-based extremely low latency streaming
Lu et al. Context-adaptive cross-layer TCP optimization for Internet video streaming
Ma et al. Early packet loss feedback for webrtc-based mobile video telephony over Wi-Fi
Jin et al. Performance evaluation of a hybrid FEC/ARQ for wireless media streaming

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20210119

Address after: 510000 3108, 79 Wanbo 2nd Road, Nancun Town, Panyu District, Guangzhou City, Guangdong Province

Patentee after: GUANGZHOU CUBESILI INFORMATION TECHNOLOGY Co.,Ltd.

Address before: 28th floor, block B1, Wanda Plaza, Nancun Town, Panyu District, Guangzhou City, Guangdong Province

Patentee before: GUANGZHOU HUADUO NETWORK TECHNOLOGY Co.,Ltd.

EE01 Entry into force of recordation of patent licensing contract
EE01 Entry into force of recordation of patent licensing contract

Application publication date: 20181116

Assignee: GUANGZHOU HUADUO NETWORK TECHNOLOGY Co.,Ltd.

Assignor: GUANGZHOU CUBESILI INFORMATION TECHNOLOGY Co.,Ltd.

Contract record no.: X2021440000053

Denomination of invention: Live broadcast data transmission control method, device, live broadcast equipment and storage medium

Granted publication date: 20201002

License type: Common License

Record date: 20210208