Streaming media transmission optimization method and system based on Cubic
Through the Cubic-based streaming media transmission optimization method, combined with the difference in transmission delay and packet loss rate between packets, the transmission bit rate is dynamically adjusted, which solves the problem of network state misjudgment and low bandwidth utilization in streaming media transmission, and realizes efficient streaming media transmission in a shallow buffer network environment.
Patent Information
- Application Number
- CN202510633593.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-16
- Publication Date
- 2025-08-12
AI Technical Summary
The existing streaming media transmission congestion control algorithms have problems such as misjudging the network status, low bandwidth utilization and large network jitter in the Changfei network and the shallow buffer network environment. In particular, the packet loss algorithm is misjudged random packet loss in the Changfei network. The delay-based algorithm cannot effectively preempt bandwidth in the shallow buffer network.
The streaming media transmission optimization method based on Cubic is adopted, and the transmission delay difference and packet loss rate between packet groups is calculated, combined with a finite state machine and adaptive threshold, the transmission bit rate is dynamically adjusted, and the bandwidth estimator module based on delay and packet loss is used to achieve accurate judgment of network state and optimization of code rate.
After the network congestion is restored, the streaming media transmission code rate will be quickly restored, the bandwidth utilization will be improved, the network congestion in the dark buffer network environment will be avoided, and the stability and efficiency of streaming media transmission will be improved.
Smart Images

Figure CN120474989A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of streaming media transmission, and in particular to a Cubic-based streaming media transmission optimization method and system. Background Art
[0002] In streaming media transmission, congestion control algorithms are key technologies for ensuring transmission quality and user experience. Traditional congestion control algorithms are primarily categorized as packet loss-based and delay-based, but both have limitations in streaming media transmission. Loss-based congestion control algorithms, such as Reno and NewReno, passively monitor network packet loss events to determine network congestion. However, these algorithms face significant challenges in long-fat networks (LFNs). Random packet loss is more likely in LFNs, but this loss is not necessarily caused by network congestion. Loss-based congestion control algorithms cannot distinguish between random and congestion-related packet loss, leading to misjudgment of network status and proactively reducing the sending bitrate, thereby reducing bandwidth utilization. Furthermore, these algorithms continue to occupy router buffers even when packet loss is not occurring. While this improves bandwidth utilization, once packet loss occurs, it signals severe network congestion, resulting in delayed response and high network jitter. Delay-based congestion control algorithms, such as Vegas, predict congestion by monitoring network delay variations. Because network latency often precedes packet loss, especially in deep buffer networks, where packet latency increases significantly as they queue in the buffer, delay-based algorithms can detect congestion before it occurs and reduce the sending bitrate, thereby avoiding network congestion. However, these algorithms cannot trigger congestion control when the buffer is not full, putting them at a disadvantage when competing for bandwidth with loss-based algorithms. In networks where loss-based algorithms dominate, delay-based algorithms suffer from bandwidth starvation due to their inability to effectively seize bandwidth, making them difficult to compete effectively with mainstream algorithms. BBR (Bottleneck Bandwidth and Round-Trip Propagation Time) is a congestion control algorithm based on bottleneck bandwidth and RTT feedback. Unlike traditional event-driven algorithms, BBR achieves autonomous control through real-time feedback, with the sending rate dynamically adjusted by the algorithm rather than relying on network events. BBR's main advantages are low latency and strong bandwidth preemption, but it also suffers from slow convergence and limited jitter tolerance. GCC (Google Congestion Control) combines delay-based and loss-based congestion control mechanisms. In deep-buffer networks, when congestion occurs, transmission delay increases significantly. Delay-based control mechanisms can promptly detect congestion and make adjustments. In shallow-buffer networks, when delay changes are less pronounced, packet loss-based control mechanisms take effect. This combined mechanism enables GCC to adapt to diverse network environments, improving the flexibility and robustness of congestion control. However, after congestion is triggered, GCC's AI (additive addition) congestion recovery is slow, resulting in low bandwidth utilization. Summary of the Invention
[0003] The purpose of the present invention is to overcome the shortcomings of the existing technology and provide a Cubic-based streaming media transmission optimization method and system, which can quickly restore the streaming media transmission bit rate after network congestion is recovered, improve bandwidth utilization, and avoid the occurrence of network congestion in deep and shallow buffer network environments.
[0004] To achieve the above objectives, the technical solutions provided by the present invention are:
[0005] A Cubic-based streaming media transmission optimization method includes the following steps:
[0006] S1. The sender calculates the transmission delay difference d between packet groups based on the sending and arrival time information of the data packet. i , get the current queuing delay gradient T′ qi , and calculate the packet loss rate f with the help of packet loss information l ;
[0007] S2, the queue delay gradient T′ calculated by S1 qi Compare with the adaptive threshold to determine the current network status, and then update the adaptive threshold;
[0008] S3. Input the current network state into the finite state machine, obtain the rate adjustment strategy of the delay-based bandwidth estimator and calculate the corresponding sending rate at the next moment;
[0009] S4, according to the packet loss rate f l Determine the bitrate adjustment strategy of the bandwidth estimator based on packet loss and calculate the corresponding sending bitrate at the next moment;
[0010] S5. Take the minimum value of the next moment transmission bit rate calculated by the delay-based bandwidth estimator and the packet loss-based bandwidth estimator as the target transmission bit rate and input it into the encoder and data transmission module;
[0011] S6. Repeat steps S1 to S5 to complete the optimization.
[0012] Furthermore, the transmission delay difference between packet groups is calculated, including:
[0013] Define a packet group as a set of data packets sent continuously;
[0014] Let the sending time of the first data packet be T i-1 , the subsequent data packet sending time is T i ; If the time interval between the subsequent data packet and the first data packet is ΔT = T i -T i-1 ≤ the set value, the two data packets belong to the same packet group; otherwise, the subsequent data packets belong to the next packet group;
[0015] Define the sending time of the first packet of the i-1th packet group as T i-1 , the time when the last packet arrives at the receiver is t i-1 ; The first packet of the i-th packet group is sent at T i , the time when the last packet arrives at the receiver is t i , the transmission delay difference d between packet groups i The calculation formula is as follows:
[0016] d i =(t i -t i-1 )-(T i -T i-1 ).
[0017] Furthermore, the queuing delay gradient T′ is calculated qi ,include:
[0018] A two-dimensional coordinate system is established with the arrival time as the x-axis and the cumulative value of the transmission delay difference between packet groups as the y-axis. Each time a packet group is received, the relevant data is converted into the coordinate system;
[0019] Each packet group corresponds to the coordinate x on the x-axis. i Defined as the time t when the last data packet of the current packet group arrives at the receiver i Subtract the time t when the first data packet of the packet group arrives at the receiver first_arrival , the calculation formula is as follows:
[0020] x i =t i -t first_arrival
[0021] Each packet group corresponds to the coordinate y on the y-axis i Defined as the cumulative value of the transmission delay difference between packet groups
[0022] Considering that the packet group may have large jitter at some time, in order to make y i To make it smoother, use the following formula to perform exponential smoothing on the accumulated value:
[0023]
[0024] y i =αy i-1 +(1-α)acc i
[0025] Among them, α is the smoothing coefficient;
[0026] After collecting n packet group coordinate data, the queue delay gradient is calculated. The default value of n is 20. i and yi Corresponding average value and As follows:
[0027]
[0028] Based on x i 、y i 、 and Get a straight line with the smallest square error, the slope of the straight line is k i The calculation formula is as follows:
[0029]
[0030] Slope k i It is also the queuing delay gradient T′ qi .
[0031] Furthermore, the sender calculates the packet loss rate f according to the packet loss information analyzed by the RTCP analysis module. l , the calculation formula is as follows:
[0032]
[0033] Among them, received_seq_max is the maximum sequence number of the streaming data packet received by the receiver; last_report_seq_max is the maximum sequence number of the streaming data packet received by the receiver in the last RTCP feedback message; cumulative_loss is the total number of streaming packet losses in the current streaming; last_report_cumulative_loss is the total number of streaming packet losses in the last RTCP feedback.
[0034] Furthermore, step S2 includes:
[0035] S2-1, the queue delay gradient T′ calculated by S1 qi Compare with the adaptive threshold to determine the current network status:
[0036] The queuing delay gradient T′ qi Multiply by n to amplify, and the amplified queue delay gradient is NT′ qi The calculation formula is as follows:
[0037] NT′ qi =T′ qi ×n
[0038] Using NT′ qi Compare with the adaptive threshold γ to determine the current network status; when NT′ qiWhen the adaptive threshold γ is exceeded, the network is considered to be in an overload state; when NT′ qi When NT′ is less than -γ, the network is considered to be underloaded; when NT′ qi When it is within the range of [-γ, γ], the network is considered to be in normal state. The judgment formula is as follows:
[0039]
[0040] S2-2, update the adaptive threshold:
[0041] After obtaining the current network status in step S2-1, the threshold γ is updated in combination with the current queuing delay gradient. The adjustment formula is as follows:
[0042] γ i =γ i-1 +△t i ×k i ×([NT′ qi -γ i-1 )
[0043] Where, Δt i Indicates the interval between the current threshold update time and the last threshold update time, k i The coefficient that determines the change of threshold γ is taken as follows:
[0044]
[0045] Furthermore, step S3 includes:
[0046] S3-1. Using a finite state machine to determine the rate adjustment strategy of the delay-based bandwidth estimator:
[0047] When the current network state is in the overload state (Overuse), the finite state machine enters the Decrease state, and the rate adjustment strategy is to reduce the rate and gradually empty the queue. When the network is in the underload state (Underuse), the finite state machine enters the Hold state, and the rate adjustment strategy is to maintain the current rate and wait for the queue to be emptied. When the network is in the normal state (Normal), the finite state machine enters the Increase state, and the rate adjustment strategy is to increase the rate.
[0048] S3-2. The Cubic controller calculates the sending bit rate at the next moment based on the bit rate adjustment strategy:
[0049] When the code rate adjustment strategy is to reduce the code rate, the Cubic controller uses a multiplication reduction method to adjust the transmission code rate of the delay-based bandwidth estimator, and the corresponding transmission code rate C at the next moment is target (t) is calculated as follows:
[0050] C target (t) = β·R(t i-1 )
[0051] Where β is the multiplication reduction factor; R(t i-1 ) is the average receiving rate estimated by the sender based on the feedback message from the receiving end;
[0052] When the bitrate adjustment strategy is to maintain the current bitrate, the Cubic controller keeps the current sending bitrate unchanged, and the corresponding sending bitrate C at the next moment target (t) is calculated as follows:
[0053] C target (t) = C(t i-1 )
[0054] Among them, C(t i-1 ) is the sending bit rate at the current moment;
[0055] When the bit rate adjustment strategy is to increase the bit rate, the Cubic controller adjusts the sending bit rate detection bandwidth upper limit according to the cubic function model, and the corresponding sending bit rate C at the next moment is target (t) is calculated as follows:
[0056] C target (t)=α·c·((tt last )-k) 3 +B latest
[0057]
[0058] Among them, the coefficient c determines the overall curvature of the cubic function of the transmission rate growth. The larger the value, the steeper the overall transmission rate growth curve and the faster the transmission rate growth; the coefficient β is the multiplicative reduction factor that proportionally reduces the rate when the transmission network is congested; B latest is the sending bit rate when the bit rate dropped last time; t is the current time; variable k is the time required for the sending bit rate to recover to the sending bit rate when the bit rate dropped last time; t last is the time of the last bit rate drop; the variable α is the coefficient that controls the curvature change of the cubic function, and its value is as follows:
[0059]
[0060] By adjusting the coefficient α, the detection speed of the current network bandwidth is accelerated, the maximum bandwidth of the network can be detected more quickly, and the sending bit rate level can be improved.
[0061] Furthermore, step S4 includes:
[0062] If the packet loss rate f lGreater than 10%, the bandwidth estimator based on packet loss reduces the bit rate; if the packet loss rate f l If the packet loss is less than 2%, the bandwidth estimator based on packet loss increases the bit rate; otherwise, the sending bit rate remains unchanged;
[0063] The corresponding sending code rate A at the next moment s (t k ) is calculated as follows:
[0064]
[0065] Among them, A s (t k-1 ) is the sending bit rate estimated by the bandwidth estimator based on packet loss at the previous moment.
[0066] Furthermore, the present invention also provides a Cubic-based streaming media transmission optimization system for implementing the above-mentioned Cubic-based streaming media transmission optimization method, which includes an RTCP assembly module, an RTCP parsing module, an encoder module, a data sending module, a delay-based bandwidth estimator module, and a packet loss-based bandwidth estimator module;
[0067] The RTCP assembly module is used to assemble the packet loss information and data packet arrival time information counted by the receiver into an RTCP feedback message, and feed it back to the sender at a sending interval of 1 second;
[0068] The RTCP parsing module is used to parse the packet loss information and data packet arrival time information in the RTCP feedback message fed back by the receiver, and pass the parsing results to the delay-based bandwidth estimator module and the packet loss-based bandwidth estimator module;
[0069] The delay-based bandwidth estimator module calculates the transmission delay difference between packet groups using data packet arrival time information and data packet transmission time information. The queuing delay gradient is obtained through least squares filtering. The queuing delay gradient is compared with the adaptive threshold to obtain the current network state. The finite state machine in the Cubic controller obtains the bit rate adjustment strategy and calculates the corresponding transmission bit rate at the next moment based on the strategy.
[0070] The packet loss-based bandwidth estimator module calculates the packet loss rate based on the packet loss information transmitted by the RTCP analysis module, determines the bit rate adjustment strategy based on the packet loss rate, and calculates the corresponding sending rate at the next moment;
[0071] The encoder module uses the minimum value of the next moment transmission bit rates output by the delay-based bandwidth estimator module and the packet loss-based bandwidth estimator module as the target bit rate for data encoding;
[0072] The data sending module uses the minimum value of the next moment sending code rates output by the delay-based bandwidth estimator module and the packet loss-based bandwidth estimator module as the target code rate for data sending.
[0073] Compared with the existing technology, the principles and advantages of this technical solution are as follows:
[0074] 1. A congestion avoidance algorithm suitable for streaming media transmission under deep buffer and shallow buffer is proposed. That is, while using the Cubic controller to control the output sending bit rate of the delay-based bandwidth estimator, it is combined with the output sending bit rate of the packet loss-based bandwidth estimator to avoid network congestion during streaming media transmission and improve the network bandwidth utilization of streaming media transmission.
[0075] 2. Use the transmission delay difference between packet groups as the input of the least squares filter to more accurately estimate the current network change trend.
[0076] 3. The use of adaptive thresholds can more accurately judge the current network congestion situation, avoiding media stream starvation caused by a too small threshold and the inability to avoid congestion due to an overly large threshold.
[0077] 4. Use a finite state machine to determine the bit rate adjustment strategy, and use a Cubic controller to calculate the next-moment sending bit rate that is ultimately output by the delay-based bandwidth estimation module. This can restore the sending bit rate level more quickly after network congestion is recovered, while avoiding network congestion and improving network bandwidth utilization. BRIEF DESCRIPTION OF THE DRAWINGS
[0078] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the services required for use in the embodiments or the prior art descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0079] Figure 1 This is a schematic diagram of the principles of a Cubic-based streaming media transmission optimization system of the present invention;
[0080] Figure 2 This is a principle flow chart of a Cubic-based streaming media transmission optimization method of the present invention;
[0081] Figure 3 Define a schematic for a computational package group;
[0082] Figure 4 Establish a coordinate axis diagram for least squares filtering;
[0083] Figure 5It is a schematic diagram of the state transition of the finite state machine;
[0084] Figure 6 A schematic diagram showing how the bit rate of a streaming media transmission optimization system changes over time in an embodiment of the present invention;
[0085] Figure 7 A schematic diagram showing how the one-way transmission delay of the streaming media transmission optimization system varies with time in an embodiment of the present invention;
[0086] Figure 8 Schematic diagram of the change of packet loss rate over time in the streaming media transmission optimization system according to an embodiment of the present invention. DETAILED DESCRIPTION
[0087] The present invention will be further described below in conjunction with specific embodiments:
[0088] like Figure 1 As shown, the Cubic-based streaming media transmission optimization system described in this embodiment includes an RTCP assembly module, an RTCP parsing module, an encoder module, a data sending module, a delay-based bandwidth estimator module, and a packet loss-based bandwidth estimator module.
[0089] in,
[0090] The RTCP assembly module is used to assemble the packet loss information and data packet arrival time information counted by the receiver into an RTCP feedback message, and feed it back to the sender at a sending interval of 1s; the RTCP parsing module is used to parse the packet loss information and data packet arrival time information in the RTCP feedback message fed back by the receiver, and pass the parsing results to the delay-based bandwidth estimator module and the packet loss-based bandwidth estimator module; the delay-based bandwidth estimator module uses the data packet arrival time information and the data packet sending time information to calculate the transmission delay difference between packet groups, obtain the queuing delay gradient through least squares filtering, compare the queuing delay gradient with the adaptive threshold to obtain the current network status, and output The finite state machine input into the Cubic controller obtains the bit rate adjustment strategy and calculates the corresponding sending bit rate at the next moment based on it; the packet loss-based bandwidth estimator module calculates the packet loss rate based on the packet loss information transmitted by the RTCP parsing module, judges the bit rate adjustment strategy based on the packet loss rate, and calculates the corresponding sending rate at the next moment; the encoder module uses the minimum value of the sending bit rates at the next moment output by the delay-based bandwidth estimator module and the packet loss-based bandwidth estimator module as the target bit rate for data encoding; the data sending module uses the minimum value of the sending bit rates at the next moment output by the delay-based bandwidth estimator module and the packet loss-based bandwidth estimator module as the target bit rate for data sending.
[0091] like Figure 2As shown, the working principle of this embodiment using the Cubic-based streaming media transmission optimization system to achieve streaming media transmission optimization is as follows:
[0092] S1. The sender calculates the transmission delay difference d between packet groups based on the sending and arrival time information of the data packet. i , use the least squares filter to obtain the current queue delay gradient T′ qi , and calculate the packet loss rate f with the help of packet loss information l ;
[0093] In this embodiment, the specific process of step S1 is as follows:
[0094] S1-1. Calculate the transmission delay difference between packet groups:
[0095] like Figure 3 As shown in the figure, a packet group is defined as a group of data packets sent continuously. Let the sending time of the first data packet be T i-1 , the subsequent data packet sending time is T i If the time interval between the sending of the subsequent data packet and the first data packet is ΔT = T i -T i-1 If the transmission time of the first packet of the i-1th packet group is ≤5ms, then the two packets belong to the same packet group. Otherwise, the subsequent packets belong to the next packet group. Define the sending time of the first packet of the i-1th packet group as T i-1 , the time when the last packet arrives at the receiver is t i-1 The first packet of the i-th packet group is sent at T i , the time when the last packet arrives at the receiver is t i , the transmission delay difference d between packet groups i The calculation formula is as follows:
[0096] d i =(t i -t i-1 )-(T i -T i-1 )
[0097] S12. Calculate the queuing delay gradient:
[0098] like Figure 4 As shown, a two-dimensional coordinate system is established with the arrival time as the x-axis and the cumulative value of the transmission delay difference between packet groups as the y-axis. Every time a packet group is received, the relevant data is converted into the coordinate system.
[0099] Each packet group corresponds to the coordinate value x on the x-axis i Defined as the time t when the last data packet of the current packet group arrives at the receiver i Subtract the time t when the first data packet of the packet group arrives at the receiver first_arrival , the calculation formula is as follows:
[0100] x i =t i -t first_arrival
[0101] Each packet group corresponds to the coordinate y on the y-axis i Defined as the cumulative value of the transmission delay difference between packet groups Considering that the packet group may have large jitter at some time, in order to make y i To make it smoother, we can use the following formula to perform exponential smoothing on the accumulated value:
[0102]
[0103] y i =αy i-1 +(1-α)acc i
[0104] Among them, α is the smoothing coefficient, and the default value is 0.9.
[0105] After collecting n packet group coordinate data, the queue delay gradient is calculated. The default value of n is 20. i and y i Corresponding average value and As follows:
[0106]
[0107] In the calculation of x i 、y i 、 and After that, we can get a straight line with the minimum square error through them, and its slope k i It is the queuing delay gradient T′ qi , the calculation formula is as follows:
[0108]
[0109] S1-3. Calculate the packet loss rate:
[0110] The sender calculates the packet loss rate f based on the packet loss information parsed by the RTCP parsing module l , the calculation formula is as follows:
[0111]
[0112] Among them, received_seq_max is the maximum sequence number of the streaming data packet received by the receiver; last_report_seq_max is the maximum sequence number of the streaming data packet received by the receiver in the last RTCP feedback message; cumulative_loss is the total number of streaming packet losses in the current streaming; last_report_cumulative_loss is the total number of streaming packet losses in the last RTCP feedback.
[0113] S2, the queue delay gradient T′ calculated by S1 qi Compare with the adaptive threshold to determine the current network status, and then update the adaptive threshold;
[0114] In this embodiment, the specific process of step S2 is as follows:
[0115] S2-1, the queue delay gradient T′ calculated by S1 qi Compare with the adaptive threshold to determine the current network status:
[0116] The queuing delay gradient T′ qi Multiply by n to amplify, and the amplified queue delay gradient is NT′ qi The calculation formula is as follows:
[0117] NT' qi =T' qi ×n
[0118] Using NT′ qi Compare with the adaptive threshold γ to determine the current network status; when NT′ qi When the adaptive threshold γ is exceeded, the network is considered to be in an overload state; when NT′ qi When NT′ is less than -γ, the network is considered to be underloaded; when NT′ qi When it is within the range of [-γ, γ], the network is considered to be in normal state. The judgment formula is as follows:
[0119]
[0120] S2-2, update the adaptive threshold:
[0121] After obtaining the current network status in step S2-1, the threshold γ is updated in combination with the current queuing delay gradient. The adjustment formula is as follows:
[0122] γ i =γ i-1 +△t i ×k i ×(|NT' qi -γi-1 )
[0123] Where, Δt i Indicates the interval between the current threshold update time and the last threshold update time, k i The coefficient that determines the change of threshold γ is taken as follows:
[0124]
[0125] S3. Input the current network state into the finite state machine, obtain the rate adjustment strategy of the delay-based bandwidth estimator and calculate the corresponding sending rate at the next moment;
[0126] In this embodiment, the specific process of step S3 is as follows:
[0127] S3-1. Using a finite state machine to determine the rate adjustment strategy of the delay-based bandwidth estimator:
[0128] When the current network state is in the overload state (Overuse), the finite state machine enters the Decrease state, and the rate adjustment strategy is to reduce the rate and gradually empty the queue. When the network is in the underload state (Underuse), the finite state machine enters the Hold state, and the rate adjustment strategy is to maintain the current rate and wait for the queue to be emptied. When the network is in the normal state (Normal), the finite state machine enters the Increase state, and the rate adjustment strategy is to increase the rate.
[0129] S3-2. The Cubic controller calculates the sending bit rate at the next moment based on the bit rate adjustment strategy:
[0130] When the code rate adjustment strategy is to reduce the code rate, the Cubic controller uses a multiplication reduction method to adjust the transmission code rate of the delay-based bandwidth estimator, and the corresponding transmission code rate C at the next moment is target (t) is calculated as follows:
[0131] C target (t) = β·R(t i-1 )
[0132] Where β is the multiplication reduction factor; R(t i-1 ) is the average receiving rate estimated by the sender based on the feedback message from the receiving end;
[0133] When the bitrate adjustment strategy is to maintain the current bitrate, the Cubic controller keeps the current sending bitrate unchanged, and the corresponding sending bitrate C at the next moment target (t) is calculated as follows:
[0134] C target (t)-C(t i-1 )
[0135] Among them, C(t i-1 ) is the sending bit rate at the current moment;
[0136] When the bit rate adjustment strategy is to increase the bit rate, the Cubic controller adjusts the sending bit rate detection bandwidth upper limit according to the cubic function model, and the corresponding sending bit rate C at the next moment is target (t) is calculated as follows:
[0137] C target (t) = α·c·((t-t last )-k) 3 +B latest
[0138]
[0139] Among them, the coefficient c determines the overall curvature of the cubic function of the transmission rate growth. The larger the value, the steeper the overall transmission rate growth curve and the faster the transmission rate growth; the coefficient β is the multiplicative reduction factor that proportionally reduces the rate when the transmission network is congested; B latest is the sending bit rate when the bit rate dropped last time; t is the current time; variable k is the time required for the sending bit rate to recover to the sending bit rate when the bit rate dropped last time; t last is the time of the last bit rate drop; the variable α is the coefficient that controls the curvature change of the cubic function, and its value is as follows:
[0140]
[0141] By adjusting the coefficient α, the detection speed of the current network bandwidth is accelerated, the maximum bandwidth of the network can be detected more quickly, and the sending bit rate level can be improved.
[0142] S4, according to the packet loss rate f l Determine the bitrate adjustment strategy of the bandwidth estimator based on packet loss and calculate the corresponding sending bitrate at the next moment;
[0143] In this embodiment, the specific process of step S4 is as follows:
[0144] If the packet loss rate f l Greater than 10%, the bandwidth estimator based on packet loss reduces the bit rate; if the packet loss rate f l If the packet loss is less than 2%, the bandwidth estimator based on packet loss increases the bit rate; otherwise, the sending bit rate remains unchanged;
[0145] The corresponding sending code rate A at the next moment s (t k ) is calculated as follows:
[0146]
[0147] Among them, A s (t k-1 ) is the sending bit rate estimated by the bandwidth estimator based on packet loss at the previous moment.
[0148] S5. Take the minimum value of the next moment transmission bit rate calculated by the delay-based bandwidth estimator and the packet loss-based bandwidth estimator as the target transmission bit rate and input it into the encoder and data transmission module;
[0149] S6. Repeat steps S1 to S5 to complete the optimization.
[0150] This example tests the dynamic change of link capacity for streaming media. The maximum transmission bit rate of the streaming media transmission optimization system is set to 3Mbps. The duration of the example is 200s. The initial link capacity is 3Mbps. The link capacity is adjusted by 500kbps every 20s. The range of link capacity change is 500kbps-3Mbps. The results are as follows: Figure 6-8 As shown, the sending bit rate of the Cubic-based streaming media transmission optimization method proposed in the present invention (abbreviated as C-GCC in the figure) will decrease as the link capacity decreases. When the sending bit rate touches the link capacity, the sending bit rate will also decrease. At the same time, due to the use of a Cubic controller to adjust the bit rate, the sending bit rate can be increased more quickly when network congestion recovers and link capacity increases. Figure 7 The one-way delay of the optimization method changes over time. When data is sent to a network link at a transmission rate close to the link capacity, the one-way delay will increase suddenly. When the link capacity decreases, the one-way delay will also increase. The delay-based bandwidth estimation module determines the transmission rate adjustment strategy based on the change of one-way delay. Figure 8 When the packet loss rate of the optimization algorithm is greater than 10%, the bandwidth estimation module based on packet loss will estimate a smaller bandwidth, which leads to Figure 6 The trapezoidal change of the sending code rate at the corresponding moment.
[0151] The embodiments described above are only preferred embodiments of the present invention and are not intended to limit the scope of implementation of the present invention. Therefore, any changes made based on the shape and principle of the present invention should be included in the scope of protection of the present invention.
Claims
1. A Cubic-based streaming media transmission optimization method, characterized in that: The steps include: S1. The sender calculates the transmission delay difference d between packet groups based on the sending and arrival time information of the data packet. i , get the current queuing delay gradient T′ qi , and calculate the packet loss rate f with the help of packet loss information l ; S2, the queue delay gradient T′ calculated by S1 qi Compare with the adaptive threshold to determine the current network status, and then update the adaptive threshold; S3. Input the current network state into the finite state machine, obtain the rate adjustment strategy of the delay-based bandwidth estimator and calculate the corresponding sending rate at the next moment; S4, according to the packet loss rate f l Determine the bitrate adjustment strategy of the bandwidth estimator based on packet loss and calculate the corresponding sending bitrate at the next moment; S5. Take the minimum value of the next moment transmission bit rate calculated by the delay-based bandwidth estimator and the packet loss-based bandwidth estimator as the target transmission bit rate and input it into the encoder and data transmission module; S6. Repeat steps S1 to S5 to complete the optimization.
2. The Cubic-based streaming media transmission optimization method according to claim 1, characterized in that: Calculate the transmission delay difference between packet groups, including: Define a packet group as a set of data packets sent continuously; Assume that the sending time of the first data packet is T i-1 , the subsequent data packet sending time is T i ; If the time interval between the sending of the subsequent data packet and the first data packet is ΔT=T i -T i-1 ≤ the set value, the two data packets belong to the same packet group; otherwise, the subsequent data packets belong to the next packet group; Define the sending time of the first packet of the i-1th packet group as T i-1 , the time when the last packet arrives at the receiver is t i-1 ; The first packet of the i-th packet group is sent at T i , the time when the last packet arrives at the receiver is t i , the transmission delay difference d between packet groups i The calculation formula is as follows: d i =(t i -t i-1 )-(T i -T i-1 )。 3. The Cubic-based streaming media transmission optimization method according to claim 1, characterized in that: Calculate the queuing delay gradient T′ qi ,include: A two-dimensional coordinate system is established with the arrival time as the x-axis and the cumulative value of the transmission delay difference between packet groups as the y-axis. Each time a packet group is received, the relevant data is converted into the coordinate system; Each packet group corresponds to the coordinate x on the x-axis. i Defined as the time t when the last data packet of the current packet group arrives at the receiver i Subtract the time t when the first data packet of the packet group arrives at the receiver first_arrival , the calculation formula is as follows: x i =t i -t first_arrival Each packet group corresponds to the coordinate y on the y-axis i Defined as the cumulative value of the transmission delay difference between packet groups Considering that the packet group may have large jitter at some time, in order to make y i To make it smoother, use the following formula to perform exponential smoothing on the accumulated value: y i =oy i-1 +(1-α)acc i Among them, α is the smoothing coefficient; After collecting n packet group coordinate data, the queue delay gradient is calculated. The default value of n is 20. i and y i Corresponding average value and As follows: Based on x i 、y i 、 and Get a straight line with the smallest square error, the slope of the straight line is k i The calculation formula is as follows: Slope k i It is also the queuing delay gradient T′ qi .
4. The Cubic-based streaming media transmission optimization method according to claim 1, characterized in that: The sender calculates the packet loss rate f based on the packet loss information parsed by the RTCP parsing module i , the calculation formula is as follows: Among them, received_seq_max is the maximum sequence number of the streaming data packet received by the receiver; last_report_seq_max is the maximum sequence number of the streaming data packet received by the receiver in the last RTCP feedback message; cumulative_loss is the total number of streaming packet losses in the current streaming; last_report_cumulative_loss is the total number of streaming packet losses in the last RTCP feedback.
5. The Cubic-based streaming media transmission optimization method according to claim 1, characterized in that: Step S2 includes: S2-1, the queue delay gradient T′ calculated by S1 qi Compare with the adaptive threshold to determine the current network status: The queuing delay gradient T′ qi Multiply by n to amplify, and the amplified queue delay gradient is NT′ qi The calculation formula is as follows: NT′ qi =T′ qi ×n Using NT′ qi Compare with the adaptive threshold γ to determine the current network status; when NT′ qi When the adaptive threshold γ is exceeded, the network is considered to be in an overload state; when NT′ qi When NT′ is less than -γ, the network is considered to be underloaded; when NT′ qi When it is within the range of [-γ, γ], the network is considered to be in normal state. The judgment formula is as follows: S2-2, update the adaptive threshold: After obtaining the current network status in step S2-1, the threshold γ is updated in combination with the current queuing delay gradient. The adjustment formula is as follows: c i =c i-1 +△t i ×k i ×(|NT′ qi |-c i-1 ) Where, Δt i Indicates the interval between the current threshold update time and the last threshold update time, k i The coefficient that determines the change of threshold γ is taken as follows:
6. The Cubic-based streaming media transmission optimization method according to claim 1, characterized in that: Step S3 includes: S3-1. Using a finite state machine to determine the rate adjustment strategy of the delay-based bandwidth estimator: When the current network state is in the overload state (Overuse), the finite state machine enters the Decrease state, and the rate adjustment strategy is to reduce the rate and gradually empty the queue. When the network is in the underload state (Underuse), the finite state machine enters the Hold state, and the rate adjustment strategy is to maintain the current rate and wait for the queue to be emptied. When the network is in the normal state (Normal), the finite state machine enters the Increase state, and the rate adjustment strategy is to increase the rate. S3-2. The Cubic controller calculates the sending bit rate at the next moment based on the bit rate adjustment strategy: When the code rate adjustment strategy is to reduce the code rate, the Cubic controller uses a multiplication reduction method to adjust the transmission code rate of the delay-based bandwidth estimator, and the corresponding transmission code rate C at the next moment is target (t) is calculated as follows: C targot (t)=β·R(t i-1 ) Where β is the multiplication reduction factor; R(t i-1 ) is the average receiving rate estimated by the sender based on the feedback message from the receiving end; When the bitrate adjustment strategy is to maintain the current bitrate, the Cubic controller keeps the current sending bitrate unchanged, and the corresponding sending bitrate C at the next moment target (t) is calculated as follows: C target (t)=C(t i-1 ) Among them, C(t i-1 ) is the sending bit rate at the current moment; When the bit rate adjustment strategy is to increase the bit rate, the Cubic controller adjusts the sending bit rate detection bandwidth upper limit according to the cubic function model, and the corresponding sending bit rate C at the next moment is target (t) is calculated as follows: C targst (t)=α·c·((t-t last )-k) 3 +B latest Among them, the coefficient c determines the overall curvature of the cubic function of the transmission rate growth. The larger the value, the steeper the overall transmission rate growth curve and the faster the transmission rate growth; the coefficient β is the multiplicative reduction factor that proportionally reduces the rate when the transmission network is congested; B latest is the sending bit rate when the bit rate dropped last time; t is the current time; variable k is the time required for the sending bit rate to recover to the sending bit rate when the bit rate dropped last time; t last is the time of the last bit rate drop; the variable α is the coefficient that controls the curvature change of the cubic function, and its value is as follows: By adjusting the coefficient α, the detection speed of the current network bandwidth is accelerated, the maximum bandwidth of the network can be detected more quickly, and the sending bit rate level can be improved.
7. The Cubic-based streaming media transmission optimization method according to claim 1, characterized in that: Step S4 includes: If the packet loss rate f l Greater than 10%, the bandwidth estimator based on packet loss reduces the bit rate; if the packet loss rate f l If the packet loss is less than 2%, the bandwidth estimator based on packet loss increases the bit rate; otherwise, the sending bit rate remains unchanged; The corresponding sending code rate A at the next moment s (t k ) is calculated as follows: Among them, A s (t k-1 ) is the sending bit rate estimated by the bandwidth estimator based on packet loss at the previous moment.
8. A Cubic-based streaming media transmission optimization system, used to implement the Cubic-based streaming media transmission optimization method according to any one of claims 1 to 7, characterized in that: Including RTCP assembly module, RTCP parsing module, encoder module, data sending module, delay-based bandwidth estimator module, and packet loss-based bandwidth estimator module; The RTCP assembly module is used to assemble the packet loss information and data packet arrival time information counted by the receiver into an RTCP feedback message, and feed it back to the sender at a sending interval of 1 second; The RTCP parsing module is used to parse the packet loss information and data packet arrival time information in the RTCP feedback message fed back by the receiver, and pass the parsing results to the delay-based bandwidth estimator module and the packet loss-based bandwidth estimator module; The delay-based bandwidth estimator module calculates the transmission delay difference between packet groups using data packet arrival time information and data packet transmission time information. The queuing delay gradient is obtained through least squares filtering. The queuing delay gradient is compared with the adaptive threshold to obtain the current network state. The finite state machine in the Cubic controller obtains the bit rate adjustment strategy and calculates the corresponding transmission bit rate at the next moment based on the strategy. The packet loss-based bandwidth estimator module calculates the packet loss rate based on the packet loss information transmitted by the RTCP analysis module, determines the bit rate adjustment strategy based on the packet loss rate, and calculates the corresponding sending rate at the next moment; The encoder module uses the minimum value of the next moment transmission bit rate output by the delay-based bandwidth estimator module and the packet loss-based bandwidth estimator module as the target bit rate for data encoding; The data sending module uses the minimum value of the next moment sending code rates output by the delay-based bandwidth estimator module and the packet loss-based bandwidth estimator module as the target code rate for data sending.
Citation Information
Cited By
Computing power network bandwidth estimation method
CN120768809A