Token management method and device, equipment and storage medium
By responsive to access requests in the storage system and evenly filling the token bucket, the delay problem caused by rapid consumption of token buckets is solved, and the stable bandwidth/IOPS processing of the storage system is achieved, which improves the stability of access requests.
Patent Information
- Application Number
- CN202311865309.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-29
- Publication Date
- 2025-07-01
AI Technical Summary
In the prior art, the token bucket of the storage system causes delay in processing subsequent access requests after quickly consuming the token. How to reasonably fill the token bucket has become a technical problem that needs to be solved urgently.
Retrieve storage performance parameter values by responding to access request instructions, delete the corresponding token amount from the token bucket of the storage system according to the storage performance parameter values, and even fill the maximum token amount at preset time intervals, and divide it into multiple fill cycles to ensure the token amount in each cycle is stable and avoid delays caused by rapid consumption of tokens at the initial moment.
It realizes stable bandwidth/IOPS of the storage system during the quality of service cycle, avoids the delay caused by rapid consumption of token buckets at the initial moment, and improves the stability of access request processing and user experience.
Smart Images

Figure CN120234835A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of storage systems, and particularly to a token management method, apparatus, device, and storage medium. Background Art
[0002] Distributed storage systems are widely deployed in data centers of various scales. They often receive a large number of access requests from different clients at the same time. Therefore, it is necessary to execute a QoS (Quality of Service) mechanism to process these access requests.
[0003] Taking the token bucket algorithm as an example, in the related art, tokens are filled into the token bucket of the storage system so that the storage system can synchronously consume the tokens in the token bucket according to the processed access requests. If the access requests received at the initial moment quickly consume the tokens in the token bucket, it will cause a delay in processing access requests at subsequent moments.
[0004] Therefore, how to reasonably fill the tokens in the token bucket of the storage system has become a technical problem to be solved urgently. Summary of the Invention
[0005] Based on this, it is necessary to provide a token management method, apparatus, device, and storage medium for the above technical problems to reasonably fill the tokens in the token bucket.
[0006] In a first aspect, this application provides a token management method, which includes:
[0007] Respond to an access request instruction and obtain the storage performance parameter value corresponding to the access request instruction;
[0008] Delete the corresponding token amount from the token bucket of the storage system according to the storage performance parameter value; the tokens in the token bucket are filled evenly at a preset time interval based on the maximum token amount; the maximum token amount is determined according to the storage performance upper limit of the storage system within a service quality cycle.
[0009] In the technical solution provided by the embodiment of the present application, in response to an access request instruction, a storage performance parameter value corresponding to the access request instruction is obtained, and according to the storage performance parameter value, a corresponding amount of tokens is deleted from the token bucket of the storage system. Among them, the maximum amount of tokens in the token bucket is determined according to the storage performance upper limit of the storage system within a quality of service cycle, and the tokens in the token bucket are filled evenly at a preset time interval based on the maximum amount of tokens. In the embodiment of the present application, according to the storage performance upper limit of the storage system within a quality of service cycle, the maximum amount of tokens in the token bucket is determined to limit the overall performance of the access request instruction within a quality of service cycle. Moreover, for any quality of service cycle, at a preset time interval, the maximum amount of tokens is filled into the token bucket in batches smoothly, so that the storage system can obtain a more stable bandwidth / IOPS throughout the quality of service cycle, so as to process access requests smoothly and avoid quickly consuming all the tokens in the token bucket at the initial moment of the quality of service cycle, thereby causing delays in processing access requests at subsequent moments in the quality of service cycle.
[0010] In one embodiment, the method further includes:
[0011] For any quality of service cycle, obtain multiple filling cycles corresponding to the quality of service cycle;
[0012] According to the maximum amount of tokens, determine the amount of tokens to be filled in each filling cycle;
[0013] According to each filling cycle, fill tokens corresponding to the amount of tokens to be filled into the token bucket.
[0014] In the technical solution provided by the embodiment of the present application, the maximum amount of tokens is divided into the amounts of tokens to be filled in multiple filling cycles, and corresponding tokens are filled into the token bucket in each filling cycle, which is equivalent to filling the maximum amount of tokens into the token bucket in batches, so as to ensure that the tokens in the token bucket support the storage performance upper limit within a quality of service cycle and achieve precise control of the storage performance upper limit.
[0015] In one embodiment, obtaining multiple filling cycles corresponding to the quality of service cycle includes:
[0016] Divide the quality of service cycle evenly according to a preset time interval to obtain multiple filling cycles.
[0017] In the technical solution provided by the embodiment of the present application, the quality of service is evenly divided to obtain multiple filling cycles with the same time. On this basis, tokens are filled into the token bucket according to each filling cycle, that is, at every preset time interval, tokens are filled into the token bucket smoothly and uniformly, thereby limiting the quantity and speed of token consumption in the token bucket.
[0018] In one embodiment, determining the filling token amount for each filling period according to the maximum token amount includes:
[0019] Average the maximum token amount and allocate it to each filling period to obtain the initial filling token amount for each filling period;
[0020] Determine the filling token amount for each filling period according to each initial filling token amount.
[0021] In the technical solution provided by the embodiments of the present application, the maximum token amount is evenly distributed to each filling period to ensure that the initial filling token amounts of each filling period are equal. On this basis, the initial filling token amounts are adjusted so that the difference between the filling token amounts of each filling period is as small as possible, and the entire token filling process is also smoother.
[0022] In one embodiment, determining the filling token amount for each filling period according to each initial filling token amount includes:
[0023] For any filling period, obtain the remaining token amount of the storage bucket in the filling period;
[0024] Determine the token capacity difference of the storage bucket according to the maximum token amount and the remaining token amount;
[0025] Compare the token capacity difference with the initial filling token amount to obtain the filling token amount of the filling period.
[0026] In the technical solution provided by the embodiments of the present application, considering that filling according to the initial filling token amount may cause the situation of token overflow in the token bucket, the token capacity difference is calculated according to the maximum token amount and the remaining token amount to evaluate the token carrying capacity of the storage bucket in the filling period. Then, by comparing the token capacity difference with the initial filling token amount, the initial filling token amount is adjusted to obtain an accurate filling token amount that matches the maximum token amount in the current storage bucket, avoiding token waste.
[0027] In one embodiment, comparing the token capacity difference with the initial filling token amount to obtain the filling token amount of the filling period includes:
[0028] If the token capacity difference is greater than or equal to the initial filling token amount, determine the initial filling token amount as the filling token amount of the filling period;
[0029] If the token capacity difference is less than the initial filling token amount, determine the token capacity difference as the filling token amount of the filling period.
[0030] In the technical solution provided by the embodiments of the present application, by comparing the token capacity difference with the initial filling token amount, select the token amount with the smaller numerical value of the two as the filling token amount of the filling period, avoiding the phenomenon of token overflow in the token bucket.
[0031] In one embodiment, the storage performance parameter value includes storage bandwidth, and / or, the number of read / write operations per second.
[0032] In the technical solution provided by the embodiments of the present application, the storage performance parameter value can be a bandwidth value or the number of read / write operations per second, which is equivalent to not restricting the type of access request. Correspondingly, the type of token bucket can be a bandwidth type or an input / output type, which improves the scenario applicability of the token management method to a certain extent.
[0033] Second, the present application also provides a token management device, which includes:
[0034] A request response module, configured to obtain the storage performance parameter value corresponding to the access request instruction in response to the access request instruction;
[0035] A token update module, configured to delete a corresponding token amount from the token bucket of the storage system according to the storage performance parameter value; the tokens in the token bucket are filled evenly based on the maximum token amount at a preset time interval; the maximum token amount is determined according to the storage performance upper limit of the storage system within a quality of service cycle.
[0036] Third, the present application also provides a computer device, including a memory and a processor. The memory stores a computer program, and when the processor executes the computer program, it implements the steps of the method in any one of the embodiments in the first aspect above.
[0037] Fourth, the present application also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, it implements the steps of the method in any one of the embodiments in the first aspect above.
[0038] Fifth, the present application also provides a computer program product, including a computer program. When the computer program is executed by a processor, it implements the steps of the method in any one of the embodiments in the first aspect above. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the following will briefly introduce the drawings required for the description of the embodiments or related technologies. Obviously, the following drawings are only some embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.
[0040] Figure 1 It is the internal structure diagram of a computer device in one embodiment;
[0041] Figure 2Schematic diagram of the hardware platform of the distributed storage system in an embodiment;
[0042] Figure 3 Flow schematic diagram of the token management method in an embodiment;
[0043] Figure 4 Flow schematic diagram of the token filling method in an embodiment;
[0044] Figure 5 Flow schematic diagram of the token quantity determination step in an embodiment;
[0045] Figure 6 Flow schematic diagram of the token quantity determination step in another embodiment;
[0046] Figure 7 Flow schematic diagram of the token quantity comparison step in an embodiment;
[0047] Figure 8 Flow schematic diagram of the token filling step in an embodiment;
[0048] Figure 9 Flow schematic diagram of the token filling step in another embodiment;
[0049] Figure 10 Flow schematic diagram of the token filling step in another embodiment;
[0050] Figure 11 Flow schematic diagram of the token filling step in another embodiment;
[0051] Figure 12 Structural block diagram of the token management device in an embodiment. Detailed implementation manners
[0052] In order to make the objectives, technical solutions and advantages of the present application clearer and more understandable, the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0053] The token management method provided by the embodiments of the present application can be applied to a computer device, and the computer device can be a server, and its internal structure diagram can be as Figure 1As shown in the figure. The computer device includes a processor, a memory, an input / output interface (Input / Output, abbreviated as I / O), and a communication interface. Among them, the processor, the memory, and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store token management data. The input / output interface of the computer device is used to exchange information between the processor and external devices. The communication interface of the computer device is used to communicate with external terminals through a network connection. When the computer program is executed by the processor, it implements a token management method.
[0054] Those skilled in the art can understand that Figure 1 the structure shown in the figure is only a block diagram of some structures related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine some components, or have different component arrangements.
[0055] Storage systems are widely deployed in data centers of various scales and can manage the growing persistent data. In practical applications, a large number of access requests from different clients are often received at the same time. Based on this, providing a QoS mechanism for token buckets in a distributed storage system to provide QoS performance guarantees for clients sharing system resources is an important requirement to be achieved.
[0056] Among them, a token bucket is a group of related storage objects and can be regarded as a single logical entity. A token can be composed of multiple logical volumes, and each logical volume is evenly distributed among different storage nodes in the storage system. The objects of the token bucket can be accessed by multiple clients authorized by the storage nodes. For example, the owner of the token bucket can be a department in an organization, and the client can be a team member of the department. The owner of the token bucket is responsible for providing storage services used by different authorized clients, and at the same time, the token bucket can be distributed among multiple storage nodes according to the data distribution policy of the storage system.
[0057] Under normal circumstances, users need to control the upper limit of the quality of service performance of different logical volumes. Especially for less critical services, the upper limit of performance involves two aspects: resource allocation and request scheduling. Resource allocation sets the policies and mechanisms to allocate system resources to competing clients, while request scheduling performs the allocation. Generally speaking, the upper limit of the quality of service performance can be targeted at physical resources such as network bandwidth and Central Processing Unit (CPU) execution time, or derived metrics such as request throughput and response time.
[0058] In related technologies, the method for controlling the quality of service of multiple virtual machines sharing a single server is processed through a hypervisor module. This module controls the order and timing of sending requests to the storage backend to implement fine-grained quality of service performance requirement guarantees. Specifically, reservations and restrictions are made on the Input / Output (I / O) of a single virtual machine, so that each virtual machine operates with the minimum number of Input / Output Operations Per Second (IOPS), and at the same time, the maximum number of allowed IOPS for each virtual machine is restricted.
[0059] Taking the token bucket algorithm as an example, tokens are filled into the token bucket of the storage system so that the storage system can synchronously consume the tokens in the token bucket according to the processed access requests. When the read / write bandwidth / IOPS of the current request exceeds the upper limit of the quality of service performance, if the token bucket stores the Bytes or the number of IOs for 1 second, then the token amount for 1 second may be consumed within the first 200 ms, resulting in a bandwidth / IOPS of 0 for the subsequent 800 ms, and further causing a delay in the processing of access requests in the subsequent second. For the client front end, it is manifested as the instability of the request task processing process, affecting the user access experience.
[0060] To avoid the above situation, the embodiments of the present application provide a token management method, which further subdivides the number of tokens in a QoS cycle, sets a more refined token filling cycle and quantity for the token bucket, so that there can be corresponding bandwidth / IOPS filling in each filling cycle, thereby improving the smoothness of the access request processing process.
[0061] It should be noted that the token bucket algorithm can be applied to a distributed environment or a centralized environment, and in either environment, there may be an uneven consumption of tokens and an unstable processing of request tasks. Therefore, the token management method in the embodiments of the present application can be applied not only to distributed storage systems but also to centralized systems.
[0062] However, most of the QoS in the related art is based on QoS in a centralized environment rather than in a distributed environment. The reasons can be divided into the following aspects: (1) Since the storage system distributes the objects of the storage buckets on multiple servers, the demands for the storage buckets on different servers may be unevenly distributed. (2) The I / O processing capabilities of the servers may also depend on the workload characteristics. (3) The requests for multiple storage buckets may overload some servers, leading to problems such as which requests to serve, which requests to postpone, and which requests to discard to meet the QoS requirements.
[0063] In summary, due to the complexity and correlation of the spatial and temporal variations in the distribution of demands and capacities among servers in a distributed environment, some new challenges are brought to providing QoS in distributed storage.
[0064] Based on this, in the face of a distributed storage system, considering that each subscribed client can obtain a certain amount of I / O (within a specified time interval) on the objects stored in the distributed system, the embodiments of the present application pre-guarantee the minimum I / O quantity and the maximum I / O quantity of the client in each QoS period, and summarize the minimum I / O quantity and the maximum I / O quantity of the client in each QoS period on all the servers in the distributed system. Herein, the QoS period refers to the time interval for performing performance guarantee. The QoS period of the early strategy was several days or weeks, mainly focusing on billing and limit execution.
[0065] Please refer to Figure 2 , Figure 2 which shows a schematic diagram of the hardware platform of the distributed storage system. Figure 2 The distributed storage system in Figure 2As shown, a client can access multiple logical volumes (for example, logical volume 1 and logical volume 2 in the figure can be mapped by client 1), and a logical volume can also be accessed by multiple logical volumes at the same time (for example, logical volume 3 and logical volume 4 in the figure can access logical volume 4). Such a mapping relationship makes the QoS processing complicated, because n storage nodes provide services at the same time, and there is no single entry point at the front end to process the request sent by the client, so it is necessary to coordinate the information of all storage nodes to correctly process QoS. In addition, each storage node is deployed with multiple policy information, such as policy 1, policy 2, policy 3, etc. The policy can be a policy for processing the access request of the client, or a service quality policy for each logical volume. A service quality processing program is also deployed on each storage node, which is used to perform corresponding processing according to the instructions of the policy information, such as processing the access request received from the client, controlling the service quality of each logical volume on the storage node, etc.
[0066] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.
[0067] In an exemplary embodiment, Figure 3 As shown, a token management method is provided, comprising the following steps:
[0068] S301, in response to an access request instruction, obtaining a storage performance parameter value corresponding to the access request instruction.
[0069] The storage performance parameter value includes storage bandwidth and / or the number of IOPS (input / output operations per second).
[0070] Storage bandwidth refers to the amount of information accessed by the memory per unit time, also known as the number of bits or bytes read / written by the memory per unit time. IOPS refers to the number of reads and writes of the computer per unit time, which can be regarded as the input and output per second.
[0071] In an embodiment of the present application, the storage performance parameter value can be a bandwidth value or the number of reads and writes per second, which is equivalent to not restricting the type of access request. Correspondingly, the type of the token bucket can be a bandwidth type or an input and output type, which improves the scenario applicability of the token management method to a certain extent.
[0072] In response to an access request instruction sent by a client, determine the bandwidth or the number of I / Os corresponding to the access request instruction. Exemplarily, in response to an access request instruction of 50 MB, determine that the value of the storage performance parameter corresponding to the access request instruction is 50 MB; in response to 50 access requests, determine that the value of the storage performance parameter of the access request instruction is 50 requests.
[0073] S302, according to the value of the storage performance parameter, delete the corresponding amount of tokens from the token bucket of the storage system; the tokens in the token bucket are filled evenly based on the maximum amount of tokens at a preset time interval; the maximum amount of tokens is determined according to the storage performance upper limit of the storage system within a quality of service cycle.
[0074] Among them, the token bucket can be regarded as a container for storing tokens, and is used for multiple clients corresponding to the storage system to access. Moreover, there is a corresponding relationship between the tokens in the token bucket and the value of the storage performance parameter of the access request. Since the storage performance parameter can be storage bandwidth or IOPS, correspondingly, the type of the token bucket can be bandwidth type or IOPS type. Please refer to Table 1, which shows the attribute information of each dimension of the token bucket.
[0075] Table 1
[0076]
[0077] In Table 1, the maximum amount of tokens in the token bucket is determined according to the storage performance upper limit of the storage system within a QoS cycle, which represents the maximum capacity of the token bucket. If the tokens in the token bucket reach the maximum amount of tokens and continue to be filled, the tokens will overflow. The remaining amount of tokens in the token bucket is the current remaining number of tokens in the token bucket.
[0078] The filling speed of the token bucket is determined based on a preset time interval. For example, if the preset time interval is 100 ms, the filling speed of the token bucket is to fill once every 10 ms. The preset time interval in the embodiments of the present application is less than a QoS cycle.
[0079] The filling time of the token bucket is the time of the last token filling, that is, every time a token is filled, the filling time is updated.
[0080] Taking the token bucket of the storage system as a bandwidth-type token bucket, with the storage performance upper limit within a QoS cycle being 500 MB / s and the time interval being 100 ms as an example, the maximum amount of tokens in the token bucket is 500 MB, and the token filling rule is: within a QoS cycle, at a filling speed of 1 time / 100 ms, fill 500 MB of tokens in 10 times, and fill 50 MB of tokens each time, that is, update one-tenth of the bandwidth every 100 ms.
[0081] Meanwhile, when filling the token bucket with tokens, the storage system is also receiving access request instructions sent by the client, and for each processed access request, the corresponding token amount is deleted from the token bucket.
[0082] If the remaining token amount in the token bucket can handle all access requests, the corresponding token amount is directly deleted from the token bucket; if the remaining token amount in the token bucket cannot handle all access requests, the number of access requests corresponding to the remaining token amount is determined and processed, and as for other unprocessable access requests, they can be discarded or placed in the buffer and not processed temporarily.
[0083] In the embodiment of the present application, in response to the access request instruction, the storage performance parameter value corresponding to the access request instruction is obtained, and according to the storage performance parameter value, the corresponding token amount is deleted from the token bucket of the storage system. Among them, the maximum token amount in the token bucket is determined according to the storage performance upper limit of the storage system within a quality of service cycle, and the tokens in the token bucket are filled evenly based on the maximum token amount at a preset time interval. In the embodiment of the present application, according to the storage performance upper limit of the storage system within a quality of service cycle, the maximum token amount of the token bucket is determined to limit the overall performance of the access request instruction within a quality of service cycle. And for any quality of service cycle, according to the preset time interval, the maximum token amount is filled into the token bucket in batches smoothly, so that the storage system can obtain a more stable bandwidth / IOPS throughout the quality of service cycle to process access requests smoothly, and avoid quickly consuming all the tokens in the token bucket at the initial moment of the quality of service cycle, thereby causing delays in processing access requests at subsequent moments in the quality of service cycle.
[0084] As can be seen from the foregoing embodiments, the tokens in the token bucket are filled based on the preset time interval and the maximum token amount. Based on this, an implementation manner of filling tokens in the token bucket will be described below through an embodiment.
[0085] In an exemplary embodiment, as Figure 4 shown, the method further includes:
[0086] S401, for any quality of service cycle, obtain multiple filling cycles corresponding to the quality of service cycle.
[0087] The quality of service cycle is evenly divided into multiple sub - cycles, and according to the preset screening rule, several sub - cycles are screened out and determined as filling cycles.
[0088] For example, randomly select half of the sub - cycles corresponding to the quality of service cycle and determine them as the multiple filling cycles corresponding to the quality of service cycle.
[0089] In another scenario, multiple sub - cycles can also be sorted in chronological order, and the first sub - cycle is used as the first filling cycle. Every other sub - cycle, a filling cycle is determined, and so on, to select filling cycles with a quantity equal to half of the number of sub - cycles from multiple sub - cycles.
[0090] S402. Determine the filling token quantity for each filling cycle according to the maximum token quantity.
[0091] Divide the maximum token quantity into multiple equal parts with the same number as the number of filling cycles according to the number of filling cycles. The token quantity of each equal part corresponds to a filling cycle. In the embodiments of the present application, when the sum of the filling token quantities of each filling cycle is the maximum token quantity, the division method of the maximum token quantity is not limited.
[0092] Taking the IOPS - type token bucket with the maximum token quantity of 2000 as an example, if there are 5 filling cycles, according to the rule of increasing filling, the filling token quantities of the 5 filling cycles can be 200, 300, 400, 500, and 600 respectively in sequence; or according to the rule of decreasing filling, the filling token quantities of the 5 filling cycles can be 600, 500, 400, 300, and 300 respectively in sequence.
[0093] S403. Fill the token bucket with tokens corresponding to the filling token quantity according to each filling cycle.
[0094] According to the filling token quantity of each filling cycle, fill the token bucket with tokens equal to the corresponding filling token quantity in each filling cycle in sequence.
[0095] In the embodiments of the present application, dividing the maximum token quantity into the filling token quantities of multiple filling cycles and filling the corresponding tokens into the token bucket in each filling cycle is equivalent to filling the maximum token quantity into the token bucket in batches to ensure that the tokens in the token bucket support the storage performance upper limit within a service quality cycle, and realizing precise control of the storage performance upper limit.
[0096] Next, another implementable way of multiple filling cycles in the foregoing embodiment S401 is described. In an exemplary embodiment, obtaining multiple filling cycles corresponding to the service quality cycle includes:
[0097] Divide the service quality cycle evenly according to a preset time interval to obtain multiple filling cycles.
[0098] Based on the time interval, divide the service quality cycle into multiple filling cycles with the same duration. Taking the service quality cycle of 1s and the time interval of 100ms as an example, divide 1s into 10 100ms, and each 100ms is used as a filling cycle.
[0099] In the embodiments of the present application, the quality of service is evenly divided to obtain multiple filling periods with the same time. On this basis, tokens are filled into the token bucket according to each filling period, that is, at intervals of a preset time duration, tokens are filled into the token bucket steadily and uniformly, thereby restricting the quantity and speed of token consumption in the token bucket.
[0100] In the case of obtaining the maximum token quantity, the maximum token quantity can be divided in various ways to ensure that the sum of the filled token quantities in each filling period is the maximum token quantity. For example, as in the foregoing embodiments, the filled token quantities in each filling period are determined in the manner of increasing or decreasing sequentially according to the filled token quantity of the filling period. Based on this, through an embodiment below, another implementation manner of the filled token quantity is described.
[0101] In an exemplary embodiment, as Figure 5 shown, determining the filled token quantity in each filling period includes:
[0102] S501, evenly distribute the maximum token quantity to each filling period to obtain the initial filled token quantity of each filling period.
[0103] Obtain the number of multiple filling periods corresponding to a quality of service period, and determine the ratio of the maximum token quantity to the number of multiple filling periods as the initial filled token quantity of each filling period. In other words, the initial filled token quantities of each filling period are the same.
[0104] S502, determine the filled token quantity in each filling period according to the initial filled token quantity of each.
[0105] Considering that in the process of filling tokens in the token bucket, there may also be various scenarios of token consumption. For example, when the storage system receives a small number of access requests, the token consumption speed is slow; or when the storage system receives a small number of access requests, the token consumption speed is fast; or when the storage system does not receive access requests during the filling process, the tokens will not be consumed. Based on this, in the embodiments of the present application, during the token filling process, according to different token consumption scenarios, the initial filled token quantity of each filling period is dynamically adjusted to determine the filled token quantity of each filling period.
[0106] In the embodiments of the present application, the maximum token quantity is evenly distributed to each filling period to ensure that the initial filled token quantities of each filling period are equal. On this basis, the initial filled token quantities of each are adjusted so that the difference between the filled token quantities of each filling period is as small as possible, and the entire token filling process is also smoother.
[0107] As can be seen from the foregoing embodiments, when determining the initial filling token amounts, it is often necessary to adjust the initial filling token amounts based on the actual consumption scenarios of the tokens to determine the filling token amounts. Based on this, the steps for obtaining the filling token amounts will be described below through an embodiment.
[0108] In an exemplary embodiment, as Figure 6 shown, determining the filling token amounts for each filling period according to the initial filling token amounts includes:
[0109] S601, for any filling period, obtain the remaining token amount in the bucket for the filling period.
[0110] Every time a filling period passes, read the remaining token amount in the bucket corresponding to the current filling period. For example, at the initial moment or the end moment of the current filling period, determine the remaining token number in the bucket for the current filling period.
[0111] S602, determine the token capacity difference of the bucket according to the maximum token amount and the remaining token number.
[0112] The maximum token amount of the bucket is fixed, and the remaining token number in the bucket is less than or equal to the maximum token amount. The difference between the maximum token amount and the remaining token number is determined as the token capacity difference of the token bucket for the current filling period.
[0113] S603, compare the token capacity difference with the initial filling token amount to obtain the filling token amount for the filling period.
[0114] Compare the token capacity difference with the initial filling token amount to determine the filling token amount for the current filling period.
[0115] It should be noted that if the remaining token amount is determined at the initial moment of the current filling period, it means that the token filling for the current filling period has not been carried out yet. In this case, the comparison result between the token capacity difference and the initial filling token amount is used to determine the filling token amount for the current filling period.
[0116] If the remaining token amount is determined at the end moment of the current filling period, it means that the token filling for the current filling period has been carried out. In this case, the comparison result between the token capacity difference and the initial filling token amount is used to determine the filling token amount for the next filling period of the current filling period.
[0117] In the embodiments of the present application, considering that filling according to the initial filling token quantity may cause the situation that tokens overflow the token bucket, the token capacity difference is calculated based on the maximum token quantity and the remaining token quantity to evaluate the token carrying capacity of the storage bucket during the filling period. Then, by comparing the token capacity difference with the initial filling token quantity, the initial filling token quantity is adjusted to obtain an accurate filling token quantity that matches the maximum token quantity in the current storage bucket, avoiding token waste.
[0118] The comparison results between the token capacity difference and the initial filling token quantity are divided into three cases: the token capacity difference is greater than the initial filling token quantity, the token capacity difference is equal to the initial filling token quantity, and the token capacity difference is less than the initial filling token quantity. The methods for determining the filling token quantity in the filling period under various comparison results are described below.
[0119] Then in an exemplary embodiment, as Figure 7 shown, comparing the token capacity difference with the initial filling token quantity to obtain the filling token quantity in the filling period includes:
[0120] S701, if the token capacity difference is greater than or equal to the initial filling token quantity, then determine the initial filling token quantity as the filling token quantity in the filling period.
[0121] If the token capacity difference is greater than or equal to the initial filling token quantity, it means that if tokens are filled according to the initial filling token quantity, the tokens in the token bucket will still not overflow. At this time, the initial filling token quantity is determined as the filling token quantity in the filling period.
[0122] S702, if the token capacity difference is less than the initial filling token quantity, then determine the token capacity difference as the filling token quantity in the filling period.
[0123] If the token capacity difference is less than the initial filling token quantity, it means that after filling tokens according to the initial filling token quantity, the tokens in the token bucket will overflow by the number of tokens that the initial filling token quantity is greater than the token capacity difference. At this time, to avoid token overflow and meet the maximum token capacity of the token bucket, the token capacity difference is determined as the filling token quantity in the filling period.
[0124] In the embodiments of the present application, by comparing the token capacity difference with the initial filling token quantity, the token quantity with the smaller numerical value of the two is selected as the filling token quantity in the filling period, avoiding the phenomenon of token overflow in the token bucket.
[0125] In an exemplary embodiment, the token management method specifically includes the following steps:
[0126] (1) For any service quality period, divide the service quality period evenly according to a preset time interval to obtain a plurality of filling periods.
[0127] (2) Average the maximum token amount across each filling period to obtain the initial filling token amount for each filling period.
[0128] Among them, the maximum token amount is determined based on the storage performance upper limit of the storage system within a quality of service period.
[0129] (3) For any filling period, obtain the remaining token amount of the bucket in the filling period.
[0130] (4) Determine the token capacity difference of the bucket based on the maximum token amount and the remaining token amount.
[0131] (5) If the token capacity difference is greater than or equal to the initial filling token amount, then determine the initial filling token amount as the filling token amount for the filling period.
[0132] (6) If the token capacity difference is less than the initial filling token amount, then determine the token capacity difference as the filling token amount for the filling period.
[0133] (7) Fill the token bucket with tokens corresponding to the filling token amount according to each filling period.
[0134] (8) In response to an access request instruction, obtain the storage performance parameter value corresponding to the access request instruction.
[0135] (9) Delete the corresponding token amount from the token bucket of the storage system according to the storage performance parameter value.
[0136] In the embodiments of the present application, in response to an access request instruction, obtain the storage performance parameter value corresponding to the access request instruction, and delete the corresponding token amount from the token bucket of the storage system according to the storage performance parameter value. Among them, the maximum token amount in the token bucket is determined based on the storage performance upper limit of the storage system within a quality of service period, and the tokens in the token bucket are filled evenly based on the maximum token amount at a preset time interval. In the embodiments of the present application, determine the maximum token amount of the token bucket according to the storage performance upper limit of the storage system within a quality of service period to limit the overall performance of the access request instruction within a quality of service period. And, for any quality of service period, fill the maximum token amount into the token bucket in batches and stably at a preset time interval, so that the storage system can obtain a more stable bandwidth / IOPS throughout the quality of service period to process access requests smoothly, and avoid quickly consuming all the tokens in the token bucket at the initial moment of the quality of service period, thereby causing a delay in processing access requests at subsequent moments in the quality of service period.
[0137] To further verify the rationality of the token management method provided in the embodiments of the present application, next, taking the token bucket type as a bandwidth-based token bucket, with a storage bandwidth upper limit of 500 MB / s and a filling period of 100 ms as an example, the changes in the tokens in the token bucket are described separately for scenarios with different required bandwidths.
[0138] It should be noted that in actual applications, during the acquisition and actual use of the token bucket, multiple threads simultaneously acquire tokens from the same token bucket. However, considering that the upper limit requirements for service quality storage performance parameters in the token management method of the present application should be accurate, and the update and use of tokens should also be accurate, in the embodiments of the present application, the competition for the token bucket is restricted within the process. Both the single serial filling of tokens and the multiple concurrent acquisitions of tokens are restricted within the process, and there is no inter-process concurrent acquisition of tokens. In other words, the filling of the token bucket is regarded as a single-threaded process, and multiple token filling processes are mutually exclusive, without concurrent filling. Correspondingly, the consumption of tokens in the token bucket is also regarded as a single-threaded process, and multiple token consumption processes are mutually exclusive, without concurrent acquisition. Moreover, the process of reading the remaining token amount in the token bucket during token filling and the token consumption process are also in a mutually exclusive relationship, that is, when reading the remaining token amount in the token bucket, token consumption is not performed. In the embodiments of the present application, spin_lock can be used to describe this mutually exclusive relationship. When multiple threads, such as 16 threads, access the same token bucket, strict mutual exclusion needs to be ensured. Since the logic is relatively simple, this lock will be released quickly, and the mutual exclusion time will be very short.
[0139] (1) When the required bandwidth is 0 MB / s, that is, when there are no user access requests.
[0140] Please refer to Figure 8 , Figure 8 which shows the process of token filling in the token bucket when the required bandwidth is 0 MB / s and the storage bandwidth upper limit is 500 MB / s. Figure 8 In, the service quality period of 1 s is evenly divided into 10 filling periods, that is, each filling period is 100 ms, and 50 MB of tokens are filled every 100 ms. When the remaining token amount in the token bucket does not exceed the maximum token amount, tokens are continuously filled. When the remaining token amount is equal to the maximum token amount, no new tokens are added, and only the filling timestamp is updated every 100 ms thereafter, without updating the token quantity. It should be noted that due to the setting of the timestamp, a timer that is not that precise is required. As long as the time difference is calculated, it is possible to know how many tokens should be filled.
[0141] (2) When the required bandwidth is 800 MB / s, that is, when the required bandwidth is much greater than the storage bandwidth upper limit.
[0142] Please refer to Figure 9 ,Figure 9 It shows the process of token filling in the token bucket when the required bandwidth is 800 MB / s and the upper limit of the storage bandwidth is 500 MB / s. Figure 9 In this case, the quality of service cycle of 1 s is evenly divided into 10 filling cycles, that is, each filling cycle is 100 ms, and 50 MB of tokens are filled every 100 ms. It can be seen that when the required bandwidth far exceeds the bandwidth upper limit, compared with the filling method of filling 500 MB of tokens in 1 s, the filling method of filling 50 MB of tokens every 100 ms in the embodiment of the present application is equivalent to smoothing the filling steps. In this way, the user's access request can only obtain a performance of 50 MB every 100 ms, and cannot take away all 500 MB of tokens in 1 s at 100 ms, resulting in no requests in the next few hundred ms. In this way, the user service looks very stable, and the bandwidth is well restricted.
[0143] (3)When the required bandwidth is 550 MB / s, that is, the case where the required bandwidth is slightly greater than the upper limit of the storage bandwidth.
[0144] Please refer to Figure 10 , Figure 10 It shows the process of token filling in the token bucket when the required bandwidth is 550 MB / s, the upper limit of the storage bandwidth is 500 MB / s, and the required bandwidth is not very stable, sometimes high and sometimes low, every 100 ms. Figure 10 In this case, the quality of service cycle of 1 s is evenly divided into 10 filling cycles, that is, each filling cycle is 100 ms, and 50 MB of tokens are filled every 100 ms. It can be seen that the tokens accumulated in the early stage allow subsequent requests to exceed 100 ms. Generally, the bandwidth within 1 s is accurately limited to 500 MB / s, that is, the upper limit value of the storage service bandwidth.
[0145] (4)When the required bandwidth is 300 MB / s, that is, the case where the required bandwidth is less than the upper limit of the storage bandwidth.
[0146] Please refer to Figure 11 , Figure 11 It shows the case where the required bandwidth is 30 MB / s and the upper limit of the storage bandwidth is 500 MB / s. Figure 11 In this case, the quality of service cycle of 1 s is evenly divided into 10 filling cycles, that is, each filling cycle is 100 ms, and 50 MB of tokens are filled every 100 ms. It can be seen that the tokens in the token bucket are updated regularly. If the pressure of the service is less than the bandwidth upper limit of the quality of service cycle, then the actual required performance is ultimately the actual demand. This smoothness does not need to be processed and is the behavior of the service itself. At this time, what needs to be done is not to cause the actual required performance to decrease due to the bandwidth upper limit of the quality of service cycle.
[0147] In summary, in various cases where the required bandwidth is 0, greater than the upper limit of the storage bandwidth, or less than the upper limit of the storage bandwidth, etc., by using the token management method provided in the embodiments of the present application, the actual bandwidth can be controlled to be less than or approximately equal to the upper limit of the storage bandwidth, and the error should be relatively small.
[0148] It should be understood that although the steps in the flowcharts involved in the above-described embodiments are shown in sequence according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise clearly stated in this article, the execution of these steps has no strict order limit, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-described embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be executed alternately or alternately with at least a part of other steps or steps in other steps.
[0149] Based on the same inventive concept, the embodiments of the present application also provide a token management device for implementing the above-mentioned token management method. The solution provided by this device for solving problems is similar to the solution described in the above method. Therefore, the specific limitations in one or more embodiments of the token management device provided below can refer to the limitations on the token management method in the above text, and will not be repeated here.
[0150] In an exemplary embodiment, as Figure 12 shown, a token management device is provided, including: a request response module 1201 and a token update module 1202, where:
[0151] The request response module 1201 is configured to obtain the storage performance parameter value corresponding to the access request instruction in response to the access request instruction;
[0152] The token update module 1202 is configured to delete the corresponding token amount from the token bucket of the storage system according to the storage performance parameter value; the tokens in the token bucket are filled evenly based on the maximum token amount at a preset time interval; the maximum token amount is determined according to the storage performance upper limit of the storage system within a quality of service cycle.
[0153] In an exemplary embodiment, the token management device further includes: a cycle determination module, a token amount determination module, and a token filling module, where:
[0154] The cycle determination module is configured to obtain multiple filling cycles corresponding to the quality of service cycle for any quality of service cycle;
[0155] A token quantity determination module, configured to determine the filling token quantity for each filling period according to the maximum token quantity;
[0156] A token filling module, configured to fill the token bucket with tokens corresponding to the filling token quantity according to each filling period.
[0157] In an exemplary embodiment, the period determination module is further configured to evenly divide the quality of service period at a preset time interval to obtain a plurality of filling periods.
[0158] In an exemplary embodiment, the token quantity determination module further includes a first determination unit and a second determination unit, where:
[0159] The first determination unit is configured to evenly distribute the maximum token quantity to each filling period to obtain the initial filling token quantity for each filling period;
[0160] The second determination unit is configured to determine the filling token quantity for each filling period according to each initial filling token quantity.
[0161] In an exemplary embodiment, the second determination unit includes a remaining quantity acquisition subunit, a difference quantity acquisition subunit, and a token comparison subunit, where:
[0162] The remaining quantity acquisition subunit is configured to, for any filling period, acquire the remaining token quantity of the storage bucket in the filling period;
[0163] The difference quantity acquisition subunit is configured to determine the token capacity difference of the storage bucket according to the maximum token quantity and the remaining token quantity;
[0164] The token comparison subunit is configured to compare the token capacity difference with the initial filling token quantity to obtain the filling token quantity of the filling period.
[0165] In an exemplary embodiment, the token comparison subunit includes a first comparison subunit and a second comparison subunit, where:
[0166] The first comparison subunit is configured to, if the token capacity difference is greater than or equal to the initial filling token quantity, determine the initial filling token quantity as the filling token quantity of the filling period;
[0167] The second comparison subunit is configured to, if the token capacity difference is less than the initial filling token quantity, determine the token capacity difference as the filling token quantity of the filling period;
[0168] In an exemplary embodiment, the storage performance parameter value includes storage bandwidth, and / or, the number of read and write operations per second.
[0169] Each module in the above token management device can be implemented in whole or in part by software, hardware, and their combination. Each of the above modules can be embedded in the processor of the computer device in hardware form or be independent of it, or can be stored in the memory of the computer device in software form, so that the processor can call and execute the operations corresponding to each of the above modules.
[0170] In an exemplary embodiment, a computer device is provided, including a memory and a processor. A computer program is stored in the memory. When the processor executes the computer program, the following steps are implemented:
[0171] In response to an access request instruction, obtain the storage performance parameter value corresponding to the access request instruction;
[0172] According to the storage performance parameter value, delete the corresponding token amount from the token bucket of the storage system; the tokens in the token bucket are filled evenly based on the maximum token amount at a preset time interval; the maximum token amount is determined according to the storage performance upper limit of the storage system within a quality of service cycle.
[0173] In an exemplary embodiment, when the processor executes the computer program, the following steps are further implemented:
[0174] For any quality of service cycle, obtain multiple filling cycles corresponding to the quality of service cycle;
[0175] According to the maximum token amount, determine the filling token amount for each filling cycle;
[0176] According to each filling cycle, fill the token bucket with tokens corresponding to the filling token amount.
[0177] In an exemplary embodiment, when the processor executes the computer program, the following steps are further implemented:
[0178] Divide the quality of service cycle evenly according to a preset time interval to obtain multiple filling cycles.
[0179] In an exemplary embodiment, when the processor executes the computer program, the following steps are further implemented:
[0180] Average the maximum token amount and distribute it to each filling cycle to obtain the initial filling token amount for each filling cycle;
[0181] According to each initial filling token amount, determine the filling token amount for each filling cycle.
[0182] In an exemplary embodiment, when the processor executes the computer program, the following steps are further implemented:
[0183] For any filling cycle, obtain the remaining token amount of the storage bucket under the filling cycle;
[0184] Determine the token capacity difference of the bucket according to the maximum token amount and the remaining token amount;
[0185] Compare the token capacity difference with the initial filling token amount to obtain the filling token amount for the filling period.
[0186] In an exemplary embodiment, when the processor executes the computer program, the following steps are further implemented:
[0187] If the token capacity difference is greater than or equal to the initial filling token amount, determine the initial filling token amount as the filling token amount for the filling period;
[0188] If the token capacity difference is less than the initial filling token amount, determine the token capacity difference as the filling token amount for the filling period.
[0189] In an exemplary embodiment, the storage performance parameter value includes storage bandwidth, and / or the number of read / write operations per second.
[0190] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the following steps are implemented:
[0191] In response to an access request instruction, obtain the storage performance parameter value corresponding to the access request instruction;
[0192] Delete the corresponding token amount from the token bucket of the storage system according to the storage performance parameter value; the tokens in the token bucket are filled evenly at a preset time interval based on the maximum token amount; the maximum token amount is determined according to the storage performance upper limit of the storage system within a quality of service cycle.
[0193] In an exemplary embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0194] For any quality of service cycle, obtain multiple filling periods corresponding to the quality of service cycle;
[0195] Determine the filling token amount for each filling period according to the maximum token amount;
[0196] Fill the token bucket with tokens corresponding to the filling token amount according to each filling period.
[0197] In an exemplary embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0198] Divide the quality of service cycle evenly at a preset time interval to obtain multiple filling periods.
[0199] In an exemplary embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0200] Average the maximum token amount over each filling period to obtain the initial filling token amount for each filling period;
[0201] Determine the filling token amount for each filling period according to each initial filling token amount.
[0202] In an exemplary embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0203] For any filling period, obtain the remaining token amount of the bucket in the filling period;
[0204] Determine the token capacity difference of the bucket according to the maximum token amount and the remaining token amount;
[0205] Compare the token capacity difference with the initial filling token amount to obtain the filling token amount for the filling period.
[0206] In an exemplary embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0207] If the token capacity difference is greater than or equal to the initial filling token amount, determine the initial filling token amount as the filling token amount for the filling period;
[0208] If the token capacity difference is less than the initial filling token amount, determine the token capacity difference as the filling token amount for the filling period.
[0209] In an exemplary embodiment, the storage performance parameter value includes storage bandwidth, and / or, the number of read / write operations per second.
[0210] In an exemplary embodiment, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the following steps are implemented:
[0211] In response to an access request instruction, obtain the storage performance parameter value corresponding to the access request instruction;
[0212] Delete the corresponding token amount from the token bucket of the storage system according to the storage performance parameter value; the tokens in the token bucket are filled evenly based on the maximum token amount at a preset time interval; the maximum token amount is determined according to the storage performance upper limit of the storage system within a quality of service period.
[0213] In an exemplary embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0214] For any quality of service period, obtain multiple filling periods corresponding to the quality of service period;
[0215] Determine the filling token amount for each filling period according to the maximum token amount;
[0216] Tokens corresponding to the filling token amount are filled into the token bucket according to each filling period.
[0217] In an exemplary embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0218] The quality-of-service period is evenly divided according to a preset time interval to obtain a plurality of filling periods.
[0219] In an exemplary embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0220] The maximum token amount is evenly distributed to each filling period to obtain the initial filling token amount for each filling period;
[0221] According to each initial filling token amount, the filling token amount for each filling period is determined.
[0222] In an exemplary embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0223] For any filling period, obtain the remaining token amount in the storage bucket under the filling period;
[0224] According to the maximum token amount and the remaining token amount, determine the token capacity difference of the storage bucket;
[0225] Compare the token capacity difference with the initial filling token amount to obtain the filling token amount for the filling period.
[0226] In an exemplary embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0227] If the token capacity difference is greater than or equal to the initial filling token amount, the initial filling token amount is determined as the filling token amount for the filling period;
[0228] If the token capacity difference is less than the initial filling token amount, the token capacity difference is determined as the filling token amount for the filling period.
[0229] In an exemplary embodiment, the storage performance parameter value includes storage bandwidth and / or the number of read / write operations per second.
[0230] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in this application are all information and data that have been authorized by the user or fully authorized by all parties, and the collection, use, and processing of relevant data need to comply with relevant regulations.
[0231] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above methods. Among them, any reference to a memory, database, or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memories. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc. The databases involved in the embodiments provided in the present application can include at least one of relational databases and non-relational databases. Non-relational databases can include distributed databases based on blockchain, etc., without limitation. The processors involved in the embodiments provided in the present application can be general-purpose processors, central processors, graphics processors, digital signal processors, programmable logic devices, data processing logics based on quantum computing, etc., without limitation.
[0232] The technical features of the above embodiments can be combined arbitrarily. For the sake of brevity of description, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, it should be considered as the scope described in this specification.
[0233] The above-described embodiments merely represent several implementation manners of the present application. The description thereof is relatively specific and detailed, but it should not be construed as a limitation on the patent scope of the present application. It should be noted that for those of ordinary skill in the art, without departing from the concept of the present application, several modifications and improvements can still be made, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the appended claims.
Claims
1. A token management method, characterized in that, The method includes: In response to an access request instruction, obtaining a storage performance parameter value corresponding to the access request instruction; According to the storage performance parameter value, deleting a corresponding amount of tokens from the token bucket of the storage system; the tokens in the token bucket are evenly filled based on a maximum token amount at a preset time interval; the maximum token amount is determined according to the storage performance upper limit of the storage system within a quality of service cycle.
2. The method according to claim 1, characterized in that, The method further includes: For any quality of service cycle, obtaining a plurality of filling cycles corresponding to the quality of service cycle; According to the maximum token amount, determining the filling token amount for each of the filling cycles; According to each of the filling cycles, filling tokens corresponding to the filling token amount into the token bucket.
3. The method according to claim 2, wherein The obtaining of the plurality of filling cycles corresponding to the quality of service cycle includes: Dividing the quality of service cycle evenly at a preset time interval to obtain the plurality of filling cycles.
4. The method according to claim 2 or 3, characterized in that, The determining of the filling token amount for each of the filling cycles according to the maximum token amount includes: Allocating the maximum token amount evenly to each of the filling cycles to obtain an initial filling token amount for each of the filling cycles; According to each of the initial filling token amounts, determining the filling token amount for each of the filling cycles.
5. The method according to claim 4, characterized in that, The determining of the filling token amount for each of the filling cycles according to each of the initial filling token amounts includes: For any filling cycle, obtaining the remaining token amount of the storage bucket in the filling cycle; According to the maximum token amount and the remaining token amount, determining the token capacity difference of the storage bucket; Comparing the token capacity difference with the initial filling token amount to obtain the filling token amount for the filling cycle.
6. The method according to claim 5, wherein The comparing of the token capacity difference with the initial filling token amount to obtain the filling token amount for the filling cycle includes: If the token capacity difference is greater than or equal to the initial filling token amount, determining the initial filling token amount as the filling token amount for the filling cycle; If the token capacity difference is less than the initial filling token amount, determining the token capacity difference as the filling token amount for the filling cycle.
7. The method according to any one of claims 1 to 3, characterized in that, The storage performance parameter value includes storage bandwidth, and / or, the number of read / write operations per second.
8. A token management device, characterized in that, The apparatus includes: A request response module, configured to obtain a storage performance parameter value corresponding to the access request instruction in response to the access request instruction; A token update module, configured to delete a corresponding amount of tokens from the token bucket of the storage system according to the storage performance parameter value; the tokens in the token bucket are evenly filled based on a maximum token amount at a preset time interval; the maximum token amount is determined according to the storage performance upper limit of the storage system within a quality of service cycle.
9. A computer device, comprising a memory and a processor, the memory storing a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the steps of the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Quality of service control method and device
CN109361733A
Data processing method and device, computer equipment and computer readable storage medium
CN115277577A
Service data processing request flow limiting method and device, equipment and medium
CN116566915A
Request Throttling in Distributed Storage Systems
US20210191650A1
Burst throttling for multi-tenant storage services
US9703602B1
Cited By
Cloud disk token management method and device for edge computing, equipment and product
CN120455380A