[go: up one dir, main page]

CN111726301A - Congestion control method and system for ensuring video quality in real-time video - Google Patents

Congestion control method and system for ensuring video quality in real-time video Download PDF

Info

Publication number
CN111726301A
CN111726301A CN202010414567.9A CN202010414567A CN111726301A CN 111726301 A CN111726301 A CN 111726301A CN 202010414567 A CN202010414567 A CN 202010414567A CN 111726301 A CN111726301 A CN 111726301A
Authority
CN
China
Prior art keywords
state
code rate
bitrate
current
video data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202010414567.9A
Other languages
Chinese (zh)
Other versions
CN111726301B (en
Inventor
李海
耿若琳
侯舒娟
张钦
宋政育
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Institute of Technology BIT
Original Assignee
Beijing Institute of Technology BIT
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Institute of Technology BIT filed Critical Beijing Institute of Technology BIT
Priority to CN202010414567.9A priority Critical patent/CN111726301B/en
Publication of CN111726301A publication Critical patent/CN111726301A/en
Application granted granted Critical
Publication of CN111726301B publication Critical patent/CN111726301B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/25Flow control; Congestion control with rate being modified by the source upon detecting a change of network conditions
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • H04L43/0852Delays
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • H04L43/0876Network utilisation, e.g. volume of load or congestion level
    • H04L43/0882Utilisation of link capacity
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • H04L43/0876Network utilisation, e.g. volume of load or congestion level
    • H04L43/0894Packet rate
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L65/00Network arrangements, protocols or services for supporting real-time applications in data packet communication
    • H04L65/80Responding to QoS

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Environmental & Geological Engineering (AREA)
  • Multimedia (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

本发明公开了一种实时视频中保证视频质量的拥塞控制方法及系统,能够快速响应带宽变化、并克服码率增加过多的缺点,提高了码率对带宽的跟踪速度,提高了带宽利用率,克服了码率增加过多造成网络拥塞的缺点。具体方案为:实时接收视频数据包,并计算延迟梯度。根据延迟梯度对当前网络状态进行过载检测,获得当前网络状态信号;当前网络状态信号为过载状态信号Overuse、正常状态信号Normal或低载状态信号Underuse。构建有限状态机,根据当前网络状态信号进行状态转换。根据状态机的当前状态,进行码率计算。根据计算出来的下一时刻即ti时刻的码率设定视频数据包的发送码率。

Figure 202010414567

The invention discloses a congestion control method and system for ensuring video quality in real-time video, which can quickly respond to bandwidth changes, overcome the shortcomings of excessive code rate increase, improve the tracking speed of the code rate to the bandwidth, and improve the bandwidth utilization rate. , overcoming the shortcoming of network congestion caused by excessive code rate increase. The specific scheme is: receive video data packets in real time, and calculate the delay gradient. Perform overload detection on the current network state according to the delay gradient to obtain the current network state signal; the current network state signal is the overload state signal Overuse, the normal state signal Normal or the low load state signal Underuse. Build a finite state machine to perform state transitions based on current network state signals. According to the current state of the state machine, the code rate calculation is performed. The transmission code rate of the video data packet is set according to the calculated code rate at the next moment, that is, time t i .

Figure 202010414567

Description

一种实时视频中保证视频质量的拥塞控制方法及系统Congestion control method and system for ensuring video quality in real-time video

技术领域technical field

本发明涉及网络传输技术领域,具体涉及一种实时视频中保证视频质量的拥塞控制方法及系统。The invention relates to the technical field of network transmission, in particular to a congestion control method and system for ensuring video quality in real-time video.

背景技术Background technique

网络拥塞是基于IP协议的数据报交换网络中常见的一种网络传输问题,它对网络传输的质量有严重的影响,网络拥塞是导致网络吞吐降低,网络丢包等的主要原因之一,这些问题使得上层应用无法有效地利用网络带宽获得高质量的网络传输效果。特别是在通信领域,网络拥塞导致的丢包、延迟、抖动等问题,严重的影响了通信质量,如果不能很好的解决这些问题,一个通信产品就无法在现实环境中正常使用。Network congestion is a common network transmission problem in IP-based datagram switching networks, which has a serious impact on the quality of network transmission. Network congestion is one of the main reasons for reduced network throughput and network packet loss. The problem makes the upper-layer application unable to effectively use the network bandwidth to obtain high-quality network transmission effect. Especially in the field of communication, problems such as packet loss, delay, and jitter caused by network congestion seriously affect the communication quality. If these problems cannot be solved well, a communication product cannot be used normally in the real environment.

GCC(GoogleCongestionControl)拥塞控制算法主要分成两个部分:一个是基于丢包的拥塞控制,一个是基于延迟的拥塞控制。这两个拥塞控制算法分别是在发送端和接收端实现的,接收端的拥塞控制算法所计算出的估计带宽,会通过RTCP的remb报文反馈到发送端,发送端综合两个控制算法的结果得到一个最终的发送码率,并以此码率发送数据包。The GCC (Google Congestion Control) congestion control algorithm is mainly divided into two parts: one is congestion control based on packet loss, and the other is congestion control based on delay. The two congestion control algorithms are implemented at the sender and receiver respectively. The estimated bandwidth calculated by the congestion control algorithm at the receiver will be fed back to the sender through the RTCP remb message, and the sender will synthesize the results of the two control algorithms. Get a final transmit bit rate, and send data packets at this bit rate.

基于丢包的拥塞控制的基本思想是根据丢包的多少来判断网络的拥塞程度,丢包越多则认为网络越拥塞,那么需要降低发送速率来缓解网络拥塞;如果没有丢包,这说明网络状况很好,这时候可以提高发送码率,向上探测是否有更多的带宽可用。基于延迟的拥塞控制,GCC使用延迟梯度来判断网络的拥塞程度,其算法分为几个部分:到达时间滤波器、过载检测器、速率控制器。The basic idea of congestion control based on packet loss is to judge the degree of network congestion according to the number of lost packets. The more packets lost, the more congested the network is, so the transmission rate needs to be reduced to relieve network congestion; if there is no packet loss, this indicates that the network The condition is very good. At this time, you can increase the transmission code rate and detect whether there is more bandwidth available. Delay-based congestion control, GCC uses delay gradient to determine the degree of network congestion, its algorithm is divided into several parts: arrival time filter, overload detector, rate controller.

原有的GCC拥塞控制算法应用于本系统后,遇到带宽情况由差变好时,码率依然维持在较低水平,造成带宽浪费,用户接收视频质量较差。基于此缺点,对算法进行改进。After the original GCC congestion control algorithm is applied to the system, when the bandwidth situation changes from poor to better, the bit rate remains at a low level, resulting in wasted bandwidth and poor video quality for users. Based on this shortcoming, the algorithm is improved.

现有的GCC拥塞控制算法存在以下缺点:带宽由低开始增加时,算法计算的码流比带宽低很多,没有迅速跟踪带宽的变化提升码率。原因是状态机输入信号为underuse时,无论现态处于哪一状态,次态均为hold,处于hold状态时,码率变化策略是保持不变,导致码率没有实时增加;码率一旦开始增加就增的过高,超过带宽的范围,造成网络拥塞,丢包增多,视频出现卡顿,其原因是码率增加时采用乘性增加,增加后的码率过大,超过带宽范围。The existing GCC congestion control algorithm has the following shortcomings: when the bandwidth starts to increase from a low value, the code stream calculated by the algorithm is much lower than the bandwidth, and the code rate does not quickly track the change of the bandwidth. The reason is that when the input signal of the state machine is underuse, no matter which state the current state is in, the next state is hold. When it is in the hold state, the code rate change strategy remains unchanged, resulting in no real-time increase in the code rate; once the code rate starts to increase If the increase is too high, it exceeds the bandwidth range, causing network congestion, increased packet loss, and video freezes.

图1示出了传统的GCC拥塞控制算法的带宽跟踪效果。其中带宽短时间波动时,检测低带宽的灵敏度高,可以在1-2s内跟踪上,但对带宽增加不敏感,码率增加很慢。下图的曲线反映的是优化前拥塞控制算法在带宽12秒变化一次时的码率变化曲线,从图中可以看出,带宽增加时码率维持在低码率下,对带宽的增加延迟10秒做出反应,增加时增加超过带宽300kbps。Figure 1 shows the bandwidth tracking effect of the traditional GCC congestion control algorithm. Among them, when the bandwidth fluctuates for a short time, the sensitivity of detecting low bandwidth is high, and it can be tracked within 1-2s, but it is not sensitive to the increase of bandwidth, and the code rate increases very slowly. The curve in the figure below reflects the code rate change curve of the congestion control algorithm before the optimization when the bandwidth changes once every 12 seconds. It can be seen from the figure that when the bandwidth increases, the code rate is maintained at a low code rate, and the increase in bandwidth is delayed by 10 seconds to respond, increasing bandwidth by more than 300kbps.

可以看出,GCC拥塞控制算法的策略保守,无法快速反应利用可用的带宽资源,在看重视频质量的实时视频通信中不适用;码率增加策略使码率增加过多,加剧网络拥塞和丢包。现有的拥塞控制算法在视频传输过程中对带宽的跟踪速度较慢,增速不合适,不能满足需求。It can be seen that the strategy of the GCC congestion control algorithm is conservative, unable to quickly respond to the available bandwidth resources, and is not suitable for real-time video communication where video quality is important; the bit rate increase strategy increases the bit rate too much, aggravating network congestion and packet loss . The existing congestion control algorithm has a slow tracking speed of the bandwidth in the video transmission process, and the growth rate is not suitable, which cannot meet the demand.

发明内容SUMMARY OF THE INVENTION

有鉴于此,本发明提供了一种实时视频中保证视频质量的拥塞控制方法及系统,能够快速响应带宽变化、并克服码率增加过多的缺点,提高了码率对带宽的跟踪速度,提高了带宽利用率,克服了码率增加过多造成网络拥塞的缺点。In view of this, the present invention provides a congestion control method and system for ensuring video quality in real-time video, which can quickly respond to changes in bandwidth, overcome the shortcomings of excessive increase in code rate, improve the tracking speed of code rate to bandwidth, and improve It improves the bandwidth utilization rate and overcomes the shortcoming of network congestion caused by excessive code rate increase.

为达到上述目的,本发明的技术方案为:一种实时视频中保证视频质量的拥塞控制方法,包括如下步骤:In order to achieve the above-mentioned purpose, the technical scheme of the present invention is: a congestion control method for ensuring video quality in a real-time video, comprising the following steps:

步骤一、实时接收视频数据包,并计算延迟梯度。Step 1: Receive video data packets in real time and calculate the delay gradient.

步骤二、根据延迟梯度对当前网络状态进行过载检测,获得当前网络状态信号;当前网络状态信号为过载状态信号Overuse、正常状态信号Normal或低载状态信号Underuse。Step 2: Perform overload detection on the current network state according to the delay gradient to obtain the current network state signal; the current network state signal is the overload state signal Overuse, the normal state signal Normal or the low load state signal Underuse.

步骤三、构建有限状态机:包括码率减小状态Decrease、码率维持状态Hold以及码率增加状态Increase,预先设置有限状态机所处的初始状态,当前网络状态信号输入至有限状态机中,若输入为Overuse,有限状态机直接转换为Decrease状态;若输入为Normal,有限状态机直接转换为Hold状态;若输入为Underuse,且有限状态机的当前状态是Decrease,则有限状态机转换为Hold状态;若输入为Underuse,且有限状态机的当前状态不是Decrease,则有限状态机转换为Incease状态。Step 3: Construct a finite state machine: including the code rate reduction state Decrease, the code rate maintaining state Hold and the code rate increasing state Increase, the initial state of the finite state machine is preset, and the current network state signal is input into the finite state machine, If the input is Overuse, the finite state machine is directly converted to the Decrease state; if the input is Normal, the finite state machine is directly converted to the Hold state; if the input is Underuse and the current state of the finite state machine is Decrease, the finite state machine is converted to Hold State; if the input is Underuse, and the current state of the finite state machine is not Decrease, the finite state machine transitions to the Incease state.

步骤四、根据状态机的当前状态,按照如下方式进行码率计算:Step 4. According to the current state of the state machine, calculate the code rate as follows:

1)当状态机的当前状态为Increase状态时,且距离探测带宽相差大于设定阈值时,则下一时刻即ti时刻的码率为:1) When the current state of the state machine is the Increase state, and the difference from the detection bandwidth is greater than the set threshold, the code rate at the next moment, that is, moment t i , is:

Ar(ti)=max(min(Ar(ti-1)+max(0.2×Ar(ti-1),1000),1.4×incoming_bitrate),incoming_bitrate)A r (t i )=max(min(A r (t i-1 )+max(0.2×A r (t i-1 ), 1000), 1.4×incoming_bitrate), incoming_bitrate)

其中Ar(ti)为ti时刻的码率;Ar(ti-1)为当前时刻即ti-1时刻的码率;incoming_bitrate是根据接收视频数据包统计计算得出的接收数据码率;根据接收所述视频数据包的速率计算距离探测带宽相差是否大于设定阈值;where Ar (t i ) is the bit rate at time t i ; A r ( t i-1 ) is the bit rate at the current moment, i.e. time t i-1 ; incoming_bitrate is the received data calculated according to the statistics of the received video data packets bit rate; according to the rate at which the video data packet is received, calculate whether the distance detection bandwidth difference is greater than the set threshold;

2)当状态机的当前状态为Increase状态时,且距离探测带宽相差不大于设定阈值时,则下一时刻即ti时刻的码率为2) When the current state of the state machine is the Increase state, and the difference from the detection bandwidth is not greater than the set threshold, then the code rate at the next moment, i.e. at moment t i , is:

Ar(ti)=max(min(Ar(ti-1)+max(averOfPacket,1000),1.4×incoming_bitrate),incoming_bitrate)A r (t i )=max(min(A r (t i-1 )+max(averOfPacket, 1000), 1.4×incoming_bitrate), incoming_bitrate)

其中,averOfPacket是视频数据包的平均数据量,incoming_bitrate是根据接收视频数据包统计计算得出的接收数据码率;Among them, averOfPacket is the average data volume of video data packets, incoming_bitrate is the received data bit rate calculated according to the statistics of received video data packets;

averOfPacket=bits_per_frame/packets_per_frameaverOfPacket=bits_per_frame/packets_per_frame

其中bits_per_frame是每帧数据量,packets_per_frame是一帧包含的数据包数量;Where bits_per_frame is the amount of data per frame, packets_per_frame is the number of packets contained in a frame;

3)当状态机的当前状态为Decrease状态时,则下一时刻即ti时刻的码率为3) When the current state of the state machine is the Decrease state, the code rate at the next moment, i.e. at moment t i , is:

Ar(ti)=min(0.75×incoming_bitrate,Ar(ti-1)) Ar (t i )=min(0.75×incoming_bitrate, Ar ( t i-1 ))

其中incoming_bitrate是根据接收视频数据包统计计算得出的接收数据码率;Among them, incoming_bitrate is the received data bit rate calculated according to the statistics of received video data packets;

4)当状态机的当前状态信号为Hold时,则码率保持不变,即下一时刻ti时刻的码率等于当前时刻ti-1时刻的码率;4) When the current state signal of the state machine is Hold, the code rate remains unchanged, that is, the code rate at the next moment t i is equal to the code rate at the current moment t i-1 ;

步骤五、根据计算出来的下一时刻即ti时刻的码率设定视频数据包的发送码率。Step 5: Set the sending code rate of the video data packet according to the calculated code rate at the next moment, that is, time t i .

进一步地,步骤一,实时接收视频数据包,并计算延迟梯度,具体为:Further, in step 1, video data packets are received in real time, and the delay gradient is calculated, specifically:

预先设定数据包组的时间间隔,在一个数据包组的时间间隔内接收的所有视频数据包为一组;对于当前一组视频数据包,以最后一个视频数据包的到达时间减去第一个视频数据包的发送时间作为时间延迟;当前一组视频数据包与上一组视频数据包的时间延迟相差作为当前一组视频数据包的延迟梯度。The time interval of the data packet group is preset, and all video data packets received within the time interval of a data packet group are grouped; for the current group of video data packets, the arrival time of the last video data packet is subtracted from the first video data packet. The sending time of each video data packet is taken as the time delay; the time delay difference between the current group of video data packets and the previous group of video data packets is taken as the delay gradient of the current group of video data packets.

进一步地,步骤二,具体为:Further, step 2 is specifically:

预先设定过载阈值Th1和低载阈值Th0,若延迟梯度大于过载阈值Th1,则当前网络状态信号为Overuse。The overload threshold Th 1 and the low load threshold Th 0 are preset. If the delay gradient is greater than the overload threshold Th 1 , the current network status signal is Overuse.

若延迟梯度小于低载阈值Th0,则当前网络状态信号为Underuse。If the delay gradient is less than the low load threshold Th 0 , the current network status signal is Underuse.

若延迟梯度处于[Th0,Th1]范围内,则当前网络状态信号为Normal。If the delay gradient is in the range of [Th 0 , Th 1 ], the current network state signal is Normal.

进一步地,步骤四中,根据接收视频数据包的速率计算距离探测带宽相差是否大于设定阈值,具体为:Further, in step 4, calculate whether the distance detection bandwidth difference is greater than the set threshold according to the rate of the received video data packets, specifically:

所述视频数据包的接收速率为incoming_bitrate,设定平均最大码率avg_max_bitrate的初始值为第一组视频数据包的接收速率,每接收一组视频数据包更新平均最大码率avg_max_bitrate为:The reception rate of the video data packet is incoming_bitrate, and the initial value of the set average maximum code rate avg_max_bitrate is the reception rate of the first group of video data packets, and the average maximum code rate avg_max_bitrate is updated every time a group of video data packets is received:

avg_max_bitrate=(1-α)×avg_max_bitrate_last+α×incoming_bitrateavg_max_bitrate=(1-α)×avg_max_bitrate_last+α×incoming_bitrate

其中α为设定的系数常量,本发明中可以依经验设定系数常量,例如本发明实施例中可设定该系数常量α为0.05。α is a preset coefficient constant, which can be set according to experience in the present invention. For example, in the embodiment of the present invention, the coefficient constant α can be set to be 0.05.

更新最大码率方差var_max_bitrate为:Update the maximum bit rate variance var_max_bitrate as:

var_max_bitrate=(1-α)×var_max_bitrate_last+α×(avg_max_bitrate-incoming_bitrate)2 var_max_bitrate=(1-α)×var_max_bitrate_last+α×(avg_max_bitrate-incoming_bitrate) 2

更新最大码率标准差std_max_bitrate为:Update the maximum bitrate standard deviation std_max_bitrate to:

Figure BDA0002494569930000051
Figure BDA0002494569930000051

Increase状态时,接收码率incoming_bitrate大于avg_max_bitrate与std_max_bitrate之和,则认为距离探测带宽相差较大。每次进入Decrease状态,认为距离探测带宽相差较小。In the Increase state, if the incoming_bitrate of the received bit rate is greater than the sum of avg_max_bitrate and std_max_bitrate, it is considered that the distance detection bandwidth has a large difference. Each time it enters the Decrease state, it is considered that the difference from the detection bandwidth is small.

进一步地,bits_per_frame是每帧数据量,bits_per_frame在每次码率计算完成之后进行更新:Further, bits_per_frame is the amount of data per frame, and bits_per_frame is updated after each bit rate calculation is completed:

bits_per_frame=current_bitrate/frame_per_second。bits_per_frame=current_bitrate/frame_per_second.

其中frame_per_second是每秒的帧数;current_bitrate为当前比特率。Where frame_per_second is the number of frames per second; current_bitrate is the current bit rate.

进一步地,设定码率调整时间间隔为4s以内,在每个码率调整时间间隔内,均执行步骤一~步骤五进行码率调整。Further, the code rate adjustment time interval is set to be within 4s, and in each code rate adjustment time interval, steps 1 to 5 are performed to adjust the code rate.

本发明另一实施例提供了一种实时视频中保证视频质量的拥塞控制系统,该系统包括视频发送端、视频接收端、时间滤波器、过载检测器、状态转换机以及码率计算器;Another embodiment of the present invention provides a congestion control system for ensuring video quality in real-time video, the system includes a video transmitter, a video receiver, a time filter, an overload detector, a state converter, and a bit rate calculator;

视频发送端,用于根据实时调整的发送码率进行视频数据包的接收。The video sending end is used to receive video data packets according to the sending bit rate adjusted in real time.

视频接收端,用于实时接收视频数据包。The video receiver is used to receive video data packets in real time.

时间滤波器,用于根据视频数据包的发送时间和接收时间计算延迟梯度。Temporal filter for computing delay gradients based on the sending and receiving times of video packets.

过载检测器,用于根据延迟梯度对当前网络状态进行过载检测,获得当前网络状态信号;当前网络状态信号为过载状态信号Overuse、正常状态信号Normal或低载状态信号Underuse。The overload detector is used to perform overload detection on the current network state according to the delay gradient to obtain the current network state signal; the current network state signal is the overload state signal Overuse, the normal state signal Normal or the low load state signal Underuse.

状态转换机,用于构建有限状态机:包括码率减小状态Decrease、码率维持状态Hold以及码率增加状态Increase,预先设置有限状态机所处的初始状态,当前网络状态信号输入至有限状态机中,若输入为Overuse,有限状态机直接转换为Decrease状态;若输入为Normal,有限状态机直接转换为Hold状态;若输入为Underuse,且有限状态机的当前状态是Decrease,则有限状态机转换为Hold状态;若输入为Underuse,且有限状态机的当前状态不是Decrease,则有限状态机转换为Incease状态。State conversion machine, used to construct a finite state machine: including the code rate reduction state Decrease, the code rate maintaining state Hold and the code rate increasing state Increase, the initial state of the finite state machine is preset, and the current network state signal is input to the finite state In the machine, if the input is Overuse, the finite state machine is directly converted to the Decrease state; if the input is Normal, the finite state machine is directly converted to the Hold state; if the input is Underuse, and the current state of the finite state machine is Decrease, then the finite state machine Convert to Hold state; if the input is Underuse, and the current state of the finite state machine is not Decrease, the finite state machine is converted to Incease state.

码率计算器,用于根据状态机的当前状态,按照如下方式进行码率计算:The code rate calculator is used to calculate the code rate according to the current state of the state machine as follows:

1)当状态机的当前状态为Increase状态时,且距离探测带宽相差大于设定阈值时,则下一时刻即ti时刻的码率为:1) When the current state of the state machine is the Increase state, and the difference from the detection bandwidth is greater than the set threshold, the code rate at the next moment, that is, moment t i , is:

Ar(ti)=max(min(Ar(ti-1)+max(averOfPacket,1000),1.4×incoming_bitrate),incoming_bitrate)A r (t i )=max(min(A r (t i-1 )+max(averOfPacket, 1000), 1.4×incoming_bitrate), incoming_bitrate)

其中Ar(ti)为ti时刻的码率;Ar(ti-1)为当前时刻即ti-1时刻的码率;incoming_bitrate是根据接收视频数据包统计计算得出的接收数据码率;根据接收所述视频数据包的速率计算距离探测带宽相差是否大于设定阈值;where Ar (t i ) is the bit rate at time t i ; A r ( t i-1 ) is the bit rate at the current moment, i.e. time t i-1 ; incoming_bitrate is the received data calculated according to the statistics of the received video data packets bit rate; according to the rate at which the video data packet is received, calculate whether the distance detection bandwidth difference is greater than the set threshold;

2)当状态机的当前状态为Increase状态时,且距离探测带宽相差不大于设定阈值时,则下一时刻即ti时刻的码率为:2) When the current state of the state machine is the Increase state, and the distance from the detection bandwidth is not greater than the set threshold, the code rate at the next moment, that is, moment t i , is:

Ar(ti)=max(min(Ar(ti-1)+max(averOfPacket,1000),1.4×incoming_bitrate),incoming_bitrate)A r (t i )=max(min(A r (t i-1 )+max(averOfPacket, 1000), 1.4×incoming_bitrate), incoming_bitrate)

其中,averOfPacket是视频数据包的平均数据量,incoming_bitrate是根据接收视频数据包统计计算得出的接收数据码率;Among them, averOfPacket is the average data volume of video data packets, incoming_bitrate is the received data bit rate calculated according to the statistics of received video data packets;

averOfPacket=bits_per_frame/packets_per_frameaverOfPacket=bits_per_frame/packets_per_frame

其中bits_per_frame是每帧数据量,packets_per_frame是一帧包含的数据包数量;Where bits_per_frame is the amount of data per frame, packets_per_frame is the number of packets contained in a frame;

3)当状态机的当前状态为Decrease状态时,则下一时刻即ti时刻的码率为3) When the current state of the state machine is the Decrease state, the code rate at the next moment, i.e. at moment t i , is:

Ar(ti)=min(0.75×incoming_bitrate,Ar(ti-1)) Ar (t i )=min(0.75×incoming_bitrate, Ar ( t i-1 ))

其中incoming_bitrate是根据接收视频数据包统计计算得出的接收数据码率;Among them, incoming_bitrate is the received data bit rate calculated according to the statistics of received video data packets;

4)当状态机的当前状态信号为Hold时,则码率保持不变,即下一时刻ti时刻的码率等于当前时刻ti-1时刻的码率。4) When the current state signal of the state machine is Hold, the code rate remains unchanged, that is, the code rate at the next time t i is equal to the code rate at the current time t i-1 .

码率计算器计算得到实时调整的发送码率送入到视频发送端。The bit rate calculator calculates the real-time adjusted sending bit rate and sends it to the video sending end.

进一步地,视频发送端根据设定的调整时间间隔,依照实时调整的发送码率进行码率调整。Further, the video sending end adjusts the code rate according to the real-time adjusted sending code rate according to the set adjustment time interval.

有益效果:Beneficial effects:

本发明提供一种实时视频中保证视频质量的拥塞控制方法及系统,该方案基于传统的GCC拥塞控制算法方案,根据本系统的需求和技术特点,对原有的拥塞控制算法进行优化和适配,提高了码率对带宽的跟踪速度,提高了带宽利用率,克服了码率增加过多造成网络拥塞的缺点。本发明采用修改优化的状态转换机制,基于快速响应带宽变化的策略,克服了带宽增加时码率无法快速跟踪的问题,使计算出的码率快速跟踪带宽变化,提高了带宽利用率,以达到在带宽允许的范围内提高视频画面质量的目标需求。本发明采用优化的码率变化函数,克服码率增加过多的缺点,避免加剧网络拥塞。The invention provides a congestion control method and system for ensuring video quality in real-time video. The solution is based on the traditional GCC congestion control algorithm solution, and the original congestion control algorithm is optimized and adapted according to the requirements and technical characteristics of the system. , which improves the tracking speed of the code rate to the bandwidth, improves the bandwidth utilization rate, and overcomes the shortcoming of network congestion caused by too much increase in the code rate. The invention adopts a modified and optimized state transition mechanism, and based on the strategy of rapidly responding to bandwidth changes, it overcomes the problem that the code rate cannot be quickly tracked when the bandwidth increases, so that the calculated code rate quickly tracks the bandwidth change, and improves the bandwidth utilization rate, so as to achieve The target demand for improving the video picture quality within the range allowed by the bandwidth. The invention adopts an optimized code rate change function, overcomes the disadvantage of excessive increase in code rate, and avoids aggravating network congestion.

附图说明Description of drawings

图1为传统的GCC拥塞控制算法的带宽跟踪效果图;Fig. 1 is the bandwidth tracking effect diagram of the traditional GCC congestion control algorithm;

图2为本发明实施例中构建的有限状态机状态变化趋势图;2 is a state change trend diagram of a finite state machine constructed in an embodiment of the present invention;

图3为本发明实施例中的实时视频中保证视频质量的拥塞控制方法流程图;3 is a flowchart of a method for congestion control for ensuring video quality in real-time video according to an embodiment of the present invention;

图4为本发明实施例中的实时视频中保证视频质量的拥塞控制系统框图;4 is a block diagram of a congestion control system for ensuring video quality in real-time video according to an embodiment of the present invention;

图5为本发明实施例中带宽以4秒为变化间隔的带宽跟踪效果图;Fig. 5 is a bandwidth tracking effect diagram in which the bandwidth takes 4 seconds as a change interval in the embodiment of the present invention;

图6为本发明实施例中带宽以6秒为变化间隔的带宽跟踪效果图。FIG. 6 is a bandwidth tracking effect diagram in which the bandwidth is changed at intervals of 6 seconds according to an embodiment of the present invention.

具体实施方式Detailed ways

下面结合附图并举实施例,对本发明进行详细描述。The present invention will be described in detail below with reference to the accompanying drawings and embodiments.

本发明提供了一种实时视频中保证视频质量的拥塞控制方法,其流程如图3所示其特征在于,包括如下步骤:The present invention provides a congestion control method for ensuring video quality in a real-time video, the process of which is shown in Figure 3 and is characterized in that it includes the following steps:

步骤一、实时接收视频数据包,并计算延迟梯度。Step 1: Receive video data packets in real time and calculate the delay gradient.

本发明实施例中,预先设定码率调整时间间隔,可以根据在码率调整时间间隔内接收一组视频数据包,对于当前一组视频数据包,以最后一个视频数据包的到达时间减去第一个视频数据包的达到时间作为达到时间差,以最后一个视频数据包的发送时间减去第一个视频数据的发送时间作为发送时间差,以到达时间差与发送时间差之间相差作为当前一组视频数据包的延迟梯度。In this embodiment of the present invention, the bit rate adjustment time interval is preset, and a group of video data packets can be received within the bit rate adjustment time interval. For the current group of video data packets, the arrival time of the last video data packet is subtracted from the arrival time of the last video data packet. The arrival time of the first video data packet is taken as the arrival time difference, the sending time of the last video data packet minus the sending time of the first video data is taken as the sending time difference, and the difference between the arrival time difference and the sending time difference is taken as the current group of video Delay gradient for packets.

本发明实施例中,设定码率调整时间间隔为4s以内,在每个码率调整时间间隔内,均执行步骤一~步骤五进行码率调整。In the embodiment of the present invention, the code rate adjustment time interval is set to be within 4s, and steps 1 to 5 are performed to adjust the code rate within each code rate adjustment time interval.

步骤二、根据延迟梯度对当前网络状态进行过载检测,获得当前网络状态信号;当前网络状态信号为过载状态信号Overuse、正常状态信号Normal或低载状态信号Underuse。Step 2: Perform overload detection on the current network state according to the delay gradient to obtain the current network state signal; the current network state signal is the overload state signal Overuse, the normal state signal Normal or the low load state signal Underuse.

预先设定过载阈值Th1和低载阈值Th0,若延迟梯度大于过载阈值Th1,则当前网络状态信号为Overuse。The overload threshold Th 1 and the low load threshold Th 0 are preset. If the delay gradient is greater than the overload threshold Th 1 , the current network status signal is Overuse.

若延迟梯度小于低载阈值Th0,则当前网络状态信号为Underuse。If the delay gradient is less than the low load threshold Th 0 , the current network status signal is Underuse.

若延迟梯度处于[Th0,Th1]范围内,则当前网络状态信号为Normal。If the delay gradient is in the range of [Th 0 , Th 1 ], the current network state signal is Normal.

步骤三、构建有限状态机:包括码率减小状态Decrease、码率维持状态Hold以及码率增加状态Increase,预先设置有限状态机所处的初始状态,当前网络状态信号输入至有限状态机中,若输入为Overuse,有限状态机直接转换为Decrease状态;若输入为Normal,有限状态机直接转换为Hold状态;若输入为Underuse,且有限状态机的当前状态是Decrease,则有限状态机转换为Hold状态;若输入为Underuse,且有限状态机的当前状态不是Decrease,则有限状态机转换为Incease状态。Step 3: Construct a finite state machine: including the code rate reduction state Decrease, the code rate maintaining state Hold and the code rate increasing state Increase, the initial state of the finite state machine is preset, and the current network state signal is input into the finite state machine, If the input is Overuse, the finite state machine is directly converted to the Decrease state; if the input is Normal, the finite state machine is directly converted to the Hold state; if the input is Underuse and the current state of the finite state machine is Decrease, the finite state machine is converted to Hold State; if the input is Underuse, and the current state of the finite state machine is not Decrease, the finite state machine transitions to the Incease state.

本发明实施例中,所构建的有限状态机的状态变化趋势如图2所示。In the embodiment of the present invention, the state change trend of the constructed finite state machine is shown in FIG. 2 .

步骤四、根据状态机的当前状态,按照如下方式进行码率计算:Step 4. According to the current state of the state machine, calculate the code rate as follows:

1)当状态机的当前状态为Increase状态时,且距离探测带宽相差大于设定阈值时,则下一时刻即ti时刻的码率为:1) When the current state of the state machine is the Increase state, and the difference from the detection bandwidth is greater than the set threshold, the code rate at the next moment, that is, moment t i , is:

Ar(ti)=max(min(Ar(ti-1)+max(0.2×Ar(ti-1),1000),1.4×incoming_bitrate),incoming_bitrate)A r (t i )=max(min(A r (t i-1 )+max(0.2×A r (t i-1 ), 1000), 1.4×incoming_bitrate), incoming_bitrate)

其中Ar(ti)为ti时刻的码率;Ar(ti-1)为当前时刻即ti-1时刻的码率;incoming_bitrate是根据接收视频数据包统计计算得出的接收数据码率。where Ar (t i ) is the bit rate at time t i ; A r ( t i-1 ) is the bit rate at the current moment, i.e. time t i-1 ; incoming_bitrate is the received data calculated according to the statistics of the received video data packets code rate.

本发明实施例中根据接收视频数据包的速率计算距离探测带宽相差是否大于设定阈值。In the embodiment of the present invention, it is calculated according to the rate of receiving video data packets whether the difference between the distance detection bandwidth is greater than the set threshold.

所述视频数据包的接收速率为incoming_bitrate,设定平均最大码率avg_max_bitrate的初始值为第一组视频数据包的接收速率,每接收一组视频数据包更新平均最大码率avg_max_bitrate为:The reception rate of the video data packet is incoming_bitrate, and the initial value of the set average maximum code rate avg_max_bitrate is the reception rate of the first group of video data packets, and the average maximum code rate avg_max_bitrate is updated every time a group of video data packets is received:

avg_max_bitrate=(1-α)×avg_max_bitrate_last+α×incoming_bitrateavg_max_bitrate=(1-α)×avg_max_bitrate_last+α×incoming_bitrate

其中α为设定的系数常量,本发明中可以依经验设定系数常量,例如本发明实施例中可设定该系数常量α为0.05。α is a preset coefficient constant, which can be set according to experience in the present invention. For example, in the embodiment of the present invention, the coefficient constant α can be set to be 0.05.

更新最大码率方差var_max_bitrate为:Update the maximum bit rate variance var_max_bitrate as:

var_max_bitrate=(1-α)×var_max_bitrate_last+α×(avg_max_bitrate-incoming_bitrate)2 var_max_bitrate=(1-α)×var_max_bitrate_last+α×(avg_max_bitrate-incoming_bitrate) 2

更新最大码率标准差std_max_bitrate为:Update the maximum bit rate standard deviation std_max_bitrate to:

Figure BDA0002494569930000101
Figure BDA0002494569930000101

Increase状态时,接收码率incoming_bitrate大于avg_max_bitrate与std_max_bitrate之和,则认为距离探测带宽相差大于设定阈值,每次进入Decrease状态,认为距离探测带宽相差不大于设定阈值。In the Increase state, if the incoming_bitrate of the received bit rate is greater than the sum of avg_max_bitrate and std_max_bitrate, it is considered that the distance detection bandwidth difference is greater than the set threshold.

2)当状态机的当前状态为Increase状态时,且距离探测带宽相差不大于设定阈值时,则下一时刻即ti时刻的码率为:2) When the current state of the state machine is the Increase state, and the distance from the detection bandwidth is not greater than the set threshold, the code rate at the next moment, that is, the moment t i is:

Ar(ti)=max(min(Ar(ti-1)+max(averOfPacket,1000),1.4×incoming_bitrate),incoming_bitrate)A r (t i )=max(min(A r (t i-1 )+max(averOfPacket, 1000), 1.4×incoming_bitrate), incoming_bitrate)

其中,averOfPacket是视频数据包的平均数据量,incoming_bitrate是根据接收视频数据包统计计算得出的接收数据码率。Among them, averOfPacket is the average data volume of video data packets, and incoming_bitrate is the received data bit rate calculated according to the statistics of received video data packets.

averOfPacket=bits_per_frame/packets_per_frameaverOfPacket=bits_per_frame/packets_per_frame

其中bits_per_frame是每帧数据量,packets_per_frame是一帧包含的数据包数量;本发明实施例中,按照设定,包最大为1200字节。Wherein bits_per_frame is the amount of data per frame, and packets_per_frame is the number of data packets included in one frame; in the embodiment of the present invention, according to the setting, the maximum packet size is 1200 bytes.

packets_per_frame=bits_per_frame/(8×1200)。packets_per_frame=bits_per_frame/(8×1200).

本发明实施例中,bits_per_frame是每帧数据量,bits_per_frame在每次码率计算完成之后进行更新:In this embodiment of the present invention, bits_per_frame is the amount of data per frame, and bits_per_frame is updated after each bit rate calculation is completed:

bits_per_frame=current_bitrate/frame_per_second;bits_per_frame=current_bitrate/frame_per_second;

其中frame_per_second是每秒的帧数;current_bitrate为当前比特率。Where frame_per_second is the number of frames per second; current_bitrate is the current bit rate.

3)当状态机的当前状态为Decrease状态时,则下一时刻即ti时刻的码率为3) When the current state of the state machine is the Decrease state, the code rate at the next moment, i.e. at moment t i , is:

Ar(ti)=min(0.75×incoming_bitrate,Ar(ti-1)) Ar (t i )=min(0.75×incoming_bitrate, Ar ( t i-1 ))

其中incoming_bitrate是根据接收视频数据包统计计算得出的接收数据码率。The incoming_bitrate is the received data bitrate calculated according to the statistics of the received video data packets.

4)当状态机的当前状态信号为Hold时,则码率保持不变,即下一时刻ti时刻的码率等于当前时刻ti-1时刻的码率;4) When the current state signal of the state machine is Hold, the code rate remains unchanged, that is, the code rate at the next moment t i is equal to the code rate at the current moment t i-1 ;

步骤五、根据计算出来的下一时刻即ti时刻的码率设定视频数据包的发送码率。Step 5: Set the sending code rate of the video data packet according to the calculated code rate at the next moment, that is, time t i .

本发明另外一个实施例还提供了一种实时视频中保证视频质量的拥塞控制系统,如图4所示,该系统包括视频发送端、视频接收端、时间滤波器、过载检测器、状态转换机以及码率计算器。Another embodiment of the present invention also provides a congestion control system for ensuring video quality in real-time video. As shown in FIG. 4 , the system includes a video transmitter, a video receiver, a time filter, an overload detector, and a state transition machine. and a bitrate calculator.

视频发送端,用于根据实时调整的发送码率进行视频数据包的接收。The video sending end is used to receive video data packets according to the sending bit rate adjusted in real time.

视频接收端,用于实时接收视频数据包。The video receiver is used to receive video data packets in real time.

时间滤波器,用于根据视频数据包的发送时间和接收时间计算延迟梯度;可以根据以上实施例中给出的计算法进行计算。The time filter is used to calculate the delay gradient according to the sending time and the receiving time of the video data packet; it can be calculated according to the calculation method given in the above embodiment.

过载检测器,用于根据延迟梯度对当前网络状态进行过载检测,获得当前网络状态信号;当前网络状态信号为过载状态信号Overuse、正常状态信号Normal或低载状态信号Underuse;可以根据以上实施例中给出的过载检测方法进行计算。The overload detector is used to perform overload detection on the current network state according to the delay gradient to obtain the current network state signal; the current network state signal is the overload state signal Overuse, the normal state signal Normal or the low load state signal Underuse; The given overload detection method is calculated.

状态转换机,用于构建有限状态机:包括码率减小状态Decrease、码率维持状态Hold以及码率增加状态Increase,预先设置有限状态机所处的初始状态,当前网络状态信号输入至有限状态机中,若输入为Overuse,有限状态机直接转换为Decrease状态;若输入为Normal,有限状态机直接转换为Hold状态;若输入为Underuse,且有限状态机的当前状态是Decrease,则有限状态机转换为Hold状态;若输入为Underuse,且有限状态机的当前状态不是Decrease,则有限状态机转换为Incease状态。State conversion machine, used to construct a finite state machine: including the code rate reduction state Decrease, the code rate maintaining state Hold and the code rate increasing state Increase, the initial state of the finite state machine is preset, and the current network state signal is input to the finite state In the machine, if the input is Overuse, the finite state machine is directly converted to the Decrease state; if the input is Normal, the finite state machine is directly converted to the Hold state; if the input is Underuse, and the current state of the finite state machine is Decrease, then the finite state machine Convert to Hold state; if the input is Underuse, and the current state of the finite state machine is not Decrease, the finite state machine is converted to Incease state.

码率计算器,用于根据状态机的当前状态,按照如下方式进行码率计算:The code rate calculator is used to calculate the code rate according to the current state of the state machine as follows:

1)当状态机的当前状态为Increase状态时,且距离探测带宽相差大于设定阈值时,则下一时刻即ti时刻的码率为:1) When the current state of the state machine is the Increase state, and the difference from the detection bandwidth is greater than the set threshold, the code rate at the next moment, that is, moment t i , is:

Ar(ti)=max(min(Ar(ti-1)+max(0.2×Ar(ti-1),1000),1.4×incoming_bitrate),incoming_bitrate)A r (t i )=max(min(A r (t i-1 )+max(0.2×A r (t i-1 ), 1000), 1.4×incoming_bitrate), incoming_bitrate)

其中Ar(ti)为ti时刻的码率;Ar(ti-1)为当前时刻即ti-1时刻的码率;incoming_bitrate是根据接收视频数据包统计计算得出的接收数据码率;根据接收视频数据包的速率计算距离探测带宽相差是否大于设定阈值。where Ar (t i ) is the bit rate at time t i ; A r ( t i-1 ) is the bit rate at the current moment, i.e. time t i-1 ; incoming_bitrate is the received data calculated according to the statistics of the received video data packets Bit rate; according to the rate of receiving video data packets, calculate whether the difference between the distance detection bandwidth is greater than the set threshold.

2)当状态机的当前状态为Increase状态时,且距离探测带宽相差不大于设定阈值时,则下一时刻即ti时刻的码率为:2) When the current state of the state machine is the Increase state, and the distance from the detection bandwidth is not greater than the set threshold, the code rate at the next moment, that is, moment t i , is:

Ar(ti)=max(min(Ar(ti-1)+max(averOfPacket,1000),1.4×incoming_bitrate),incoming_bitrate)A r (t i )=max(min(A r (t i-1 )+max(averOfPacket, 1000), 1.4×incoming_bitrate), incoming_bitrate)

其中,averOfPacket是视频数据包的平均数据量,incoming_bitrate是根据接收视频数据包统计计算得出的接收数据码率;Among them, averOfPacket is the average data volume of video data packets, incoming_bitrate is the received data bit rate calculated according to the statistics of received video data packets;

averOfPacket=bits_per_frame/packets_per_frameaverOfPacket=bits_per_frame/packets_per_frame

其中bits_per_frame是每帧数据量,packets_per_frame是一帧包含的数据包数量。按照设定,包最大为1200字节。Where bits_per_frame is the amount of data per frame, and packets_per_frame is the number of packets contained in a frame. According to the settings, the maximum packet size is 1200 bytes.

packets_per_frame=bits_per_frame/(8×1200)packets_per_frame=bits_per_frame/(8×1200)

3)当状态机的当前状态为Decrease状态时,则下一时刻即ti时刻的码率为3) When the current state of the state machine is the Decrease state, the code rate at the next moment, i.e. at moment t i , is:

Ar(ti)=min(0.75×incoming_bitrate,Ar(ti-1)) Ar (t i )=min(0.75×incoming_bitrate, Ar ( t i-1 ))

其中incoming_bitrate是根据接收视频数据包统计计算得出的接收数据码率。The incoming_bitrate is the received data bitrate calculated according to the statistics of the received video data packets.

4)当状态机的当前状态信号为Hold时,则码率保持不变,即下一时刻ti时刻的码率等于当前时刻ti-1时刻的码率。4) When the current state signal of the state machine is Hold, the code rate remains unchanged, that is, the code rate at the next time t i is equal to the code rate at the current time t i-1 .

码率计算器计算得到实时调整的发送码率送入到视频发送端。The bit rate calculator calculates the real-time adjusted sending bit rate and sends it to the video sending end.

本发明实施例中,视频发送端根据设定的调整时间间隔,依照实时调整的发送码率进行码率调整。In the embodiment of the present invention, the video sending end adjusts the code rate according to the real-time adjusted sending code rate according to the set adjustment time interval.

图5示出了一种带宽以4秒为变化间隔的带宽跟踪效果图,可以看出使用本发明实施例提供的实时视频中保证视频质量的拥塞控制方案能够满足需求。FIG. 5 shows a bandwidth tracking effect diagram in which the bandwidth is changed at an interval of 4 seconds. It can be seen that the congestion control scheme for ensuring video quality in real-time video provided by the embodiment of the present invention can meet the requirements.

图6示出了一种带宽以6秒为变化间隔的带宽跟踪效果图,可以看出使用本发明实施例提供的实时视频中保证视频质量的拥塞控制方案能够满足需求。FIG. 6 shows a bandwidth tracking effect diagram in which the bandwidth is changed at an interval of 6 seconds. It can be seen that the congestion control solution for ensuring video quality in real-time video provided by the embodiment of the present invention can meet the requirements.

综上所述,以上仅为本发明的较佳实施例而已,并非用于限定本发明的保护范围。凡在本发明的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。To sum up, the above are only preferred embodiments of the present invention, and are not intended to limit the protection scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included within the protection scope of the present invention.

Claims (8)

1.一种实时视频中保证视频质量的拥塞控制方法,其特征在于,包括如下步骤:1. the congestion control method of guaranteeing video quality in a real-time video, is characterized in that, comprises the steps: 步骤一、实时接收视频数据包,并计算延迟梯度;Step 1. Receive video data packets in real time, and calculate the delay gradient; 步骤二、根据所述延迟梯度对当前网络状态进行过载检测,获得当前网络状态信号;所述当前网络状态信号为过载状态信号Overuse、正常状态信号Normal或低载状态信号Underuse;Step 2: Perform overload detection on the current network state according to the delay gradient to obtain a current network state signal; the current network state signal is an overload state signal Overuse, a normal state signal Normal, or a low load state signal Underuse; 步骤三、构建有限状态机:包括码率减小状态Decrease、码率维持状态Hold以及码率增加状态Increase,预先设置有限状态机所处的初始状态,所述当前网络状态信号输入至所述有限状态机中,若输入为Overuse,所述有限状态机直接转换为Decrease状态;若输入为Normal,所述有限状态机直接转换为Hold状态;若输入为Underuse,且所述有限状态机的当前状态是Decrease,则所述有限状态机转换为Hold状态;若输入为Underuse,且所述有限状态机的当前状态不是Decrease,则所述有限状态机转换为Incease状态;Step 3: Constructing a finite state machine: including the code rate reduction state Decrease, the code rate maintaining state Hold and the code rate increasing state Increase, the initial state of the finite state machine is preset, and the current network state signal is input to the finite state machine. In the state machine, if the input is Overuse, the finite state machine is directly converted to the Decrease state; if the input is Normal, the finite state machine is directly converted to the Hold state; if the input is Underuse, and the current state of the finite state machine is Decrease, then the finite state machine is converted to the Hold state; if the input is Underuse, and the current state of the finite state machine is not Decrease, then the finite state machine is converted to the Incease state; 步骤四、根据状态机的当前状态,按照如下方式进行码率计算:Step 4. According to the current state of the state machine, calculate the code rate as follows: 1)当状态机的当前状态为Increase状态时,且距离探测带宽相差大于设定阈值时,则下一时刻即ti时刻的码率为1) When the current state of the state machine is the Increase state, and the difference from the detection bandwidth is greater than the set threshold, then the code rate at the next moment, i.e. at moment t i , is: Ar(ti)=max(min(Ar(ti-1)+max(0.2×Ar(ti-1),1000),1.4×incoming_bitrate),incoming_bitrate)A r (t i )=max(min(A r (t i-1 )+max(0.2×A r (t i-1 ), 1000), 1.4×incoming_bitrate), incoming_bitrate) 其中Ar(ti)为ti时刻的码率;Ar(ti-1)为当前时刻即ti-1时刻的码率;incoming_bitrate为根据接收视频数据包统计计算得出的接收数据码率;根据接收所述视频数据包的速率计算距离探测带宽相差是否大于设定阈值;where Ar (t i ) is the bit rate at time t i ; A r ( t i-1 ) is the bit rate at the current moment, i.e. time t i-1 ; incoming_bitrate is the received data calculated according to the statistics of the received video data packets bit rate; according to the rate at which the video data packet is received, calculate whether the distance detection bandwidth difference is greater than the set threshold; 2)当状态机的当前状态为Increase状态时,且距离探测带宽相差不大于设定阈值时,则下一时刻即ti时刻的码率为2) When the current state of the state machine is the Increase state, and the difference from the detection bandwidth is not greater than the set threshold, then the code rate at the next moment, i.e. at moment t i , is: Ar(ti)=max(min(Ar(ti-1)+max(averOfPacket,1000),1.4×incoming_bitrate),incoming_bitrate)A r (t i )=max(min(A r (t i-1 )+max(averOfPacket, 1000), 1.4×incoming_bitrate), incoming_bitrate) 其中,averOfPacket是视频数据包的平均数据量,incoming_bitrate是根据接收视频数据包统计计算得出的接收数据码率;Among them, averOfPacket is the average data volume of video data packets, incoming_bitrate is the received data bit rate calculated according to the statistics of received video data packets; averOfPacket=bits_per_frame/packets_per_frameaverOfPacket=bits_per_frame/packets_per_frame 其中bits_per_frame是每帧数据量,packets_per_frame是一帧包含的数据包数量;Where bits_per_frame is the amount of data per frame, packets_per_frame is the number of packets contained in a frame; 3)当状态机的当前状态为Decrease状态时,则下一时刻即ti时刻的码率为3) When the current state of the state machine is the Decrease state, the code rate at the next moment, i.e. at moment t i , is: Ar(ti)=min(0.75×incoming_bitrate,Ar(ti-1)) Ar (t i )=min(0.75×incoming_bitrate, Ar ( t i-1 )) 其中incoming_bitrate是根据接收视频数据包统计计算得出的接收数据码率;Among them, incoming_bitrate is the received data bit rate calculated according to the statistics of received video data packets; 4)当状态机的当前状态信号为Hold时,则码率保持不变,即下一时刻ti时刻的码率等于当前时刻ti-1时刻的码率;4) When the current state signal of the state machine is Hold, the code rate remains unchanged, that is, the code rate at the next moment t i is equal to the code rate at the current moment t i-1 ; 步骤五、根据计算出来的下一时刻即ti时刻的码率设定视频数据包的发送码率。Step 5: Set the sending code rate of the video data packet according to the calculated code rate at the next moment, that is, time t i . 2.如权利要求1所述的方法,其特征在于,所述步骤一,实时接收视频数据包,并计算延迟梯度,具体为:2. method as claimed in claim 1 is characterized in that, described step 1, receives video data packet in real time, and calculates delay gradient, is specially: 预先设定数据包组的时间间隔,在一个数据包组的时间间隔内接收的所有视频数据包为一组;The time interval of the data packet group is preset, and all video data packets received within the time interval of a data packet group are grouped into one group; 对于当前一组视频数据包,以最后一个视频数据包的到达时间减去第一个视频数据包的发送时间作为时间延迟;For the current group of video data packets, the time delay is the arrival time of the last video data packet minus the sending time of the first video data packet; 当前一组视频数据包与上一组视频数据包的时间延迟的差值作为当前一组视频数据包的延迟梯度。The difference between the time delays of the current group of video data packets and the previous group of video data packets is used as the delay gradient of the current group of video data packets. 3.如权利要求1或2所述的方法,其特征在于,所述步骤二,具体为:3. The method according to claim 1 or 2, wherein the step 2 is specifically: 预先设定过载阈值Th1和低载阈值Th0,若所述延迟梯度大于所述过载阈值Th1,则所述当前网络状态信号为Overuse;Preset overload threshold Th 1 and low load threshold Th 0 , if the delay gradient is greater than the overload threshold Th 1 , the current network status signal is Overuse; 若所述延迟梯度小于所述低载阈值Th0,则所述当前网络状态信号为Underuse;If the delay gradient is less than the low load threshold Th 0 , the current network status signal is Underuse; 若所述延迟梯度处于[Th0,Th1]范围内,则所述当前网络状态信号为Normal。If the delay gradient is in the range of [Th 0 , Th 1 ], the current network state signal is Normal. 4.如权利要求3所述的方法,其特征在于,所述步骤四中,根据接收所述视频数据包的速率计算距离探测带宽相差是否大于设定阈值,具体为:4. The method of claim 3, wherein in the step 4, according to the rate of receiving the video data packet, calculate whether the distance detection bandwidth difference is greater than a set threshold, specifically: 所述视频数据包的接收速率为incoming_bitrate,设定平均最大码率avg_max_bitrate的初始值为第一组视频数据包的接收速率,每接收一组视频数据包更新平均最大码率avg_max_bitrate为:The reception rate of the video data packet is incoming_bitrate, and the initial value of the set average maximum code rate avg_max_bitrate is the reception rate of the first group of video data packets, and the average maximum code rate avg_max_bitrate is updated every time a group of video data packets is received: avg_max_bitrate=(1-α)×avg_max_bitrate_last+α×incoming_bitrateavg_max_bitrate=(1-α)×avg_max_bitrate_last+α×incoming_bitrate 其中α为设定的系数常量;where α is the set coefficient constant; 更新最大码率方差var_max_bitrate为:Update the maximum bit rate variance var_max_bitrate to: var_max_bitrate=(1-α)×var_max_bitrate_last+α×(avg_max_bitrate-incoming_bitrate)2 var_max_bitrate=(1-α)×var_max_bitrate_last+α×(avg_max_bitrate-incoming_bitrate) 2 更新最大码率标准差std_max_bitrate为:Update the maximum bit rate standard deviation std_max_bitrate to:
Figure FDA0002494569920000031
Figure FDA0002494569920000031
Increase状态时,若接收码率incoming_bitrate大于avg_max_bitrate与std_max_bitrate之和,则认为距离探测带宽相差大于设定阈值,每次进入Decrease状态,认为距离探测带宽相差不大于设定阈值。In the Increase state, if the incoming_bitrate of the received bit rate is greater than the sum of avg_max_bitrate and std_max_bitrate, it is considered that the distance detection bandwidth difference is greater than the set threshold.
5.如权利要求1、2或4所述的方法,其特征在于,所述bits_per_frame是每帧数据量,bits_per_frame在每次码率计算完成之后进行更新:5. The method according to claim 1, 2 or 4, wherein the bits_per_frame is an amount of data per frame, and the bits_per_frame is updated after each bit rate calculation is completed: bits_per_frame=current_bitrate/frame_per_secondbits_per_frame=current_bitrate/frame_per_second 其中frame_per_second是每秒的帧数;current_bitrate为当前比特率。Where frame_per_second is the number of frames per second; current_bitrate is the current bit rate. 6.如权利要求1所述的方法,其特征在于,设定码率调整时间间隔为4s以内,在每个码率调整时间间隔内,均执行步骤一~步骤五进行码率调整。6 . The method of claim 1 , wherein the code rate adjustment time interval is set to be within 4s, and steps 1 to 5 are performed to adjust the code rate within each code rate adjustment time interval. 7 . 7.一种实时视频中保证视频质量的拥塞控制系统,其特征在于,该系统包括视频发送端、视频接收端、时间滤波器、过载检测器、状态转换机以及码率计算器;7. A congestion control system that guarantees video quality in real-time video, is characterized in that, this system comprises video sending end, video receiving end, time filter, overload detector, state converter and code rate calculator; 所述视频发送端,用于根据实时调整的发送码率进行视频数据包的接收;The video sending terminal is used for receiving video data packets according to the sending code rate adjusted in real time; 所述视频接收端,用于实时接收视频数据包;The video receiving end is used to receive video data packets in real time; 所述时间滤波器,用于根据视频数据包的发送时间和接收时间计算延迟梯度;The time filter is used to calculate the delay gradient according to the sending time and the receiving time of the video data packet; 所述过载检测器,用于根据所述延迟梯度对当前网络状态进行过载检测,获得当前网络状态信号;所述当前网络状态信号为过载状态信号Overuse、正常状态信号Normal或低载状态信号Underuse;The overload detector is configured to perform overload detection on the current network state according to the delay gradient to obtain a current network state signal; the current network state signal is an overload state signal Overuse, a normal state signal Normal or a low load state signal Underuse; 所述状态转换机,用于构建有限状态机:包括码率减小状态Decrease、码率维持状态Hold以及码率增加状态Increase,预先设置有限状态机所处的初始状态,所述当前网络状态信号输入至所述有限状态机中,若输入为Overuse,所述有限状态机直接转换为Decrease状态;若输入为Normal,所述有限状态机直接转换为Hold状态;若输入为Underuse,且所述有限状态机的当前状态是Decrease,则所述有限状态机转换为Hold状态;若输入为Underuse,且所述有限状态机的当前状态不是Decrease,则所述有限状态机转换为Incease状态;The state transition machine is used to construct a finite state machine: including a code rate reduction state Decrease, a code rate maintaining state Hold and a code rate increasing state Increase, the initial state of the finite state machine is preset, and the current network state signal Input into the finite state machine, if the input is Overuse, the finite state machine is directly converted to the Decrease state; if the input is Normal, the finite state machine is directly converted to the Hold state; if the input is Underuse, and the finite state machine The current state of the state machine is Decrease, then the finite state machine is converted to the Hold state; if the input is Underuse, and the current state of the finite state machine is not Decrease, then the finite state machine is converted to the Incease state; 所述码率计算器,用于根据状态机的当前状态,按照如下方式进行码率计算:The code rate calculator is used to calculate the code rate according to the current state of the state machine as follows: 1)当状态机的当前状态为Increase状态时,且距离探测带宽的差值大于设定阈值时,则下一时刻即ti时刻的码率为1) When the current state of the state machine is the Increase state, and the difference from the detection bandwidth is greater than the set threshold, the code rate at the next moment, i.e. at moment t i , is: Ar(ti)=max(min(Ar(ti-1)+max(averOfPacket,1000),1.4×incoming_bitrate),incoming_bitrate)A r (t i )=max(min(A r (t i-1 )+max(averOfPacket, 1000), 1.4×incoming_bitrate), incoming_bitrate) 其中Ar(ti)为ti时刻的码率;Ar(ti-1)为当前时刻即ti-1时刻的码率;incoming_bitrate是根据接收视频数据包统计计算得出的接收数据码率;根据接收所述视频数据包的速率计算距离探测带宽的差值是否大于设定阈值;where Ar (t i ) is the bit rate at time t i ; A r ( t i-1 ) is the bit rate at the current moment, i.e. time t i-1 ; incoming_bitrate is the received data calculated according to the statistics of the received video data packets bit rate; according to the rate at which the video data packet is received, calculate whether the difference from the detection bandwidth is greater than the set threshold; 2)当状态机的当前状态为Increase状态时,且距离探测带宽相差不大于设定阈值时,则下一时刻即ti时刻的码率为:2) When the current state of the state machine is the Increase state, and the distance from the detection bandwidth is not greater than the set threshold, the code rate at the next moment, that is, moment t i , is: Ar(ti)=max(min(Ar(ti-1)+max(averOfPacket,1000),1.4×incoming_bitrate),incoming_bitrate)A r (t i )=max(min(A r (t i-1 )+max(averOfPacket, 1000), 1.4×incoming_bitrate), incoming_bitrate) 其中,averOfPacket是视频数据包的平均数据量,incoming_bitrate是根据接收视频数据包统计计算得出的接收数据码率;Among them, averOfPacket is the average data volume of video data packets, incoming_bitrate is the received data bit rate calculated according to the statistics of received video data packets; averOfPacket=bits_per_frame/packets_per_frameaverOfPacket=bits_per_frame/packets_per_frame 其中bits_per_frame是每帧数据量,packets_per_frame是一帧包含的数据包数量;Where bits_per_frame is the amount of data per frame, packets_per_frame is the number of packets contained in a frame; 3)当状态机的当前状态为Decrease状态时,则下一时刻即ti时刻的码率为3) When the current state of the state machine is the Decrease state, the code rate at the next moment, i.e. at moment t i , is: Ar(ti)=min(0.75×incoming_bitrate,Ar(ti-1)) Ar (t i )=min(0.75×incoming_bitrate, Ar ( t i-1 )) 其中incoming_bitrate是根据接收视频数据包统计计算得出的接收数据码率;Among them, incoming_bitrate is the received data bit rate calculated according to the statistics of received video data packets; 4)当状态机的当前状态信号为Hold时,则码率保持不变,即下一时刻ti时刻的码率等于当前时刻ti-1时刻的码率;4) When the current state signal of the state machine is Hold, the code rate remains unchanged, that is, the code rate at the next moment t i is equal to the code rate at the current moment t i-1 ; 所述码率计算器计算得到实时调整的发送码率送入到所述视频发送端。The sending code rate adjusted in real time calculated by the code rate calculator is sent to the video sending end. 8.如权利要求7所述的系统,其特征在于,所述视频发送端根据设定的调整时间间隔,依照所述实时调整的发送码率进行码率调整。8 . The system of claim 7 , wherein the video sending end adjusts the code rate according to the real-time adjusted sending code rate according to the set adjustment time interval. 9 .
CN202010414567.9A 2020-05-15 2020-05-15 Congestion control method and system for ensuring video quality in real-time video Active CN111726301B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010414567.9A CN111726301B (en) 2020-05-15 2020-05-15 Congestion control method and system for ensuring video quality in real-time video

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010414567.9A CN111726301B (en) 2020-05-15 2020-05-15 Congestion control method and system for ensuring video quality in real-time video

Publications (2)

Publication Number Publication Date
CN111726301A true CN111726301A (en) 2020-09-29
CN111726301B CN111726301B (en) 2022-03-22

Family

ID=72564525

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010414567.9A Active CN111726301B (en) 2020-05-15 2020-05-15 Congestion control method and system for ensuring video quality in real-time video

Country Status (1)

Country Link
CN (1) CN111726301B (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112291824A (en) * 2020-11-23 2021-01-29 武汉长江通信智联技术有限公司 Wireless video low-delay transmission method in 5G network
CN112653635A (en) * 2020-12-23 2021-04-13 百果园技术(新加坡)有限公司 Congestion control algorithm improvement method, device, equipment and storage medium
CN115801639A (en) * 2022-08-01 2023-03-14 天翼云科技有限公司 Bandwidth detection method and device, electronic equipment and storage medium
CN116260799A (en) * 2023-05-16 2023-06-13 北京庭宇科技有限公司 Method for adjusting network state and electronic equipment

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109905326A (en) * 2019-03-26 2019-06-18 武汉大学 A Congestion Level Factor-Based Optimization Method for Rate Descent Parameters

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109905326A (en) * 2019-03-26 2019-06-18 武汉大学 A Congestion Level Factor-Based Optimization Method for Rate Descent Parameters

Non-Patent Citations (5)

* Cited by examiner, † Cited by third party
Title
GAETANO CARLUCCI 等: "Congestion Control for Real-time Communications:a comparison between NADA and GCC", 《2016 24TH MEDITERRANEAN CONFERENCE ON CONTROL AND AUTOMATION (MED)》 *
GAETANO CARLUCCI 等: "Congestion Control for Web Real-Time Communication", 《IEEE/ACM TRANSACTIONS ON NETWORKING》 *
GAETANO CARLUCCI 等: "Modelling and control for web real-time communication", 《53RD IEEE CONFERENCE ON DECISION AND CONTROL》 *
LEILEI WU 等: "GCC-β: Improving Interactive Live Video Streaming via an Adaptive Low-Latency Congestion Control", 《ICC 2019 - 2019 IEEE INTERNATIONAL CONFERENCE ON COMMUNICATIONS (ICC)》 *
LUCA DE CICCO 等: "Understanding the Dynamic Behaviour of the Google Congestion Control for RTCWeb", 《2013 20TH INTERNATIONAL PACKET VIDEO WORKSHOP》 *

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112291824A (en) * 2020-11-23 2021-01-29 武汉长江通信智联技术有限公司 Wireless video low-delay transmission method in 5G network
CN112291824B (en) * 2020-11-23 2022-10-04 武汉长江通信智联技术有限公司 Wireless video low-delay transmission method in 5G network
CN112653635A (en) * 2020-12-23 2021-04-13 百果园技术(新加坡)有限公司 Congestion control algorithm improvement method, device, equipment and storage medium
CN115801639A (en) * 2022-08-01 2023-03-14 天翼云科技有限公司 Bandwidth detection method and device, electronic equipment and storage medium
CN115801639B (en) * 2022-08-01 2024-06-07 天翼云科技有限公司 Bandwidth detection method, device, electronic device and storage medium
CN116260799A (en) * 2023-05-16 2023-06-13 北京庭宇科技有限公司 Method for adjusting network state and electronic equipment

Also Published As

Publication number Publication date
CN111726301B (en) 2022-03-22

Similar Documents

Publication Publication Date Title
CN111726301A (en) Congestion control method and system for ensuring video quality in real-time video
EP2432175B1 (en) Method, device and system for self-adaptively adjusting data transmission rate
CN101909060B (en) Qos control method suitable for real-time streaming media transmission of mobile videos
CN106330761B (en) Congestion control method and device based on queue time delay
EP2255535B1 (en) Device and method for adaptation of target rate of video signals
CN108401128B (en) Congestion control method in video call
CN111935441B (en) Network state detection method and device
CN105430532A (en) Control method and system for adaptive adjustment of video data transmission
JPWO2006054442A1 (en) Transmitting apparatus, receiving apparatus, and communication system
WO2017148260A1 (en) Voice code sending method and apparatus
CN111263102B (en) ViLTE video call congestion control method and system based on delay gradient accumulation
KR20060128595A (en) Rate control method using error correction packet and communication device using same
US8995268B2 (en) Method for controlling a flow in a packet switching network
CN113891172B (en) Adaptive code rate control method based on RTT (round trip time) and suitable for wireless Mesh network
CN106789385B (en) A video stream sending method, sending device and network camera
WO2020253488A1 (en) Method and device for congestion control, communication network, and computer storage medium
CN104349219A (en) Strict increase loose decrease equal step congestion control algorithm based on mobile communication network
CN112995048B (en) Data center network congestion control and scheduling fusion method and terminal equipment
CN114785743A (en) Active queue management algorithm for enhancing RED stability
TWI801835B (en) Round-trip estimation
CN100391195C (en) A Method of Dynamically Adjusting Data Packet Length Based on Network Quality of Service
CN114866859B (en) Real-time video transmission dynamic delay control system based on time stamp and packet loss detection
Papadimitriou et al. QRP04-4: End-to-end Congestion Management for Real-Time Streaming Video over the Internet
CN118828686A (en) Transport layer congestion control method for underwater acoustic sensor networks based on RTT-LDA
He et al. An Improved MCVideo System Video Stream Adaptive Control Algorithm

Legal Events

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