Code rate detection optimization method and device, equipment and storage medium

By collecting network feedback information in WebRTC, adjusting the code rate, and using the available bandwidth calculation formula, the problem of GCC algorithm's low tolerance for packet loss and delay is solved, achieving faster and more accurate network adaptation, and improving data transmission efficiency. .

CN118764472APending Publication Date: 2024-10-11GUANGZHOU BAOLUN ELECTRONICS CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202411020187.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-29
Publication Date
2024-10-11

AI Technical Summary

Technical Problem

The GCC congestion control algorithm in WebRTC has low tolerance for packet loss and delay, resulting in unstable bandwidth estimation and affecting transmission quality and efficiency.

Method used

By collecting network feedback information, triggering code rate detection, adjusting the code rate, using the preset available bandwidth calculation formula, determining the instantaneous available bandwidth based on the target packet loss rate and delay, monitoring network changes in real time, optimizing code rate detection, and quickly adapting to the network environment.

Benefits of technology

The speed and accuracy of code rate detection are improved, allowing the system to adapt to network changes faster and achieve the best data transmission effect.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118764472A_ABST
    Figure CN118764472A_ABST
Patent Text Reader

Abstract

The invention discloses a code rate detection optimization method and device, equipment and a storage medium, and the method comprises the steps: collecting first network feedback information, and triggering code rate detection when the first network feedback information meets a code rate detection condition; collecting second network feedback information during the code rate detection period, determining a network performance state during the code rate detection period based on the second network feedback information, and when the network performance state satisfies a network performance good condition, adjusting the current detection code rate to obtain an adjusted detection code rate; re-collecting second network feedback information during code rate detection based on the adjusted detection code rate until a network performance state corresponding to the re-collected second network feedback information does not meet a good network performance condition or the current detection frequency meets a code rate detection frequency upper limit, and determining an optimal detection code rate; compared with the prior art, the technical scheme of the invention can quickly adapt to the change of the network condition, and the data transmission efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of network communications, and in particular to an optimization method, device, equipment and storage medium for bit rate detection. Background Art

[0002] WebRTC (Web Real-Time Communication) is a network technology that supports real-time communication and is widely used in scenarios such as video conferencing and voice calls. One of its core components is the congestion control algorithm, which is responsible for managing the rate at which data packets are sent to adapt to changes in network conditions. Currently, three major congestion control algorithms are integrated into WebRTC: GCC (Google Congestion Control), BBR (Bottleneck Bandwidth and Round-trip propagation time), and PCC (Pre Congestion Control).

[0003] The GCC algorithm is one of the earliest congestion control mechanisms adopted in WebRTC. Its implementation is mainly divided into two parts: packet loss-based congestion control and delay-based congestion control. In the early implementation, these two algorithms were implemented at the sender and receiver respectively. The congestion control algorithm at the receiver calculates the estimated bandwidth and feeds the information back to the sender through the REMB (Receiver Estimated Maximum Bitrate) mechanism of RTCP (Real-time Transport Control Protocol). The sender combines the results of the two control algorithms to obtain a final sending bitrate and sends data packets at this bitrate. In order to optimize performance, the GCC algorithm integrates both congestion algorithms into the sender in the later implementation. Although the algorithm itself has not changed, the sender needs to calculate the delay, so additional feedback information is required. This information includes the arrival time of each media packet received by the receiver to help the sender more accurately evaluate the network status.

[0004] Although the GCC algorithm plays an important role in network congestion control, it has some significant limitations: (1) The GCC algorithm relies on packet loss and jitter to detect network congestion. This dependence results in a low tolerance for packet loss and delay. When the packet loss rate exceeds 10%, the bandwidth will drop sharply, resulting in a decrease in transmission quality. In addition, drastic fluctuations in the sending volume will also lead to unstable bandwidth estimation, affecting the overall transmission effect. (2) The GCC algorithm relies on packet loss and jitter to detect network congestion. This dependence results in a low tolerance for packet loss and delay. When the packet loss rate exceeds 10%, the bandwidth will drop sharply, resulting in a decrease in transmission quality. In addition, drastic fluctuations in the sending volume will also lead to unstable bandwidth estimation, affecting the overall transmission effect. Summary of the invention

[0005] The technical problem to be solved by the present application is to provide a method, device, equipment and storage medium for optimizing bit rate detection, so as to quickly adapt to changes in network conditions and improve data transmission efficiency.

[0006] In order to solve the above technical problems, the present application provides a method for optimizing bit rate detection, including:

[0007] Collecting first network feedback information, and triggering bit rate detection when the first network feedback information meets a bit rate detection condition;

[0008] Collecting second network feedback information during the bit rate detection period, determining a network performance state during the bit rate detection period based on the second network feedback information, and when the network performance state meets a good network performance condition, adjusting the current detection bit rate to obtain an adjusted detection bit rate;

[0009] Based on the adjustment of the detection bit rate, the second network feedback information during the bit rate detection period is re-collected until the network performance state corresponding to the re-collected second network feedback information does not meet the good network performance condition, or the current detection times meet the bit rate detection times upper limit, and the optimal detection bit rate is determined.

[0010] In a possible implementation manner, after determining the network performance state during the bit rate detection period based on the second network feedback information, the method further includes:

[0011] Extracting the target packet loss rate and target delay from the second network feedback information, and obtaining the detection packet size during the bit rate detection period;

[0012] The target packet loss rate, the target delay and the detection packet size are input into a preset available bandwidth calculation formula to obtain instantaneous available bandwidth.

[0013] In a possible implementation, the available bandwidth calculation formula is as follows:

[0014] B = ((1-PLR)*S*8) / ARTT;

[0015] Where B is the instantaneous available bandwidth, PLR is the target packet loss rate, ARTT is the target delay, and S is the detection packet size.

[0016] In a possible implementation manner, collecting first network feedback information, and triggering bit rate detection when the first network feedback information meets a bit rate detection condition, specifically includes:

[0017] Obtain the expected total number of received detection packets and the actual total number of received detection packets in multiple time periods, calculate the packet loss rates corresponding to the multiple time periods based on the expected total number of received detection packets and the actual total number of received detection packets, and obtain the current bit rate corresponding to the current time period;

[0018] Obtaining the sending time and receiving time of the detection packet in multiple time periods, determining based on the sending time and the receiving time, and calculating the data round-trip time fluctuation rate in the multiple time periods based on the data round-trip time corresponding to each of the multiple time periods;

[0019] When the packet loss rates corresponding to the multiple time periods are less than the preset packet loss rate threshold, the data round-trip time fluctuation rate is less than the preset data round-trip time fluctuation rate threshold, and the current bit rate is less than the historical optimal detection bit rate, it is determined that the network feedback information meets the bit rate detection conditions and the bit rate detection is triggered.

[0020] In a possible implementation manner, collecting the second network feedback information during the bit rate detection period specifically includes:

[0021] Obtaining the number of probe packets sent and the number of probe packets received during the bit rate detection period, and determining a target packet loss rate based on the number of probe packets sent and the number of probe packets received;

[0022] Obtaining a first sending time of a first detection packet during the bit rate detection period, and obtaining a first receiving time of a last detection packet, and determining a target delay based on the first sending time and the first receiving time,

[0023] Obtaining a second receiving time corresponding to each detection packet during the bit rate detection period, determining based on the second receiving time and calculating an average receiving time interval based on the receiving time interval between adjacent detection packets;

[0024] respectively calculating the time difference between the second receiving time corresponding to each detection packet and the average receiving time interval, and determining the target jitter based on the time difference;

[0025] The target packet loss rate, the target delay and the target jitter are used as second network feedback information during bit rate detection.

[0026] In a possible implementation manner, after determining the optimal detection code rate, the method further includes:

[0027] Real-time monitoring of network feedback information, wherein the network feedback information includes real-time packet loss rate and real-time data round-trip time;

[0028] Calculate the packet loss rate difference between the real-time packet loss rate and the packet loss rate at the previous moment, and calculate the data round-trip time difference between the real-time data round-trip time and the data round-trip time at the previous moment;

[0029] When the packet loss rate difference is greater than a preset packet loss rate difference threshold, or the data round-trip time difference is greater than a preset data round-trip time difference threshold, the bit rate detection operation is re-triggered.

[0030] In a possible implementation, adjusting the current detection code rate to obtain an adjusted detection code rate specifically includes:

[0031] A preset gain factor is obtained, and the current detection code rate is adjusted based on the gain factor to obtain an adjusted detection code rate.

[0032] The present application also provides a device for optimizing bit rate detection, including: a bit rate detection trigger module, a detection bit rate adjustment module and an optimal detection bit rate confirmation module;

[0033] The bit rate detection triggering module is used to collect the first network feedback information, and trigger the bit rate detection when the first network feedback information meets the bit rate detection condition;

[0034] The detection bit rate adjustment module is used to collect the second network feedback information during the bit rate detection period, determine the network performance status during the bit rate detection period based on the second network feedback information, and when the network performance status meets the good network performance condition, adjust the current detection bit rate to obtain the adjusted detection bit rate;

[0035] The optimal detection bit rate confirmation module is used to re-collect the second network feedback information during the bit rate detection period based on the adjusted detection bit rate, until the network performance status corresponding to the re-collected second network feedback information does not meet the good network performance condition, or the current detection number meets the bit rate detection number upper limit, to determine the optimal detection bit rate.

[0036] The present application provides an optimization device for bit rate detection, further comprising: an available bandwidth calculation module;

[0037] The available bandwidth calculation module is used to extract the target packet loss rate and the target delay from the second network feedback information, and simultaneously obtain the detection packet size during the bit rate detection period, and input the target packet loss rate, the target delay and the detection packet size into a preset available bandwidth calculation formula to obtain the instantaneous available bandwidth.

[0038] In a possible implementation, the available bandwidth calculation formula is as follows:

[0039] B = ((1-PLR)*S*8) / ARTT;

[0040] Where B is the instantaneous available bandwidth, PLR is the target packet loss rate, ARTT is the target delay, and S is the detection packet size.

[0041] In a possible implementation manner, the bit rate detection triggering module is used to collect first network feedback information, and when the first network feedback information meets the bit rate detection condition, trigger a bit rate detection operation, specifically including:

[0042] Obtain the expected total number of received detection packets and the actual total number of received detection packets in multiple time periods, calculate the packet loss rates corresponding to the multiple time periods based on the expected total number of received detection packets and the actual total number of received detection packets, and obtain the current bit rate corresponding to the current time period;

[0043] Obtaining the sending time and receiving time of the detection packet in multiple time periods, determining based on the sending time and the receiving time, and calculating the data round-trip time fluctuation rate in the multiple time periods based on the data round-trip time corresponding to each of the multiple time periods;

[0044] When the packet loss rates corresponding to the multiple time periods are less than a preset packet loss rate threshold, the data round-trip time fluctuation rate is less than a preset data round-trip time fluctuation rate threshold, and the current bit rate is less than the historical optimal detection bit rate, it is determined that the first network feedback information meets the bit rate detection condition, and a bit rate detection operation is triggered.

[0045] In a possible implementation, the detection bit rate adjustment module is used to collect the second network feedback information during the bit rate detection period, specifically including:

[0046] Obtaining the number of probe packets sent and the number of probe packets received during the bit rate detection period, and determining a target packet loss rate based on the number of probe packets sent and the number of probe packets received;

[0047] Obtaining a first sending time of a first detection packet during the bit rate detection period, and obtaining a first receiving time of a last detection packet, and determining a target delay based on the first sending time and the first receiving time,

[0048] Obtaining a second receiving time corresponding to each detection packet during the bit rate detection period, determining based on the second receiving time and calculating an average receiving time interval based on the receiving time interval between adjacent detection packets;

[0049] respectively calculating the time difference between the second receiving time corresponding to each detection packet and the average receiving time interval, and determining the target jitter based on the time difference;

[0050] The target packet loss rate, the target delay and the target jitter are used as second network feedback information during bit rate detection.

[0051] The present application provides a bit rate detection optimization device, further comprising: a bit rate detection re-triggering module;

[0052] The bit rate detection re-trigger module is used to monitor network feedback information in real time, wherein the network feedback information includes a real-time packet loss rate and a real-time data round-trip time, calculate the packet loss rate difference between the real-time packet loss rate and the packet loss rate at the previous moment, and calculate the data round-trip time difference between the real-time data round-trip time and the data round-trip time at the previous moment, and re-trigger the bit rate detection operation when the packet loss rate difference is greater than a preset packet loss rate difference threshold, or the data round-trip time difference is greater than a preset data round-trip time difference threshold.

[0053] In a possible implementation, the detection code rate adjustment module is used to adjust the current detection code rate to obtain the adjusted detection code rate, specifically including:

[0054] A preset gain factor is obtained, and the current detection code rate is adjusted based on the gain factor to obtain an adjusted detection code rate.

[0055] The present application also provides a terminal device, including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein when the processor executes the computer program, the optimization method for bit rate detection as described in any one of the above items is implemented.

[0056] The present application also provides a computer-readable storage medium, which includes a stored computer program, wherein when the computer program is running, the device where the computer-readable storage medium is located is controlled to execute the optimization method for bit rate detection as described in any one of the above.

[0057] The optimization method, device, equipment and storage medium of the bit rate detection in the embodiment of the present application have the following beneficial effects compared with the prior art:

[0058] Collecting first network feedback information, and triggering bit rate detection when the first network feedback information meets a bit rate detection condition;

[0059] By collecting the second network feedback information during the bit rate detection period, based on the second network feedback information, determining the network performance status during the bit rate detection period, when the network performance status meets the good network performance condition, adjusting the current detection bit rate to obtain the adjusted detection bit rate; based on the adjusted detection bit rate, re-collecting the second network feedback information during the bit rate detection period, until the network performance status corresponding to the re-collected second network feedback information does not meet the good network performance condition, or the current detection times meet the bit rate detection times upper limit, the optimal detection bit rate is determined; compared with the prior art, the technical solution of the present invention effectively improves the speed and accuracy of bit rate detection through fine condition triggering, real-time feedback adjustment and iterative optimization strategy, so that the system can adapt to different network environments more quickly and achieve the best data transmission effect in a short time. BRIEF DESCRIPTION OF THE DRAWINGS

[0060] Figure 1 This is a flow chart of an embodiment of a method for optimizing bit rate detection provided by the present application;

[0061] Figure 2 It is a structural schematic diagram of an embodiment of a bit rate detection optimization device provided by the present application;

[0062] Figure 3 This is a structural diagram of a GCC congestion control module after adding a probe code rate detection module in an embodiment provided by the present application;

[0063] Figure 4 It is a structural schematic diagram of a terminal device provided by the present invention. DETAILED DESCRIPTION

[0064] The following will be combined with the drawings in this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the described embodiments are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0065] Example 1, see Figure 1 , Figure 1 is a flow chart of an embodiment of a method for optimizing bit rate detection provided by the present application, such as Figure 1 As shown, the method includes steps 101 to 103, which are specifically as follows:

[0066] In the initial stage or when the network load is low, the sender usually sends data at a lower initial code rate to ensure that the network will not be congested due to too much data. When the sender detects that the available network bandwidth has increased or receives a signal that the network conditions have improved, it hopes to speed up the sending rate to make better use of the available bandwidth. However, without adding a detection code rate, the sender usually uses AIMD (additive increase, multiplicative decrease) to adjust the sending rate. This means that each time the sending rate is increased, only a small fixed amount is increased, and when the rate is reduced, it is multiplied by a small factor. This method ensures the stability of network congestion control, but the adjustment speed is slow, and it may take a long time to reach the optimal sending rate of the network.

[0067] Therefore, this embodiment adds a detection bit rate to the congestion control algorithm. The addition of the detection bit rate is intended to accelerate the sender's adaptation process to the network bandwidth; the sender detects the current available bandwidth of the network through the detection bit rate. In specific implementation, the sender may send data at a certain percentage of the target bit rate; if the receiving end confirms that the amount of data received reaches or exceeds the detection bit rate set by the sender, the sender considers that the detection is successful, and then the sending bit rate can be quickly adjusted to the target value; it is suitable for environments that need to quickly adapt to network changes, such as real-time video transmission or other applications with high real-time requirements; by quickly detecting the available bandwidth and adjusting the sending rate, network resources can be maximized.

[0068] like Figure 3 As shown, Figure 3 It is a structural diagram of the GCC congestion control module after adding the probe code rate detection module, wherein the probe code rate detection module includes the ProbeController class and the ProbeBitrateEst imator class, wherein the ProbeController class is a fast bandwidth control class.

[0069] Step 101: collect first network feedback information, and trigger bit rate detection when the first network feedback information meets a bit rate detection condition.

[0070] In one embodiment, the fast bandwidth control class includes algorithm parameter configuration, wherein the parameter configuration is used to set the initial bit rate, detection interval, gain factor and upper limit of bit rate detection times, and these parameters affect the speed, range and sensitivity of detection.

[0071] Specifically, for the initial bit rate: it can be set based on comprehensive consideration of network conditions and actual capabilities of the device, with a range of 50kbps to 1Mbps, so as to adapt to initial communication requirements under different network environments.

[0072] Specifically, the detection interval is used to control the frequency of bit rate detection. It is adjusted according to the network conditions to ensure that the detection frequency is not too frequent, causing interference to normal communication, and to avoid missing changes in network status due to too long a detection interval. The range is set to 5s to 30s.

[0073] Specifically, the gain factor is used to adjust the code rate after each code rate detection, and the range is set to 5% to 20% to achieve the purpose of balancing the detection efficiency and ensuring the stability of the code rate detection process.

[0074] Specifically, the upper limit of the bitrate detection times is set in the range of 3 to 5 times, which can avoid unnecessary network congestion caused by frequent sending of detection data packets. Especially when the network condition is already poor, frequent detection may aggravate congestion.

[0075] In one embodiment, the fast bandwidth control class detects the setting status of the detection bit rate, detects the network status of the network, detects the active request initiated by the outside, and detects whether it is currently in the application restriction area stage; wherein the setting status of the detection bit rate includes setting the maximum bit rate, setting the minimum bit rate, the initial bit rate or setting the estimated bit rate; the network status of the network is network interruption or network recovery.

[0076] In one embodiment, the fast bandwidth control class also includes a detection trigger and execution part, including starting bit rate detection and network feedback collection.

[0077] In one embodiment, the fast bandwidth control class triggers the detection condition of the detection bit rate when it detects that any of the setting states of the detection bit rate is set to set the maximum bit rate, set the minimum bit rate, the initial bit rate or set the estimated bit rate, the network state of the network is network interruption or network recovery, an active request initiated by the outside, and the current state is in the application restricted area stage.

[0078] In one embodiment, when a detection condition for detecting a bit rate is triggered, first network feedback information is collected, and it is determined whether the first network feedback information satisfies the bit rate detection condition.

[0079] In one embodiment, the expected total number of received detection packets and the actual total number of received detection packets in multiple time periods are obtained, and based on the expected total number of received detection packets and the actual total number of received detection packets, the packet loss rates corresponding to the multiple time periods are calculated.

[0080] Specifically, the expected total number of received detection packets and the actual total number of received detection packets corresponding to each time period in multiple time periods are obtained through a confirmation mechanism between the sender and the receiver.

[0081] Specifically, the expected total number of received packets and the actual total number of received packets in each time period are input into a preset packet loss rate calculation formula to calculate the packet loss rate corresponding to each time period, wherein the packet loss rate calculation formula is:

[0082] Packet loss rate = (total number of expected receptions - total number of actual receptions) / total number of expected receptions.

[0083] In one embodiment, a current bit rate corresponding to a current time period is obtained.

[0084] Specifically, the code rate corresponding to the current time period is obtained, which can be determined by the current sending rate.

[0085] In one embodiment, the sending time and receiving time of the detection packet in multiple time periods are obtained, and based on the sending time and the receiving time, the data round-trip time corresponding to each of the multiple time periods is determined and based on the fluctuation rate of the data round-trip time in the multiple time periods is calculated.

[0086] Specifically, the sending time and receiving time of the detection packet in each time period are input into the preset data round-trip time calculation formula to calculate the data round-trip time corresponding to each time period, wherein the data round-trip time calculation formula is: data round-trip time = receiving time - sending time.

[0087] Specifically, the volatility of the data round-trip time can reflect the stability of the network; therefore, the maximum value of the data round-trip time and the minimum value of the data round-trip time are obtained from the corresponding data round-trip times in the multiple time periods, and the average value of the data round-trip time is calculated based on the corresponding data round-trip times in the multiple time periods, and the minimum value of the data round-trip time, the maximum value of the data round-trip time and the average value of the data round-trip time are substituted into the data round-trip time volatility calculation formula to obtain the data round-trip time volatility in the multiple time periods; wherein the data round-trip time volatility calculation formula is as follows:

[0088] Data round trip time fluctuation rate =

[0089] (Maximum data round-trip time - Minimum data round-trip time) / Average data round-trip time.

[0090] In one embodiment, when the packet loss rates corresponding to the multiple time periods are less than a preset packet loss rate threshold, the data round-trip time fluctuation rate is less than a preset data round-trip time fluctuation rate threshold, and the current bit rate is less than the historical optimal detection bit rate, it is determined that the network feedback information meets the bit rate detection condition and the bit rate detection is triggered.

[0091] Preferably, the preset packet loss rate threshold is 1%; the preset data round-trip time fluctuation rate threshold is 10%.

[0092] Specifically, the packet loss rate of each time period is compared with a preset packet loss rate threshold. If the packet loss rates of all time periods are less than the preset packet loss rate threshold, it is considered that the network status is good and suitable for bit rate detection.

[0093] Specifically, the calculated data round-trip time fluctuation rate is compared with a preset data round-trip time fluctuation rate threshold; if the data round-trip time fluctuation rate is less than the preset data round-trip time fluctuation rate threshold, it is considered that the network state is stable and suitable for bit rate detection.

[0094] Specifically, the historical optimal detection code rate is the optimal detection code rate determined in the previous code rate detection cycle. The current code rate is compared with the historical optimal detection code rate. When the current code rate is less than the historical optimal detection code rate, it is considered that the network state is stable and suitable for code rate detection.

[0095] In one embodiment, when the above conditions are met, the sender can send a code rate based on a preset initial code rate to perform code rate detection; through this mechanism, the sender can more accurately understand the real-time status of the network and dynamically adjust the sending detection code rate without causing network congestion, thereby improving the efficiency and stability of data transmission.

[0096] Step 102: collect the second network feedback information during the bit rate detection period, determine the network performance status during the bit rate detection period based on the second network feedback information, and when the network performance status meets the good network performance condition, adjust the current detection bit rate to obtain the adjusted detection bit rate.

[0097] In one embodiment, the fast bandwidth control class also includes a rate adjustment part.

[0098] In one embodiment, the number of sent detection packets and the number of received detection packets during the bit rate detection period are obtained, and the target packet loss rate is determined based on the number of sent detection packets and the number of received detection packets.

[0099] Specifically, the number of probe packets sent during the bit rate detection is recorded, the number of probe packets successfully received during the bit rate detection is recorded, the difference between the number of probe packets sent and the number of probe packets received is calculated, and the difference is divided by the number of probe packets sent to obtain the target packet loss rate.

[0100] In one embodiment, a first sending time of a first detection packet during a bit rate detection period is obtained, and a first receiving time of a last detection packet is obtained, and a target delay is determined based on the first sending time and the first receiving time.

[0101] Specifically, the sending time of the first detection packet is recorded as the first sending time, and the receiving time of the last detection packet is recorded as the first receiving time, and the first sending time is subtracted from the first receiving time to obtain the target delay.

[0102] In one embodiment, the second receiving time corresponding to each detection packet during the bit rate detection is obtained, and based on the second receiving time, the average receiving time interval is determined and calculated based on the receiving time interval between adjacent detection packets; the time difference between the second receiving time corresponding to each detection packet and the average receiving time interval is calculated respectively, and the target jitter is determined based on the time difference.

[0103] Specifically, during the bit rate detection, for each detection packet, its receiving time is recorded as the second receiving time, and based on all the detection packets, multiple adjacent detection packet pairs are determined. For each adjacent detection packet pair, their respective corresponding receiving time intervals are calculated, and all the receiving time intervals are summed up and divided by the number of adjacent detection packet pairs to obtain the average receiving time interval.

[0104] Specifically, for each detection packet, the time difference between the second receiving time and the average receiving time interval is calculated, and the target jitter is determined based on the root mean square of the sum of the squares of the time differences.

[0105] In one embodiment, the target packet loss rate, the target delay and the target jitter are used as the second network feedback information during the bit rate detection period.

[0106] Preferably, a time window is set as the time period for bit rate detection; within the time window, a series of detection packets are sent, and their sending time and receiving time are recorded; the target packet loss rate, target delay and target jitter are calculated using the above method; this information is fed back to the bit rate control algorithm to adjust the transmission bit rate.

[0107] In one embodiment, the second network feedback information calculated above can reflect the instability of network delay. When the target packet loss rate increases, the target delay increases, or the target jitter increases, it means that the detected bit rate value needs to be reduced to alleviate the occurrence of the above situation.

[0108] In one embodiment, the target packet loss rate is compared with a preset target packet loss rate threshold, and the target delay is compared with a preset target delay threshold. If the target packet loss rate is less than the preset target packet loss rate threshold, and the target delay is not greater than the preset target delay threshold, then the network performance status during the bit rate detection period is determined to be good network performance; otherwise, the network performance status during the bit rate detection period is determined to be poor network performance.

[0109] Preferably, the preset target packet loss rate threshold is 2%, and the preset target delay threshold is 20%. If the network performance is good during the detection period, that is, the target packet loss rate is less than 2% and the target delay is not greater than 20%, it is considered that the current network conditions support the detected bit rate; conversely, if the packet loss rate increases or the delay increases significantly, the bit rate needs to be reduced to maintain the communication quality.

[0110] In one embodiment, when the current detection code rate is adjusted to obtain the adjusted detection code rate, a preset gain factor is obtained, and the current detection code rate is adjusted based on the gain factor to obtain the adjusted detection code rate.

[0111] Specifically, when it is determined that the network performance state during the bit rate detection period is a good network performance, the bit rate is increased according to the gain factor, and detection is performed again based on the increased adjusted bit rate.

[0112] Specifically, when it is determined that the network performance state during the bit rate detection period is that the network performance is not good, the bit rate reduction processing is performed on the current detection bit rate according to the gain factor.

[0113] Preferably, the code rate adjustment strategy adopts a gradient increasing method, and the code rate is increased by 5% during the initial detection, and then it can be adjusted according to the packet loss rate and delay until the set maximum or minimum adjustment threshold is reached.

[0114] Preferably, the target packet loss rate is also compared with a preset target packet loss rate maximum value. If the target packet loss rate is greater than the preset target packet loss rate maximum value, a rapid speed reduction mechanism is triggered to quickly reduce the current bit rate to the optimal detection bit rate determined during the previous detection period.

[0115] Preferably, the preset maximum value of the target packet loss rate is 10%.

[0116] In one embodiment, the ProbeBitrateEstimator class can obtain the second network feedback information from the fast bandwidth control class and calculate the available bandwidth based on the second network feedback information.

[0117] In one embodiment, after determining the network performance status during the bit rate detection period based on the second network feedback information, the target packet loss rate and target delay are extracted from the second network feedback information, and the detection packet size during the bit rate detection period is obtained.

[0118] In one embodiment, when it is determined that the network performance status during the bit rate detection period is good, the target packet loss rate, the target delay and the detection packet size are input into a preset available bandwidth calculation formula to obtain the instantaneous available bandwidth.

[0119] Specifically, the available bandwidth calculation formula is as follows:

[0120] B = ((1-PLR)*S*8) / ARTT;

[0121] Where B is the instantaneous available bandwidth, PLR is the target packet loss rate, ARTT is the target delay, and S is the detection packet size.

[0122] In one embodiment, when it is determined that the network performance during the bit rate detection period is poor, the current instantaneous available bandwidth can be updated according to a certain ratio α=0.9 in combination with the historical instantaneous available bandwidth value to reduce the volatility of the estimate.

[0123] Step 103: Based on the adjusted detection bit rate, re-collect the second network feedback information during the bit rate detection period until the network performance status corresponding to the re-collected second network feedback information does not meet the good network performance condition, or the current detection times meet the bit rate detection times upper limit, and determine the optimal detection bit rate.

[0124] In one embodiment, after the adjusted detection bit rate is obtained, the second network feedback information during the bit rate detection period is re-collected based on the method of step 102.

[0125] In one embodiment, after re-detecting the bit rate based on adjusting the detection bit rate, the following two termination conditions are further detected: the network performance status does not meet the good network performance condition, and the number of detection times reaches a preset upper limit.

[0126] In one embodiment, when the network performance status corresponding to the re-collected second network feedback information does not meet the good network performance condition, the detection code rate before adjustment is used as the optimal detection code rate; that is, by comparing the difference in network feedback before and after the code rate adjustment, it is determined whether to set the adjusted code rate as the optimal detection code rate.

[0127] In one embodiment, if the current number of detection times meets the upper limit of the number of bit rate detection times, the current adjusted detection bit rate is used as the optimal detection bit rate.

[0128] In one embodiment, the current actual bit rate is obtained, and the current actual bit rate is compared with the optimal detection bit rate. If the current actual bit rate is less than the optimal detection bit rate, the current actual bit rate is increased, and the optimal detection bit rate is used as the current actual bit rate.

[0129] In one embodiment, if the current actual bit rate is less than the optimal detection bit rate, a bit rate reduction process is performed on the current actual bit rate, and the optimal detection bit rate is used as the current actual bit rate.

[0130] In one embodiment, after determining the optimal detection bit rate, the network feedback information is also monitored in real time, wherein the network feedback information includes the real-time packet loss rate and the real-time data round-trip time; the packet loss rate difference between the real-time packet loss rate and the packet loss rate at the previous moment is calculated, and the data round-trip time difference between the real-time data round-trip time and the data round-trip time at the previous moment is calculated; when the packet loss rate difference is greater than a preset packet loss rate difference threshold, or the data round-trip time difference is greater than a preset data round-trip time difference threshold, the bit rate detection operation is re-triggered.

[0131] Specifically, after determining the optimal detection code rate, it is still necessary to monitor the network feedback information in real time to capture any changes that may affect the transmission performance.

[0132] Specifically, the packet loss rate difference refers to the difference between the real-time packet loss rate and the packet loss rate at the previous moment; the data round-trip time difference refers to the difference between the real-time data round-trip time and the data round-trip time at the previous moment; the preset packet loss rate difference threshold and data round-trip time difference threshold are parameters set by the system based on experience or network characteristics, and are used to determine whether the network status has changed significantly.

[0133] Specifically, if the packet loss rate difference is greater than the preset difference threshold, this may indicate that the network quality is deteriorating and the bit rate needs to be re-evaluated; if the data round-trip time difference is greater than the preset data round-trip time difference threshold, this may indicate that the network delay is increasing and the bit rate may also need to be adjusted; when any of the above conditions is met, the system will re-trigger the bit rate detection operation to determine whether the current optimal detection bit rate needs to be adjusted.

[0134] Specifically, this strategy allows the system to adaptively respond to changes in network conditions rather than relying solely on initial detection results; by setting thresholds, it can avoid overreacting to small network fluctuations, thereby reducing unnecessary bitrate adjustments.

[0135] In one embodiment, when the network status is good, that is, the target packet loss rate is low and the network jitter is not obvious, the network is relatively stable and does not require frequent detection; in this state, the number of bit rate detections can be reduced to reduce interference with normal communications and the occupation of network resources. If the target packet loss rate is high or the network status changes rapidly, more frequent detection is required to quickly respond to network changes.

[0136] Specifically, when the network environment is poor, increasing the frequency of bit rate detection, the size of the detection packet, and the duration of the detection can help the system capture changes in network status more quickly.

[0137] Preferably, according to the change of network status, the frequency of bit rate detection can be adjusted from once every 10 seconds to once every 5 seconds to adapt to different network conditions; the size of the detection packet can also be adjusted from 1KB to 2KB as needed to obtain more network status information; the duration of the detection can be extended from 10 seconds to 20 seconds as needed to collect more data when the network changes.

[0138] Example 2, see Figure 2 , Figure 2 is a structural diagram of an embodiment of a bit rate detection optimization device provided by the present application, such as Figure 2 As shown, the device includes a code rate detection trigger module 201, a detection code rate adjustment module 202 and an optimal detection code rate confirmation module 203, which are specifically as follows:

[0139] The bit rate detection triggering module 201 is used to collect first network feedback information, and trigger bit rate detection when the first network feedback information meets the bit rate detection condition.

[0140] The detection bit rate adjustment module 202 is used to collect the second network feedback information during the bit rate detection period, determine the network performance status during the bit rate detection period based on the second network feedback information, and when the network performance status meets the good network performance condition, adjust the current detection bit rate to obtain the adjusted detection bit rate.

[0141] The optimal detection bit rate confirmation module 203 is used to re-collect the second network feedback information during the bit rate detection period based on the adjusted detection bit rate, until the network performance status corresponding to the re-collected second network feedback information does not meet the good network performance condition, or the current detection number meets the bit rate detection number upper limit, to determine the optimal detection bit rate.

[0142] The bit rate detection optimization device provided in the embodiment of the present application also includes: an available bandwidth calculation module.

[0143] In one embodiment, the available bandwidth calculation module is used to extract the target packet loss rate and the target delay from the second network feedback information, and simultaneously obtain the detection packet size during the bit rate detection period, and input the target packet loss rate, the target delay and the detection packet size into a preset available bandwidth calculation formula to obtain the instantaneous available bandwidth.

[0144] In one embodiment, the available bandwidth calculation formula is as follows:

[0145] B = ((1-PLR)*S*8) / ARTT;

[0146] Where B is the instantaneous available bandwidth, PLR is the target packet loss rate, ARTT is the target delay, and S is the detection packet size.

[0147] In one embodiment, the bit rate detection trigger module 201 is used to collect first network feedback information, and when the first network feedback information meets the bit rate detection condition, trigger the bit rate detection operation, which specifically includes: obtaining the expected total number of received detection packets and the actual total number of received detection packets in multiple time periods, calculating the packet loss rates corresponding to each of the multiple time periods based on the expected total number of received detection packets and the actual total number of received detection packets, and obtaining the current bit rate corresponding to the current time period; obtaining the sending time and receiving time of the detection packets in multiple time periods, determining and calculating the data round trip time fluctuation rate in the multiple time periods based on the sending time and the receiving time; when the packet loss rates corresponding to each of the multiple time periods are less than a preset packet loss rate threshold, the data round trip time fluctuation rate is less than a preset data round trip time fluctuation rate threshold, and the current bit rate is less than the historical optimal detection bit rate, it is determined that the first network feedback information meets the bit rate detection condition, and the bit rate detection operation is triggered.

[0148] In one embodiment, the detection bit rate adjustment module 202 is used to collect the second network feedback information during the bit rate detection period, specifically including: obtaining the number of detection packets sent and the number of detection packets received during the bit rate detection period, and determining the target packet loss rate based on the number of detection packets sent and the number of detection packets received; obtaining the first sending time of the first detection packet during the bit rate detection period, and obtaining the first receiving time of the last detection packet, and determining the target delay based on the first sending time and the first receiving time, obtaining the second receiving time corresponding to each detection packet during the bit rate detection period, determining based on the second receiving time and calculating the average receiving time interval based on the receiving time interval between adjacent detection packets; respectively calculating the time difference between the second receiving time corresponding to each detection packet and the average receiving time interval, and determining the target jitter based on the time difference; using the target packet loss rate, the target delay and the target jitter as the second network feedback information during the bit rate detection period.

[0149] The bit rate detection optimization device provided in the embodiment of the present application also includes: a bit rate detection re-triggering module.

[0150] In one embodiment, the bit rate detection re-trigger module is used to monitor network feedback information in real time, wherein the network feedback information includes real-time packet loss rate and real-time data round-trip time, calculate the packet loss rate difference between the real-time packet loss rate and the packet loss rate at the previous moment, and calculate the data round-trip time difference between the real-time data round-trip time and the data round-trip time at the previous moment, and re-trigger the bit rate detection operation when the packet loss rate difference is greater than a preset packet loss rate difference threshold, or the data round-trip time difference is greater than a preset data round-trip time difference threshold.

[0151] In one embodiment, the detection code rate adjustment module 202 is used to adjust the current detection code rate to obtain the adjusted detection code rate, which specifically includes: obtaining a preset gain factor, and adjusting the current detection code rate based on the gain factor to obtain the adjusted detection code rate.

[0152] The above-mentioned bit rate detection optimization device can implement the bit rate detection optimization method of the above-mentioned method embodiment. The options in the above-mentioned method embodiment are also applicable to this embodiment and will not be described in detail here.

[0153] Figure 4 A schematic diagram of the structure of a terminal device. Figure 4 As shown, the terminal device 4 of this embodiment includes: at least one processor 401 ( Figure 4 Only one is shown in the figure) a processor, a memory 402, and a computer program 403 stored in the memory 402 and executable on at least one processor 401, and when the processor 401 executes the computer program 403, the steps in any of the above method embodiments are implemented.

[0154] The terminal device 4 may be a computing device such as a smart phone, a laptop, a tablet computer, and a desktop computer. The terminal device may include but is not limited to a processor 401 and a memory 402. Those skilled in the art will appreciate that Figure 4 It is only an example of the terminal device 4 and does not constitute a limitation on the terminal device 4. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, it may also include input and output devices, network access devices, etc.

[0155] The processor 401 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.

[0156] In some embodiments, the memory 402 may be an internal storage unit of the terminal device 4, such as a hard disk or memory of the terminal device 4. In other embodiments, the memory 402 may also be an external storage device of the terminal device 4, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the terminal device 4. Further, the memory 402 may also include both an internal storage unit and an external storage device of the terminal device 4. The memory 402 is used to store an operating system, an application program, a boot loader (BootLoader), data, and other programs, such as program codes of computer programs. The memory 402 may also be used to temporarily store data that has been output or is to be output.

[0157] In addition, an embodiment of the present application further provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the steps in any of the above method embodiments are implemented.

[0158] In several embodiments provided in the present application, it is understood that each box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and a module, a program segment or a part of a code includes one or more executable instructions for realizing a specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from that marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes also be executed in the opposite order, depending on the functions involved.

[0159] If the function is implemented in the form of a software function module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a terminal device to execute all or part of the steps of each embodiment method of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program code.

[0160] In summary, the present application provides an optimization method, device, equipment and storage medium for bit rate detection, which collects first network feedback information, and triggers bit rate detection when the first network feedback information meets the bit rate detection condition; collects second network feedback information during the bit rate detection period, and determines the network performance status during the bit rate detection period based on the second network feedback information, and when the network performance status meets the good network performance condition, adjusts the current detection bit rate to obtain the adjusted detection bit rate; based on the adjusted detection bit rate, re-collects the second network feedback information during the bit rate detection period until the network performance status corresponding to the re-collected second network feedback information does not meet the good network performance condition, or the current detection number meets the upper limit of the bit rate detection number, and determines the optimal detection bit rate; compared with the prior art, the technical solution of the present application can quickly adapt to changes in network conditions and improve data transmission efficiency.

[0161] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and substitutions can be made without departing from the technical principles of the present application. These improvements and substitutions should also be regarded as the scope of protection of the present application.

Claims

1. A method for optimizing bit rate detection, characterized in that: include: Collecting first network feedback information, and triggering bit rate detection when the first network feedback information meets a bit rate detection condition; Collecting second network feedback information during the bit rate detection period, determining a network performance state during the bit rate detection period based on the second network feedback information, and when the network performance state meets a good network performance condition, adjusting the current detection bit rate to obtain an adjusted detection bit rate; Based on the adjustment of the detection bit rate, the second network feedback information during the bit rate detection period is re-collected until the network performance state corresponding to the re-collected second network feedback information does not meet the good network performance condition, or the current detection times meet the bit rate detection times upper limit, and the optimal detection bit rate is determined.

2. The method for optimizing bit rate detection according to claim 1, characterized in that: After determining the network performance state during the bit rate detection period based on the second network feedback information, the method further includes: Extracting the target packet loss rate and target delay from the second network feedback information, and obtaining the detection packet size during the bit rate detection period; The target packet loss rate, the target delay and the detection packet size are input into a preset available bandwidth calculation formula to obtain instantaneous available bandwidth.

3. The method for optimizing bit rate detection according to claim 2, wherein: The formula for calculating the available bandwidth is as follows: B = ((1-PLR)*S*8) / ARTT; Where B is the instantaneous available bandwidth, PLR is the target packet loss rate, ARTT is the target delay, and S is the detection packet size.

4. The method for optimizing bit rate detection according to claim 1, wherein: Collecting first network feedback information, and triggering bit rate detection when the first network feedback information meets a bit rate detection condition, specifically including: Obtain the expected total number of received detection packets and the actual total number of received detection packets in multiple time periods, calculate the packet loss rates corresponding to the multiple time periods based on the expected total number of received detection packets and the actual total number of received detection packets, and obtain the current bit rate corresponding to the current time period; Obtaining the sending time and receiving time of the detection packet in multiple time periods, determining based on the sending time and the receiving time, and calculating the data round-trip time fluctuation rate in the multiple time periods based on the data round-trip time corresponding to each of the multiple time periods; When the packet loss rates corresponding to the multiple time periods are less than the preset packet loss rate threshold, the data round-trip time fluctuation rate is less than the preset data round-trip time fluctuation rate threshold, and the current bit rate is less than the historical optimal detection bit rate, it is determined that the network feedback information meets the bit rate detection conditions and the bit rate detection is triggered.

5. The method for optimizing bit rate detection according to claim 1, characterized in that: Collect the second network feedback information during the bit rate detection period, including: Obtaining the number of probe packets sent and the number of probe packets received during the bit rate detection period, and determining a target packet loss rate based on the number of probe packets sent and the number of probe packets received; Obtaining a first sending time of a first detection packet during the bit rate detection period, and obtaining a first receiving time of a last detection packet, and determining a target delay based on the first sending time and the first receiving time, Obtaining a second receiving time corresponding to each detection packet during the bit rate detection period, determining based on the second receiving time and calculating an average receiving time interval based on the receiving time interval between adjacent detection packets; respectively calculating the time difference between the second receiving time corresponding to each detection packet and the average receiving time interval, and determining the target jitter based on the time difference; The target packet loss rate, the target delay and the target jitter are used as second network feedback information during bit rate detection.

6. The method for optimizing bit rate detection according to claim 1, characterized in that: After determining the optimal detection code rate, it also includes: Real-time monitoring of network feedback information, wherein the network feedback information includes real-time packet loss rate and real-time data round-trip time; Calculate the packet loss rate difference between the real-time packet loss rate and the packet loss rate at the previous moment, and calculate the data round-trip time difference between the real-time data round-trip time and the data round-trip time at the previous moment; When the packet loss rate difference is greater than a preset packet loss rate difference threshold, or the data round-trip time difference is greater than a preset data round-trip time difference threshold, the bit rate detection operation is re-triggered.

7. The method for optimizing bit rate detection according to claim 1, wherein: The current detection code rate is adjusted to obtain an adjusted detection code rate, specifically including: A preset gain factor is obtained, and the current detection code rate is adjusted based on the gain factor to obtain an adjusted detection code rate.

8. A device for optimizing bit rate detection, characterized in that: include: Bit rate detection trigger module, detection bit rate adjustment module and optimal detection bit rate confirmation module; The bit rate detection triggering module is used to collect the first network feedback information, and trigger the bit rate detection when the first network feedback information meets the bit rate detection condition; The detection bit rate adjustment module is used to collect the second network feedback information during the bit rate detection period, determine the network performance status during the bit rate detection period based on the second network feedback information, and when the network performance status meets the good network performance condition, adjust the current detection bit rate to obtain the adjusted detection bit rate; The optimal detection bit rate confirmation module is used to re-collect the second network feedback information during the bit rate detection period based on the adjusted detection bit rate, until the network performance status corresponding to the re-collected second network feedback information does not meet the good network performance condition, or the current detection number meets the bit rate detection number upper limit, to determine the optimal detection bit rate.

9. A terminal device, characterized in that: The method comprises a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein the processor implements the method for optimizing code rate detection as claimed in any one of claims 1 to 7 when executing the computer program.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored computer program, wherein when the computer program is executed, the device where the computer-readable storage medium is located is controlled to execute the method for optimizing bit rate detection according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Method and device for controlling code rates on basis of network state evaluation

    CN104243102A

  • Method, apparatus and device for detection of available bandwidth of network link

    CN108011771A

  • Live streaming data transmission control method and device, live streaming equipment and storage medium

    CN108833930A

  • Sending code rate adjusting method and system for wireless network video

    CN109348259A

  • Network condition detection method and device, equipment, medium and product

    CN114302164A