CN117896371A - Cloud storage quota speed limit downloading method and device - Google Patents

Cloud storage quota speed limit downloading method and device Download PDF

Info

Publication number
CN117896371A
CN117896371A CN202311797715.XA CN202311797715A CN117896371A CN 117896371 A CN117896371 A CN 117896371A CN 202311797715 A CN202311797715 A CN 202311797715A CN 117896371 A CN117896371 A CN 117896371A
Authority
CN
China
Prior art keywords
downloading
write
threshold
data read
data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311797715.XA
Other languages
Chinese (zh)
Inventor
张辉
林纲
姚振兴
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Fujian Centerm Information Co Ltd
Original Assignee
Fujian Centerm Information Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fujian Centerm Information Co Ltd filed Critical Fujian Centerm Information Co Ltd
Priority to CN202311797715.XA priority Critical patent/CN117896371A/en
Publication of CN117896371A publication Critical patent/CN117896371A/en
Pending legal-status Critical Current

Links

Landscapes

  • Information Transfer Between Computers (AREA)

Abstract

The invention discloses a cloud storage quota speed limit downloading method and device, comprising the following steps: receiving a downloading request, and reading and writing data according to the downloading request; acquiring a preset data quantity threshold and a transmission rate threshold, and calculating a downloading time threshold according to the data quantity threshold and the transmission rate threshold; acquiring current data read-write quantity in real time, judging whether the current data read-write quantity reaches a data quantity threshold value, and if so, acquiring data read-write time length; judging whether the data read-write time length is smaller than a downloading time threshold value, if so, stopping data read-write until the downloading time threshold value is reached, and executing data read-write again; if not, the current data read-write quantity is adjusted to the data quantity threshold value, and then the data read-write is executed again. Because the transmission rate threshold is a fixed value and the transmission rate which can be used by each user is fixed, the problem of resource preemption among different users is avoided; meanwhile, the speed of current data reading and writing is adjusted in real time, so that the user experience is improved, and meanwhile, the user is prevented from occupying extra resources.

Description

Cloud storage quota speed limit downloading method and device
Technical Field
The invention relates to the technical field of flow control, in particular to a cloud storage quota speed limit downloading method and device.
Background
With the continuous development of cloud computing, users can store and manage digitized files on the internet. Personal or enterprise files can be uploaded to a remote server by a cloud disk user, and then accessed and shared anytime and anywhere through the internet. The cloud disk provides a convenient, safe and reliable file storage and management solution, and a user can access, edit and download own files through a computer, a mobile phone or other devices.
However, without quota and bandwidth limiting downloads to the user, the user may download resources in large amounts, resulting in wasted resources. Particularly for hot resources, the resources are easily downloaded in large quantities, and other users may not be able to acquire the resources in time. Meanwhile, some users may misuse resources, and occupy bandwidth through a large amount of downloading, so that other users cannot normally access or download the resources, and the fairness of the service is reduced. If a large number of users perform high-frequency downloading operation in the same time period, network congestion may be caused, and network experience of other users is affected. Unlimited downloads may provide convenience to malicious users who can exploit this vulnerability to make large-scale malicious downloads, thereby jeopardizing the system or misusing resources. And, unlimited downloads can bring higher costs to cloud storage providers, such as increased traffic bandwidth costs, and pressure on server operation and maintenance. Therefore, limiting the download speed and download times of the user can balance the allocation of resources, and maintain the stability and fairness of the network.
In the prior art, a static bandwidth allocation mode is generally adopted: and carrying out unified speed limiting through the Nginx gateway. Nginx is a high-performance HTTP and reverse proxy web server that provides a functional configuration of limiting speed and speed limits to achieve speed limits on user requests. But it cannot be aimed at a specified user, the speed limiting scheme provided by the method is a single request, and the user can transmit files simultaneously by initiating a plurality of requests, i.e. the problem of network resource occupation still exists. If the speed limit configuration needs to be modified, the nginx configuration file needs to be manually modified. However, modifying the nginx.conf configuration file has a risk, and if the nginx adopts cluster deployment, the configuration file of each nginx server needs to be modified, which is time-consuming and labor-consuming.
Current systems therefore have no efficient mechanism to limit the bandwidth usage of the user, or speed limitation by a single terminal only, resulting in that during high traffic, some users may occupy too much bandwidth resources, affecting the quality of service of other users. And this phenomenon may cause instability or even interruption of the service, seriously impairing the user experience. Meanwhile, the number of downloading tasks of a single user is limited by a client, and the number of downloading tasks of all clients cannot be limited effectively. That is, a user can start a plurality of clients at the same time to perform a large number of download tasks, and bypass the limitation of the download task management module and the bandwidth management module, thereby consuming a large amount of system resources. This may not only lead to reduced performance of the system, but may also adversely affect the use by other users.
Disclosure of Invention
The technical problems to be solved by the invention are as follows: the method and the device for downloading the cloud storage quota speed limit are provided to solve the problem of random preemption of bandwidth in the existing cloud storage system.
In order to solve the technical problems, the invention adopts the following technical scheme:
a cloud storage quota speed limit downloading method comprises the following steps:
receiving a downloading request, and reading and writing data according to the downloading request;
acquiring a preset data volume threshold and a transmission rate threshold, and calculating a downloading time threshold according to the data volume threshold and the transmission rate threshold;
acquiring current data read-write quantity in real time, judging whether the current data read-write quantity reaches the data quantity threshold value, and if so, acquiring data read-write time length;
judging whether the data read-write time length is smaller than the downloading time threshold value, if so, stopping data read-write until the downloading time threshold value is reached, and executing data read-write again;
if not, the current data read-write quantity is adjusted to the data quantity threshold value, and then the data read-write is executed again.
In order to solve the technical problems, the invention adopts another technical scheme that:
the cloud storage quota speed limit downloading device comprises a memory, a processor and a computer program which is stored in the memory and can be run on the processor, wherein the processor realizes the following steps when executing the computer program:
receiving a downloading request, and reading and writing data according to the downloading request;
acquiring a preset data volume threshold and a transmission rate threshold, and calculating a downloading time threshold according to the data volume threshold and the transmission rate threshold;
acquiring current data read-write quantity in real time, judging whether the current data read-write quantity reaches the data quantity threshold value, and if so, acquiring data read-write time length;
judging whether the data read-write time length is smaller than the downloading time threshold value, if so, stopping data read-write until the downloading time threshold value is reached, and executing data read-write again;
if not, the current data read-write quantity is adjusted to the data quantity threshold value, and then the data read-write is executed again.
The invention has the beneficial effects that: acquiring a preset data quantity threshold and a preset transmission rate threshold after receiving a downloading request, and calculating to obtain a downloading time threshold according to the data quantity threshold and the transmission rate threshold, wherein the transmission rate threshold is a fixed value, namely the transmission rate which can be used by each user is fixed, so that the problem of resource preemption among different users is avoided; meanwhile, the current data reading and writing time is compared with the corresponding downloading time threshold, when the data reading and writing speed is too high, the data reading and writing is stopped, namely the time of the next data reading and writing is prolonged, and when the data reading and writing speed is too low, the current data reading and writing quantity is adjusted to the data quantity threshold, namely the time of the next data reading and writing is quickened, the current data reading and writing speed is adjusted in real time, the user experience is improved, and meanwhile, the user is prevented from occupying extra resources.
Drawings
FIG. 1 is a flow chart of steps of a method for downloading a cloud storage quota speed limit in an embodiment of the invention;
FIG. 2 is a system flow chart of a cloud storage quota speed limit downloading method in an embodiment of the invention;
fig. 3 is a schematic structural diagram of a cloud storage quota speed limit downloading device in an embodiment of the invention.
Detailed Description
In order to describe the technical contents, the achieved objects and effects of the present invention in detail, the following description will be made with reference to the embodiments in conjunction with the accompanying drawings.
Referring to fig. 1, a cloud storage quota speed limit downloading method includes:
receiving a downloading request, and reading and writing data according to the downloading request;
acquiring a preset data volume threshold and a transmission rate threshold, and calculating a downloading time threshold according to the data volume threshold and the transmission rate threshold;
acquiring current data read-write quantity in real time, judging whether the current data read-write quantity reaches the data quantity threshold value, and if so, acquiring data read-write time length;
judging whether the data read-write time length is smaller than the downloading time threshold value, if so, stopping data read-write until the downloading time threshold value is reached, and executing data read-write again;
if not, the current data read-write quantity is adjusted to the data quantity threshold value, and then the data read-write is executed again.
From the above description, the beneficial effects of the invention are as follows: acquiring a preset data quantity threshold and a preset transmission rate threshold after receiving a downloading request, and calculating to obtain a downloading time threshold according to the data quantity threshold and the transmission rate threshold, wherein the transmission rate threshold is a fixed value, namely the transmission rate which can be used by each user is fixed, so that the problem of resource preemption among different users is avoided; meanwhile, the current data reading and writing time is compared with the corresponding downloading time threshold, when the data reading and writing speed is too high, the data reading and writing is stopped, namely the time of the next data reading and writing is prolonged, and when the data reading and writing speed is too low, the current data reading and writing quantity is adjusted to the data quantity threshold, namely the time of the next data reading and writing is quickened, the current data reading and writing speed is adjusted in real time, the user experience is improved, and meanwhile, the user is prevented from occupying extra resources.
Further, the calculating the downloading time threshold according to the data volume threshold and the transmission rate threshold includes:
acquiring the number of tasks contained in the downloading request;
obtaining the average download rate of the tasks according to the number of the tasks and the transmission rate threshold;
and obtaining the downloading time threshold of each task according to the average downloading rate of the tasks and the data quantity threshold.
As can be seen from the above description, the average download rate of the tasks is obtained according to the number of tasks and the transmission rate threshold value included in the download request, and each task can be processed simultaneously by allocating a corresponding maximum download rate to each task.
Further, the method further comprises the following steps:
judging whether the number of the tasks is reduced in real time, if so, updating the number of the tasks;
and updating the downloading time threshold according to the updated task number.
According to the description, when the number of tasks is reduced due to the conditions of completion of task downloading, cancellation of tasks, interruption of tasks and the like, the maximum downloading rate of each task can be adjusted in real time according to the updated downloading time threshold value by acquiring the current number of tasks in real time and updating the corresponding downloading time threshold value of each task, so that the task processing efficiency is improved.
Further, the receiving the download request, and performing data reading and writing according to the download request further includes:
obtaining the number of tokens of a current token bucket;
judging whether the number of tokens required by the downloading request is larger than the number of tokens, if yes, judging whether the downloading request meets the token overdraft condition, and if yes, executing the downloading request.
As can be seen from the above description, when receiving the download request, if the number of tokens required by the current download request is greater than the number of tokens in the token bucket, the download request meeting the overdraft condition of the tokens is executed by overdraft tokens, which can effectively solve the problem of current limitation caused by insufficient number of tokens and improve the efficiency of processing the request by the system.
Further, the determining whether the download request meets the token overdraft condition further includes:
if not, executing the downloading request until the number of tokens is equal to the number of tokens; or executing the downloading request until the downloading request meets the token overdraft condition.
From the above description, when the download request does not meet the token overdraft condition currently, the efficiency of processing the request by the system can be improved by waiting for the recovery of the number of tokens or executing the download request when the token overdraft condition is met.
Another embodiment of the present invention provides a cloud storage quota speed limit downloading device, including a memory, a processor, and a computer program stored on the memory and capable of running on the processor, where the processor implements the following steps when executing the computer program:
receiving a downloading request, and reading and writing data according to the downloading request;
acquiring a preset data volume threshold and a transmission rate threshold, and calculating a downloading time threshold according to the data volume threshold and the transmission rate threshold;
acquiring current data read-write quantity in real time, judging whether the current data read-write quantity reaches the data quantity threshold value, and if so, acquiring data read-write time length;
judging whether the data read-write time length is smaller than the downloading time threshold value, if so, stopping data read-write until the downloading time threshold value is reached, and executing data read-write again;
if not, the current data read-write quantity is adjusted to the data quantity threshold value, and then the data read-write is executed again.
As can be seen from the above description, the preset data amount threshold and the transmission rate threshold are obtained after the download request is received, and the download time threshold is calculated according to the data amount threshold and the transmission rate threshold, and the transmission rate threshold is a fixed value, that is, the transmission rate that each user can use is fixed, so that the problem of resource preemption among different users is avoided; meanwhile, the current data reading and writing time is compared with the corresponding downloading time threshold, when the data reading and writing speed is too high, the data reading and writing is stopped, namely the time of the next data reading and writing is prolonged, and when the data reading and writing speed is too low, the current data reading and writing quantity is adjusted to the data quantity threshold, namely the time of the next data reading and writing is quickened, the current data reading and writing speed is adjusted in real time, the user experience is improved, and meanwhile, the user is prevented from occupying extra resources.
Further, the calculating the downloading time threshold according to the data volume threshold and the transmission rate threshold includes:
acquiring the number of tasks contained in the downloading request;
obtaining the average download rate of the tasks according to the number of the tasks and the transmission rate threshold;
and obtaining the downloading time threshold of each task according to the average downloading rate of the tasks and the data quantity threshold.
As can be seen from the above description, the average download rate of the tasks is obtained according to the number of tasks and the transmission rate threshold value included in the download request, and each task can be processed simultaneously by allocating a corresponding maximum download rate to each task.
Further, the method further comprises the following steps:
judging whether the number of the tasks is reduced in real time, if so, updating the number of the tasks;
and updating the downloading time threshold according to the updated task number.
According to the description, when the number of tasks is reduced due to the conditions of completion of task downloading, cancellation of tasks, interruption of tasks and the like, the maximum downloading rate of each task can be adjusted in real time according to the updated downloading time threshold value by acquiring the current number of tasks in real time and updating the corresponding downloading time threshold value of each task, so that the task processing efficiency is improved.
Further, the receiving the download request, and performing data reading and writing according to the download request further includes:
obtaining the number of tokens of a current token bucket;
judging whether the number of tokens required by the downloading request is larger than the number of tokens, if yes, judging whether the downloading request meets the token overdraft condition, and if yes, executing the downloading request.
As can be seen from the above description, when receiving the download request, if the number of tokens required by the current download request is greater than the number of tokens in the token bucket, the download request meeting the overdraft condition of the tokens is executed by overdraft tokens, which can effectively solve the problem of current limitation caused by insufficient number of tokens and improve the efficiency of processing the request by the system.
Further, the determining whether the download request meets the token overdraft condition further includes:
if not, executing the downloading request until the number of tokens is equal to the number of tokens; or executing the downloading request until the downloading request meets the token overdraft condition.
As can be seen from the above description, when the downloading request does not meet the token overdraft condition currently, the downloading request can be executed again by waiting for the recovery of the number of tokens or meeting the token overdraft condition, so that the efficiency of processing the request by the system is improved.
The cloud storage quota speed limit downloading method and device provided by the invention can be applied to the scenes of resource allocation such as cloud storage, and the like, so that the effective control of the number of tasks downloaded by a user and the prevention of excessive occupation of system resources are realized, and the following description is given by a specific embodiment:
example 1
Referring to fig. 1 and fig. 2, a cloud storage quota speed limit downloading method includes:
s1, receiving a downloading request, and reading and writing data according to the downloading request;
s2, acquiring a preset data quantity threshold and a preset transmission rate threshold, and calculating a downloading time threshold according to the data quantity threshold and the transmission rate threshold; defining a data block (chunk) in bytes, wherein the size of the data block is the data volume threshold, and defining a maximum rate maxRate allowed by a user in KB/s, and the maximum rate is the transmission rate threshold; the downloading time threshold is adjusted according to the task number contained in the downloading request, and the method specifically comprises the following steps:
s21, acquiring the task number contained in the downloading request;
s22, obtaining the average download rate of the tasks according to the number of the tasks and the transmission rate threshold; if the number of tasks is denoted by n, and the average download rate of tasks is denoted by byte willbetntoreceptive-chunkSize, then byte willbetntoreceptive-chunksize=maxrate/n;
s23, obtaining the downloading time threshold of each task according to the average downloading rate of the tasks and the data quantity threshold; specific: according to the data blocks and the task average download rate defined in the steps, the time required by a byte stream with the size of one data block can be obtained, namely the download time threshold is obtained and is represented by timeCostPerChunk; meanwhile, whether the number of the tasks is reduced or increased is required to be judged in real time, if yes, the number of the tasks is updated, and if one task is downloaded, the downloading is canceled or interrupted, namely the current number of the tasks is updated to be n-1, and the downloading time threshold is updated according to the updated number of the tasks; similarly, when the number of tasks increases, updating the task number and the downloading time threshold;
s3, acquiring current data read-write quantity in real time, judging whether the current data read-write quantity reaches the data quantity threshold, and if so, acquiring data read-write time length; when the bytes are read/written in the task execution process, acquiring the byte quantity which is already read/written as the current data read/write quantity (byte WillBeSentOrreceived); when the current data read-write quantity reaches the size of one data block, the time consumed in the checking period is the data read-write time length (nonwNanoTime-lastPiecementOrReceiveTick);
s4, judging whether the data read-write time length is smaller than the downloading time threshold value, and if yes, executing S5; if not, executing S6;
s5, stopping data reading and writing until the downloading time threshold is reached, and executing data reading and writing again; when the data read-write time length is smaller than the downloading time threshold value, the time consumed in the representing period is smaller than the downloading time threshold value, which indicates that the current transmission rate exceeds the average downloading rate of the task, therefore, the data read-write is stopped to sleep the task to limit the flow;
s6, if not, adjusting the current data read-write quantity to the data quantity threshold value, and then executing data read-write again; i.e. when the data read/write time is longer than the download time threshold, indicating that the current transmission rate does not reach the task average download rate, making the byte willbesentport receive=byte eswillbesentport-chunkSize (i.e. the current data read/write amount=task average download rate); meanwhile, after task dormancy is completed, the speed of the next data reading and writing is adjusted in the mode, and the current data reading and writing speed is monitored in real time in the subsequent data reading and writing process and adjusted.
Example two
The present embodiment is different from the first embodiment in that: controlling the way of executing the downloading request by adjusting the allocation way of the token; the token bucket in the prior art generally generates tokens at a steady speed, such as a token bucket that generates r tokens per second; if each request arrives, n tokens need to be consumed, and at the moment, the number of the remaining tokens in the token bucket is m; when at t 0 When the next request arrives at the moment, if m<n, the request needs to wait (n-m)/r seconds before being processed; and when m>n, the request will be passed directly. Assume a time point t at which the number of tokens m=5×n+1 in the token bucket 1 Simultaneously 6 requests are made; at this time, 5 requests out of 6 will be released directly out of order, and the remaining one request needs to wait (n-1)/r seconds before being processed, i.e. burst margin is created. Thus, only the number of tokens m in the token bucket isAfter being consumed to a certain level, i.e. m e 0, n, the future requests can be limited, and the traffic state at this moment is defined as "average traffic level". If there are no tokens remaining in the token bucket, i.e., m=0, each request to consume n tokens requires n/r seconds to wait for token production, i.e., the "average traffic level" is: r/n, in units of: QPS request/sec; thereby influencing the latency of the request and thus the QPS of the traffic by the token production efficiency.
However, for a token bucket with r=1, there are only 5 tokens in the token bucket at a certain time, and the request arriving at this time is a request that consumes 100 tokens, and then the request needs to wait 95 seconds before being executed. Even if the current system is in an idle state, the system cannot process the request, so that the system needs to face the embarrassment of concurrent execution with the subsequent request after 95 seconds, and the efficiency of processing the request by the system is reduced; in this embodiment, the request is allowed to "overdrawn" when applying for tokens, no matter how many tokens are currently remaining, the request is released, and the waiting time for the token bucket to generate enough tokens is assumed by the subsequent requests.
In view of the foregoing, this embodiment provides a token allocation method, specifically:
in executing step S1 in the first embodiment, further includes:
s11, obtaining the number of tokens of a current token bucket;
s12, judging whether the number of tokens required by the downloading request is larger than the number of tokens, if so, executing S13; if not, executing S14;
s13, judging whether the downloading request meets the token overdraft condition, and if so, executing the downloading request; that is, after meeting the token overdraft condition, the request is allowed to be overdraft when applying for tokens, and the request is released no matter how many tokens remain in the current token bucket; wherein, the number of tokens which allow overdraft and the number of continuous overdraft can be set, and when the download request meets the number of tokens which allow overdraft and the number of continuous overdraft, overdraft operation is executed; and the time waiting for the token bucket to generate enough tokens is born by the subsequent request; for one request, assuming that the number of tokens overdrawed by the last request is c, the waiting time of the current request meets the formula of waittime=c/r; meanwhile, when the token bucket is in an idle state, tokens can be replenished through a resync method.
S14, executing the downloading request until the number of tokens is equal to the number of tokens; or executing the downloading request until the downloading request meets the token overdraft condition; meanwhile, recording the operation behavior record of the user in the process of downloading the user; the user operation behavior can be queried through the background record, so that the record is prevented from being tampered and the data leakage is avoided.
Example III
Referring to fig. 3, a cloud storage quota speed limit downloading device includes a memory, a processor, and a computer program stored in the memory and capable of running on the processor, wherein the processor implements the following steps when executing the computer program:
s1, receiving a downloading request, and reading and writing data according to the downloading request, wherein the method comprises the following steps of:
s11, obtaining the number of tokens of a current token bucket;
s12, judging whether the number of tokens required by the downloading request is larger than the number of tokens, if so, executing S13; if not, executing S14;
s13, judging whether the downloading request meets the token overdraft condition, and if so, executing the downloading request;
s14, executing the downloading request until the number of tokens is equal to the number of tokens; or executing the downloading request until the downloading request meets the token overdraft condition.
S2, acquiring a preset data volume threshold and a preset transmission rate threshold, and calculating a downloading time threshold according to the data volume threshold and the transmission rate threshold, wherein the downloading time threshold is specifically:
s21, acquiring the task number contained in the downloading request;
s22, obtaining the average download rate of the tasks according to the number of the tasks and the transmission rate threshold;
s23, obtaining the downloading time threshold of each task according to the average downloading rate of the tasks and the data quantity threshold; meanwhile, judging whether the task number is reduced or increased in real time, if yes, updating the task number; and updating the downloading time threshold according to the updated task number.
S3, acquiring current data read-write quantity in real time, judging whether the current data read-write quantity reaches the data quantity threshold, and if so, acquiring data read-write time length;
s4, judging whether the data read-write time length is smaller than the downloading time threshold value, and if yes, executing S5; if not, executing S6;
s5, stopping data reading and writing until the downloading time threshold is reached, and executing data reading and writing again;
and S6, adjusting the current data read-write quantity to the data quantity threshold value, and executing data read-write again.
In summary, according to the cloud storage quota speed-limiting downloading method and device provided by the invention, the preset data quantity threshold and the preset transmission rate threshold are obtained after the downloading request is received, and the downloading time threshold is obtained by calculation according to the data quantity threshold and the transmission rate threshold, and because the transmission rate threshold is a fixed value, that is, the transmission rate which can be used by each user is fixed, the downloading rate of the single user is effectively controlled, the excessive occupation of system resources can be prevented, the problem of resource preemption among different users and the breakdown of the system due to resource exhaustion are avoided, and therefore the stability and reliability of the system are improved; meanwhile, the current data reading and writing time is compared with the corresponding downloading time threshold, when the data reading and writing speed is too high, the data reading and writing is stopped, namely the time of the next data reading and writing is prolonged, and when the data reading and writing speed is too low, the current data reading and writing quantity is adjusted to the data quantity threshold, namely the time of the next data reading and writing is quickened, the current data reading and writing speed is adjusted in real time, the user experience is improved, and meanwhile, the user is prevented from occupying extra resources.
The foregoing description is only illustrative of the present invention and is not intended to limit the scope of the invention, and all equivalent changes made by the specification and drawings of the present invention, or direct or indirect application in the relevant art, are included in the scope of the present invention.

Claims (10)

1. The cloud storage quota speed limit downloading method is characterized by comprising the following steps of:
receiving a downloading request, and reading and writing data according to the downloading request;
acquiring a preset data volume threshold and a transmission rate threshold, and calculating a downloading time threshold according to the data volume threshold and the transmission rate threshold;
acquiring current data read-write quantity in real time, judging whether the current data read-write quantity reaches the data quantity threshold value, and if so, acquiring data read-write time length;
judging whether the data read-write time length is smaller than the downloading time threshold value, if so, stopping data read-write until the downloading time threshold value is reached, and executing data read-write again;
if not, the current data read-write quantity is adjusted to the data quantity threshold value, and then the data read-write is executed again.
2. The cloud storage quota speed limit downloading method according to claim 1, wherein the calculating the downloading time threshold according to the data amount threshold and the transmission rate threshold comprises:
acquiring the number of tasks contained in the downloading request;
obtaining the average download rate of the tasks according to the number of the tasks and the transmission rate threshold;
and obtaining the downloading time threshold of each task according to the average downloading rate of the tasks and the data quantity threshold.
3. The cloud storage quota speed limit downloading method as in claim 2, further comprising:
judging whether the number of the tasks is reduced in real time, if so, updating the number of the tasks;
and updating the downloading time threshold according to the updated task number.
4. The cloud storage quota speed limit downloading method according to claim 1, wherein the receiving a downloading request and performing data reading and writing according to the downloading request further comprises:
obtaining the number of tokens of a current token bucket;
judging whether the number of tokens required by the downloading request is larger than the number of tokens, if yes, judging whether the downloading request meets the token overdraft condition, and if yes, executing the downloading request.
5. The cloud storage quota speed limit downloading method as in claim 4, wherein said determining whether said download request meets a token overdraft condition further comprises:
if not, executing the downloading request until the number of tokens is equal to the number of tokens; or executing the downloading request until the downloading request meets the token overdraft condition.
6. The cloud storage quota speed limit downloading device comprises a memory, a processor and a computer program stored on the memory and capable of running on the processor, and is characterized in that the processor realizes the following steps when executing the computer program:
receiving a downloading request, and reading and writing data according to the downloading request;
acquiring a preset data volume threshold and a transmission rate threshold, and calculating a downloading time threshold according to the data volume threshold and the transmission rate threshold;
acquiring current data read-write quantity in real time, judging whether the current data read-write quantity reaches the data quantity threshold value, and if so, acquiring data read-write time length;
judging whether the data read-write time length is smaller than the downloading time threshold value, if so, stopping data read-write until the downloading time threshold value is reached, and executing data read-write again;
if not, the current data read-write quantity is adjusted to the data quantity threshold value, and then the data read-write is executed again.
7. The cloud storage quota speed limit downloading apparatus as in claim 6, wherein said calculating a download time threshold from said data volume threshold and said transmission rate threshold comprises:
acquiring the number of tasks contained in the downloading request;
obtaining the average download rate of the tasks according to the number of the tasks and the transmission rate threshold;
and obtaining the downloading time threshold of each task according to the average downloading rate of the tasks and the data quantity threshold.
8. The cloud storage quota speed limit downloading apparatus as in claim 7, further comprising:
judging whether the number of the tasks is reduced in real time, if so, updating the number of the tasks;
and updating the downloading time threshold according to the updated task number.
9. The cloud storage quota speed limit downloading apparatus as in claim 6, wherein said receiving a download request and reading and writing data according to said download request further comprises:
obtaining the number of tokens of a current token bucket;
judging whether the number of tokens required by the downloading request is larger than the number of tokens, if yes, judging whether the downloading request meets the token overdraft condition, and if yes, executing the downloading request.
10. The cloud storage quota speed limit downloading apparatus as in claim 9, wherein said determining whether said download request meets a token overdraft condition further comprises:
if not, executing the downloading request until the number of tokens is equal to the number of tokens; or executing the downloading request until the downloading request meets the token overdraft condition.
CN202311797715.XA 2023-12-25 2023-12-25 Cloud storage quota speed limit downloading method and device Pending CN117896371A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311797715.XA CN117896371A (en) 2023-12-25 2023-12-25 Cloud storage quota speed limit downloading method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311797715.XA CN117896371A (en) 2023-12-25 2023-12-25 Cloud storage quota speed limit downloading method and device

Publications (1)

Publication Number Publication Date
CN117896371A true CN117896371A (en) 2024-04-16

Family

ID=90640445

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311797715.XA Pending CN117896371A (en) 2023-12-25 2023-12-25 Cloud storage quota speed limit downloading method and device

Country Status (1)

Country Link
CN (1) CN117896371A (en)

Similar Documents

Publication Publication Date Title
US11601512B2 (en) System and method for throttling service requests having non-uniform workloads
US8239564B2 (en) Dynamic throttling based on network conditions
US9419904B2 (en) System and method for throttling service requests using work-based tokens
US6920110B2 (en) System and method for transferring data over a network
US7139815B2 (en) System and method for transferring data over a network
US8918536B1 (en) Method and apparatus for optimizing computer network usage to prevent congestion
CN110545246A (en) Token bucket-based current limiting method and device
US8898674B2 (en) Memory databus utilization management system and computer program product
EP2466824A1 (en) Service scheduling method and device
WO2022057391A1 (en) Cache memory adjustment method, apparatus, and computer device
US10862992B2 (en) Resource cache management method and system and apparatus
WO2014026613A1 (en) Network bandwidth distribution method and terminal
CN112445857A (en) Resource quota management method and device based on database
CN110391873B (en) Method, apparatus and computer program product for determining a data transfer mode
CN112600761B (en) Resource allocation method, device and storage medium
CN113645150B (en) Transmission rate control method, apparatus, electronic device, and readable storage medium
CN106936867A (en) The response method and device of a kind of service request
CN110674064B (en) Data transmission method, device, equipment and computer readable storage medium
CN103840910A (en) Data transmission control method and apparatus
US11005776B2 (en) Resource allocation using restore credits
WO2001061945A1 (en) System and method for transferring data over a network
CN117896371A (en) Cloud storage quota speed limit downloading method and device
CN114020209A (en) Client service speed limiting method, device, equipment and storage medium
CN114116231A (en) Data loading method and device, computer equipment and storage medium
CN113709214A (en) Message processing method and device, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination