Video transmission method, related apparatus and medium
Patent Information
- Application Number
- CN202510513886.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-22
- Publication Date
- 2026-10-23
AI Technical Summary
[0002]随着多媒体技术发展,网络视频在日常生活中变得越来越重要,为了减少账户在播放视频过程中等待视频内容加载到终端所需的时间,往往会将视频分割成多个视频分片,终端在加载单个视频分片后就开始播放,并在播放的同时预加载后续需要播放的其它视频分片,而由于账户可能在当前视频播放完之前就切换成播放其它视频,因此往往既需要预加载与账户正在播放的视频中未加载的一些视频分片,也需要预加载账户在后续可能会播放的其它视频中的视频分片;而在预加载这些视频分片时,终端的带宽会均等或相对随机地分配到这些正在播放的视频中的其它视频分片以及后续可能需要播放的其它视频的视频分片,导致终端的带宽有效利用率较低
[0071]本公开提出的视频传输方法、相关装置和介质,通过获取客户端当前正在播放的当前视频的已播放时长和登录客户端的账户播放过的历史视频的实际播放时长,并根据历史视频的实际播放时长进行加权得到加权播放时长,基于已播放时长在加权播放时长中的比例,可以准确地反映账户对正在播放的视频的偏好度,已播放时长和加权播放时长之间的比例越大,就说明账户对当前视频的偏好度越高,账户有较高概率会继续播放当前视频的后续内容;反之,当已播放时长和加权播放时长之间的比例较小时,此时账户则有较高概率由于对当前视频的内容偏好度不高而切换到下一个视频。因此,基于当前视频的已播放时长和加权播放时长之间的比例关系判断账户是否对当前视频的内容感兴趣,并以此确定第一待加载视频分片和各个第二待加载视频分片的加载优先级;之后,再基于加载优先级确定第一待加载视频分片和各个第二待加载视频分片的传输带宽参数,并基于传输带宽参数获取第一待加载视频分片和各个第二待加载视频分片,这样可以使得终端的终端网络带宽可以优先分配至账户有较高几率需要播放的视频分片,以此提高了终端的网络带宽的有效利用率。
Smart Images

Figure CN122970286A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of artificial intelligence, and in particular to a video transmission method, related apparatus and medium. Background Technology
[0002] With the development of multimedia technology, online video has become increasingly important in daily life. To reduce the time required for accounts to wait for video content to load on the terminal during playback, videos are often divided into multiple video segments. The terminal starts playing a single video segment after loading it, and simultaneously preloads other video segments that will be played later. However, since accounts may switch to playing other videos before the current video finishes playing, it is often necessary to preload not only some video segments that are not yet loaded in the video being played, but also video segments from other videos that the account may play later. When preloading these video segments, the terminal's bandwidth is allocated equally or relatively randomly to the other video segments in the currently playing video and the video segments of other videos that may be played later, resulting in low bandwidth utilization of the terminal. Summary of the Invention
[0003] This disclosure provides a video transmission method, related apparatus, and medium that can prioritize the allocation of terminal bandwidth for preloading video segments of higher importance, thereby improving the effective utilization rate of terminal bandwidth.
[0004] According to one aspect of this disclosure, a video transmission method is provided, the method comprising:
[0005] The client obtains the playback duration of the current video in terms of playback progress, wherein the current video is the video currently being played on the client by the account logged into the client, the current video includes a first video segment to be loaded, and the client is also used to play at least one video to be played after the current video, the video to be played includes a second video segment to be loaded, the second video segment to be loaded is the first video segment in the video to be played;
[0006] Obtain the actual playback duration of historical videos, and calculate the weighted playback duration of the historical videos by weighting the actual playback duration. The historical videos are the videos that the account has played in the past.
[0007] Based on the proportion of the already played duration in the weighted playback duration, loading priorities are determined for the first video segment to be loaded and the second video segment to be loaded, respectively.
[0008] The transmission bandwidth parameters of the first video segment to be loaded and the second video segment to be loaded are determined according to the loading priority.
[0009] The first video segment to be loaded and the second video segment to be loaded are obtained based on their respective transmission bandwidth parameters.
[0010] According to one aspect of this disclosure, a video transmission apparatus is provided, comprising:
[0011] The first duration acquisition module is used to acquire the playback duration of the current video in the client's playback progress. The current video is the video currently being played on the client by the account logged into the client. The current video includes a first video segment to be loaded. The client is also used to play at least one video to be played after the current video. The video to be played includes a second video segment to be loaded. The second video segment to be loaded is the first video segment in the video to be played.
[0012] The second duration acquisition module is used to acquire the actual playback duration of historical videos, and to obtain the weighted playback duration of the historical videos by weighting the actual playback duration. The historical videos are the videos that the account has played in the past.
[0013] The priority determination module is used to determine the loading priority for the first video segment to be loaded and the second video segment to be loaded, respectively, based on the proportion of the already played duration in the weighted playback duration.
[0014] A bandwidth allocation module is used to determine the transmission bandwidth parameters of the first video segment to be loaded and the second video segment to be loaded respectively according to the loading priority;
[0015] The video acquisition module is used to acquire the first video segment to be loaded and the second video segment to be loaded based on their respective transmission bandwidth parameters.
[0016] Optionally, the priority determination module is specifically used for:
[0017] Determine the first preset ratio threshold;
[0018] Based on the relationship between the proportion of the played duration in the weighted playback duration and the first preset proportion threshold, loading priorities are determined for the first video segment to be loaded and the second video segment to be loaded, respectively.
[0019] Optionally, the at least one video to be played includes a plurality of videos to be played in an ordered manner, and the priority determination module is specifically used for:
[0020] If the proportion of the played duration in the weighted playback duration is greater than the first preset proportion threshold, the loading priority determined for the first video segment to be loaded is higher than the loading priority determined for each of the second video segments to be loaded, and the loading priority determined for each of the second video segments to be loaded decreases sequentially according to the order of the multiple videos to be played.
[0021] Alternatively, if the proportion of the played duration in the weighted playback duration is less than or equal to the first preset proportion threshold, the loading priority determined for the first video segment to be loaded is lower than the loading priority determined for at least one second video segment to be loaded, and the loading priority determined for each second video segment to be loaded decreases sequentially according to the order of the multiple videos to be played.
[0022] Optionally, the priority determination module is specifically used for:
[0023] The account category of the account is determined based on the weighted playback duration, wherein the account category includes at least a first account category and a second account category, and the weighted playback duration corresponding to the first account category is greater than the weighted playback duration corresponding to the second account category;
[0024] A first preset ratio threshold is determined based on the account category, wherein the first preset ratio threshold corresponding to the first account category is less than the first preset ratio threshold corresponding to the second account category.
[0025] Optionally, the priority determination module is specifically used for:
[0026] If the weighted playback duration is greater than the first preset time threshold, the account category of the account is determined to be the first account category;
[0027] Alternatively, if the weighted playback duration is less than or equal to the first preset time threshold, the account category of the account is determined as the first account category.
[0028] Optionally, the number of historical videos is multiple, and the second duration acquisition module is specifically used for:
[0029] The weighted sum of the actual playback durations of multiple historical videos is obtained by weighting and summing them.
[0030] Optionally, the second duration acquisition module is specifically used for:
[0031] Obtain a first preset weight coefficient and a second preset weight coefficient, wherein both the first preset weight coefficient and the second preset weight coefficient are positive numbers not greater than 1;
[0032] The first historical video in the ordered set of multiple historical videos is determined as the first historical video of the current round, and the actual playback duration corresponding to the first historical video is determined as the reference playback duration.
[0033] The next historical video after the first historical video is determined as the second historical video of the current round;
[0034] The reference playback duration and the playback duration of the second historical video are weighted and summed based on the first preset weight coefficient and the second preset weight coefficient, and the reference playback duration is updated based on the result of the weighted summation.
[0035] The second historical video of the current round is determined as the first historical video of the next round, and the reference playback duration is updated again until the second historical video is the last historical video in an ordered set of multiple historical videos, thus obtaining the weighted playback duration of the multiple historical videos.
[0036] Optionally, the bandwidth allocation module is specifically used for:
[0037] Monitor the network performance metrics of the terminal running the client, and determine the network quality coefficient based on the network performance metrics;
[0038] In response to the decrease in network quality coefficient, the transmission bandwidth parameters of the first video segment to be loaded and the second video segment to be loaded are determined according to the loading priority.
[0039] Optionally, the bandwidth allocation module is specifically used for:
[0040] The bandwidth ratio coefficients of the first video segment to be loaded and the second video segment to be loaded are determined according to the loading priority, wherein the bandwidth ratio coefficients are positively correlated with the loading priority;
[0041] Obtain the terminal network bandwidth of the terminal running the client, and determine the terminal network bandwidth and the corresponding bandwidth ratio coefficient as the transmission bandwidth parameters of the first video segment to be loaded and the second video segment to be loaded, respectively.
[0042] Optionally, the bandwidth allocation module is specifically used for:
[0043] If the terminal network bandwidth is less than a preset bandwidth threshold, a preset bandwidth list is obtained. The preset bandwidth list includes multiple ordered preset bandwidth values, which decrease sequentially.
[0044] The ordered preset bandwidth values are sequentially allocated to the first video segment to be loaded and the second video segment to be loaded according to the loading priority from high to low, until the sum of the allocated preset bandwidth values is greater than or equal to the terminal network bandwidth.
[0045] Optionally, the bandwidth allocation module is specifically used for:
[0046] The first connection bandwidth between the terminal and each video server is obtained. The video server is used to transmit at least one of the first video segment to be loaded or the second video segment to be loaded to the terminal. The first connection bandwidth is the maximum bandwidth between the video server and the terminal within a preset period.
[0047] The terminal network bandwidth of the terminal is determined based on the bandwidth of each of the first connection bandwidths.
[0048] Optionally, the bandwidth allocation module is specifically used for:
[0049] The terminal network bandwidth is obtained by summing the bandwidths of each of the first connections;
[0050] Alternatively, the terminal network bandwidth can be obtained based on the average of the bandwidths of each of the first connections;
[0051] Alternatively, the bandwidths of each first connection can be sorted based on their respective bandwidth sizes to obtain a bandwidth sorting result, and the terminal network bandwidth can be determined based on a preset quantile and the bandwidth sorting result.
[0052] Optionally, the bandwidth allocation module is specifically used for:
[0053] Determine the timestamp corresponding to the terminal network bandwidth, the timestamp being used to characterize the time information when determining the terminal network bandwidth based on each of the connection bandwidths;
[0054] Obtain the current time information and determine the first time difference between the timestamp and the current time information;
[0055] If the first time difference is greater than a preset time difference threshold, the second connection bandwidth between the terminal and each of the video servers is obtained, and the terminal network bandwidth is re-determined based on each of the second connection bandwidths.
[0056] Optionally, the video acquisition module is specifically used for:
[0057] The transmission bandwidth parameters corresponding to the first video segment to be loaded and the transmission bandwidth parameters corresponding to the second video segment to be loaded are respectively sent to the video servers corresponding to the first video segment to be loaded and the second video segment to be loaded.
[0058] Receive the first video segment to be loaded and the second video segment to be loaded from each of the video servers based on the corresponding transmission bandwidth parameters.
[0059] Optionally, the transmission bandwidth parameters include the terminal network bandwidth and bandwidth ratio of the terminal running the client, and the video server is specifically used for:
[0060] The transmission bandwidth is determined by multiplying the terminal network bandwidth and the bandwidth ratio coefficient.
[0061] Obtain the initial transmission rate corresponding to when the video server transmits the first video segment to be loaded and the second video segment to be loaded to the terminal;
[0062] Select one of the initial transmission rate and the transmission bandwidth as the target transmission rate;
[0063] Based on the target transmission rate, the first video segment to be loaded and the second video segment to be loaded are transmitted to the terminal. During the transmission of the first video segment to be loaded and the second video segment to be loaded to the terminal, in response to the initial transmission rate update, the transmission bandwidth is updated based on the updated initial transmission rate, and the first video segment to be loaded and the second video segment to be loaded are transmitted to the terminal based on the updated target transmission rate.
[0064] Optionally, the video server is specifically used for:
[0065] Obtain the initial congestion window size corresponding to the video server. The initial congestion window size is used to characterize the maximum amount of data that the video server can send when it does not receive a response signal from the terminal.
[0066] The congestion adjustment ratio is determined based on the ratio of the target transmission rate to the initial transmission rate, and the initial congestion window size is adjusted based on the congestion adjustment ratio to obtain the target congestion window size;
[0067] Based on the target congestion window size and the target transmission rate, the corresponding first video segment to be loaded and the second video segment to be loaded are transmitted to the terminal.
[0068] According to one aspect of this disclosure, an electronic device is provided, including a memory and a processor, the memory storing a computer program, the processor executing the computer program to implement the video transmission method as described above.
[0069] According to one aspect of this disclosure, a computer-readable storage medium is provided, the storage medium storing a computer program that, when executed by a processor, implements the video transmission method described above.
[0070] According to one aspect of this disclosure, a computer program product is provided, comprising a computer program that is read and executed by a processor of a computer device, causing the computer device to perform the video transmission method as described above.
[0071] The video transmission method, related apparatus, and medium disclosed herein obtain the playback duration of the currently playing video on the client and the actual playback duration of historical videos played by the logged-in client account. A weighted playback duration is obtained by weighting the historical videos based on their actual playback durations. The proportion of the playback duration to the weighted playback duration accurately reflects the account's preference for the currently playing video. A larger proportion between the playback duration and the weighted playback duration indicates a higher preference for the current video, and the account is more likely to continue playing subsequent content of the current video. Conversely, when the proportion between the playback duration and the weighted playback duration is small, the account is more likely to switch to the next video due to a low preference for the current video's content. Therefore, the system determines whether an account is interested in the current video content based on the ratio between the current video's played duration and its weighted playback duration, and uses this to determine the loading priority of the first video segment to be loaded and each of the second video segments to be loaded. Then, based on the loading priority, the system determines the transmission bandwidth parameters of the first video segment to be loaded and each of the second video segments to be loaded, and uses these transmission bandwidth parameters to obtain the first video segment to be loaded and each of the second video segments to be loaded. This allows the terminal's network bandwidth to be preferentially allocated to video segments that the account has a higher probability of needing to play, thereby improving the effective utilization rate of the terminal's network bandwidth.
[0072] Other features and advantages of this disclosure will be set forth in the following description and will be apparent in part from the description or may be learned by practicing the disclosure. The objectives and other advantages of this disclosure may be realized and obtained by means of the structures particularly pointed out in the description, claims and drawings. Attached Figure Description
[0073] The accompanying drawings are provided to further understand the technical solutions of this disclosure and constitute a part of the specification. They are used together with the embodiments of this disclosure to explain the technical solutions of this disclosure and do not constitute a limitation on the technical solutions of this disclosure.
[0074] Figure 1 This is a system architecture diagram of the video transmission method according to an embodiment of the present disclosure;
[0075] Figure 2 A flowchart illustrating a video transmission method provided in an embodiment of this disclosure;
[0076] Figure 3 A schematic diagram illustrating the video that needs to be preloaded for the terminal provided in this embodiment of the disclosure;
[0077] Figure 4 This is a flowchart illustrating the calculation of weighted playback duration provided in an embodiment of the present disclosure;
[0078] Figure 5 Execution provided for embodiments of this disclosure Figure 2 A schematic diagram of an optional topology architecture for video transmission methods in [the context of video transmission].
[0079] Figure 6 Execution provided for embodiments of this disclosure Figure 2 A schematic diagram of another optional topology architecture for video transmission methods in the diagram;
[0080] Figure 7 A schematic diagram illustrating the connection relationship between a terminal and a video server provided in an embodiment of this disclosure;
[0081] Figure 8 A schematic diagram illustrating the process of establishing a connection between a terminal and a video server, as provided in an embodiment of this disclosure.
[0082] Figure 9 A schematic diagram illustrating the interaction process between a terminal and a video server provided in an embodiment of this disclosure;
[0083] Figure 10 A flowchart illustrating the overall process of applying the video transmission method provided in the embodiments of this disclosure;
[0084] Figure 11 This is a schematic diagram of the structure of a video transmission device provided in an embodiment of the present disclosure;
[0085] Figure 12 This is a partial structural block diagram of a terminal provided in an embodiment of the present disclosure;
[0086] Figure 13 This is a partial structural block diagram of a server provided in an embodiment of this disclosure. Detailed Implementation
[0087] To make the objectives, technical solutions, and advantages of this disclosure clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and are not intended to limit the scope of this disclosure.
[0088] Before providing a further detailed description of the embodiments of this disclosure, the terms and concepts used in these embodiments are explained, and they are subject to the following interpretations:
[0089] Video segments are video fragments obtained by breaking down a video into its constituent parts, and are one of the basic units for network video transmission. When transmitting network video, if the video source transmits the entire video to the terminal, the terminal needs to wait for the entire video to download before it can decode and play it. Since video files are relatively large, downloading the entire video often takes a long time, resulting in a poor playback experience. Furthermore, when transmitting such large files, if an error occurs during transmission, the entire video file needs to be retransmitted, and it is susceptible to network fluctuations that can cause transmission failures. Therefore, related technologies often break down the video into multiple video segments at the video source, with each segment corresponding to a shorter segment of the video. The video is then transmitted to the terminal in segments. In this case, the terminal only needs to load one video segment before starting playback, without waiting for the entire video to load. In related technologies, a video can be divided into multiple video segments based on a preset length or a preset percentage. For example, a 60-second video can be divided into 6 video segments with a preset length of 10 seconds, or into 10 video segments with a preset length of 6 seconds each, based on a preset ratio of 10%.
[0090] When transmitting network video, it is often done in video chunks. This means the video is broken down into multiple smaller segments, and each segment is transmitted independently to the terminal. Furthermore, considering that users may switch to other videos during playback, especially after quickly switching from the beginning of a video to the next one if the content doesn't meet their needs, the terminal often needs to preload unloaded video chunks from the currently playing video as well as chunks from other videos the user might switch to. However, related technologies often allocate terminal bandwidth equally or relatively randomly to receive these video chunks. This can lead to inefficient bandwidth allocation for loading chunks that need to be played quickly, resulting in low bandwidth utilization. This is particularly problematic when the terminal has poor network quality and limited overall bandwidth, easily leading to video stuttering due to the inability to preload necessary video chunks in time.
[0091] Based on this, this disclosure proposes a video transmission method, related apparatus and medium, which can improve the effective utilization of the network bandwidth of the terminal.
[0092] Figure 1 This is a system architecture diagram of a video transmission method according to an embodiment of the present disclosure. It includes: a target terminal 110, an Internet 120, a gateway 130, and a server 140.
[0093] The target terminal 110 is a device used by the target to play the current video and various videos to be played. It includes various forms such as desktop computers, laptops, PDAs (Personal Digital Assistants), mobile phones, in-vehicle terminals, home theater terminals, dedicated terminals, televisions, and set-top boxes. Furthermore, it can be a single device or a collection of multiple devices. For example, multiple devices can be connected via a local area network, sharing a single display device to work collaboratively, forming a single terminal. The target terminal 110 can also communicate with the Internet 120 via wired or wireless means to exchange data.
[0094] Gateway 130, also known as an internetwork connector or protocol converter, is a computer system or device that enables network interconnection at the transport layer and acts as a translator. It bridges the gap between two systems using different communication protocols, data formats, languages, or even completely different architectures. Gateway 130 also provides filtering and security functions. Messages sent from target terminal 110 to server 140 are forwarded to the corresponding server 140 via gateway 130. Messages sent from server 140 to target terminal 110 are also forwarded to the corresponding target terminal 110 via gateway 130.
[0095] Server 140 is a computer system that provides video transmission services to target terminal 110. Compared to target terminal 110, server 140 has higher requirements in terms of stability, security, and performance. Server 140 can be a single high-performance computer in a network platform, a cluster of multiple high-performance computers, a portion of a single high-performance computer (e.g., a virtual machine), or a combination of portions of multiple high-performance computers (e.g., virtual machines). Server 140 can also communicate with the Internet 120 via wired or wireless means to exchange data.
[0096] For example, the target terminal 110 detects the played duration of the current video and obtains the actual played duration of each historical video in the account. It then sends the played duration and weighted playback duration to the server 140. The server 140, after obtaining the played duration of the current video and the actual played duration of each historical video, determines the weighted playback duration of the account based on the actual played duration and identifies the first video segment to be loaded in the current video. The first video segment to be loaded includes at least the first video segment following the currently playing video segment. Simultaneously, it identifies the second video segment to be loaded in the videos that the target terminal 110 may subsequently play. Based on the ratio between the played duration and the weighted playback duration, the server 140 sends the played duration and weighted playback duration to each historical video segment. The first video segment to be loaded and each second video segment to be loaded are assigned a corresponding loading priority. The target terminal 110 also detects its own terminal network bandwidth and sends the terminal network bandwidth to the server 140. After receiving the terminal network bandwidth, the server 140 allocates the terminal network bandwidth to the first video segment to be loaded and each second video segment to be loaded based on the loading priority, so as to determine the transmission bandwidth of each first video segment to be loaded and each second video segment to be loaded. Afterwards, the server 140 can return each transmission bandwidth to the target terminal 110 so that the target terminal 110 can obtain the corresponding video segment to be loaded based on the transmission bandwidth of each first video segment to be loaded and each second video segment to be loaded.
[0097] In addition, the server 140 may not return the transmission bandwidth of each first video segment to be loaded and each second video segment to be loaded to the target terminal 110. Instead, it may directly send the transmission bandwidth of each first video segment to be loaded and each second video segment to be loaded to the video source of each first video segment to be loaded and each second video segment to be loaded, so that the video source sends each first video segment to be loaded and each second video segment to be loaded to the target terminal 110 based on the corresponding transmission bandwidth.
[0098] In addition, the target terminal 110 may not send the played duration and weighted playback duration to the server 140. Instead, it can directly determine the loading priority of each first video segment to be loaded and each second video segment to be loaded locally on the target terminal 110 based on the ratio between the played duration and the weighted playback duration. Based on the loading priority, the terminal network bandwidth of the target terminal 110 is allocated to each first video segment to be loaded and each second video segment to be loaded. Based on the transmission bandwidth allocated to each first video segment to be loaded and each second video segment to be loaded, the target terminal 110 obtains each first video segment to be loaded and each second video segment to be loaded from the video source.
[0099] As can be seen, by obtaining the playback duration of the currently playing video on the client and the actual playback duration of historical videos played by the logged-in client account, and then weighting them according to the actual playback duration of historical videos to obtain the weighted playback duration, the proportion of the playback duration to the weighted playback duration can accurately reflect the account's preference for the currently playing video. The larger the proportion between the playback duration and the weighted playback duration, the higher the account's preference for the current video, and the higher the probability that the account will continue to play the subsequent content of the current video. Conversely, when the proportion between the playback duration and the weighted playback duration is small, the account is more likely to switch to the next video due to a low preference for the content of the current video. Therefore, the system determines whether an account is interested in the current video content based on the ratio between the current video's played duration and its weighted playback duration, and uses this to determine the loading priority of the first video segment to be loaded and each of the second video segments to be loaded. Then, based on the loading priority, the system determines the transmission bandwidth parameters of the first video segment to be loaded and each of the second video segments to be loaded, and uses these transmission bandwidth parameters to obtain the first video segment to be loaded and each of the second video segments to be loaded. This allows the terminal's network bandwidth to be preferentially allocated to video segments that the account has a higher probability of needing to play, thereby improving the effective utilization rate of the terminal's network bandwidth.
[0100] As can be seen, compared to the related technologies that allocate the terminal's network bandwidth for preloading various video segments in an equal or relatively random manner, the method disclosed in this invention determines the account's video playback habits by combining the current video's played duration and the account's weighted playback duration. This determines the loading priority of the subsequent video segments of the current video and the video segments of the video to be played, and allocates transmission bandwidth parameters to the subsequent video segments of the current video and the video segments of the video to be played based on these parameters. By obtaining each video segment based on the transmission bandwidth parameters, the terminal's network bandwidth can be prioritized for preloading video segments with higher priority and a higher probability of needing to be played in a short time, thereby improving the effective utilization rate of the terminal's network bandwidth.
[0101] The video transmission method disclosed herein can be applied to various scenarios, such as multimedia and online education.
[0102] Reference Figure 2 , Figure 2 This is a schematic diagram of an optional video transmission method provided in this embodiment of the disclosure. The video transmission method can be executed independently by the terminal, or it can be executed collaboratively by the terminal and the server, with each completing a portion of the process. The video transmission method may include, but is not limited to, the following steps:
[0103] Step S201: Obtain the current playback duration of the video on the client in terms of playback progress;
[0104] The current video is the video currently playing on the logged-in client account. This means that the current video is a network video that needs to be sent in real-time from a video source such as a video server or database to the terminal via Ethernet or other communication methods, rather than a local video stored on the terminal running the client. For example, the current video could be a short video from a media platform, an episode of a TV series, or a course video from an online course; this is not limited in this embodiment.
[0105] The current video includes at least one first video segment to be loaded. This first video segment to be loaded includes at least the first video segment following the currently playing video segment. The current video is divided into multiple video segments, which are loaded and played sequentially. The video segments to be loaded refer to those not yet loaded onto the client. Understandably, to ensure smooth video playback, at least the first video segment following the currently playing video segment needs to be preloaded. Specifically, after the current video is divided into multiple video segments, these segments are ordered. The order of each video segment indicates its position within the current video. For example, when a video is divided into multiple 5-second segments, the first 5 seconds constitute the first video segment, the 6th to 10th seconds constitute the second video segment, and so on. Therefore, the first video segment to be loaded can be determined based on the video segment that is currently playing. For example, if the video segment that is currently playing is the 5th video segment in the current video, then the first video segment to be loaded includes at least the 6th video segment in the current video.
[0106] In addition, in one possible embodiment, besides the first video segment after the currently playing video segment, the first video segment to be loaded may also include all other video segments in the current video that are after the currently playing video segment. For example, if the current video consists of 10 ordered video segments, and the currently playing video segment is the 5th video segment, then the first video segment to be loaded includes not only the 6th video segment in the current video, but also the 7th to 10th video segments in the current video. It should be noted that, considering that during the playback of the current video, the account may skip a segment of the current video by sliding the progress bar or other means, and directly play another segment of the current video. In this case, the first video segment to be loaded can only include the video segments after the currently playing video segment, excluding the video segments that have been skipped and are before the currently playing video segment. For example, if the current video consists of video segments 1 to m, and the account directly drags the progress bar to skip all segments before video segment i, and directly plays video segment i, where i is an integer less than m, then the first video segment to be loaded refers to video segments i+1 to m of the current video, excluding video segments 1 to i-1.
[0107] Reference Figure 3 The client is also used to play at least one video to be played after the current video. The video to be played is another video that the account may switch to and play while the current video is playing. The video to be played can be another video that is categorized in the same video list as the current video and appears after the current video. For example, the video to be played and the current video could be different episodes from the same TV series, different course videos from the same online course, different videos uploaded by the same uploader and categorized in the same list, videos added by the account to the same video playlist (such as a video collection created by the account), or videos that the account switches to after swiping on the current video. For example, if the current video is the second episode of a TV series, then the third episode and all subsequent videos of the series are the videos to be played. In addition, the video to be played can also be a video pushed to the account by a recommendation algorithm for the account to play later. For example, the video to be played can be a video with the same or similar content tags, category tags, address tags, or creator tags as the current video, so that it can be pushed to the account by the corresponding recommendation algorithm; or, the video to be played can be a video whose corresponding feature vector has a high similarity to the feature vector of the current video, so that it can be pushed to the account by a feature vector-based recommendation algorithm. This is not limited in this embodiment.
[0108] Understandably, multiple videos awaiting playback are also ordered. The order of the videos represents the order in which the account plays videos normally (i.e., one video plays automatically after another has finished playing). For example, when the videos awaiting playback and the current video are different videos from the same series or course, the videos awaiting playback are inherently ordered. However, when the videos awaiting playback are pushed to the account through a recommendation algorithm, they will be sorted based on the recommendation logic of the algorithm itself. For example, they may be sorted from most to least similar or identical tags between the videos awaiting playback and the current video, or from highest to lowest similarity between the feature codes of the videos awaiting playback and the feature codes of the current video.
[0109] Understandably, the order of the videos to be played can represent the probability of choosing to play each video when the account switches to and plays other videos while the current video is playing, or it can represent the playback order when the account switches to a specified video by swiping the terminal screen or other preset non-directional switching methods. For example, when the account switches to a video by swiping the screen, the first swipe will switch to the first video to be played, the second swipe will switch to the second video to be played, and so on. The number of videos to be played can be determined based on the actual situation. For example, when the videos to be played are course videos belonging to the same online course as the current video, the number of videos to be played is determined based on the number of course videos following the currently playing course video in that online course. Alternatively, when the videos to be played are videos pushed to the account through a recommendation algorithm based on tags or feature vectors, the number is determined based on the actual number of videos pushed by the recommendation algorithm. Of course, in one possible embodiment, to avoid the terminal's network bandwidth being allocated too much after the first video segment to be loaded and each of the second video segments to be loaded, resulting in insufficient bandwidth allocated to a single video segment, the number of videos to be played can be capped. For example, the maximum number of videos to be played is no more than 100. If there are too many other videos following the current video in the video list or too many videos recalled by the recommendation algorithm, then the top 100 videos in the sorted list will be used as the videos to be played.
[0110] The video to be played includes at least one second video segment to be loaded, which refers to the first video segment in the corresponding video to be played. It is understandable that if an account switches to another video to be played while the current video is playing, the first video segment of the switched-to video will be played first. Therefore, during the playback of the current video, it is also necessary to preload the first video segment of each video to be played, meaning that a portion of the terminal's bandwidth needs to be allocated to each second video segment to be loaded.
[0111] Specifically, on the terminal, corresponding identifiers can be assigned to multiple first video segments to be loaded and multiple second video segments to be loaded. The identifiers of the first video segments to be loaded and each of the second video segments to be loaded can be constructed into a set. For example, if the current video is denoted as video i, and the current video includes m video segments, and the video segment currently playing is the j-th video segment in the current video, then the video segment currently playing can be denoted as video_i_j, and the identifier corresponding to the first video segment to be loaded can be denoted as video_i_j+1, where video_i_j+1 is the (j+1)-th video segment in the current video; and the videos to be played can be denoted sequentially as video i+1, video i+2, video i+3..., and the second video segment to be loaded, as the first video segment in the corresponding video to be played, can be denoted sequentially as video_i+1_1, video_i+2_1, video_i+3_1... Subsequently, based on the identifiers of each first video segment to be loaded and each second video segment to be loaded, a corresponding set can be constructed. This set can be denoted as [video_i_j+1, video_i+1_1, video_i+2_1, video_i+3_1...]. Then, by determining the loading priority corresponding to each identifier in this set, the terminal's bandwidth can be allocated to each first and second video segment to be loaded. Furthermore, in one possible embodiment, the first video segments to be loaded include not only the first video segment after the currently playing video segment, but also multiple other video segments after the currently playing video segment. In this case, corresponding identifiers, such as video_i_j+2, video_i_j+3..., can also be assigned to these video segments and used as elements in the set.
[0112] Played duration refers to the length of time the current video has been played according to the playback progress. Specifically, when the current video is played on the terminal, the playback progress of the current video is recorded in real time, for example, through a progress bar or other means. Based on this, the played duration of the current video can be determined according to the playback progress of the current video. For example, if the total duration of the current video is 5 minutes and the current progress bar has played for 2 minutes, then the played duration is 2 minutes.
[0113] Step S202: Obtain the actual playback duration of the historical videos, and calculate the weighted playback duration of the historical videos by weighting the actual playback duration.
[0114] Historical videos are videos that an account has already played. It should be noted that historical videos can include all videos played on multiple different devices belonging to the account, not just those played on the device currently playing the video. Historical videos can include all videos played by the account; alternatively, historical videos can only include videos played by the account within a certain time period, such as videos played by the account within the last 7 days; or historical videos can only include a preset number of recently played videos, such as the 500 most recently played videos. This can be set according to actual circumstances and is not limited in this embodiment.
[0115] The actual playback duration refers to the actual time elapsed when the corresponding historical video is played on the terminal. For example, if a historical video starts playing on the terminal at time node 1 and stops playing at time node 2, the corresponding actual playback duration is the time difference between time node 1 and time node 2. Specifically, when an account plays a video, the video platform's server or the terminal locally stores the account's historical playback records in an account database. These historical playback records include multiple videos played by the account and the actual playback duration of each video. For example, when an account plays a short video on the terminal and stops playing it after 50 seconds, a historical playback record corresponding to this short video is generated to indicate that the account played the short video on the terminal and that the actual playback duration of the short video was 50 seconds. This historical playback record is then stored in the corresponding account database. Based on this, in this embodiment, the actual playback duration of each corresponding historical video can be read from the account database corresponding to the account.
[0116] In one possible embodiment, considering that an account might speed up playback or drag the progress bar to skip segments of a historical video during playback, the playback progress of the historical video might not match its actual playback duration. In this case, the actual playback duration refers to the actual time elapsed on the terminal while the historical video is playing, not the duration indicated by the playback progress bar. For example, if an account plays a historical video at double speed, playing 20 seconds of content within a 10-second window before stopping playback, the actual playback duration of the historical video is 10 seconds, not 20 seconds. Therefore, in one embodiment, for each historical video, a start timestamp can be obtained when the account starts playing the video, and an end timestamp can be obtained when the account stops playing the video. The actual playback duration is determined based on the time difference between the start and end timestamps, and the actual playback duration and the corresponding historical video are associated and stored in the corresponding account database.
[0117] After obtaining the actual playback duration of multiple historical videos for an account, the weighted playback duration corresponding to the account can be determined based on the actual playback duration of each historical video. In this embodiment, the weighted playback duration is determined by weighting the actual playback durations of multiple historical videos, and is a parameter that can be used to reflect the account's overall playback duration on historical videos. It is easy to understand that historical videos often include videos that the account plays completely and videos that the account stops playing before they finish (e.g., switching to the next video before they finish playing) because the account is not interested in the video content. The weighted playback duration obtained based on the actual playback duration of each historical video is itself between the playback duration of videos that the account is interested in and the playback duration of videos that the account is not interested in. It can be used to determine whether the account is interested in the current video and whether it will continue playing the subsequent content of the current video.
[0118] Specifically, in one embodiment, the average of the actual playback durations of multiple historical videos played by an account can be determined as the weighted playback duration. For example, the average of the actual playback durations of multiple historical videos played by an account within a certain period can be calculated as the weighted playback duration. For example, the average of the actual playback durations of all historical videos played by an account within 24 hours can be calculated. Alternatively, the number of historical videos used to calculate the weighted playback duration can be preset, and then the actual playback durations of multiple historical videos of the account can be obtained based on the preset number of videos and the average can be calculated to determine the weighted playback duration. For example, the average of the actual playback durations of the 100 most recently played historical videos of the account can be calculated as the weighted playback duration.
[0119] In one possible embodiment, the actual playback durations of multiple historical videos can be weighted and summed, and the result of the weighted summation can be used as the weighted playback duration. Specifically, in one possible implementation, step S202 includes: obtaining a first preset weight coefficient and a second preset weight coefficient; determining the first historical video in the ordered set of multiple historical videos as the first historical video of the current round, and determining the actual playback duration corresponding to the first historical video as the reference playback duration; determining the next historical video after the first historical video as the second historical video of the current round; performing a weighted summation of the reference playback duration and the playback duration of the second historical video based on the first preset weight coefficient and the second preset weight coefficient, and updating the reference playback duration based on the result of the weighted summation; determining the second historical video of the current round as the first historical video of the next round, and updating the reference playback duration again, until the second historical video is the last historical video in the ordered set of multiple historical videos, thus obtaining the weighted playback duration of the historical videos.
[0120] Based on this, the actual playback duration of multiple historical videos is recursively weighted and summed in multiple rounds. Under this recursive weighted summation method, the earlier the historical video was played, the more times its actual playback duration is recursively weighted, and the smaller its actual weight. Conversely, the actual playback duration of the account's most recently played historical videos is recursively weighted, and the corresponding actual weight is relatively larger. Thus, the actual playback duration of the account's most recently played historical videos has a greater impact on the weighted playback duration, making the obtained weighted playback duration more accurately reflect the account's recent video playback habits.
[0121] It's understandable that the account plays historical videos one by one, rather than all at once. Therefore, the multiple historical videos are ordered, and the last one in this ordered sequence is the last video the account played before playing the current video. It's also understandable that the actual playback time of the most recently played historical videos more accurately reflects the account's current video playback habits compared to the actual playback time of older historical videos.
[0122] Based on this, in this embodiment, a first preset weighting coefficient and a second preset weighting coefficient are first obtained. Specifically, the first preset weighting coefficient and the second preset weighting coefficient are two pre-set integers not greater than 1. In one embodiment, the sum of the first preset weighting coefficient and the second preset weighting coefficient is 1, that is, the second preset weighting coefficient is the difference between 1 and the first preset weighting coefficient. For example, if the first preset weighting coefficient is 0.8, then the second preset weighting coefficient is 0.2. Thus, it can be ensured that when performing weighted summation based on the first preset weighting coefficient and the second preset weighting coefficient, the total weight of all weighted parameters is 1, and the result of weighted summation will not show an overall increasing or decreasing trend as the number of weighted summations increases.
[0123] After obtaining the first and second preset weighting coefficients, the first historical video in the ordered set of historical videos is designated as the first historical video, and its actual playback duration is designated as the reference playback duration. The next historical video after the first historical video is designated as the second historical video. Then, multiple rounds of weighted summation are performed based on the first and second preset weighting coefficients. In each round of calculation, the reference playback duration is weighted according to the first preset weighting coefficient, and the actual playback duration of the second historical video is weighted according to the second preset weighting coefficient. This weighted summation is then performed, and the reference playback duration is updated based on the result. The second historical video is then used as the new first historical video, and the next round of weighted summation begins until the second historical video is the last historical video. At this point, the reference playback duration calculated in the current round is determined as the weighted playback duration.
[0124] For example, refer to Figure 4 First, obtain the first preset weight coefficient α and the second preset weight coefficient 1-α. Then, determine the actual playback duration of the first historical video as the initial reference playback duration. Simultaneously, during the recursive weighted summation process across multiple rounds, maintain a parameter m. Parameter m represents the position of the second historical video in the ordered sequence of historical videos in the current round. It's easy to understand that in the first round, the second historical video in the ordered sequence is used as the second historical video; therefore, the initial m can be set to 2. Then, the calculation can begin. Specifically, in each round, obtain the actual playback duration time_watch_m corresponding to the m-th historical video and the reference playback duration time_m-1 passed to the current round. Then, perform a weighted summation of the reference playback duration and the actual playback duration of the second historical video based on the first and second preset weight coefficients. Specifically, the calculation process for the recursive round in which the m-th historical video is used as the second historical video can be represented as follows:
[0125] time_m=alpha*time_m-1+(1-ahpha)*time_watch_m;
[0126] In this way, the reference playback duration for the current round can be obtained. Next, it is determined whether the second historical video of the current round, i.e., the m-th historical video, is the last historical video. If so, the reference playback duration for the current round is determined as the weighted playback duration; otherwise, m is incremented by 1, and the calculation for the next round is performed based on the reference playback duration calculated for the current round and the actual playback duration of the historical video corresponding to the incremented m, until the m-th historical video is the last historical video.
[0127] Understandably, because the reference playback duration from the previous round is weighted in each round of calculation, this is equivalent to reducing the weight of each historical video before the second historical video in the current round. This results in the weight of the actual playback duration of multiple ordered historical videos increasing sequentially. The older the historical video played by the account, the smaller the weight, while the weight of the actual playback duration of the account's most recently played historical video is relatively larger. This allows the weighted playback duration to more accurately reflect the account's current video playback habits.
[0128] As can be understood from the description in step S202 above, each time an account stops playing a video, that stopped video is recorded as a historical video of the account and a corresponding historical playback record is written to the account database. Based on this, in one possible embodiment, the weighted playback duration can be updated in real time as the account stops playing a video. Specifically, it can be based on the actual playback duration of multiple historical videos stored in the account database. For example, if the video the account is currently playing is the m-th video played by the account on the platform, then there will be m-1 historical playback records in the account database. In this case, the weighted playback duration can be based on these m-1 historical... The actual playback duration of the video determines the weighted playback duration at this point, which can be denoted as time_watch_m-1. When the account stops playing the m-th video and switches to playing the (m+1)-th video, the actual playback duration time_m of the m-th video played by the account can be obtained in real time. Based on the first and second preset weighting coefficients, the actual playback duration time_m of the m-th video and the weighted playback duration time_watch_m-1 obtained based on the actual playback duration of the previous m-1 historical videos are weighted and summed to obtain a new weighted playback duration time_watch_m.
[0129] Step S203: Based on the proportion of the played duration in the weighted playback duration, determine the loading priority for the first video segment to be loaded and the second video segment to be loaded respectively.
[0130] Loading priority refers to the priority given by the terminal when preloading each first and second video segment to be loaded. A higher loading priority indicates that the terminal needs to load the corresponding first or second video segment first. Similarly, weighted playback duration represents the total playback time of each historical video by the account. It can be used to represent the threshold for the playback time of videos the account is interested in and not interested in. When the playback time of the current video reaches a certain percentage of the weighted playback duration, the account is considered interested in the current video and has a high probability of continuing to play subsequent content. Conversely, when the playback time has not reached a certain percentage of the weighted playback duration, the account is considered not interested in the subsequent content of the current video, and the account has a high probability of stopping playback of the current video and switching to the next video. Therefore, based on the ratio between the played duration and the weighted playback duration, the account's preference during the playback of the current video can be determined. This ratio is then used to assign loading priorities to each first and second video segment to be loaded, allowing for subsequent allocation of terminal network bandwidth to each segment based on these priorities. It should be noted that in this embodiment, the ratio of the played duration to the weighted playback duration refers to the ratio between the total played duration and the total weighted playback duration.
[0131] Specifically, at least two ratio ranges can be preset, and a loading priority list can be preset for each ratio range. This loading priority list can represent the loading priority assigned to each first video segment to be loaded and each second video segment to be played when the played duration and the weighted playback duration are within the corresponding ratio range. Then, based on the ratio range in which the ratio between the played duration and the weighted playback duration falls, the corresponding loading priority list is looked up, and loading priorities are assigned to each first video segment to be loaded and each second video segment to be loaded. For example, three ratio ranges can be preset: [0, 0.6), [0.6, 1), and [1, +∞). Corresponding loading priority lists can be preset for each of these ranges. For instance, when the ratio is within the range [0, 0.6], it indicates that the current video's playback duration is much shorter than the account's weighted playback duration. It can be assumed that the account is not currently showing interest in the current video. In this case, the account has a higher probability of switching to other videos during the current video's playback. Therefore, for the ratio range [0, 0.6), a higher loading priority can be set for each second-loaded video segment, while a lower priority can be set for each first-loaded video segment. The loading priority of each first video segment to be loaded is set to a lower priority than that of each second video segment to be loaded. Similarly, when the ratio between the played duration and the weighted playback duration is within the range of [1, +∞), that is, when the played duration of the current video is not less than the weighted playback duration of the historical videos played by the account, it can be considered that the account is interested in the content of the current video and the account has a high probability of continuing to play the subsequent content of the current video. Therefore, for the ratio range of [1, +∞), a higher loading priority can be set for each first video segment to be loaded, while a lower loading priority can be set for each second video segment to be loaded compared to the first video segment to be loaded.
[0132] In one possible implementation, step S203 includes: determining a first preset ratio threshold; and assigning loading priorities to the first video segment to be loaded and the second video segment to be loaded in the video to be played, based on the relationship between the ratio between the played duration and the weighted playback duration and the first preset ratio threshold.
[0133] Based on this, by comparing the ratio between the played duration and the weighted playback duration with the first preset ratio threshold, the user's level of interest in the current video content is determined. This is then used to determine the loading priority of the first and second video segments to be loaded. Thus, the loading priority assigned to the first and second video segments to be loaded reflects the probability that the corresponding video segment will be the next video segment played by the user. Subsequently, the terminal network bandwidth is allocated based on the loading priority, prioritizing the allocation of terminal network bandwidth for preloading video segments with a higher probability of being the next video segment played, thereby improving the effective utilization rate of terminal network bandwidth.
[0134] Specifically, refer to Figure 5 The client can be configured with a priority determination module. This module can obtain the current playback duration of the video in real time. Then, it can calculate the ratio between the playback duration and the weighted playback duration, and compare the ratio with a first preset ratio threshold. Based on the comparison result, it can determine the account's level of interest in the current video, and assign loading priorities to the first video segment to be loaded and each second video segment to be loaded, thereby realizing the allocation of loading priorities based on the ratio between the playback duration and the weighted playback duration.
[0135] In another embodiment, since the first preset ratio threshold and the weighted playback duration are relatively fixed, the priority determination module can first calculate the product between the first preset ratio threshold and the weighted playback duration, then obtain the current video's played duration in real time, and determine the relationship between the played duration and the product to determine whether the account is interested in the current video content. It then assigns loading priorities to the first video segment to be loaded and each of the second video segments to be loaded, thereby achieving loading priority allocation based on the ratio between the played duration and the weighted playback duration. This is not limited in this embodiment.
[0136] In one possible implementation, loading priorities are assigned to the first video segment to be loaded and the second video segments to be loaded within the video to be played, based on the relationship between the ratio of the played duration and the weighted playback duration and a first preset ratio threshold. This includes: if the ratio of the played duration to the weighted playback duration is greater than the first preset ratio threshold, the loading priority determined for the first video segment to be loaded is higher than the loading priority determined for each of the second video segments to be loaded, and the loading priority determined for each of the second video segments to be loaded decreases sequentially according to the order of the multiple videos to be played; or, if the ratio of the played duration to the weighted playback duration is less than or equal to the first preset ratio threshold, the loading priority determined for the first video segment to be loaded is lower than the loading priority determined for at least one of the second video segments to be loaded, and the loading priority determined for each of the second video segments to be loaded decreases sequentially according to the order of the multiple videos to be played.
[0137] Based on this, if the ratio between the played duration and the weighted playback duration is greater than the first preset ratio threshold (denoted as time_play_i>beta*time_watch_m, where the current video is the i-th video, time_play_i represents the played duration, time_watch_m represents the weighted playback duration, and beta represents the first preset ratio threshold), it indicates that the played duration of the current video is relatively long, and the account is interested in the content of the current video. Conversely, if the ratio between the played duration and the weighted playback duration is less than or equal to the first preset ratio threshold (denoted as time_play_i<=beta*time_watch_m), it means that the current video is currently playing for a short time on the terminal, the account is less interested in the content of the current video, and there is a higher probability that the account will immediately switch to a video waiting to be played. Therefore, a higher priority is assigned to each of the second video segments waiting to be loaded. In this way, the probability of an account continuing to play subsequent video segments of the current video can be determined based on the already played duration of the current video. This determines the loading priority of each first and second video segment to be loaded, so that the terminal's network bandwidth can be allocated to video segments with higher loading priority in the future, thereby improving the effective utilization of the terminal's bandwidth.
[0138] Specifically, the first preset ratio threshold is a pre-set threshold. Specifically, a parameter can be set as the first preset ratio threshold in the video platform's program configuration file. For example, the parameter `beta` can be set as the first preset ratio threshold in the configuration file, and the value of this parameter can be declared. The first preset ratio threshold can be set according to actual needs; for example, it can be 0.5 or 0.8, but this is not limited in this embodiment.
[0139] As can be understood from the description of step S202 above, the weighted playback duration can be used to determine whether an account is interested in the content of the current video. It's easy to see that the longer the current video has been played, the higher the account's level of interest in the content. Therefore, when the ratio between the played duration and the weighted playback duration is greater than a first preset threshold, it can be considered that the account is interested in the current video content. In this case, the highest loading priority is assigned to the first video segment to be loaded, and then progressively decreasing loading priorities are assigned to each subsequent second video segment to be loaded. Consequently, when allocating terminal network bandwidth based on loading priority, the terminal network bandwidth will be prioritized for the first video segment to be loaded to ensure smooth playback of the current video.
[0140] In another embodiment, if the ratio between the played duration and the weighted playback duration is not greater than a first preset ratio threshold, this indicates that the account is not currently showing any preference for the content of the current video, and the account is highly likely to stop playing the current video and switch to a sequence of multiple videos to be played. Based on this, sequentially decreasing loading priorities are assigned to the sequence of multiple second videos to be loaded, and a loading priority lower than that of at least one second video to be loaded is assigned to the first video to be loaded. Therefore, at least one second video to be loaded has a higher loading priority than the first video to be loaded. Consequently, when allocating terminal network bandwidth based on loading priority, terminal network bandwidth will be preferentially allocated to the second video to be loaded in the first video to be played, ensuring that a significant amount of terminal network bandwidth is used to preload the first video to be played in the next video to be played. When the account switches to play the next video to be played, the preloaded second video to be loaded can be played immediately without waiting.
[0141] In one embodiment, considering that different accounts have different operating habits when playing videos, in one possible implementation, determining the first preset ratio threshold includes: determining the account category based on the weighted playback duration; and determining the first preset ratio threshold according to the account category.
[0142] Based on this, the weighted playback duration is used to determine the total playback duration of each historical video for each account during playback. This helps to assess the account's operational habits during video playback and thus determine the account category. Furthermore, different first preset ratio thresholds are set for different account categories. In this way, the first preset ratio thresholds set for different account categories can better align with the account's operational habits during video playback.
[0143] Specifically, the account categories include at least a first account category and a second account category. The first and second account categories can be pre-defined based on their corresponding weighted playback durations, with the weighted playback duration for the first account category being greater than that for the second account category. Specifically, refer to... Figure 5 The client has an account category identification module. This module can obtain the actual playback duration of each historical video of an account from the account database, and determine the weighted playback duration of the account. Then, it determines the account category corresponding to the account based on the weighted playback duration. For example, the account category identification module can maintain a parameter to indicate the account category. This parameter can be denoted as bool_fast_swipe. When bool_fast_swipe = 0, it means that the account category is the first account category. When bool_fast_swipe = 1, it means that the account category is the second account category. Subsequently, the account category identification module can send the account category to the priority determination module, so that the priority determination module can determine the corresponding first preset ratio threshold based on the account category. In addition, it is easy to understand that since the account category identification module needs to determine the account category based on the weighted playback duration of the account, in a possible embodiment, the above step S202 can be performed by the account category identification module. Afterwards, since the priority determination module also needs to determine the loading priority based on the weighted playback duration of the account, the account category identification module can encapsulate the corresponding account category and weighted playback duration into a message and send it to the priority determination module after determining the account category. This message can be represented as: Pkt_behavior = {time_watch_m, bool_fast_swipe}, where time_watch_m is the weighted playback duration of the account and bool_fast_swipe is a parameter used to characterize the account category.
[0144] Specifically, for accounts in the first account category, the corresponding weighted playback duration is longer. This indicates that accounts in this category are less likely to actively switch to the next video during playback. They tend to play most of a video before starting the next one. For this type of account, when allocating terminal network bandwidth, priority should be given to allocating it to the first video segment to be loaded, ensuring smooth playback without buffering. Since the weighted playback duration for this account category is relatively long, in this embodiment, a smaller first preset ratio threshold needs to be set for accounts in the first account category, making it easier for the ratio between the played duration and the weighted playback duration to exceed the first preset ratio threshold.
[0145] For accounts in the second account category, the corresponding weighted playback duration is shorter. This indicates that these accounts tend to actively switch to the next video more frequently during playback. These accounts are likely to choose whether to switch to the next video after playing only a small portion of the video, such as the first 10 seconds. For this type of account, when allocating terminal network bandwidth, more emphasis should be placed on allocating bandwidth to the second video segment to accommodate their high-frequency video switching habits. Because of the high frequency of video switching, the actual playback duration of a single historical video will be lower, resulting in a relatively shorter weighted playback duration for this type of account. Therefore, a larger first preset ratio threshold should be set for this category of accounts to ensure that the ratio between the played duration and the weighted playback duration does not easily exceed the first preset ratio threshold.
[0146] Specifically, in one possible implementation, determining the account category based on the weighted playback duration includes: if the weighted playback duration is greater than a first preset time threshold, determining the account category as the first account category; or, if the weighted playback duration is less than or equal to the first preset time threshold, determining the account category as the first account category.
[0147] Based on this, by setting a first time threshold and comparing the weighted playback duration corresponding to the account with the first time threshold, the account category is determined. This allows for the subsequent determination of a first preset ratio threshold that better matches the account's operating habits. This enables a more accurate determination of whether the account is interested in the current video based on the first preset ratio threshold, thereby improving the accuracy of allocating loading priorities.
[0148] Step S204: Determine the transmission bandwidth parameters of the first video segment to be loaded and the second video segment to be loaded according to the loading priority;
[0149] The transmission bandwidth parameter is a parameter that controls the transmission bandwidth when transmitting the first video segment to be loaded and the second video segment to be loaded. The transmission bandwidth parameter is sent from the client to the server, so that the server controls the transmission bandwidth when transmitting the first video segment to be loaded and the second video segment to be loaded based on the transmission bandwidth parameter.
[0150] Specifically, refer to Figure 5 The client has a bandwidth allocation module. After determining the loading priorities of the first video segment to be loaded and each of the second video segments to be loaded, the priority determination module can encapsulate the loading priorities of the first video segment to be loaded and each of the second video segments to be loaded into a message according to a certain format and send it to the bandwidth allocation module. For example, the message sent by the priority determination module to the bandwidth allocation module can be represented as:
[0151] video_chunk_priority_set={priority_i_j+1, priority_i+1_1, priority_i+2_1,…}
[0152] Where priority_i_j+1 represents the loading priority of the first video segment to be loaded, video_i_j+1, and priority_i+1_1 represents the loading priority of the second video segment to be loaded in the first video to be played in the (i+1)th video, i.e., the ordered multiple videos to be played. Similarly, priority_i+2_1 is the loading priority of the second video segment to be loaded in the second video to be played, video_i+2_1, and so on. The priority parameter can be indicated by numbers or text, for example, the number 0 represents the highest priority, the number 1 represents the second highest priority, and so on. After receiving the message from the priority determination module, the bandwidth allocation module can allocate the terminal network bandwidth to the first video segment to be loaded and each of the second video segments to be loaded according to the loading priority from high to low. Specifically, a mapping relationship between each loading priority and the bandwidth allocation ratio can be established in advance, or a mapping relationship between each loading priority and the corresponding bandwidth quota can be established in advance. In this way, the terminal network bandwidth can be allocated to the first video segment to be loaded and each of the second video segments to be loaded according to the loading priority and the corresponding mapping relationship, and the transmission bandwidth parameters corresponding to the first video segment to be loaded and each of the second video segments to be loaded can be obtained.
[0153] In one possible implementation, refer to Figure 6 The client also includes a network quality measurement module. Step S204 includes: monitoring the network performance indicators of the terminal and determining the network quality coefficient based on the network performance indicators; in response to a decrease in the network quality coefficient, allocating the transmission bandwidth parameters of each first video segment to be loaded and each second video segment to be loaded according to the loading priority.
[0154] Based on this, by monitoring network performance indicators in real time and determining the network quality coefficient of the terminal, when the network quality coefficient decreases, that is, when the network quality of the terminal deteriorates, the terminal network bandwidth is allocated to the first and second video segments to be loaded according to the loading priority of the video segments. This ensures that when the network quality deteriorates, the terminal network bandwidth can be effectively used to preload video segments with higher loading priority, effectively cope with the impact of network quality changes on video playback, and improve the effective utilization rate of the terminal network bandwidth.
[0155] Network performance metrics are parameters used to reflect the network environment in which a terminal operates. Specifically, network performance metrics may include at least one of the following: terminal network bandwidth, network latency, and network jitter rate. In this embodiment, considering that allocating the terminal's network bandwidth to the first and second video segments to be loaded is actually to improve the effective utilization of the terminal's network bandwidth, to avoid some important video segments being allocated only a small amount of bandwidth and thus failing to be preloaded to the terminal in a timely manner, it is even more necessary to optimize the allocation method of the terminal's network bandwidth when the terminal's network bandwidth decreases. Based on this, in this embodiment, the network performance metrics include at least the terminal's network bandwidth. This allows for optimization of the terminal's network bandwidth allocation method when the terminal's network bandwidth decreases, ensuring that limited terminal network bandwidth can be prioritized for loading video segments with higher loading priority. Of course, in some possible embodiments, network performance metrics may also include other parameters such as network latency and jitter, which can be determined according to the actual situation and are not limited in this embodiment.
[0156] Specifically, in this embodiment, referring to Figure 6 The network performance metrics of the terminal can be monitored at preset intervals using a network quality measurement module. For example, network performance metrics such as terminal network bandwidth and network latency can be acquired every 5 seconds. It is understood that different acquisition methods can be set for different types of network performance metrics. For example, when network performance metrics include terminal network bandwidth, the amount of data sent and received by the terminal per unit time can be periodically counted using the traffic statistics interface provided by the terminal to determine the terminal's network bandwidth; while for network latency, the network latency between the terminal and each video source can be determined periodically using the PING command. The acquisition method for network performance metrics is not limited in this embodiment.
[0157] The network quality coefficient is a score derived from network performance metrics. Specifically, after obtaining each network performance metric, a model is built based on these metrics using a specific algorithm to determine the network quality coefficient. For example, multiple value ranges can be preset for each network performance metric, along with a network quality score corresponding to each range. Then, for each network performance metric, its corresponding value range is determined, yielding its score. Finally, the scores of each network performance metric are weighted and summed to determine the network quality coefficient.
[0158] For example, in this embodiment, the network performance indicator is the terminal network bandwidth, and correspondingly, the network quality coefficient is determined based on the size of the terminal network bandwidth. Specifically, multiple bandwidth ranges can be preset, and a corresponding network quality coefficient can be preset for each bandwidth range. Then, the terminal network bandwidth is periodically monitored, and the bandwidth range in which the monitored terminal network bandwidth is located is determined to determine the network quality coefficient. Based on this, when the terminal network bandwidth fluctuates within the same bandwidth range, the corresponding network quality coefficient will remain unchanged, thus avoiding changes in the network quality coefficient caused by small fluctuations in the terminal network bandwidth. At this point, the network quality coefficient will only decrease when the terminal network bandwidth changes significantly, dropping directly from one bandwidth range to another. In response to this decrease in network quality coefficient, the terminal will allocate transmission bandwidth parameters to the first and second video segments to be loaded according to loading priority. This ensures that when the terminal's network quality deteriorates, the terminal's network bandwidth is preferentially allocated to the first or second video segments with higher loading priority. This allows the terminal's network bandwidth to be used preferentially for preloading the first or second video segments with higher loading priority, improving the effective utilization of bandwidth when network quality deteriorates.
[0159] Reference Figure 6 After determining the network quality coefficient, the network quality measurement sends this coefficient to the bandwidth allocation module. In response to a decrease in the network quality coefficient, the bandwidth allocation module allocates terminal network bandwidth based on loading priority. Thus, when network quality deteriorates and the terminal's network bandwidth decreases, video segments with higher loading priorities receive more network bandwidth resources to ensure timely pre-loading onto the terminal, preventing a decline in the user's video playback experience due to the terminal's deteriorating network quality. For example, if the first video segment to be loaded has the highest loading priority, then during network bandwidth allocation, more of the terminal's available network bandwidth will be allocated to the first video segment to be loaded. This ensures that the current video or videos that may be prioritized for playback based on the user's playback habits can be quickly pre-loaded onto the terminal, avoiding stuttering and other issues that could degrade the video playback experience.
[0160] In one possible implementation, step S204 includes: allocating bandwidth ratio coefficients to the first video segment to be loaded and the second video segment to be loaded according to the loading priority; obtaining the terminal network bandwidth of the terminal running the client, and determining the terminal network bandwidth and the corresponding bandwidth ratio coefficient as the transmission bandwidth parameters of the first video segment to be loaded and the second video segment to be loaded.
[0161] Based on this, bandwidth ratio coefficients are allocated to each first and second video segment to be loaded according to their loading priorities. The bandwidth ratio coefficients allocated to the first and second video segments to be loaded are positively correlated with their corresponding loading priorities. Simultaneously, the terminal's network bandwidth is obtained, and then the terminal network bandwidth and its corresponding bandwidth ratio coefficient are used to determine the transmission bandwidth coefficient of the first or second video segment to be loaded. In this way, based on the transmission bandwidth parameters corresponding to the first and second video segments to be loaded, the bandwidth allocated to the first and second video segments to be loaded can be determined, ensuring that video segments with high loading priorities can be allocated a higher proportion of terminal network bandwidth, thus improving the effective utilization rate of terminal network bandwidth.
[0162] The bandwidth ratio coefficient is a coefficient used to characterize the ratio of the transmission bandwidth allocated to the corresponding first or second video segment to be loaded to the terminal's network bandwidth. It is understood that each bandwidth ratio coefficient is an integer not greater than 1, and the sum of the bandwidth ratio coefficients corresponding to all first and second video segments to be loaded is not greater than 1.
[0163] Specifically, a bandwidth ratio coefficient corresponding to each loading priority can be preset. For example, for multiple preset loading priorities, bandwidth ratio coefficients a_0%, a_1%, a_2%, a_3%, a_4%,... can be set sequentially from high to low, where a_0%, a_1%, a_2%, a_3%, a_4%,... decrease sequentially. Then, for the first video segment to be loaded and each of the second video segments to be loaded, the corresponding bandwidth ratio coefficient can be determined based on their respective loading priorities. For example, the bandwidth ratio coefficient for the first or second video segment to be loaded with the highest loading priority is a_0%, while the bandwidth ratio coefficient for the first or second video segment to be loaded with the second highest loading priority is a_1%, and so on.
[0164] Simultaneously, the terminal network bandwidth of the running client is obtained. For each first or second video segment to be loaded, the terminal network bandwidth and the corresponding bandwidth ratio coefficient can be determined as the corresponding transmission bandwidth parameter. In this way, the bandwidth for the terminal to receive the first and each second video segment to be loaded can be controlled based on the transmission bandwidth parameter, thereby prioritizing the allocation of terminal network bandwidth for preloading video segments with high loading priority.
[0165] In one possible implementation, step S204 further includes: if the terminal network bandwidth is less than a preset bandwidth threshold, obtaining a preset bandwidth list, the preset bandwidth list including multiple ordered preset bandwidth values, the multiple ordered preset bandwidth values decreasing sequentially; and allocating the multiple ordered preset bandwidth values to the first video segment to be loaded and the second video segment to be loaded in descending order of loading priority, until the sum of the allocated preset bandwidth values is greater than or equal to the terminal network bandwidth.
[0166] Therefore, when the terminal's network bandwidth is lower than a preset bandwidth threshold, meaning the terminal can only provide a limited amount of network bandwidth, the terminal's network bandwidth is no longer allocated to the first video segment to be loaded and each of the second video segments to be loaded according to a pre-set ratio. Instead, the terminal's network bandwidth is directly allocated to the first and second video segments to be loaded sequentially according to a preset bandwidth value, until the allocated preset bandwidth value is not less than the terminal's network bandwidth. This ensures that the bandwidth allocated to video segments with higher loading priority is sufficient to preload the corresponding video segments to the terminal in a timely manner. It avoids the situation where the terminal's network bandwidth is too low, resulting in insufficient transmission bandwidth allocated proportionally to the first or second video segments to be loaded or played, thus failing to preload the corresponding video segments to the terminal in a timely manner.
[0167] Specifically, the preset bandwidth threshold is a pre-defined threshold that can be set based on the duration and data volume of a single video segment. For example, if the length of a single video segment is 10 seconds and the corresponding data size is 5MB, then the transmission rate required to preload the next video segment to the terminal in a timely manner during the playback of the previous video segment is at least 5MB / 10 seconds, or 0.5MB / s, and the corresponding bandwidth is 4Mbps. In this case, the preset bandwidth threshold can be determined based on 4Mbps, for example, by setting n times 4Mbps as the preset bandwidth threshold.
[0168] It is understood that, in this embodiment, allocating terminal network bandwidth based on various preset bandwidth values in the preset bandwidth list is to ensure that, when the terminal network bandwidth is limited, the transmission bandwidth allocated to several video segments with higher loading priorities is sufficient to preload the corresponding video segments to be loaded onto the terminal before the previous video segment finishes playing. Based on this, in one embodiment, when it is determined that the bandwidth allocated to a video segment with a specific loading priority is insufficient to preload that video segment within the duration of a video segment, multiple preset bandwidth values from the preset bandwidth list can be used to allocate terminal network bandwidth.
[0169] Based on this, in one possible embodiment, a preset bandwidth threshold can be determined according to the duration and data volume of a single video segment, as well as a bandwidth ratio coefficient. Specifically, the minimum bandwidth required to preload a single video segment to be loaded onto the terminal before the previous video segment finishes playing can be determined based on the duration and data volume of the single video segment. Then, the preset bandwidth threshold is determined based on the quotient between this minimum bandwidth and the minimum value of the bandwidth ratio coefficient corresponding to the video segment that needs to be preloaded onto the terminal. For example, when the terminal network bandwidth is greater than the preset bandwidth threshold, the bandwidth ratio coefficients corresponding to each loading priority are 25%, 20%, 15%, 10%, 3%, 2%, etc., from high to low. In order to ensure the playback experience of the account, the video segment with the highest loading priority and the video segment with the second highest loading priority should be preloaded to the terminal as much as possible before the currently playing video segment is completed. At this time, if the terminal network bandwidth is reduced to 10% of its bandwidth quota, which is insufficient to preload the video segment with the second highest loading priority to the terminal before the previous video segment is completed, the terminal network bandwidth can no longer be allocated according to the bandwidth ratio coefficient, but according to the preset bandwidth values in the preset bandwidth list. At this time, after determining the minimum bandwidth required to preload a single video segment to the terminal before the previous video segment is completed based on the duration and data volume of a single video segment to be loaded, 10 times the minimum bandwidth can be determined as the preset bandwidth threshold.
[0170] Furthermore, the data size corresponding to the same video segment length varies at different bitrates. Therefore, in one possible embodiment, different preset bandwidth thresholds can be set for different video bitrates. In this case, the corresponding preset bandwidth threshold can be obtained based on the current video bitrate.
[0171] In addition, in some possible embodiments, the preset bandwidth threshold can also be set in other ways. For example, the minimum bandwidth required to load a single video to be played onto the terminal within a specified time can be determined based on the data volume of a single video segment and the preset maximum loading wait time (i.e., the maximum time that the account is expected to wait for the video segment to load during video playback). The preset bandwidth threshold can then be determined based on the minimum bandwidth and various bandwidth ratio coefficients. This is not limited in this embodiment.
[0172] The preset bandwidth list is an ordered list of multiple preset bandwidth values, which can be stored in the terminal's database. It is understood that the ordered preset bandwidth values decrease sequentially; for example, the ordered preset bandwidth values can decrease in an arithmetic progression. It should be noted that in the preset bandwidth list, at least several preset bandwidth values are greater than the minimum bandwidth required to load a single video to be played onto the terminal within a specified duration, as determined in the above embodiments.
[0173] Specifically, in this embodiment, the obtained terminal bandwidth is compared with a preset bandwidth threshold. If the terminal network bandwidth is less than the preset bandwidth threshold, a preset bandwidth list is read from the terminal's database. Then, the first video segment to be loaded and each of the second video segments to be loaded are sorted in descending order of loading priority. Based on the sorting result, multiple preset bandwidth values from the preset bandwidth list are sequentially allocated to the first video segment to be loaded and each of the second video segments to be loaded, until the sum of the allocated preset bandwidth values is not less than the terminal network bandwidth. For example, the terminal network bandwidth is 40Mbps. The preset bandwidth values in the preset bandwidth list are 10Mbps, 9Mbps, 8Mbps, 7Mbps, 6Mbps, 5Mbps... After sorting the first and second video segments to be loaded according to their loading priority from high to low, 10Mbps is allocated to the first segment in the sorting result, 9Mbps to the second, and so on. When 6Mbps is allocated to the fifth segment, the total allocated preset bandwidth values are no less than the terminal network bandwidth. At this point, the allocation of preset bandwidth values stops; that is, the terminal network bandwidth is not allocated to the sixth segment and subsequent segments in the sorting result. In this way, even when the terminal network bandwidth is low, it can be ensured that the bandwidth allocated to the first and second video segments with higher loading priority is sufficient to preload them to the terminal within a specified time.
[0174] It should be noted that because the preset bandwidth values in the preset bandwidth list are pre-set, when allocating these preset bandwidth values to the first and subsequent video segments to be loaded, the sum of all allocated preset bandwidth values may exceed the terminal network bandwidth. For example, if the terminal network bandwidth is 38Mbps, and the preset bandwidth values in the preset bandwidth list are 10Mbps, 9Mbps, 8Mbps, 7Mbps, 6Mbps, 5Mbps, etc., then when the sum of the allocated preset bandwidth values is not less than the terminal network bandwidth, the five preset bandwidth values from 10Mbps to 6Mbps have been allocated sequentially to the top five video segments with the highest loading priority in the first and subsequent video segments to be loaded. At this point, the sum of these five allocated preset bandwidth values is 40Mbps, which is greater than the terminal network bandwidth. In this case, a portion of the preset bandwidth value allocated to the video segment with the lowest loading priority can be reduced. For example, if the terminal network bandwidth is 38Mbps, after allocating the five preset bandwidth values sequentially to the first and fifth highest-priority video segments to be loaded (both the first and second video segments to be loaded), the total allocated preset bandwidth values are 40Mbps, which is greater than the terminal network bandwidth. Therefore, the fifth preset bandwidth value is reduced by 2Mbps. This ensures that the final total bandwidth allocated to the first and second video segments to be loaded equals the terminal network bandwidth.
[0175] In one possible implementation, obtaining the terminal network bandwidth of the terminal includes: obtaining the first connection bandwidth between the terminal and each video server; and determining the terminal network bandwidth of the terminal based on the first connection bandwidth.
[0176] Based on this, by monitoring the first connection bandwidth between the terminal and each video server, the terminal network bandwidth can be determined. In this way, the terminal network bandwidth can more accurately reflect the receiving bandwidth that the terminal can use when receiving the first video segment to be loaded and each second video segment to be loaded from multiple video servers.
[0177] Specifically, a video server is a server used to transmit at least one of a first video segment to be loaded or a second video segment to be loaded to the terminal. The first video segment to be loaded and each of the second video segments to be loaded can be stored on different video servers. Multiple video servers can concurrently send the first video segment to be loaded and each of the second video segments to be loaded to the terminal respectively.
[0178] The first connection bandwidth is the maximum bandwidth between the video server and the terminal within a preset period. Specifically, the amount of data received by the terminal from each video server at each time point within the preset period can be counted through the traffic statistics interface provided by the terminal itself. Based on this, the maximum amount of data received by the terminal from each video server per unit time can be determined, thus obtaining the first connection bandwidth between the terminal and each video server within the preset period. Specifically, each first connection bandwidth can be recorded as bw_conn_1, bw_conn_2, bw_conn_3, ... in sequence.
[0179] After obtaining the bandwidth of each first connection, the terminal network bandwidth can be determined based on a preset algorithm. This process can be represented as follows:
[0180] bw_client=func(bw_conn_1,bw_conn_2,…,bw_conn_n)
[0181] Where bw_client is the terminal network bandwidth, bw_conn_n represents the bandwidth of the nth first connection, where n is the number of first connection bandwidths, and func() is a preset function used to determine the terminal network bandwidth based on each first connection bandwidth.
[0182] It is understandable that the method of calculating the terminal network bandwidth based on the first connection bandwidth can be different for different situations. Specifically, in one possible implementation, determining the terminal network bandwidth based on each first connection bandwidth includes at least one of the following: summing the first connection bandwidths to obtain the terminal network bandwidth; or, obtaining the terminal network bandwidth based on the average of each first connection bandwidth; or, sorting the first connection bandwidths based on their size to obtain a bandwidth sorting result, and determining the terminal network bandwidth based on a preset quantile and the bandwidth sorting result.
[0183] Based on this, by summing, averaging, or sorting the first connection bandwidth between the terminal and each video server, and then extracting the first connection bandwidth at a preset quantile based on the sorting result, the terminal network bandwidth can more accurately reflect the bandwidth that the terminal can provide for preloading the first video segment to be loaded and each second video segment to be loaded from each video server.
[0184] Specifically, in one possible embodiment, since each first connection bandwidth is the maximum bandwidth between the terminal and different video servers within a single preset period, and the terminal communicates concurrently with multiple video servers, the multiple first connection bandwidths can be summed, and the summation result can be used as the terminal network bandwidth.
[0185] In another possible embodiment, it is understood that the maximum bandwidth between the terminal and various video servers within the same preset period may be detected at different time points. For example, if the preset period is 10 seconds long, the maximum bandwidth between the terminal and some video servers may be detected at time 2 seconds, while the maximum bandwidth between the terminal and other video servers may be detected at time 5 seconds. In this case, if the bandwidths of multiple first connections are summed, the resulting terminal network bandwidth will exceed the actual maximum bandwidth that the terminal can provide. This will lead to an excessively large sum of bandwidth allocated to the first video segment to be loaded and each of the second video segments to be loaded. This could result in a situation where the bandwidth allocated to video segments with lower loading priority is too large, causing these lower-priority video segments to preempt the terminal's bandwidth. Based on this, in this embodiment, the average value of each first connection bandwidth can also be calculated as the terminal network bandwidth.
[0186] Furthermore, considering that there may be significant anomalies in the various first connection bandwidths, such as values that are significantly larger or smaller than normal, if the terminal network bandwidth is determined by summing or averaging the various first connection bandwidths, these anomalies would cause the terminal network bandwidth to also be significantly larger or smaller, resulting in distortion. Moreover, determining the terminal network bandwidth by summing or averaging lacks flexibility. For example, in some cases, it might be more appropriate to use the median or 75th percentile, which have specific statistical significance, as the terminal network bandwidth. Based on this, in this embodiment, the various first connection bandwidths can also be sorted according to their size, and the terminal network bandwidth can be determined based on the bandwidth sorting result and the preset percentile. Specifically, the various first connection bandwidths can be sorted in descending order, and then, based on the percentage indicated by the preset percentile, the first connection bandwidth at the percentage position indicated by the preset percentile in the bandwidth sorting result can be determined as the terminal network bandwidth. For example, if the number of first connection bandwidths is 5 and the preset quantile is 50%, this means that the median of the bandwidth ranking results is used as the terminal network bandwidth. In this case, the third first connection bandwidth in the bandwidth ranking results can be used as the terminal network bandwidth.
[0187] It should be noted that since the number of first connection bandwidths is not fixed, the percentage indicated by the preset quantile may not correspond exactly to a single first connection bandwidth, but rather lies between two first connection bandwidths. In this case, the terminal network bandwidth can be determined by rounding up, rounding down, or interpolation. For example, when calculating the terminal network bandwidth by interpolation, if the number of first connection bandwidths is 10 and the preset quantile is the 73% quantile, the terminal network bandwidth should be higher than 73% of the values of each first connection bandwidth. That is, the size of the terminal network bandwidth should not be less than the size of the 7.3 first connection bandwidths in the bandwidth ranking result. In this case, the terminal network bandwidth can be calculated using the 7th and 8th first connection bandwidths in the ranking result. Specifically, the 7th first connection bandwidth in the ranking result is denoted as bw_conn_7, and the 8th first connection bandwidth is denoted as bw_conn_7. Then the terminal network bandwidth can be expressed as bw_conn_7 + (7.3 - 7) * (bw_conn_8 - bw_conn_7).
[0188] Therefore, when significant outliers exist among multiple first connection bandwidths, sorting the first connection bandwidths often places these outliers in the largest or smallest positions. Subsequently, determining the terminal network bandwidth from the bandwidth sorting results based on a preset quantile can reduce the interference of these outliers on the terminal network bandwidth. Furthermore, by adjusting the preset quantile, bandwidth values with different statistical significance can be flexibly used as the terminal network bandwidth.
[0189] Specifically, in practical application of the method disclosed herein, one of the above embodiments can be selected as the method for determining the terminal network bandwidth based on the first connection bandwidth, depending on the actual situation. For example, when the length of a single preset period is short, such as only 1 second, the terminal network bandwidth can be determined by summing the first connection bandwidths. When the length of a single preset period is long, and the first connection bandwidths between the terminal and each video server have significantly larger or smaller values, the terminal network bandwidth can be determined by calculating the average of the first connection bandwidths. When the length of a single preset period is long, and there are significantly larger or smaller values among the multiple first connection bandwidths, the first connection bandwidths can be sorted according to the size of the first connection, and the terminal network bandwidth can be determined from the sorting results based on a preset quantile.
[0190] It is understandable that an account does not continuously play videos through the terminal; there may be a considerable interval between two video playback operations. This could mean that the terminal network bandwidth stored in the terminal may have been determined during the account's previous video playback, making the timeliness of the terminal network bandwidth unreliable and potentially failing to accurately reflect the terminal's current actual available bandwidth. Therefore, in one possible implementation, before determining the terminal network bandwidth and its corresponding bandwidth ratio as the transmission bandwidth parameters for the first and second video segments to be loaded, the method further includes: determining the timestamp corresponding to the terminal network bandwidth; obtaining current time information and determining a first time difference between the timestamp and the current time information; if the first time difference is greater than a preset time difference threshold, obtaining the second connection bandwidth between the terminal and each video server, and re-determining the terminal network bandwidth based on each second connection bandwidth.
[0191] Based on this, by obtaining the timestamp when the terminal network bandwidth was determined and calculating the time difference between the time information indicated by the timestamp and the current time information, if the time difference is greater than a preset time difference threshold, it indicates that the terminal network bandwidth was determined a long time ago and may not accurately reflect the terminal's current available bandwidth. Therefore, the current second connection bandwidth of the terminal and each video server is obtained again, and the terminal network bandwidth is re-determined based on the second connection bandwidth. This ensures the timeliness of the terminal network bandwidth, allowing it to accurately reflect the bandwidth that the terminal can currently provide for receiving the first video segment to be loaded and each of the second video segments to be loaded.
[0192] Specifically, each time the terminal network bandwidth is determined, the corresponding time information can be obtained to generate a corresponding timestamp, and the timestamp can be associated and stored locally on the terminal running the client; or, the terminal network bandwidth and the corresponding timestamp can be encapsulated in the same message and sent to the module used to allocate the terminal network bandwidth.
[0193] In another embodiment, the start or end time of the preset period for obtaining each first connection bandwidth can be used as the timestamp corresponding to the terminal network bandwidth. For example, if the start time of the preset period for obtaining each first connection bandwidth used to calculate the terminal network bandwidth is time_start and the end time of the preset period is time_end, then at least one of time_start and time_end can be determined as the timestamp corresponding to the terminal network bandwidth and stored in the database in association with the terminal network bandwidth. Alternatively, the terminal network bandwidth and the corresponding timestamp can be encapsulated in the same message and sent to the module used to allocate the terminal network bandwidth. This message can be represented as: Pkt_bw_response = {time_start, time_end, Bw_client}, where Bw_client is the terminal network bandwidth, and time_start and time_end are as described above.
[0194] Subsequently, when it is necessary to allocate terminal network bandwidth to the first video segment to be loaded and each of the second video segments to be loaded based on loading priority, the corresponding timestamp is first detected and the current time information is obtained. Then, the first time difference between the time information indicated by the timestamp and the current time information is calculated, and the time difference is compared with a first preset time difference threshold. In this embodiment, the first preset time difference threshold can be a preset duration threshold, such as 24 hours. At this time, if the first time difference is greater than the first preset time difference threshold, it indicates that the terminal network bandwidth is determined based on the first connection bandwidth from a long time ago. This terminal network bandwidth cannot accurately reflect the actual available bandwidth of the terminal at present. Therefore, the current second connection bandwidth between the terminal and each video server is re-obtained, and the terminal network bandwidth is re-determined based on the second connection bandwidth. This makes the terminal network bandwidth more accurately reflect the actual available bandwidth of the terminal at present. Specifically, the method of determining the terminal network bandwidth based on the second connection bandwidth can refer to the steps of determining the terminal network bandwidth based on the first connection bandwidth in the above embodiment, which will not be elaborated here.
[0195] Step S205: Obtain the first video segment to be loaded and the second video segment to be loaded based on their respective transmission bandwidth parameters.
[0196] Understandably, referring to Figure 7The terminal can connect to multiple video servers simultaneously and obtain either a first or second video segment to be loaded from each server. Specifically, the terminal and each video server can communicate and transmit the first and second video segments to be loaded via TCP. At this time, at least one connection is established between each video server and the terminal, and each connection is used to send one of the first or second video segments to be loaded from the corresponding video server to the terminal. After determining the transmission bandwidth parameters allocated to the first and second video segments based on loading priority, it is possible to identify which video segment each connection is used to transmit. Based on the transmission bandwidth parameters allocated to the first and second video segments, the bandwidth allocated to the first and second video segments is calculated, and the available receiving bandwidth for each connection is limited accordingly. For example, the terminal preloads the first video segment to be loaded (video_i_j+1), the second video segment to be loaded (video_i+1_1 to video_i+4_1), and the bandwidth corresponding to the first video segment to be loaded (video_i_j+1), the second video segment to be loaded (video_i+1_1 to video_i+4_1), and the second video segment to be loaded (video_i+4_1) is calculated to be bw_1 to bw_5 based on the transmission bandwidth parameter. At this time, the terminal can limit the available receiving bandwidth for the connection with video server 1 to bw_1, the available receiving bandwidth for the connection with video server 2 to bw_2, and so on.
[0197] Understandably, video servers typically encapsulate video segments into multiple data packets before sending them to clients. To prevent connection failures and data loss, video servers and terminals often employ acknowledgment mechanisms to ensure accurate transmission of these data packets. For example, after successfully receiving a data packet from the video server, the terminal needs to send an acknowledgment signal back to the corresponding video server. If the video server receives the acknowledgment signal within a certain time after sending a data packet to the terminal, it can confirm that the data packet has been correctly sent. If the server fails to receive the acknowledgment signal in time, it assumes the data packet is lost and triggers a retransmission. Therefore, limiting the available receiving bandwidth for each connection on the terminal side can easily lead to video servers sending multiple data packets to the terminal at a high rate, while the terminal cannot receive these packets in time. This prevents the terminal from sending an acknowledgment signal promptly, causing the video server to trigger a retransmission and resulting in network congestion. Furthermore, if data packets from the video server are not received by the terminal in time, they will accumulate on the corresponding connection for a longer period, increasing the risk of data loss. Based on this, in another possible embodiment, after determining the transmission bandwidth parameters of the first video segment to be loaded and each of the second video segments to be loaded, the transmission bandwidth parameters can be sent to the video server used to transmit the corresponding first video segment to be loaded or each of the second video segments to be loaded to the terminal, so that the video server, as the sending end, limits the transmission rate of the corresponding first video segment to be loaded or each of the second video segments to be loaded according to the transmission bandwidth parameters, instead of limiting the available bandwidth of each connection used to receive the first video segment to be loaded and each of the second video segments to be loaded on the terminal side.
[0198] Specifically, in one possible implementation, step S205 includes: sending the transmission bandwidth parameters corresponding to the first video segment to be loaded and the second video segment to be loaded to the video servers corresponding to the first video segment to be loaded and the second video segment to be loaded, respectively; and receiving the first video segment to be loaded and the second video segment to be loaded transmitted by the video servers based on the corresponding transmission bandwidth parameters from each video server.
[0199] Based on this, by sending the transmission bandwidth parameters corresponding to the first and second video segments to be loaded to the video servers corresponding to the first and second video segments to be loaded, respectively, the video servers acting as the sending end can limit the sending rate of the corresponding first or second video segments to be loaded to the terminal according to the received transmission bandwidth parameters. In this way, the terminal only needs to receive the first or second video segments to be loaded sent by each video server based on the corresponding transmission bandwidth parameters, so that the terminal's terminal network bandwidth can be prioritized for receiving video segments with higher loading priority, thereby improving the terminal's bandwidth utilization and avoiding network congestion and data packet loss that may be caused by rate limiting.
[0200] Specifically, the video server corresponding to the first video segment to be loaded refers to the server among multiple video servers that sends the first video segment to be loaded to the terminal. Similarly, the video server corresponding to each second video segment to be loaded is the video server that sends the corresponding second video segment to the terminal.
[0201] Understandably, each video server is used to send at least one of a first and a second video segment to be loaded to the terminal running the client. Before transmitting the first or second video segment, a connection usually needs to be established between the terminal and the video server, and then the corresponding video segment is transmitted through the established connection. For example, data transmission between the terminal and the video servers can be performed via the TCP protocol. In the TCP protocol, a three-way handshake is usually performed between the terminal and the video server before data transmission begins. During the handshake, the terminal and the video server exchange information corresponding to the video segments to be transmitted later, in order to establish a connection between the terminal and the video server for transmitting the corresponding video segments. For example, refer to... Figure 8 When a terminal needs to preload a video segment (video_x_y) to be loaded, it first sends a request to video server i to obtain the video segment (video_x_y). Then, video server i returns a response signal to the client, confirming that the video segment (video_x_y) can be sent to the client. Afterward, the terminal sends another response signal to the video server i, confirming the establishment of a connection i with video server i for transmitting the video segment (video_x_y). In this way, during the process of establishing the connection between the terminal and the video server, the terminal can perceive the video segments transmitted through each connection with each video server. Thus, the terminal can perceive the video server corresponding to the first video segment to be loaded and the video servers corresponding to each of the second video segments to be loaded.
[0202] After determining the video servers corresponding to the first video segment to be loaded and each of the second video segments to be loaded, refer to Figure 5 and Figure 6 The bandwidth allocation module in the client can then send each transmission bandwidth parameter to the corresponding video server, so that each video server can be aware of the bandwidth allocated to the first video segment to be played by the terminal. Specifically, the terminal can send corresponding messages to each video server to notify each video server of the bandwidth allocated to the first video segment to be loaded and each of the second video segments to be loaded. In this embodiment, the message format can be as follows:
[0203] Pkt_ctl={video_x_y,bw_client,a_i}
[0204] In this context, Pkt_ctl represents the message sent to the video server, video_x_y is the identifier of the y-th video segment of video x, which can be the identifier of the first video segment to be loaded or a certain second video segment to be loaded; bw_client is the terminal's network bandwidth, and a_i is the bandwidth ratio coefficient allocated to video_x_y. After receiving and parsing this message, the video server can determine that the bandwidth allocated to video segment video_x_y is bw_client*a_i%. Subsequently, the video server controls the transmission rate when sending video_x_y to the terminal based on the bandwidth quota indicated by the message, so that the transmission rate matches the bandwidth quota allocated by the terminal to the corresponding first or second video segment to be loaded. At this point, because the transmission bandwidth parameters for video segments with higher loading priority indicate a larger bandwidth limit, while those for lower loading priority indicate a relatively smaller bandwidth limit, the video server corresponding to the higher-priority video segment will transmit the corresponding video segment to the terminal at a higher transmission rate, while the video server corresponding to the lower-priority video segment will transmit the corresponding video segment to the terminal at a relatively lower transmission rate. Furthermore, the sum of the transmission rates of the first and second video segments to be loaded by all video servers will not exceed the terminal's network bandwidth. Thus, the terminal only needs to receive the first and second video segments to be loaded after the transmission rate is limited by the transmission bandwidth parameters. This allows for accurate allocation of the terminal's network bandwidth to receive video segments with high loading priority and a high probability of needing to be played within a short time, thereby improving the effective utilization of the terminal's network bandwidth.
[0205] For example, refer to Figure 9The terminal needs to preload the first video segment to be loaded (video_i_j+1), the second video segment to be loaded (video_i+1_1 to video_i+4_1) sequentially from video server 1 to video server 5. The transmission bandwidth parameters corresponding to the first video segment to be loaded (video_i_j+1), the second video segment to be loaded (video_i+1_1 to video_i+4_1) can be denoted as [bw_1] to [bw_5], where [bw_n] can include the terminal network bandwidth (bw_client) and the bandwidth ratio coefficient (a_n) allocated to the corresponding first or second video segment to be loaded, where n is an integer from 1 to 5. At this point, the terminal can send the transmission bandwidth parameter [bw_1] to video server 1, which transmits the first video segment to be loaded (video_i_j+1), and the transmission bandwidth parameter [bw_2] to video server 2, which transmits the first video segment to be loaded (video_i+1_1), and so on. This allows video servers 1 through 5 to determine their corresponding bandwidth values based on the received transmission bandwidth parameters and control the transmission rate of the first and second video segments to be loaded to the terminal according to the bandwidth limit determined by the transmission bandwidth parameters. For example, video server 1 sends the first video segment to be loaded (video_i_j+1) to the terminal based on the transmission bandwidth parameter [bw_1], video server 2 sends the second video segment to be loaded (video_i+1_1) to the terminal based on the transmission bandwidth parameter [bw_2], and so on. Afterward, the terminal simply receives the first and second video segments to be loaded sent by each video server based on the transmission bandwidth parameters.
[0206] It should be noted that, in the above embodiments, the transmission bandwidth parameters sent to each video server can be other parameters used to calculate the bandwidth allocated to the corresponding first or second video segment to be loaded. For example, the transmission bandwidth parameters may include the terminal's network bandwidth bw_client and the bandwidth ratio coefficient a_i allocated to the corresponding first or second video segment to be loaded. In another possible embodiment, the specific bandwidth value can also be calculated directly on the terminal and sent directly as the transmission bandwidth parameters to each video server.
[0207] In one possible implementation, the transmission bandwidth parameters include the terminal network bandwidth and bandwidth ratio coefficient of the terminal running the client. The video server transmits the first and second video segments to be loaded through the following steps: determining the transmission bandwidth based on the product of the terminal network bandwidth and the bandwidth ratio coefficient; obtaining the initial transmission rate corresponding to the video server transmitting the first and second video segments to be loaded to the terminal; selecting one of the initial transmission rate and the transmission bandwidth as the target transmission rate; transmitting the corresponding first and second video segments to be loaded to the terminal based on the target transmission rate, and during the transmission of the first and second video segments to be loaded to the terminal, in response to the update of the initial transmission rate, updating the target transmission rate based on the updated initial transmission rate, and transmitting the first and second video segments to be loaded to the terminal based on the updated target transmission rate.
[0208] Based on this, after receiving the transmission bandwidth parameters, the video server first determines the corresponding transmission bandwidth based on these parameters. Simultaneously, it obtains the initial transmission rate originally used by the video server to send the corresponding first or second video segment to be loaded to the terminal. The minimum of the initial transmission rate and the transmission bandwidth is then determined as the target transmission rate; alternatively, the maximum of the initial transmission rate and the transmission bandwidth can also be used. This ensures that the transmission rate by which the video server sends the corresponding first or second video segment to the terminal does not exceed the bandwidth allocated to that segment by the terminal.
[0209] Specifically, the initial transmission rate is the rate at which the video server sends the corresponding first or second video segment to be loaded, without considering the transmission bandwidth parameters sent by the terminal. Specifically, this initial transmission rate can be determined by the video server itself based on the communication protocol between it and the terminal and the real-time network environment. For example, when the video server and the terminal communicate using the TCP protocol, the transmission rate will be adjusted according to the real-time network environment to avoid sending too many data packets in a short period, which could lead to network congestion. The method for determining the initial transmission rate can refer to the transmission rate adjustment methods of various communication protocols in related technologies, and is not limited in this embodiment. It is understood that the initial transmission rate indicates the maximum rate at which the video server can stably send the first or second video segment to be loaded to the terminal under the influence of factors such as the current network conditions and load of the video server. If the video server sends the first or second video segment to the terminal at a rate higher than the initial transmission rate, packet loss or network congestion may occur.
[0210] It's understandable that terminal network bandwidth represents the data transmission rate that the terminal device can currently support, while the bandwidth ratio factor is a pre-set ratio value based on the video transmission strategy and overall resource allocation. Multiplying these two values allows for the accurate calculation of the transmission bandwidth allocated to a specific video segment. For example, if the terminal network bandwidth is 10Mbps and the bandwidth ratio factor is 0.3, the calculated transmission bandwidth is 3Mbps, meaning that the theoretically maximum usable transmission rate for this video segment during transmission is 3Mbps. This transmission bandwidth indicates the maximum rate at which the video server sends the first or second video segment to be loaded to the terminal.
[0211] After determining the initial transmission rate and bandwidth, the minimum of the initial transmission rate and bandwidth is set as the target transmission rate. For example, if the initial transmission rate is 4 Mbps and the calculated transmission bandwidth is 3 Mbps, then 3 Mbps is set as the target transmission rate. This ensures that the rate at which the first or second video segment to be loaded is sent to the terminal does not exceed the corresponding transmission bandwidth, and also avoids packet loss or network congestion caused by factors such as the current network conditions and load of the video server.
[0212] Specifically, the above process can be represented as:
[0213] Pacing_rate_final=func1{pacing_cpt, bw_client*a_i%};
[0214] Where Pacing_rate_final is the target sending rate, pacing_cpt is the initial sending rate, bw_client and a_i% are the terminal network bandwidth and bandwidth ratio coefficient, respectively, and func1{} represents the function that takes the minimum value.
[0215] It should be noted that in one possible embodiment, an error in the communication protocol between the terminal and the video server may cause the initial transmission rate determined by the communication protocol to remain at a low rate. In this case, even if the terminal allocates more bandwidth to the first or second video segment to be loaded with a higher loading priority, the corresponding video server may still send the corresponding first or second video segment to be loaded to the terminal at a low rate. Consequently, the terminal cannot preload these higher-priority video segments from the corresponding video server in a timely manner. Therefore, in one possible embodiment, `func1{}` is configurable. By default, it operates as a function that takes the minimum value. However, the video server's administrator account can actively set `func1{}` to take the maximum value to avoid the video server failing to send the higher-priority video segments to the terminal in a timely manner due to communication protocol issues between the terminal and the video server.
[0216] After determining the target transmission rate, the video server can send the first or second video segment to be loaded to the terminal according to the target transmission rate.
[0217] Furthermore, as described above, the initial transmission rate of the video server is updated in real time based on factors such as network conditions and load. Therefore, during the transmission of the first and second video segments to be loaded to the terminal, if the initial transmission rate changes, the video server will update the target transmission rate based on the updated initial transmission rate and transmission bandwidth. For example, when the network conditions of the video server improve, the initial transmission rate will increase. In this case, the video server can redetermine the target transmission rate based on the transmission bandwidth and the increased initial transmission rate, and transmit the video segments to the terminal based on the updated target transmission rate. This dynamic adjustment of the target transmission rate better adapts to changes in the network environment while ensuring that the maximum target transmission rate does not exceed the transmission bandwidth allocated to the corresponding first or second video segment to be loaded, thus guaranteeing the stability and efficiency of the transmission process.
[0218] In another possible implementation, transmitting the corresponding first and second video segments to be loaded to the terminal based on the target transmission rate includes: obtaining the initial congestion window size corresponding to the video server; determining the congestion adjustment ratio based on the ratio of the target transmission rate to the initial transmission rate, and adjusting the initial congestion window size based on the congestion adjustment ratio to obtain the target congestion window size; and transmitting the corresponding first and second video segments to be loaded to the terminal based on the target congestion window size and the target transmission rate.
[0219] Based on this, by adjusting the size of the congestion window according to the ratio between the target transmission rate and the initial transmission rate, the size of the congestion window can be matched with the target transmission rate, thus avoiding network congestion caused by a mismatch between the target transmission rate adjusted according to the transmission bandwidth and the size of the congestion window.
[0220] Specifically, the initial congestion window size is the congestion window size corresponding to the initial transmission rate. It represents the number of data packets that the video server can send before receiving an acknowledgment signal from the terminal when sending the first or second video segment to be loaded to the terminal at the initial transmission rate. In other words, it represents the maximum amount of data that can be sent without receiving an acknowledgment signal from the terminal. In this embodiment, the video server and the terminal communicate using the TCP protocol. In the TCP protocol, if the congestion window size does not decrease as the actual transmission rate decreases, a large congestion window coupled with a low actual transmission rate may cause a large number of data packets to fail to be sent to the receiving end in time, accumulating in the video server's transmission buffer and the link between the video server and the terminal, thus leading to network congestion. Therefore, in this embodiment, the size of the congestion window needs to be adjusted based on the ratio between the target transmission rate and the initial transmission rate.
[0221] Specifically, since the target transmission rate is obtained by taking the minimum value between the transmission bandwidth calculated by the video server based on the transmission bandwidth parameter and the initial transmission rate, when the initial transmission rate is less than the transmission bandwidth (i.e., the target transmission rate is the same as the initial transmission rate), the initial congestion window size corresponds to the initial transmission rate, so there is no need to adjust the congestion window size. However, when the target transmission rate is the transmission bandwidth, it indicates that the transmission bandwidth is less than the initial transmission rate, meaning the target transmission rate is less than the initial transmission rate. In this case, the congestion window size needs to be reduced to match the target transmission rate. Based on this, in this embodiment, the congestion window adjustment ratio is determined according to the ratio between the target transmission rate and the initial transmission rate, and the initial congestion window size is adjusted accordingly to obtain the target congestion window size. In this way, the adjustment range of the target congestion window size matches the ratio between the target transmission rate and the initial transmission rate, meaning the target congestion window size matches the target transmission rate. This avoids network congestion caused by a mismatch between the congestion window size and the transmission rate.
[0222] Specifically, the above process can be represented as:
[0223] cwnd_final=cwnd_cpt*pacing_rate_final / pacing_cpt
[0224] Where cwnd_final is the target congestion window size, cwnd_cpt is the initial congestion window size, pacing_rate_final is the target transmission rate, and pacing_cpt is the initial transmission rate.
[0225] After determining the target congestion window size, the video server can send the first or second video segment to be loaded to the terminal based on the target congestion window size and the target transmission rate. This process can be referred to in the relevant technology for the communication process based on the TCP protocol, and will not be elaborated here.
[0226] For example, the video transmission method provided in this disclosure can be applied to short videos. Specifically, when an account plays a short video on a self-media platform, the playback duration of the video currently being played by the account can be detected, and the corresponding weighted playback duration can be determined based on the account's historical video records. Based on the ratio between the playback duration and the weighted playback duration, it can be determined whether to prioritize allocating the account's terminal bandwidth to preload subsequent video segments of the video currently being played by the account, or to prioritize preload the first video segment of other videos pushed to the account, thereby improving the effective utilization rate of the account's terminal bandwidth.
[0227] For example, the video transmission method provided in this disclosure can be applied to online education scenarios. Specifically, when an account plays course videos on an online education platform, the playback duration of the currently played course video can be detected, and the corresponding weighted playback duration can be determined based on the account's historical video records. Based on the ratio between the playback duration and the weighted playback duration, it can be determined whether to prioritize allocating the account's terminal bandwidth to preloading subsequent video segments of the currently played course video, or to prioritize preloading the first video segment of the subsequent course video, thereby improving the effective utilization rate of the account's terminal bandwidth.
[0228] Reference Figure 10 , Figure 10 This is an overall flowchart of the video transmission method provided in the embodiments of this disclosure.
[0229] First, in this embodiment, the client determines multiple video segments to be loaded from multiple video servers respectively; for example, it determines the subsequent video segments of the client's current video and the first video segment of the subsequent video. Only then, a corresponding identifier is assigned to each video segment to be loaded, and a set is constructed based on the identifier of each video segment to be loaded.
[0230] Next, the network quality measurement module in the client periodically measures the network quality coefficient of the client. For example, it periodically measures the connection bandwidth between the client and each video server, and determines the client's terminal network bandwidth based on this, and then determines the network quality coefficient based on the size of the terminal network bandwidth.
[0231] Next, the client's account category identification module identifies the account's operating habits and sends these habits to the priority determination module. For example, it identifies the account's operating habits during video playback based on the actual playback duration of the account's historical videos. Specifically, it can recursively calculate the weighted sum of the actual playback durations of multiple historical videos to determine the account's weighted playback duration for multiple historical videos. Based on the length of the weighted playback duration, it determines the frequency with which the account actively switches between playing videos to determine the account's operating habits.
[0232] Next, the client's priority determination module assigns loading priorities to subsequent video segments within the current video and the first video segment of the subsequent video based on the account's operational habits. For example, it determines the account category based on the account's operational habits, and determines a duration threshold for judging whether the account is interested in the content of the currently playing video based on the weighted playback duration of the account category and the account's historical videos. At the same time, it obtains the already played duration of the currently playing video, and determines whether the account is interested in the content of the current video based on the relationship between the already played duration and the duration threshold, and assigns loading priorities to subsequent video segments of the current video and the first video segment of the subsequent video accordingly. For example, when the account is interested in the content of the current video, the subsequent video segments of the current video are assigned a higher loading priority than the first video segment of the subsequent video; conversely, the first video segment of the subsequent video is assigned a higher loading priority than the subsequent video segments of the current video.
[0233] Next, the client's bandwidth allocation module obtains the network quality coefficient and the loading priority of each video segment to be loaded from the network quality measurement module, and determines whether it is necessary to reallocate bandwidth to the subsequent video segments in the current video and the first video segment of the subsequent video based on the loading priority. For example, when the network quality coefficient decreases, bandwidth is reallocated to the subsequent video segments in the current video and the first video segment of the subsequent video based on the loading priority.
[0234] Next, the bandwidth allocation module allocates transmission bandwidth to each video segment to be loaded according to the loading priority, and determines the transmission bandwidth parameters corresponding to each video segment to be loaded; for example, it determines the bandwidth ratio coefficients corresponding to the subsequent video segments in the current video and the first video segment of the subsequent video according to the loading priority, and uses the client's terminal network bandwidth and the corresponding bandwidth ratio coefficients as the corresponding transmission bandwidth parameters.
[0235] Next, the bandwidth allocation module sends the transmission bandwidth parameters to each video server; for example, it encapsulates the transmission bandwidth parameters into a message and sends it to the video server corresponding to each video segment to be loaded.
[0236] Next, in response to the transmission bandwidth parameters received from the client, the video server adjusts the sending rate when sending the corresponding video segment to be loaded to the client, and sends the corresponding video segment to be loaded to the client based on the sending rate; for example, the video server determines the target sending rate when actually sending the video segment to be loaded to the client based on the minimum value between the initial sending rate of sending the corresponding video segment to be loaded and the sending rate indicated by the transmission bandwidth parameters.
[0237] Next, the client receives the video segments to be loaded from the video server based on the transmission bandwidth parameters, and checks whether all video segments have been loaded locally. If so, it stops transmitting bandwidth to the video segments and clears the loading priority and transmission bandwidth parameters corresponding to each video segment. If not, it continues to periodically measure the client's network quality coefficient, and re-determines the loading priorities of subsequent video segments and the first video segment of the subsequent video based on the current video's played duration, and allocates transmission bandwidth to these segments based on the loading priorities. This process continues until all video segments are preloaded locally on the client.
[0238] Reference Figure 11 , Figure 11 This is a schematic diagram of the structure of a video transmission device provided in an embodiment of the present disclosure. The video transmission device 1100 includes:
[0239] The first duration acquisition module 1101 is used to acquire the playback duration of the current video in the playback progress of the client. The current video is the video currently being played on the client by the logged-in client account. The current video includes a first video segment to be loaded. The client is also used to play at least one video to be played after the current video. The video to be played includes a second video segment to be loaded. The second video segment to be loaded is the first video segment in the video to be played.
[0240] The second duration acquisition module 1102 is used to acquire the actual playback duration of historical videos and to obtain the weighted playback duration of historical videos by weighting the actual playback duration. The historical videos are the videos that the account has played in the past.
[0241] Priority determination module 1103; used to determine the loading priority for the first video segment to be loaded and the second video segment to be loaded respectively based on the proportion of the played duration in the weighted playback duration;
[0242] The bandwidth allocation module 1104 is used to determine the transmission bandwidth parameters of the first video segment to be loaded and the second video segment to be loaded according to the loading priority.
[0243] The video acquisition module 1105 is used to acquire the first video segment to be loaded and the second video segment to be loaded based on their respective transmission bandwidth parameters.
[0244] Optionally, the priority determination module 1103 is specifically used for:
[0245] Determine the first preset ratio threshold;
[0246] Based on the relationship between the proportion of the played duration in the weighted playback duration and the first preset proportion threshold, the loading priorities are determined for the first and second video segments to be loaded.
[0247] Optionally, at least one video to be played includes multiple videos to be played in an ordered manner, and the priority determination module 1103 is specifically used for:
[0248] If the proportion of the played time in the weighted playback time is greater than the first preset proportion threshold, the loading priority determined for the first video segment to be loaded is higher than the loading priority determined for each of the second video segments to be loaded, and the loading priority determined for each of the second video segments to be loaded decreases sequentially according to the order of the multiple videos to be played.
[0249] Alternatively, if the proportion of the played duration in the weighted playback duration is less than or equal to the first preset proportion threshold, the loading priority determined for the first video segment to be loaded is lower than the loading priority determined for at least one second video segment to be loaded, and the loading priority determined for each second video segment to be loaded decreases sequentially according to the order of the multiple videos to be played.
[0250] Optionally, the priority determination module 1103 is specifically used for:
[0251] The account category is determined based on the weighted playback duration, wherein the account category includes at least a first account category and a second account category, and the weighted playback duration corresponding to the first account category is greater than the weighted playback duration corresponding to the second account category;
[0252] A first preset ratio threshold is determined based on the account category, wherein the first preset ratio threshold corresponding to the first account category is less than the first preset ratio threshold corresponding to the second account category.
[0253] Optionally, the priority determination module 1103 is specifically used for:
[0254] If the weighted playback duration exceeds the first preset time threshold, the account's account category will be determined as the first account category;
[0255] Alternatively, if the weighted playback duration is less than or equal to the first preset time threshold, the account's account category is determined as the first account category.
[0256] Optionally, the number of historical videos can be multiple, and the second duration acquisition module 1102 is specifically used for:
[0257] The weighted sum of the actual playback durations of multiple historical videos is obtained by weighting and summing them.
[0258] Optionally, the second duration acquisition module 1102 is specifically used for:
[0259] Obtain the first preset weight coefficient and the second preset weight coefficient, wherein both the first preset weight coefficient and the second preset weight coefficient are positive numbers not greater than 1;
[0260] The first historical video in a sequence of multiple historical videos is determined as the first historical video of the current round, and the actual playback duration of the first historical video is determined as the reference playback duration.
[0261] The next historical video after the first historical video is determined as the second historical video of the current round;
[0262] The reference playback duration and the playback duration of the second historical video are weighted and summed based on the first preset weight coefficient and the second preset weight coefficient, and the reference playback duration is updated based on the result of the weighted summation.
[0263] The second historical video of the current round is determined as the first historical video of the next round, and the reference playback duration is updated again until the second historical video is the last historical video in an ordered sequence of historical videos, thus obtaining the weighted playback duration of multiple historical videos.
[0264] Optionally, the bandwidth allocation module 1104 is specifically used for:
[0265] Monitor the network performance metrics of the terminal running the client, and determine the network quality coefficient based on the network performance metrics;
[0266] In response to a decrease in network quality coefficient, the transmission bandwidth parameters of the first and second video segments to be loaded are determined according to loading priority.
[0267] Optionally, the bandwidth allocation module 1104 is specifically used for:
[0268] The bandwidth ratio coefficients of the first and second video segments to be loaded are determined based on the loading priority, where the bandwidth ratio coefficients are positively correlated with the loading priority.
[0269] Obtain the terminal network bandwidth of the terminal running the client, and determine the terminal network bandwidth and the corresponding bandwidth ratio as the transmission bandwidth parameters of the first and second video segments to be loaded.
[0270] Optionally, the bandwidth allocation module 1104 is specifically used for:
[0271] If the terminal network bandwidth is less than the preset bandwidth threshold, obtain the preset bandwidth list. The preset bandwidth list includes multiple ordered preset bandwidth values, which decrease sequentially.
[0272] Multiple preset bandwidth values are sequentially allocated to the first and second video segments to be loaded according to their loading priority from high to low, until the sum of the allocated preset bandwidth values is greater than or equal to the terminal network bandwidth.
[0273] Optionally, the bandwidth allocation module 1104 is specifically used for:
[0274] The first connection bandwidth between the terminal and each video server is obtained. The video server is used to transmit at least one of the first video segment to be loaded or the second video segment to be loaded to the terminal. The first connection bandwidth is the maximum bandwidth between the corresponding video server and the terminal within a preset period.
[0275] The terminal network bandwidth of the terminal is determined based on the bandwidth of each first connection.
[0276] Optionally, the bandwidth allocation module 1104 is specifically used for:
[0277] The terminal network bandwidth is obtained by summing the bandwidths of each connection.
[0278] Alternatively, the terminal network bandwidth can be obtained based on the average bandwidth of each connection.
[0279] Alternatively, the bandwidth of each connection can be sorted based on its size to obtain a bandwidth sorting result, and the terminal network bandwidth can be determined based on a preset quantile and the bandwidth sorting result.
[0280] Optionally, the bandwidth allocation module 1104 is specifically used for:
[0281] Determine the timestamp corresponding to the terminal network bandwidth. The timestamp is used to characterize the time information when determining the terminal network bandwidth based on each connection bandwidth.
[0282] Obtain the current time information and determine the first time difference between the timestamp and the current time information;
[0283] If the first time difference is greater than the preset time difference threshold, obtain the second connection bandwidth between the terminal and each video server, and redetermine the terminal network bandwidth based on each second connection bandwidth.
[0284] Optionally, the video acquisition module 1105 is specifically used for:
[0285] The transmission bandwidth parameters corresponding to the first video segment to be loaded and the second video segment to be loaded are sent to the video servers corresponding to the first video segment to be loaded and the second video segment to be loaded, respectively.
[0286] Receive the first and second video segments to be loaded from each video server based on the corresponding transmission bandwidth parameters.
[0287] Optionally, the transmission bandwidth parameters include the terminal network bandwidth and bandwidth ratio of the terminal running the client, and the video server is specifically used for:
[0288] The transmission bandwidth is determined by multiplying the terminal network bandwidth by the bandwidth ratio factor.
[0289] Obtain the initial transmission rate corresponding to when the video server transmits the first and second video segments to be loaded to the terminal;
[0290] Choose one of the initial transmission rate and the transmission bandwidth as the target transmission rate;
[0291] Based on the target transmission rate, the first and second video segments to be loaded are transmitted to the terminal. During the transmission of the first and second video segments to be loaded to the terminal, in response to the initial transmission rate update, the target transmission rate is updated based on the updated initial transmission rate and the transmission bandwidth is updated. Based on the updated target transmission rate, the first and second video segments to be loaded are transmitted to the terminal.
[0292] Optionally, the video server is specifically used for:
[0293] Obtain the initial congestion window size corresponding to the video server. The initial congestion window size is used to characterize the maximum amount of data that the video server can send when it does not receive a response signal from the terminal.
[0294] The congestion adjustment ratio is determined based on the ratio of the target transmission rate to the initial transmission rate, and the initial congestion window size is adjusted based on the congestion adjustment ratio to obtain the target congestion window size.
[0295] Based on the target congestion window size and the target transmission rate, the corresponding first and second video segments to be loaded are transmitted to the terminal.
[0296] The electronic device provided in this disclosure for performing the above-described video transmission method can be a terminal, as shown in the following embodiments. Figure 12 , Figure 12 This is a partial structural block diagram of a terminal provided in an embodiment of the present disclosure. The terminal includes: a camera assembly 1210, a first memory 1220, an input unit 1230, a display unit 1240, a sensor 1250, an audio circuit 1260, a wireless fidelity (WiFi) module 1270, a first processor 1280, and a first power supply 1290, among other components. Those skilled in the art will understand that... Figure 12 The terminal structure shown does not constitute a limitation on the terminal and may include more or fewer components than shown, or combine certain components, or have different component arrangements.
[0297] The camera assembly 1210 can be used to capture images or videos. Optionally, the camera assembly 1210 includes a front-facing camera and a rear-facing camera. Typically, the front-facing camera is located on the front panel of the terminal, and the rear-facing camera is located on the back of the terminal. In some embodiments, there are at least two rear-facing cameras, which are any one of a main camera, a depth-sensing camera, a wide-angle camera, and a telephoto camera, to achieve background blurring by fusion of the main camera and the depth-sensing camera, panoramic shooting by fusion of the main camera and the wide-angle camera, VR (Virtual Reality) shooting, or other fusion shooting functions.
[0298] The first memory 1220 can be used to store software programs and modules. The first processor 1280 executes various functional applications and data processing of the terminal by running the software programs and modules stored in the first memory 1220.
[0299] The input unit 1230 can be used to receive input numeric or character information, and to generate key signal inputs related to the terminal's settings and function control. Specifically, the input unit 1230 may include a touch panel 1231 and other input devices 1232.
[0300] The display unit 1240 can be used to display input or provided information, as well as various menus of the terminal. The display unit 1240 may include a display panel 1241.
[0301] Audio circuitry 1260, speaker 1261, and microphone 1262 provide an audio interface.
[0302] The first power source 1290 can be AC power, DC power, a disposable battery, or a rechargeable battery.
[0303] The number of sensors 1250 can be one or more, and these sensors 1250 include, but are not limited to: accelerometers, gyroscopes, pressure sensors, optical sensors, etc.
[0304] An accelerometer can detect the magnitude of acceleration along the three coordinate axes of a coordinate system established by the terminal. For example, an accelerometer can be used to detect the components of gravitational acceleration along the three coordinate axes. The first processor 1280 can control the display unit 1240 to display the user interface in either a horizontal or vertical view based on the gravitational acceleration signal acquired by the accelerometer. The accelerometer can also be used for collecting motion data from games or other applications.
[0305] The gyroscope sensor can detect the terminal's orientation and rotation angle. It can work in conjunction with an accelerometer to collect 3D user movements on the terminal. Based on the data collected by the gyroscope sensor, the first processor 1280 can perform the following functions: motion sensing (e.g., changing the UI based on the user's tilt), image stabilization during shooting, game control, and inertial navigation.
[0306] The pressure sensor can be installed on the side bezel of the terminal and / or on the lower layer of the display unit 1240. When the pressure sensor is installed on the side bezel of the terminal, it can detect the user's grip signal on the terminal, and the first processor 1280 can perform left / right hand recognition or quick operation based on the grip signal collected by the pressure sensor. When the pressure sensor is installed on the lower layer of the display unit 1240, the first processor 1280 can control the operable controls on the UI interface based on the user's pressure operation on the display unit 1240. The operable controls include at least one of button controls, scroll bar controls, icon controls, and menu controls.
[0307] An optical sensor is used to collect ambient light intensity. In one embodiment, the first processor 1280 can control the display brightness of the display unit 1240 based on the ambient light intensity collected by the optical sensor. Specifically, when the ambient light intensity is high, the display brightness of the display unit 1240 is increased; when the ambient light intensity is low, the display brightness of the display unit 1240 is decreased. In another embodiment, the first processor 1280 can also dynamically adjust the shooting parameters of the camera assembly 1210 based on the ambient light intensity collected by the optical sensor.
[0308] In this embodiment, the first processor 1280 included in the terminal can execute the video transmission method of the previous embodiment.
[0309] The electronic device provided in this disclosure for performing the above-described video transmission method can also be a server, see below. Figure 13 , Figure 13This is a partial structural block diagram of a server provided in an embodiment of the present disclosure. The server can vary significantly due to different configurations or performance. It may include one or more second processors 1310 and second memories 1330, and one or more storage media 1340 (e.g., one or more mass storage devices) for storing application programs 1343 or data 1342. The second memories 1330 and storage media 1340 may be temporary or persistent storage. The program stored in the storage media 1340 may include one or more modules (not shown in the diagram), each module including a series of instruction operations on the server. Furthermore, the second processor 1310 may be configured to communicate with the storage media 1340 and execute the series of instruction operations stored in the storage media 1340 on the server.
[0310] The server may also include one or more secondary power supplies 1320, one or more wired or wireless network interfaces 1350, one or more input / output interfaces 1360, and / or one or more operating systems 1341, such as Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™, etc.
[0311] The second processor 1310 in the server can be used to execute video transmission methods.
[0312] This disclosure also provides a computer-readable storage medium for storing a computer program for executing the video transmission methods of the foregoing embodiments.
[0313] This disclosure also provides a computer program product comprising a computer program stored in a computer-readable storage medium. A processor of a computer device reads the computer program from the computer-readable storage medium and executes the computer program, causing the computer device to perform the video transmission method described above.
[0314] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in this disclosure and the foregoing drawings 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 to describe embodiments of this disclosure, for example, those that can be implemented in orders other than those illustrated or described herein. Furthermore, the terms “comprising” and “having,” and any variations thereof, are intended to cover 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 apparatuses.
[0315] It should be understood that in this disclosure, "at least one item" means one or more, and "more than one" means two or more. "And / or" is used to describe the relationship between related objects, indicating that three relationships can exist. For example, "A and / or B" can represent three cases: only A exists, only B exists, and both A and B exist simultaneously, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c can represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, and c can be single or multiple.
[0316] It should be understood that in the description of the embodiments disclosed herein, "multiple" means two or more, "greater than", "less than", "exceeding" etc. are understood to exclude the number itself, and "above", "below", "within" etc. are understood to include the number itself.
[0317] In the several embodiments provided in this disclosure, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces, indirect coupling or communication connection between apparatuses or units, and may be electrical, mechanical, or other forms.
[0318] The units described as separate components may or may not be physically separate. 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 units can be selected to achieve the purpose of this embodiment according to actual needs.
[0319] Furthermore, the functional units in the various embodiments of this disclosure can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0320] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this disclosure, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this disclosure. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0321] It should also be understood that the various implementation methods provided in this disclosure can be combined arbitrarily to achieve different technical effects.
[0322] The above is a detailed description of the preferred embodiments of this disclosure. However, this disclosure is not limited to the above embodiments. Those skilled in the art can make various equivalent modifications or substitutions without departing from the spirit of this disclosure. All such equivalent modifications or substitutions are included within the scope defined by the claims of this disclosure.
Claims
1. A video transmission method, characterized in that, The method includes: The client obtains the playback duration of the current video in terms of playback progress, wherein the current video is the video currently being played on the client by the account logged into the client, the current video includes a first video segment to be loaded, and the client is also used to play at least one video to be played after the current video, the video to be played includes a second video segment to be loaded, the second video segment to be loaded is the first video segment in the video to be played; Obtain the actual playback duration of historical videos, and calculate the weighted playback duration of the historical videos by weighting the actual playback duration. The historical videos are the videos that the account has played in the past. Based on the proportion of the already played duration in the weighted playback duration, loading priorities are determined for the first video segment to be loaded and the second video segment to be loaded, respectively. The transmission bandwidth parameters of the first video segment to be loaded and the second video segment to be loaded are determined according to the loading priority. The first video segment to be loaded and the second video segment to be loaded are obtained based on their respective transmission bandwidth parameters.
2. The video transmission method according to claim 1, characterized in that, The step of determining loading priorities for the first and second video segments to be loaded based on the proportion of the already played duration in the weighted playback duration includes: Determine the first preset ratio threshold; Based on the relationship between the proportion of the played duration in the weighted playback duration and the first preset proportion threshold, loading priorities are determined for the first video segment to be loaded and the second video segment to be loaded, respectively.
3. The video transmission method according to claim 2, characterized in that, The at least one video to be played includes a plurality of ordered videos to be played. The method of determining loading priorities for the first video segment to be loaded and the second video segment to be loaded, based on the relationship between the proportion of the played duration in the weighted playback duration and the first preset proportion threshold, includes: If the proportion of the played duration in the weighted playback duration is greater than the first preset proportion threshold, the loading priority determined for the first video segment to be loaded is higher than the loading priority determined for each of the second video segments to be loaded, and the loading priority determined for each of the second video segments to be loaded decreases sequentially according to the order of the multiple videos to be played. Alternatively, if the proportion of the played duration in the weighted playback duration is less than or equal to the first preset proportion threshold, the loading priority determined for the first video segment to be loaded is lower than the loading priority determined for at least one second video segment to be loaded, and the loading priority determined for each second video segment to be loaded decreases sequentially according to the order of the multiple videos to be played.
4. The video transmission method according to claim 2, characterized in that, Determining the first preset ratio threshold includes: The account category of the account is determined based on the weighted playback duration, wherein the account category includes at least a first account category and a second account category, and the weighted playback duration corresponding to the first account category is greater than the weighted playback duration corresponding to the second account category; A first preset ratio threshold is determined based on the account category, wherein the first preset ratio threshold corresponding to the first account category is less than the first preset ratio threshold corresponding to the second account category.
5. The video transmission method according to claim 4, characterized in that, The process of determining the account category based on the weighted playback duration includes: If the weighted playback duration is greater than the first preset time threshold, the account category of the account is determined to be the first account category; Alternatively, if the weighted playback duration is less than or equal to the first preset time threshold, the account category of the account is determined as the first account category.
6. The video transmission method according to any one of claims 1 to 5, characterized in that, The number of historical videos is multiple, and the step of obtaining the weighted playback duration of the historical videos based on the actual playback duration includes: The weighted sum of the actual playback durations of multiple historical videos is obtained by weighting and summing them.
7. The video transmission method according to claim 6, characterized in that, The historical videos are ordered, and the last historical video in the ordered set is the last video played before the current video is played by the account. The weighted sum of the actual playback durations of the multiple historical videos yields the weighted playback duration of the multiple historical videos, including: Obtain a first preset weight coefficient and a second preset weight coefficient, wherein both the first preset weight coefficient and the second preset weight coefficient are positive numbers not greater than 1; The first historical video in the ordered set of multiple historical videos is determined as the first historical video of the current round, and the actual playback duration corresponding to the first historical video is determined as the reference playback duration. The next historical video after the first historical video is determined as the second historical video of the current round; The reference playback duration and the playback duration of the second historical video are weighted and summed based on the first preset weight coefficient and the second preset weight coefficient, and the reference playback duration is updated based on the result of the weighted summation. The second historical video of the current round is determined as the first historical video of the next round, and the reference playback duration is updated again until the second historical video is the last historical video in an ordered set of multiple historical videos, thus obtaining the weighted playback duration of the multiple historical videos.
8. The video transmission method according to any one of claims 1 to 7, characterized in that, Determining the transmission bandwidth parameters of the first video segment to be loaded and the second video segment to be loaded according to the loading priority includes: Monitor the network performance metrics of the terminal running the client, and determine the network quality coefficient based on the network performance metrics; In response to the decrease in network quality coefficient, the transmission bandwidth parameters of the first video segment to be loaded and the second video segment to be loaded are determined according to the loading priority.
9. The video transmission method according to any one of claims 1 to 7, characterized in that, Determining the transmission bandwidth parameters of the first video segment to be loaded and the second video segment to be loaded according to the loading priority includes: The bandwidth ratio coefficients of the first video segment to be loaded and the second video segment to be loaded are determined according to the loading priority, wherein the bandwidth ratio coefficients are positively correlated with the loading priority; Obtain the terminal network bandwidth of the terminal running the client, and determine the terminal network bandwidth and the corresponding bandwidth ratio coefficient as the transmission bandwidth parameters of the first video segment to be loaded and the second video segment to be loaded, respectively.
10. The video transmission method according to claim 9, characterized in that, The step of determining the transmission bandwidth parameters of the first video segment to be loaded and the second video segment to be loaded according to the loading priority further includes: If the terminal network bandwidth is less than a preset bandwidth threshold, a preset bandwidth list is obtained. The preset bandwidth list includes multiple ordered preset bandwidth values, which decrease sequentially. The ordered preset bandwidth values are sequentially allocated to the first video segment to be loaded and the second video segment to be loaded according to the loading priority from high to low, until the sum of the allocated preset bandwidth values is greater than or equal to the terminal network bandwidth.
11. The video transmission method according to claim 9, characterized in that, The step of obtaining the terminal network bandwidth of the terminal running the client includes: The first connection bandwidth between the terminal and each video server is obtained. The video server is used to transmit at least one of the first video segment to be loaded or the second video segment to be loaded to the terminal. The first connection bandwidth is the maximum bandwidth between the video server and the terminal within a preset period. The terminal network bandwidth of the terminal is determined based on the bandwidth of each of the first connection bandwidths.
12. The video transmission method according to claim 11, characterized in that, Determining the terminal network bandwidth of the terminal based on each of the first connection bandwidths includes: The terminal network bandwidth is obtained by summing the bandwidths of each of the first connections; Alternatively, the terminal network bandwidth can be obtained based on the average of the bandwidths of each of the first connections; Alternatively, the bandwidths of each first connection can be sorted based on their respective bandwidth sizes to obtain a bandwidth sorting result, and the terminal network bandwidth can be determined based on a preset quantile and the bandwidth sorting result.
13. The video transmission method according to claim 11, characterized in that, Before determining the terminal network bandwidth and the corresponding bandwidth ratio coefficient as the transmission bandwidth parameters of the first video segment to be loaded and the second video segment to be loaded, the method further includes: Determine the timestamp corresponding to the terminal network bandwidth, the timestamp being used to characterize the time information when determining the terminal network bandwidth based on each of the connection bandwidths; Obtain the current time information and determine the first time difference between the timestamp and the current time information; If the first time difference is greater than a preset time difference threshold, the second connection bandwidth between the terminal and each of the video servers is obtained, and the terminal network bandwidth is re-determined based on each of the second connection bandwidths.
14. The video transmission method according to any one of claims 1 to 13, characterized in that, The process of obtaining the first video segment to be loaded and the second video segment to be loaded based on their respective transmission bandwidth parameters includes: The transmission bandwidth parameters corresponding to the first video segment to be loaded and the transmission bandwidth parameters corresponding to the second video segment to be loaded are respectively sent to the video servers corresponding to the first video segment to be loaded and the second video segment to be loaded. Receive the first video segment to be loaded and the second video segment to be loaded from each of the video servers based on the corresponding transmission bandwidth parameters.
15. The video transmission method according to claim 14, characterized in that, The transmission bandwidth parameters include the terminal network bandwidth and bandwidth ratio of the terminal running the client. The video server transmits the first video segment to be loaded and the second video segment to be loaded through the following steps: The transmission bandwidth is determined by multiplying the terminal network bandwidth and the bandwidth ratio coefficient. Obtain the initial transmission rate corresponding to when the video server transmits the first video segment to be loaded and the second video segment to be loaded to the terminal; Select one of the initial transmission rate and the transmission bandwidth as the target transmission rate; Based on the target transmission rate, the first video segment to be loaded and the second video segment to be loaded are transmitted to the terminal. During the transmission of the first video segment to be loaded and the second video segment to be loaded to the terminal, in response to the initial transmission rate update, the transmission bandwidth is updated based on the updated initial transmission rate, and the first video segment to be loaded and the second video segment to be loaded are transmitted to the terminal based on the updated target transmission rate.
16. The video transmission method according to claim 15, characterized in that, The transmission of the corresponding first video segment to be loaded and the second video segment to be loaded to the terminal based on the target transmission rate includes: Obtain the initial congestion window size corresponding to the video server. The initial congestion window size is used to characterize the maximum amount of data that the video server can send when it does not receive a response signal from the terminal. The congestion adjustment ratio is determined based on the ratio of the target transmission rate to the initial transmission rate, and the initial congestion window size is adjusted based on the congestion adjustment ratio to obtain the target congestion window size; Based on the target congestion window size and the target transmission rate, the corresponding first video segment to be loaded and the second video segment to be loaded are transmitted to the terminal.
17. A video transmission device, characterized in that, include: The first duration acquisition module is used to acquire the playback duration of the current video in the client's playback progress. The current video is the video currently being played on the client by the account logged into the client. The current video includes a first video segment to be loaded. The client is also used to play at least one video to be played after the current video. The video to be played includes a second video segment to be loaded. The second video segment to be loaded is the first video segment in the video to be played. The second duration acquisition module is used to acquire the actual playback duration of historical videos, and to obtain the weighted playback duration of the historical videos by weighting the actual playback duration. The historical videos are the videos that the account has played in the past. The priority determination module is used to determine the loading priority for the first video segment to be loaded and the second video segment to be loaded, respectively, based on the proportion of the already played duration in the weighted playback duration. A bandwidth allocation module is used to determine the transmission bandwidth parameters of the first video segment to be loaded and the second video segment to be loaded respectively according to the loading priority; The video acquisition module is used to acquire the first video segment to be loaded and the second video segment to be loaded based on their respective transmission bandwidth parameters.
18. An electronic device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the video transmission method according to any one of claims 1 to 16.
19. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the video transmission method according to any one of claims 1 to 16.
20. A computer program product comprising a computer program that is read and executed by a processor of a computer device, causing the computer device to perform the video transmission method according to any one of claims 1 to 16.