A cloud storage quota throttled download method and apparatus
By setting data volume and transmission rate thresholds in the cloud storage system, adjusting the download speed in real time, and using a token bucket overdraft mechanism, the problem of user bandwidth contention was solved, improving system stability and user experience.
Patent Information
- Application Number
- CN202311797715.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-25
- Publication Date
- 2025-12-05
- Estimated Expiration
- 2043-12-25
AI Technical Summary
The lack of effective mechanisms in existing cloud storage systems to limit user bandwidth usage leads to resource contention and network congestion, affecting user experience and system stability.
After receiving a download request, the system obtains preset data volume thresholds and transmission rate thresholds, calculates download time thresholds, and adjusts data read and write speeds in real time to control the user's download rate. A token bucket mechanism is used to allow overdrafts to optimize request processing.
It effectively controls user download speeds, avoids resource contention, improves system stability and user experience, prevents system crashes, and optimizes request processing efficiency.
Smart Images

Figure CN117896371B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of traffic control technology, and in particular to a method and apparatus for limiting download speed using cloud storage quotas. Background Technology
[0002] With the continuous development of cloud computing, users can store and manage digital files on the internet. Through cloud storage, users can upload personal or corporate files to remote servers and then access and share these files anytime, anywhere via the internet. Cloud storage provides a convenient, secure, and reliable file storage and management solution, allowing users to access, edit, and download their files via computers, mobile phones, or other devices.
[0003] However, without user quotas and bandwidth limits, users might download excessive amounts of resources, leading to resource waste. This is especially true for popular resources, which are easily downloaded in large quantities, preventing other users from accessing them promptly. Furthermore, some users might abuse resources by excessively downloading, consuming bandwidth and preventing other users from accessing or downloading resources normally, thus reducing service fairness. If a large number of users perform high-frequency downloads simultaneously, it can cause network congestion, impacting the network experience of other users. Unrestricted downloads could also provide opportunities for malicious users to exploit this vulnerability for large-scale malicious downloads, thereby harming the system or abusing resources. Moreover, unlimited downloads would impose higher costs on cloud storage providers, such as increased bandwidth fees and increased pressure on server maintenance. Therefore, limiting users' download speed and frequency can balance resource allocation and maintain network stability and fairness.
[0004] In existing technologies, static bandwidth allocation is typically used: unified rate limiting is implemented through the Nginx gateway. Nginx is a high-performance HTTP and reverse proxy web server that provides rate limiting configuration to restrict the speed of user requests. However, it cannot target specific users; its rate limiting scheme is based on a single request. Users can initiate multiple requests to transfer files simultaneously, meaning network resource consumption issues still exist. Modifying the rate limiting configuration requires manually modifying the nginx configuration file. Modifying the nginx.conf configuration file carries risks; if Nginx is deployed in a cluster, the configuration file needs to be modified on each nginx server, which is time-consuming and labor-intensive.
[0005] Therefore, the current system lacks an effective mechanism to limit user bandwidth usage, or only limits speed on a single terminal. This leads to some users potentially consuming excessive bandwidth resources during periods of high traffic, impacting the service quality for other users. Furthermore, this phenomenon can cause service instability or even interruption, severely damaging the user experience. Simultaneously, limiting the number of download tasks for a single user through the client-side approach is ineffective in limiting the number of download tasks across all clients. In other words, a user can simultaneously launch multiple clients, performing numerous download tasks, bypassing the limitations of the download task management module and bandwidth management module, consuming significant system resources. This not only may lead to system performance degradation but may also adversely affect the usage of other users. Summary of the Invention
[0006] The technical problem to be solved by the present invention is to provide a method and apparatus for limiting download speed based on cloud storage quotas, so as to solve the problem of random bandwidth contention in existing cloud storage systems.
[0007] To solve the above-mentioned technical problems, the technical solution adopted by the present invention is as follows:
[0008] A method for limiting download speed using cloud storage quotas includes:
[0009] Receive download requests and perform data read / write operations based on the download requests;
[0010] Obtain the preset data volume threshold and transmission rate threshold, and calculate the download time threshold based on the data volume threshold and transmission rate threshold;
[0011] The current data read / write volume is obtained in real time, and it is determined whether the current data read / write volume has reached the data volume threshold. If so, the data read / write duration is obtained.
[0012] Determine whether the data read / write duration is less than the download time threshold. If so, stop data read / write until the download time threshold is reached, and then resume data read / write.
[0013] If not, the current data read / write volume will be adjusted to the data volume threshold before data read / write is performed again.
[0014] To solve the above-mentioned technical problems, another technical solution adopted by the present invention is as follows:
[0015] A cloud storage quota-based download speed limiting device includes a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, it performs the following steps:
[0016] Receive download requests and perform data read / write operations based on the download requests;
[0017] Obtain the preset data volume threshold and transmission rate threshold, and calculate the download time threshold based on the data volume threshold and transmission rate threshold;
[0018] The current data read / write volume is obtained in real time, and it is determined whether the current data read / write volume has reached the data volume threshold. If so, the data read / write duration is obtained.
[0019] Determine whether the data read / write duration is less than the download time threshold. If so, stop data read / write until the download time threshold is reached, and then resume data read / write.
[0020] If not, the current data read / write volume will be adjusted to the data volume threshold before data read / write is performed again.
[0021] The beneficial effects of this invention are as follows: After receiving a download request, a preset data volume threshold and a transmission rate threshold are obtained, and a download time threshold is calculated based on the data volume threshold and the transmission rate threshold. Since the transmission rate threshold is a fixed value, the transmission rate that each user can use is fixed, thereby avoiding the problem of resource contention between different users. At the same time, by comparing the current data read / write time with the corresponding download time threshold, when the data read / write speed is too fast, the data read / write is stopped, which prolongs the time for the next data read / write. When the data read / write speed is too slow, the current data read / write volume is adjusted to the data volume threshold, which speeds up the time for the next data read / write. This achieves real-time adjustment of the current data read / write speed, improving the user experience while avoiding users consuming extra resources. Attached Figure Description
[0022] Figure 1 This is a flowchart illustrating the steps of a cloud storage quota-based download speed limiting method in an embodiment of the present invention.
[0023] Figure 2 This is a system flowchart of a cloud storage quota-based download speed limiting method according to an embodiment of the present invention;
[0024] Figure 3 This is a schematic diagram of a cloud storage quota-limited download device according to an embodiment of the present invention. Detailed Implementation
[0025] To explain in detail the technical content, objectives, and effects of the present invention, the following description is provided in conjunction with the embodiments and accompanying drawings.
[0026] Please refer to Figure 1 A method for limiting download speed using cloud storage quotas, comprising:
[0027] Receive download requests and perform data read / write operations based on the download requests;
[0028] Obtain the preset data volume threshold and transmission rate threshold, and calculate the download time threshold based on the data volume threshold and transmission rate threshold;
[0029] The current data read / write volume is obtained in real time, and it is determined whether the current data read / write volume has reached the data volume threshold. If so, the data read / write duration is obtained.
[0030] Determine whether the data read / write duration is less than the download time threshold. If so, stop data read / write until the download time threshold is reached, and then resume data read / write.
[0031] If not, the current data read / write volume will be adjusted to the data volume threshold before data read / write is performed again.
[0032] As described above, the beneficial effects of this invention are as follows: After receiving a download request, a preset data volume threshold and a transmission rate threshold are obtained, and a download time threshold is calculated based on the data volume threshold and the transmission rate threshold. Since the transmission rate threshold is a fixed value, the transmission rate that each user can use is fixed, thereby avoiding the problem of resource contention between different users. At the same time, by comparing the current data read / write time with the corresponding download time threshold, when the data read / write speed is too fast, data read / write is stopped, which prolongs the time for the next data read / write. When the data read / write speed is too slow, the current data read / write volume is adjusted to the data volume threshold, which speeds up the time for the next data read / write. This achieves real-time adjustment of the current data read / write speed, improving the user experience while preventing users from consuming additional resources.
[0033] Further, the calculation of the download time threshold based on the data volume threshold and the transmission rate threshold includes:
[0034] Obtain the number of tasks contained in the download request;
[0035] The average download speed of a task is obtained based on the number of tasks and the transmission rate threshold.
[0036] The download time threshold for each task is obtained based on the average download rate and the data volume threshold.
[0037] As described above, the average download rate of a task is obtained based on the number of tasks contained in the download request and the transmission rate threshold. By allocating a corresponding maximum download rate to each task, each task can be processed simultaneously.
[0038] Furthermore, it also includes:
[0039] The system continuously checks whether the number of tasks has decreased; if so, it updates the number of tasks.
[0040] The download time threshold is updated based on the updated number of tasks.
[0041] As described above, when the number of tasks decreases due to events such as task completion, task cancellation, or task interruption, the maximum download rate of each task can be adjusted in real time based on the updated download time threshold by obtaining the current number of tasks and updating the corresponding download time threshold for each task, thereby improving task processing efficiency.
[0042] Furthermore, the step of receiving a download request and performing data read / write operations based on the download request also includes:
[0043] Get the current number of tokens in the token bucket;
[0044] Determine whether the number of tokens required for the download request is greater than the number of tokens. If so, determine whether the download request meets the token overdraft condition. If it does, the download request will be executed.
[0045] As described above, when receiving a download request, if the number of tokens required for the current download request is greater than the number of tokens in the token bucket, the download request that meets the token overdraft condition will be executed by overdrafting tokens. This can effectively solve the problem of rate limiting caused by insufficient tokens and improve the efficiency of the system in processing requests.
[0046] Furthermore, determining whether the download request meets the token overdraft conditions also includes:
[0047] If not, the download request will be executed only after the required number of tokens equals the number of tokens; or the download request will be executed only after the download request meets the token overdraft condition.
[0048] As described above, when a download request does not currently meet the token overdraft conditions, the download request can be executed only after the token quantity is restored or the token overdraft conditions are met, which can improve the efficiency of the system in processing requests.
[0049] Another embodiment of the present invention provides a cloud storage quota-based download speed limiting device, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, it performs the following steps:
[0050] Receive download requests and perform data read / write operations based on the download requests;
[0051] Obtain the preset data volume threshold and transmission rate threshold, and calculate the download time threshold based on the data volume threshold and transmission rate threshold;
[0052] The current data read / write volume is obtained in real time, and it is determined whether the current data read / write volume has reached the data volume threshold. If so, the data read / write duration is obtained.
[0053] Determine whether the data read / write duration is less than the download time threshold. If so, stop data read / write until the download time threshold is reached, and then resume data read / write.
[0054] If not, the current data read / write volume will be adjusted to the data volume threshold before data read / write is performed again.
[0055] As described above, after receiving a download request, a preset data volume threshold and transmission rate threshold are obtained, and a download time threshold is calculated based on these thresholds. Since the transmission rate threshold is a fixed value, the transmission rate available to each user is fixed, thus avoiding resource contention between different users. Simultaneously, by comparing the current data read / write time with the corresponding download time threshold, data read / write is stopped when the speed is too fast, extending the time for the next read / write operation. Conversely, when the speed is too slow, the current data read / write volume is adjusted to the data volume threshold, accelerating the time for the next read / write operation. This achieves real-time adjustment of the current data read / write speed, improving user experience while preventing users from consuming additional resources.
[0056] Further, the calculation of the download time threshold based on the data volume threshold and the transmission rate threshold includes:
[0057] Obtain the number of tasks contained in the download request;
[0058] The average download speed of a task is obtained based on the number of tasks and the transmission rate threshold.
[0059] The download time threshold for each task is obtained based on the average download rate and the data volume threshold.
[0060] As described above, the average download rate of a task is obtained based on the number of tasks contained in the download request and the transmission rate threshold. By allocating a corresponding maximum download rate to each task, each task can be processed simultaneously.
[0061] Furthermore, it also includes:
[0062] The system continuously checks whether the number of tasks has decreased; if so, it updates the number of tasks.
[0063] The download time threshold is updated based on the updated number of tasks.
[0064] As described above, when the number of tasks decreases due to events such as task completion, task cancellation, or task interruption, the maximum download rate of each task can be adjusted in real time based on the updated download time threshold by obtaining the current number of tasks and updating the corresponding download time threshold for each task, thereby improving task processing efficiency.
[0065] Furthermore, the step of receiving a download request and performing data read / write operations based on the download request also includes:
[0066] Get the current number of tokens in the token bucket;
[0067] Determine whether the number of tokens required for the download request is greater than the number of tokens. If so, determine whether the download request meets the token overdraft condition. If it does, the download request will be executed.
[0068] As described above, when receiving a download request, if the number of tokens required for the current download request is greater than the number of tokens in the token bucket, the download request that meets the token overdraft condition will be executed by overdrafting tokens. This can effectively solve the problem of rate limiting caused by insufficient tokens and improve the efficiency of the system in processing requests.
[0069] Furthermore, determining whether the download request meets the token overdraft conditions also includes:
[0070] If not, the download request will be executed only after the required number of tokens equals the number of tokens; or the download request will be executed only after the download request meets the token overdraft condition.
[0071] As described above, when a download request does not currently meet the token overdraft conditions, the download request can be executed only after the token quantity is restored or the token overdraft conditions are met, thereby improving the system's efficiency in processing requests.
[0072] The cloud storage quota-based download speed limiting method and apparatus provided by this invention can be applied to scenarios such as cloud storage resource allocation, effectively controlling the number of user download tasks and preventing excessive occupation of system resources. The following detailed embodiments illustrate this:
[0073] Example 1
[0074] Please refer to Figure 1 as well as Figure 2 A method for limiting download speed using cloud storage quotas, comprising:
[0075] S1. Receive a download request and perform data reading and writing according to the download request;
[0076] S2. Obtain preset data volume thresholds and transmission rate thresholds, and calculate the download time threshold based on the data volume thresholds and transmission rate thresholds; for example, define a data block (chunk) in bytes, the size of which is the data volume threshold, and define a maximum allowed rate (maxRate) in KB / s, which is the transmission rate threshold; wherein, the download time threshold is adjusted according to the number of tasks contained in the download request, and the specific steps are as follows:
[0077] S21. Obtain the number of tasks contained in the download request;
[0078] S22. Obtain the average download rate of the task based on the number of tasks and the transmission rate threshold; if the number of tasks is represented by n and the average download rate of the task is represented by bytesWillBeSentOrReceive-chunkSize, then bytesWillBeSentOrReceive-chunkSize = maxRate / n.
[0079] S23. Obtain the download time threshold for each task based on the average download rate and data volume threshold. Specifically: based on the data block size and average download rate defined in the above steps, the time required to process a byte stream of one data block size can be obtained, i.e., the download time threshold is obtained, denoted by timeCostPerChunk. At the same time, it is necessary to determine in real time whether the number of tasks decreases or increases. If so, the number of tasks is updated. If a task is completed, canceled, or interrupted, the current number of tasks is updated to n-1, and the download time threshold is updated according to the updated number of tasks. Similarly, when the number of tasks increases, the number of tasks and the download time threshold are updated.
[0080] S3. Real-time acquisition of current data read / write volume, and determination of whether the current data read / write volume has reached the data volume threshold. If so, acquisition of data read / write duration; for example, when reading / writing bytes during task execution, acquisition of the number of bytes already read / written as the current data read / write volume (bytesWillBeSentOrReceive); when the current data read / write volume reaches the size of one of the above data blocks, the time consumed during the check is the acquisition of the data read / write duration (nowNanoTime-lastPieceSentOrReceiveTick);
[0081] S4. Determine whether the data read / write time is less than the download time threshold. If yes, proceed to S5; otherwise, proceed to S6.
[0082] S5. Stop data reading and writing until the download time threshold is reached and then perform data reading and writing again; that is, when the data reading and writing duration is less than the download time threshold, it means that the time consumed during this period is less than the download time threshold, indicating that the current transmission rate has exceeded the task average download rate. Therefore, the task is put into sleep by stopping data reading and writing to limit traffic.
[0083] S6. If not, adjust the current data reading and writing amount to the data amount threshold and then perform data reading and writing again; that is, when the data reading and writing duration is greater than the download time threshold, it indicates that the current transmission rate has not reached the task average download rate. Then let bytesWillBeSentOrReceive = bytesWillBeSentOrReceive - chunkSize (that is, the current data reading and writing amount = the task average download rate); at the same time, when the task sleep is completed, the rate of the next data reading and writing is also adjusted in the above way, and the rate of the current data reading and writing is monitored in real time during the subsequent data reading and writing process and adjusted.
[0084] Embodiment 2
[0085] The difference between this embodiment and Embodiment 1 is that the way of executing download requests is controlled by adjusting the token distribution method; in the prior art, the token bucket usually generates tokens at a stable speed, such as a token bucket that generates r tokens per second; if each request arrives and needs to consume n tokens, and the remaining number of tokens in the token bucket at this time is m; when the next request arrives at time t0, if m < n, this request needs to wait (n - m) / r seconds before it can be processed; and when m > n, this request will be directly released. Suppose 6 requests arrive simultaneously at time t1 when the number of tokens m in the token bucket is 5*n + 1; at this time, 5 of the 6 requests will be directly released without order, and the remaining one request needs to wait (n - 1) / r seconds before it can be processed, that is, causing burst tolerance. Therefore, only when the number of tokens m in the token bucket is consumed to a certain level, that is, m ∈ [0, n), can flow control be implemented for future requests, and the traffic state at this time is defined as the "average traffic level". If there are no remaining tokens in the token bucket, that is, m = 0, each request that consumes n tokens needs to wait n / r seconds for token production, that is, the "average traffic level" is: r / n, unit: QPS requests / second; thus, the waiting time of requests is affected by the token production efficiency, and then the QPS of traffic is affected.
[0086] However, for a token bucket with r=1, if at a certain moment there are only 5 tokens in the bucket, and a request arrives that requires 100 tokens, then the request must wait 95 seconds before it can be executed. Even if the system is currently idle, it cannot process this request, leading to a situation where the system faces the dilemma of concurrent execution with subsequent requests after 95 seconds, reducing the system's request processing efficiency. In this embodiment, requests are allowed to "overdraft" when requesting tokens. Regardless of how many tokens are currently available, the request will be allowed to proceed, and the time waiting for the token bucket to generate enough tokens will be borne by subsequent requests.
[0087] To address the above issues, this embodiment provides a token allocation method, specifically:
[0088] When performing step S1 in Embodiment 1, the method further includes:
[0089] S11. Get the current number of tokens in the token bucket;
[0090] S12. Determine whether the number of tokens required for the download request is greater than the number of tokens. If yes, proceed to S13; otherwise, proceed to S14.
[0091] S13. Determine whether the download request meets the token overdraft condition. If it does, the download request will be executed. That is, when the token overdraft condition is met, the request is allowed to "overdraft" when applying for tokens, regardless of how many tokens are left in the token bucket. The number of tokens allowed to be overdrafted and the number of consecutive overdrafts can be set. When the download request meets the allowed number of tokens and the number of consecutive overdrafts, the overdraft operation is executed. The time for the token bucket to generate enough tokens is borne by subsequent requests. For a request, assuming the number of tokens overdrafted by the previous request is c, the waiting time for the current request satisfies the formula: WaitTime = c / r. At the same time, when the token bucket is idle, tokens can be replenished through the resync method.
[0092] S14. The download request is executed once the required number of tokens equals the number of tokens; or the download request is executed once the token overdraft condition is met. Simultaneously, the user's operation behavior is recorded during the download process, so that the user's operation behavior can be queried through the background records later, preventing the records from being tampered with and avoiding data leakage.
[0093] Example 3
[0094] Please refer to Figure 3A cloud storage quota-based download speed limiting device includes a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, it performs the following steps:
[0095] S1. Receive a download request and perform data reading and writing according to the download request, specifically:
[0096] S11. Get the current number of tokens in the token bucket;
[0097] S12. Determine whether the number of tokens required for the download request is greater than the number of tokens. If yes, proceed to S13; otherwise, proceed to S14.
[0098] S13. Determine whether the download request meets the token overdraft conditions. If it does, the download request will be executed.
[0099] S14. Execute the download request after the required number of tokens equals the number of tokens; or execute the download request after the download request meets the token overdraft condition.
[0100] S2. Obtain the preset data volume threshold and transmission rate threshold, and calculate the download time threshold based on the data volume threshold and transmission rate threshold. Specifically:
[0101] S21. Obtain the number of tasks contained in the download request;
[0102] S22. Obtain the average download speed of the task based on the number of tasks and the transmission rate threshold.
[0103] S23. Obtain the download time threshold for each task based on the average download rate and data volume threshold of the task; simultaneously, determine in real time whether the number of tasks has decreased or increased, and if so, update the number of tasks; update the download time threshold based on the updated number of tasks.
[0104] S3. Obtain the current data read / write volume in real time, and determine whether the current data read / write volume has reached the data volume threshold. If so, obtain the data read / write duration.
[0105] S4. Determine whether the data read / write time is less than the download time threshold. If yes, proceed to S5; otherwise, proceed to S6.
[0106] S5. Stop data reading and writing until the download time threshold is reached, then resume data reading and writing.
[0107] S6. Then, adjust the current data read / write volume to the data volume threshold and perform data read / write again.
[0108] In summary, the cloud storage quota-based download speed limiting method and apparatus provided by this invention obtains a preset data volume threshold and transmission rate threshold after receiving a download request, and calculates a download time threshold based on the data volume threshold and transmission rate threshold. Since the transmission rate threshold is a fixed value, that is, the transmission rate that each user can use is fixed, effectively controlling the download rate of an individual user can prevent excessive occupation of system resources, avoid resource contention between different users, and prevent the system from crashing due to resource exhaustion, thereby improving the stability and reliability of the system. At the same time, by comparing the current data read / write time with the corresponding download time threshold, when the data read / write speed is too fast, data read / write is stopped, thus extending the time for the next data read / write. Conversely, when the data read / write speed is too slow, the current data read / write volume is adjusted to the data volume threshold, thus speeding up the time for the next data read / write. This achieves real-time adjustment of the current data read / write speed, improving the user experience while preventing users from consuming extra resources.
[0109] The above description is merely an embodiment of the present invention and does not limit the patent scope of the present invention. Any equivalent modifications made based on the content of the present invention specification and drawings, or direct or indirect applications in related technical fields, are similarly included within the patent protection scope of the present invention.
Claims
1. A method for limiting download speed using cloud storage quotas, characterized in that, include: Receive download requests and perform data read / write operations based on the download requests; Obtain the preset data volume threshold and transmission rate threshold, and calculate the download time threshold based on the data volume threshold and transmission rate threshold; The current data read / write volume is obtained in real time, and it is determined whether the current data read / write volume has reached the data volume threshold. If so, the data read / write duration is obtained. Determine whether the data read / write duration is less than the download time threshold. If so, stop data read / write until the download time threshold is reached, and then resume data read / write. If not, adjust the current data read / write volume to the data volume threshold and then perform data read / write again; The calculation of the download time threshold based on the data volume threshold and the transmission rate threshold includes: Obtain the number of tasks contained in the download request; The average download speed of a task is obtained based on the number of tasks and the transmission rate threshold. The download time threshold for each task is obtained based on the average download rate and the data volume threshold of the task. Also includes: The system continuously checks whether the number of tasks has decreased; if so, it updates the number of tasks. The download time threshold is updated based on the updated number of tasks.
2. The cloud storage quota-based download speed limiting method according to claim 1, characterized in that, The step of receiving a download request and performing data reading and writing based on the download request further includes: Get the current number of tokens in the token bucket; Determine whether the number of tokens required for the download request is greater than the number of tokens. If so, determine whether the download request meets the token overdraft condition. If it does, the download request will be executed.
3. The cloud storage quota-based download speed limiting method according to claim 2, characterized in that, The step of determining whether the download request meets the token overdraft conditions also includes: If not, the download request will be executed only after the required number of tokens equals the number of tokens. Alternatively, the download request may be executed only after it meets the token overdraft conditions.
4. A cloud storage quota-based download speed limiting device, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, When the processor executes the computer program, it performs the following steps: Receive download requests and perform data read / write operations based on the download requests; Obtain the preset data volume threshold and transmission rate threshold, and calculate the download time threshold based on the data volume threshold and transmission rate threshold; The current data read / write volume is obtained in real time, and it is determined whether the current data read / write volume has reached the data volume threshold. If so, the data read / write duration is obtained. Determine whether the data read / write duration is less than the download time threshold. If so, stop data read / write until the download time threshold is reached, and then resume data read / write. If not, adjust the current data read / write volume to the data volume threshold and then perform data read / write again; The calculation of the download time threshold based on the data volume threshold and the transmission rate threshold includes: Obtain the number of tasks contained in the download request; The average download speed of a task is obtained based on the number of tasks and the transmission rate threshold. The download time threshold for each task is obtained based on the average download rate and the data volume threshold of the task. Also includes: The system continuously checks whether the number of tasks has decreased; if so, it updates the number of tasks. The download time threshold is updated based on the updated number of tasks.
5. A cloud storage quota-based download speed limiting device according to claim 4, characterized in that, The step of receiving a download request and performing data reading and writing based on the download request further includes: Get the current number of tokens in the token bucket; Determine whether the number of tokens required for the download request is greater than the number of tokens. If so, determine whether the download request meets the token overdraft condition. If it does, the download request will be executed.
6. The cloud storage quota-based download speed limiting device according to claim 5, characterized in that, The step of determining whether the download request meets the token overdraft conditions also includes: If not, the download request will be executed only after the required number of tokens equals the number of tokens. Alternatively, the download request may be executed only after it meets the token overdraft conditions.
Citation Information
Patent Citations
Bandwidth management method
CN103490930A
Distributed downloading system of Internet crawlers
CN105991699A