Task bandwidth allocation method and device for network application, equipment and storage medium
By dynamically allocating bandwidth resources in real-time audio and video transmission state, the problem of unreasonable bandwidth allocation in network applications is solved, the balance between audio and video quality and interaction timeliness is achieved, and the user experience is improved.
Patent Information
- Application Number
- CN202510335782.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-20
- Publication Date
- 2025-07-18
AI Technical Summary
In the prior art, the bandwidth allocation method of network applications cannot reasonably allocate limited resources, resulting in a decline in audio and video quality, unable to ensure the timeliness of interaction, and affecting user experience.
When the real-time audio and video transmission state is detected, the first download task is performed according to the current audio and video reception rate; when the second download task is detected, the first download rate is calculated based on the cut-off time and file size, and the second download task is performed according to the first download rate; the first remaining bandwidth is determined based on the user's estimated bandwidth and the first download rate, and when the remaining bandwidth is smaller than the audio and video reception rate, the first download task is performed according to the remaining bandwidth.
By dynamically allocating bandwidth resources, balancing the rates of different download tasks, ensuring audio and video quality and interaction timeliness, and optimizing user experience.
Smart Images

Figure CN120342878A_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present application relate to the field of computer technologies, and particularly to a method, device, equipment, and storage medium for task bandwidth allocation of network applications. Background Art
[0002] With the rapid development of network technologies, especially the popularization of high-speed network technologies, a solid foundation has been provided for the real-time transmission of network applications. On this basis, various network applications, especially live broadcast applications and short video applications, have begun to be widely popularized and have profoundly affected people's daily lives. For example, live broadcast applications can provide users with various service functions such as watching live content, sending barrage comments, and adding special effects, enriching the viewing experience of users. Among them, each service function is provided with a corresponding download task, and they jointly use the user's bandwidth to download relevant resources from the server.
[0003] For the processing of different download tasks of network applications, the related technologies adopt a fixed bandwidth allocation method, fixedly setting the download rates of different download tasks, which cannot reasonably allocate limited bandwidth resources, easily leads to a decline in the quality of audio and video, cannot ensure the timeliness of interaction, and affects the user experience. Summary of the Invention
[0004] Embodiments of the present application provide a method, device, equipment, and storage medium for task bandwidth allocation of network applications, which solve the problems in the related technologies that limited bandwidth resources cannot be reasonably allocated, easily leading to a decline in the quality of audio and video, unable to ensure the timeliness of interaction, and affecting the user experience. It can adapt to different types of download tasks for dynamic allocation of limited bandwidth resources, balance the download rates of different download tasks, ensure the timeliness of interaction while guaranteeing the quality of audio and video, and optimize the user experience.
[0005] In a first aspect, embodiments of the present application provide a method for task bandwidth allocation of network applications, and the method includes:
[0006] When it is detected that the user terminal is in the state of real-time audio and video transmission, execute the first download task corresponding to the real-time audio and video transmission at the current audio and video reception rate;
[0007] When it is detected that there is a second download task, calculate a first download rate based on the deadline and file size corresponding to the second download task, and execute the second download task at the first download rate, where the priority of the second download task is lower than that of the first download task;
[0008] Determine a first remaining bandwidth according to the currently detected estimated user bandwidth and the first download rate;
[0009] In the case where the first remaining bandwidth is less than the audio and video reception rate, execute the first download task according to the first remaining bandwidth.
[0010] In a second aspect, an embodiment of the present application further provides a task bandwidth allocation device for a network application. The device includes:
[0011] A first task processing module, configured to execute a first download task corresponding to real-time audio and video transmission according to the current audio and video reception rate when detecting that the user terminal is in a state of real-time audio and video transmission;
[0012] A second task processing module, configured to calculate a first download rate based on the deadline and file size corresponding to the second download task when detecting the existence of the second download task, and execute the second download task according to the first download rate, where the priority of the second download task is lower than the priority of the first download task;
[0013] A remaining bandwidth determination module, configured to determine a first remaining bandwidth according to the currently detected user estimated bandwidth and the first download rate;
[0014] A third task processing module, configured to execute the first download task according to the first remaining bandwidth in the case where the first remaining bandwidth is less than the audio and video reception rate.
[0015] In a third aspect, an embodiment of the present application further provides a task bandwidth allocation device for a network application. The device includes:
[0016] One or more processors;
[0017] A storage device, configured to store one or more programs,
[0018] When the one or more programs are executed by the one or more processors, the one or more processors implement the task bandwidth allocation method for a network application according to an embodiment of the present application.
[0019] In a fourth aspect, an embodiment of the present application further provides a non-volatile storage medium storing computer-executable instructions. The computer-executable instructions are configured to execute the task bandwidth allocation method for a network application according to an embodiment of the present application when executed by a computer processor.
[0020] In a fifth aspect, an embodiment of the present application further provides a computer program product. The computer program product includes a computer program. The computer program is stored in a computer-readable storage medium. At least one processor of the device reads and executes the computer program from the computer-readable storage medium, so that the device executes the task bandwidth allocation method for a network application according to an embodiment of the present application.
[0021] In an embodiment of the present application, when it is detected that the user terminal is in the state of real-time audio and video transmission, a first download task corresponding to the real-time audio and video transmission is executed according to the current audio and video reception rate; when it is detected that there is a second download task, a first download rate is calculated based on the deadline and file size corresponding to the second download task, and the second download task is executed according to the first download rate, where the priority of the second download task is lower than that of the first download task; a first remaining bandwidth is determined according to the currently detected estimated user bandwidth and the first download rate; when the first remaining bandwidth is less than the audio and video reception rate, the first download task is executed according to the first remaining bandwidth. In the above solution, by detecting whether the user terminal is in the state of real-time audio and video transmission, it can be judged whether the user terminal enters the real-time transmission state such as watching a video live broadcast or playing a short video that has not been cached, and it is necessary to receive audio and video data in real time; by executing the first download task corresponding to the real-time audio and video transmission according to the current audio and video reception rate, the download rate of the first download task is not restricted, and the audio and video quality is preferentially guaranteed; by calculating the first download rate based on the deadline and file size corresponding to the second download task, the minimum acceptable download rate of the second download task can be determined, and the second download task is executed according to the first download rate. While ensuring the timeliness of interaction, the second download task is reasonably speed-limited, reducing the user bandwidth occupancy and avoiding affecting the audio and video quality; by determining the first remaining bandwidth according to the currently detected estimated user bandwidth and the first download rate, the remaining bandwidth resources can be effectively estimated, and when the first remaining bandwidth is less than the audio and video reception rate, the first download task is executed according to the first remaining bandwidth, which can adapt to different download task types for dynamic allocation of limited bandwidth resources, balance the download rates of different download tasks, guarantee the audio and video quality, and optimize the user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] Figure 1 It is a flowchart of a task bandwidth allocation method for a network application provided by an embodiment of the present application;
[0023] Figure 2 It is a flowchart of a task bandwidth allocation method including a process of delaying the execution of a second download task provided by an embodiment of the present application;
[0024] Figure 3 It is a flowchart of a task bandwidth allocation method including a process of executing a third download task provided by an embodiment of the present application;
[0025] Figure 4 It is a flowchart of a task bandwidth allocation method including a process of using a third download task for bandwidth detection provided by an embodiment of the present application;
[0026] Figure 5 A flowchart of a task bandwidth allocation method including a process of executing a fourth download task provided by an embodiment of the present application;
[0027] Figure 6 A flowchart of another task bandwidth allocation method including a process of executing a third download task provided by an embodiment of the present application;
[0028] Figure 7 A flowchart of a task bandwidth allocation method including a process of stopping the execution of a third download task provided by an embodiment of the present application;
[0029] Figure 8 A flowchart of a task bandwidth allocation method including a process of sending historical download rates provided by an embodiment of the present application;
[0030] Figure 9 A structural block diagram of a task bandwidth allocation device for a network application provided by an embodiment of the present application;
[0031] Figure 10 A structural schematic diagram of a task bandwidth allocation device for a network application provided by an embodiment of the present application. Detailed implementation manners
[0032] The following further describes the embodiments of the present application in detail with reference to the accompanying drawings and embodiments. It can be understood that the specific embodiments described herein are only used to explain the embodiments of the present application, rather than limiting the embodiments of the present application. Additionally, it should be noted that for the sake of description, only parts related to the embodiments of the present application are shown in the accompanying drawings, rather than all the structures.
[0033] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, rather than to describe a specific order or sequence. It should be understood that such data can be interchanged under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described herein, and the objects distinguished by "first", "second", etc. are usually of the same category, and do not limit the number of objects. For example, the first object can be one or multiple. In addition, "and / or" in the specification and claims means at least one of the connected objects, and the character " / " generally represents an "or" relationship between the associated objects before and after.
[0034] The task bandwidth allocation method for network applications provided by the embodiments of the present application can be used to adapt to different download task types for dynamic allocation of limited bandwidth resources, balance the download rates of the first download task and the second download task with different priorities, ensure the timeliness of interaction while guaranteeing the audio-visual quality, and optimize the user experience. The relevant application scenarios include video live broadcast, video conferencing, voice live broadcast, etc. The several application scenarios listed above are only exemplary and explanatory. In actual applications, this task bandwidth allocation method can also be used in network applications in other scenarios. The embodiments of the present application do not limit this.
[0035] For the task bandwidth allocation method for network applications provided by the embodiments of the present application, the execution subject of each step can be a computer device, which refers to any electronic device with data calculation, processing, and storage capabilities, such as terminal devices like mobile phones, PCs (Personal Computers), and tablet computers. The embodiments of the present application do not limit this.
[0036] Figure 1 It is a flowchart of a task bandwidth allocation method for network applications provided by the embodiments of the present application.
[0037] As Figure 1 shown, it includes the following steps:
[0038] Step S101: When it is detected that the user terminal is in the state of real-time audio-visual transmission, execute the first download task corresponding to the real-time audio-visual transmission according to the current audio-visual reception rate.
[0039] Among them, the real-time audio and video transmission state can be a continuous audio and video data stream transmission state established between the user terminal and the audio and video media server. The specific application scenarios can be video conferencing, video live streaming, etc. For example, the user terminal is watching a video live stream or a short video without caching, and needs to receive the transmitted audio and video data in real time. It occupies a high user bandwidth and has a high immediacy requirement. Therefore, for the first download task corresponding to the real-time audio and video transmission, it cannot be delayed in downloading or forcibly speed-limited, otherwise it will affect the clarity and smoothness of the audio and video. The first download task can be a streaming media data download task required for real-time audio and video transmission, with a high priority, and its bandwidth resources need to be preferentially guaranteed. The audio and video reception rate can be the average rate at which the user terminal receives audio and video data from the audio and video media server, and can be adaptively adjusted based on device information, network information, buffer size, etc. The device information can be device model information, device hardware parameters, etc., used to reflect the device performance and decoding ability. The network information can be network type, network bandwidth, network metric information, etc., used to reflect the network condition of the viewer side. Here, this application does not make a limitation. Therefore, when the user terminal is in the real-time audio and video transmission state, the first download task is not speed-limited, and the first download task is executed according to the audio and video reception rate adaptively selected by the rate, preferentially guaranteeing the audio and video quality.
[0040] Step S102, in the case of detecting the existence of a second download task, calculate a first download rate based on the deadline and file size corresponding to the second download task, and execute the second download task according to the first download rate, where the priority of the second download task is lower than the priority of the first download task.
[0041] Among them, the second download task can be a data download task required when the user performs interactive operations such as public chat, comments, and interactive special effects. Its priority is lower than that of the first download task, and the timeliness requirement is lower than that of the first download task. The deadline corresponding to the second download task can be a preset latest completion time limit. If the execution time of the second download task exceeds this deadline, it will cause obvious interaction delays and affect the user interaction experience. Therefore, the first download rate can be calculated based on the deadline corresponding to the second download task and the file size. In one embodiment, the file size can be divided by the subtraction result of the deadline and the current time to obtain the first download rate. In one embodiment, the subtraction result of the deadline and the current time can be multiplied by the first fluctuation coefficient to obtain the target completion time, and the file size can be divided by the target completion time to obtain the first download rate. The first fluctuation coefficient can be between 1 and 2 and can be obtained by statistically analyzing the recorded historical network data. It is used to appropriately increase the target completion time required for the second download task and reserve redundant bandwidth for executing the second download task when the network jitters violently. Thus, executing the second download task at the first download rate can ensure that the second download task is completed within an acceptable maximum completion time, ensure interaction timeliness, and achieve a certain speed limit effect, reduce user bandwidth occupancy, and avoid affecting the audio and video quality.
[0042] Step S103: Determine the first remaining bandwidth according to the currently detected estimated user bandwidth and the first download rate.
[0043] Among them, the user-estimated bandwidth can be the upper limit value of the available bandwidth corresponding to the current network obtained through active detection. For the real-time audio and video transmission scenario of this application, the selection of the detection algorithm needs to take into account the scenario characteristics of low latency, packet loss resistance, and dynamic bandwidth adaptation, and combine the implementation characteristics of the user terminal. Specifically, congestion control algorithms based on TCP (Transmission Control Protocol) or UDP (User Datagram Protocol), congestion control algorithms based on lightweight machine learning models, or sliding window detection algorithms based on TCP or UDP can be used. The lightweight machine learning module can be an LSTM (Long Short-Term Memory) model, which is not limited in this application. In one embodiment, the first remaining bandwidth can be obtained by subtracting the first download rate from the user-estimated bandwidth. In one embodiment, the user-estimated bandwidth can be subtracted by the result of multiplying the second fluctuation coefficient by the user-estimated bandwidth to obtain the target estimated bandwidth, and the first remaining bandwidth can be obtained by subtracting the target estimated bandwidth from the first download rate. The second fluctuation coefficient ranges from 0 to 1 and can be obtained based on the statistical analysis of the recorded historical network data, which is used to appropriately reduce the obtained user-estimated bandwidth and reserve redundant bandwidth for the execution of the first download task when the network jitters violently. The first remaining bandwidth can represent the available bandwidth portion in the user-estimated bandwidth that is not occupied by the second download task.
[0044] Step S104, when the first remaining bandwidth is less than the audio and video reception rate, execute the first download task according to the first remaining bandwidth.
[0045] Among them, by comparing the first remaining bandwidth with the audio and video reception rate, it can be determined whether the current available bandwidth margin can meet the original rate requirement of the first download task when the second download task is added and the second download task is ensured to be completed at the minimum download rate. If the first remaining bandwidth is greater than or equal to the audio and video reception rate, it can be considered that the current available bandwidth margin can meet the original rate requirement of the first download task, and no adjustment is needed, and the first download task corresponding to the real-time audio and video transmission can continue to be executed at the current audio and video reception rate. If the first remaining bandwidth is less than the audio and video reception rate, it can be considered that the current available bandwidth margin cannot meet the original rate requirement of the first download task, and the first download task needs to be executed according to the first remaining bandwidth, appropriately reducing the download rate to avoid network congestion caused by concurrent tasks and resulting in audio and video playback stuttering.
[0046] In the above case, when it is detected that the user terminal is in the state of real-time audio and video transmission, the first download task corresponding to the real-time audio and video transmission is executed according to the current audio and video reception rate; when it is detected that there is a second download task, the first download rate is calculated based on the deadline and file size corresponding to the second download task, and the second download task is executed according to the first download rate, where the priority of the second download task is lower than that of the first download task; the first remaining bandwidth is determined according to the currently detected user estimated bandwidth and the first download rate; when the first remaining bandwidth is less than the audio and video reception rate, the first download task is executed according to the first remaining bandwidth. In the above solution, by detecting whether the user terminal is in the state of real-time audio and video transmission, it can be determined whether the user terminal enters the real-time transmission state such as watching a video live broadcast or playing a short video that has not been cached, and it is necessary to receive audio and video data in real time; by executing the first download task corresponding to the real-time audio and video transmission according to the current audio and video reception rate, the download rate of the first download task is not restricted, and the audio and video quality is preferentially guaranteed; by calculating the first download rate based on the deadline and file size corresponding to the second download task, the minimum acceptable download rate of the second download task can be determined, and the second download task is executed according to the first download rate, while ensuring the timeliness of interaction, reasonably limiting the speed of the second download task, reducing the user bandwidth occupancy, and avoiding affecting the audio and video quality; by determining the first remaining bandwidth according to the currently detected user estimated bandwidth and the first download rate, the remaining bandwidth resources can be effectively estimated, and when the first remaining bandwidth is less than the audio and video reception rate, the first download task is executed according to the first remaining bandwidth, which can adapt to different download task types for dynamic allocation of limited bandwidth resources, balance the download rates of different download tasks, guarantee the audio and video quality, and optimize the user experience.
[0047] Figure 2 The figure is a flowchart of a task bandwidth allocation method provided by an embodiment of the present application, which includes a process of delaying the execution of a second download task. As Figure 2 shown, the method includes the following steps:
[0048] Step S201: When it is detected that the user terminal is in the state of real-time audio and video transmission, execute the first download task corresponding to the real-time audio and video transmission according to the current audio and video reception rate.
[0049] Step S202: When it is detected that there is a second download task, calculate the first download rate based on the deadline and file size corresponding to the second download task, and count the cumulative duration of the real-time audio and video transmission. When the cumulative duration reaches the first duration threshold, execute the second download task according to the first download rate, where the priority of the second download task is lower than that of the first download task.
[0050] Among them, by counting the cumulative duration of real-time audio and video transmission, the duration of the user watching a video live stream or a short video that has not been cached can be determined. This first duration threshold can be used to determine whether the user has just started watching a video live stream or a short video that has not been cached. For example, this first duration threshold can be 2 seconds, which can be specifically adaptively set by developers according to the user experience data of the actual application scenario, and this application does not make a limitation here. If the cumulative duration does not reach the first duration threshold, it can be considered that the user has just started watching a video live stream or a short video that has not been cached, and their attention is mainly focused on the video content rather than interactive content such as public chat, comments, and interactive special effects. Therefore, the execution of the second download task is prohibited until the cumulative duration reaches the first duration threshold.
[0051] Step S203: Determine the first remaining bandwidth according to the currently detected estimated user bandwidth and the first download rate.
[0052] Step S204: In the case where the first remaining bandwidth is less than the audio and video reception rate, execute the first download task according to the first remaining bandwidth.
[0053] As described above, by counting the cumulative duration of real-time audio and video transmission, it can be determined whether the user has just started watching a video live stream or a short video that has not been cached. And when the cumulative duration reaches the first duration threshold, execute the second download task according to the first download rate, which can effectively prevent the user bandwidth from being preempted by the second download task during the initial transmission of audio and video, delay the start of the second download task, and optimize the user's initial experience.
[0054] Figure 3 This is a flowchart of a task bandwidth allocation method provided by an embodiment of this application, which includes the process of executing a third download task. As Figure 3 shown, it includes the following steps:
[0055] Step S301: In the case where it is detected that the user terminal is in the state of real-time audio and video transmission, execute the first download task corresponding to the real-time audio and video transmission according to the current audio and video reception rate.
[0056] Step S302: In the case where it is detected that there is no second download task, the audio and video cache duration reaches the second duration threshold, and there is a third download task, determine the second remaining bandwidth based on the currently detected estimated user bandwidth and the audio and video reception rate, and execute the third download task according to the second remaining bandwidth, where the priority of the third download task is lower than the priority of the second download task.
[0057] Among them, the third download task can be a data download task for pre-caching resource files, short videos, etc., so as to make full use of the idle bandwidth for early data download. Its priority is lower than that of the second download task and is the lowest. If it is detected that there is no second download task, it can be considered that the current user is not performing interactive operations such as public chat, comment, and interaction special effects. The second duration threshold can be used to determine whether the current audio-video cache duration can provide sufficient buffer space to cope with the risk of audio-video stuttering. For example, the second duration threshold can be 2 seconds, and specifically, it can be adaptively set by developers according to the user experience data of the actual application scenario, and this application does not make a limitation here. If the audio-video cache duration does not reach the second duration threshold, it can be considered that the pre-cached audio-video data cannot effectively cope with the risk of audio-video stuttering, and the third download task cannot be started temporarily when the user terminal is in the audio-video real-time transmission state. If the audio-video cache duration reaches the second duration threshold, it can be considered that the pre-cached audio-video data can effectively cope with the risk of audio-video stuttering, and the third download task can be started when the user terminal is in the audio-video real-time transmission state, so as to make full use of the idle bandwidth. In one embodiment, the second remaining bandwidth can be obtained by subtracting the audio-video reception rate from the user's estimated bandwidth. In one embodiment, the user's estimated bandwidth can be subtracted by the product of the dynamic margin coefficient and the user's estimated bandwidth to obtain the target user bandwidth, and the audio-video reception rate can be subtracted from the target user bandwidth to obtain the second remaining bandwidth. The dynamic margin coefficient can be between 0 and 1 and can be obtained based on the statistical history network data and is used to reserve redundant bandwidth when the network jitters violently.
[0058] Step S303, when it is detected that there is a second download task, calculate the first download rate based on the deadline and file size corresponding to the second download task, and execute the second download task at the first download rate, where the priority of the second download task is lower than that of the first download task.
[0059] Step S304, determine the first remaining bandwidth according to the currently detected user's estimated bandwidth and the first download rate.
[0060] Step S305, when the first remaining bandwidth is less than the audio-video reception rate, execute the first download task at the first remaining bandwidth.
[0061] As described above, if it is detected that there is no second download task, the audio-video cache duration reaches the second duration threshold, and there is a third download task, it can be determined that the risk of stuttering in the current audio-video playback is relatively small, and the third download task can be selected to be started to make full use of the idle bandwidth and optimize the bandwidth resource allocation.
[0062] Figure 4The flowchart of a task bandwidth allocation method provided by an embodiment of the present application, which includes a process of using a third download task for bandwidth detection. As Figure 4 shown, it includes the following steps:
[0063] Step S401: When it is detected that the user terminal is in the state of real-time audio and video transmission, execute the first download task corresponding to the real-time audio and video transmission according to the current audio and video reception rate.
[0064] Step S402: When it is detected that there is a second download task, calculate the first download rate based on the deadline and file size corresponding to the second download task, and execute the second download task according to the first download rate, where the priority of the second download task is lower than that of the first download task.
[0065] Step S403: When bandwidth detection is triggered and it is detected that there is a third download task, start the third download task, and control the download rate of the third download task to perform bandwidth detection until the user estimated bandwidth that meets the preset network metric conditions is obtained.
[0066] Among them, in the related art, bandwidth detection can be to send test data and measure indicators such as data transmission rate, round-trip delay, and packet loss rate to determine the current maximum available bandwidth of the network. Since this test data is only used for bandwidth detection, it is easy to cause bandwidth waste. Therefore, in this embodiment, if bandwidth detection is triggered, it can first detect whether there is a third download task. If it is simultaneously detected that there is a third download task, the third download task can be selected to be started to replace the sending of test data for bandwidth detection. By controlling the download rate of the third download task, the user estimated bandwidth that meets the preset network metric conditions can be detected. The preset network metric conditions can be that one or more indicator values such as round-trip delay and packet loss rate are within the preset threshold range, which is not limited in this application. Thus, the sum of the download rate of the third download task and the download rate of the first download task can be used as the user estimated bandwidth, achieving the purpose of reducing bandwidth waste.
[0067] Step S404: Determine the first remaining bandwidth according to the currently detected user estimated bandwidth and the first download rate.
[0068] Step S405: When the first remaining bandwidth is less than the audio and video reception rate, execute the first download task according to the first remaining bandwidth.
[0069] As described above, by starting the third download task and controlling the download rate of the third download task to perform bandwidth detection, the third download task that helps to improve the audio and video playback experience can be used to replace the original test data and applied to bandwidth detection, reducing bandwidth waste and saving traffic costs.
[0070] Figure 5 This is a flowchart of a task bandwidth allocation method provided by an embodiment of the present application, which includes the process of executing a fourth download task. As Figure 5 shown, the method includes the following steps:
[0071] Step S501: When it is detected that there is a fourth download task, execute the fourth download task at the original download rate corresponding to the fourth download task, and the priority of the fourth download task is higher than that of the first download task.
[0072] Among them, the fourth download task may be a data download task required when the user performs operations such as entering or leaving a live broadcast room, switching audio and video, etc. Its priority is higher than that of the first download task and has the highest priority. Since the data volume of the fourth download task is small, the bandwidth occupancy is small, and the timeliness requirement is high, therefore, there is no need to limit the speed of the fourth download task, and the fourth download task can be executed at the original download rate corresponding to the fourth download task.
[0073] Step S502: When it is detected that the user terminal is in the state of real-time audio and video transmission, execute the first download task corresponding to the real-time audio and video transmission at the current audio and video reception rate.
[0074] Step S503: When it is detected that there is a second download task, calculate the first download rate based on the deadline and file size corresponding to the second download task, and execute the second download task at the first download rate, where the priority of the second download task is lower than that of the first download task.
[0075] Step S504: Determine the first remaining bandwidth according to the currently detected estimated bandwidth of the user and the first download rate.
[0076] Step S505: When the first remaining bandwidth is less than the audio and video reception rate, execute the first download task at the first remaining bandwidth.
[0077] As described above, by setting the fourth download task to the highest priority, it is possible to ensure the priority download of signaling information generated when the user enters or leaves a live broadcast room, switches audio and video, etc., and ensure the normal progress of business processes such as the user watching live broadcasts and short videos.
[0078] Figure 6 This is a flowchart of another task bandwidth allocation method provided by an embodiment of the present application, which includes the process of executing a third download task. As Figure 6 shown, the method includes the following steps:
[0079] Step S601: Detect whether the user terminal is in the state of real-time audio and video transmission.
[0080] Step S602: When it is detected that the user terminal is not in the state of real-time audio and video transmission and there is a third download task, execute the third download task at the original download rate corresponding to the third download task.
[0081] Among them, if it is detected that the user terminal is not in the state of real-time audio and video transmission, it can be considered that the user is not watching a video live broadcast or an uncached short video, etc., and there is no first download task to be executed. The current bandwidth resource is relatively abundant, and the third download task of pre-caching resource files, short videos, etc. can be executed, and there is no need to limit the download rate to pre-cache audio and video data as much as possible and reduce the risk of audio and video stuttering.
[0082] Step S603: When it is detected that the user terminal is in the state of real-time audio and video transmission, execute the first download task corresponding to the real-time audio and video transmission at the current audio and video reception rate.
[0083] Step S604: When it is detected that there is a second download task, calculate the first download rate based on the deadline and file size corresponding to the second download task, and execute the second download task at the first download rate, where the priority of the second download task is lower than that of the first download task.
[0084] Step S605: Determine the first remaining bandwidth according to the currently detected estimated bandwidth of the user and the first download rate.
[0085] Step S606: When the first remaining bandwidth is less than the audio and video reception rate, execute the first download task at the first remaining bandwidth.
[0086] As described above, when it is detected that the user terminal is not in the state of real-time audio and video transmission and there is a third download task, execute the third download task at the original download rate corresponding to the third download task, which can make full use of the relatively abundant bandwidth resources for pre-downloading audio and video data, is beneficial to reducing the risk of audio and video stuttering, and improving the user experience.
[0087] Figure 7 The figure is a flowchart of a task bandwidth allocation method provided by an embodiment of the present application, which includes a process of stopping the execution of the third download task. As Figure 7 shown, it includes the following steps:
[0088] Step S701: Detect whether the user terminal is in the state of real-time audio and video transmission.
[0089] Step S702: When it is detected that the user terminal is not in the state of real-time audio and video transmission and there is a third download task, execute the third download task at the original download rate corresponding to the third download task. When it is detected that the state switches to real-time audio and video transmission, stop executing the third download task.
[0090] Among them, since executing the third download task according to the original download rate corresponding to the third download task will occupy more bandwidth, therefore, when it is detected that the user terminal switches from the non-audio / video real-time transmission state to the audio / video real-time transmission state, the execution of the third download task can be stopped first to ensure the normal transmission of audio / video data until other conditions for starting the third download task are met.
[0091] Step S703: When it is detected that the user terminal is in the audio / video real-time transmission state, execute the first download task corresponding to the audio / video real-time transmission according to the current audio / video reception rate.
[0092] Step S704: When it is detected that there is a second download task, calculate the first download rate based on the deadline and file size corresponding to the second download task, and execute the second download task according to the first download rate, where the priority of the second download task is lower than that of the first download task.
[0093] Step S705: Determine the first remaining bandwidth according to the currently detected estimated bandwidth of the user and the first download rate.
[0094] Step S706: When the first remaining bandwidth is less than the audio / video reception rate, execute the first download task according to the first remaining bandwidth.
[0095] As described above, by stopping the execution of the third download task when it is detected that the state switches to the audio / video real-time transmission state, the normal bandwidth occupancy of the audio / video data can be preferentially maintained, the real-time transmission of the audio / video data can be prevented from being affected by the execution of the third download task, and the smoothness and clarity of the audio / video can be ensured.
[0096] Figure 8 It is a flowchart of a task bandwidth allocation method including a process of sending historical download rates provided by an embodiment of the present application. As Figure 8 shown, it includes the following steps:
[0097] Step S801: Detect whether the user terminal is in the audio / video real-time transmission state.
[0098] Step S802: When it is detected that the user terminal is not in the audio / video real-time transmission state and there is a third download task, execute the third download task according to the original download rate corresponding to the third download task. When it is detected that the state switches to the audio / video real-time transmission state, stop the execution of the third download task, and send the historical download rate corresponding to the third download task to the audio / video media server, so that the audio / video media server can select a video code rate level according to the historical download rate and send down the audio / video data corresponding to the video code rate level.
[0099] Step S803: When it is detected that the user terminal is in the state of real-time audio and video transmission, execute the first download task corresponding to the real-time audio and video transmission according to the current audio and video reception rate.
[0100] Step S804: When it is detected that there is a second download task, calculate the first download rate based on the deadline and file size corresponding to the second download task, and execute the second download task according to the first download rate, where the priority of the second download task is lower than that of the first download task.
[0101] Step S805: Determine the first remaining bandwidth according to the currently detected user estimated bandwidth and the first download rate.
[0102] Step S806: When the first remaining bandwidth is less than the audio and video reception rate, execute the first download task according to the first remaining bandwidth.
[0103] As described above, by sending the historical download rate corresponding to the third download task before switching to the audio and video media server as user information, it can effectively assist the audio and video media server to select the audio and video bitrate gear that best suits the user's network bandwidth according to the historical download rate, ensuring the smoothness of the user's video viewing while maximizing the clarity of the user's video viewing.
[0104] Figure 9 As shown in the block diagram of the task bandwidth allocation device for a network application provided in the embodiment of the present application, the device is configured to execute the task bandwidth allocation method for the network application provided in the above embodiment, and has the corresponding functional modules and beneficial effects for executing the method. Figure 9 As shown in the figure, the device includes:
[0105] The first task processing module 101 is configured to execute the first download task corresponding to the real-time audio and video transmission according to the current audio and video reception rate when it is detected that the user terminal is in the state of real-time audio and video transmission;
[0106] The second task processing module 102 is configured to calculate the first download rate based on the deadline and file size corresponding to the second download task when it is detected that there is a second download task, and execute the second download task according to the first download rate, where the priority of the second download task is lower than that of the first download task;
[0107] The remaining bandwidth determination module 103 is configured to determine the first remaining bandwidth according to the currently detected user estimated bandwidth and the first download rate;
[0108] The third task processing module 104 is configured to execute the first download task according to the first remaining bandwidth when the first remaining bandwidth is less than the audio and video reception rate.
[0109] As described above, when it is detected that the user terminal is in the state of real-time audio and video transmission, the first download task corresponding to the real-time audio and video transmission is executed at the current audio and video reception rate; when it is detected that there is a second download task, the first download rate is calculated based on the deadline and file size corresponding to the second download task, and the second download task is executed at the first download rate, and the priority of the second download task is lower than that of the first download task; the first remaining bandwidth is determined according to the currently detected estimated user bandwidth and the first download rate; when the first remaining bandwidth is less than the audio and video reception rate, the first download task is executed at the first remaining bandwidth. In the above solution, by detecting whether the user terminal is in the state of real-time audio and video transmission, it can be judged whether the user terminal enters the real-time transmission state such as watching a video live broadcast or playing a short video that has not been cached, and it is necessary to receive audio and video data in real time; by executing the first download task corresponding to the real-time audio and video transmission at the current audio and video reception rate, the download rate of the first download task is not restricted, and the audio and video quality is preferentially guaranteed; by calculating the first download rate based on the deadline and file size corresponding to the second download task, the minimum acceptable download rate of the second download task can be determined, and the second download task is executed at the first download rate, while ensuring the timeliness of interaction, reasonably limiting the speed of the second download task, reducing the user bandwidth occupancy, and avoiding affecting the audio and video quality; by determining the first remaining bandwidth according to the currently detected estimated user bandwidth and the first download rate, the remaining bandwidth resources can be effectively estimated, and when the first remaining bandwidth is less than the audio and video reception rate, the first download task is executed at the first remaining bandwidth, which can adapt to different download task types for dynamic allocation of limited bandwidth resources, balance the download rates of different download tasks, ensure the audio and video quality, and optimize the user experience.
[0110] In a possible embodiment, it further includes a duration statistics module, configured to:
[0111] Statistically calculate the cumulative duration of the real-time audio and video transmission;
[0112] Correspondingly, the second task processing module 102 is further configured to:
[0113] When the cumulative duration reaches the first duration threshold, execute the second download task at the first download rate.
[0114] In a possible embodiment, it further includes a fourth task processing module, configured to:
[0115] In the case where it is detected that there is no second download task, the audio - video cache duration reaches the second duration threshold, and there is a third download task, determine the second remaining bandwidth based on the currently detected estimated user bandwidth and the audio - video reception rate, and execute the third download task according to the second remaining bandwidth. The priority of the third download task is lower than that of the second download task.
[0116] In a possible embodiment, it further includes a bandwidth detection module, configured as:
[0117] In the case where bandwidth detection is triggered and it is detected that there is a third download task, start the third download task, and control the download rate of the third download task to perform bandwidth detection until the estimated user bandwidth that meets the preset network metric conditions is obtained.
[0118] In a possible embodiment, it further includes a fifth task processing module, configured as:
[0119] In the case where it is detected that there is a fourth download task, execute the fourth download task according to the original download rate corresponding to the fourth download task. The priority of the fourth download task is higher than that of the first download task.
[0120] In a possible embodiment, it further includes a sixth task processing module, configured as:
[0121] In the case where it is detected that the user terminal is not in the audio - video real - time transmission state and there is a third download task, execute the third download task according to the original download rate corresponding to the third download task.
[0122] In a possible embodiment, it further includes a task stop module, configured as:
[0123] In the case where it is detected that the state is switched to the audio - video real - time transmission state, stop executing the third download task.
[0124] In a possible embodiment, it further includes a download rate feedback module, configured as:
[0125] Send the historical download rate corresponding to the third download task to the audio - video media server, so that the audio - video media server selects a video bitrate level according to the historical download rate and distributes the audio - video data corresponding to the video bitrate level.
[0126] Figure 10 This is a schematic structural diagram of a task bandwidth allocation device for a network application provided by an embodiment of the present application. As Figure 10 shown, the device includes a processor 201, a memory 202, an input device 203, and an output device 204; the number of processors 201 in the device can be one or more. Figure 10Take a processor 201 as an example; the processor 201, memory 202, input device 203, and output device 204 in the device can be connected through a bus or other means. Figure 10 Take the connection through the bus as an example. The memory 202, as a computer-readable storage medium, can be configured to store software programs, computer-executable programs, and modules, such as the program instructions / modules corresponding to the task bandwidth allocation method of the network application in the embodiments of the present application. The processor 201 executes various functional applications and data processing of the device by running the software programs, instructions, and modules stored in the memory 202, that is, implements the above-mentioned task bandwidth allocation method of the network application. The input device 203 can be configured to receive input digital or character information, and generate key signal inputs related to the user settings and function controls of the device. The output device 204 can include display devices such as a display screen.
[0127] The embodiments of the present application also provide a non-volatile storage medium containing computer-executable instructions. The computer-executable instructions, when executed by a computer processor, are configured to execute a task bandwidth allocation method of a network application described in the above embodiments, including: when it is detected that the user terminal is in the state of real-time audio and video transmission, performing a first download task corresponding to real-time audio and video transmission according to the current audio and video reception rate; when it is detected that there is a second download task, calculating a first download rate based on the deadline and file size corresponding to the second download task, and performing the second download task according to the first download rate, where the priority of the second download task is lower than that of the first download task; determining a first remaining bandwidth according to the currently detected user estimated bandwidth and the first download rate; when the first remaining bandwidth is less than the audio and video reception rate, performing the first download task according to the first remaining bandwidth.
[0128] It should be noted that in the embodiments of the above-mentioned task bandwidth allocation device of the network application, the various units and modules included are only divided according to functional logic, but are not limited to the above division, as long as the corresponding functions can be realized; in addition, the specific names of the functional units are only for the convenience of mutual distinction and are not configured to limit the protection scope of the embodiments of the present application.
[0129] In some possible implementation manners, various aspects of the method provided by the present application can also be implemented in the form of a program product, which includes program code. When the program product runs on a computer device, the program code is configured to cause the computer device to execute the steps in the methods according to various exemplary embodiments of the present application described in this specification. For example, the computer device can execute the task bandwidth allocation method of the network application recorded in the embodiments of the present application. The program product can be implemented by any combination of one or more readable media.
Claims
1. A method for task bandwidth allocation of a network application, characterized in that including: When it is detected that the user terminal is in the state of real-time audio and video transmission, execute the first download task corresponding to the real-time audio and video transmission according to the current audio and video reception rate; When it is detected that there is a second download task, calculate the first download rate based on the deadline and file size corresponding to the second download task, and execute the second download task according to the first download rate, where the priority of the second download task is lower than that of the first download task; Determine the first remaining bandwidth according to the currently detected user estimated bandwidth and the first download rate; When the first remaining bandwidth is less than the audio and video reception rate, execute the first download task according to the first remaining bandwidth.
2. The task bandwidth allocation method for network applications according to claim 1, characterized in that Before executing the second download task according to the first download rate, it further includes: Statistical cumulative duration of real-time audio and video transmission; Correspondingly, executing the second download task according to the first download rate includes: When the cumulative duration reaches the first duration threshold, execute the second download task according to the first download rate.
3. The task bandwidth allocation method for a network application according to claim 1, characterized in that, After executing the first download task corresponding to the real-time audio and video transmission according to the current audio and video reception rate, it further includes: When it is detected that there is no second download task, the audio and video cache duration reaches the second duration threshold, and there is a third download task, determine the second remaining bandwidth based on the currently detected user estimated bandwidth and the audio and video reception rate, and execute the third download task according to the second remaining bandwidth, where the priority of the third download task is lower than that of the second download task.
4. The task bandwidth allocation method for a network application according to claim 1, wherein Before determining the first remaining bandwidth according to the currently detected user estimated bandwidth and the first download rate, it further includes: When bandwidth detection is triggered and it is detected that there is a third download task, start the third download task and control the download rate of the third download task for bandwidth detection until the user estimated bandwidth that meets the preset network metric conditions is obtained.
5. The task bandwidth allocation method for a network application according to claim 1, wherein Before detecting that the user terminal is in the state of real-time audio and video transmission, it further includes: When it is detected that there is a fourth download task, execute the fourth download task according to the original download rate corresponding to the fourth download task, where the priority of the fourth download task is higher than that of the first download task.
6. The task bandwidth allocation method for a network application according to claim 1, characterized in that It further includes: When it is detected that the user terminal is not in the state of real-time audio and video transmission and there is a third download task, execute the third download task according to the original download rate corresponding to the third download task.
7. The task bandwidth allocation method for a network application according to claim 6, wherein After executing the third download task according to the original download rate corresponding to the third download task, it further includes: When it is detected that the state switches to real-time audio and video transmission, stop executing the third download task.
8. The method for task bandwidth allocation of a network application according to claim 7, wherein After stopping executing the third download task, it further includes: Send the historical download rate corresponding to the third download task to the audio and video media server, so that the audio and video media server selects a video code rate level according to the historical download rate and downloads the audio and video data corresponding to the video code rate level.
9. A task bandwidth allocation device for a network application, characterized in that, including: The first task processing module is configured to execute a first download task corresponding to real-time audio and video transmission at the current audio and video reception rate when it is detected that the user terminal is in a state of real-time audio and video transmission; The second task processing module is configured to calculate a first download rate based on the deadline and file size corresponding to the second download task and execute the second download task at the first download rate when it is detected that there is a second download task, and the priority of the second download task is lower than the priority of the first download task; The remaining bandwidth determination module is configured to determine a first remaining bandwidth according to the currently detected user estimated bandwidth and the first download rate; The third task processing module is configured to execute the first download task at the first remaining bandwidth when the first remaining bandwidth is less than the audio and video reception rate.
10. A task bandwidth allocation device for a network application, the device comprising: One or more processors; A storage device configured to store one or more programs, which when executed by the one or more processors cause the one or more processors to implement the task bandwidth allocation method of the network application according to any one of claims 1-8.
11. A non-volatile storage medium storing computer-executable instructions, the computer-executable instructions being configured to execute the task bandwidth allocation method of the network application according to any one of claims 1-8 when executed by a computer processor.
12. A computer program product, comprising a computer program, characterized in that, The computer program is stored in a computer-readable storage medium, and at least one processor of the device reads and executes the computer program from the computer-readable storage medium, so that the device executes the task bandwidth allocation method of the network application according to any one of claims 1-8.