Code rate determination method, apparatus, device, and storage medium
By constructing a traffic data graph and using the Kalman filter algorithm to calculate bandwidth, the problem of inaccurate bandwidth prediction in low-latency live streaming was solved, enabling adaptive adjustment of video bitrate and improving the smoothness and clarity of live video.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- TENCENT DIGITAL (SHENZHEN) CO LTD
- Filing Date
- 2022-08-04
- Publication Date
- 2026-05-19
AI Technical Summary
In low-latency live streaming scenarios, existing technologies cannot accurately predict bandwidth, resulting in inaccurate adaptive adjustment of video bitrate, which affects the smoothness and clarity of video playback.
By acquiring the traffic data map of the current data packet fragments, constructing a preset window and a preset distance, determining the target traffic data map, and using the Kalman filter algorithm and the exponentially weighted moving average algorithm, calculating the current predicted bandwidth of the target application, and determining the target bitrate of the data packet fragments to be played based on the bandwidth.
It enables the rapid and accurate determination of the target bitrate in low-latency live streaming scenarios, ensuring smooth and clear video playback and improving user experience.
Smart Images

Figure CN117560522B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a method, apparatus, device and storage medium for determining bit rate. Background Technology
[0002] In related technologies, in low-latency live streaming scenarios, the client downloads Prefetch TS segments (TS segments that are being generated, such as Low latency 2.ts). The download bottleneck is the video generation speed. By measuring the download speed, the current bandwidth cannot be obtained; only the video bitrate can be obtained.
[0003] Therefore, in low-latency live streaming scenarios, it is impossible to accurately predict bandwidth and adaptively adjust the video bitrate. Summary of the Invention
[0004] This application provides a bitrate determination method, apparatus, device, and storage medium that can accurately predict the bandwidth corresponding to the target application, thereby accurately determining the target bitrate of the segment to be played and ensuring adaptive adjustment of the video bitrate in the target application.
[0005] On the one hand, this application provides a bitrate determination method, the method comprising:
[0006] Obtain the traffic data graph of the currently processed data packet fragment in the target application; the traffic data graph represents the correspondence between data traffic and time in the current data packet fragment;
[0007] Based on the range of coordinate values in the traffic data graph, a preset window and a preset distance are determined; the preset window is determined based on the starting coordinate point of the traffic data graph.
[0008] Based on the preset window and the preset distance, a target traffic data map is determined;
[0009] Based on the target traffic data map, determine the current predicted bandwidth of the target application;
[0010] Based on the current predicted bandwidth, the target bitrate of the data packet fragments to be played in the target application is determined.
[0011] On the other hand, a bitrate determination apparatus is provided, the apparatus comprising:
[0012] The traffic data graph acquisition module is used to acquire the traffic data graph of the currently processed data packet fragment in the target application; the traffic data graph represents the correspondence between data traffic and time in the current data packet fragment;
[0013] The preset window determination module is used to determine a preset window and a preset distance based on the range of coordinate values in the traffic data graph; the preset window is determined based on the starting coordinate point of the traffic data graph.
[0014] The target traffic data map determination module is used to determine the target traffic data map based on the preset window and the preset distance;
[0015] The current predicted bandwidth determination module is used to determine the current predicted bandwidth of the target application based on the target traffic data map;
[0016] The target bitrate determination module is used to determine the target bitrate of the data packet fragments to be played in the target application based on the current predicted bandwidth.
[0017] On the other hand, a bitrate determination device is provided, the device including a processor and a memory, the memory storing at least one instruction or at least one program, the at least one instruction or the at least one program being loaded and executed by the processor to implement the bitrate determination method as described above.
[0018] On the other hand, a computer storage medium is provided that stores at least one instruction or at least one program, which is loaded and executed by a processor to implement the bitrate determination method as described above.
[0019] On the other hand, a computer program product or computer program is provided, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the bit rate determination method as described above.
[0020] The bit rate determination method, apparatus, device, and storage medium provided in this application have the following technical advantages:
[0021] This application obtains a traffic data graph of the currently processed data packet fragment in the target application; the traffic data graph represents the correspondence between data traffic and time in the current data packet fragment; based on the coordinate value range in the traffic data graph, a preset window and a preset distance are determined; the preset window is determined based on the starting coordinate point of the traffic data graph; based on the preset window and the preset distance, a target traffic data graph is determined; based on the target traffic data graph, the current predicted bandwidth of the target application is determined; based on the current predicted bandwidth, the target bitrate of the data packet fragment to be played in the target application is determined. This application, by constructing a preset window, achieves rapid and accurate determination of the target traffic data graph, thereby accurately predicting the target bitrate of the data packet fragment to be played, ensuring adaptive adjustment of the video bitrate in the target application, and thus ensuring smooth and efficient video playback during live streaming. Attached Figure Description
[0022] To more clearly illustrate the technical solutions and advantages 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, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0023] Figure 1 This is a schematic diagram of a bit rate determination system provided in an embodiment of this application;
[0024] Figure 2 This is a flowchart illustrating a bitrate determination method provided in an embodiment of this application;
[0025] Figure 3 This is a flowchart illustrating a method for determining a target traffic data map based on the preset window and the preset distance, as provided in an embodiment of this application.
[0026] Figure 4 This is a flowchart illustrating a method for determining the target traffic data graph based on the current slope corresponding to each current window, as provided in an embodiment of this application.
[0027] Figure 5 This is a flowchart illustrating a method for determining the current predicted bandwidth of a target application based on the target traffic data map provided in this application embodiment.
[0028] Figure 6 This is a flowchart illustrating a method for determining the target bitrate of a data packet fragment to be played in the target application based on the current predicted bandwidth, as provided in an embodiment of this application.
[0029] Figure 7This is a traffic data graph of current data packet fragmentation in a target application, provided in an embodiment of this application.
[0030] Figure 8 This is a download curve of a current data packet fragment provided in an embodiment of this application;
[0031] Figure 9 This is a comparison curve between bandwidth prediction results and actual results provided in an embodiment of this application;
[0032] Figure 10 This is a schematic diagram of an LHLS m3u8 file provided in an embodiment of this application;
[0033] Figure 11 This is a schematic diagram of the bandwidth prediction method corresponding to different data packet fragments provided in the embodiments of this application;
[0034] Figure 12 This is a schematic diagram of the error level parameters corresponding to different data packet fragments provided in the embodiments of this application;
[0035] Figure 13 These are the bandwidth prediction curves before and after processing by the Kalman filter algorithm during the slow rate increase process provided in this application embodiment;
[0036] Figure 14 These are the bandwidth prediction curves before and after processing by the Kalman filter algorithm during the bit rate drop process provided in the embodiments of this application;
[0037] Figure 15 This is a schematic diagram of the bandwidth prediction curve under high latency scenarios provided in the embodiments of this application;
[0038] Figure 16 This is a schematic diagram of the bandwidth prediction curve in a low-latency scenario provided in the embodiments of this application;
[0039] Figure 17 This is a schematic diagram illustrating the switching between different resolution data packet fragments to be played, provided in an embodiment of this application.
[0040] Figure 18 This is a schematic diagram of the structure of an LHLS low-latency live streaming system provided in an embodiment of this application;
[0041] Figure 19 This is a comparison chart of data download latency at the viewer's end in a high-latency and low-latency live streaming scenario provided in an embodiment of this application;
[0042] Figure 20 This is the display interface of the target application in the viewer terminal provided in this application embodiment;
[0043] Figure 21 This is a structural diagram of a bitrate adaptive adjustment system provided in an embodiment of this application;
[0044] Figure 22 This is a schematic diagram of the structure of a bit rate determination device provided in an embodiment of this application;
[0045] Figure 23 This is a schematic diagram of the structure of a server provided in an embodiment of this application. Detailed Implementation
[0046] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.
[0047] First, some of the nouns or terms that appear in the description of the embodiments of this application are explained as follows:
[0048] HLS: HTTP Live Streaming, a streaming media protocol. HTTP Live Streaming (HLS) is a streaming media transmission protocol based on HTTP, enabling live streaming and video-on-demand (VOD) of media. It is primarily used in iOS systems, providing audio and video live streaming and VOD solutions for iOS devices (such as iPhones and iPads). The biggest difference in HLS live streaming is that the live streaming client does not receive a complete data stream. The HLS protocol stores the live data stream as continuous, short media files (MPEG-TS format) on the server side, and the client continuously downloads and plays these small files. Because the server constantly generates new small files with the latest live data, the client only needs to continuously play the files obtained from the server in sequence to achieve live streaming. Therefore, it can be essentially considered that HLS achieves live streaming using a VOD technology.
[0049] m3u8: HLS playlist file;
[0050] LHLS: Low-latency HLS;
[0051] TS: Data packet carrying media data;
[0052] Normal TS: TS that has already been generated;
[0053] Prefetch TS: The TS being generated.
[0054] Live streaming: Independent signal acquisition equipment (audio + video) is set up on-site, imported into the broadcast control unit (broadcast equipment or platform), and then uploaded to a server via the network and published to a website for viewing. Live streaming includes shopping live streams, game live streams, etc. Game live streams have high requirements for real-time video quality, and the data volume of game videos is large. The method in this application, while ensuring a short latency, accurately predicts bandwidth and can play the next TS segment at the maximum bitrate adapted to the predicted bandwidth. This ensures low latency while maintaining smooth and high-definition live streaming, maximizing the user's viewing experience.
[0055] Traditional HLS bitrate adaptation scheme for high latency scenarios: Bandwidth measurement is achieved by measuring the download speed of TS segments, and this measurement is then used as a reference for bitrate adaptation.
[0056] In high-latency scenarios, the download is of Normal TS fragments (already generated TS fragments, such as High latency1.ts). The download bottleneck is network bandwidth, and the current bandwidth can be obtained by measuring the download speed.
[0057] However, bandwidth cannot be accurately measured in low-latency scenarios. A low-latency Twitch live stream bitrate adaptation solution involves using an HTTP Range(206) request to obtain a small segment (32.8k) of pre-generated TS fragment data for speed testing, which is then used as a reference for bitrate adaptation.
[0058] In low-latency scenarios, Prefetch TS segments are downloaded (TS segments that are being generated, such as Low latency2.ts). The bottleneck is the video generation speed. Measuring the download speed does not provide the current bandwidth, only the video bitrate. At the time, there was redundant traffic; test segments could not be too small, otherwise the speed test would be inaccurate, while segments that were too large would waste valuable bandwidth resources. Furthermore, Range requests share the download channel with TS, and serial requests can lead to head-of-line blocking issues, easily causing video stuttering. HTTPRange requests allow the server to send only a portion of the HTTP message to the client. Such partial requests are very helpful for large media files and download files with interrupted and resumed download progress.
[0059] The Kalman filter algorithm is an algorithm that uses the state equations of a linear system to optimally estimate the system state using observed input and output data. Since the observed data includes noise and interference from the system, the optimal estimation can also be viewed as a filtering process. Data filtering is a data processing technique that removes noise and restores the true data. Kalman filtering, given known measurement variance, can estimate the state of a dynamic system from a series of data containing measurement noise.
[0060] In order to accurately predict the bandwidth of the target application, thereby accurately predicting the target bitrate of the data packet fragment to be played, and ensuring the adaptive adjustment of the video bitrate in the target application, this application proposes a bitrate determination method, apparatus, device and storage medium.
[0061] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or server that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or devices.
[0062] Please see Figure 1 , Figure 1 This is a schematic diagram of a bitrate determination system provided in an embodiment of this application, such as... Figure 1 As shown, the bitrate determination system may include at least server 01 and client 02.
[0063] Specifically, in this embodiment, server 01 may include a standalone server, a distributed server, or a server cluster composed of multiple servers. It may also be a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms. Server 01 may include a network communication unit, a processor, and a memory, etc. Specifically, server 01 can be used to determine the target bitrate of the data packet fragments to be played in the target application.
[0064] Specifically, in this embodiment, the client 02 may include physical devices such as smartphones, desktop computers, tablets, laptops, digital assistants, smart wearable devices, smart speakers, in-vehicle terminals, virtual reality (VR) devices, and smart TVs. It may also include software running on the physical device, such as web pages provided to users by service providers, or applications provided to users by those service providers. Specifically, the client 02 can be used to play data packet fragments of the target bitrate in the target application.
[0065] The following describes a bitrate determination method according to this application. This method can be applied to online live streaming scenarios. Figure 2 This is a flowchart illustrating a bitrate determination method provided in an embodiment of this application. This method can be applied to... Figure 1 In the server 01 shown, this specification provides the method operation steps as described in the embodiments or flowcharts, but based on conventional or non-inventive labor, more or fewer operation steps may be included. The order of steps listed in the embodiments is merely one possible execution order among many and does not represent the only execution order. In actual system or server product execution, the methods shown in the embodiments or drawings can be executed sequentially or in parallel (e.g., in a parallel processor or multi-threaded processing environment). Specifically, as shown in the figures... Figure 2 As shown, the method may include:
[0066] S201: Obtain the traffic data graph of the currently processed data packet fragment in the target application; the traffic data graph represents the correspondence between data traffic and time in the current data packet fragment.
[0067] Specifically, in this embodiment, the method can be applied to low-latency live streaming scenarios; the server can obtain the traffic data graph of the currently processed data packet fragment in the target application; the target application can be an application in the terminal, and the server can be the backend server of the target application; for example, the target application is a video application, and the server can be a video backend server; the currently processed data packet fragment in the target application can be a TS fragment being generated; the current data packet fragment can be a TS fragment being generated in the server, and its traffic data graph in the target application can be the traffic time curve of the target application downloading the current data packet fragment in the terminal; the server can generate TS fragments while sending the generated partial TS fragments to the target application, so that the target application can download the generated partial TS fragments at the same time; thus, after the TS fragments are completely generated, the corresponding traffic data graph can be obtained, thereby facilitating the prediction of the current bandwidth of the target application.
[0068] S203: Based on the range of coordinate values in the traffic data graph, determine a preset window and a preset distance; the preset window is determined based on the starting coordinate point of the traffic data graph.
[0069] In this embodiment, the traffic data graph can be plotted with time on the horizontal axis and the download traffic of the current data packet fragment on the vertical axis. A preset window can be constructed based on the horizontal or vertical axis of the traffic data graph. The preset window can be rectangular. The preset window can be obtained by moving a preset distance along a preset coordinate axis, with the starting coordinate point of the traffic data graph as the initial position. One side of the preset window can be a preset distance or a first preset value, and the other side can be a second preset value. The first preset value, the second preset value, and the preset distance are all fixed. The preset coordinate axis can be the horizontal or vertical axis of the traffic data graph; the preset distance can be the single movement distance of the preset window and can be set according to actual conditions.
[0070] S205: Determine the target traffic data map based on the preset window and the preset distance.
[0071] In this embodiment, the download speed in the target traffic data graph is greater than a preset speed threshold; the preset speed threshold can be set according to actual conditions. The target traffic data graph can be the segment of the traffic data graph with the fastest download speed.
[0072] In the embodiments of this application, such as Figure 3 As shown, determining the target traffic data map based on the preset window and the preset distance includes:
[0073] S2051: Set the preset window as the current window;
[0074] S2053: Calculate the current slope of the current traffic data graph based on the current traffic data graph corresponding to the current window;
[0075] Specifically, in this embodiment, the data graph in the current window can be determined as the current traffic data graph. The current traffic data graph is usually a straight line, and the slope of the corresponding straight line can be calculated as the current slope.
[0076] S2055: Move the current window by the preset distance along the preset coordinate axis of the traffic data graph to obtain an updated window, and use the updated window as the current window again;
[0077] Specifically, in this embodiment, the preset coordinate axis can be the horizontal or vertical axis of the traffic data graph; the current window can be continuously moved according to a preset distance to obtain an updated window; moving the preset distance once yields an updated window; the updated window and the preset window have the same area, that is, the area of each current window is the same; the updated window and the preset window may or may not overlap.
[0078] S2057: Repeat the steps of calculating the current slope of the current traffic data graph based on the current traffic data graph corresponding to the current window; until the current window is moved by the preset distance along the preset coordinate axis direction of the traffic data graph to obtain an updated window, and the updated window is used as the current window again, until the updated window exceeds the range of the traffic data graph;
[0079] Specifically, in this embodiment, the current window can be continuously moved to obtain an updated window until the range of the updated window exceeds the range of the traffic data graph, at which point the window update stops. This allows the traffic data graph to be decomposed into multiple sub-data graphs based on the current window, facilitating the calculation of the slope of each sub-data graph.
[0080] In a specific embodiment, such as Figure 7 As shown, Figure 7 This is a traffic data graph of a current data packet fragment in the target application, where window 1 is a preset window and window 2 is an updated window after multiple translations of the preset window. Window 1 and window 2 have the same area, and neither of them exceeds the range of the target traffic data graph; each window corresponds to a segment of traffic data curve.
[0081] S2059: Determine the target traffic data map based on the current slope corresponding to each current window.
[0082] Specifically, in this embodiment of the application, the current slope of the current traffic data graph within each current window can be calculated to determine the target traffic data graph.
[0083] In the embodiments of this application, such as Figure 8 As shown, Figure 8The download curves for a fragmented data packet being generated include curves 03 and 04. Predicted bandwidth data for the target application is obtained from these two curves. After downloading, the actual bandwidth data and video bitrate in the target application are acquired. Comparison reveals that the predicted bandwidth data in curve 03 is close to the actual bandwidth data, while the predicted bandwidth data in curve 04 is close to the video bitrate. Therefore, to obtain a more accurate bandwidth prediction result, curve 03 in the fragmented data packet being generated needs to be obtained. Based on this curve, the bandwidth of the target application can be accurately predicted, and curve 03 is the curve with the steepest slope in the download curve.
[0084] In the embodiments of this application, such as Figure 4 As shown, determining the target traffic data map based on the current slope corresponding to each current window includes:
[0085] S20591: Sort the current windows based on the numerical value of the current slope corresponding to each current window;
[0086] In this embodiment of the application, sorting the current windows based on the numerical value of the current slope corresponding to each current window may include:
[0087] Sort each current window in descending order of its current slope value to obtain the first sorting result;
[0088] In this embodiment of the application, sorting the current windows based on the numerical value of the current slope corresponding to each current window may include:
[0089] Sort each current window in ascending order of its current slope value to obtain the second sorting result.
[0090] S20593: Based on the sorting results, determine the current target window from the current windows;
[0091] In this embodiment of the application, determining the current target window from the various current windows based on the sorting results includes:
[0092] Based on the first sorting result, the current window that ranks first in the sorting is determined as the current target window.
[0093] In this embodiment of the application, determining the current target window from the various current windows based on the sorting results includes:
[0094] Based on the second sorting result, the current window that is last in the sorting order is determined as the current target window.
[0095] In this embodiment, the current window with the largest current slope can be determined as the current target window, thereby accurately predicting the bandwidth based on the current target window.
[0096] S20595: Determine the corresponding part of the current target window in the traffic data graph as the target traffic data graph.
[0097] In this embodiment of the application, the data graph corresponding to the current target window can be determined as the target traffic data graph, and the slope of this part of the data graph is the largest.
[0098] S207: Based on the target traffic data map, determine the current predicted bandwidth of the target application.
[0099] In the embodiments of this application, such as Figure 5 As shown, determining the current predicted bandwidth of the target application based on the target traffic data map includes:
[0100] S2071: Based on the target traffic data map, determine the data traffic difference and time difference;
[0101] Specifically, in this embodiment of the application, the time difference can be determined based on the horizontal axis of the target traffic data graph. Specifically, the start time value (minimum value) and end time value (maximum value) of the target traffic data graph can be obtained, and the difference between the end time value and the start time value can be calculated to obtain the time difference; the start traffic value (start point of the vertical axis in the graph) and end traffic value (end point of the vertical axis in the graph) of the target traffic data graph can be obtained, and the difference between the end traffic value and the start traffic value can be calculated to obtain the data traffic difference.
[0102] S2073: Calculate the ratio of the data flow difference to the time difference to obtain the flow-time ratio;
[0103] Specifically, in this embodiment of the application, the ratio of the data flow difference to the time difference can be calculated as the flow-time ratio.
[0104] S2075: Based on the traffic-time ratio, determine the current predicted bandwidth of the target application.
[0105] Specifically, in this embodiment of the application, the traffic-time ratio can be used as the current predicted bandwidth of the target application.
[0106] In a specific embodiment, such as Figure 9 As shown, Figure 9 This is a comparison curve between the bandwidth prediction result and the actual result, where the sawtooth curve 05 is the predicted bandwidth curve and the broken line 06 is the actual bandwidth curve; the two have a high degree of similarity.
[0107] In this embodiment of the application, the current data packet fragment is at least two, and determining the current predicted bandwidth of the target application based on the traffic-time ratio includes:
[0108] Based on the traffic-time ratios corresponding to each of the at least two current data packet fragments, a traffic-time ratio map is constructed.
[0109] In this embodiment of the application, at least two current data packet fragments may include fragments that are being processed and fragments that are waiting to be processed.
[0110] In this embodiment of the application, an m3u8 file can be constructed based on at least two current data packet fragments; such as Figure 10 As shown, Figure 10 This is a schematic diagram of an LHLS m3u8 file, which includes two Prefetch TS fragments (the first is the fragment being generated, and the second is the fragment to be generated).
[0111] Based on the Kalman filter algorithm, the traffic time ratio graph is smoothed to obtain the current predicted bandwidth of the target application.
[0112] In this embodiment of the application, the bandwidth prediction accuracy can be improved by using a Kalman filter algorithm to smooth the traffic time ratio graph and obtain the current predicted bandwidth of the target application.
[0113] To further improve bandwidth prediction accuracy and achieve the slow rise and fast fall characteristics of bandwidth prediction (reducing video stuttering), error modification rules can be added to the Kalman filter algorithm: 1) error parameter levels; 2) gradient descent scheme; Gradient descent rule: when the bandwidth measurement decreases continuously for n times, a smaller error parameter is used. For example, 0.0001 is used for 2 consecutive falls, 0.00008 for 3 consecutive falls, 0.00004 for 4 consecutive falls, and 0.000004 for 5 or more consecutive falls; when the bandwidth increases, the prediction result increases slowly, meeting the slow rise requirement; when the bandwidth decreases, the prediction result decreases rapidly, meeting the fast fall requirement.
[0114] In a specific embodiment, such as Figure 11 As shown, Figure 11 This diagram illustrates bandwidth prediction methods for different data packet fragments. To reduce bandwidth measurement errors, different bandwidth prediction methods can be used under different circumstances. For generated TS fragments, the bandwidth can be calculated using the following formula:
[0115] Bindwith = Size / Time;
[0116] Where Size is the TS segment size and Time is the TS segment download time. The calculation results can be smoothed using the Exponentially Weighted Moving Average (EWMA) algorithm to obtain bandwidth prediction results with higher accuracy.
[0117] For the TS segments being generated, the method of determining the current predicted bandwidth of the target application based on the target traffic data graph (WindowMax method) of this embodiment can be used; when a severe timeout occurs, for example, when the download timeout is 0.3s, the current prediction method can be switched to the method of determining the current predicted bandwidth of the target application based on the ratio of the traffic data difference to the time difference in the traffic data graph; that is, in this case, the bandwidth prediction is performed using the formula for calculating the generated TS segments.
[0118] In this embodiment of the application, the smoothing of the traffic time ratio graph based on the Kalman filter algorithm to obtain the current predicted bandwidth of the target application may include:
[0119] Based on the traffic data graph, determine the error parameters;
[0120] In a specific embodiment, such as Figure 12 As shown, Figure 12 This diagram illustrates the error level parameters corresponding to different data packet fragments. Based on the traffic data diagram, the data download speed can be determined, and the error parameters can be determined accordingly. The data download speed can be used to characterize whether the bandwidth is sufficient. When the bandwidth is sufficient, the error level is higher, and the error parameters corresponding to the higher error level can be determined. When the bandwidth is insufficient, the error level is lower, and the error parameters corresponding to the lower error level can be determined.
[0121] Based on the Kalman filter algorithm and the error parameters, the traffic time ratio graph is smoothed to obtain the current predicted bandwidth of the target application.
[0122] In this embodiment of the application, the method for determining the current predicted bandwidth of the target application based on the target traffic data graph is the WindowMax method; when a severe timeout occurs, for example, when the download timeout is 0.3s, the current prediction method can be switched to a method for determining the current predicted bandwidth of the target application based on the ratio of the traffic data difference to the time difference in the traffic data graph.
[0123] In a specific embodiment, such as Figure 13 As shown, Figure 13The graph shows the bandwidth prediction curves before and after Kalman filtering during the slow increase of bitrate. Curve 07 is the bandwidth prediction curve before processing, and curve 08 is the bandwidth prediction curve after processing. Curve 09 is the actual bandwidth curve, and curve 10 is the video bitrate curve. It can be seen that the bandwidth prediction curve after processing is highly similar to the actual bandwidth curve.
[0124] In a specific embodiment, such as Figure 14 As shown, Figure 14 The graph shows the bandwidth prediction curves before and after Kalman filtering during the rapid bitrate drop process. Curve 11 is the bandwidth prediction curve before processing, and curve 12 is the bandwidth prediction curve after processing. Curve 13 is the actual bandwidth curve, and curve 14 is the video bitrate curve. It can be seen that the bandwidth prediction curve after processing is highly similar to the actual bandwidth curve.
[0125] In one specific embodiment, within the same target application, bandwidth prediction is performed using both the bitrate adaptation method for high-latency scenarios and the bitrate adaptation method for low-latency scenarios as described in this embodiment, resulting in bandwidth prediction curves for the two schemes; the test parameter bitrate is 2500kbps, and the actual bandwidth variation is: 10Mbps -- 6Mbps -- 2Mbps; as Figure 15 As shown, Figure 15 This diagram illustrates the bandwidth prediction curves for high-latency scenarios. The bandwidth calculation formula for high-latency scenarios is Bindwith = Size / Time. The result is curve 15, and curve 16 is obtained after smoothing the data. The jagged dashed line 15 represents the bandwidth prediction curve before processing, and the jagged solid line 16 represents the bandwidth prediction curve after processing. Curve 17 is the actual bandwidth curve, and curve 18 is the video bitrate curve. Figure 16 As shown, Figure 16 This is a schematic diagram of the bandwidth prediction curve in a low-latency scenario; sawtooth curve 19 is the bandwidth prediction curve before processing, sawtooth curve 20 is the bandwidth prediction curve after processing; curve 21 is the actual bandwidth curve, and curve 22 is the video bitrate curve; as can be seen from the comparison, the root mean square error (RMSE) of the two is close and both are close to 0, indicating that the bandwidth prediction accuracy obtained by the method in this embodiment in a low-latency scenario is close to the bandwidth prediction accuracy in existing high-latency scenarios.
[0126] S209: Based on the current predicted bandwidth, determine the target bitrate of the data packet fragments to be played in the target application.
[0127] In this embodiment of the application, the data segment to be played is the segment whose playback order is after the currently played data segment.
[0128] In the embodiments of this application, such as Figure 6As shown, determining the target bitrate of the data packet fragments to be played in the target application based on the current predicted bandwidth includes:
[0129] S2091: Determine the prediction code rate corresponding to the current prediction bandwidth;
[0130] In this embodiment of the application, the predicted bitrate is a bitrate that matches the current predicted bandwidth, or a bitrate calculated based on the current predicted bandwidth.
[0131] S2093: Obtain the current bitrate of the currently playing data packet segment in the target application;
[0132] In this embodiment of the application, the current bitrate can be obtained based on the playback video corresponding to the current playback data packet segment.
[0133] S2095: Based on the predicted bitrate and the current bitrate, determine the target bitrate of the data packet fragment to be played in the target application.
[0134] Specifically, in this embodiment of the application, the initial bitrate of the data packet fragment to be played can be set to the lowest bitrate, that is, the file with the lowest resolution among the various resolution files corresponding to the pre-built data packet fragment to be played can be played first.
[0135] Specifically, in this embodiment of the application, determining the target bitrate of the data packet fragment to be played in the target application based on the predicted bitrate and the current bitrate includes:
[0136] If the predicted bitrate is greater than the current bitrate, determine a first ratio of the current predicted bandwidth to the predicted bitrate;
[0137] If the predicted bitrate is greater than the current bitrate, determining a first ratio of the current predicted bandwidth to the predicted bitrate includes:
[0138] If the predicted bitrate is greater than the current bitrate, determine the bandwidth prediction state of the preset data packet fragment; the preset data packet fragment is the fragment located after the current data packet fragment;
[0139] In this embodiment of the application, the preset data packet fragment can be at least two.
[0140] If the preset data packet fragmentation is in the bandwidth prediction completion state, determine the first ratio of the current predicted bandwidth to the predicted bit rate.
[0141] Specifically, in the embodiments of this application, after each bitrate change, if the bitrate needs to be increased, at least N (N=2) segment speed tests are completed, thereby avoiding stuttering during video playback.
[0142] If the first ratio is greater than the first threshold, the predicted bitrate is determined as the target bitrate of the data packet segment to be played.
[0143] In this embodiment of the application, the first threshold can be set according to the actual situation, for example, it can be set to 1.4, so as to avoid video screen jitter during the bitrate upscaling process and improve the user experience.
[0144] Specifically, in this embodiment of the application, if the predicted bitrate is equal to the current bitrate, the current bitrate is determined as the target bitrate of the data packet segment to be played.
[0145] Specifically, in this embodiment of the application, if the first ratio is less than or equal to the first threshold, the current bitrate is determined as the target bitrate of the data packet segment to be played, and the bitrate is not adjusted at this time.
[0146] Specifically, in this embodiment of the application, determining the target bitrate of the data packet fragment to be played in the target application based on the predicted bitrate and the current bitrate includes:
[0147] If the predicted bitrate is less than the current bitrate, determine a second ratio of the current predicted bandwidth to the predicted bitrate;
[0148] In this embodiment of the application, if the predicted bitrate is less than the current bitrate, it indicates that a bitrate increase operation may be required. In this case, it is necessary to further calculate a second ratio between the current predicted bandwidth and the predicted bitrate.
[0149] If the second ratio is less than the second threshold, the predicted bitrate is determined as the target bitrate of the data packet segment to be played.
[0150] In this embodiment, the second threshold can be set according to actual conditions, for example, it can be set to 1.2. If the second ratio is less than the second threshold, it means that a bitrate downsampling operation can be performed. This avoids video jitter during bitrate upsampling and improves the user experience.
[0151] If the second ratio is greater than or equal to the second threshold, the current bitrate is determined as the target bitrate of the data packet segment to be played.
[0152] In this embodiment of the application, if the second ratio is greater than or equal to the second threshold, it indicates that the bitrate reduction condition is not met. In this case, the data packet fragments to be played can be played according to the current bitrate of the current data packet without adjusting the bitrate.
[0153] Specifically, in this embodiment of the application, after determining the target bitrate of the data packet fragments to be played in the target application based on the current predicted bandwidth, the method further includes:
[0154] Based on the currently playing data packet fragments, at least two candidate data packet fragments are determined; the at least two candidate data packet fragments correspond to different resolutions, and the at least two candidate data packet fragments correspond to the same live data stream;
[0155] Based on the resolutions corresponding to the at least two candidate data packet fragments, candidate data packet fragments that match the target bitrate are selected as the data packet fragments to be played.
[0156] Specifically, in this embodiment of the application, before the bandwidth prediction result is available, the candidate data packet fragment with the lowest resolution can be obtained for playback and adjusted during the playback process.
[0157] Specifically, in the embodiments of this application, the method further includes:
[0158] Obtain the preset live streaming data stream and the device resolution corresponding to the target application;
[0159] In this embodiment of the application, when the target application sends a video playback request to the server for the first time, it can send the device resolution to the server. For example, when a user opens the target application for the first time, the device can send its resolution to the server, which facilitates the server in constructing candidate data packet fragments with different resolutions.
[0160] Based on the device resolution, at least two preset resolutions are determined;
[0161] In this embodiment, the server can determine multiple preset resolutions based on the device resolution, where the preset resolution is less than or equal to the device resolution; thereby ensuring that candidate data packet fragments of various different resolutions can be played normally in the target application.
[0162] Based on the preset live data stream, candidate data packet fragments corresponding to the at least two preset resolutions are generated.
[0163] In this embodiment, the preset live data stream can be a data stream generated by the broadcaster. Candidate data packet fragments are generated through the preset live data stream on the broadcaster's end, which facilitates playback on the viewer's end.
[0164] This embodiment can be applied to online live streaming scenarios, specifically game live streaming, shopping live streaming, and sports live streaming. It ensures low latency while maintaining smooth and high-definition live video, maximizing the user's viewing experience.
[0165] In one specific embodiment, during video playback in the target application, such as Figure 17 As shown, Figure 17This diagram illustrates the switching between different resolution data packet segments to be played. Data packet segments of different resolutions in the video are pre-built. For each data packet segment, a TS file of different resolutions is constructed. The playback content, playback time, and playback sequence number of the TS files at different resolutions are identical. The first TS file has a resolution of 1080P. When the network deteriorates (predicted bandwidth is less than the current bandwidth), the resolution of the second TS file is adjusted to 720P. When the network deteriorates further (predicted bandwidth is even smaller), the resolution of the third TS file is adjusted to 480P. When the network improves (predicted bandwidth is greater than the current bandwidth), the resolution of the fourth TS file is adjusted to 720P. When the network improves further (predicted bandwidth is even greater), the resolution of the fifth TS file is adjusted to 1080P. This allows for adaptive adjustment of the corresponding resolution file for playback based on the predicted bandwidth, thereby achieving adaptive adjustment of the video bitrate.
[0166] In a specific embodiment, such as Figure 18 As shown, Figure 18 This is a schematic diagram of an LHLS low-latency live streaming system. The system includes a live streaming acquisition / encoding module, an access CDN, a transcoding server, CDN downlink, and a viewer-side decoding / rendering module. First, the live streaming acquisition / encoding module acquires the current live stream data, encodes it, and sends it to the live streaming CDN via Real-Time Messaging Protocol (RTMP). The encoded file is then sent to the transcoding server, which transcodes the file before sending it to the viewer-side CDN downlink. The CDN downlink transmits the data to the viewer-side decoding / rendering module via the HTTP chunked protocol, based on the low-latency streaming media protocol. The module decodes the data and renders the page for display on the viewer's end. Chunked transfer encoding is a data transmission mechanism in the Hypertext Transfer Protocol (HTTP) that allows data sent from a web server to a client application to be divided into multiple parts. When a client requests a static page or an image from the server, the server knows the content size and uses the Content-Length message header field to tell the client how much data to receive. However, for dynamic pages, the server cannot know the content size in advance. In this case, the "Transfer-Encoding: chunked" mode can be used to transfer data. That is, if the server needs to generate data and send it to the client at the same time, it needs to use the "Transfer-Encoding: chunked" method for data transmission.
[0167] In a specific embodiment, such as Figure 19 As shown, Figure 19 This chart compares the data download latency at the viewer's end in high-latency and low-latency live streaming scenarios. In high-latency scenarios, each downloaded segment is a complete, pre-generated TS (Timestamp) segment. In low-latency scenarios, however, partial downloaded segments can be sent before a complete segment is fully generated. Clearly, the latency in low-latency live streaming is significantly shorter than in high-latency scenarios. Furthermore, because low-latency scenarios can send partial downloaded segments, fewer video frames are involved, reducing GOP (Group of Pictures) time compared to high-latency scenarios. In low-latency scenarios, playback begins from the last generated TS segment.
[0168] In a specific embodiment, such as Figure 20 As shown, Figure 20 This is the display interface of the target application in the viewer's terminal; where the option corresponding to the resolution is Auto (adaptive bitrate), in which case the bitrate determination method of this embodiment can be implemented.
[0169] In a specific embodiment, such as Figure 21 As shown, Figure 21 This is a structural diagram of a bitrate adaptive adjustment system. In bitrate adaptive adjustment mode, after receiving a response message, the initial bandwidth is calculated by the initial bandwidth calculation module, the calculation result is smoothed by the bandwidth prediction module to obtain the predicted bandwidth, and then the bitrate switching control module obtains the TS file of the target resolution according to the predicted bandwidth request. The buffer module at the viewer end obtains the TS file of the target resolution and renders it through the display module before displaying it.
[0170] In one specific embodiment, different protocols were used to adjust the live streaming parameters, resulting in the comparison results of the live streaming parameters shown in Table 1 below. LHTS (ABR) is the bitrate determination method in this embodiment, ABR is the bitrate adaptive adjustment (Auto enabled), and LHTS is the bitrate prediction method based on the formula Bindwith = Size / Time.
[0171] Table 1
[0172]
[0173] As shown in Table 1, enabling the Auto mode improved the average bitrate in all applications, increasing it by 35% in application 1 and by 16% in application 2, allowing users to watch higher resolution videos. Furthermore, enabling the Auto mode reduced both the secondary buffering ratio (average number of stutters per viewing session) and the average number of stutters per hour; the secondary buffering ratio decreased by 40% in application 1 and by 14% in application 2. The secondary buffering ratio is a parameter for evaluating stuttering, representing the percentage of stutters in the application. For example, if application 1 has 100 users, and 10 users experienced stuttering during video playback, with each user experiencing a different number of stutters, then dividing the total number of stutters by 100 gives the secondary buffering ratio. Therefore, the method in this embodiment improves video clarity in live streaming scenarios, reduces video stuttering, and enhances the user's video viewing experience.
[0174] As can be seen from the technical solutions provided by the embodiments of this application above, the embodiments of this application obtain a traffic data map of the currently processed data packet fragment in the target application; the traffic data map represents the correspondence between data traffic and time in the current data packet fragment; based on the coordinate value range in the traffic data map, a preset window and a preset distance are determined; the preset window is determined based on the starting coordinate point of the traffic data map; based on the preset window and the preset distance, a target traffic data map is determined; based on the target traffic data map, the current predicted bandwidth of the target application is determined; based on the current predicted bandwidth, the target bitrate of the data packet fragment to be played in the target application is determined. This application, by constructing a preset window, achieves rapid and accurate determination of the target traffic data map, thereby accurately predicting the target bitrate of the data packet fragment to be played, ensuring adaptive adjustment of the video bitrate in the target application, and thus ensuring smooth and efficient video playback during live streaming.
[0175] This application also provides a bitrate determination device, such as... Figure 22 As shown, the device includes:
[0176] The traffic data graph acquisition module 2210 is used to acquire the traffic data graph of the currently processed data packet fragment in the target application; the traffic data graph represents the correspondence between data traffic and time in the current data packet fragment;
[0177] The preset window determination module 2220 is used to determine a preset window and a preset distance based on the coordinate value range in the traffic data graph; the preset window is determined based on the starting coordinate point of the traffic data graph.
[0178] The target traffic data map determination module 2230 is used to determine the target traffic data map based on the preset window and the preset distance;
[0179] The current predicted bandwidth determination module 2240 is used to determine the current predicted bandwidth of the target application based on the target traffic data map;
[0180] The target bitrate determination module 2250 is used to determine the target bitrate of the data packet fragment to be played in the target application based on the current predicted bandwidth.
[0181] In some embodiments, the target traffic data map determination module may include:
[0182] The current window determination submodule is used to select the preset window as the current window;
[0183] The current slope calculation submodule is used to calculate the current slope of the current traffic data graph based on the current traffic data graph corresponding to the current window;
[0184] The update window determination submodule is used to move the current window along the preset coordinate axis direction of the traffic data graph by the preset distance to obtain an update window, and then use the update window as the current window again;
[0185] The step repeat submodule is used to repeat the steps of calculating the current slope of the current traffic data graph based on the current traffic data graph corresponding to the current window; to moving the current window along the preset coordinate axis direction of the traffic data graph by the preset distance to obtain an updated window, and using the updated window as the current window again, until the updated window exceeds the range of the traffic data graph;
[0186] The target traffic data map determination submodule is used to determine the target traffic data map based on the current slope corresponding to each current window.
[0187] In some embodiments, the target traffic data map determination submodule may include:
[0188] The sorting unit is used to sort the current windows based on the numerical value of the current slope corresponding to each current window;
[0189] The current target window determination unit is used to determine the current target window from the various current windows based on the sorting results;
[0190] The target traffic data map determination unit is used to determine the corresponding part of the current target window in the traffic data map as the target traffic data map.
[0191] In some embodiments, the current predicted bandwidth determination module may include:
[0192] The time difference determination submodule is used to determine the data flow difference and time difference based on the target flow data map;
[0193] The traffic-time ratio determination submodule is used to calculate the ratio of the data traffic difference to the time difference to obtain the traffic-time ratio;
[0194] The current predicted bandwidth determination submodule is used to determine the current predicted bandwidth of the target application based on the traffic time ratio.
[0195] In some embodiments, the current data packet fragmentation is at least two, and the current predicted bandwidth determination module may include:
[0196] The traffic-time ratio graph construction submodule is used to construct a traffic-time ratio graph based on the traffic-time ratios corresponding to the at least two current data packet fragments.
[0197] The smoothing submodule is used to smooth the traffic time ratio map based on the Kalman filter algorithm to obtain the current predicted bandwidth of the target application.
[0198] In some embodiments, the target bitrate determination module may include:
[0199] The prediction bitrate determination submodule is used to determine the prediction bitrate corresponding to the current prediction bandwidth;
[0200] The current bitrate acquisition submodule is used to acquire the current bitrate of the currently playing data packet segment in the target application;
[0201] The target bitrate determination submodule is used to determine the target bitrate of the data packet fragment to be played in the target application based on the predicted bitrate and the current bitrate.
[0202] In some embodiments, the target bit rate determination submodule may include:
[0203] The first ratio determination unit is configured to determine a first ratio between the current predicted bandwidth and the predicted bit rate if the predicted bit rate is greater than the current bit rate.
[0204] The target bitrate determination unit is used to determine the predicted bitrate as the target bitrate of the data packet segment to be played if the first ratio is greater than the first threshold.
[0205] In some embodiments, the first ratio determining unit may include:
[0206] A bandwidth prediction state determination subunit is used to determine the bandwidth prediction state of a preset data packet fragment if the predicted bit rate is greater than the current bit rate; the preset data packet fragment is a fragment located after the current data packet fragment.
[0207] The first ratio determination subunit is used to determine the first ratio between the current predicted bandwidth and the predicted bit rate if the preset data packet fragmentation is in the bandwidth prediction completion state.
[0208] In some embodiments, the target bit rate determination submodule may include:
[0209] The second ratio determination unit is used to determine a second ratio between the current predicted bandwidth and the predicted bit rate if the predicted bit rate is less than the current bit rate.
[0210] The target bitrate determination unit is used to determine the predicted bitrate as the target bitrate of the data packet segment to be played if the second ratio is less than the second threshold.
[0211] In some embodiments, the apparatus may further include:
[0212] The candidate data packet fragment determination module is used to determine at least two candidate data packet fragments based on the currently playing data packet fragments; the at least two candidate data packet fragments correspond to different resolutions, and the at least two candidate data packet fragments correspond to the same live data stream;
[0213] The data packet fragment filtering module is used to filter out candidate data packet fragments that match the target bitrate based on the resolutions of the at least two candidate data packet fragments, and use them as the data packet fragments to be played.
[0214] In some embodiments, the apparatus may further include:
[0215] The device resolution acquisition module is used to acquire the preset live data stream and the device resolution corresponding to the target application;
[0216] A preset resolution determination module is used to determine at least two preset resolutions based on the device resolution;
[0217] The candidate data packet fragmentation generation module is used to generate candidate data packet fragments corresponding to the at least two preset resolutions based on the preset live data stream.
[0218] The apparatus and method embodiments described herein are based on the same inventive concept.
[0219] This application provides a bitrate determination device, which includes a processor and a memory. The memory stores at least one instruction or at least one program, which is loaded and executed by the processor to implement the bitrate determination method provided in the above method embodiments.
[0220] Embodiments of this application also provide a computer storage medium, which can be disposed in a terminal to store at least one instruction or at least one program related to implementing a bitrate determination method in the method embodiments. The at least one instruction or at least one program is loaded and executed by the processor to implement the bitrate determination method provided in the above method embodiments.
[0221] Embodiments of this application also provide a computer program product or computer program, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the bit rate determination method provided in the above-described method embodiments.
[0222] Optionally, in this embodiment, the storage medium may be located at at least one of the multiple network servers in a computer network. Optionally, in this embodiment, the storage medium may include, but is not limited to, various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.
[0223] The memory described in this application embodiment can be used to store software programs and modules. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory. The memory may mainly include a program storage area and a data storage area. The program storage area may store the operating system, applications required for the functions, etc.; the data storage area may store data created according to the use of the device, etc. In addition, the memory 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 volatile solid-state storage device. Accordingly, the memory may also include a memory controller to provide the processor with access to the memory.
[0224] The bitrate determination method embodiments provided in this application can be executed on mobile terminals, computer terminals, servers, or similar computing devices. Taking running on a server as an example, Figure 23 This is a hardware structure block diagram of a server for a bitrate determination method provided in an embodiment of this application. For example... Figure 23As shown, the server 2300 can vary significantly due to different configurations or performance. It may include one or more central processing units (CPUs) 2310 (CPUs 2310 may include, but are not limited to, microprocessors (MCUs) or programmable logic devices (FPGAs), a memory 2330 for storing data, and one or more storage media 2320 (e.g., one or more mass storage devices) for storing application programs 2323 or data 2322. The memory 2330 and storage media 2320 may be temporary or persistent storage. The program stored in the storage media 2320 may include one or more modules, each module may include a series of instruction operations on the server. Furthermore, the CPU 2310 may be configured to communicate with the storage media 2320 and execute the series of instruction operations stored in the storage media 2320 on the server 2300. Server 2300 may also include one or more power supplies 2360, one or more wired or wireless network interfaces 2350, one or more input / output interfaces 2340, and / or one or more operating systems 2321, such as Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™, etc.
[0225] The input / output interface 2340 can be used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by the communication provider of server 2300. In one example, the input / output interface 2340 includes a network interface controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the input / output interface 2340 may be a radio frequency (RF) module for wireless communication with the Internet.
[0226] Those skilled in the art will understand that Figure 23 The structure shown is for illustrative purposes only and does not limit the structure of the aforementioned electronic device. For example, server 2300 may also include... Figure 23 The more or fewer components shown, or having the same Figure 23 The different configurations shown.
[0227] As can be seen from the embodiments of the bitrate determination method, apparatus, device, or storage medium provided in this application, this application obtains a traffic data map of the currently processed data packet fragment in the target application; the traffic data map represents the correspondence between data traffic and time in the current data packet fragment; based on the coordinate value range in the traffic data map, a preset window and a preset distance are determined; the preset window is determined based on the starting coordinate point of the traffic data map; based on the preset window and the preset distance, a target traffic data map is determined; based on the target traffic data map, the current predicted bandwidth of the target application is determined; based on the current predicted bandwidth, the target bitrate of the data packet fragment to be played in the target application is determined. This application, by constructing a preset window, achieves rapid and accurate determination of the target traffic data map, thereby accurately predicting the target bitrate of the data packet fragment to be played, ensuring adaptive adjustment of the video bitrate in the target application, and thus ensuring smooth and efficient video playback during live streaming.
[0228] It should be noted that the order of the embodiments described above is merely for descriptive purposes and does not represent the superiority or inferiority of the embodiments. Furthermore, specific embodiments have been described above. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps described in the claims can be performed in a different order than that shown in the embodiments and still achieve the desired result. Additionally, the processes depicted in the drawings do not necessarily require a specific or sequential order to achieve the desired result. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0229] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the embodiments of apparatus, devices, and storage media are basically similar to the method embodiments, so the descriptions are relatively simple; relevant parts can be referred to the descriptions of the method embodiments.
[0230] Those skilled in the art will understand that all or part of the steps of the above embodiments can be implemented by hardware or by a program instructing related hardware. The program can be stored in a computer storage medium, such as a read-only memory, a disk, or an optical disk.
[0231] The above description is only a preferred embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.
Claims
1. A method for determining bit rate, characterized in that, The method includes: Obtain the traffic data graph of the currently processed data packet fragment in the target application; the traffic data graph represents the correspondence between the cumulative downloaded data traffic and the download time for the current data packet fragment; Based on the range of coordinate values in the traffic data graph, a preset window and a preset distance are determined; the starting coordinate point of the traffic data graph is used as the starting position of the preset window. The preset window is used as the current window; based on the current traffic data graph corresponding to the current window, the current slope of the current traffic data graph is calculated; The current window is moved by the preset distance along the preset coordinate axis of the traffic data graph to obtain an updated window, and the updated window is used as the current window again. Repeat the steps of calculating the current slope of the current traffic data graph based on the current window; then move the current window along the preset coordinate axis of the traffic data graph by the preset distance to obtain an updated window, and use the updated window as the current window again, until the updated window exceeds the range of the traffic data graph; Based on the numerical value of the current slope corresponding to each current window, the current windows are sorted; based on the sorting result, the current window with the largest current slope is determined as the current target window; the corresponding part of the current target window in the traffic data graph is determined as the target traffic data graph. Based on the target traffic data map, determine the current predicted bandwidth of the target application; Based on the current predicted bandwidth, the target bitrate of the data packet fragments to be played in the target application is determined.
2. The method according to claim 1, characterized in that, Determining the current predicted bandwidth of the target application based on the target traffic data map includes: Based on the target traffic data map, determine the data traffic difference and time difference; Calculate the ratio of the data flow difference to the time difference to obtain the flow-time ratio; Based on the traffic-time ratio, the current predicted bandwidth of the target application is determined.
3. The method according to claim 2, characterized in that, The current data packet is fragmented into at least two segments, and the determination of the current predicted bandwidth of the target application based on the traffic-time ratio includes: Based on the traffic-time ratios corresponding to each of the at least two current data packet fragments, a traffic-time ratio map is constructed. Based on the Kalman filter algorithm, the traffic time ratio graph is smoothed to obtain the current predicted bandwidth of the target application.
4. The method according to claim 1, characterized in that, Determining the target bitrate of the data packet fragments to be played in the target application based on the current predicted bandwidth includes: Determine the prediction bitrate corresponding to the current prediction bandwidth; Obtain the current bitrate of the currently playing data packet segment in the target application; Based on the predicted bitrate and the current bitrate, the target bitrate of the data packet fragment to be played in the target application is determined.
5. The method according to claim 4, characterized in that, Determining the target bitrate of the data packet fragment to be played in the target application based on the predicted bitrate and the current bitrate includes: If the predicted bitrate is greater than the current bitrate, determine a first ratio of the current predicted bandwidth to the predicted bitrate; If the first ratio is greater than the first threshold, the predicted bitrate is determined as the target bitrate of the data packet segment to be played.
6. The method according to claim 5, characterized in that, If the predicted bitrate is greater than the current bitrate, determining a first ratio of the current predicted bandwidth to the predicted bitrate includes: If the predicted bitrate is greater than the current bitrate, determine the bandwidth prediction state of the preset data packet fragment; the preset data packet fragment is the fragment located after the current data packet fragment; If the preset data packet fragmentation is in the bandwidth prediction completion state, determine the first ratio of the current predicted bandwidth to the predicted bit rate.
7. The method according to claim 4, characterized in that, Determining the target bitrate of the data packet fragment to be played in the target application based on the predicted bitrate and the current bitrate includes: If the predicted bitrate is less than the current bitrate, determine a second ratio of the current predicted bandwidth to the predicted bitrate; If the second ratio is less than the second threshold, the predicted bitrate is determined as the target bitrate of the data packet segment to be played.
8. The method according to claim 4, characterized in that, After determining the target bitrate of the data packet fragments to be played in the target application based on the current predicted bandwidth, the method further includes: Based on the currently playing data packet fragments, at least two candidate data packet fragments are determined; the at least two candidate data packet fragments correspond to different resolutions, and the at least two candidate data packet fragments correspond to the same live data stream; Based on the resolutions corresponding to the at least two candidate data packet fragments, candidate data packet fragments that match the target bitrate are selected as the data packet fragments to be played.
9. The method according to claim 8, characterized in that, The method further includes: Obtain the preset live streaming data stream and the device resolution corresponding to the target application; Based on the device resolution, at least two preset resolutions are determined; Based on the preset live data stream, candidate data packet fragments corresponding to the at least two preset resolutions are generated.
10. A bit rate determination device, characterized in that, The device includes: The traffic data graph acquisition module is used to acquire the traffic data graph of the currently processed data packet fragment in the target application; the traffic data graph represents the correspondence between the cumulative downloaded data traffic and the download time for the current data packet fragment; The preset window determination module is used to determine a preset window and a preset distance based on the coordinate value range in the traffic data graph; the starting coordinate point of the traffic data graph is used as the starting position of the preset window. The target traffic data map determination module is used to: use the preset window as the current window; calculate the current slope of the current traffic data map based on the current window; move the current window along the preset coordinate axis of the traffic data map by the preset distance to obtain an updated window, and use the updated window as the current window again; repeat the steps of calculating the current slope of the current traffic data map based on the current window; and moving the current window along the preset coordinate axis of the traffic data map by the preset distance to obtain an updated window, and using the updated window as the current window again, until the updated window exceeds the range of the traffic data map; sort the current windows based on the numerical value of the current slope corresponding to each current window; determine the current window with the largest current slope as the current target window based on the sorting result; and determine the corresponding part of the current target window in the traffic data map as the target traffic data map. The current predicted bandwidth determination module is used to determine the current predicted bandwidth of the target application based on the target traffic data map; The target bitrate determination module is used to determine the target bitrate of the data packet fragments to be played in the target application based on the current predicted bandwidth.
11. The apparatus according to claim 10, characterized in that, The current predicted bandwidth determination module includes: a time difference determination submodule, used to determine the data traffic difference and time difference based on the target traffic data map; a traffic-time ratio determination submodule, used to calculate the ratio of the data traffic difference to the time difference to obtain the traffic-time ratio; and a current predicted bandwidth determination submodule, used to determine the current predicted bandwidth of the target application based on the traffic-time ratio.
12. The apparatus according to claim 11, characterized in that, The current data packet is fragmented into at least two segments. The current predicted bandwidth determination module includes: a traffic-time ratio map construction submodule, used to construct a traffic-time ratio map based on the traffic-time ratio corresponding to each of the at least two current data packet fragments; and a smoothing processing submodule, used to smooth the traffic-time ratio map based on the Kalman filter algorithm to obtain the current predicted bandwidth of the target application.
13. The apparatus according to claim 10, characterized in that, The target bitrate determination module includes: a predicted bitrate determination submodule, used to determine the predicted bitrate corresponding to the current predicted bandwidth; a current bitrate acquisition submodule, used to acquire the current bitrate of the currently playing data packet fragment in the target application; and a target bitrate determination submodule, used to determine the target bitrate of the data packet fragment to be played in the target application based on the predicted bitrate and the current bitrate.
14. The apparatus according to claim 13, characterized in that, The target bitrate determination submodule includes: a first ratio determination unit, configured to determine a first ratio between the current predicted bandwidth and the predicted bitrate if the predicted bitrate is greater than the current bitrate; and a target bitrate determination unit, configured to determine the predicted bitrate as the target bitrate of the data packet segment to be played if the first ratio is greater than a first threshold.
15. The apparatus according to claim 14, characterized in that, The first ratio determination unit includes: a bandwidth prediction state determination subunit, used to determine the bandwidth prediction state of a preset data packet fragment if the predicted bit rate is greater than the current bit rate; the preset data packet fragment is a fragment located after the current data packet fragment; and a first ratio determination subunit, used to determine a first ratio between the current predicted bandwidth and the predicted bit rate if the preset data packet fragment is in a bandwidth prediction completion state.
16. The apparatus according to claim 13, characterized in that, The target bitrate determination submodule includes: a second ratio determination unit, configured to determine a second ratio between the current predicted bandwidth and the predicted bitrate if the predicted bitrate is less than the current bitrate; and a target bitrate determination unit, configured to determine the predicted bitrate as the target bitrate of the data packet segment to be played if the second ratio is less than a second threshold.
17. The apparatus according to claim 13, characterized in that, The device further includes: The candidate data packet fragment determination module is used to determine at least two candidate data packet fragments based on the currently playing data packet fragments; the at least two candidate data packet fragments correspond to different resolutions and the at least two candidate data packet fragments correspond to the same live data stream; the data packet fragment filtering module is used to filter out candidate data packet fragments that match the target bitrate according to the resolutions corresponding to the at least two candidate data packet fragments, and use them as the data packet fragments to be played.
18. The apparatus according to claim 17, characterized in that, The device further includes: The device resolution acquisition module is used to acquire a preset live data stream and the device resolution corresponding to the target application; the preset resolution determination module is used to determine at least two preset resolutions based on the device resolution; and the candidate data packet fragmentation generation module is used to generate candidate data packet fragments corresponding to the at least two preset resolutions based on the preset live data stream.
19. A bit rate determination device, characterized in that, The device includes a processor and a memory, the memory storing at least one instruction or at least one program, the at least one instruction or at least one program being loaded and executed by the processor to implement the bit rate determination method as described in any one of claims 1-9.
20. A computer storage medium, characterized in that, The computer storage medium stores at least one instruction or at least one program, which is loaded and executed by a processor to implement the bit rate determination method as described in any one of claims 1-9.
21. A computer program product comprising computer instructions, characterized in that, When the computer instructions are executed by the processor, they implement the bit rate determination method as described in any one of claims 1-9.