Method and device for adaptive adjustment of network bandwidth of set-top box and storage medium

CN122554669BActive Publication Date: 2026-09-11深圳市微浦技术有限公司
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202611041511.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-07-14
Publication Date
2026-09-11
Estimated Expiration
2046-07-14

AI Technical Summary

Technical Problem

[0005]本申请的主要目的在于提供一种机顶盒网络带宽自适应调节方法、设备及存储介质,旨在解决如何降低码率切换频次,提升播放稳定性的技术问题

Benefits of technology

[0016] This application provides a set-top box network bandwidth adaptive adjustment method applied to the sending end. The sending end obtains the download rate measurement value sent by the receiving end and stores the download rate measurement value in a sliding window buffer. Based on the historical measurement values ​​in the sliding window buffer, the available bandwidth prediction value for the next measurement period is predicted through a preset smoothing algorithm. Then, based on the comparison result between the available bandwidth prediction value and the current token generation rate, a new token generation rate is determined according to a preset speed-changing rule. Furthermore, the actual packet sending rate is determined based on the new token generation rate, and data packets are sent to the receiving end according to the actual packet sending rate.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122554669B_ABST
    Figure CN122554669B_ABST
Patent Text Reader

Abstract

The application discloses a set-top box network bandwidth self-adaptive adjusting method and device and a storage medium, and relates to the technical field of adaptive transmission. In the method, a sending end obtains a download rate measurement value sent by a receiving end and stores the download rate measurement value in a sliding window buffer area; based on historical measurement values in the sliding window buffer area, a preset smoothing algorithm is used to predict an available bandwidth prediction value of a next measurement period; then, according to a comparison result of the available bandwidth prediction value and a current token generation rate, a new token generation rate is determined according to a preset variable speed rule; further, an actual packet sending rate is determined according to the new token generation rate, and data packets are sent to the receiving end according to the actual packet sending rate; the actual packet sending rate is constrained based on a token bucket mechanism, bandwidth short-time violent oscillation is smoothed, bandwidth instantaneous mutation is avoided, unnecessary code rate rising and falling frequency is reduced, and the stability of long-time set-top box streaming media playing is improved as a whole.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of adaptive transmission technology, and in particular to a method, device and storage medium for adaptive adjustment of network bandwidth in set-top boxes. Background Technology

[0002] Most current set-top box streaming media adaptive playback solutions employ a bitrate adjustment mechanism, whereby the receiving end dynamically switches between different video bitrate levels to match network transmission capacity by detecting available network bandwidth in real time, thus avoiding playback stuttering.

[0003] However, in actual home networking environments, factors such as multiple terminals competing for traffic on the local area network, wireless signal interference, and transmission link congestion can easily cause frequent and violent fluctuations in available bandwidth. Even small fluctuations in bandwidth can frequently trigger bitrate switching, resulting in fluctuating clarity and poor visual experience, leading to poor media playback stability.

[0004] The above content is only used to help understand the technical solution of this application and does not represent an admission that the above content is prior art. Summary of the Invention

[0005] The main purpose of this application is to provide a method, device and storage medium for adaptive adjustment of network bandwidth in a set-top box, which aims to solve the technical problem of how to reduce the frequency of bitrate switching and improve playback stability.

[0006] To achieve the above objectives, this application proposes a set-top box network bandwidth adaptive adjustment method, applied at the transmitting end, the set-top box network bandwidth adaptive adjustment method comprising: Obtain the download speed measurement value sent by the receiving end, and store the download speed measurement value in the sliding window buffer; Based on the historical measurement values ​​in the sliding window buffer, the available bandwidth prediction value for the next measurement cycle is predicted using a preset smoothing algorithm. Based on the comparison between the predicted available bandwidth and the current token generation rate, a new token generation rate is determined according to a preset speed-changing rule; The actual packet sending rate is determined based on the new token generation rate, and data packets are sent to the receiving end according to the actual packet sending rate.

[0007] In one embodiment, the set-top box network bandwidth adaptive adjustment method further includes: The maximum value of the historical token generation rate is determined, and the amount of data corresponding to a preset multiple of the maximum value is used as the capacity of the token bucket of the sending end; wherein, after the sending end obtains a number of tokens equal to the amount of data to be sent from the token bucket, it sends a data packet to the receiving end.

[0008] In one embodiment, the step of predicting the available bandwidth for the next measurement period based on historical measurement values ​​within the sliding window buffer using a preset smoothing algorithm includes: Obtain the download rate measurement value for the current measurement period, and obtain the horizontal component and trend component of the previous measurement period from the sliding window cache; The download speed measurement value of the current measurement period is weighted and averaged with the predicted baseline value of the previous measurement period by a preset first smoothing coefficient to obtain the horizontal component of the current measurement period. By using a preset second smoothing coefficient, the horizontal component of the current measurement period and the trend component of the previous measurement period are weighted and averaged to obtain the trend component of the current measurement period. The sum of the horizontal component and the trend component of the current measurement period is used as the predicted available bandwidth for the next measurement period.

[0009] In one embodiment, the step of determining a new token generation rate according to a preset speed-changing rule based on a comparison between the predicted available bandwidth and the current token generation rate includes: When the predicted available bandwidth is greater than a preset first multiple of the current token generation rate, the current token generation rate is incremented at a first rate to obtain the new token generation rate, wherein the increment is less than or equal to a first limit. When the predicted available bandwidth is less than a preset second multiple of the current token generation rate, the current token generation rate is reduced by a second rate to obtain the new token generation rate, wherein the single reduction amount is less than or equal to the second limit, the second rate is greater than the first rate, and the first limit is less than the second limit.

[0010] In one embodiment, after determining a new token generation rate according to a preset speed-changing rule based on the comparison result between the available bandwidth prediction value and the current token generation rate; The new token generation rate is sent to the receiving end so that the receiving end can determine the available bandwidth based on the new token generation rate and the locally measured instantaneous download rate, and determine the target bitrate based on the available bandwidth.

[0011] In one embodiment, the set-top box network bandwidth adaptive adjustment method is applied at the receiving end and includes the following steps: Upon receiving the new token generation rate sent by the sending end, the instantaneous download rate is obtained; The fusion weight corresponding to the new token generation rate is determined based on the difference between the new token generation rate and the instantaneous download rate, and the fusion weight is proportional to the difference. Based on the fusion weight, the new token generation rate and the instantaneous download rate are weighted and fused to obtain the available bandwidth; The target bitrate is determined based on the available bandwidth, and the target bitrate is proportional to the available bandwidth.

[0012] In one embodiment, the step of determining the target bit rate based on the available bandwidth includes: Based on a preset bandwidth status mapping rule, the available bandwidth is mapped to candidate bandwidth status; When the candidate bandwidth state is different from the bandwidth state of the previous measurement period, the bandwidth difference between the available bandwidth and the available bandwidth of the previous measurement period is determined. When the bandwidth difference is greater than a preset threshold, the candidate bandwidth state is taken as the current bandwidth state; The highest bitrate in the bitrate policy range corresponding to the current bandwidth state is taken as the target bitrate, so that the receiving end gradually switches the current bitrate to the target bitrate according to a preset step size.

[0013] In one embodiment, after the step of determining the target bit rate based on the available bandwidth, the method further includes: The fluctuation correction coefficient is determined based on the ratio of the standard deviation to the mean of the historical available bandwidth within the most recent preset quantity measurement period; Determine the amount of data to be played in the buffer, and determine the buffer correction coefficient based on the ratio of the amount of data to be played to the maximum capacity of the buffer; The product of the fluctuation correction coefficient, the cache correction coefficient, and the available bandwidth is taken as the corrected available bandwidth; When the corrected available bandwidth is greater than the next level bitrate value of the current bitrate, and the amount of data to be played is greater than the preset upgrade threshold, the target bitrate is increased. When the available bandwidth is less than the currently used bitrate and the amount of data to be played is less than the preset upsampling threshold, the target bitrate is reduced.

[0014] In addition, to achieve the above objectives, this application also proposes a set-top box network bandwidth adaptive adjustment device, the device comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the steps of the set-top box network bandwidth adaptive adjustment method as described above.

[0015] In addition, to achieve the above objectives, this application also proposes a storage medium, which is a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, it implements the steps of the set-top box network bandwidth adaptive adjustment method described above.

[0016] This application provides a set-top box network bandwidth adaptive adjustment method applied to the sending end. The sending end obtains the download rate measurement value sent by the receiving end and stores the download rate measurement value in a sliding window buffer. Based on the historical measurement values ​​in the sliding window buffer, the available bandwidth prediction value for the next measurement period is predicted through a preset smoothing algorithm. Then, based on the comparison result between the available bandwidth prediction value and the current token generation rate, a new token generation rate is determined according to a preset speed-changing rule. Furthermore, the actual packet sending rate is determined based on the new token generation rate, and data packets are sent to the receiving end according to the actual packet sending rate.

[0017] The above method is deployed at the streaming media transmitter. It first collects download speed measurement data reported by the receiver and stores it in a sliding window cache, retaining multiple sets of historical speed samples. A smoothing algorithm is used to process the historical data within the window to predict the available bandwidth for the next measurement cycle, reducing bandwidth misjudgments caused by instantaneous throughput fluctuations. Instead of directly switching the bitrate based on instantaneous bandwidth, it compares the predicted bandwidth value with the current token generation rate and updates the token rate according to preset speed-up rules. Based on the token bucket mechanism, it constrains the actual packet sending rate, smoothing out short-term, drastic bandwidth fluctuations. This avoids sudden bandwidth changes caused by sudden traffic spikes or wireless interference, reduces unnecessary bitrate increases and decreases, suppresses frequent image quality jumps, improves the viewing experience, stabilizes the packet sending rhythm at the transmitter, alleviates transmission link congestion, and overall improves the stability of long-term streaming media playback on the set-top box. Attached Figure Description

[0018] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.

[0019] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0020] Figure 1 This is a flowchart illustrating an embodiment of the adaptive adjustment method for set-top box network bandwidth in this application. Figure 2 This is a flowchart illustrating Embodiment 2 of the set-top box network bandwidth adaptive adjustment method of this application; Figure 3 This is a flowchart illustrating Embodiment 3 of the set-top box network bandwidth adaptive adjustment method of this application; Figure 4 This is a schematic diagram of the hardware operating environment involved in the set-top box network bandwidth adaptive adjustment method in this embodiment of the application.

[0021] The purpose, features, and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation

[0022] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of this application and are not intended to limit this application.

[0023] To better understand the technical solution of this application, a detailed description will be provided below in conjunction with the accompanying drawings and specific embodiments. It should be noted that all actions involving the acquisition of signals, information, or data in this application are performed in accordance with the relevant data protection laws and regulations of the country where the application is located, and with authorization from the owner of the corresponding device.

[0024] Currently, adaptive playback of streaming media on set-top boxes generally adopts a dynamic bitrate adjustment scheme: the terminal detects the available network bandwidth in real time and automatically switches between multiple video bitrate levels based on the network throughput capacity to match real-time transmission conditions, effectively alleviating problems such as playback stuttering and frequent buffering. This function is based on the Adaptive Bit Rate (ABR) algorithm, with typical examples including BOLA (Buffer Occupancy based Lyapunov Algorithm) based on throughput estimation and DASH Throughput algorithm based on buffer occupancy threshold. All these algorithms rely on playback status feedback data reported by the receiving end to calculate real-time network bandwidth and make intelligent bitrate switching decisions.

[0025] However, in real-world home networking environments, factors such as multiple devices sharing the same bandwidth (e.g., mobile phones, tablets, TVs, and computers) can cause fluctuations in available bandwidth. Wireless signal interference, such as Wi-Fi signal attenuation, co-channel interference, and channel contention, can cause instantaneous throughput jitter. Furthermore, transmission link congestion can lead to severe fluctuations in available bandwidth. These bandwidth fluctuations frequently trigger bitrate switching, resulting in inconsistent image clarity, poor visual quality, and ultimately, unstable media playback.

[0026] In view of the above problems, this application proposes a set-top box network bandwidth adaptive adjustment method, applied to the sending end. The sending end obtains the download rate measurement value sent by the receiving end and stores the download rate measurement value in a sliding window buffer. Based on the historical measurement values ​​in the sliding window buffer, the available bandwidth prediction value for the next measurement period is predicted through a preset smoothing algorithm. Then, based on the comparison result between the available bandwidth prediction value and the current token generation rate, a new token generation rate is determined according to a preset speed-changing rule. Furthermore, the actual packet sending rate is determined based on the new token generation rate, and data packets are sent to the receiving end according to the actual packet sending rate.

[0027] The above method is deployed at the streaming media transmitter. It first collects download speed measurement data reported by the receiver and stores it in a sliding window cache, retaining multiple sets of historical speed samples. A smoothing algorithm is used to process the historical data within the window to predict the available bandwidth for the next measurement cycle, reducing bandwidth misjudgments caused by instantaneous throughput fluctuations. Instead of directly switching the bitrate based on instantaneous bandwidth, it compares the predicted bandwidth value with the current token generation rate and updates the token rate according to preset speed-up rules. Based on the token bucket mechanism, it constrains the actual packet sending rate, smoothing out short-term, drastic bandwidth fluctuations. This avoids sudden bandwidth changes caused by sudden traffic spikes or wireless interference, reduces unnecessary bitrate increases and decreases, suppresses frequent image quality jumps, improves the viewing experience, stabilizes the packet sending rhythm at the transmitter, alleviates transmission link congestion, and overall improves the stability of long-term streaming media playback on the set-top box.

[0028] It should be noted that the executing entity in this embodiment can be a computing service device with data processing, network communication and program running functions, such as a tablet computer, personal computer or mobile phone, or an electronic device and server capable of realizing the above functions.

[0029] Example 1 This application provides an embodiment of a set-top box network bandwidth adaptive adjustment method, applied to the transmitting end, as described in the following example. Figure 1 In this embodiment, the set-top box network bandwidth adaptive adjustment method includes steps S10 to S40: Step S10: Obtain the download speed measurement value sent by the receiving end, and store the download speed measurement value in the sliding window buffer.

[0030] The download rate measurement is the instantaneous throughput calculated by the receiving end in each measurement cycle based on the ratio of the actual number of data bytes received to the duration of the measurement cycle. The unit can be bits per second or kilobits per second. The sliding window buffer is a first-in, first-out storage area maintained by the sending end, used to store the download rate measurement values ​​sent by the receiving end in the most recent measurement cycles. The window length is fixed at a preset N measurement cycles.

[0031] For example, at the end of each fixed measurement period, the receiving end counts the total number of bytes successfully received from the network interface during that measurement period, divides this total number of bytes by the duration of the measurement period, and obtains the download speed measurement value for that measurement period. The receiving end encapsulates this download speed measurement value in a feedback message, such as an RTCP APP message or a custom HTTP header extension field, and sends it to the sending end via a transport layer protocol. After receiving the feedback message, the sending end parses it to obtain the download speed measurement value for the current measurement period. The sending end maintains a sliding window buffer of length N, which stores the download speed measurement values ​​of the most recent N measurement periods in a queue. The sending end inserts newly received download speed measurement values ​​at the end of the sliding window buffer; if the sliding window buffer is full, it removes the oldest download speed measurement value and then adds the new value, thus always ensuring that the sliding window buffer stores the download speed measurement values ​​of the most recent N measurement periods.

[0032] Step S20: Based on the historical measurement values ​​in the sliding window buffer, predict the available bandwidth for the next measurement period using a preset smoothing algorithm.

[0033] Historical measurements are download rate measurements from previous measurement periods stored in the sliding window cache.

[0034] Understandably, in a home network environment, the instantaneous download speed measured at the receiving end is affected by multiple factors such as multi-device contention, wireless interference, and TCP (Transmission Control Protocol) window congestion, exhibiting significant random jitter and short-term spikes. If such noisy instantaneous values ​​are directly used as input to the adaptive bitrate algorithm, the bandwidth estimate will fluctuate frequently with the noise, causing repeated bitrate switching, resulting in inconsistent image clarity and severely impacting the user's viewing experience. However, by processing historical download speed measurements using a smoothing algorithm to obtain a smooth and trend-reflecting predicted available bandwidth value, the sending end can pre-adjust the new token generation rate before actual bandwidth changes occur, thereby reducing false bitrate switching due to delayed responses. Simultaneously, this predicted available bandwidth value serves as the basis for subsequent adjustments to the new token generation rate, reducing the noise level of the bandwidth observation at the source, making the changes in the new token generation rate smoother. This indirectly reduces the bandwidth input jitter faced by the receiver's adaptive bitrate algorithm, significantly reducing the frequency of bitrate switching and improving image quality stability.

[0035] Furthermore, the above smoothing algorithm can employ double exponential smoothing, wherein step S20 includes steps S21 to S24: Step S21: Obtain the download rate measurement value of the current measurement period, and obtain the horizontal component and trend component of the previous measurement period from the sliding window cache.

[0036] For example, the sending end retrieves the download rate measurement value Rm(t) for the current measurement period from the sliding window buffer, and simultaneously reads the horizontal component L(t) calculated and stored in the previous measurement period from the internal memory. 1) and trend component T(t) 1) If this is the first measurement cycle, initialize the horizontal component to the current download speed measurement value and initialize the trend component to 0.

[0037] The horizontal component represents the baseline estimate of the available bandwidth for the current measurement period. It represents the steady-state center of the bandwidth after eliminating instantaneous random jitter, and is the result of a weighted fusion of the download speed measurement for the current period and the predicted baseline value for the previous measurement period. If the available bandwidth is viewed as a curve fluctuating around the true value, the horizontal component is the "center line" of that curve. It moves slowly following the changes in the true bandwidth, but does not fluctuate drastically due to peaks or dips in a single measurement.

[0038] The trend component characterizes the slope of change in available bandwidth, indicating whether the bandwidth is continuously increasing or decreasing relative to the previous measurement period, and the rate of change. It is the result of a weighted fusion of the difference between the horizontal components of adjacent measurement periods and the trend component of the previous measurement period. The trend component is equivalent to the "tangent slope" of the bandwidth curve; a positive value indicates an upward trend in bandwidth, while a negative value indicates a downward trend, and the absolute value indicates the strength of the trend. When bandwidth continues to decrease due to preemption by other devices, the trend component becomes negative, causing the predicted value to be adjusted downward in advance; when bandwidth continues to improve, the trend component remains positive, guiding the predicted value to rise steadily.

[0039] Step S22: The download speed measurement value of the current measurement period and the predicted baseline value of the previous measurement period are weighted and averaged using a preset first smoothing coefficient to obtain the horizontal component of the current measurement period.

[0040] For example, the transmitting end transmits the horizontal component L(t) from the previous measurement period. 1) with trend component T(t) 1) Add them together to obtain the predicted baseline value L(t) for the previous measurement period. 1)+T(t 1). Then, using a preset first smoothing coefficient α, the download rate measurement value Rm(t) of the current measurement period is weighted and averaged with the predicted baseline value to obtain the horizontal component L(t) of the current measurement period:

[0041] This horizontal component represents the baseline estimate of the available bandwidth for the current measurement period. Its function is to filter out instantaneous noise and make the estimate closer to the true steady state of the bandwidth.

[0042] Step S23: Using a preset second smoothing coefficient, the horizontal component of the current measurement period and the trend component of the previous measurement period are weighted and averaged to obtain the trend component of the current measurement period.

[0043] For example, the transmitting end calculates the change L(t) of the horizontal component in the current measurement period relative to the horizontal component in the previous measurement period. L(t 1), and then using the preset second smoothing coefficient β, the trend component T(t) of this change relative to the previous measurement period. 1) Perform a weighted average to obtain the trend component T(t) for the current measurement period:

[0044] This trend component characterizes the slope of change in available bandwidth, used to sense whether bandwidth is in a continuous upward or downward phase.

[0045] Step S24: The sum of the horizontal component and the trend component of the current measurement period is used as the predicted available bandwidth value for the next measurement period.

[0046] For example, the transmitting end adds the horizontal component L(t) and the trend component T(t) of the current measurement period to obtain the predicted available bandwidth for the next measurement period. (t+1):

[0047] Meanwhile, the transmitting end stores the horizontal component L(t) and trend component T(t) calculated in the current measurement cycle into its internal memory as the historical state for the next measurement cycle.

[0048] In addition to the double exponential smoothing mentioned above, the Kalman filter algorithm or the Holt-Winters exponential smoothing method can also be used to smooth and predict the historical measurements in the sliding window buffer to obtain the above-mentioned available bandwidth prediction value.

[0049] Step S30: Based on the comparison result between the available bandwidth prediction value and the current token generation rate, determine the new token generation rate according to the preset speed change rule.

[0050] The current token generation rate is the actual token bucket generation rate used by the sender during the current measurement period, denoted as . (t), used to control the long-term average rate of packet transmission at the sending end. The new token generation rate is the token bucket generation rate to be used in the next measurement period after adjustment in this step, denoted as . (t+1).

[0051] In the token bucket algorithm, a token is a virtual counting credential. Each token represents a fixed-size data transmission permission, typically corresponding to one byte or a preset data unit, such as an Ethernet frame. The token bucket is the container that maintains tokens, and includes two parameters: the token generation rate and the bucket capacity. The token generation rate determines how many new tokens the token bucket generates per second, i.e., the long-term average transmission rate allowed by the sender; the bucket capacity limits the maximum number of tokens that can accumulate in the token bucket, i.e., how many transmission permissions the sender can store during idle periods for subsequent short bursts.

[0052] The token bucket works as follows: It continuously generates tokens based on the token generation rate and stores them in the bucket, with the number of tokens in the bucket never exceeding a preset capacity limit. When the application layer at the sending end has a data packet to send, it first checks if there are enough tokens in the bucket. If so, it deducts a number of tokens equal to the size of the data packet from the bucket and then sends the data packet to the network interface. If there are not enough tokens, the data packet must wait in the sending queue until the token bucket accumulates enough tokens before it can be sent.

[0053] Furthermore, when the predicted available bandwidth is greater than a preset first multiple of the current token generation rate, the current token generation rate is incremented at a first rate to obtain a new token generation rate.

[0054] For example, if the preset first multiple is represented by δ1, the sending end determines Is (t+1) greater than (t)×(1+δ1). If this condition is met, the predicted available bandwidth is determined to be significantly higher than the current token generation rate, and the system enters increment mode. In increment mode, the sender increments the current token generation rate at a preset first rate, with each increment not exceeding a first limit. The increment process continues until either condition 1 or condition 2 is met, at which point it stops: Condition 1: The predicted available bandwidth is less than or equal to the product of the current token generation rate and a preset first multiple, i.e. (t+1)≤ (t)×(1+δ1) indicates that the token generation rate has caught up with the predicted value and there is no need to continue to increase it; Condition 2: The current token generation rate has reached the preset global limit. This upper limit is a preset multiple of the highest bitrate of the video or the capacity of the network bottleneck, to prevent the token generation rate from increasing indefinitely.

[0055] After the increment is complete, the sender will use the incremented token generation rate as the new token generation rate. (t+1).

[0056] When the predicted available bandwidth is less than a preset second multiple of the current token generation rate, the current token generation rate is reduced by the second rate to obtain a new token generation rate.

[0057] For example, if the preset first multiple is represented by δ2, the sending end determines Is (t+1) less than (t)×(1 δ2). If this condition is met, the predicted available bandwidth is determined to be significantly lower than the current token generation rate, and the system enters a decreasing mode.

[0058] In decrement mode, the sender decreases the current token generation rate at a preset second rate, with each decrease not exceeding the second limit. The decrement process continues until either of the following termination conditions 3 and 4 is met: Condition 3: The predicted available bandwidth is greater than or equal to the product of the current token generation rate and a preset second multiple, i.e. (t+1)≥ (t)×(1 δ2) indicates that the token generation rate has dropped to near the predicted value and does not need to continue to decrease; Condition 4: The current token generation rate has reached the preset global lower limit. This lower limit is the lowest bitrate level for video to prevent an excessive drop in token generation rate from affecting basic transmission capabilities.

[0059] After the reduction is complete, the sender will use the reduced token generation rate as the new token generation rate. (t+1).

[0060] like (t)×(1 δ2)≤ (t+1)≤ If (t)×(1+δ1), then the predicted available bandwidth is determined to be within a reasonable fluctuation range of the current token generation rate, and no adjustment is needed. The sender directly uses the current token generation rate as the new token generation rate, i.e. (t+1)= (t).

[0061] Wherein, the single increment is less than or equal to the first limit; the single decrement is less than or equal to the second limit; the second rate is greater than the first rate; and the first limit is less than the second limit.

[0062] The second rate being greater than the first rate means that the step size of each adjustment during decrement is greater than that during increment, allowing the token generation rate to contract more quickly when bandwidth decreases, avoiding link overflow due to slow response. The first limit being less than the second limit means that the maximum adjustment range of a single increment operation is less than the maximum adjustment range of a single decrement operation, further limiting the rate of increase while allowing for more decisive adjustments during decrease.

[0063] In home network environments, instantaneous spikes in available bandwidth are often not a true increase in bandwidth capacity, but rather a false spike caused by accidental factors such as other devices pausing downloads, the fading of Wi-Fi interference measurement periods, or a brief rebound in the TCP congestion window. These false spikes are usually short-lived. If the sender increases the token generation rate too quickly to keep up, it will be forced to revert after the false spike subsides, causing unnecessary fluctuations in the token generation rate itself. This leads to increased jitter in the download rate measured by the receiver, ultimately affecting the adaptive bitrate stage and inducing invalid bitrate switching. By setting a smaller initial rate and a smaller initial limit, the token generation rate increases slowly as the bandwidth prediction rises. Combined with a higher trigger threshold, this ensures that only sustained and significant bandwidth improvements trigger the incrementing operation, effectively filtering out interference from instantaneous false spikes and reducing bitrate switching errors caused by chasing noise at the source.

[0064] Unlike bandwidth increases, a sudden drop in available bandwidth in a home network is usually caused by other devices substantially preempting bandwidth resources, such as starting 4K video playback, initiating cloud backup or game downloads, or increased wireless interference. This type of drop often has a certain degree of persistence. If the sender reduces the token generation rate at a slower rate, it will still send packets at a rate higher than the actual available bandwidth during the period when bandwidth is preempted. This leads to link buffer overflow and TCP packet loss retransmission, which in turn causes a further drop in the download speed measured by the receiver, ultimately forcing the adaptive bitrate algorithm to perform a larger downgrade operation. By setting a larger second rate and a larger second limit, the token generation rate is reduced decisively when the bandwidth prediction value decreases. This allows the sender to yield before the link overflows, avoiding TCP jitter induced by its own aggressive packet sending, thus maintaining a relatively stable download speed measured by the receiver and reducing the probability of the adaptive bitrate algorithm being forced to downgrade.

[0065] Step S40: Determine the actual packet sending rate based on the new token generation rate, and send data packets to the receiving end according to the actual packet sending rate.

[0066] When the application layer at the sending end has media data to be sent, the sending end first obtains the size of the data packet to be sent, and then checks whether the current number of tokens in the token bucket is not less than the size of the data packet to be sent. If the number of tokens is sufficient, the sending end deducts a number of tokens equal to the size of the data packet to be sent from the bucket, and sends the data packet to the network interface; if the number of tokens is insufficient, the data packet to be sent is placed in the sending queue to wait until the token bucket accumulates a sufficient number of tokens, then the tokens are deducted and the data packet is sent.

[0067] Through this mechanism, the actual packet sending rate allows for short-term bursts at the micro level. That is, when the application layer has no data to send temporarily, the token bucket continuously accumulates tokens. When a burst of data arrives, the sender can use the accumulated tokens in the bucket to send multiple data packets at once, making the instantaneous sending rate temporarily higher than the token generation rate. However, at the macro level, the long-term average of the actual packet sending rate is limited by the token generation rate. (t+1), and will not continuously exceed this rate. This characteristic avoids the sending end from impacting network bottlenecks or inducing TCP packet loss and retransmission due to uncontrolled bursts, while retaining the instantaneous capability required for discrete video block transmission. This reduces the variance of the download rate Rm(t) measured by the receiving end at the source, providing a smoother input for subsequent adaptive bitrate, thereby reducing the frequency of bitrate switching and improving playback stability and user experience.

[0068] As a preferred option, the token bucket capacity can be determined as follows: determine the maximum value of the historical token generation rate, and use the amount of data corresponding to a preset multiple of the maximum value as the token bucket capacity of the sending end.

[0069] For example, the sending end maintains a sliding window to record the historical values ​​of all newly determined token generation rates within a preset time period. After completing step S30 above in each measurement cycle, the sending end extracts the maximum value of the historical token generation rate from the sliding window. Then, it multiplies the preset multiple of the time period by the maximum value, and the resulting data volume is used as the token bucket capacity for the current measurement cycle.

[0070] Since the maximum value of the historical token generation rate is a slowly varying parameter, it is only updated when a higher token generation rate occurs and will not decrease immediately as the current rate decreases. Therefore, the token bucket capacity will not change frequently with the instantaneous fluctuations of the token generation rate in each measurement cycle.

[0071] Optionally, as an alternative implementation, after the sending end determines the new token generation rate, it can send the new token generation rate to the receiving end, so that the receiving end can determine the available bandwidth based on the new token generation rate and the locally measured instantaneous download rate, and determine the target bit rate based on the available bandwidth.

[0072] In the first embodiment described above, the raw download speed measurement values ​​obtained by the sending end from the receiving end contain a large amount of high-frequency noise introduced by multiple devices vying for bandwidth, wireless interference, and TCP congestion. The sending end uses a double exponential smoothing algorithm to recursively filter and predict the trend of these historical measurements. The resulting available bandwidth prediction value filters out instantaneous spikes while retaining the continuous direction of bandwidth change. Subsequently, based on the comparison between this prediction value and the current token generation rate, the sending end determines a new token generation rate according to a preset speed-changing rule. When the bandwidth prediction value is artificially high, the token generation rate increases slowly to avoid chasing noise; when the bandwidth prediction value decreases substantially, the token generation rate decreases rapidly to avoid link overflow due to slow response. Since the token generation rate itself has been kept stable through asymmetric speed regulation, the sending end directly uses it as the token generation rate of the token bucket and determines the bucket capacity by the maximum value of the historical token generation rate and a preset multiple of the duration. This prevents the bucket capacity from changing frequently with the instantaneous fluctuations of the current rate, thereby macroscopically constraining the actual packet transmission rate to near the stable average token generation rate. The packet sending curve at the sending end becomes smoother and more controllable, no longer aggressively impacting network bottlenecks. The probability of packet loss triggering in TCP congestion control is significantly reduced, and the frequency of slow start and retransmission decreases accordingly. As a result, the receiving end is freed from the large jitter caused by TCP sawtooth fluctuations and the sudden behavior of the sending end itself. The variance of its measured download rate will naturally decrease. After the noise of the input signal faced by the adaptive bitrate algorithm is reduced, the probability of the bandwidth estimate exceeding the switching threshold decreases. In addition, the hysteresis and cooling mechanism of the adaptive bitrate algorithm itself ultimately achieves a significant reduction in the frequency of bitrate switching, maintaining stable picture quality while ensuring smooth playback.

[0073] Example 2 Based on the above embodiment one, the set-top box network bandwidth adaptive adjustment method proposed in this embodiment is applied to the receiving end. Further, based on the sending end determining a new token generation rate and sending the new token generation rate to the receiving end, it refers to... Figure 2 The set-top box network bandwidth adaptive adjustment method also includes steps A10 to A40: Step A10: Upon receiving the new token generation rate from the sending end, obtain the instantaneous download rate.

[0074] Step A20: Determine the fusion weight corresponding to the new token generation rate based on the difference between the new token generation rate and the instantaneous download rate. The fusion weight is proportional to the difference.

[0075] The receiver checks for feedback messages from the sender during each measurement cycle. When it receives a message containing the new token generation rate... When a message is received, the receiving end parses the message and extracts the token generation rate. value. Meanwhile, the receiving end acquires the instantaneous download rate R'm at the current moment locally.

[0076] The receiving end calculates the absolute difference D between the new token generation rate and the instantaneous download rate R'm, where D= . Then, the fusion weight λ is determined according to the difference. The value of λ is proportional to the difference D, that is, the larger the difference, the closer λ is to 1; the smaller the difference, the closer λ is to the preset reference value λ0. In specific implementation, an upper difference limit Dmax and a lower difference limit Dmin can be set. When D≤Dmin, λ=λ0; when D≥Dmax, λ=1; when Dmin<D<Dmax, λ is linearly interpolated between λ0 and 1, where λ0 is less than 1. When the instantaneous download rate is highly consistent with the new token generation rate from the sending end, the fusion weight is biased towards the historical smoothed value; when the two deviate significantly, for example, the instantaneous download rate is abnormally low due to sudden interference, the fusion weight automatically increases to close to 1, making the receiving end trust the new token generation rate provided by the sending end more, thereby suppressing erroneous bit rate switching caused by instantaneous abnormalities.

[0077] Step A30: based on the fusion weight, perform weighted fusion on the new token generation rate and the instantaneous download rate to obtain the available bandwidth.

[0078] Exemplarily, according to the fusion weight λ determined above, the receiving end performs weighted summation on the new token generation rate and the instantaneous download rate R'm to obtain the available bandwidth B of the current measurement cycle: .

[0079] When λ is large, the available bandwidth estimation B inherits more of the smoothing characteristic with low noise level; when λ is small, the available bandwidth estimation B reflects more the latest change of the instantaneous download rate. Since λ is dynamically adjusted according to the difference between the two, B is biased towards smoothing when the two are consistent, and automatically turns to trusting the estimation from the sending end when they deviate, thereby maintaining low variance and high reliability on the whole.

[0080] Step A40: determine the target bit rate according to the available bandwidth, and the target bit rate is proportional to the available bandwidth.

[0081] Exemplarily, the receiving end multiplies the available bandwidth B calculated above by a preset safety factor η to obtain the effective utilization upper limit B' of available bandwidth, B'=B×η. Then, from the ascending-order arranged bit rate gear set {r1,r2,…,rn}, the maximum bit rate gear satisfying ri≤B' is selected as the target bit rate. If B' is lower than the lowest bit rate gear, the lowest bit rate gear is selected; if B' is higher than the highest bit rate gear, the highest bit rate gear is selected.

[0082] The higher the available bandwidth, the higher the selected bitrate level, resulting in better image quality; conversely, the lower the available bandwidth, the lower the selected bitrate level, prioritizing smoothness. Since the available bandwidth has been dynamically weighted and fused, its noise level is significantly lower than the original instantaneous download speed, thus making the bitrate selection more stable and reducing the frequency of switching.

[0083] Furthermore, step A40 above includes steps A41 to A44: Step A41: Based on the preset bandwidth status mapping rules, the available bandwidth is mapped to candidate bandwidth status.

[0084] Step A42: When the candidate bandwidth state is different from the bandwidth state of the previous measurement period, determine the bandwidth difference between the available bandwidth and the available bandwidth of the previous measurement period.

[0085] Step A43: When the bandwidth difference is greater than a preset threshold, the candidate bandwidth state is taken as the current bandwidth state.

[0086] Step A44: The highest bitrate in the bitrate policy range corresponding to the current bandwidth state is taken as the target bitrate, so that the receiving end gradually switches the current bitrate to the target bitrate according to a preset step size.

[0087] For example, the receiver pre-sets a set of bandwidth state division thresholds, such as dividing the available bandwidth into three intervals: low bandwidth interval [0, B1), medium bandwidth interval [B1, B2), and high bandwidth interval [B2, +∞). Here, B1 is less than B2, and each bandwidth interval corresponds to a discrete bandwidth state such as low, medium, and high. The receiver compares the currently available bandwidth B(t) calculated above with these bandwidth state division thresholds to determine its interval, and uses the bandwidth state corresponding to that interval as a candidate bandwidth state S′(t).

[0088] The receiver compares the candidate bandwidth state S′(t) with the bandwidth state S(t) that actually took effect in the previous measurement period. 1) If the two values ​​are the same, it indicates that the bandwidth state has not changed, and the bandwidth state of the previous measurement period can be directly used without further processing. If the two values ​​are different, it indicates that the bandwidth state may have changed. In this case, the receiver calculates the current available bandwidth B(t) and the available bandwidth B(t) of the previous measurement period. 1) The absolute difference between them is ΔB = |B(t) B(t 1)∣.

[0089] The receiving end compares the calculated bandwidth difference ΔB with a preset threshold ΔBth. If ΔB > ΔBth, it is determined that a substantial change in bandwidth has indeed occurred, and the candidate bandwidth state S′(t) is adopted as the effective bandwidth state S(t) for the current measurement period. If ΔB ≤ ΔBth, it is determined that the bandwidth jump is insufficient to confirm the state change, and the bandwidth state of the previous measurement period remains unchanged, i.e., S(t) = S(t). 1) This mechanism is equivalent to introducing a hysteresis zone during bandwidth state switching, avoiding frequent bandwidth state jumps caused by minor fluctuations in available bandwidth near state boundaries. The receiver, based on the determined current bandwidth state S(t), queries a preset bitrate policy mapping table to obtain the bitrate policy range corresponding to that state. This bitrate policy range defines the range of bitrate levels allowed to be selected under the current bandwidth state; for example, a high bandwidth state corresponds to several of the highest bitrate levels in the bitrate set, and a low bandwidth state corresponds to several of the lowest bitrate levels. The receiver uses the highest bitrate level within this range as the target bitrate. However, the receiver does not directly jump from the current bitrate to the target bitrate, but rather transitions gradually towards the target bitrate according to a preset step size. Specifically, if the current bitrate is lower than the target bitrate, it is adjusted upwards by one level each time; if the current bitrate is higher than the target bitrate, it is adjusted downwards by one level each time; if the current bitrate is already within the range corresponding to the target bitrate, it remains unchanged. This gradual switching method avoids a one-time large jump in bitrate, making image quality changes smoother and reducing the abruptness of the image perceived by the user.

[0090] Example 2 further suppresses rate switching by fusing smoothing information provided by the transmitter with locally measured information at the receiver. The receiver first receives the new token generation rate from the transmitter. This new token generation rate has already undergone double exponential smoothing prediction and asymmetric rate adjustment processing by the transmitter, resulting in low noise levels and trend awareness. Simultaneously, the receiver acquires the locally measured instantaneous download rate, which, while reflecting real-time network conditions, contains high noise. The receiver calculates the difference between the two and determines the fusion weight based on this difference, allowing the available bandwidth estimate to better inherit the smoothing characteristics of the token generation rate. The smaller the difference, the more appropriately the fusion weight is adjusted, ensuring the available bandwidth estimate takes into account the real-time nature of the instantaneous download rate. Through this dynamic weighted fusion, the receiver obtains an available bandwidth estimate that is both smooth and reflects real-time changes. Subsequently, the receiver did not directly map the available bandwidth to the bitrate. Instead, it introduced a bandwidth state mechanism: first, the available bandwidth was mapped to candidate bandwidth states. Only when a candidate state differed from the state of the previous measurement period, and the change in available bandwidth exceeded a preset threshold, was a substantial change in bandwidth state confirmed and the current bandwidth state updated. If the change did not exceed the threshold, the original state remained unchanged. This state change threshold effectively filtered out invalid state transitions caused by minor fluctuations in available bandwidth near state boundaries. Finally, the receiver determined the target bitrate based on the bitrate strategy range corresponding to the current bandwidth state and gradually switched to the target bitrate according to a preset step size, avoiding a one-time large jump in bitrate. Through the above steps, the receiver, based on the smoothed bandwidth at the transmitter, further suppressed invalid bitrate switching at the decision level, making the final output target bitrate more stable. This formed a complete transmit-receive collaborative closed loop with the transmitter's asymmetric speed adjustment and token bucket shaping, maintaining stable image quality while ensuring smooth playback.

[0091] Example 3 Based on the above embodiment two, in the set-top box network bandwidth adaptive adjustment method proposed in this embodiment, referring to... Figure 3 After step A40 above, steps A50 to A90 are also included: Step A50: Determine the fluctuation correction coefficient based on the ratio of the standard deviation to the mean of the historical available bandwidth within the most recent preset quantity measurement period.

[0092] Historical available bandwidth is a sequence of available bandwidth values ​​stored over the most recent preset number W measurement periods, used to calculate the degree of bandwidth fluctuation. The fluctuation correction coefficient is denoted as... This is used to correct the current available bandwidth based on the historical fluctuations in available bandwidth. The greater the bandwidth fluctuation, the smaller the fluctuation correction factor, thereby lowering the bandwidth estimate and avoiding selecting an excessively high bit rate when the bandwidth is unstable.

[0093] For example, the receiving end maintains a sliding window of length W, storing the available bandwidth value B(t) calculated over the most recent W measurement cycles. From W+1) to B(t). After determining the target code rate based on the available bandwidth in each measurement period, the receiver calculates the average of these W available bandwidth values. And standard deviation σ(B), then calculate the volatility coefficient. =σ(B) / This fluctuation coefficient reflects the relative volatility of available bandwidth in the near term. The receiver further uses the fluctuation coefficient... Determine the fluctuation correction factor The calculation formula can be:

[0094] in This is the lower bound of the preset volatility correction coefficient. For example, 0.5. When the volatility coefficient... When smaller, A value close to 1 indicates stable available bandwidth, requiring no overcorrection; when the fluctuation coefficient... When it is large, Approaching the lower bound This indicates that the available bandwidth fluctuates drastically, and the bandwidth estimate needs to be lowered to avoid selecting an excessively high bitrate when the bandwidth is unstable, which could cause stuttering.

[0095] Step A60: Determine the amount of data to be played in the buffer, and determine the buffer correction coefficient based on the ratio of the amount of data to be played to the maximum capacity of the buffer.

[0096] The buffer is a storage area at the receiving end used to store downloaded but unplayed video data. The amount of data to be played is the amount of video data currently in the buffer that has not yet been played, usually expressed as playback duration or data volume, denoted as buf(t). The maximum buffer capacity is the maximum amount of data the buffer can hold, denoted as Bmax. The buffer correction factor is denoted as... The adjustment factor is dynamically adjusted based on the cache usage ratio. The fuller the cache, the larger the cache correction factor, encouraging the selection of a higher bitrate; the emptier the cache, the smaller the cache correction factor, prioritizing smoothness.

[0097] For example, the receiving end obtains the amount of unplayed video data buf(t) in the current buffer from the player module, and also obtains the maximum buffer capacity Bmax. The buffer occupancy ratio rb = buf(t) / Bmax is calculated, and this ratio is between 0 and 1.

[0098] The receiving end determines the buffer correction coefficient based on this ratio. The calculation formula is: in and These are the preset lower and upper bounds of the cache correction coefficient, respectively. When the cache occupancy rate is high... A larger cache size indicates ample caching, allowing for increased bandwidth utilization and the selection of a higher bitrate; conversely, a lower cache occupancy rate suggests insufficient caching. A lower bitrate indicates a tight cache, requiring a reduction in bandwidth estimates to prioritize smoothness and avoid cache exhaustion caused by selecting an excessively high bitrate.

[0099] Step A70: The product of the fluctuation correction coefficient, the cache correction coefficient, and the available bandwidth is taken as the corrected available bandwidth.

[0100] Step A80: When the corrected available bandwidth is greater than the next level bitrate value of the current bitrate, and the amount of data to be played is greater than the preset upgrade threshold, the target bitrate is increased.

[0101] Step A90: When the available bandwidth is less than the currently used bitrate and the amount of data to be played is less than the preset upsampling threshold, the target bitrate is reduced.

[0102] For example, the receiving end uses the available bandwidth B obtained in step A30 and the fluctuation correction coefficient obtained in step A50. And the cache correction coefficient obtained in step A60 Multiplying these together, we obtain the corrected usable bandwidth γt: γt = B × ρv × ρb.

[0103] The corrected available bandwidth takes into account both historical bandwidth fluctuations and current cache status, making it more robust than a single available bandwidth estimate. When bandwidth fluctuates significantly or the cache is strained, γt automatically decreases, encouraging a more conservative bitrate selection; when bandwidth is stable and the cache is ample, γt increases appropriately, encouraging the selection of a higher bitrate to improve image quality.

[0104] The receiver compares the corrected available bandwidth γt with the current code rate. The next level bitrate value If γt> This indicates that the bandwidth is capable of supporting a higher bitrate. Simultaneously, the receiver checks whether the current amount of data to be played, buf(t), is greater than the preset upsampling threshold. If both conditions are met, then an upgrade operation can be performed, and the target bitrate is set to the next level below the current bitrate. If γt≤ If buf(t) ≤ Bup, then the upgrade will not be performed, and the current bitrate will remain unchanged. This mechanism ensures that upgrading requires not only sufficient bandwidth but also sufficient buffer capacity, avoiding stuttering caused by a rapid decrease in buffer capacity due to bandwidth fluctuations after the upgrade.

[0105] If B < This indicates that the current bandwidth is insufficient to support the current bitrate. Simultaneously, the receiver checks whether the current amount of data to be played, buf(t), is less than the preset downsampling threshold. If both conditions are met, it is determined that a downgrading operation is needed, and the target bitrate is set to the next higher bitrate than the current bitrate. .

[0106] If B≥ or buf(t)≥ If the bandwidth is insufficient, the downgrading will not be performed, and the current bitrate will remain unchanged. This mechanism ensures that downgrading requires not only insufficient bandwidth but also a low amount of data to be played, avoiding unnecessary downgrading triggered by brief bandwidth fluctuations. When the buffer is sufficient, even if the bandwidth is temporarily lower than the current bitrate, the system can still rely on the buffer to get through the fluctuation period, thereby further reducing the frequency of bitrate switching.

[0107] The above-described embodiment three further introduces a triple mechanism: fluctuation correction, cache correction, and a joint bandwidth and cache decision-making mechanism, making bitrate switching decisions more prudent. First, the receiver determines the fluctuation correction coefficient based on the ratio of the standard deviation to the mean of historical available bandwidth within the most recent preset measurement period. When available bandwidth fluctuates drastically, this fluctuation correction automatically decreases, thereby lowering the bandwidth estimate during the correction process and avoiding excessively high bitrates that could cause stuttering during unstable periods. Simultaneously, the receiver determines the cache correction coefficient based on the ratio of the amount of data to be played in the cache to the maximum capacity of the cache. The emptier the cache, the smaller the cache correction, prioritizing smoothness; the fuller the cache, the larger the cache correction, encouraging full utilization of bandwidth to improve image quality. Multiplying the fluctuation correction coefficient and the cache correction coefficient by the available bandwidth yields the corrected available bandwidth, reflecting both historical fluctuation risks and current cache availability. Building upon this foundation, the upscaling and downscaling operations no longer rely solely on bandwidth comparison. Instead, they require both bandwidth and buffer conditions to be met simultaneously: when upscaling, the corrected available bandwidth must be greater than the next bitrate value of the current bitrate, and the amount of data to be played must be greater than a preset upscaling threshold; when downscaling, the available bandwidth must be less than the currently used bitrate, and the amount of data to be played must be less than a preset downscaling threshold. This joint decision-making mechanism ensures that when the buffer is sufficient, even if the bandwidth is briefly lower than the current bitrate, it will not rashly downscale but will instead rely on buffering to overcome fluctuations; when the buffer is strained, even if the bandwidth slightly recovers, it will not rush to upscale but will prioritize filling the buffer. Through fluctuation correction, buffer correction, and joint decision-making, the receiver, based on the smoothed bandwidth at the transmitter, further filters out invalid switching caused by brief bandwidth jitters or instantaneous buffer changes at the decision-making level, significantly reducing the frequency of bitrate switching and maintaining image quality stability to the maximum extent while ensuring smooth playback.

[0108] It should be noted that the above examples are only for understanding this application and do not constitute a limitation on the adaptive adjustment method of set-top box network bandwidth of this application. Any simple modifications based on this technical concept are within the protection scope of this application.

[0109] This application provides a set-top box network bandwidth adaptive adjustment device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the set-top box network bandwidth adaptive adjustment method in the above embodiment 1.

[0110] The following is for reference. Figure 4 This document illustrates a structural schematic diagram of a set-top box network bandwidth adaptive adjustment device suitable for implementing embodiments of this application. The set-top box network bandwidth adaptive adjustment device in this application embodiment may include, but is not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, personal digital assistants (PDAs), tablet computers (PADs), portable media players (PMPs), and in-vehicle terminals (e.g., in-vehicle navigation terminals), as well as fixed terminals such as digital TVs and desktop computers. Figure 4 The set-top box network bandwidth adaptive adjustment device shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of this application.

[0111] like Figure 4As shown, the set-top box network bandwidth adaptive adjustment device may include a processing unit 1001 (e.g., a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1002 or a program loaded from a storage device 1003 into a random access memory (RAM) 1004. The RAM 1004 also stores various programs and data required for the operation of the set-top box network bandwidth adaptive adjustment device. The processing unit 1001, the read-only memory 1002, and the RAM 1004 are interconnected via a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Typically, the following systems can be connected to I / O interface 1006: input devices 1007 including, for example, touchscreens, touchpads, keyboards, mice, image sensors, microphones, accelerometers, gyroscopes, etc.; output devices 1008 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 1003 including, for example, magnetic tapes, hard disks, etc.; and communication devices 1009. Communication device 1009 allows the set-top box network bandwidth adaptive adjustment device to communicate wirelessly or wiredly with other devices to exchange data. Although a set-top box network bandwidth adaptive adjustment device with various systems is shown in the figure, it should be understood that it is not required to implement or possess all the systems shown. More or fewer systems may be implemented alternatively.

[0112] Specifically, according to the embodiments disclosed in this application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments disclosed in this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device, or installed from storage device 1003, or installed from read-only memory 1002. When the computer program is executed by processing device 1001, it performs the functions defined in the methods of the embodiments disclosed in this application.

[0113] The set-top box network bandwidth adaptive adjustment device provided in this application, employing the set-top box network bandwidth adaptive adjustment method in the above embodiments, can solve the technical problem of how to reduce the frequency of bitrate switching and improve playback stability. Compared with the prior art, the beneficial effects of the set-top box network bandwidth adaptive adjustment device provided in this application are the same as those of the set-top box network bandwidth adaptive adjustment method provided in the above embodiments, and other technical features in this set-top box network bandwidth adaptive adjustment device are the same as those disclosed in the previous embodiment method, and will not be repeated here.

[0114] It should be understood that the various parts disclosed in this application can be implemented using hardware, software, firmware, or a combination thereof. In the description of the above embodiments, specific features, structures, materials, or characteristics can be combined in any suitable manner in one or more embodiments or examples.

[0115] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

[0116] This application provides a computer-readable storage medium having computer-readable program instructions (i.e., a computer program) stored thereon, the computer-readable program instructions being used to execute the set-top box network bandwidth adaptive adjustment method in the above embodiments.

[0117] The computer-readable storage medium provided in this application may be, for example, a USB flash drive, but is not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatuses, or devices, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to: electrical connections having one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), or flash memory, optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer-readable storage medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, radio frequency (RF), etc., or any suitable combination thereof.

[0118] The aforementioned computer-readable storage medium may be included in the set-top box network bandwidth adaptive adjustment device; or it may exist independently and not be assembled into the set-top box network bandwidth adaptive adjustment device.

[0119] The aforementioned computer-readable storage medium carries one or more programs that, when executed by a set-top box network bandwidth adaptive adjustment device, enable the set-top box network bandwidth adaptive adjustment device to write computer program code for performing the operations of this application in one or more programming languages ​​or a combination thereof. These programming languages ​​include object-oriented programming languages ​​such as Java, Smalltalk, and C++, as well as conventional procedural programming languages ​​such as C or similar languages. The program code can be executed entirely on the user's computer, partially on the user's computer, or as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computer (e.g., using an internet connection provided by an internet service).

[0120] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation that may be implemented in systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0121] The modules described in the embodiments of this application can be implemented in software or hardware. The names of the modules do not necessarily limit the functionality of the unit itself.

[0122] The readable storage medium provided in this application is a computer-readable storage medium that stores computer-readable program instructions (i.e., a computer program) for executing the above-described set-top box network bandwidth adaptive adjustment method, which can solve the technical problem of how to reduce the frequency of bitrate switching and improve playback stability. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in this application are the same as the beneficial effects of the set-top box network bandwidth adaptive adjustment method provided in the above embodiments, and will not be repeated here.

[0123] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the set-top box network bandwidth adaptive adjustment method described above.

[0124] The computer program product provided in this application can solve the technical problem of how to reduce the frequency of bitrate switching and improve playback stability. Compared with the prior art, the beneficial effects of the computer program product provided in this application are the same as those of the set-top box network bandwidth adaptive adjustment method provided in the above embodiments, and will not be repeated here.

[0125] The above description is only a part of the embodiments of this application and does not limit the patent scope of this application. All equivalent structural transformations made under the technical concept of this application and using the contents of the specification and drawings of this application, or direct / indirect applications in other related technical fields, are included in the patent protection scope of this application.

Claims

1. A method for adaptive adjustment of network bandwidth in a set-top box, characterized in that, Applied to the transmitting end, the set-top box network bandwidth adaptive adjustment method includes: Obtain the download speed measurement value sent by the receiving end, and store the download speed measurement value in the sliding window buffer; Based on the historical measurement values ​​in the sliding window buffer, the available bandwidth prediction value for the next measurement cycle is predicted using a preset smoothing algorithm. Based on the comparison between the predicted available bandwidth and the current token generation rate, a new token generation rate is determined according to a preset speed-changing rule; The actual packet sending rate is determined based on the new token generation rate, and data packets are sent to the receiving end according to the actual packet sending rate. The step of predicting the available bandwidth for the next measurement period based on historical measurement values ​​within the sliding window buffer using a preset smoothing algorithm includes: Obtain the download rate measurement value for the current measurement period, and obtain the horizontal component and trend component of the previous measurement period from the sliding window cache; The download speed measurement value of the current measurement period is weighted and averaged with the predicted baseline value of the previous measurement period by a preset first smoothing coefficient to obtain the horizontal component of the current measurement period. By using a preset second smoothing coefficient, the horizontal component of the current measurement period and the trend component of the previous measurement period are weighted and averaged to obtain the trend component of the current measurement period. The sum of the horizontal component and the trend component of the current measurement period is used as the predicted available bandwidth for the next measurement period. The step of determining a new token generation rate according to a preset speed-changing rule based on the comparison result between the predicted available bandwidth and the current token generation rate includes: When the predicted available bandwidth is greater than a preset first multiple of the current token generation rate, the current token generation rate is incremented at a first rate to obtain the new token generation rate, wherein the increment is less than or equal to a first limit. When the predicted available bandwidth is less than a preset second multiple of the current token generation rate, the current token generation rate is reduced by a second rate to obtain the new token generation rate, wherein the single reduction amount is less than or equal to the second limit, the second rate is greater than the first rate, and the first limit is less than the second limit.

2. The set-top box network bandwidth adaptive adjustment method as described in claim 1, characterized in that, The set-top box network bandwidth adaptive adjustment method further includes: The maximum value of the historical token generation rate is determined, and the amount of data corresponding to a preset multiple of the maximum value is used as the capacity of the token bucket of the sending end; wherein, after the sending end obtains a number of tokens equal to the amount of data to be sent from the token bucket, it sends a data packet to the receiving end.

3. The set-top box network bandwidth adaptive adjustment method as described in claim 1, characterized in that, After determining a new token generation rate according to a preset speed-changing rule based on the comparison result between the available bandwidth prediction value and the current token generation rate; The new token generation rate is sent to the receiving end so that the receiving end can determine the available bandwidth based on the new token generation rate and the locally measured instantaneous download rate, and determine the target bitrate based on the available bandwidth.

4. The set-top box network bandwidth adaptive adjustment method as described in claim 3, characterized in that, Applied to the receiving end, the set-top box network bandwidth adaptive adjustment method includes the following steps: Upon receiving the new token generation rate sent by the sending end, the instantaneous download rate is obtained; The fusion weight corresponding to the new token generation rate is determined based on the difference between the new token generation rate and the instantaneous download rate, and the fusion weight is proportional to the difference. Based on the fusion weight, the new token generation rate and the instantaneous download rate are weighted and fused to obtain the available bandwidth; The target bitrate is determined based on the available bandwidth, and the target bitrate is proportional to the available bandwidth.

5. The set-top box network bandwidth adaptive adjustment method as described in claim 4, characterized in that, The step of determining the target bit rate based on the available bandwidth includes: Based on a preset bandwidth status mapping rule, the available bandwidth is mapped to candidate bandwidth status; When the candidate bandwidth state is different from the bandwidth state of the previous measurement period, the bandwidth difference between the available bandwidth and the available bandwidth of the previous measurement period is determined. When the bandwidth difference is greater than a preset threshold, the candidate bandwidth state is taken as the current bandwidth state; The highest bitrate in the bitrate policy range corresponding to the current bandwidth state is taken as the target bitrate, so that the receiving end gradually switches the current bitrate to the target bitrate according to a preset step size.

6. The set-top box network bandwidth adaptive adjustment method as described in claim 4, characterized in that, After the step of determining the target bit rate based on the available bandwidth, the method further includes: The fluctuation correction coefficient is determined based on the ratio of the standard deviation to the mean of the historical available bandwidth within the most recent preset quantity measurement period; Determine the amount of data to be played in the buffer, and determine the buffer correction coefficient based on the ratio of the amount of data to be played to the maximum capacity of the buffer; The product of the fluctuation correction coefficient, the cache correction coefficient, and the available bandwidth is taken as the corrected available bandwidth; When the corrected available bandwidth is greater than the next level bitrate value of the current bitrate, and the amount of data to be played is greater than the preset upgrade threshold, the target bitrate is increased. When the available bandwidth is less than the currently used bitrate and the amount of data to be played is less than the preset downgrading threshold, the target bitrate is reduced.

7. A set-top box network bandwidth adaptive adjustment device, characterized in that, The device includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the steps of the set-top box network bandwidth adaptive adjustment method as described in any one of claims 1 to 6.

8. A storage medium, characterized in that, The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, it implements the steps of the set-top box network bandwidth adaptive adjustment method as described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Session resource scheduling method and device, equipment and storage medium

    CN120455283A

  • Multi-core hybrid cluster resource scheduling method based on topology awareness

    CN121144024A