A method, device, computer device, medium and program product for determining available bandwidth

By using the average rate of change of bitrate to divide the window for bandwidth calculation in adaptive bitrate technology, the problem of bandwidth calculation accuracy in multimedia file playback is solved, improving smoothness and user experience.

CN123164285APending Publication Date: 2026-11-24TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510670906.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-22
Publication Date
2026-11-24

AI Technical Summary

Technical Problem

In existing technologies, bandwidth calculation methods based on multimedia files have low accuracy under adaptive bitrate technology, resulting in poor playback smoothness and user experience of multimedia files.

Method used

By obtaining the average rate of change of bitrate of multimedia file fragments, the window size and sliding distance are determined, multiple windows are divided to calculate the available bandwidth, and bandwidth measurement is dynamically adjusted to cope with network fluctuations, thereby improving the accuracy of bandwidth calculation.

Benefits of technology

It improves the smoothness of multimedia file playback and user experience, enhances bandwidth utilization, and avoids the impact of abnormal traffic on bandwidth calculation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123164285A_ABST
    Figure CN123164285A_ABST
Patent Text Reader

Abstract

This application discloses a method, apparatus, computer device, medium, and program product for determining available bandwidth. Taking the i-th segment of a multimedia file as an example, the method obtains the average bitrate change rate of the i-th segment. Based on the average bitrate change rate of the i-th segment, the window size and sliding distance for measuring the available bandwidth of the i-th segment are determined. This allows for adaptive adjustment of the window size and sliding distance according to traffic fluctuations during download, improving the accuracy of subsequent available bandwidth measurements. Based on the window size and sliding distance of the i-th segment, the download process of the i-th segment is divided into multiple windows, and the sub-available bandwidth corresponding to each window is calculated. Based on the sub-available bandwidth corresponding to the i-th segment in each window, the available bandwidth of the i-th segment is comprehensively determined. This improves the accuracy of determining available bandwidth, thereby improving the smoothness of multimedia file playback and enhancing the user experience.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of Internet technology, and in particular to a method, apparatus, computer equipment, medium, and program product for determining available bandwidth. Background Technology

[0002] Bandwidth refers to the maximum amount of data a network can transmit. It determines how much data a network can transmit per unit of time and directly affects the network's capacity and throughput.

[0003] In related technologies, the bandwidth for transmitting a multimedia file can be obtained based on the ratio of the size of the multimedia file to the time required to transmit the video.

[0004] However, with the continuous innovation driven by the media industry, the same multimedia file can be split into multiple video segments for transmission, resulting in lower accuracy of bandwidth calculation methods in related technologies. Summary of the Invention

[0005] To address the aforementioned technical problems, this application provides a method, apparatus, computer device, medium, and program product for determining available bandwidth, which improves the accuracy of determining available bandwidth during multimedia file transmission.

[0006] The embodiments of this application disclose the following technical solutions:

[0007] On one hand, embodiments of this application provide a method for determining available bandwidth, the method comprising:

[0008] For the i-th segment among multiple segments included in a multimedia file, obtain the average bitrate change rate of the i-th segment, where i is a positive integer;

[0009] Based on the average rate of change of the bitrate of the i-th slice, determine the window size and the sliding distance of the i-th slice;

[0010] Based on the window size and sliding distance of the i-th slice, calculate the sub-available bandwidth corresponding to the i-th slice in each window, wherein the window is determined based on the window size and the sliding distance;

[0011] The available bandwidth of the i-th slice is determined based on the sub-available bandwidth corresponding to each window of the i-th slice.

[0012] On the other hand, embodiments of this application provide an apparatus for determining available bandwidth, the apparatus comprising: an acquisition unit, a determination unit, and a calculation unit;

[0013] The acquisition unit is used to acquire the average bitrate change rate of the i-th segment among the multiple segments included in the multimedia file, where i is a positive integer;

[0014] The determining unit is used to determine the window size and sliding distance of the i-th slice based on the average rate of change of the bitrate of the i-th slice.

[0015] The calculation unit is used to calculate the sub-available bandwidth corresponding to the i-th slice in each window based on the window size of the i-th slice and the sliding distance of the i-th slice, wherein the window is determined based on the window size and the sliding distance;

[0016] The determining unit is further configured to determine the available bandwidth of the i-th slice based on the sub-available bandwidth corresponding to the i-th slice in each window.

[0017] On the other hand, embodiments of this application provide a computer device, the computer device including a processor and a memory:

[0018] The memory is used to store computer programs and to transfer the computer programs to the processor;

[0019] The processor is configured to execute the methods described above according to instructions in the computer program.

[0020] On the other hand, embodiments of this application provide a computer-readable storage medium for storing a computer program for performing the methods described above.

[0021] On the other hand, embodiments of this application provide a computer program product including a computer program, which, when run on a computer device, causes the computer device to perform the methods described above.

[0022] As can be seen from the above technical solution, for scenarios involving multimedia file transmission based on adaptive bitrate technology, whether the available bandwidth is being effectively utilized can be reflected by whether there are abnormal traffic patterns. These abnormal traffic patterns can be reflected by the average bitrate change rate. Therefore, the available bandwidth can be calculated using the average bitrate change rate. The following explanation uses the i-th segment of a multimedia file as an example. The average bitrate change rate of the i-th segment is obtained. Based on this rate, the window size and sliding distance for measuring the available bandwidth of the i-th segment are determined. This allows for adaptive adjustment of the window size and sliding distance based on traffic fluctuations during the download process, improving the accuracy of subsequent available bandwidth measurements. Based on the window size and sliding distance of the i-th segment, the download process of the i-th segment is divided into multiple windows, and the sub-available bandwidth corresponding to each window is calculated. Based on the sub-available bandwidth corresponding to the i-th segment in each window, the available bandwidth of the i-th segment is comprehensively determined. Therefore, instead of calculating available bandwidth based on the entire segment, the segment is divided into multiple windows, and the available bandwidth is calculated based on the sub-available bandwidth of these windows to cope with the dynamic changes in available bandwidth during the download of segments. Furthermore, bandwidth is no longer calculated based on bitrate, but rather on the average bitrate change rate, which dynamically adjusts the window size and sliding distance required for bandwidth calculation. This ensures more balanced fluctuations in available bandwidth within each window, avoiding the impact of traffic anomalies, improving the accuracy of determining available bandwidth, and consequently improving the smoothness of multimedia file playback and enhancing the user experience. Attached Figure Description

[0023] 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, 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.

[0024] Figure 1 This is a schematic diagram illustrating bit rate and available bandwidth in related technologies;

[0025] Figure 2 A schematic diagram of a computer system for a method of determining available bandwidth provided in an embodiment of this application;

[0026] Figure 3 A schematic diagram illustrating an application scenario of a method for determining available bandwidth provided in an embodiment of this application;

[0027] Figure 4 A flowchart illustrating a method for determining available bandwidth provided in an embodiment of this application;

[0028] Figure 5A schematic diagram illustrating a traffic anomaly provided in an embodiment of this application;

[0029] Figure 6 A schematic diagram illustrating a method for determining available bandwidth provided in an embodiment of this application;

[0030] Figure 7 A schematic diagram illustrating an available bandwidth as provided in an embodiment of this application;

[0031] Figure 8 A schematic diagram illustrating the live video stream transfer provided in an embodiment of this application;

[0032] Figure 9 A schematic diagram illustrating another live video stream transfer method provided in this application embodiment;

[0033] Figure 10 A schematic diagram illustrating a video stream transfer as provided in an embodiment of this application;

[0034] Figure 11 A schematic diagram illustrating a scenario for determining available bandwidth, provided as an embodiment of this application;

[0035] Figure 12 This application provides a schematic diagram of the structure of a device for determining available bandwidth;

[0036] Figure 13 This application provides a schematic diagram of the structure of a server according to an embodiment of the present application.

[0037] Figure 14 This is a schematic diagram of the structure of a terminal device provided in an embodiment of this application. Detailed Implementation

[0038] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings.

[0039] As the media industry continues to drive innovation, streaming media servers offer multiple quality file formats for the same multimedia file. For example, video files can be in different quality formats such as 720p, 1080p, and 4K. Compared to 720p, 1080p video frames are 2.25 times larger, and 4K video frames are 4.5 times larger. To ensure optimal playback quality, different quality multimedia files are transmitted at different bitrates, requiring different bandwidths. As the quality of multimedia files increases, the bandwidth required to download them gradually rises, leading to a significant increase in delivery costs.

[0040] Therefore, for downloading multimedia files for online playback, a multimedia file can be divided into multiple smaller segments, so that each segment can be delivered or downloaded by the player independently, instead of downloading the entire multimedia file at once. During the download of multiple segments, Adaptive Bitrate Streaming (ABR) technology is employed. Continuing with the example of video, let's assume the video is encoded according to the bitrate steps shown in Table 1.

[0041] Table 1

[0042] File format Bitrate 1080p 5.0 Mbps 720p 4.0 Mbps 640p 3.2 Mbps 480p 2.0 Mbps 270p 1.0 Mbps

[0043] When the player starts playing video, let's assume it measures an available bandwidth of 20 Mbps, which is significantly higher than the maximum bitrate of 5 Mbps. Therefore, the player can safely download the first segment (video clip) with a maximum bitrate of 5 Mbps. The player then measures the available bandwidth again; if it's still high, it will use the maximum bitrate when requesting the next segment. If the available bandwidth suddenly drops to 5 Mbps, the player will request a segment with a bitrate of 4 Mbps from the streaming server, as requesting a 5 Mbps segment risks interrupting playback. The player will then receive and play the 4 Mbps segment.

[0044] In other words, network conditions are not static; available bandwidth changes dynamically over time. The player can request appropriately quality video clips based on the measured available bandwidth, thus maximizing the playback of multimedia files. Therefore, more accurate measurement of available bandwidth can improve the smoothness of multimedia file playback and enhance the user experience.

[0045] In related technologies, for scenarios where the bitrate of each segment is adjusted based on adaptive bitrate technology, the available bandwidth is measured for each segment of the multimedia file during bandwidth testing. Specifically, the available bandwidth is determined based on the bitrate and download time of each segment, resulting in the obtained available bandwidth being only slightly higher than the bitrate of the multimedia file. Figure 1 As shown, subsequent segments based on this measurement result cannot switch to a high bitrate. In other words, adaptive bitrate technology aims to provide users with a smooth viewing experience by continuously monitoring network conditions and dynamically adjusting the bitrate of multimedia files. However, its core objective is to ensure that multimedia files do not stutter, rather than measuring the maximum value of currently available bandwidth, resulting in lower accuracy in determining available bandwidth.

[0046] Based on this, embodiments of this application provide a method for determining available bandwidth. Instead of calculating available bandwidth as a whole for each segment, the method divides the segment into multiple windows and calculates the available bandwidth based on the sub-available bandwidth of each window, thus addressing the dynamic changes in available bandwidth during the download of segments. Furthermore, instead of calculating bandwidth based on bitrate, the method dynamically adjusts the window size and sliding distance required for bandwidth calculation based on the average bitrate change rate. This ensures more balanced fluctuations in available bandwidth within each window, avoiding the impact of traffic anomalies, improving the accuracy of determining available bandwidth, and consequently improving the smoothness of multimedia file playback and enhancing the user experience.

[0047] It should be noted that this application may display prompt interfaces, pop-ups, or output voice prompts before and during the collection of user-related data (such as multimedia files). These prompt interfaces, pop-ups, or voice prompts are used to inform the user that their relevant data is being collected. This ensures that the application only begins the steps for collecting user-related data after receiving confirmation from the user regarding the prompt interface or pop-up; otherwise (i.e., without receiving confirmation from the user), the steps for collecting user-related data end, meaning no user-related data is collected. In other words, all user data collected in this application is collected with the user's consent and authorization, and the collection, use, and processing of relevant user data must comply with the relevant laws, regulations, and standards of the relevant countries and regions.

[0048] To facilitate understanding of the method for determining available bandwidth provided in the embodiments of this application, the computer system for this method will be described below.

[0049] See Figure 2 This figure is a schematic diagram of a computer system for a method of determining available bandwidth provided in an embodiment of this application. The computer system 100 includes a terminal device 110 and a server 120, which can communicate with each other through a communication network.

[0050] The communication network uses standard communication technologies and / or protocols, typically the Internet, but can also be any network, including but not limited to Bluetooth, local area network (LAN), metropolitan area network (MAN), wide area network (WAN), mobile, private network, or any combination of virtual private network. In some embodiments, custom or dedicated data communication technologies may be used to replace or supplement the aforementioned data communication technologies.

[0051] The terminal device can be an electronic device such as a smartphone, wearable device, personal computer (PC), intelligent voice interaction device, smart home appliance, vehicle terminal, aircraft, unmanned vending terminal, extended reality (XR) device, etc. XR devices can include virtual reality (VR) devices, augmented reality (AR) devices, mixed reality (MR) devices, etc. A client application for the target application can be installed and run on the terminal device. This target application can be an application that supports playing multimedia files, or other applications that support multimedia file creation, storage, and display; this application does not limit this. The subject matter disclosed in this application is equally applicable to other applications that support video, including, for example, video conferencing, digital TV, and storing compressed video on digital media including CDs (Compact Discs), DVDs (Digital Versatile Discs), memory sticks, etc. Furthermore, this application does not limit the form of the target application, including but not limited to applications (Apps) installed on the terminal device, applets, etc., and can also be in the form of web pages.

[0052] A server can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services such as cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDNs), and basic cloud computing services such as big data. A server can be a backend server for the aforementioned target application, providing background services to the client of the target application, such as multimedia file download services.

[0053] To facilitate understanding of the method for determining available bandwidth provided in the embodiments of this application, the following example uses a terminal device as the execution subject of the method for determining available bandwidth to illustrate the application scenarios of the method for determining available bandwidth.

[0054] See Figure 3 This figure is a schematic diagram illustrating an application scenario of a method for determining available bandwidth provided in an embodiment of this application. Figure 3 In this application scenario, there is a terminal device 110 and a server 120.

[0055] For the scenario of downloading multimedia files from server 120 based on adaptive bitrate technology, the following explanation uses the i-th segment among the multiple segments of the multimedia file as an example.

[0056] Terminal device 110 obtains the i-th segment from server 120, along with the average bitrate change rate of the i-th segment. The average bitrate change rate helps determine if any traffic anomalies have occurred, thus assessing whether the dynamically changing available bitrate is being fully utilized. Based on the average bitrate change rate of the i-th segment, terminal device 110 determines the window size and sliding distance for measuring the available bandwidth of the i-th segment. This allows for adaptive adjustment of the window size and sliding distance based on traffic fluctuations during download, improving the accuracy of subsequent available bandwidth measurements. (See also...) Figure 3 The figure shows the data transfer rate per second for downloading the i-th fragment. The window size is 3, the sliding distance is 4, and the window size can be increased when the average bitrate change rate increases.

[0057] Based on the window size and sliding distance of the i-th segment, terminal device 110 divides the download process of the i-th segment into multiple windows and calculates the sub-available bandwidth corresponding to each window. Terminal device 110 comprehensively determines the available bandwidth of the i-th segment based on the sub-available bandwidth corresponding to each window, such as determining the largest sub-available bandwidth among multiple sub-available bandwidths as the available bandwidth of the i-th segment.

[0058] After determining the available bandwidth of the i-th fragment, terminal device 110 can use this available bandwidth to determine the bitrate of the (i+1)-th fragment, and then download the (i+1)-th fragment from server 120 based on the determined bitrate. For example, terminal device 110 sends the available bandwidth of the (i+1)-th fragment to server 120, server 120 determines the bitrate of the (i+1)-th fragment based on the available bandwidth, and then sends the (i+1)-th fragment with that bitrate to terminal device 110. See also... Figure 3 After determining the available bandwidth of the i-th segment, the terminal device 110 determines the bitrate of the (i+1)-th segment and sends the bitrate of the (i+1)-th segment to the server 120 so that it can download the (i+1)-th segment with the corresponding bitrate from the server 120. This process is repeated to achieve the download of multimedia files.

[0059] Therefore, instead of calculating available bandwidth based on the entire segment, the segment is divided into multiple windows, and the available bandwidth is calculated based on the sub-available bandwidth of these windows to cope with the dynamic changes in available bandwidth during the download of segments. Furthermore, bandwidth is no longer calculated based on bitrate, but rather on the average bitrate change rate, which dynamically adjusts the window size and sliding distance required for bandwidth calculation. This ensures more balanced fluctuations in available bandwidth within each window, avoiding the impact of traffic anomalies, improving the accuracy of determining available bandwidth, and consequently improving the smoothness of multimedia file playback and enhancing the user experience.

[0060] The method for determining available bandwidth provided in this application embodiment can be executed by a terminal device. However, in other embodiments of this application, the server may also have similar functions to the terminal device to execute the method for determining available bandwidth provided in this application embodiment, or the terminal device and the server may jointly execute the method for determining available bandwidth provided in this application embodiment. This embodiment does not limit this to any particular method.

[0061] The method for determining available bandwidth provided in this application can be applied to various scenarios. Two scenarios are given below as examples.

[0062] Scenario 1: Watching live streams using XR devices.

[0063] Users begin using live streaming applications installed on XR devices to watch live streams in immersive scenarios. These applications can be for game streaming, personal shows, sports events, online education, online meetings, etc., and this application does not specifically limit their applications. Thus, live streaming applications installed on XR devices can enable virtual theme parks, virtual classrooms, and more. A virtual theme park refers to users experiencing entertainment activities such as virtual theme parks and virtual concerts at home using XR devices. A virtual classroom is created using XR devices, allowing students to interact and learn through virtual reality, which is particularly suitable for distance education.

[0064] When watching live streams using XR devices, users require high definition and low latency. Therefore, adaptive bitrate technology can be used for video transmission. The method for determining available bandwidth provided in this application improves the accuracy of available bandwidth testing, allowing for adjustments to the video bitrate based on available bandwidth. This results in higher bandwidth utilization, improved live stream viewing quality, and enhanced user experience.

[0065] Scenario 2: Cloud gaming based on terminal devices.

[0066] In cloud gaming, all games run on the server side, and the rendered game footage is compressed and transmitted to the user over the network. On the client side, the user's gaming device does not need any high-end processors or graphics cards; only basic video decompression capabilities are required.

[0067] To provide users with a better gaming experience, it is necessary to ensure low latency in the transmission of game footage from the server to the client. This can be achieved through adaptive bitrate technology for video transmission. The method for determining available bandwidth provided in this application improves the accuracy of available bandwidth testing, allowing for adjustments to the video bitrate based on available bandwidth. This results in higher utilization of available bandwidth, improved live streaming viewing quality, and enhanced user experience.

[0068] It should be noted that the above application scenarios are merely examples, and the method for determining available bandwidth provided in this embodiment can also be applied to other scenarios, which are not limited here.

[0069] The following describes in detail a method for determining available bandwidth provided in this application through method embodiments.

[0070] See Figure 4 This figure is a flowchart illustrating a method for determining available bandwidth according to an embodiment of this application. For ease of description, the following embodiments use a terminal device as an example to illustrate the execution of this method for determining available bandwidth. Figure 4 As shown, the method for determining the available bandwidth includes S401-S404.

[0071] S401: For the i-th segment among multiple segments included in a multimedia file, obtain the average bitrate change rate of the i-th segment.

[0072] Multimedia files are collections of binary data stored in a computer as files, representing various encoded data types of media. Multimedia files can include video, audio, and other formats.

[0073] A multimedia file can be split into segments, each segment being a chunk. Taking video as an example, a continuous video stream can be cut into independent files (such as MP4 / TS segments) based on time or size. Each chunk contains video data of a fixed duration (e.g., 2-10 seconds) or a fixed amount of data. This allows multimedia files to be divided into multiple chunks, enabling the conversion of larger multimedia files into independently transmittable "data blocks," supporting on-demand requests and dynamic scheduling.

[0074] The following explanation uses the i-th slice among multiple slices as an example, where i is a positive integer.

[0075] The average rate of change is the average rate of change of the bitrate. The average rate of change is the ratio of the increment of y to the increment of x. It can be used to observe the rate of change of a function and how the function changes. Therefore, the average rate of change describes the change of bitrate over a period of time. For example, if the bitrate at time t1 is m1 and the bitrate at time t2 is m2, then the rate of change can be expressed as (m2-m1) / (t2-t1).

[0076] It's important to note that available bandwidth determines the upper limit of data transmission capacity. Available bandwidth can be understood as the "channel width" of network data transmission, which determines the amount of data that can be transmitted per unit of time. For example, a network with an available bandwidth of 100Mbps (100Mbps ÷ 8 = 12.5MB / s) can theoretically transmit a maximum of 12.5MB of data per second. Data traffic, on the other hand, is the actual total amount of data transmitted through the network, and it is limited by available bandwidth. If available bandwidth is insufficient, even with a large amount of data to be transmitted, it cannot be completed in a short time, resulting in slow data transmission.

[0077] Therefore, the data traffic consumed during the download of multimedia files is a direct reflection of the utilization of available bandwidth. By statistically analyzing data traffic consumption over a period of time, one can roughly understand the usage of available bandwidth during that period. Higher data traffic consumption indicates that available bandwidth is being utilized effectively; conversely, lower data traffic consumption may mean that available bandwidth is not being fully utilized, or that network congestion is causing limitations in actual download speed. Changes in data traffic also reflect fluctuations in available bandwidth. In unstable network conditions, available bandwidth will constantly change, resulting in fluctuations in data traffic consumption rates.

[0078] When abnormal traffic occurs, it generally indicates a change in the efficiency of available bandwidth utilization. For example, traffic far exceeding expectations may lead to network congestion, affecting other normal network applications. Available bandwidth is occupied by abnormal traffic and cannot be properly allocated to tasks such as video downloads. Conversely, traffic far below expectations or fluctuating abnormally indicates that available bandwidth is not being fully utilized, resulting in resource waste.

[0079] Bitrate refers to the amount of data transmitted per unit of time, while bandwidth is the total amount of data transmitted over a network within a certain time. Bandwidth is the cumulative result of bitrate over time, i.e., bandwidth = bitrate × time. Therefore, the average rate of change in bitrate can indicate whether bandwidth is abnormal. If the network is unstable, the bitrate may frequently change abruptly. This rapid change in bitrate will cause significant fluctuations in bandwidth. For example, during playback, if the bitrate suddenly drops from 2 Mbps to 0.5 Mbps and then quickly rises back to 2 Mbps, bandwidth growth will be slower during the period of bitrate decrease, and will increase rapidly again when the bitrate recovers.

[0080] See Figure 5 This figure is a schematic diagram of a traffic anomaly provided in an embodiment of this application. Figure 5 The diagram illustrates the time-bitrate relationship for three different traffic anomalies, demonstrating how the average bitrate change rate can identify traffic anomalies. Normal bitrate adjustments should be gradual (e.g., when the video adaptive bitrate changes from 720p to 1080p, the bitrate smoothly increases to 5Mbps). Figure 5 As shown in Figure (A), the bitrate increase has no clear dividing point, making it impossible to fully utilize available bandwidth for downloading, thus resulting in abnormal traffic. Figure 5 As shown in Figure (B) as an example, the bitrate remains constant for a short period (e.g., seconds), then suddenly jumps to another constant value, forming a sawtooth curve similar to a "step," i.e., a step-like abrupt change, thus causing abnormal traffic. Figure 5 As shown in Figure (C), the bitrate has been fluctuating within a small threshold, possibly due to insufficient cache, which prevents the download of too much content and makes full use of available bandwidth, resulting in abnormal traffic.

[0081] In other words, whether available bandwidth is being used effectively can be reflected by whether traffic is abnormal, and whether traffic is abnormal can be reflected by the average bitrate change rate. Therefore, available bandwidth can be calculated using the average bitrate change rate. This will be explained in detail below.

[0082] S402: Determine the window size and sliding distance of the i-th slice based on the average rate of change of the bitrate of the i-th slice.

[0083] In the sliding window algorithm, a window is a contiguous subsequence range defined by two boundaries (pointers), containing all elements from the left to the right boundary. In this embodiment, the elements within the window represent the amount of data transmitted per unit time, such as the amount of data transmitted per second.

[0084] The window size is the number of elements contained within the window; it is the number of elements between the right and left boundaries of the window. The window size can be fixed or dynamically adjusted according to the algorithm logic. The transmission time can be determined by the window size.

[0085] The sliding distance refers to the step size (i.e. the number of elements moved) of the left or right boundary when the window moves on the data sequence. The sliding distance can be used to control the number of calculations of the available bandwidth.

[0086] It's important to note that the network environment is dynamic, and the actual available bandwidth is affected by various factors, such as network congestion, link failures, and routing changes. Using a sliding window allows for real-time monitoring of these changes and timely adjustments to measurement parameters, thus more accurately reflecting the current available bandwidth. The ratio of data transmission volume to the available bandwidth during a given period yields the available bandwidth for that period. Therefore, selecting an appropriate timeframe for calculation is crucial for improving accuracy.

[0087] As mentioned above, whether the available bandwidth is being used effectively can be reflected by whether the traffic is abnormal, and whether the traffic is abnormal can be reflected by the average bitrate change rate. Therefore, the available bandwidth can be calculated by the average bitrate change rate, that is, the size of the appropriate time period can be determined by the average bitrate change rate. The appropriate time period can be obtained by the window size and the sliding distance, and thus the window size and sliding distance can be determined by the average bitrate change rate.

[0088] As one possible implementation, if the average rate of change of bitrate increases, it means that the fluctuation amplitude and frequency of bitrate per unit time increases. Since traffic is the accumulation of bitrate over time, traffic will also increase or decrease significantly in a short period of time, resulting in traffic anomalies. The available bandwidth will also fluctuate significantly in a short period of time, meaning that the available bandwidth is not being used effectively.

[0089] Therefore, to make the calculation of available bandwidth more accurate, it is necessary to consider more fluctuations to comprehensively determine the available bandwidth. This involves increasing the window size and / or increasing the sliding distance. Increasing the window size allows more fluctuations to be included within a single window, smoothing out short-term fluctuations. Increasing the sliding distance covers a wider time range more quickly, enhancing trend-following capabilities and preventing a single fluctuation from significantly impacting the calculation of available bandwidth, thus improving the accuracy of the calculation. Furthermore, to ensure that the window size does not increase indefinitely, a window size cap can be set, such as 20 seconds, to guarantee the real-time performance of the available bandwidth calculation.

[0090] Similarly, if the average rate of change in bitrate decreases, it usually indicates that network conditions are stabilizing. In this case, the window size and / or sliding distance can be reduced. Reducing the window size allows for faster adaptation to potential small-scale fluctuations, while reducing the sliding distance allows for more frequent updates to bitrate decisions, thus improving decision accuracy. Furthermore, to prevent the window size from decreasing indefinitely, a lower limit can be set, such as 5 seconds, to ensure the accuracy of available bandwidth calculations. Additionally, the lower limit should be less than the upper limit.

[0091] One possible implementation is to adjust the window size and / or sliding distance based on the average bitrate change rate to obtain the calculated window size and sliding distance for the segment. Alternatively, the window size and / or sliding distance can be adjusted based on the average bitrate change rate and network latency to jointly determine the window size and sliding distance for the segment. For example, the window size and sliding distance for the i-th segment can be determined based on the average bitrate change rate and network latency of the i-th segment.

[0092] Specifically, if the average rate of change in bitrate increases, the window size and / or sliding distance should be increased; if the average rate of change in bitrate decreases, the window size and / or sliding distance should be decreased. If network latency increases, it indicates that available bandwidth is not being fully utilized. In this case, the window size and / or sliding distance can be increased to reduce the impact of network latency on available bandwidth and improve the accuracy of available bandwidth calculation. Similarly, if network latency decreases, it indicates that the fluctuation of available bandwidth is smaller, and the window size and / or sliding distance can be decreased to improve the accuracy of available bandwidth calculation.

[0093] S403: Based on the window size of the i-th slice and the sliding distance of the i-th slice, calculate the sub-available bandwidth corresponding to the i-th slice in each window.

[0094] The download process of the i-th fragment can be described as the amount of data transmitted in the i-th fragment over time, such as the amount of data transmitted in the first second, the amount of data transmitted in the second second, etc. After determining the window size and sliding distance, the window can be defined, and the download process of the i-th fragment can be divided into multiple windows. For example, if the i-th fragment is downloaded over a period of 6 seconds, the data transmission rate per second (in bits, the data transmission rate per second is the difference from the previous second) for the i-th fragment is 5, 6, 7, 8, 9, and 10. If the window size is 2 and the sliding distance is 2, then windows containing 5 and 6, windows containing 7 and 8, and windows containing 9 and 10 can be obtained. If the window size is 3 and the sliding distance is 3, then windows containing 5, 6, and 7, and windows containing 8, 9, and 10 can be obtained.

[0095] Each window describes the change in data transmission volume over a period of time. The sub-available bandwidth corresponding to this window can be calculated based on the ratio of data transmission volume to time duration. For example, the sub-available bandwidth of the window including windows 5 and 6 is (5+6) / 2 = 6. Similarly, the available bandwidth of the window including windows 8, 9, and 10 is (8+9+10) / 3 = 9.

[0096] S404: Determine the available bandwidth of the i-th fragment based on the sub-available bandwidth corresponding to the i-th fragment in each window.

[0097] Available bandwidth is the bandwidth that can actually be used for data transmission in a network. It changes dynamically due to various factors such as network congestion, signal interference, and equipment performance.

[0098] After obtaining the sub-available bandwidth corresponding to the i-th slice in each window, the available bandwidth of the i-th slice can be determined by combining the sub-available bandwidths corresponding to the i-th slice in each window. This application does not specifically limit the method of determining available bandwidth based on multiple sub-available bandwidths. For example, outliers can be removed from the multiple sub-available bandwidths, and the available bandwidth can be determined based on the average value of the multiple sub-available bandwidths, thereby improving the accuracy of available bandwidth calculation. Alternatively, the largest sub-available bandwidth among the multiple sub-available bandwidths can be determined as the available bandwidth, such as determining the available bandwidth of the i-th slice by taking the largest sub-available bandwidth corresponding to the i-th slice in each window. Therefore, while network bandwidth resources are limited, the available bandwidth may differ across different paths or at different times. By selecting the largest sub-available bandwidth, the currently available resources in the network can be utilized more fully, avoiding resource waste. Moreover, network conditions are dynamic, and the sub-available bandwidth corresponding to different times and windows may change. Choosing the largest available sub-bandwidth can adapt to these changes to some extent, ensuring that data transmission can make the most of the current favorable network conditions, guaranteeing that the available bandwidth can meet download demands, and improving the smoothness of multimedia file playback.

[0099] As can be seen from the above technical solution, for scenarios involving multimedia file transmission based on adaptive bitrate technology, whether the available bandwidth is effectively utilized can be reflected by whether the traffic is abnormal, and whether the traffic is abnormal can be reflected by the average bitrate change rate. Therefore, the available bandwidth can be calculated using the average bitrate change rate. The following explanation uses the i-th segment among multiple segments of a multimedia file as an example. The average bitrate change rate of the i-th segment is obtained. Based on the average bitrate change rate of the i-th segment, the window size and sliding distance for measuring the available bandwidth of the i-th segment are determined. This allows for adaptive adjustment of the window size and sliding distance according to traffic fluctuations during the download process, improving the accuracy of subsequent available bandwidth measurements. Based on the window size and sliding distance of the i-th segment, the download process of the i-th segment is divided into multiple windows, and the sub-available bandwidth corresponding to each window is calculated. Based on the sub-available bandwidth corresponding to the i-th segment in each window, the available bandwidth of the i-th segment is comprehensively determined. Therefore, instead of calculating available bandwidth based on the entire segment, the segment is divided into multiple windows, and the available bandwidth is calculated based on the sub-available bandwidth of these windows to cope with the dynamic changes in available bandwidth during the download of segments. Furthermore, bandwidth is no longer calculated based on bitrate, but rather on the average bitrate change rate, which dynamically adjusts the window size and sliding distance required for bandwidth calculation. This ensures more balanced fluctuations in available bandwidth within each window, avoiding the impact of traffic anomalies, improving the accuracy of determining available bandwidth, and consequently improving the smoothness of multimedia file playback and enhancing the user experience.

[0100] As mentioned above, the available bandwidth measured in related technologies is only slightly higher than the bitrate. This means that regardless of changes in available bandwidth, a higher bitrate cannot be switched, resulting in low utilization efficiency of the available bandwidth. Consequently, it is impossible to improve the quality of multimedia files while ensuring smooth playback. In other words, the embodiments of this application focus more on situations where available bandwidth is not fully utilized. Specifically, the availability of bandwidth is determined based on whether the aforementioned methods A401-S404 are used to determine the available bandwidth, as detailed in A1-A4.

[0101] A1: Get the duration of the i-th segment and the download duration of the i-th segment.

[0102] Segment duration refers to the time it takes to play a segment. Taking a video as an example, if the duration of playing the i-th segment is 10 seconds, then the segment duration of the i-th segment is 10 seconds.

[0103] Download duration refers to the time required to download a video segment. Continuing with the video example, if the download duration for the i-th segment is 5 seconds, then the download duration for the i-th segment is 5 seconds.

[0104] A2: If the segment duration is greater than or equal to the download duration, then execute S401-S404.

[0105] When bandwidth is sufficient and download speed is fast enough, the time required to download a segment will be shorter than the time required to play that segment. This allows subsequent segments to be downloaded in advance while the current segment is playing, achieving smooth playback. In other words, if the segment duration is greater than or equal to the download duration, it indicates that bandwidth is sufficient but may not be fully utilized. In such cases, the available bandwidth determination method provided in this application embodiment can be used to measure the available bandwidth, i.e., executing S401-S404 to obtain the available bandwidth of the i-th segment.

[0106] A3: If the segment duration is less than the download duration, and the difference between the download duration and the segment duration is greater than the duration threshold, then the available bandwidth of the i-th segment is determined based on the ratio of the size of the i-th segment to the download duration.

[0107] When available bandwidth is insufficient, download speeds are slow. The time required to download a single segment will be longer than the time required to play it. This means that while the current segment is playing, subsequent segments cannot be downloaded in advance, and even the smoothness of playback of the current segment will be affected. In other words, if the segment length is shorter than the download time, it indicates insufficient available bandwidth.

[0108] The duration threshold is used to measure whether the download time is too long. This application does not specifically limit the size of the duration threshold, but those skilled in the art can set it according to actual needs.

[0109] When available bandwidth is insufficient, if the difference between the download duration and the segment duration is greater than the duration threshold, it indicates that the segment duration is much shorter than the download duration, meaning the download duration is longer, resulting in a severe timeout. In this case, the smoothness of segment playback will also be affected. Regardless of the reason for insufficient available bandwidth, there will be no situation of insufficient available bandwidth utilization. Therefore, there is no need to execute the S401-S404 method to determine the available bandwidth. Based on the ratio of the size of the i-th segment to the download duration, the available bandwidth of the i-th segment can be determined, thereby reducing the amount of computation, improving the computation speed, and making it convenient and fast.

[0110] A4: If the segment duration is less than the download duration, and the difference between the download duration and the segment duration is less than or equal to the duration threshold, then S401-S404.

[0111] When available bandwidth is insufficient, if the difference between download duration and segment duration is less than or equal to the duration threshold, it means that the segment duration is slightly shorter than the download duration, i.e., the download duration is slightly longer, resulting in a slight timeout. Although available bandwidth is insufficient, it may be due to factors such as calculation accuracy. In order to improve the accuracy of the calculation, the available bandwidth can still be determined using the methods S401-S404.

[0112] Therefore, the availability of bandwidth is determined by the segment duration and download duration. When the available bandwidth is sufficient, the probability of insufficient bandwidth utilization is relatively high, thus the method provided in this application embodiment is executed to determine the available bandwidth. When the available bandwidth is insufficient, if there is a slight timeout, the available bandwidth can still be determined using the method provided in this application embodiment to avoid judgment errors caused by calculation and ensure the accuracy of the available bandwidth calculation; if there is a severe timeout, the available bandwidth can be determined by using the segment size and download duration, reducing the amount of calculation, increasing the calculation speed, and making it convenient and fast.

[0113] As mentioned above, the i-th segment is obtained by splitting the multimedia file. This splitting process can be performed in real time or pre-executed. Therefore, it is necessary to clearly distinguish which segments have been written to disk (already generated segments) and which segments are still being encoded or encapsulated (segments being generated). Already generated segments can guarantee real-time playback, while segments being generated can dynamically adjust the transmission strategy, adjusting the bitrate of the segments in real time based on the dynamic changes in available bandwidth.

[0114] Based on this, the bandwidth of the fragments being generated can be determined using the available bandwidth determination method provided in the embodiments of this application, and the available bandwidth of the already generated fragments can be determined by using the fragment size and download duration, reducing the amount of computation, increasing the computation speed, and making it convenient and fast. A detailed explanation follows, see B1-B3.

[0115] B1: If downloading a multimedia file in a video-on-demand scenario, the available bandwidth of the i-th segment is determined based on the ratio of the size of the i-th segment to the download duration.

[0116] In on-demand scenarios, segmentation is primarily used to allow users to select content to watch on demand, improving playback flexibility and user experience. Users can freely choose to watch specific segments of multimedia files based on their interests and time, without waiting for the entire video to load. They can also pause, fast forward, or rewind to a loaded segment at any time.

[0117] In video-on-demand scenarios, video segments are typically stored on servers. When a user requests to watch a video, the server transmits the corresponding segment to the user based on the request. Since video-on-demand content is pre-produced, the storage and transmission of segments can be optimized and arranged in advance, but cannot be dynamically adjusted based on available bandwidth. In this case, the available bandwidth for the i-th segment can be determined based on the ratio of the size of the i-th segment to the download time, which reduces the amount of computation, increases the computation speed, and is convenient and fast.

[0118] It should be noted that since video-on-demand (VOD) segments are already generated, the bitrate of a segment cannot be adjusted regardless of bandwidth availability. In this case, the available bandwidth for the i-th segment can be determined based on the ratio of its size to the download duration. In other words, if a multimedia file is being downloaded in a VOD scenario and the segment length is greater than or equal to the download duration, the available bandwidth for the i-th segment is determined by the ratio of its size to the download duration; conversely, if a multimedia file is being downloaded in a VOD scenario and the segment length is less than the download duration, the available bandwidth for the i-th segment is determined by the ratio of its size to the download duration.

[0119] B2: If a multimedia file is being downloaded in a live streaming scenario, and the i-th segment is an already generated segment, then the available bandwidth of the i-th segment is determined based on the ratio of the size of the i-th segment to the download duration.

[0120] In live streaming scenarios, the core purpose of segmentation is to achieve low-latency, smooth live transmission. By dividing the live stream into smaller segments, it's possible to more flexibly adapt to different network conditions, adjust transmission strategies promptly, and ensure viewers can watch the live content as real-time as possible, minimizing buffering and latency. Dynamic segmentation is often employed, adjusting the size and duration of segments based on the real-time nature of the live content and network conditions. When network conditions are good, the segment size can be appropriately increased to improve transmission efficiency; conversely, when the network is congested, the segment size is decreased to ensure timely transmission to viewers and reduce buffering time.

[0121] In live streaming scenarios, segments are generated in real time and need to be transmitted to a large number of viewers within a short period of time. To ensure the real-time nature of the live stream, streaming media transmission protocols such as HLS (HTTP Live Streaming) and DASH (Dynamic Adaptive Streaming over HTTP) are typically used. These protocols can dynamically select appropriate segments for transmission based on network conditions and support multi-bitrate adaptive streaming to accommodate users with different network bandwidths.

[0122] Although the segments are generated in real time, due to different network conditions, the segments may be generated in advance or in the process of being generated. Therefore, if a multimedia file is downloaded in a live streaming scenario and the i-th segment is a pre-generated segment, that is, the i-th segment is pre-made, then the available bandwidth of the i-th segment can be determined based on the ratio of the size of the i-th segment to the download time, so as to reduce the amount of calculation, improve the calculation speed, and make it convenient and fast.

[0123] It's important to note that even when downloading multimedia files in a live streaming scenario, since the i-th segment is an already generated segment, its bitrate cannot be adjusted regardless of bandwidth availability. In this case, the available bandwidth for the i-th segment can be determined based on the ratio of its size to the download duration. In other words, if downloading a multimedia file in a live streaming scenario, and the i-th segment is an already generated segment, the available bandwidth for the i-th segment is determined by the ratio of its size to the download duration.

[0124] B3: If a multimedia file is being downloaded in a live streaming scenario, and the i-th segment is a segment that is being generated, then execute S401-S404.

[0125] If a multimedia file is being downloaded in a live streaming scenario, and the i-th segment is a segment that is being generated, then the available bandwidth needs to be determined based on the method for determining available bandwidth provided in the application embodiment, thereby improving the accuracy of the determination of available bandwidth.

[0126] As one possible implementation, available bandwidth can also be determined by considering whether bandwidth is sufficient. Specifically, if a multimedia file is being downloaded in a live streaming scenario, the i-th segment is a segment being generated, and the segment duration is greater than or equal to the download duration, then steps S401-S404 are executed. If a multimedia file is being downloaded in a live streaming scenario, the i-th segment is a segment being generated, and the segment duration is less than the download duration, then the available bandwidth of the i-th segment is determined based on the ratio of the size of the i-th segment to the download duration. Thus, by combining whether a segment is being generated and whether available bandwidth is sufficient, the method for determining available bandwidth improves the accuracy of available bandwidth calculation while ensuring computational efficiency.

[0127] See Figure 6 This figure is a schematic diagram of a method for determining available bandwidth provided in an embodiment of this application. Figure 6First, the scenario for downloading a multimedia file is determined. If the scenario is a video-on-demand scenario, the available bandwidth for the i-th segment is determined by the ratio of its size to download duration, regardless of whether sufficient bandwidth is available. If the scenario is a live streaming scenario, it is necessary to determine whether the segment is being generated. If the segment is not being generated (i.e., it is already generated), the available bandwidth for the i-th segment is determined by the ratio of its size to download duration, regardless of whether sufficient bandwidth is available. If the segment is being generated, it is also necessary to determine whether sufficient bandwidth is available. If sufficient bandwidth is available, the available bandwidth is determined using the methods described in S401-S404. If insufficient bandwidth is available, it is determined whether the difference between the segment duration of the i-th segment and the download duration of the i-th segment is greater than a duration threshold. If it is greater (i.e., a severe timeout), the available bandwidth for the i-th segment is determined by the ratio of its size to download duration. If it is less than or equal to (i.e., a slight timeout), the available bandwidth is determined by the methods described in S401-S404 above.

[0128] Therefore, the download scenario of multimedia files can be used to quickly distinguish whether the fragments have already been generated or are being generated. If the fragments are being generated, the available bandwidth can be determined using the method provided in the embodiments of this application, thereby improving the accuracy of the available bandwidth calculation; if the fragments have already been generated, the available bandwidth can be determined using the size of the fragments and the download duration, reducing the amount of calculation, increasing the calculation speed, and making the process convenient and fast.

[0129] As one possible implementation, this application provides a specific implementation of S404, namely, a specific implementation of determining the available bandwidth of the i-th slice based on the sub-available bandwidth corresponding to the i-th slice in each window, see C1-C4.

[0130] C1: Determine the measured bandwidth of the i-th slice based on the sub-available bandwidth corresponding to the i-th slice in each window.

[0131] The available bandwidth can be obtained by adjusting the measurement bandwidth. The specific method for determining the measurement bandwidth of the i-th slice based on the sub-available bandwidth corresponding to the i-th slice in each window can be found in the aforementioned S404, and will not be repeated here.

[0132] Compared to available bandwidth, measured bandwidth may be affected by network jitter and contain network jitter noise. Therefore, it is necessary to suppress network jitter noise and output a smooth and accurate available bandwidth. The smoothing process is explained below.

[0133] C2: Obtain the available bandwidth and measured bandwidth of the (i-1)th fragment.

[0134] The (i-1)th fragment is the fragment preceding the ith fragment. Before determining the ith fragment, we can obtain the available bandwidth and the measured bandwidth of the (i-1)th fragment. For details, please refer to the method for determining the available bandwidth and the measured bandwidth of the ith fragment, which will not be repeated here.

[0135] It should be noted that in this embodiment, when i is 1, i-1 is 0. That is, the first shard does not have the previous shard, meaning the first shard cannot obtain the previous shard. Therefore, in this embodiment, i is an integer greater than 1, meaning that the C1-C4 method applies to the second shard and the shards after the second shard.

[0136] C3: Determine the adjustment weight for the i-th slice based on the available bandwidth and the measured bandwidth of the i-1-th slice.

[0137] Although available bandwidth fluctuates, we can assume that the change in available bandwidth is a random walk process, meaning that the bandwidth difference between adjacent time steps follows a Gaussian distribution. Therefore, the measured bandwidth is the available bandwidth plus Gaussian noise. For example, the available bandwidth of the (i-1)th segment and the measured bandwidth of the (i-1)th segment can both be used as a reference to determine the available bandwidth of the i-th segment.

[0138] Adjusting the weights is used to dynamically balance the weights of available bandwidth and measurement bandwidth to optimize state estimation. Essentially, it's an adaptive weighting system that dynamically adjusts the weights based on the uncertainty of both measurement and available bandwidth, thereby achieving optimal estimation under noise interference. If the noise in the measurement bandwidth is lower, or the reliability of the available bandwidth is lower, it indicates that the measurement bandwidth is more reliable, and therefore the adjusted weights can be higher to rely more heavily on the measurement bandwidth for calculations under uncertainty. Similarly, if the noise in the measurement bandwidth is higher, or the reliability of the available bandwidth is higher, it indicates that the available bandwidth is more reliable, and therefore the adjusted weights can be lower to reduce interference when certainty is present.

[0139] C4: Determine the available bandwidth of the i-th segment based on the measured bandwidth of the i-th segment, the available bandwidth of the (i-1)-th segment, the measured bandwidth of the (i-1)-th segment, and the adjustment weight of the i-th segment.

[0140] Therefore, by fusing the measured bandwidth and the available bandwidth, and using dynamically adjusted adjustment weights to balance the errors of the two, the optimal bandwidth value in the sense of minimum mean square error is recursively optimized, and thus the available bandwidth is obtained.

[0141] As one possible implementation, the weights can be adjusted to be the Kalman gain, thus achieving C2-C4 via Kalman filtering. See also Figure 7 This figure is a schematic diagram of available bandwidth provided in an embodiment of this application. Figure 7The diagram shows the actual bandwidth, measured bandwidth, and available bandwidth. The actual bandwidth is the bandwidth that can actually be achieved, the measured bandwidth is the bandwidth obtained after C1, and the available bandwidth is the bandwidth obtained after C4. It can be seen that by using the C1-C4 method, drastic fluctuations in noise within the measured bandwidth can be suppressed, achieving optimal estimation under noise interference.

[0142] Therefore, after obtaining the measurement bandwidth based on multiple sub-available bandwidths of the i-th segment, the adjustment weights for the i-th segment can be determined based on the available bandwidth and measurement bandwidth of the (i-1)-th segment. By dynamically adjusting the weights according to the uncertainties in the measurement and available bandwidths, optimal estimation can be achieved under noise interference. This further suppresses drastic fluctuations in noise within the measurement bandwidth, and the accuracy of the adjustment weights increases with the number of iterations, thereby improving the accuracy of the available bandwidth.

[0143] As one possible implementation, after obtaining the available bandwidth, the bitrate of the next fragment can be adjusted based on the available bandwidth. The following explanation will continue with the i-th fragment as an example, see D1-D3.

[0144] D1: If the available bandwidth of the i-th slice is less than or equal to the required bandwidth corresponding to the bitrate of the i-th slice, then the bitrate of the (i+1)-th slice is determined to be less than the bitrate of the i-th slice.

[0145] Demand bandwidth refers to the bandwidth required to transmit fragments at the corresponding bit rate.

[0146] If the available bandwidth of the i-th fragment is less than or equal to the required bandwidth corresponding to the bitrate of the i-th fragment, it means that the network transmission capacity is insufficient to support the stable transmission of this fragment at the bitrate of the i-th fragment, which may lead to stuttering, buffering, or quality degradation in multimedia file playback. In this case, the bitrate of the (i+1)-th fragment can be reduced to allow the multimedia file transmission process to better adapt to dynamic network changes, avoid more serious problems in subsequent fragment transmission due to network fluctuations, and ensure that the entire transmission process can maintain a certain quality even in changing network environments.

[0147] One possible implementation is to divide the bitrate used for transmitting segments into multiple tiers, with the bitrate corresponding to each tier increasing as the number of tiers increases. If the bitrate of the i-th segment is at the m-th tier, then the bitrate of the i-th segment can be determined by the bitrate of the (m-1)-th tier, where m is a positive integer. This avoids excessive quality variations during multimedia file playback and ensures a good user experience.

[0148] D2: If the available bandwidth of the i-th fragment is greater than the required bandwidth corresponding to the target bit rate, then obtain the available bandwidth of the n fragments in the fragment set.

[0149] The target bitrate is the bitrate greater than that of the i-th fragment. For example, the bitrate used to transmit fragments is divided into multiple levels, and the bitrate corresponding to each level increases with the number of levels. If the bitrate of the i-th fragment is at level m, then the bitrate of level m+1 can be determined as the target bitrate, where m is a positive integer.

[0150] If the available bandwidth of the i-th fragment is greater than the required bandwidth corresponding to the target bitrate, it means that the current available bandwidth is not being fully utilized, and the bitrate of the subsequent fragments can be increased. Moreover, when a bitrate change is detected, if the bitrate needs to be increased, several fragments' available bandwidth can be waited for. The decision to increase the bitrate based on the available bandwidth of multiple fragments can be made, thereby avoiding bitrate change errors caused by calculation mistakes and preventing a decrease in user experience.

[0151] Based on this, the n fragments included in the fragment set are the fragments that need to be transmitted (e.g., downloaded) after the i-th fragment, and the difference between the fragment time of each of the n fragments and the fragment time of the i-th fragment is less than the difference threshold. That is, the n fragments are the fragments adjacent to the i-th fragment, and n is a positive integer.

[0152] This application does not specifically limit the size of n in its embodiments. For example, if n is 2, the shard set includes the (i+1)th shard and the (i+2)th shard. This application does not specifically limit the size of the difference threshold; those skilled in the art can set it according to actual conditions.

[0153] D3: If the number of fragments in the fragment set whose available bandwidth is greater than the required bandwidth corresponding to the target bitrate is greater than the number threshold, then the target bitrate is determined as the bitrate of the (i+n+1)th fragment.

[0154] If the number of fragments in the fragment set whose available bandwidth is greater than the required bandwidth corresponding to the target bit rate is greater than the number threshold, it means that the number of fragments whose available bandwidth is not fully utilized after the i-th fragment is relatively large. Therefore, the bit rate can be increased, that is, the bit rate of the i+n+1-th fragment is increased to the target bit rate.

[0155] The embodiments of this application do not specifically limit the size of the quantity threshold. For example, the quantity threshold can be a number of n, so that the available bandwidth of each segment in the segment set is greater than the required bandwidth corresponding to the target bit rate, so as to ensure the stable transmission of the next segment.

[0156] Therefore, after calculating the available bandwidth of the i-th fragment, a comparison can be made between the available bandwidth of the i-th fragment and the required bandwidth corresponding to its bitrate, as well as between the available bandwidth of the i-th fragment and the required bandwidth corresponding to the target bitrate. If the bitrate changes, if a reduction in bitrate is needed, it can be done directly without waiting to ensure stable fragment transmission; if a reduction in bitrate is needed, at least one more fragment must be waited for, and the decision to increase the bitrate is made based on the bitrate changes of multiple fragments. This allows for the rational use of network resources and improved user experience while ensuring transmission stability and user experience when the network environment changes.

[0157] As one possible implementation, this application provides a specific implementation of D1, namely, if the available bandwidth of the i-th segment is less than or equal to the required bandwidth corresponding to the bit rate of the i-th segment, then the bit rate of the (i+1)-th segment is less than the bit rate of the i-th segment. For a specific implementation of this, see E1-E3.

[0158] E1: Obtain the bitrate reduction factor and the required bandwidth corresponding to the bitrate of the i-th segment.

[0159] The bitrate reduction factor is used to reduce the required bandwidth, and the bitrate reduction factor is greater than 1. This application does not specifically limit the value of the bitrate reduction threshold; those skilled in the art can set it according to actual needs, such as setting the bitrate reduction threshold to 1.2.

[0160] E2: Determine the bitrate threshold based on the bitrate reduction coefficient and the required bandwidth corresponding to the bitrate of the i-th segment.

[0161] The bitrate reduction threshold is obtained by adjusting the required bandwidth based on the bitrate reduction coefficient. As one possible implementation, the bitrate reduction threshold, determined according to the bitrate reduction coefficient and the required bandwidth corresponding to the bitrate of the i-th segment, can be expressed as follows:

[0162] Bitrate reduction threshold = Bitrate reduction coefficient × Required bandwidth corresponding to the bitrate of the i-th segment.

[0163] E3: If the available bandwidth of the i-th slice is less than or equal to the bitrate reduction threshold, then the bitrate of the (i+1)-th slice is determined to be less than the bitrate of the i-th slice.

[0164] Compared to the required bandwidth corresponding to the bitrate of the i-th slice, the bitrate reduction threshold is larger, avoiding premature bitrate reduction. Therefore, if the available bandwidth of the i-th slice is less than or equal to the bitrate reduction threshold, the bitrate of the (i+1)-th slice is determined to be less than that of the i-th slice. This reduces the frequency of bitrate adjustments to some extent, avoiding frequent bitrate adjustments due to minor bandwidth fluctuations.

[0165] Therefore, by using a bitrate reduction coefficient greater than 1 to increase the required bandwidth corresponding to the bitrate of the i-th segment, the required bandwidth for bitrate reduction is increased. This reduces the frequency of bitrate adjustments to some extent, avoiding frequent bitrate adjustments due to minor bandwidth fluctuations. This is more suitable for scenarios involving multimedia file transmission using adaptive bitrate technology, resulting in a smoother transmission process. Furthermore, avoiding premature bitrate reduction can, to some extent, ensure transmission quality, preventing negative user experience impacts from early bitrate reduction. It also reduces erroneous adjustments caused by errors, making bitrate adjustment more accurate and reliable.

[0166] As one possible implementation, this application provides a specific implementation of D2, namely, if the available bandwidth of the i-th slice is greater than the required bandwidth corresponding to the target bit rate, then the specific implementation of obtaining the available bandwidth of n slices in the slice set is described in F1-F3.

[0167] F1: Get the required bandwidth corresponding to the bitrate increase factor and the target bitrate.

[0168] The bitrate increase factor is used to increase the required bandwidth, and the bitrate increase factor is greater than 1. This application does not specifically limit the size of the bitrate increase threshold; those skilled in the art can set it according to actual needs. As one possible implementation, the bitrate increase factor is greater than the bitrate decrease factor; for example, the bitrate increase threshold can be set to 1.4.

[0169] F2: Determine the bitrate threshold based on the bitrate increase coefficient and the required bandwidth corresponding to the target bitrate.

[0170] The bitrate increase threshold is obtained by adjusting the required bandwidth based on the bitrate increase coefficient. As one possible implementation, determining the bitrate increase threshold based on the bitrate increase coefficient and the required bandwidth corresponding to the target bitrate can be expressed as follows:

[0171] Bitrate increase threshold = Bitrate increase coefficient × Required bandwidth corresponding to the target bitrate.

[0172] F3: If the available bandwidth of the i-th fragment is greater than the bit rate threshold, then obtain the available bandwidth of the n fragments in the fragment set.

[0173] Compared to the required bandwidth corresponding to the target bitrate, the bitrate increase threshold is larger, avoiding premature bitrate reduction. Therefore, if the available bandwidth of the i-th slice is less than or equal to the bitrate decrease threshold, the bitrate of the (i+1)-th slice is determined to be less than that of the i-th slice. This reduces the frequency of bitrate adjustments to some extent, avoiding frequent adjustments due to minor bandwidth fluctuations.

[0174] Therefore, by using an uprate factor greater than 1 to increase the required bandwidth corresponding to the target bitrate, the bandwidth required for uprate is increased. This reduces the frequency of bitrate adjustments to some extent, avoiding frequent adjustments due to minor bandwidth fluctuations. This is more suitable for scenarios involving multimedia file transmission using adaptive bitrate technology, resulting in a smoother transmission process. Furthermore, avoiding premature bitrate increases can ensure transmission quality to some extent, preventing negative impacts on user experience and reducing erroneous adjustments caused by errors, making bitrate adjustments more accurate and reliable.

[0175] This application does not specifically limit the protocol used to transmit multimedia files, such as Real Time Messaging Protocol (RTMP), Web Real-Time Communications (WebRTC), Hypertext Transfer Protocol (HTTP), etc.

[0176] As one possible implementation, this application embodiment can employ the High Efficiency Streaming Protocol (HESP) to transmit multimedia files. That is, each segment of the multimedia file is packaged based on HESP, such as the i-th segment being packaged based on HESP. HESP is an adaptive HTTP-based video streaming protocol that provides online viewers with a high-quality experience while reducing media transmission costs by up to 20%. HESP supports sub-second end-to-end latency, as low as 400ms. Its fast, startup, and search times are all below 100ms, providing a better experience than existing solutions. It ensures high-efficiency transmission while also transmitting with low latency, guaranteeing a superior viewing experience for users on XR and other devices.

[0177] Furthermore, the transmission speed of multimedia files can be improved by using a content delivery network. Taking the i-th segment as an example, the server can encode the i-th segment to obtain the streaming media protocol data packet of the i-th segment, and then send the streaming media protocol data packet of the i-th segment to the terminal device through the content delivery network. That is, the terminal device obtains the streaming media protocol data packet of the i-th segment from the content delivery network, and the terminal device decodes the streaming media protocol data packet of the i-th segment based on the high-efficiency streaming protocol to obtain the i-th segment.

[0178] Therefore, by using the HESP protocol to encode and decode the multiple segments of a multimedia file and distributing them through a content delivery network, not only is the problem of HESP's inability to upcode overcome, but also only the packager and player need to be improved, making the modification less difficult and improving the viewing experience under different network conditions.

[0179] To facilitate a further understanding of the technical solutions provided in the embodiments of this application, the following description takes the implementation of the method for determining available bandwidth provided in the embodiments of this application as a terminal device, and uses the HESP protocol and content delivery network to transmit live video (a multimedia file) as an example to provide an overall exemplary introduction to the method for determining available bandwidth.

[0180] In related technologies, when transmitting via content delivery networks (CDNs), HTTP-based protocols are generally used. These protocols work by dividing large multimedia files into multiple chunks. These chunks are generated in a bundler and listed in a manifest file, which can then be distributed via a standard HTTP CDN. Each chunk begins with a keyframe, allowing playback to begin immediately upon chunk loading. However, this significantly increases the bandwidth required for video transmission. The player on the terminal device needs to establish a connection with the server, load the manifest of the multimedia file's chunks, begin loading the chunks, and push them to the playback buffer. Since internet connections are often unstable, a large buffer in the player is needed to absorb a reasonable amount of bandwidth fluctuations and ensure smooth video playback. This leads to increased latency and switching / startup times.

[0181] In related technologies, methods to optimize delivery and reduce latency involve shifting to non-HTTP-based (and poorly cacheable) protocols such as RTMP and WebRTC. Since these protocols typically do not rely on HTTP, they cannot be delivered using traditional CDNs, thus requiring dedicated and expensive infrastructure for scaling. Furthermore, to address bandwidth issues, alternative codecs (such as AV1 and VP9, ​​VVC, etc.) can be used to deliver content. However, since there is currently no next-generation codec suitable for most commonly used devices, secondary encoding, packaging, and distribution are usually required.

[0182] Among the various transmission methods, RTMP, being based on the Transmission Control Protocol (TCP) and using a non-public port, may be blocked by firewalls. Furthermore, RTMP is a proprietary protocol, incompatible with many devices, especially iOS, requiring third-party decoders. Using FLV (Flash Video) for transmission results in buffering the streaming media on the local client, compromising security. Due to its high network traffic, it's also unsuitable for pull streaming. HTTP Live Streaming (HLS) offers poor real-time performance, high latency, and demanding requirements for storage and caching. WebRTC, on the other hand, is expensive, requiring dedicated servers.

[0183] In summary, these solutions often significantly increase costs for service providers for the following reasons:

[0184] 1) Increase bandwidth;

[0185] 2) Parallel encoding and caching workflow;

[0186] 3) Non-HTTP origins and caches.

[0187] Based on this, the embodiments of this application employ an improved high-efficiency streaming protocol to transmit multimedia files. Transmitting multimedia files based on the improved high-efficiency streaming protocol can achieve the following effects:

[0188] 1) Significantly reduce latency, achieving sub-second latency;

[0189] 2) Reduce the switching time to approximately 100 milliseconds;

[0190] 3) Reduce bandwidth costs and optimize player bandwidth utilization by up to 20%;

[0191] 4) At the same time, it can still be extended using HTTP CDN, thus achieving almost unlimited scalability in a cost-effective manner.

[0192] The improved high-efficiency streaming protocol can be designed to be integrated into existing video delivery pipelines and workflows, meaning that the improved high-efficiency streaming protocol is compatible with existing encoders and third-party CDNs, requiring only changes within the packer and player.

[0193] See Figure 8 This figure is a schematic diagram of a live video stream transfer provided in an embodiment of this application. Figure 8In this process, sound is captured through the microphone on the broadcaster's side to obtain audio, and live video is captured through the camera. The broadcaster's terminal device then encodes both the audio and video to obtain encapsulated audio and video. The broadcaster's terminal device encapsulates the encapsulated audio and video using RTMP to obtain encapsulated RTMP data, which is then sent to the media server. The media server sends the live stream to the HTTP CDN based on an improved high-efficiency streaming protocol, and then the HTTP CDN sends it to the viewer's terminal device for playback via the viewer's player.

[0194] The following explains the live video stream transfer process from the perspective of the device. (See also...) Figure 9 This figure is a schematic diagram of another live video stream transfer provided in an embodiment of this application. Figure 9 In this process, video streams are captured through the terminal devices on the broadcaster's side, specifically through the microphone and camera in the terminal device. The video is then encoded and encapsulated by an encoder, and the encoded and encapsulated RTMP data is sent to a media server. The media server then sends the live stream to an HTTP CDN based on an improved high-efficiency streaming protocol. Finally, the HTTP CDN sends the live stream to the viewer's terminal device based on the improved high-efficiency streaming protocol, and the viewer plays it through the player on that terminal device.

[0195] The following section explains the high-efficiency stream protocol.

[0196] High-efficiency streaming protocols are next-generation online video transmission technologies that outperform current-generation protocols, enabling large-scale, low-latency streaming. It is an ultra-low-latency streaming protocol that uses HTTP / 1.1, features chunked transmission encoding and range requests, and has a minimal manifest and low-frequency update requirements. It requires two complementary streams:

[0197] (1) The initialization stream: It contains keyframes, so it can start playing at any given moment, not necessarily at the beginning of a clip or at a keyframe interval;

[0198] (2) The Continuation stream: It contains IPB frames that can be played immediately after the keyframes of the stream initialization.

[0199] High-Efficiency Streaming Protocol delivers a broadcast-quality experience with sub-second latency and fast switching times on any device or platform. It also offers extremely low bandwidth consumption compared to other ultra-low latency streaming protocols such as WebRTC. Delivered over HTTP, it complies with standard CDN requirements and offers low-cost scalability. High-Efficiency Streaming Protocol is based on using two streams per quality / track:

[0200] (1) Initialize the stream to quickly start a new stream;

[0201] (2) Continuous flow for normal operation.

[0202] Characteristics of the initialization stream: The initialization stream consists of initialization packets corresponding to each frame position. These initialization packets are individually addressable. They contain the IDR frame corresponding to the frame position, so playback can begin from any given frame, and they are contained in ISOBMFF format.

[0203] Characteristics of continuous streaming: Continuous streaming is encapsulated in CMAF-CTE but with a specific configuration for low latency, and can begin playback immediately after the initial frame, resulting in very fast channel start and switching times. It uses byte range requests for addressing and chunked transfer encoding to provide low latency.

[0204] Segments in a continuous stream can be very long, without being limited by low latency and fast switching times, thus allowing for a large GOP size, which reduces bandwidth consumption and improves video quality.

[0205] To achieve an efficient streaming protocol, only two components in the video value chain require customization: the packer and the player. The efficient streaming protocol can be used with regular encoders and regular CDNs, as long as they support CTE and byte ranges.

[0206] See Figure 10 This figure is a schematic diagram of video stream transfer provided in an embodiment of this application. Figure 10 In this context, the standard producer is the terminal device on the broadcaster's side, the standard encoder is the encoder mentioned above, the HESP packager is located in the media server mentioned above, the regular content delivery network (CDN) is the HTTP CDN mentioned above, and the HESP player is located in the player mentioned above.

[0207] HESP offers sub-second end-to-end latency and a large GOP size (10⁻¹² seconds). Due to the initial stream, quality switching in ABR is not limited to GOP boundaries and can occur at any given moment. This means HESP is not limited to small GOP sizes. Therefore, the GOP size can remain large while having a small buffer size (HESP has a sub-second target buffer), allowing for low-latency and smooth quality switching at any time without the risk of rebuffering.

[0208] By setting a latency target (e.g., ~3 seconds) in HESP, it's possible to reduce the video bitrate while maintaining the same video quality, thus saving bandwidth. In HESP, playback isn't limited to GOP boundaries. Therefore, the lowest end-to-end latency can be achieved without sacrificing video quality (smaller GOPs). HESP can simultaneously provide small buffer sizes, low latency, large GOP sizes, and higher video quality.

[0209] However, HESP still suffers from low accuracy in available bandwidth testing. Since HESP determines available bandwidth based on video bitrate, the bitrate it measures will only be slightly higher than the actual video bitrate. Therefore, it cannot switch to high bitrate scenarios. Based on this, this application provides an improved HESP, which improves the method for determining available bandwidth based on the HESP in related technologies, thereby increasing the accuracy of available bandwidth determination. This will be explained in detail below.

[0210] In this embodiment, viewers can open the video application via Apple Vision Pro, select live stream on the homepage, and experience watching live video. Apple's first spatial computing device seamlessly integrates digital content into the real world, allowing users to be present and connected with others. Apple Vision Pro creates a borderless canvas, allowing apps to break through the limitations of traditional displays and bringing users a completely new 3D interactive experience, controlling with the eyes, hands, and voice in the most natural and intuitive way. The groundbreaking design of Apple Vision Pro includes an ultra-high-resolution display system with 23 million pixels placed in two displays and a custom Apple chip with a unique dual-chip design, delivering an immersive and real-time experience for every user.

[0211] See Figure 11This figure illustrates a scenario for determining available bandwidth according to an embodiment of this application. After the viewer's terminal device obtains the i-th segment from the media server (the process of obtaining it based on HTTP CDN is not shown), it stores the i-th segment in a buffer and then plays the i-th segment based on the player. During this process, the measured bandwidth of the i-th segment is also determined based on the i-th segment, thus realizing the process of determining the measured bandwidth.

[0212] Specifically, for the i-th segment among multiple segments in a live video stream, the average bitrate change rate of the i-th segment is obtained; based on the average bitrate change rate of the i-th segment, the window size and sliding distance of the i-th segment are determined; based on the window size and sliding distance of the i-th segment, the sub-available bandwidth corresponding to the i-th segment in each window is calculated; based on the sub-available bandwidth corresponding to the i-th segment in each window, the measurement bandwidth of the i-th segment is determined. See S401-S403 and C1 for details.

[0213] After obtaining the measured bandwidth of the i-th segment, the measured bandwidth of the i-th segment is optimized to obtain the available bandwidth of the i-th segment, thus realizing the process of optimizing the measured bandwidth and obtaining the available bandwidth.

[0214] Specifically, the available bandwidth and measured bandwidth of the (i-1)th slice are obtained; based on the available bandwidth and measured bandwidth of the (i-1)th slice, the adjustment weight for the ith slice is determined; based on the measured bandwidth, available bandwidth, and adjustment weight of the ith slice, the available bandwidth of the ith slice is determined. See C2-C4 above for details.

[0215] After obtaining the available bandwidth of the i-th segment, the bitrate of the (i+1)-th segment is determined based on the available bandwidth of the i-th segment, thus realizing the process of determining the bitrate based on the available bandwidth.

[0216] Specifically, if the available bandwidth of the i-th slice is less than or equal to the required bandwidth corresponding to the bitrate of the i-th slice, then the bitrate of the (i+1)-th slice is determined to be less than the bitrate of the i-th slice; if the available bandwidth of the i-th slice is greater than the required bandwidth corresponding to the target bitrate, then the available bandwidth of the n slices in the slice set is obtained; if the number of slices in the slice set whose available bandwidth is greater than the required bandwidth corresponding to the target bitrate is greater than a threshold, then the target bitrate is determined to be the bitrate of the (i+n+1)-th slice. See D1-D3 above for details.

[0217] Therefore, by using the improved HESP to propagate the video stream, users can experience lower latency when watching live streams, better interaction with the broadcaster, and save approximately 20% of network bandwidth. When watching videos with Apple Vision Pro, users can also enjoy higher resolution video. Furthermore, the following effects can also be achieved:

[0218] (1) Sub-second latency characteristics:

[0219] a. Near real-time interactivity (low latency, meeting the requirements of interactive scenarios); b. Will not disrupt user experience; c. Synchronous delivery across devices (cross-platform compatibility).

[0220] (2) Reduce bandwidth and costs by up to 20% (saving bandwidth costs):

[0221] a. Save costs for content distributors; b. Reinvest the saved bandwidth into transmitting more and higher-quality video.

[0222] (3) Expanding existing infrastructure (no need to deploy dedicated servers):

[0223] a. Achieve cost-effective delivery on existing HTTP infrastructure; b. Compatible with standard encoders; c. Delivered via standard CDN; d. Cross-platform playback support (supports existing mainstream platforms).

[0224] (4) Enhance the audience experience:

[0225] a. Instantaneous switching and time jumps; b. Fully adaptive bit rate (ABR) to respond to a variety of different network conditions.

[0226] In addition to the method for determining available bandwidth described above, this application also provides a corresponding device for determining available bandwidth, so that the above method for determining available bandwidth can be applied and implemented in practice.

[0227] See Figure 12 This figure is a schematic diagram of the structure of a device for determining available bandwidth provided in an embodiment of this application. Figure 12 As shown, the available bandwidth determination device 1200 includes: an acquisition unit 1201, a determination unit 1202, and a calculation unit 1203;

[0228] The acquisition unit 1201 is used to acquire the average bitrate change rate of the i-th segment among the multiple segments included in the multimedia file, where i is a positive integer;

[0229] The determining unit 1202 is used to determine the window size and sliding distance of the i-th slice based on the average rate of change of the bitrate of the i-th slice.

[0230] The calculation unit 1203 is used to calculate the sub-available bandwidth corresponding to the i-th slice in each window based on the window size of the i-th slice and the sliding distance of the i-th slice, wherein the window is determined based on the window size and the sliding distance;

[0231] The determining unit 1202 is further configured to determine the available bandwidth of the i-th slice based on the sub-available bandwidth corresponding to the i-th slice in each window.

[0232] As can be seen from the above technical solution, this application provides an apparatus for determining available bandwidth, comprising: an acquisition unit, a determination unit, and a calculation unit. For scenarios involving multimedia file transmission based on adaptive bitrate technology, whether available bandwidth is effectively utilized can be reflected by whether traffic is abnormal, and whether traffic is abnormal can be reflected by the average bitrate change rate. Therefore, available bandwidth can be calculated using the average bitrate change rate. The following explanation uses the i-th segment among multiple segments of a multimedia file as an example. The acquisition unit acquires the average bitrate change rate of the i-th segment. The determination unit determines the window size and sliding distance for measuring the available bandwidth of the i-th segment based on the average bitrate change rate of the i-th segment, so as to adaptively adjust the window size and sliding distance according to traffic fluctuations during the download process, thereby improving the accuracy of subsequent available bandwidth measurements. The calculation unit divides the download process of the i-th segment into multiple windows based on the window size and sliding distance of the i-th segment, and calculates the sub-available bandwidth corresponding to each window. The determination unit comprehensively determines the available bandwidth of the i-th segment based on the sub-available bandwidth corresponding to the i-th segment in each window. Therefore, instead of calculating available bandwidth based on the entire segment, the segment is divided into multiple windows, and the available bandwidth is calculated based on the sub-available bandwidth of these windows to cope with the dynamic changes in available bandwidth during the download of segments. Furthermore, bandwidth is no longer calculated based on bitrate, but rather on the average bitrate change rate, which dynamically adjusts the window size and sliding distance required for bandwidth calculation. This ensures more balanced fluctuations in available bandwidth within each window, avoiding the impact of traffic anomalies, improving the accuracy of determining available bandwidth, and consequently improving the smoothness of multimedia file playback and enhancing the user experience.

[0233] As one possible implementation, the device further includes a determination unit, used for:

[0234] Obtain the segment duration of the i-th segment and the download duration of the i-th segment;

[0235] If the duration of the segment is greater than or equal to the download duration, then the step of obtaining the average rate of change of the bitrate of the i-th segment and subsequent steps are executed.

[0236] If the segment duration is less than the download duration, and the difference between the download duration and the segment duration is greater than the duration threshold, then the available bandwidth of the i-th segment is determined based on the ratio of the size of the i-th segment to the download duration.

[0237] If the segment duration is less than the download duration, and the difference between the download duration and the segment duration is less than or equal to the duration threshold, then the step of obtaining the average bitrate change rate of the i-th segment and subsequent steps are executed.

[0238] As one possible implementation, the device further includes a determination unit, used for:

[0239] If the multimedia file is downloaded in a video-on-demand scenario, the available bandwidth of the i-th segment is determined based on the ratio of the size of the i-th segment to the download duration.

[0240] If the multimedia file is downloaded in a live streaming scenario, and the i-th segment is an already generated segment, then the available bandwidth of the i-th segment is determined according to the ratio of the size of the i-th segment to the download duration.

[0241] If the multimedia file is downloaded in a live streaming scenario, and the i-th segment is a segment that is being generated, then the steps of obtaining the segment duration of the i-th segment and the download duration of the i-th segment, as well as subsequent steps, are executed.

[0242] As one possible implementation, if the average rate of change of bitrate increases, then the window size or the sliding distance is increased; if the average rate of change of bitrate decreases, then the window size or the sliding distance is decreased; or,

[0243] The determining unit 1202 is specifically used for:

[0244] Based on the average rate of change of the bitrate of the i-th segment and the network latency, the window size and sliding distance of the i-th segment are determined. If the network latency increases, the window size or the sliding distance is increased; if the network latency decreases, the window size or the sliding distance is decreased.

[0245] As one possible implementation, if the average rate of change of bitrate increases, the window size is increased, and the window size is less than the upper limit of the window; if the average rate of change of bitrate decreases, the window size is decreased, and the window size is greater than the lower limit of the window, and the upper limit of the window is greater than the lower limit of the window.

[0246] As one possible implementation, the determining unit 1202 is specifically used for:

[0247] The available bandwidth of the i-th slice is determined by the largest sub-available bandwidth among the sub-available bandwidths corresponding to each window.

[0248] As one possible implementation, if i is an integer greater than 1, then the determining unit 1202 is specifically used for:

[0249] The measurement bandwidth of the i-th slice is determined based on the sub-available bandwidth corresponding to each window of the i-th slice.

[0250] Obtain the available bandwidth of the (i-1)th slice and the measured bandwidth of the (i-1)th slice;

[0251] Based on the available bandwidth of the (i-1)th slice and the measured bandwidth of the (i-1)th slice, determine the adjustment weight for the i-th slice;

[0252] The available bandwidth of the i-th segment is determined based on the measured bandwidth of the i-th segment, the available bandwidth of the (i-1)-th segment, the measured bandwidth of the (i-1)-th segment, and the adjustment weight of the i-th segment.

[0253] As one possible implementation, the device further includes a bitrate adjustment unit for:

[0254] If the available bandwidth of the i-th slice is less than or equal to the required bandwidth corresponding to the bitrate of the i-th slice, then the bitrate of the (i+1)-th slice is determined to be less than the bitrate of the i-th slice.

[0255] If the available bandwidth of the i-th slice is greater than the required bandwidth corresponding to the target bitrate, then the available bandwidth of n slices in the slice set is obtained, the target bitrate is greater than the bitrate of the i-th slice, the difference between the segment time of each slice included in the slice set and the segment time of the i-th slice is less than the difference threshold, and the n slices are downloaded after the i-th slice, where n is a positive integer;

[0256] If the number of fragments in the fragment set whose available bandwidth is greater than the required bandwidth corresponding to the target bitrate is greater than a threshold, then the target bitrate is determined as the bitrate of the (i+n+1)th fragment.

[0257] As one possible implementation, the bitrate adjustment unit is specifically used for:

[0258] Obtain the required bandwidth corresponding to the bitrate reduction coefficient and the bitrate of the i-th segment, wherein the bitrate reduction coefficient is greater than 1;

[0259] The bitrate reduction threshold is determined based on the bitrate reduction coefficient and the required bandwidth corresponding to the bitrate of the i-th segment;

[0260] If the available bandwidth of the i-th slice is less than or equal to the bitrate reduction threshold, then the bitrate of the (i+1)-th slice is determined to be less than the bitrate of the i-th slice.

[0261] As one possible implementation, the bitrate adjustment unit is specifically used for:

[0262] Obtain the bitrate increase coefficient and the required bandwidth corresponding to the target bitrate, wherein the bitrate increase coefficient is greater than 1;

[0263] The bitrate threshold is determined based on the bitrate increase coefficient and the required bandwidth corresponding to the target bitrate.

[0264] If the available bandwidth of the i-th slice is greater than the bit rate threshold, then the available bandwidth of the n slices in the slice set is obtained.

[0265] As one possible implementation, the acquisition unit 1201 is further configured to:

[0266] The streaming media protocol data packet of the i-th segment is obtained from the content delivery network, and the streaming media protocol data packet of the i-th segment is obtained by packaging based on the high-efficiency streaming protocol;

[0267] The streaming media protocol data packets of the i-th segment are decoded based on the high-efficiency streaming protocol to obtain the i-th segment.

[0268] This application also provides a computer device, which can be a server or a terminal device. The computer device provided in this application will be described below from a hardware implementation perspective. Figure 13 The diagram shown is a structural schematic of the server. Figure 14 The diagram shown is a structural schematic of the terminal device.

[0269] See Figure 13This figure is a schematic diagram of a server structure provided in an embodiment of this application. The server 1400 can vary considerably due to different configurations or performance. It may include one or more processors 1422, such as a central processing unit (CPU), memory 1432, and one or more application programs 1442 or data storage media 1430 (e.g., one or more mass storage devices). The memory 1432 and storage media 1430 can be temporary or persistent storage. The program stored in the storage media 1430 may include one or more modules (not shown in the figure), each module may include a series of instruction operations on the server. Furthermore, the processor 1422 may be configured to communicate with the storage media 1430 and execute the series of instruction operations in the storage media 1430 on the server 1400.

[0270] Server 1400 may also include one or more power supplies 1426, one or more wired or wireless network interfaces 1450, one or more input / output interfaces 1458, and / or one or more operating systems 1441, such as Windows Server. TM Mac OS X TM Unix TM Linux TM FreeBSD TM etc.

[0271] The steps performed by the server in the above embodiments can be based on this Figure 13 The server structure shown.

[0272] The processor 1422 is used to perform the following steps:

[0273] For the i-th segment among multiple segments included in a multimedia file, obtain the average bitrate change rate of the i-th segment, where i is a positive integer;

[0274] Based on the average rate of change of the bitrate of the i-th slice, determine the window size and the sliding distance of the i-th slice;

[0275] Based on the window size and sliding distance of the i-th slice, calculate the sub-available bandwidth corresponding to the i-th slice in each window, wherein the window is determined based on the window size and the sliding distance;

[0276] The available bandwidth of the i-th slice is determined based on the sub-available bandwidth corresponding to each window of the i-th slice.

[0277] Optionally, the processor 1422 may also execute method steps of any specific implementation of the method for determining available bandwidth in the embodiments of this application.

[0278] See Figure 14 This figure is a schematic diagram of the structure of a terminal device provided in an embodiment of this application. The description will be based on a smartphone as an example. Figure 14 The diagram shown is a partial structural block diagram of the smartphone, which includes: a radio frequency (RF) circuit 1510, a memory 1520, an input unit 1530, a display unit 1540, a sensor 1550, an audio circuit 1560, a Wi-Fi module 1570, a processor 1580, and a power supply 1590, among other components. Those skilled in the art will understand that... Figure 14 The smartphone structure shown does not constitute a limitation on smartphones and may include more or fewer components than shown, or combine certain components, or have different component arrangements.

[0279] The following is combined with Figure 14 A detailed introduction to the various components of a smartphone:

[0280] The RF circuit 1510 can be used to receive and transmit signals during information transmission or calls. In particular, it receives downlink information from the base station and processes it with the processor 1580; in addition, it transmits uplink data to the base station.

[0281] The memory 1520 can be used to store software programs and modules, and the processor 1580 runs the software programs and modules stored in the memory 1520 to realize various functions and data processing of the smartphone.

[0282] Input unit 1530 can be used to receive input numeric or character information and generate key signal inputs related to user settings and function control of the smartphone. Specifically, input unit 1530 may include touch panel 1531 and other input devices 1532. Touch panel 1531, also known as a touch screen, can collect touch operations on or near the user and drive corresponding connected devices according to a pre-set program. In addition to touch panel 1531, input unit 1530 may also include other input devices 1532. Specifically, other input devices 1532 may include, but are not limited to, one or more of the following: physical keyboard, function keys (such as volume control buttons, power buttons, etc.), trackball, mouse, joystick, etc.

[0283] The display unit 1540 can be used to display information input by the user or information provided to the user, as well as various menus of the smartphone. The display unit 1540 may include a display panel 1541, which may optionally be configured as a liquid crystal display (LCD), an organic light-emitting diode (OLED), or the like.

[0284] Smartphones may also include at least one sensor 1550, such as a light sensor, a motion sensor, and other sensors. Other sensors that smartphones may also be equipped with, such as gyroscopes, barometers, hygrometers, thermometers, and infrared sensors, will not be detailed here.

[0285] Audio circuit 1560, speaker 1561, and microphone 1562 provide an audio interface between the user and the smartphone. Audio circuit 1560 converts received audio data into electrical signals and transmits them to speaker 1561, where speaker 1561 converts them into sound signals for output. On the other hand, microphone 1562 converts collected sound signals into electrical signals, which are received by audio circuit 1560, converted into audio data, and then processed by processor 1580 before being transmitted via RF circuit 1510 to, for example, another smartphone, or the audio data can be output to memory 1520 for further processing.

[0286] The processor 1580 is the control center of the smartphone, connecting various parts of the smartphone through various interfaces and lines. It performs various functions and processes data by running or executing software programs and / or modules stored in the memory 1520, and by calling data stored in the memory 1520. Optionally, the processor 1580 may include one or more processing units.

[0287] The smartphone also includes a power supply 1590 (such as a battery) that supplies power to various components. Preferably, the power supply can be logically connected to the processor 1580 through a power management system, thereby enabling functions such as charging, discharging, and power consumption management through the power management system.

[0288] Although not shown, smartphones may also include a camera, Bluetooth module, etc., which will not be described in detail here.

[0289] In this embodiment of the application, the memory 1520 included in the smartphone can store computer programs and transmit the computer programs to the processor.

[0290] The processor 1580 included in the smartphone can execute the method for determining available bandwidth provided in the above embodiments according to the instructions in the computer program.

[0291] This application also provides a computer-readable storage medium for storing a computer program for executing the method for determining available bandwidth provided in the above embodiments.

[0292] On the other hand, embodiments of this application provide a computer program product including a computer program, which, when run on a computer device, causes the computer device to perform the method for determining available bandwidth provided in various optional implementations of the above aspects.

[0293] Those skilled in the art will understand that all or part of the steps of the above method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it performs the steps of the above method embodiments. The aforementioned storage medium can be at least one of the following media: read-only memory (ROM), RAM, magnetic disk or optical disk, and other media that can store computer programs.

[0294] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a particular 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, for example, in orders other than those illustrated or described herein. Furthermore, the terms “comprising” and “corresponding,” and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus 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 apparatus.

[0295] In this application embodiment, the terms "module" or "unit" refer to a computer program or part of a computer program that has a predetermined function and works with other related parts to achieve a predetermined goal, and can be implemented wholly or partially using software, hardware (such as processing circuitry or memory), or a combination thereof. Similarly, a processor (or multiple processors or memory) can be used to implement one or more modules or units. Furthermore, each module or unit can be part of an overall module or unit that includes the functionality of that module or unit.

[0296] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numerals in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.

[0297] The terminology used in this application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. The singular forms “a,” “the,” and “the” used in this application and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used herein refers to and includes any or all possible combinations of one or more of the associated listed items. Depending on the context, the word “if,” as used herein, can be interpreted as “when,” “in response to a determination,” or “when…”.

[0298] It should be noted that the various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, for the device and system embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the description of the method embodiments. The device and system embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of the solution in this embodiment according to actual needs. Those skilled in the art can understand and implement this without creative effort.

[0299] The above description is merely one 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 technical scope disclosed in this application should be included within the scope of protection of this application. Based on the implementation methods provided in the above aspects, this application can also be further combined to provide more implementation methods. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A method of determining available bandwidth, characterized by, The method includes: For the i-th segment among multiple segments included in a multimedia file, obtain the average bitrate change rate of the i-th segment, where i is a positive integer; Based on the average rate of change of the bitrate of the i-th slice, determine the window size and the sliding distance of the i-th slice; Based on the window size and sliding distance of the i-th slice, calculate the sub-available bandwidth corresponding to the i-th slice in each window, wherein the window is determined based on the window size and the sliding distance; The available bandwidth of the i-th slice is determined based on the sub-available bandwidth corresponding to each window of the i-th slice.

2. The method of claim 1, wherein, The method further includes: Obtain the segment duration of the i-th segment and the download duration of the i-th segment; If the duration of the segment is greater than or equal to the download duration, then the step of obtaining the average rate of change of the bitrate of the i-th segment and subsequent steps are executed. If the segment duration is less than the download duration, and the difference between the download duration and the segment duration is greater than the duration threshold, then the available bandwidth of the i-th segment is determined based on the ratio of the size of the i-th segment to the download duration. If the segment duration is less than the download duration, and the difference between the download duration and the segment duration is less than or equal to the duration threshold, then the step of obtaining the average bitrate change rate of the i-th segment and subsequent steps are executed.

3. The method of claim 1, wherein, The method further includes: If the multimedia file is downloaded in a video-on-demand scenario, the available bandwidth of the i-th segment is determined based on the ratio of the size of the i-th segment to the download duration. If the multimedia file is downloaded in a live streaming scenario, and the i-th segment is an already generated segment, then the available bandwidth of the i-th segment is determined according to the ratio of the size of the i-th segment to the download duration. If the multimedia file is downloaded in a live streaming scenario, and the i-th segment is a segment that is being generated, then the steps of obtaining the segment duration of the i-th segment and the download duration of the i-th segment, as well as subsequent steps, are executed.

4. The method of claim 1, wherein, If the average rate of change of bitrate increases, then the window size or the sliding distance is increased; if the average rate of change of bitrate decreases, then the window size or the sliding distance is decreased; or, The step of determining the window size and sliding distance of the i-th slice based on the average rate of change of the bitrate of the i-th slice includes: Based on the average rate of change of the bitrate of the i-th segment and the network latency, the window size and sliding distance of the i-th segment are determined. If the network latency increases, the window size or the sliding distance is increased; if the network latency decreases, the window size or the sliding distance is decreased.

5. The method of claim 4, wherein, If the average rate of change of bitrate increases, the window size is increased, and the window size is less than the upper limit of the window; if the average rate of change of bitrate decreases, the window size is decreased, and the window size is greater than the lower limit of the window, and the upper limit of the window is greater than the lower limit of the window.

6. The method according to claim 1, characterized in that, The step of determining the available bandwidth of the i-th fragment based on the sub-available bandwidth corresponding to each window includes: The available bandwidth of the i-th slice is determined by the largest sub-available bandwidth among the sub-available bandwidths corresponding to each window.

7. The method according to claim 1, characterized in that, If i is an integer greater than 1, then determining the available bandwidth of the i-th slice based on the sub-available bandwidth corresponding to each window includes: The measurement bandwidth of the i-th slice is determined based on the sub-available bandwidth corresponding to each window of the i-th slice. Obtain the available bandwidth of the (i-1)th slice and the measured bandwidth of the (i-1)th slice; Based on the available bandwidth of the (i-1)th slice and the measured bandwidth of the (i-1)th slice, determine the adjustment weight for the i-th slice; The available bandwidth of the i-th segment is determined based on the measured bandwidth of the i-th segment, the available bandwidth of the (i-1)-th segment, the measured bandwidth of the (i-1)-th segment, and the adjustment weight of the i-th segment.

8. The method according to claim 1, characterized in that, The method further includes: If the available bandwidth of the i-th slice is less than or equal to the required bandwidth corresponding to the bitrate of the i-th slice, then the bitrate of the (i+1)-th slice is determined to be less than the bitrate of the i-th slice. If the available bandwidth of the i-th slice is greater than the required bandwidth corresponding to the target bitrate, then the available bandwidth of n slices in the slice set is obtained, the target bitrate is greater than the bitrate of the i-th slice, the difference between the segment time of each slice included in the slice set and the segment time of the i-th slice is less than the difference threshold, and the n slices are downloaded after the i-th slice, where n is a positive integer; If the number of fragments in the fragment set whose available bandwidth is greater than the required bandwidth corresponding to the target bitrate is greater than a threshold, then the target bitrate is determined as the bitrate of the (i+n+1)th fragment.

9. The method according to claim 8, characterized in that, The step of determining that the bitrate of the (i+1)th fragment is less than the bitrate of the i-th fragment if the available bandwidth of the i-th fragment is less than or equal to the required bandwidth corresponding to the bitrate of the i-th fragment includes: Obtain the required bandwidth corresponding to the bitrate reduction coefficient and the bitrate of the i-th segment, wherein the bitrate reduction coefficient is greater than 1; The bitrate reduction threshold is determined based on the bitrate reduction coefficient and the required bandwidth corresponding to the bitrate of the i-th segment; If the available bandwidth of the i-th slice is less than or equal to the bitrate reduction threshold, then the bitrate of the (i+1)-th slice is determined to be less than the bitrate of the i-th slice.

10. The method according to claim 8, characterized in that, If the available bandwidth of the i-th slice is greater than the required bandwidth corresponding to the target bitrate, then the available bandwidth of the n slices in the slice set is obtained, including: Obtain the bitrate increase coefficient and the required bandwidth corresponding to the target bitrate, wherein the bitrate increase coefficient is greater than 1; The bitrate threshold is determined based on the bitrate increase coefficient and the required bandwidth corresponding to the target bitrate. If the available bandwidth of the i-th slice is greater than the bit rate threshold, then the available bandwidth of the n slices in the slice set is obtained.

11. The method according to claim 1, characterized in that, The method further includes: The streaming media protocol data packet of the i-th segment is obtained from the content delivery network, and the streaming media protocol data packet of the i-th segment is obtained by packaging based on the high-efficiency streaming protocol; The streaming media protocol data packets of the i-th segment are decoded based on the high-efficiency streaming protocol to obtain the i-th segment.

12. A device for determining available bandwidth, characterized in that, The device includes: an acquisition unit, a determination unit, and a calculation unit; The acquisition unit is used to acquire the average bitrate change rate of the i-th segment among the multiple segments included in the multimedia file, where i is a positive integer; The determining unit is used to determine the window size and sliding distance of the i-th slice based on the average rate of change of the bitrate of the i-th slice. The calculation unit is used to calculate the sub-available bandwidth corresponding to the i-th slice in each window based on the window size of the i-th slice and the sliding distance of the i-th slice, wherein the window is determined based on the window size and the sliding distance; The determining unit is further configured to determine the available bandwidth of the i-th slice based on the sub-available bandwidth corresponding to the i-th slice in each window.

13. A computer device, characterized in that, The computer device includes a processor and memory: The memory is used to store computer programs and to transfer the computer programs to the processor; The processor is configured to perform the method according to any one of claims 1-11 according to the computer program.

14. A computer-readable storage medium, characterized in that, The computer-readable storage medium is used to store a computer program for performing the method according to any one of claims 1-11.

15. A computer program product comprising a computer program, characterized in that, When it is run on a computer device, it causes the computer device to perform the method described in any one of claims 1-11.