Download speed control method, system, electronic device and medium
By comparing the current bandwidth of the download service with the bandwidth threshold and calling the PID algorithm to adjust the download speed, the problem of server bandwidth competition is solved, and the stability of the download service and the user experience are improved.
Patent Information
- Application Number
- CN202211427109.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-15
- Publication Date
- 2025-10-10
- Estimated Expiration
- 2042-11-15
AI Technical Summary
In the prior art, the server assigns a fixed download speed to the user without considering the bandwidth situation, resulting in server bandwidth competition, unstable service speed, and poor user experience.
By obtaining the comparison result of the current bandwidth of the download service and the bandwidth threshold, the PID algorithm is called to adjust the download speed and generate the corresponding download link to control the download speed.
Effectively control download speeds, avoid excessive bandwidth peaks, ensure stable speeds for each service, and improve user experience.
Smart Images

Figure CN115834596B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of download control, and in particular to a download speed control method, system, electronic device and medium. Background Art
[0002] With the development of technology, it is becoming more and more common for people to obtain a download link through a client such as a mobile phone or computer, and then download the resources corresponding to the link. Usually, the user's download speed is a fixed download speed assigned by the server.
[0003] However, allocating a fixed download speed to each user does not take bandwidth into consideration. This can easily lead to a situation where, when the server's bandwidth is full, other services provided by the server to users and the download service, or services corresponding to the server between different users, compete for bandwidth. As a result, the server provides fast services to some users and slow services to other users, making the service speed provided very unstable and reducing the user experience.
[0004] Therefore, how to design a download speed control method to solve the above problems is an urgent problem to be solved by those skilled in the art. Summary of the Invention
[0005] The purpose of this application is to provide a download speed control method, system, electronic device and medium; to solve the problem that when the current server allocates download speed for the user's download service, it does not take bandwidth into consideration, resulting in unstable speeds of various services provided by the server to the user and a low user experience.
[0006] To solve the above technical problems, the present application provides a download speed control method, which is applied to the server, including:
[0007] Responding to a request from the client to obtain a download link, obtaining the current bandwidth occupied by the download service of the cloud server;
[0008] Obtain the comparison result of the current bandwidth of the download service and the bandwidth threshold;
[0009] Calling the negative feedback algorithm and using the comparison result as input of the negative feedback algorithm to adjust the download speed;
[0010] A corresponding download link is generated according to the download speed and returned to the client so that the client can obtain relevant resources according to the download speed through the download link.
[0011] Preferably, the negative feedback algorithm is a PID algorithm, and the comparison result is a difference;
[0012] The comparison results of the current bandwidth of the download service and the bandwidth threshold are as follows:
[0013] Get the difference between the current bandwidth of the download service and the bandwidth threshold;
[0014] Calling the negative feedback algorithm and using the comparison result as the input of the negative feedback algorithm to adjust the download speed includes:
[0015] Call PID algorithm;
[0016] The difference is used as the input of the PID algorithm to adjust the download speed.
[0017] Preferably, adjusting the download speed by using the difference as an input to a PID algorithm comprises:
[0018] Get the acceleration obtained by the PID algorithm through the difference;
[0019] Get the download speed of the previous cycle;
[0020] The adjusted download speed is calculated based on the acceleration and the download speed of the previous cycle.
[0021] Preferably, the download link includes a time field; correspondingly, after receiving the download link sent by the client, the cloud server further includes:
[0022] Parse the time field contained in the download link;
[0023] If the current time does not meet the requirements of the time field, it is determined that the download link is invalid.
[0024] Preferably, the download link includes: download speed, resource information, and authentication information;
[0025] The authentication information is used to obtain relevant permissions to access the cloud server;
[0026] Resource information is used to find required resources in the cloud server;
[0027] Download speed is used to control the rate at which the cloud server sends data to the client.
[0028] Preferably, the bandwidth threshold varies with time.
[0029] Preferably, the bandwidth threshold changes with time as follows: the bandwidth threshold changes with the bandwidth occupied by other services of the cloud service end; wherein, the bandwidth occupied by other services of the cloud service end changes with time.
[0030] In order to solve the above technical problems, the present application also provides a download speed control system, including: a client, a server, and a cloud server;
[0031] The client is used to send a request to the server to obtain a download link and obtain the download link returned by the server, so as to obtain relevant resources according to the download speed through the download link;
[0032] The server end is configured to respond to the request of the client end for obtaining the download link to obtain the current bandwidth occupied by the download service of the cloud server end, to obtain a comparison result of the current bandwidth of the download service and the bandwidth threshold, and to call a negative feedback algorithm, to adjust the download speed by taking the comparison result as an input of the negative feedback algorithm, and to generate a corresponding download link according to the download speed and return the download link to the client end.
[0033] The cloud server end is configured to return the current bandwidth occupied by the download service to the server end, and to send relevant resources to the client end after receiving the download link of the client end.
[0034] To solve the above technical problems, the application further provides an electronic device, comprising a memory for storing a computer program.
[0035] A processor is configured to execute the computer program to implement the steps of the download speed control method.
[0036] To solve the above technical problems, the application further provides a computer readable storage medium, wherein the computer readable storage medium stores a computer program, and the computer program is executed by a processor to implement the steps of the download speed control method.
[0037] The download speed control method provided by the application comprises the following steps: responding to the request of the client end for obtaining the download link to obtain the current bandwidth occupied by the download service of the cloud server end; and taking the comparison result of the bandwidth threshold corresponding to the download service and the current bandwidth as an input of a negative feedback algorithm to adjust the download speed. Through the above method, the download speed corresponding to the download service can be effectively controlled, the problem of excessive total bandwidth peak caused by the fixed download speed of the download service and the problem of contention between related services can be solved, the speed of each service is relatively stable, and the user experience is improved.
[0038] The application further provides a download speed control system, an electronic device and a computer readable access medium, which correspond to the download speed control method and have the same beneficial effects. BRIEF DESCRIPTION OF DRAWINGS
[0039] To more clearly illustrate the embodiments of the application, the following will briefly introduce the drawings needed in the embodiments. Obviously, the drawings described below are only some embodiments of the application, and other drawings can be obtained by those skilled in the art without creative labor.
[0040] Figure 1 A download speed control method provided by an embodiment of the application is applied to an architecture diagram.
[0041] Figure 2A flowchart of a download speed control method provided in an embodiment of the present application;
[0042] Figure 3 This is a diagram showing the actual effect of a download speed control method provided in an embodiment of the present application;
[0043] Figure 4 A specific application scenario diagram of a download speed control method provided in an embodiment of the present application;
[0044] Figure 5 A structural diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0045] The following will be combined with the accompanying drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0046] The core of this application is to provide a download speed control method, system, electronic device, and medium. This method primarily relates to the field of download control and is primarily used in servers that provide multiple services to users. It is used to prevent bandwidth contention between different services provided by the server to users, or between services provided to different users, when the server provides download services to users, due to a lack of consideration for bandwidth. It enables the server to control the provided download speed based on the current bandwidth situation, thereby providing users with stable services and improving their user experience.
[0047] In order to enable those skilled in the art to better understand the present application, the present application is further described in detail below with reference to the accompanying drawings and specific implementation methods.
[0048] When a user requests a download service from the server, the download speed delivered in the link returned by the server is a fixed speed, which does not take into account the current server bandwidth. This can easily lead to a situation where when the server bandwidth is full, different services provided by the server to users, or services for different users, compete for bandwidth. As a result, the server configures a maximum speed for the services of some users, and does not configure speed for the services of other users at all, making the user's service speed very unstable and reducing the user experience.
[0049] Therefore, in order to solve the above problems, this application provides a download speed control method, wherein the method is applied to the server side, and the server side needs to interact with the client side and the cloud server side, wherein the client side is the user side, which is generally set on the mobile phone, computer and other devices used by the user; the server side is generally configured as the server of the product platform, wherein the cloud server side is generally a server storing related resources, wherein the server can be the server of the product platform or the server of other product platforms. Specifically, Figure 1 As shown: there will be information interaction between the client device 10, the server 11 where the service end is located, and the server 12 where the cloud service end is located. The specific information of the interaction is described in the following embodiment; the server 11 where the service end is located and the server 12 where the cloud service end is located are different servers. This method is specifically applied when the bandwidth occupied by each service provided by the server is large, and the sum of the bandwidth occupied by each service is likely to exceed the maximum threshold of the set bandwidth. Figure 2 As shown, the method specifically includes:
[0050] S10: Responding to the client's request for obtaining a download link, obtaining the current bandwidth occupied by the download service of the cloud server.
[0051] The client can only obtain relevant resources from the cloud server through a download link, which must be obtained from the server. The download link may include: maximum speed value, resource information, authentication information, etc. The download service is one of the various services provided by the cloud server, and the download service is used to manage download-related information. The cloud server is used to provide bandwidth information allocated to various services. That is, the server receives a request from the client to obtain a download link and, in response to the request, obtains information about the bandwidth occupied by the download service, namely the current bandwidth, from the cloud server.
[0052] S11: Obtain a comparison result between the current bandwidth of the download service and the bandwidth threshold.
[0053] The bandwidth threshold is the critical value of the bandwidth set by the platform. Each service in the cloud service end corresponds to the bandwidth threshold. If this value is exceeded, the quality of various services provided by the platform will be affected. The comparison result of the bandwidth threshold and the obtained current bandwidth can be the ratio of the two values or the difference between the two values. It is not limited here to which one it is, as long as it can reflect the difference between the two values.
[0054] S12: calling a negative feedback algorithm and using the comparison result as input of the negative feedback algorithm to adjust the download speed.
[0055] Negative feedback refers to the process in which the output of the system returns to the input; the specific negative feedback algorithm is not limited here, wherein the download speed is a key value in a download link, and the cloud server needs to control the speed of transmitting resources to the client according to the download speed; wherein the download speed in this embodiment will be adaptively adjusted according to the original download speed and the comparison result, and through this adjustment, the download speed can be effectively controlled to avoid speed instability.
[0056] S13: Generate a corresponding download link according to the download speed and return it to the client, so that the client can obtain related resources according to the download speed through the download link.
[0057] After obtaining the adjusted download speed, the server will generate a download link based on the download speed and related information of the resource; and transmit the download link to the client; after the client obtains the download link, it can obtain the relevant resources from the cloud server according to the adjusted download speed through the download link; the client can decide when to obtain the relevant resources according to the adjusted download speed through the download link according to the user's specific operation requirements.
[0058] The download speed control method provided in this embodiment can effectively control the download speed corresponding to the download service, solve the problem of excessively high total bandwidth peak caused by the fixed speed of the download service, and solve the problem of competition between related services; make the speed of each service relatively stable, and improve the user experience.
[0059] On the basis of the above embodiment, the negative feedback algorithm is limited to a PID algorithm, the comparison result is a difference, and step S11 is limited to include: obtaining the difference between the current bandwidth of the download service and the bandwidth threshold; and step S12 is limited to include: calling the PID algorithm; and using the difference as the input of the PID algorithm to adjust the download speed.
[0060] The symbols in PID represent the following: proportional, integral, and differential. It is a control algorithm that adjusts the input value in terms of proportional, integral, and differential to obtain a more stable output value. The difference is the difference between the bandwidth threshold and the current bandwidth, which is used as the input value of the PID algorithm. The download speed is adjusted according to the output value of the PID algorithm. The PID algorithm can be saved in a specific PID controller. The PID algorithm formula is:
[0061]
[0062] Where t is the current time, u(t) is the output value corresponding to the current time difference, e(t) is the difference between the current time bandwidth threshold and the current bandwidth, K P is the proportional gain, K i is the integral gain, Kd is the differential gain. P , K i and K d These are all debugging parameters, and different values can be set according to specific scenarios; depending on the input difference, the value of u(t) can be positive or negative.
[0063] This embodiment defines that the negative feedback algorithm is specifically a PID algorithm, which uses the PID algorithm to determine the relationship between the bandwidth threshold and the current bandwidth, thereby determining how to adjust the download speed to maintain the overall stability of the provided service; and realizes the application of the PID controller to Internet bandwidth control and achieves better control effect.
[0064] Based on the above embodiments, this embodiment, as a preferred embodiment, defines how to adjust the download speed, wherein the difference is used as the input of the PID algorithm to adjust the download speed, including: obtaining the acceleration obtained by the PID algorithm through the difference; obtaining the download speed of the previous cycle; and calculating the adjusted download speed based on the acceleration and the download speed of the previous cycle.
[0065] In this embodiment, the acceleration corresponds to u(t) in the above embodiment. The download speed of each cycle is pre-saved. The adjusted download speed is calculated by the acceleration and the download speed of the previous cycle. The period is the collection period of bandwidth statistics in the platform server, which can be set to 5 minutes. The specific method for obtaining the download speed is shown in the following formula:
[0066] speed(t i )=speed(t i-1 )+u(t i )
[0067] Among them, t i Represents a specific cycle, speed(t i ) represents the download speed of the current cycle, which is also the download speed required to be adjusted in the step, speed(t i-1 ) is the download speed corresponding to the previous cycle, u(t i ) is the output value calculated according to the formula corresponding to the above PID algorithm in the current cycle. The download speed in the first cycle can be the value preset by the platform and is not specifically limited here; when u(t i ) is negative, the download speed of the current cycle is less than that of the previous cycle, that is, the download speed is reduced; when u(t i ) is positive, the download speed corresponding to the current cycle is greater than the speed of the previous cycle, that is, the download speed is increased.
[0068] This embodiment defines how to determine the download speed of the current cycle, and can accurately adjust the speed according to the relationship between the bandwidth threshold and the current bandwidth, thereby accurately controlling the download speed according to the bandwidth and ensuring the stability of the download service.
[0069] As a preferred embodiment, in this embodiment, the download link is limited to include: a time field; the cloud server is limited to, after receiving the download link sent by the client, further including: parsing the time field contained in the download link; if the current moment does not meet the requirements of the time field, determining that the download link is invalid.
[0070] The time field can be a specific time node or a time length. After receiving the download link from the client, the cloud server needs to parse the data in the download link, such as extracting the download speed from the download link; extract the time field in the download link; and determine whether the current time meets the time field requirements. For example, when the client obtains the download link, it does not immediately obtain the relevant resources from the cloud server through the download link. The time field stored in the download link corresponds to 6 o'clock. When the current time exceeds 6 o'clock, the download link will become invalid and the resource can no longer be obtained from the cloud server through the download link. Alternatively, the stored time field is a time period, such as 2 hours. If the download link takes more than 2 hours to download the resource from the cloud server and the relevant resource is still not downloaded, the download link will also become invalid, and a new download link will need to be obtained to download the unfinished resource. However, in order not to affect user use, the duration of the time field is set to a longer time, such as two days, that is, the link remains valid for two days.
[0071] In this embodiment, by setting a time field in the download link, a download link can be kept valid within the time field. If the time field requirement is exceeded, the download link will become invalid. This can effectively prevent the download link from being unused for a long time, but still requiring the configuration of related resources for the download link, thereby avoiding waste of resources and avoiding impact on user usage.
[0072] Based on the above embodiment, the download link is limited to also include: download speed, resource information, and authentication information; the authentication information is used to obtain relevant permissions to enter the cloud server; the resource information is used to find the required resources in the cloud server; the download speed is used to control the rate at which the cloud server sends data to the client.
[0073] Among them, the download speed is the download speed of the current period obtained through the above embodiment. After obtaining the download link, the cloud server will obtain the download speed in the download link and control the rate of sending resource data to the client according to the download speed; the resource information is the resource information that the client needs to download from the cloud server; if the client downloads a video file, the resource information is the content, location, required video clarity and other information of the video file. Only through the resource information can the required resources be found in the cloud server; the authentication information is generally randomly generated by the server, and it is mainly used to determine whether the download link has the authority to access the cloud server; because the download link includes the download speed, the download link has the same period as the download speed.
[0074] Through the above embodiments, the information contained in the download link is limited, and how the cloud server returns the corresponding resources to the client through the information in the download link is limited, ensuring that the cloud server can accurately and quickly transmit relevant resource data to the client.
[0075] Based on the above embodiment, the bandwidth threshold is limited to change over time;
[0076] Set different bandwidth thresholds in different time periods. For example, 9:00 to 18:00 is the peak period for user usage. Therefore, the bandwidth threshold of the cloud server during this period can be set to a higher value. At other times, when user demand decreases, the bandwidth threshold of the cloud server can be set to a lower value. You can also set more time periods and bandwidth thresholds corresponding to multiple time periods. I will not go into details here.
[0077] This embodiment provides a better method for setting the bandwidth threshold, which can dynamically adjust the bandwidth threshold according to whether the current time period is a peak period, thereby ensuring the user experience of using the download service.
[0078] Based on the above embodiment, the bandwidth threshold is limited to change with time as follows: the bandwidth threshold changes with the bandwidth occupied by other services of the cloud service end; wherein, the bandwidth occupied by other services of the cloud service end changes with time.
[0079] Among them, other services of the cloud service end are limited to services other than download services. Other services also correspond to different bandwidths in different time periods. Specifically, as described in the above embodiment, during peak usage periods, the bandwidth occupied by other services is high, and when the number of users is small, the bandwidth occupied is low, so the bandwidth threshold is changed according to the bandwidth occupied by other services; this can solve the problem that when the bandwidth threshold is set only according to time, the bandwidth threshold cannot be adjusted according to the actual number of users, and avoid the situation where the bandwidth occupied by each service is very high when the number of users in the current time period exceeds the original number, but the bandwidth threshold is not adjusted.
[0080] like Figure 3 A diagram illustrating the actual effect of using a download speed control method is provided. The curves in the diagram are: bandwidth threshold 1, bandwidth occupied by other services 3, and bandwidth occupied by the download service 2. The bandwidth occupied by the download service 2 is controlled by the download speed control method. The diagram shows that the bandwidth occupied by other services 3 changes continuously over time, causing the bandwidth threshold 1 to also change continuously. The bandwidth occupied by the download service 2 is concave during a period of time when the bandwidth occupied by other services is at its peak. If the download speed control method is not used, the bandwidth occupied by the download service 2 should also be at its peak. Therefore, the above-mentioned download speed control method can effectively prevent the download service and other services from being in the same peak state, so that the sum of the traffic bandwidth corresponding to the download service and other services is always within the bandwidth threshold range, avoiding exceeding the bandwidth threshold.
[0081] This embodiment stipulates that the bandwidth threshold will change with the bandwidth of other services, thereby setting a more accurate bandwidth threshold, further ensuring the stability of various services provided by the cloud service end, and the above method can prevent the bandwidth occupied by the service from exceeding the bandwidth threshold.
[0082] This application also provides an embodiment of a specific application scenario of a download speed control method, wherein the method is limited to the client, server and cloud server; Figure 4 As shown, the specific steps include: S30: Sending a request to obtain a download link to the server. S31: Responding to the request and requesting bandwidth information from the cloud server. S32: Returning the bandwidth information to the server. S33: Obtaining an adjusted download speed based on the bandwidth information and a negative feedback algorithm. S34: Generating a download link based on the download speed. S35: Returning the download link to the client. S36: Requesting related resources from the cloud server based on the download link. S37: Returning related resources to the client based on the download link.
[0083] The bandwidth situation, i.e., the required bandwidth information, the bandwidth threshold, and the current bandwidth occupied by the download service. Upon receiving a specific download instruction, the client may proceed to step S36, where the client may distribute resources to the resource distribution service of the cloud server. Step S33 may be specifically a speed matching service on the server or cloud server for calculation. How the adjusted download speed is obtained in step S33 can be based on the description of the above embodiment and will not be elaborated on here.
[0084] The specific application scenario of the download speed control method provided in this embodiment shows how the method interacts between the client, server and cloud server in actual application; the embodiment of this application scenario corresponds to the embodiment of the above-mentioned download speed control method and has the same beneficial effects.
[0085] In the above embodiments, the download speed control method is described in detail. This application also provides corresponding embodiments of the download speed control device. It should be noted that this application describes the embodiments of the device from two perspectives: one is based on the functional module perspective, and the other is based on the hardware perspective.
[0086] Based on the functional module perspective, the present application also provides an embodiment corresponding to a download speed control system, which includes: a client, a server, and a cloud server;
[0087] The client is used to send a request to the server to obtain a download link and obtain the download link returned by the server, so as to obtain related resources according to the download speed through the download link;
[0088] The server is used to respond to the request for obtaining a download link sent by the client to obtain the current bandwidth occupied by the download service of the cloud server, thereby obtaining the comparison result between the bandwidth threshold corresponding to the download service and the current bandwidth, and calling the negative feedback algorithm. The comparison result is used as the input of the negative feedback algorithm to adjust the download speed, and the corresponding download link is generated according to the download speed and returned to the client;
[0089] The cloud server is used to return the current bandwidth occupied by the download service to the server, and after receiving the download link from the client, it sends the relevant resources to the client.
[0090] Since the embodiments corresponding to the download speed control system correspond to the embodiments of the method part, the cloud server can also parse the time field contained in the download link after receiving the download link sent by the client. If the current time does not meet the requirements of the time field, it is determined that the download link is invalid.
[0091] The download speed control system provided in this embodiment corresponds to the above method and thus has the same beneficial effects as the above method.
[0092] From a hardware perspective, this embodiment provides an electronic device. Figure 5 This is a structural diagram of an electronic device provided in another embodiment of the present application, such as Figure 5 As shown, the electronic device includes: a memory 20 for storing computer programs;
[0093] The processor 21 is configured to implement the steps of the download speed control method mentioned in the above embodiment when executing the computer program.
[0094] The electronic device provided in this embodiment may include but is not limited to a smart phone, a tablet computer, a laptop computer, or a desktop computer.
[0095] Among them, the processor 21 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 21 can be implemented in at least one hardware form of a digital signal processor (DSP), a field programmable gate array (FPGA), and a programmable logic array (PLA). The processor 21 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a central processing unit (CPU); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 21 may be integrated with a graphics processing unit (GPU), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 21 may also include an artificial intelligence (AI) processor, which is used to process computing operations related to machine learning.
[0096] The memory 20 may include one or more computer-readable storage media, which may be non-transitory. The memory 20 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In this embodiment, the memory 20 is at least used to store the following computer program 201, wherein, after the computer program is loaded and executed by the processor 21, it can implement the relevant steps of the download speed control method disclosed in any of the aforementioned embodiments. In addition, the resources stored in the memory 20 may also include an operating system 202 and data 203, etc., and the storage method may be temporary storage or permanent storage. Among them, the operating system 202 may include Windows, Unix, Linux, etc. The data 203 may include but is not limited to the data contained in the download speed control method, etc.
[0097] In some embodiments, the electronic device may further include a display screen 22 , an input / output interface 23 , a communication interface 24 , a power supply 25 , and a communication bus 26 .
[0098] Those skilled in the art will understand that Figure 5 The structure shown in the figure does not constitute a limitation of the electronic device, and may include more or fewer components than shown in the figure.
[0099] The electronic device provided in an embodiment of the present application includes a memory and a processor. When the processor executes a program stored in the memory, it can implement the following method: a download speed control method.
[0100] The electronic device provided in this embodiment corresponds to the above method and thus has the same beneficial effects as the above method.
[0101] Finally, the present application also provides an embodiment corresponding to a computer-readable storage medium. The computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps described in the above method embodiment (which may be a method corresponding to a client side, a method corresponding to a server side, or a method corresponding to a cloud service side).
[0102] It is understandable that if the method in the above embodiment is implemented in the form of 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 the present application, 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, which is stored in a storage medium and executes all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0103] The computer-readable storage medium provided in this embodiment corresponds to the above-mentioned download speed control method, and thus has the same beneficial effects as the above-mentioned method.
[0104] The download speed control method, system, electronic device and medium provided by the present application are introduced in detail above. The various embodiments in the specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same and similar parts between the various embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part description. It should be pointed out that for ordinary technicians in this technical field, without departing from the principles of this application, several improvements and modifications can be made to the present application, and these improvements and modifications also fall within the scope of protection of the claims of this application.
[0105] It should also be noted that, in this specification, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variants thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or apparatus. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article, or apparatus comprising the element.
Claims
1. A download speed control method, characterized in that: Applied to the server, including: Responding to a request from the client to obtain a download link, obtaining the current bandwidth occupied by the download service of the cloud server; Obtaining a comparison result between the current bandwidth of the download service and a bandwidth threshold; Invoking a negative feedback algorithm, and using the comparison result as input of the negative feedback algorithm to adjust the download speed; Generating a corresponding download link according to the download speed and returning it to the client, so that the client can obtain related resources according to the download speed through the download link; The bandwidth threshold changes with time as follows: the bandwidth threshold changes with the bandwidth occupied by other services of the cloud server; the bandwidth occupied by other services of the cloud server changes with time, and the other services of the cloud server are services other than the download service.
2. The download speed control method according to claim 1, wherein: The negative feedback algorithm is a PID algorithm, and the comparison result is a difference; The obtaining of a comparison result between the current bandwidth of the download service and the bandwidth threshold includes: Obtaining a difference between the current bandwidth of the download service and the bandwidth threshold; The calling of the negative feedback algorithm and using the comparison result as input of the negative feedback algorithm to adjust the download speed includes: Calling the PID algorithm; The difference is used as input to the PID algorithm to adjust the download speed.
3. The download speed control method according to claim 2, wherein: The adjusting the download speed by using the difference as an input of the PID algorithm comprises: Obtaining the acceleration obtained by the difference through the PID algorithm; Get the download speed of the previous cycle; The adjusted download speed is calculated according to the acceleration and the download speed of the previous cycle.
4. The download speed control method according to claim 1, wherein: The download link includes a time field; correspondingly, after receiving the download link sent by the client, the cloud server further includes: Parsing the time field contained in the download link; If the current time does not meet the requirement of the time field, it is determined that the download link is invalid.
5. The download speed control method according to claim 4, characterized in that: The download link includes: the download speed, resource information, and authentication information; The authentication information is used to obtain relevant permissions to access the cloud server; The resource information is used to search for required resources in the cloud service end; The download speed is used to control the rate at which the cloud server sends data to the client.
6. A download speed control system, characterized in that: include: Client, server, cloud server; The client is configured to send a request for obtaining a download link to the server and obtain the download link returned by the server, so as to obtain related resources according to the download speed through the download link; The server is configured to respond to the request for obtaining a download link sent by the client, obtain the current bandwidth occupied by the download service of the cloud server, thereby obtaining a comparison result between the current bandwidth of the download service and a bandwidth threshold, and invoke a negative feedback algorithm, using the comparison result as input to the negative feedback algorithm to adjust the download speed, generate a corresponding download link based on the download speed, and return the result to the client; The cloud server is configured to return the current bandwidth occupied by the download service to the server, and after receiving the download link from the client, send the relevant resources to the client; The bandwidth threshold changes with time as follows: the bandwidth threshold changes with the bandwidth occupied by other services of the cloud server; the bandwidth occupied by other services of the cloud server changes with time, and the other services of the cloud server are services other than the download service.
7. An electronic device, characterized in that: including a memory for storing a computer program; A processor, configured to implement the steps of the download speed control method according to any one of claims 1 to 5 when executing the computer program.
8. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the download speed control method according to any one of claims 1 to 5 are implemented.
Citation Information
Patent Citations
Method and equipment for adjusting downloading speed of P2P (peer-to-peer) download task
CN102137160A
Method, device and system for controlling data downloading
CN110278232A