Video code rate adjustment method and device, equipment and storage medium

By calculating the link buffer utilization and estimated frame latency of video frames, and combining multiple evaluation values ​​to determine the adjustment strategy, the problem of congestion detection and user experience deviation in video transmission is solved, achieving more accurate bitrate control and a better user experience.

CN121967756APending Publication Date: 2026-05-01SHANGHAI ZULE INFORMATION TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SHANGHAI ZULE INFORMATION TECHNOLOGY CO LTD
Filing Date
2026-01-26
Publication Date
2026-05-01

AI Technical Summary

Technical Problem

In existing technologies, congestion detection during video transmission deviates from user experience, with slow detection rates and long bitrate control cycles, making it difficult to accurately reflect network status at the video frame level.

Method used

By calculating the link buffer utilization rate and periodically estimating the frame delay time for each frame, and combining the congestion status, transmission status assessment value, and risk value, an adjustment strategy is determined to achieve precise adjustment of the video bitrate.

Benefits of technology

It improves the granularity and timeliness of congestion detection, shortens the bitrate control cycle, and enhances the accuracy of bitrate adjustment and user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121967756A_ABST
    Figure CN121967756A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a video code rate adjustment method and device, equipment and a storage medium, and the method comprises the steps: obtaining a cache utilization rate, a current video code rate, the receiving and transmitting time of each data packet, the current time and a transmission state evaluation value, and calculating a risk value based on the current video code rate and a preset upper limit code rate; periodically calculating a link cache utilization rate according to the receiving and transmitting time of each data packet, and periodically calculating an estimated frame delay time according to the current time and the receiving and transmitting time of each data packet; counting a plurality of estimated frame delay times in a preset duration range, generating a data sequence corresponding to the estimated frame delay times based on the calculation sequence, and determining a congestion state according to the link cache utilization rate, the transceiving time of each data packet and the data sequence; and determining a current adjustment strategy according to the congestion state, the transmission state evaluation value, the risk value and a preset adjustment rule, and adjusting the current video code rate based on the current adjustment strategy. The fine granularity and timeliness of congestion detection and the accuracy of code rate adjustment are improved, and the code rate control period is shortened.
Need to check novelty before this filing date? Find Prior Art

Description

A video bitrate adjustment method, apparatus, device, and storage medium Technical Field

[0001] This application relates to the field of computer technology, and in particular to a video bitrate adjustment method, apparatus, device, and storage medium. Background Technology

[0002] With the rapid development of 5G communication and cloud computing technologies, real-time audio and video transmission scenarios such as remote desktops, video conferencing, and live streaming are becoming increasingly common. These scenarios place extremely high demands on the real-time performance, smoothness, and picture quality of data transmission. A reasonable bitrate configuration can fully utilize network bandwidth to improve picture quality, while failure to adjust the bitrate in time during network congestion can lead to problems such as stuttering, packet loss, and increased latency, severely impacting the user experience.

[0003] In related technologies, congestion detection and bitrate control during video transmission are typically implemented at the packet level. For example, network status is determined and bitrate is adjusted by statistically analyzing the transmission parameters of a set of data packets (such as round-trip delay and packet loss rate). However, the granularity of packet-level control cannot match the transmission characteristics of video frames. Video frames are usually composed of multiple data packets, and their transmission quality directly determines the user's intuitive experience. Controlling only data packets cannot accurately reflect the network status at the frame level, resulting in a discrepancy between congestion detection and the actual user experience. Furthermore, congestion detection is slow, and bitrate control cycles are long. Summary of the Invention

[0004] This application provides a video bitrate adjustment method, apparatus, device, and storage medium, which solves the problems of discrepancies between congestion detection and user experience during video transmission, slow congestion detection rates, and long bitrate control cycles. It can calculate the link buffer utilization rate for each frame and periodically calculate the estimated frame delay time, thereby improving the granularity and timeliness of congestion detection and shortening the bitrate control cycle. By jointly determining the adjustment strategy based on the congestion state, transmission state assessment value, and risk value, the accuracy of bitrate adjustment is improved.

[0005] In a first aspect, embodiments of this application provide a video bitrate adjustment method, comprising: acquiring buffer utilization, current video bitrate, data packet transmission and reception time, current time, and transmission status assessment value; calculating a risk value based on the current video bitrate and a preset upper limit bitrate; periodically calculating link buffer utilization based on the data packet transmission and reception time; periodically calculating estimated frame delay time based on the current time and the data packet transmission and reception time; statistically analyzing multiple estimated frame delay times calculated within a preset time range, and generating a data sequence corresponding to the estimated frame delay time based on the calculation order; determining a congestion state based on the link buffer utilization, the data packet transmission and reception time, and the data sequence; determining a current adjustment strategy based on the congestion state, the transmission status assessment value, the risk value, and a preset adjustment rule; and adjusting the current video bitrate based on the current adjustment strategy.

[0006] Optionally, the step of periodically calculating the link buffer utilization based on the transmission and reception time of each data packet includes: periodically calculating the time difference between the reception time of the last data packet and the transmission time of the first data packet, and the round-trip transmission time of each data packet; calculating the frame queuing delay based on the time difference and the round-trip transmission time of each data packet, and calculating the ratio of the frame queuing delay to the preset frame transmission interval, and determining the ratio as the link buffer utilization.

[0007] Optionally, determining the congestion state based on the link buffer utilization, the data packet transmission and reception time, and the data sequence includes: determining whether the current state is an instantaneous congestion state based on the link buffer utilization and the data packet transmission and reception time, and determining whether the current state is a predicted congestion state based on the estimated delay times in the data sequence.

[0008] Optionally, determining whether the current state is a predicted congestion state based on the estimated delay times in the data sequence includes: determining the number of rises of adjacent estimated frame delay times in the data sequence and the total number of estimated frame delay times contained in the data sequence; calculating the rise ratio based on the number of rises and the total number of estimated frame delay times; determining the total increase and the total change of estimated frame delay times in the data sequence; calculating the rise efficiency based on the total increase and the total change of estimated frame delay times; and determining whether the current state is a predicted congestion state based on the rise ratio, the rise efficiency, and the final estimated frame delay time in the data sequence.

[0009] Optionally, determining whether the current state is a momentary congestion state based on the link buffer utilization and the transmission and reception times of each data packet includes: calculating the frame reception delay and the transmission interval of adjacent data packets based on the transmission and reception times of each data packet; and determining that the current state is a momentary congestion state when the link buffer utilization is greater than a preset buffer utilization threshold and the frame reception delay is greater than the transmission interval; or, determining the number of data packets received and the number of data packets sent in the current frame based on the transmission and reception times of each data packet; and determining that the current state is a momentary congestion state when the link buffer utilization is greater than a preset buffer utilization threshold and the number of data packets received is less than the number of data packets sent.

[0010] Optionally, determining the current adjustment strategy based on the congestion state, the transmission state assessment value, the risk value, and a preset adjustment rule includes: comparing the transmission state assessment value with the risk value; if the transmission state assessment value is greater than the risk value and the congestion state is non-congestion, determining the current adjustment strategy to adjust upward by a first adjustment magnitude; if the transmission state assessment value is less than or equal to the risk value and the congestion state is non-congestion, determining the current adjustment strategy to adjust upward by a second adjustment magnitude, wherein the first adjustment magnitude is greater than the second adjustment magnitude.

[0011] Optionally, before obtaining the cache utilization rate, current video bitrate, data packet transmission and reception time, current time, and transmission status evaluation value, the method further includes: obtaining multiple network status evaluation indicators; converting the evaluation scores of each network status evaluation indicator based on a preset algorithm to obtain the indicator score value corresponding to each network evaluation indicator; and performing weighted calculation on each indicator score value according to a preset weight coefficient to obtain the transmission status evaluation value.

[0012] In a second aspect, embodiments of this application provide a video bitrate adjustment device, comprising: a parameter acquisition module, used to acquire buffer utilization, current video bitrate, data packet transmission and reception time, current time, and transmission status evaluation value; a frame-level statistics module, used to calculate a risk value based on the current video bitrate and a preset upper limit bitrate, periodically calculate the link buffer utilization based on the data packet transmission and reception time, and periodically calculate the estimated frame delay time based on the current time and the data packet transmission and reception time; a congestion status determination module, used to statistically analyze multiple estimated frame delay times calculated within a preset time range, generate a data sequence corresponding to the estimated frame delay time based on the calculation order, and determine the congestion status based on the link buffer utilization, the data packet transmission and reception time, and the data sequence; a current adjustment strategy determination module, used to determine a current adjustment strategy based on the congestion status, the transmission status evaluation value, the risk value, and a preset adjustment rule; and a video bitrate adjustment module, used to adjust the current video bitrate based on the current adjustment strategy.

[0013] In a third aspect, embodiments of this application provide an electronic device, the device comprising: one or more processors; and a storage device configured to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the video bitrate adjustment method described in the first aspect.

[0014] In a fourth aspect, embodiments of this application provide a storage medium for storing computer-executable instructions, which, when executed by a computer processor, are used to perform the video bitrate adjustment method as described in the first aspect.

[0015] In this embodiment, by acquiring the buffer utilization rate, current video bitrate, data packet transmission and reception time, current time, and transmission status assessment value, a risk value is calculated based on the current video bitrate and a preset upper limit bitrate. The link buffer utilization rate is periodically calculated based on the data packet transmission and reception time, and the estimated frame delay time is periodically calculated based on the current time and the data packet transmission and reception time. Multiple estimated frame delay times calculated within a preset time range are statistically analyzed, and a data sequence corresponding to the estimated frame delay time is generated based on the calculation order. The congestion state is determined based on the link buffer utilization rate, data packet transmission and reception time, and the data sequence. The current adjustment strategy is determined based on the congestion state, transmission status assessment value, risk value, and preset adjustment rules, and the current video bitrate is adjusted based on the current adjustment strategy. In the above scheme, by calculating the link buffer utilization rate for each frame and periodically calculating the estimated frame delay time, congestion state detection is performed based on the estimated frame delay time, improving the fine-grainedness and timeliness of congestion detection, shortening the bitrate control cycle, and improving the accuracy of bitrate adjustment by jointly determining the adjustment strategy based on the congestion state, transmission status assessment value, and risk value. Attached Figure Description

[0016] Figure 1 is a flowchart of a video bitrate adjustment method provided in an embodiment of this application; Figure 2 is a flowchart of a link buffer utilization calculation method provided in an embodiment of this application; Figure 3 is a flowchart of a congestion state determination method provided in an embodiment of this application; Figure 4 is a flowchart of a predicted congestion state determination method provided in an embodiment of this application; Figure 5 is a structural schematic diagram of a video bitrate adjustment device provided in an embodiment of this application; Figure 6 is a structural schematic diagram of a video bitrate adjustment equipment provided in an embodiment of this application. Detailed Implementation

[0017] To make the objectives, technical solutions, and advantages of this application clearer, specific embodiments of this application will be described in further detail below with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are merely for explaining this application and not for limiting it. It should also be noted that, for ease of description, only the parts relevant to this application are shown in the drawings, not all of them. Before discussing exemplary embodiments in more detail, it should be mentioned that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although the flowcharts describe operations (or steps) as sequential processes, many of these operations can be performed in parallel, concurrently, or simultaneously. Furthermore, the order of the operations can be rearranged. The process can be terminated when its operation is completed, but may also have additional steps not included in the drawings. The process can correspond to a method, function, procedure, subroutine, subprogram, etc.

[0018] The technical solutions of the embodiments of this application will be clearly described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application are within the scope of protection of this application.

[0019] The terms "first," "second," etc., used in the specification and claims of this application are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such use of data can be interchanged where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first," "second," etc., are generally of the same class and the number of objects is not limited; for example, a first object can be one or more. Furthermore, in the specification and claims, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship.

[0020] The video bitrate adjustment method, apparatus, device, and medium provided in this application will be described in detail below with reference to the accompanying drawings and through specific embodiments and application scenarios.

[0021] The video bitrate adjustment method provided in this application is used in audio and video data transmission scenarios. Based on the above application scenario, it can be understood that the executing entity of each step can be an electronic device. This electronic device refers to any device with data computing, processing, and storage capabilities, such as mobile phones, PCs (Personal Computers), tablet computers, and other terminal devices, or it can be a server or other devices. This application does not limit the scope of the method.

[0022] Figure 1 is a flowchart of a video bitrate adjustment method provided in an embodiment of this application. As shown in Figure 1, it includes: step S101, obtaining the buffer utilization rate, the current video bitrate, the sending and receiving time of each data packet, the current time, and the transmission status evaluation value, and calculating the risk value based on the current video bitrate and the preset upper limit bitrate.

[0023] Among these, cache utilization can be used to assess the network link cache usage; a higher value indicates more cache usage, slower frame transmission, and a closer proximity to network congestion. Current video bitrate refers to the amount of video data transmitted per unit time during the current video transmission process. Packet transmission and reception time refers to the transmission and reception time of each data packet contained in a single video frame. Current time refers to the real-time point in time at which operations such as bitrate adjustment calculation and congestion detection are performed. Transmission status evaluation value refers to an evaluation score calculated from multiple network status indicators, used to quantify the overall quality of network transmission, such as the QoE (Quality of Experience) score. Preset upper limit bitrate refers to the maximum video bitrate threshold preset based on the network environment, transmission scenario, or system configuration. Risk value refers to the degree of risk of the current bitrate approaching the preset upper limit bitrate, i.e., the probability of causing congestion.

[0024] In one embodiment, the buffer utilization rate, current video bitrate, data packet transmission and reception time, current time, and transmission status evaluation value in the current audio and video data transmission environment are obtained respectively, and the ratio of the current video bitrate to the preset upper limit bitrate is calculated. The calculation result is determined as the risk value.

[0025] Step S102: Periodically calculate the link buffer utilization rate based on the transmission and reception time of each data packet, and periodically calculate the estimated frame delay time based on the current time and the transmission and reception time of each data packet.

[0026] Link buffer utilization indicates the degree of network link buffer occupancy. The higher the value, the more the network buffer is occupied, the slower the frame transmission speed, and the closer the network is to congestion. Estimated frame latency refers to the waiting time consumed from the time a video frame is initiated by the sender to the time before the receiver fully acknowledges receipt. It is used to predict network congestion by checking for timeouts.

[0027] In one embodiment, the frame transmission delay and frame transmission interval are periodically calculated based on the transmission and reception times of each data packet. The frame queuing delay is then calculated based on the frame transmission delay, and the ratio of the frame queuing delay to the frame transmission interval is determined as the link buffer utilization rate. The transmission time of the first packet of the latest frame that has not yet received complete acknowledgment within a preset period is determined based on the transmission and reception times of each data packet. The time difference between the current time and the transmission time of the first packet is calculated, and this time difference is determined as the estimated frame delay time. The latest frame that has not yet received complete acknowledgment can refer to a video frame that has started transmission but has not yet received complete acknowledgment feedback from the receiving end. The estimated frame delay can refer to the waiting time consumed from the time the video frame is initiated by the sending end to the time the receiving end has not yet received complete acknowledgment, and is used to predict network congestion by checking for timeouts.

[0028] Step S103: Calculate the estimated frame delay times obtained within the preset time range, generate the data sequence corresponding to the estimated frame delay times based on the calculation order, and determine the congestion status based on the link buffer utilization, the transmission and reception time of each data packet, and the data sequence.

[0029] The preset duration range can refer to a fixed time window pre-set for statistical analysis of estimated frame latency, which is longer than the calculation cycle of link buffer utilization and the calculation cycle of estimated frame latency. The data sequence can refer to multiple sets of estimated frame latency data collected and arranged chronologically within the preset duration range. The congestion state can refer to a network state where data transmission pressure exceeds processing capacity, resulting in increased frame latency, excessive buffer usage, and decreased transmission efficiency. This congestion state can include instantaneous congestion and predicted congestion.

[0030] In one embodiment, firstly, multiple estimated frame delay times calculated within a preset time range are statistically analyzed. Then, each estimated frame delay time is sorted according to its calculation order, generating a data sequence corresponding to the calculation order. Next, by analyzing the trend of link buffer utilization and the distribution characteristics of packet transmission and reception times, combined with the fluctuations in the estimated frame delay times in the data sequence, it is determined whether the network is in a state of transient congestion or predicted congestion. If a short-term, drastic fluctuation in the estimated frame delay time is detected, and the link buffer utilization rate rises rapidly, it can be preliminarily determined to be a state of transient congestion. If the estimated frame delay time continues to increase while the link buffer utilization rate remains high, it is confirmed that the network is currently in a state of predicted congestion.

[0031] Step S104: Determine the current adjustment strategy based on the congestion status, transmission status assessment value, risk value, and preset adjustment rules, and adjust the current video bitrate based on the current adjustment strategy.

[0032] The preset adjustment rules can refer to a predefined set of rules governing the direction and magnitude of bitrate adjustments. The current adjustment strategy can refer to the bitrate adjustment scheme determined according to the preset adjustment rules under the current network conditions.

[0033] In one embodiment, if the congestion state is non-congestion and the transmission state assessment value is less than or equal to a preset transmission state threshold, and the risk value is greater than a preset risk threshold, then a first bitrate adjustment range is selected to alleviate network congestion pressure. This first adjustment range is an adjustment range within a relatively large range. Conversely, if the congestion state is non-congestion and the transmission state assessment value is greater than the preset transmission state threshold, and the risk value is less than or equal to a preset risk threshold, then a second adjustment range is selected to maintain video transmission quality. This second adjustment range is an adjustment range within a relatively small range. After determining the appropriate bitrate adjustment range, the current video bitrate is increased according to this bitrate adjustment range. In another possible embodiment, if the congestion state is an instantaneous congestion state or a predicted congestion state, then the video bitrate is decreased based on the first adjustment range.

[0034] In this embodiment, by acquiring the buffer utilization rate, current video bitrate, data packet transmission and reception time, current time, and transmission status assessment value, a risk value is calculated based on the current video bitrate and a preset upper limit bitrate. The link buffer utilization rate is periodically calculated based on the data packet transmission and reception time, and the estimated frame delay time is periodically calculated based on the current time and the data packet transmission and reception time. Multiple estimated frame delay times calculated within a preset time range are statistically analyzed, and a data sequence corresponding to the estimated frame delay time is generated based on the calculation order. The congestion state is determined based on the link buffer utilization rate, data packet transmission and reception time, and the data sequence. The current adjustment strategy is determined based on the congestion state, transmission status assessment value, risk value, and preset adjustment rules, and the current video bitrate is adjusted based on the current adjustment strategy. In the above scheme, by calculating the link buffer utilization rate for each frame and periodically calculating the estimated frame delay time, congestion state detection is performed based on the estimated frame delay time, improving the fine-grainedness and timeliness of congestion detection, shortening the bitrate control cycle, and improving the accuracy of bitrate adjustment by jointly determining the adjustment strategy based on the congestion state, transmission status assessment value, and risk value.

[0035] Optionally, the current adjustment strategy is determined based on the congestion state, transmission state assessment value, risk value, and preset adjustment rules, including: comparing the transmission state assessment value with the risk value; if the transmission state assessment value is greater than the risk value and the congestion state is non-congestion, the current adjustment strategy is to adjust upward by a first adjustment magnitude; if the transmission state assessment value is less than or equal to the risk value and the congestion state is non-congestion, the current adjustment strategy is to adjust upward by a second adjustment magnitude, wherein the first adjustment magnitude is greater than the second adjustment magnitude.

[0036] In this embodiment, both the first and second adjustment magnitudes refer to the adjustment values ​​of the current bitrate, with the first adjustment magnitude being greater than the second adjustment magnitude. In one embodiment, the transmission state assessment value is compared with the risk value. If the transmission state assessment value is greater than the risk value and the congestion state is non-congestion, the network condition is considered good, the risk of bitrate increase is low, and a significant increase in bitrate is allowed. Therefore, the current adjustment strategy is determined to be to adjust the first adjustment magnitude upwards. If the transmission state assessment value is less than or equal to the risk value, it indicates that the network condition has deteriorated, or the current bitrate has already increased to near its upper limit, requiring a conservative increase in bitrate, allowing only a very small increase. Therefore, the current adjustment strategy is determined to be to adjust the second adjustment magnitude upwards. In another possible embodiment, if the current congestion state is an instantaneous or predicted congestion state, the network environment is considered poor, inevitably leading to a transmission state assessment value less than or equal to the risk value. In this case, the current adjustment strategy is determined to be to adjust the third adjustment magnitude downwards. This third adjustment magnitude is a larger adjustment magnitude, optionally greater than the first adjustment magnitude.

[0037] In this embodiment, by comparing the transmission status assessment value with the risk value, if the transmission status assessment value is greater than the risk value and the congestion status is non-congestion, the current adjustment strategy is determined to be an upward adjustment by a first adjustment magnitude; if the transmission status assessment value is less than or equal to the risk value and the congestion status is non-congestion, the current adjustment strategy is determined to be an upward adjustment by a second adjustment magnitude, where the first adjustment magnitude is greater than the second adjustment magnitude. This scheme allows for flexible adjustment of the video bitrate based on network conditions and transmission requirements, thereby improving user experience while ensuring transmission quality.

[0038] Optionally, before obtaining the cache utilization rate, current video bitrate, data packet transmission and reception time, current time, and transmission status evaluation value, the method further includes: obtaining multiple network status evaluation indicators, converting the evaluation scores of each network status evaluation indicator based on a preset algorithm to obtain the indicator score value corresponding to each network evaluation indicator; and performing weighted calculation on each indicator score value according to a preset weight coefficient to obtain the transmission status evaluation value.

[0039] Among them, network status assessment indicators can refer to key parameters selected from core dimensions such as latency, packet loss, image quality, and smoothness. The indicator score can refer to the score of a single indicator obtained after standardizing the network status assessment indicators, and the range of the indicator score can be [0,1].

[0040] In one embodiment, metrics such as single-frame latency, single-packet round-trip time, frame quantization parameters, frame rate, stutter duration, and packet loss rate are collected. Based on a preset algorithm, each network status evaluation metric is evaluated and its score is converted, mapping the raw data to standardized metric scores to ensure a unified quantification standard for each metric. For example, for each metric `value`, an optimal value (`ideal`) and a worst value (`worst`) are set, and the metric score is calculated as (`value` - `worst`) / (`ideal` - `worst`). Based on pre-defined weighting coefficients, the scores of each metric are weighted and calculated to obtain a comprehensive transmission status evaluation value that reflects the network transmission quality. For example, the weighting coefficients for single frame time, single packet round-trip time, and packet loss rate are all 0.1, the weighting coefficients for frame quantization parameters and frame rate are all 0.2, and the weighting coefficient for stuttering duration is 0.3. After calculating the scores for single frame time, single packet round-trip time, frame quantization parameters, frame rate, stuttering duration, and packet loss rate, the final transmission status evaluation value is obtained by weighting the scores of each indicator with their corresponding weighting coefficients.

[0041] In this embodiment, multiple network status evaluation indicators are obtained, and evaluation scores are converted for each indicator based on a preset algorithm to obtain the corresponding indicator score value. The score values ​​of each indicator are then weighted according to preset weighting coefficients to obtain the transmission status evaluation value. This scheme comprehensively reflects the multi-dimensional evaluation results of network transmission quality, effectively avoiding the excessive influence of a single indicator on the overall evaluation result, thereby improving the accuracy and reliability of the transmission status evaluation value.

[0042] Figure 2 is a flowchart of a link buffer utilization calculation method provided in an embodiment of this application. As shown in Figure 2, it includes: step S1021, periodically calculating the time difference between the last data packet reception time and the first data packet transmission time, and the round-trip transmission time of each data packet based on the data packet transmission and reception time.

[0043] Step S1022: Calculate the frame queuing delay based on the time difference and the round-trip transmission time of a single packet, and calculate the ratio of the frame queuing delay to the preset frame transmission interval, and determine the ratio as the link buffer utilization rate.

[0044] The round-trip time per packet refers to the total time it takes for a single data packet to be sent from the sender, successfully received and acknowledged by the receiver, and then received by the sender again. Frame queuing delay refers to the time it takes for video frames to complete transmission due to network buffer usage at the sender. The preset frame transmission interval refers to a pre-defined standard value for the transmission time interval between two adjacent video frames.

[0045] In one embodiment, the reception time of the last received data packet and the transmission time of the first sent data packet within a preset period are determined based on the transmission and reception times of each data packet. The time difference between these reception and transmission times is calculated, and this time difference represents the delay from the transmission of a single data packet to the receipt of all acknowledgments. The total time consumed from the sending end to the receiving end successfully receiving and returning an acknowledgment signal, and then back to the sending end receiving the acknowledgment information, is determined based on the transmission and reception times of each data packet. The difference between this time difference and the round-trip transmission time of a single packet is calculated, and this difference is determined as the frame queuing delay. The ratio of the frame queuing delay to a preset frame transmission interval is calculated, and this ratio is determined as the link buffer utilization rate.

[0046] In this embodiment, the time difference between the reception time of the last data packet and the transmission time of the first data packet is periodically calculated based on the transmission and reception times of each data packet, along with the round-trip time per data packet. The frame queuing delay is then calculated based on the time difference and the round-trip time per packet, and the ratio of the frame queuing delay to a preset frame transmission interval is calculated. This ratio is then determined as the link buffer utilization rate. This scheme allows for accurate determination of the link buffer occupancy and the actual load on the network link through precise analysis of the transmission and reception times of each data packet.

[0047] Figure 3 is a flowchart of a congestion state determination method provided in an embodiment of this application. As shown in Figure 3, it includes: step S1031, determining whether the current state is an instantaneous congestion state based on the link buffer utilization and the transmission and reception time of each data packet.

[0048] Step S1032: Determine whether the current state is a predicted congestion state based on the estimated delay times in the data sequence.

[0049] Instantaneous congestion refers to temporary network congestion caused by short-term data accumulation or instantaneous fluctuations. Predicted congestion refers to a persistent network congestion trend with a significant increase in frame latency.

[0050] In one embodiment, whether the network is in a transient congestion state is determined based on the rate and trend of change of link buffer utilization within a preset short period of time and the distribution characteristics of the transmission and reception times of each data packet. If the rate of increase of link buffer utilization within a preset short period of time is detected to be within a preset rate of change, abnormal data packets are identified based on the transmission and reception times, and the number of abnormal data packets is determined. If the rate of increase exceeds a preset rate of change and the number of abnormal data packets exceeds a preset abnormal number threshold, a transient congestion state is determined. The duration of the transient congestion state is statistically analyzed. If the duration exceeds a preset duration range, the current state is considered a predicted congestion state. Alternatively, based on the estimated frame delay times in the data sequence, if the estimated frame delay times show a continuous increasing trend, and the link buffer utilization is higher than a preset link buffer utilization threshold for a relatively long period, it can also be confirmed that the current network is in a predicted congestion state.

[0051] In this embodiment, the system determines whether the current state is transient congestion based on link buffer utilization and the transmission and reception times of each data packet. If transient congestion is present, the duration of the transient congestion is determined. Furthermore, the system determines whether the current state is predicted congestion based on the estimated frame delay time or duration in the data sequence. This method effectively distinguishes different types of congestion states, providing a more accurate basis for formulating subsequent rate adjustment strategies.

[0052] Optionally, the system determines whether the current state is a transient congestion state based on the link buffer utilization and the transmission and reception time of each data packet, including: calculating the frame reception delay and the transmission interval of adjacent data packets based on the transmission and reception time of each data packet, and determining that the current state is a transient congestion state when the link buffer utilization is greater than a preset buffer utilization threshold and the frame reception delay is greater than the transmission interval; or, determining the number of data packets received and the number of data packets sent in the current frame based on the transmission and reception time of each data packet, and determining that the current state is a transient congestion state when the link buffer utilization is greater than a preset buffer utilization threshold and the number of data packets received is less than the number of data packets sent.

[0053] The number of data packets received in the current frame can refer to the total number of data packets that the receiving end has successfully received and acknowledged. The number of data packets sent in the current frame can refer to the total number of data packets that the sending end has actually sent.

[0054] In one embodiment, it is first determined whether the link buffer utilization rate is greater than a preset buffer utilization threshold. If it is not exceeded, the current state is not transient congestion. If the link buffer utilization rate is greater than the preset buffer utilization threshold, it is further determined whether one of the following conditions is met: Based on the transmission and reception times of each data packet, the total number of data packets actually sent by the sending end and the total number of data packets received by the receiving end within a preset time range are determined, and the total number of sent data packets is compared with the total number of received data packets. If the number of received packets is less than the number of sent packets, it is considered that the current frame has not received complete reception feedback; or based on the transmission and reception times of each data packet, the reception time of the last packet and the reception time of the first packet are determined, the time difference between the reception time of the last data packet and the reception time of the first data packet is calculated as the frame reception delay, and the frame reception delay is compared with the frame transmission interval. If the frame reception delay is greater than the frame transmission interval, it is determined that the frame reception delay has timed out. If the link buffer utilization rate is greater than the preset buffer utilization threshold, and the current frame has not received complete reception feedback or the frame reception delay has timed out, the current state is determined to be transient congestion.

[0055] In this embodiment, the frame reception delay and the transmission interval of adjacent data packets are calculated based on the transmission and reception times of each data packet. If the link buffer utilization rate is greater than a preset buffer utilization threshold and the frame reception delay is greater than the transmission interval, the current state is determined to be transient congestion. Alternatively, the number of data packets received and sent in the current frame is determined based on the transmission and reception times of each data packet. If the link buffer utilization rate is greater than a preset buffer utilization threshold and the number of data packets received is less than the number of data packets sent, the current state is determined to be transient congestion. The above schemes can quickly identify the occurrence of transient network congestion by analyzing the relationship between data packet transmission and reception times and link buffer utilization, effectively avoiding misjudgments caused by fluctuations in a single indicator, and improving the accuracy and reliability of network congestion state judgment.

[0056] Figure 4 is a flowchart of a method for predicting congestion state determination provided in an embodiment of this application. As shown in Figure 4, it includes: step S10321, determining the number of rises of adjacent estimated frame delay times in the data sequence and the total number of estimated frame delay times contained in the data sequence, and calculating the rise ratio based on the number of rises and the total number of estimated frame delay times.

[0057] Step S10322: Determine the total increase and total change of the estimated frame delay time in the data sequence, and calculate the upswing efficiency based on the total increase and total change of the estimated frame delay time.

[0058] Step S10323: Determine whether the current state is a predicted congestion state based on the rise ratio, rise efficiency, and estimated delay time of the end frame in the data sequence.

[0059] The rise ratio refers to the percentage of rises in the latency of adjacent frames in the data sequence. Rise efficiency refers to the proportion of the total rise in frame latency to the total change in latency. The total change in estimated frame latency time refers to the sum of the absolute values ​​of the differences in the estimated frame latency times of all adjacent frames in the frame latency data sequence. The final estimated frame latency time refers to the last estimated frame latency time data in the frame latency data sequence.

[0060] In one embodiment, firstly, the number of increases in adjacent estimated frame delay times in the statistical data sequence, and the total number of estimated frame delay times included in the data sequence, are used to calculate the increase ratio = number of increases / (total number - 1). This ratio reflects the overall growth trend of the estimated frame delay times. Then, the increase efficiency is calculated based on the absolute values ​​of the total increase and total change in estimated frame delay times in the data sequence: increase efficiency = total increase in delay time / absolute value of the total change in estimated frame delay times. Finally, considering the increase ratio, increase efficiency, and the final estimated frame delay time in the data sequence, it is determined whether the current network is in a predicted congestion state. If the increase ratio exceeds a preset first ratio threshold, the increase efficiency is greater than or equal to a preset first efficiency threshold, and the final estimated frame delay time is greater than a preset frame delay threshold, then a predicted congestion state can be determined. Alternatively, if the increase ratio is less than or equal to a preset second ratio threshold, the increase efficiency exceeds a preset second efficiency threshold, and the estimated frame delay time is greater than a preset frame delay threshold, then a predicted congestion state can be determined. Here, the first ratio threshold is greater than the second ratio threshold, and the first efficiency threshold is less than the second efficiency threshold. For example, if the first ratio threshold is 0.66, the second ratio threshold is 0.54, the first efficiency threshold is 0.45, the second efficiency threshold is 0.55, and the frame delay threshold is 150ms, then if the estimated frame delay time at the end is higher than 150ms and any preset condition is met, it can be determined that the current state is a predicted congestion state. The preset conditions are: (1) pct>0.66 and pdt≥0.45; (2) pct≥0.54 and pdt>0.55.

[0061] In this embodiment, the rise efficiency is calculated by determining the total increase and total change of the estimated frame delay time in the data sequence, respectively. The rise ratio, rise efficiency, and the estimated frame delay time at the end of the data sequence are then used to determine whether the current state is predicted to be congested. This scheme improves the accuracy of congestion state determination through multi-dimensional analysis of the estimated frame delay time.

[0062] Figure 5 is a schematic diagram of a video bitrate adjustment device provided in an embodiment of this application. As shown in Figure 5, it includes: a parameter acquisition module 21, used to acquire buffer utilization, current video bitrate, data packet transmission and reception time, current time, and transmission status evaluation value; a frame-level statistics module 22, used to calculate a risk value based on the current video bitrate and a preset upper limit bitrate, periodically calculate the link buffer utilization based on the data packet transmission and reception time, and periodically calculate the estimated frame delay time based on the current time and the data packet transmission and reception time; a congestion status determination module 23, used to statistically analyze multiple estimated frame delay times calculated within a preset time range, generate a data sequence corresponding to the estimated frame delay time based on the calculation order, and determine the congestion status based on the link buffer utilization, the data packet transmission and reception time, and the data sequence; a current adjustment strategy determination module 24, used to determine the current adjustment strategy based on the congestion status, the transmission status evaluation value, the risk value, and a preset adjustment rule; and a video bitrate adjustment module 25, used to adjust the current video bitrate based on the current adjustment strategy.

[0063] In this embodiment, by acquiring the buffer utilization rate, current video bitrate, data packet transmission and reception time, current time, and transmission status assessment value, a risk value is calculated based on the current video bitrate and a preset upper limit bitrate. The link buffer utilization rate is periodically calculated based on the data packet transmission and reception time, and the estimated frame delay time is periodically calculated based on the current time and the data packet transmission and reception time. Multiple estimated frame delay times calculated within a preset time range are statistically analyzed, and a data sequence corresponding to the estimated frame delay time is generated based on the calculation order. The congestion state is determined based on the link buffer utilization rate, data packet transmission and reception time, and the data sequence. The current adjustment strategy is determined based on the congestion state, transmission status assessment value, risk value, and preset adjustment rules, and the current video bitrate is adjusted based on the current adjustment strategy. In the above scheme, by calculating the link buffer utilization rate for each frame and periodically calculating the estimated frame delay time, congestion state detection is performed based on the estimated frame delay time, improving the fine-grainedness and timeliness of congestion detection, shortening the bitrate control cycle, and improving the accuracy of bitrate adjustment by jointly determining the adjustment strategy based on the congestion state, transmission status assessment value, and risk value.

[0064] In one possible embodiment, the frame-level statistics module 22 is specifically used to: periodically calculate the time difference between the last data packet reception time and the first data packet transmission time, and the round-trip transmission time of each data packet, based on the data packet transmission and reception time; calculate the frame queuing delay based on the time difference and the round-trip transmission time, and calculate the ratio of the frame queuing delay to the preset frame transmission interval, and determine the ratio as the link buffer utilization rate.

[0065] In one possible embodiment, the congestion state determination module 23 is specifically used to: determine whether the current state is an instantaneous congestion state based on the link buffer utilization and the transmission and reception time of each data packet; and determine whether the current state is a predicted congestion state based on the estimated delay time in each data sequence.

[0066] In one possible embodiment, the congestion state determination module 23 is specifically configured to: determine the number of rises in the estimated frame delay time of adjacent frames in the data sequence and the total number of estimated frame delay times contained in the data sequence; calculate the rise ratio based on the number of rises and the total number of estimated frame delay times; determine the total increase and the total change in estimated frame delay time in the data sequence, respectively; calculate the rise efficiency based on the total increase and the total change in estimated frame delay time; and determine whether the current state is a predicted congestion state based on the rise ratio, the rise efficiency, and the estimated frame delay time at the end of the data sequence.

[0067] In one possible embodiment, the congestion state determination module 23 is specifically configured to: determine the number of rises in the estimated frame delay time of adjacent frames in the data sequence and the total number of estimated frame delay times contained in the data sequence; calculate the rise ratio based on the number of rises and the total number of estimated frame delay times; determine the total increase and the total change in estimated frame delay time in the data sequence, respectively; calculate the rise efficiency based on the total increase and the total change in estimated frame delay time; and determine whether the current state is a predicted congestion state based on the rise ratio, the rise efficiency, and the estimated frame delay time at the end of the data sequence.

[0068] In one possible embodiment, the congestion state determination module 23 is specifically configured to: calculate the frame reception delay and the transmission interval of adjacent data packets based on the transmission and reception times of each data packet; and determine that the current state is an instantaneous congestion state when the link buffer utilization is greater than a preset buffer utilization threshold and the frame reception delay is greater than the transmission interval; or, determine the number of data packets received and the number of data packets sent in the current frame based on the transmission and reception times of each data packet; and determine that the current state is an instantaneous congestion state when the link buffer utilization is greater than a preset buffer utilization threshold and the number of data packets received is less than the number of data packets sent.

[0069] In one possible embodiment, the current adjustment strategy determination module 24 is specifically configured to: compare the transmission state assessment value with the risk value; if the transmission state assessment value is greater than the risk value and the congestion state is a non-congestion state, determine that the current adjustment strategy is to adjust upward by a first adjustment magnitude; if the transmission state assessment value is less than or equal to the risk value and the congestion state is a non-congestion state, determine that the current adjustment strategy is to adjust upward by a second adjustment magnitude, wherein the first adjustment magnitude is greater than the second adjustment magnitude.

[0070] In one possible embodiment, the system further includes a transmission status evaluation value determination module 24, which is specifically used to: acquire multiple network status evaluation indicators; convert the evaluation scores of each network status evaluation indicator based on a preset algorithm to obtain the indicator score value corresponding to each network evaluation indicator; and perform weighted calculation on each indicator score value according to a preset weight coefficient to obtain the transmission status evaluation value.

[0071] This application also provides an electronic device that integrates a video bitrate adjustment apparatus provided in this application. Figure 6 is a schematic diagram of the structure of a video bitrate adjustment apparatus provided in this application. Referring to Figure 6, the video bitrate adjustment apparatus includes: an input device 33, an output device 34, a memory 32, and one or more processors 31; the memory 32 is used to store one or more programs; when one or more programs are executed by one or more processors 31, the one or more processors 31 implement the video bitrate adjustment method provided in the above embodiments. The input device 33, the output device 34, the memory 32, and the processors 31 can be connected via a bus or other means; Figure 6 shows an example of connection via a bus.

[0072] The memory 32, as a computing device readable storage medium, can be used to store software programs, computer-executable programs, and modules, such as the program instructions / modules corresponding to the video bitrate adjustment method provided in any embodiment of this application. The memory 32 may primarily include a program storage area and a data storage area. The program storage area may store the operating system and at least one application program required for a function; the data storage area may store data created based on the use of the device. Furthermore, the memory 32 may include high-speed random access memory and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other non-volatile solid-state storage device. In some instances, the memory 32 may further include memory remotely located relative to the processor 31, and these remote memories can be connected to the device via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.

[0073] Input device 33 can be used to receive input digital or character information, and to generate key signal inputs related to user settings and function control of the device. Output device 34 may include display devices such as a display screen.

[0074] The processor 31 executes various functional applications and data processing of the device by running software programs, instructions and modules stored in the memory 32, thereby realizing the video bitrate adjustment method described above.

[0075] The video bitrate adjustment apparatus, device, and computer provided above can be used to execute the video bitrate adjustment method provided in any of the above embodiments, and have corresponding functions and beneficial effects.

[0076] This application embodiment also provides a storage medium for storing computer-executable instructions. When executed by a computer processor, the computer-executable instructions are used to execute the video bitrate adjustment method provided in the above embodiment. The video bitrate adjustment method includes: obtaining buffer utilization, current video bitrate, data packet transmission and reception time, current time, and transmission status evaluation value; calculating a risk value based on the current video bitrate and a preset upper limit bitrate; periodically calculating link buffer utilization based on the data packet transmission and reception time; periodically calculating estimated frame delay time based on the current time and the data packet transmission and reception time; statistically analyzing multiple estimated frame delay times calculated within a preset time range, and generating a data sequence corresponding to the estimated frame delay time based on the calculation order; determining a congestion state based on the link buffer utilization, the data packet transmission and reception time, and the data sequence; determining a current adjustment strategy based on the congestion state, the transmission status evaluation value, the risk value, and a preset adjustment rule; and adjusting the current video bitrate based on the current adjustment strategy.

[0077] Storage medium – any type of memory device or storage device. The term “storage medium” is intended to include: mounting media, such as CD-ROMs, floppy disks, or magnetic tape devices; computer system memory or random access memory, such as DRAM, DDR RAM, SRAM, EDO RAM, Rambus RAM, etc.; non-volatile memory, such as flash memory, magnetic media (e.g., hard disks or optical storage); registers or other similar types of memory elements, etc. Storage media may also include other types of memory or combinations thereof. Furthermore, storage media may reside in a first computer system in which a program is executed, or may reside in a different second computer system connected to the first computer system via a network (such as the Internet). The second computer system can provide program instructions to the first computer for execution. The term “storage medium” can include two or more storage media that may reside in different locations (e.g., in different computer systems connected via a network). Storage media may store program instructions (e.g., specifically implemented as a computer program) executable by one or more processors.

[0078] Of course, the storage medium for storing computer-executable instructions provided in the embodiments of this application is not limited to the video bitrate adjustment method described above, but can also perform related operations in the video bitrate adjustment method provided in any embodiment of this application.

[0079] The video bitrate adjustment apparatus, device, and storage medium provided in the above embodiments can execute the video bitrate adjustment method provided in any embodiment of this application. For technical details not described in detail in the above embodiments, please refer to the video bitrate adjustment method provided in any embodiment of this application.

[0080] The above description is merely a preferred embodiment and the technical principles employed in this application. This application is not limited to the specific embodiments described herein, and various obvious changes, readjustments, and substitutions that can be made by those skilled in the art will not depart from the scope of protection of this application. Therefore, although this application has been described in detail through the above embodiments, this application is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of this application, the scope of which is determined by the scope of the claims.

Claims

1. A video bitrate adjustment method, characterized in that, include: Obtain the cache utilization rate, current video bitrate, data packet transmission and reception time, current time, and transmission status evaluation value; calculate the risk value based on the current video bitrate and the preset upper limit bitrate. The link buffer utilization rate is periodically calculated based on the transmission and reception time of each data packet, and the estimated frame delay time is periodically calculated based on the current time and the transmission and reception time of each data packet. The system calculates multiple estimated frame delay times within a preset time range, generates a data sequence corresponding to the estimated frame delay times based on the calculation order, determines the congestion state based on the link buffer utilization, the data packet transmission and reception time, and the data sequence, determines the current adjustment strategy based on the congestion state, the transmission state evaluation value, the risk value, and preset adjustment rules, and adjusts the current video bitrate based on the current adjustment strategy.

2. The video bitrate adjustment method according to claim 1, characterized in that, The step of periodically calculating the link buffer utilization based on the transmission and reception times of each data packet includes: periodically calculating the time difference between the reception time of the last data packet and the transmission time of the first data packet, as well as the round-trip transmission time of each data packet; calculating the frame queuing delay based on the time difference and the round-trip transmission time of each data packet, and calculating the ratio of the frame queuing delay to the preset frame transmission interval, and determining the ratio as the link buffer utilization.

3. The video bitrate adjustment method according to claim 1, characterized in that, The step of determining the congestion state based on the link buffer utilization, the data packet transmission and reception time, and the data sequence includes: determining whether the current state is an instantaneous congestion state based on the link buffer utilization and the data packet transmission and reception time; and determining whether the current state is a predicted congestion state based on the estimated delay time in the data sequence.

4. The video bitrate adjustment method according to claim 3, characterized in that, The step of determining whether the current state is a predicted congestion state based on the estimated delay times in the data sequence includes: determining the number of rises of adjacent estimated frame delay times in the data sequence and the total number of estimated frame delay times in the data sequence; calculating the rise ratio based on the number of rises and the total number of estimated frame delay times; determining the total increase and the total change of estimated frame delay times in the data sequence; calculating the rise efficiency based on the total increase and the total change of estimated frame delay times; and determining whether the current state is a predicted congestion state based on the rise ratio, the rise efficiency, and the estimated delay time at the end of the data sequence.

5. The video bitrate adjustment method according to claim 3, characterized in that, The step of determining whether the current state is a momentary congestion state based on the link buffer utilization and the transmission and reception times of each data packet includes: calculating the frame reception delay and the transmission interval of adjacent data packets based on the transmission and reception times of each data packet; and determining that the current state is a momentary congestion state when the link buffer utilization is greater than a preset buffer utilization threshold and the frame reception delay is greater than the transmission interval; or, determining the number of data packets received and the number of data packets sent in the current frame based on the transmission and reception times of each data packet; and determining that the current state is a momentary congestion state when the link buffer utilization is greater than a preset buffer utilization threshold and the number of data packets received is less than the number of data packets sent.

6. The video bitrate adjustment method according to claim 1, characterized in that, The step of determining the current adjustment strategy based on the congestion state, the transmission state assessment value, the risk value, and the preset adjustment rules includes: comparing the transmission state assessment value with the risk value; if the transmission state assessment value is greater than the risk value and the congestion state is non-congestion, determining the current adjustment strategy to adjust upward by a first adjustment magnitude; if the transmission state assessment value is less than or equal to the risk value and the congestion state is non-congestion, determining the current adjustment strategy to adjust upward by a second adjustment magnitude, wherein the first adjustment magnitude is greater than the second adjustment magnitude.

7. The video bitrate adjustment method according to any one of claims 1-6, characterized in that, Before obtaining the cache utilization rate, current video bitrate, data packet transmission and reception time, current time, and transmission status evaluation value, the method further includes: obtaining multiple network status evaluation indicators; converting the evaluation scores of each network status evaluation indicator based on a preset algorithm to obtain the indicator score value corresponding to each network evaluation indicator; and performing weighted calculation on each indicator score value according to a preset weight coefficient to obtain the transmission status evaluation value.

8. A video bitrate adjustment device, characterized in that, include: The parameter acquisition module is used to obtain buffer utilization, current video bitrate, data packet transmission and reception time, current time, and transmission status evaluation value. The frame-level statistics module is used to calculate the risk value based on the current video bitrate and the preset upper limit bitrate, periodically calculate the link buffer utilization based on the transmission and reception time of each data packet, and periodically calculate the estimated frame delay time based on the current time and the transmission and reception time of each data packet. The congestion state determination module is used to statistically analyze multiple estimated frame delay times calculated within a preset time range, generate a data sequence corresponding to the estimated frame delay times based on the calculation order, and determine the congestion state according to the link buffer utilization, the data packet transmission and reception time, and the data sequence; the current adjustment strategy determination module is used to determine the current adjustment strategy according to the congestion state, the transmission state evaluation value, the risk value, and preset adjustment rules. The video bitrate adjustment module is used to adjust the current video bitrate based on the current adjustment strategy.

9. An electronic device, characterized in that, The device includes: one or more processors; and a storage device for storing one or more programs, which, when executed by the one or more processors, cause the one or more processors to implement the video bitrate adjustment method as described in any one of claims 1-7.

10. A storage medium for storing computer-executable instructions, characterized in that, The computer-executable instructions, when executed by a computer processor, are used to perform the video bitrate adjustment method as described in any one of claims 1-7.