Resource allocation
By generating tag information for indicating the latest processing time and weight priority, the problem of unfair allocation of IO resources in shared storage technology is solved, and efficient and fair allocation of IO resources is achieved.
Patent Information
- Application Number
- PCT/CN2024/128078
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-11-15
- Filing Date
- 2024-10-29
- Publication Date
- 2025-05-22
AI Technical Summary
In shared storage technology, when multiple users access and operate data at the same time, appropriate input and output (IO) resources need to be allocated to each user to meet the data access and operation needs of different users, but the prior art is difficult to achieve fair and efficient IO resource allocation.
By generating the first tag information and the second tag information for the received IO resource allocation request, the first tag information is used to indicate the latest processing time of the resource allocation request, and the second tag information is used to indicate the weight priority information of the resource allocation request, and then IO resource allocation is performed based on these tag information to ensure fairness and efficiency of resource allocation.
It realizes the fair allocation of remaining IO resources while meeting the minimum IO resource needs of each user, making the resource allocation more fair and efficient, and can be reasonably allocated according to the request's latest processing time and weight priority.
Smart Images

Figure CN2024128078_22052025_PF_FP_ABST
Abstract
Description
Resource Allocation Technical Field
[0001] One or more embodiments of this specification relate to the field of computer technology, and more particularly, to a resource allocation method, apparatus, device, and medium. Background Art
[0002] With the rapid development of cloud computing, big data analysis, artificial intelligence and other fields, technologies such as distributed computing and parallel computing have emerged. Shared storage technology, as one of the foundations for the implementation of these technologies, has also been widely used in processing complex scenarios such as high concurrency and large data volumes.
[0003] Through shared storage technology, data can be stored in a distributed manner on multiple storage nodes, and a unified access interface and mechanism can be provided to achieve data sharing and access.
[0004] When using shared storage technology to implement data storage, multiple users can access and operate data at the same time. This requires allocating appropriate input / output (IO) resources to each user to meet the data access and operation needs of different users.
[0005] Summary of the Invention
[0006] In view of this, one or more embodiments of this specification provide a resource allocation method, apparatus, device, and medium.
[0007] To achieve the above objectives, one or more embodiments of this specification provide the following technical solutions.
[0008] According to a first aspect of one or more embodiments of this specification, a resource allocation method is proposed, including: generating first tag information and second tag information for multiple resource allocation requests received for obtaining input and output (IO) resources, the first tag information being used to indicate the latest processing time of the resource allocation request, and the second tag information being used to indicate weight priority information of the resource allocation request; performing IO resource allocation for the multiple resource allocation requests based on the first tag information, and updating the second tag information for the multiple resource allocation requests; and performing IO resource allocation for the multiple resource allocation requests based on the updated second tag information.
[0009] According to the second aspect of one or more embodiments of this specification, a resource allocation device is proposed, including: a generation module for generating first tag information and second tag information for multiple resource allocation requests received for obtaining input and output (IO) resources, the first tag information being used to indicate the latest processing time of the resource allocation request, and the second tag information being used to indicate the weight priority information of the resource allocation request; a resource allocation module for performing IO resource allocation for the multiple resource allocation requests based on the first tag information; an update module for updating the second tag information for the multiple resource allocation requests; and the resource allocation module further for performing IO resource allocation for the multiple resource allocation requests based on the updated second tag information.
[0010] According to a third aspect of one or more embodiments of this specification, a computing device is proposed, comprising: a processor; a memory for storing processor-executable instructions; wherein the processor implements the resource allocation method described in the first aspect above by running the executable instructions.
[0011] According to a fourth aspect of one or more embodiments of this specification, a computer-readable storage medium is provided, on which computer instructions are stored. When the computer instructions are executed by a processor, the resource allocation method described in the first aspect is implemented.
[0012] One or more embodiments of the present specification generate first tag information and second tag information for multiple resource allocation requests received for obtaining input and output IO resources. The first tag information can be used to indicate the latest processing time of the resource allocation request, and the second tag information can be used to indicate the weight priority information of the resource allocation request. Thus, IO resources can be allocated for multiple resource allocation requests based on the first tag information, so that the reserved resource amount of each resource allocation request can be satisfied in the order of the latest processing time of the request. In addition, the second tag information of multiple resource allocation requests can be updated, so that IO resources can be allocated for multiple resource allocation requests based on the second tag information, so that the remaining unallocated resource amount of each resource allocation request can be satisfied according to the weight priority level. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] FIG1 is a flowchart of a resource allocation method provided by an exemplary embodiment.
[0014] FIG2 is a flowchart of a resource allocation process provided by an exemplary embodiment.
[0015] FIG. 3 is a response rate curve diagram provided by an exemplary embodiment.
[0016] FIG. 4 is a response rate curve diagram provided by an exemplary embodiment.
[0017] FIG5 is a schematic structural diagram of a computing device provided by an exemplary embodiment.
[0018] FIG6 is a block diagram of a resource allocation device provided by an exemplary embodiment. DETAILED DESCRIPTION
[0019] Exemplary embodiments will be described in detail herein, with examples illustrated in the accompanying drawings. In the following description, when referring to the drawings, identical numerals in different figures represent identical or similar elements, unless otherwise indicated. The implementations described in the following exemplary embodiments are not intended to represent all implementations consistent with one or more embodiments of this specification. Rather, they are merely examples of apparatuses and methods consistent with certain aspects of one or more embodiments of this specification, as detailed in the appended claims.
[0020] It should be noted that in other embodiments, the steps of the corresponding method are not necessarily performed in the order shown and described in this specification. In some other embodiments, the method may include more or fewer steps than those described in this specification. In addition, a single step described in this specification may be broken down into multiple steps for description in other embodiments, and multiple steps described in this specification may be combined into a single step for description in other embodiments.
[0021] The user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this manual are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of relevant countries and regions, and corresponding operation entrances are provided for users to choose to authorize or refuse.
[0022] In related technologies, shared storage technology can provide multiple users with a certain amount of IO resources, such as Input / Output Operations Per Second (IOPS) or bandwidth service capacity, to provide technical support for multiple users' access and operations. However, each user's access requirements change dynamically over time, requiring a fair IO resource allocation solution to more fairly distribute the remaining IO resources to multiple users while still meeting their minimum IO resource requirements.
[0023] Optionally, the resource allocation method provided in this specification can be used to allocate IO resources in a distributed storage system, but is not limited thereto. The resource allocation method provided in this specification can also be applied to other scenarios involving IO resource allocation.
[0024] The above resource allocation method can be executed by a computing device, which can be a server, such as one server, multiple servers, a server cluster, a cloud computing platform, etc. This specification does not limit the device type and number of the computing device.
[0025] After introducing the resource allocation method provided in this specification, the specific implementation process of the resource allocation method provided in this specification is introduced next.
[0026] Referring to FIG. 1 , FIG. 1 is a flow chart of a resource allocation method provided by an exemplary embodiment. As shown in FIG. 1 , the method includes the following steps.
[0027] Step 101: Generate first tag information and second tag information for multiple resource allocation requests received for obtaining input and output (IO) resources. The first tag information is used to indicate the latest processing time of the resource allocation request, and the second tag information is used to indicate the weight priority information of the resource allocation request.
[0028] It should be noted that the computing device can receive multiple user requests for IO resource allocation from any user. For example, any user can trigger a resource allocation request for obtaining IO resources when there is a need to access data and / or operate data. The computing device can receive the resource allocation request and then perform IO resource allocation based on the received resource allocation request.
[0029] Optionally, each time a resource allocation request is received, the first label information and the second label information may be generated for the received resource allocation request.
[0030] Step 102: Allocate IO resources for multiple resource allocation requests according to the first tag information, and update the second tag information of the multiple resource allocation requests.
[0031] It should be noted that the first tag information can be used to indicate the latest processing time of the resource allocation request. By allocating IO resources based on the first tag information, it is ensured that IO resources can be allocated in the order of the latest processing time of the requests, so as to ensure that the minimum IO resource requirement of each user (that is, the reserved resource amount) can be met.
[0032] The reserved resources (reservation) may be the minimum service capacity that the system guarantees to reserve for the user.
[0033] Step 103: Allocate IO resources for multiple resource allocation requests according to the updated second tag information.
[0034] It should be noted that the second tag information can be used to indicate the weight priority information of the resource allocation request. By allocating IO resources according to the second tag information, it is ensured that IO resources can be allocated according to the weight priority of the resource allocation request, so as to ensure that the remaining resources can be allocated to multiple users according to the weight ratio.
[0035] The above embodiment generates first tag information and second tag information for multiple resource allocation requests received for obtaining input and output IO resources. The first tag information can be used to indicate the latest processing time of the resource allocation request, and the second tag information can be used to indicate the weight priority information of the resource allocation request. Therefore, IO resources can be allocated for multiple resource allocation requests based on the first tag information, so that the reserved resource amount of each resource allocation request can be satisfied in the order of the latest processing time of the request. In addition, the second tag information of multiple resource allocation requests can be updated, so that IO resources can be allocated for multiple resource allocation requests based on the second tag information, so that the remaining unallocated resource amount of each resource allocation request can be satisfied according to the weight priority level.
[0036] After introducing the basic implementation process of this specification, the following describes in detail the various optional implementation methods of this specification.
[0037] In some embodiments, for step 101, taking the case where the currently received resource allocation request is the k+1th resource allocation request of the target user (such as the i-th user) as an example, when generating first tag information and second tag information for multiple resource allocation requests received for obtaining input and output (IO) resources, it can be achieved through the following steps.
[0038] Step 1011: For the received k+1th resource allocation request of the target user, generate first label information for the first resource allocation request based on the first label information of the Kth resource allocation request of the target user, the reserved resource information pre-set for the target user, and the request reception time of the K+1th resource allocation request.
[0039] In one possible implementation, the first alternative tag information can be determined based on the cumulative result of the first tag information of the k-th resource allocation request of the target user and the inverse of the reserved resource information, and the second alternative tag information can be determined based on the request reception time of the k+1-th resource allocation request; thereby, the first alternative tag information is determined based on the maximum value of the first alternative tag information and the second alternative tag information.
[0040] For example, the first label information of the k+1th resource allocation request of the i-th user may be determined according to the following formula (1):
[0041] in, Indicates the first tag information of the k+1th resource allocation request of the i-th user, Indicates the first label information of the k-th resource allocation request of the i-th user, r i represents the reserved resource amount set in advance for the i-th user, and t represents the request reception time of the k+1-th resource allocation request of the i-th user, where i and k are both positive integers greater than 0.
[0042] It should be noted that That is the first candidate label information, and t is the second candidate label information.
[0043] Optionally, the initial value of the first tag information may start from 0, that is, the first tag information of the first resource allocation request of each user may be 0, but is not limited thereto. This specification does not limit the initial value of the first tag information.
[0044] For the first tag information determined by the above formula (1), the earlier the resource allocation request arrives, the smaller the value of its first tag information. That is, the earlier the resource allocation request arrives, the earlier the latest processing time. In this way, when IO resources are subsequently allocated according to the first tag information, resource allocation requests with earlier request arrival times can be preferentially satisfied to ensure the rationality of the request processing process.
[0045] Step 1012: Generate second label information based on the second label information of the kth resource allocation request and weight information pre-set for the target user.
[0046] In a possible implementation, the second label information may be determined based on an accumulation result of the second label information of the kth resource allocation request and the inverse of the weight information.
[0047] For example, the second tag information of the k+1th resource allocation request of the i-th user may be determined according to the following formula (2):
[0048] in, The second tag information representing the k+1th resource allocation request of the i-th user, The second tag information of the kth resource allocation request of the i-th user, w i represents the weight information pre-set for the i-th user, where i and k are both positive integers greater than 0.
[0049] Optionally, the initial value of the second tag information may start from 0, that is, the second tag information of the first resource allocation request of each user may be 0, but the present specification does not limit the initial value of the second tag information.
[0050] In some embodiments, the second tag information of the k-th resource allocation request may be set to a first preset value every first preset time period. The value of is set to the first preset value.
[0051] The first preset duration may be any duration, for example, the first preset duration may be 1 second. The first preset value may be an initial value of the second tag information, for example, the first preset value may be 0.
[0052] The above embodiment only takes the generation of the first label information and the second label information for the k+1th resource allocation request of the i-th user as an example for explanation. The process of generating the first label information and the second label information for other resource allocation requests of the i-th user and resource allocation requests of other users is the same as the above process and will not be repeated here.
[0053] After the first tag information and the second tag information are generated for the resource allocation request through the above embodiment, IO resource allocation can be performed for multiple resource allocation requests according to the first tag information and the second tag information of each resource allocation request.
[0054] According to the resource allocation method provided in this specification, the request processing process can be divided into two stages: the reservation satisfaction stage and the weight priority stage. In the reservation satisfaction stage, IO resource allocation can be performed for the resource allocation request based on the first tag information. In the weight priority stage, IO resource allocation can be performed for the resource allocation request based on the second tag information. Optionally, each resource allocation request can be further processed in the weight priority stage only after it has been processed in the reservation satisfaction stage.
[0055] In some embodiments, for step 102, when performing IO resource allocation for multiple resource allocation requests according to the first tag information, it can be implemented in the following manner.
[0056] For resource allocation requests whose first tag information is less than or equal to the current timestamp, IO resources may be allocated to the multiple resource allocation requests in ascending order of the first tag information.
[0057] For example, in the reservation satisfaction stage, resource allocation requests whose first tag information is less than or equal to the current timestamp can be processed in ascending order according to the size of the first tag information, so that resource allocation requests with earlier processing time (that is, more urgent processing time) can be satisfied first.
[0058] Optionally, the second tag information of multiple resource allocation requests can be updated based on the request processing status. For step 102, when updating the second tag information of multiple resource allocation requests, for the third resource allocation request to which IO resources are allocated based on the second tag information, the first tag information of the unprocessed resource allocation request of the user corresponding to the third resource allocation request can be updated. The unprocessed resource allocation request of the user corresponding to the third resource allocation request can be referred to as the fourth resource allocation request. That is, for the third resource allocation request to which IO resources are allocated based on the second tag information, the first tag information of the fourth resource allocation request can be updated. The fourth resource allocation request is also the unprocessed resource allocation request of the user corresponding to the third resource allocation request.
[0059] In a possible implementation, when the first tag information of the fourth resource allocation request is updated, it can be implemented in the following manner.
[0060] For any fourth resource allocation request among the fourth resource allocation requests, the reciprocal of the reserved resource amount of the user corresponding to the fourth resource allocation request is subtracted from the first label information of the fourth resource allocation request to obtain updated first label information.
[0061] For example, if the resource allocation request of the i-th user is processed in the weight priority stage, then after the processing of the resource allocation request of the i-th user is completed, the first tag information of other unprocessed resource allocation requests of the i-th user can be subtracted from the inverse of the reserved resource amount of the i-th user to achieve the update of the first tag information of the unprocessed resource allocation requests of the i-th user.
[0062] By updating the second tag information, the second tag information of each resource allocation request can reflect the current request processing status in real time, thereby ensuring that the subsequent request processing process is more in line with the actual request processing situation and improving the real-time and accuracy of the request processing process.
[0063] In some embodiments, step 103 , when allocating IO resources for multiple resource allocation requests according to the second tag information, can be implemented in the following manner.
[0064] IO resources are allocated for the multiple resource allocation requests in ascending order of the second tag information.
[0065] For example, in the weight priority stage, if the system still has remaining resources, it can be processed in order of the size of the second tag information from small to large, that is, the resource allocation request with the smallest second tag information is prioritized for processing, so that the resource allocation request with higher processing priority can be satisfied first.
[0066] Optionally, the first tag information of the unprocessed resource allocation request may be updated according to the request processing status.
[0067] In some embodiments, for a first resource allocation request to which IO resources are allocated based on first tag information, the second tag information of an unprocessed resource allocation request of a user corresponding to the first resource allocation request may be updated. The unprocessed resource allocation request of the user corresponding to the first resource allocation request may be referred to as a second resource allocation request. That is, for a first resource allocation request to which IO resources are allocated based on the first tag information, the second tag information of a second resource allocation request may be updated. The second resource allocation request is also the unprocessed resource allocation request of the user corresponding to the first resource allocation request.
[0068] In a possible implementation, when the second tag information of the second resource allocation request is updated, it can be implemented in the following manner.
[0069] For any second resource allocation request in the second resource allocation request, the inverse of the weight information of the user corresponding to the second resource allocation request is subtracted from the second label information of the second resource allocation request to obtain updated second label information.
[0070] For example, if the resource allocation request of the i-th user is processed in the reservation satisfaction stage, then when the resource allocation request of the i-th user is processed, the second tag information of other unprocessed resource allocation requests of the i-th user can be subtracted from the inverse of the i-th user's weight information as a whole to achieve the update of the second tag information of the i-th user's unprocessed resource allocation requests.
[0071] By updating the first tag information, it is ensured that the first tag information of each resource allocation request can reflect the current request processing status in real time, thereby ensuring that the subsequent request processing process is more in line with the actual request processing situation, and improving the real-time and accuracy of the request processing process.
[0072] It should be noted that the above embodiment mainly introduces the request processing process when there is a resource allocation request with the first tag information less than or equal to the current timestamp. In more possible implementation methods, if there is no resource allocation request with the first tag information less than or equal to the current timestamp, IO resources can be directly allocated for multiple resource allocation requests according to the second tag information.
[0073] Optionally, when allocating IO resources for multiple resource allocation requests, it is possible to first determine whether there is a resource allocation request whose first tag information is less than or equal to the current timestamp. If there is a resource allocation request whose first tag information is less than or equal to the current timestamp, IO resources are allocated to the multiple resource allocation requests according to the first tag information, and the second tag information of the multiple resource allocation requests is updated so that subsequent allocation of IO resources can be performed according to the updated second tag information; if there is no resource allocation request whose first tag information is less than or equal to the current timestamp, IO resources can be directly allocated to the multiple resource allocation requests according to the second tag information.
[0074] The resource allocation process provided by the above embodiment can be seen in Figure 2. Figure 2 is a flow chart of a resource allocation process provided by an exemplary embodiment. As shown in Figure 2, during the resource allocation process, it can be first determined whether there is a resource allocation request with a first tag information less than or equal to the current timestamp. If there is a resource allocation request with a first tag information less than or equal to the current timestamp, the resource allocation request with the smallest first tag information can be processed, and after the request processing is completed, the second tag information of other resource allocation requests of the user to which the processed resource allocation request belongs is updated; if there is no resource allocation request with a first tag information less than or equal to the current timestamp, the resource allocation request with the smallest second tag information can be processed, and after the request processing is completed, the first tag information of other resource allocation requests of the user to which the processed resource allocation request belongs is updated. After the current request processing is completed, the process of determining whether there is a resource allocation request with a first tag information less than or equal to the current timestamp can be entered again, and then the resource allocation request processing can be continued according to the determination result.
[0075] It should be noted that during the resource allocation request processing process, due to the weight-based competition processing mechanism in the weight priority stage, it is very likely that a user's request will not be processed for a long time in the weight priority stage, resulting in the request scheduling in the weight priority stage not being smooth enough. To address this situation, a decay mechanism can be provided to update the second tag information of a user's resource allocation request when the user is idle for a long time in the weight priority stage, so as to increase its competitiveness in the later stage and make the overall scheduling of the resource allocation process smoother.
[0076] For example, the entire request processing process can be divided into three stages: early, middle, and late. Suppose there are two users, and their activity in each stage is as follows.
[0077] User 1: active in the early stage, idle in the middle stage, and active in the late stage.
[0078] User 2: Idle in the early stage, idle in the middle stage, active in the late stage.
[0079] If user one is active in the early stages, many of user one's resource allocation requests will be processed during the reservation satisfaction phase, causing the second tag information of user one's resource allocation requests to accumulate to a higher level. However, if user two is relatively idle in the early and middle stages, fewer resource allocation requests from user two will be processed during the reservation satisfaction phase, and the first tag information of user two's resource allocation requests will be relatively small. Therefore, in the later stages, most of the resource allocation requests processed during the weighted priority phase will be from user two, and user one's resource allocation request can only be processed during the weighted priority phase when the second tag information of user two's resource allocation request accumulates to the same level as user one. From the perspective of the entire cycle, the scheduling of user one's resource allocation request is not smooth enough. In this case, the attenuation mechanism provided in this specification can be used to update the second tag information of user one's resource allocation request to increase its competitiveness in the later stages, making the overall scheduling of the resource allocation process smoother.
[0080] In some embodiments, when IO resources are allocated for resource allocation requests based on the second tag information, for users whose resource allocation requests have not been processed within the second preset time period, the second tag information of the user's unprocessed resource allocation request can be updated based on the second tag information of the user's first target resource allocation request, the processing time of the first target resource allocation request, and the current time.
[0081] The first target resource allocation request may be a processed resource allocation request of the user whose processing time is closest to the current time.
[0082] In some embodiments, updating the second tag information based on the second tag information of the user's first target resource allocation request, the processing time of the first target resource allocation request, and the current time can be achieved through the following steps.
[0083] Step 1: Determine a decay coefficient based on the processing time of the first target resource allocation request, the current time, and preset parameters.
[0084] In one possible implementation, the time difference can be determined based on the current time and the processing time of the first target resource allocation request, and thus the attenuation index can be determined based on the time difference and the first preset parameter, and then the attenuation index can be used as the exponential value of the second preset parameter to determine the attenuation coefficient.
[0085] The first preset parameter can be a decay constant. The value of the first preset parameter can be set according to actual needs. The larger the value of the first preset parameter is, the faster the decay speed of the second tag information is. It takes time for the value to decay to half of the original value. In practice, the value of λ can be adjusted as needed. The second preset constant can be a natural constant e, which has a value of approximately 2.71828.
[0086] Step 2: Based on the second tag information of the first target resource allocation request and the attenuation coefficient, update the second tag information of the unprocessed resource allocation request of the user.
[0087] In a possible implementation, the second tag information of the user's unprocessed resource allocation request may be updated through the following steps.
[0088] Step 1: Determine third candidate label information based on the second label information and the attenuation coefficient of the first target resource allocation request.
[0089] Optionally, the product of the second label information of the first target resource allocation request and the attenuation coefficient may be determined as the third candidate label information.
[0090] For example, the third candidate label information may be determined according to the following formula (3):
[0091] in, represents the third candidate label information of the i-th user, represents the second tag information of the first target resource allocation request of the i-th user, t1 represents the processing time of the first target resource allocation request, t2 represents the current time, λ represents the first preset parameter (that is, the decay constant), and e is the second preset parameter (that is, the natural constant), where i and k are both positive integers greater than 0.
[0092] Step 2: Based on the third alternative tag information and the weight information pre-set for the user, determine the updated second tag information of the second target resource allocation request, where the second target resource allocation request is the unprocessed resource allocation request with the request reception time farthest from the current time among the unprocessed resource allocation requests of the user.
[0093] In a possible implementation, the accumulated result of the third candidate label information and the inverse of the weight information pre-set for the user may be determined as the updated second label information of the second target resource allocation request.
[0094] It should be noted that when the computing device receives resource allocation requests from different users, it can maintain the resource allocation requests from different users through different request queues. The request queue can process the user's unprocessed resource allocation requests according to the first-in-first-out principle. Based on this, when determining the updated second tag information of the second target resource allocation request based on the third alternative tag information and the weight information pre-set for the user, the second tag information of the resource allocation request at the head of the user's request queue can be updated to the sum of the third alternative tag information and the inverse of the user's weight information.
[0095] Step 3: Based on the updated second tag information of the second target resource allocation request, determine the updated second tag information of other unprocessed resource allocation requests of the user.
[0096] In one possible implementation, for any unprocessed resource allocation request among the user's other unprocessed resource allocation requests, the second tag information of the resource allocation request can be updated to the cumulative result of the second tag information of the previous unprocessed resource allocation request and the inverse of the user's weight information.
[0097] That is, starting from the second unprocessed resource allocation request in the request queue, the second tag information of each unprocessed resource allocation request can be updated in sequence to the sum of the second tag information of the previous unprocessed resource allocation request and the inverse of the user's weight information.
[0098] Through the resource allocation method provided in this specification, in the reservation satisfaction stage, the reserved resource quota allocated to the user will be used to perform the first stage of processing the user's resource allocation request. After the request is processed in this stage, the user's unprocessed resource allocation requests will be updated to reduce the user's unprocessed resource allocation requests as a whole by a value. Overall, it does not affect the user's competitive advantage in the weight priority stage.
[0099] In the weight priority stage, newly received resource allocation requests will be counted starting from the first preset value (such as 0) at the beginning of each cycle. This ensures that within a fixed period, each user will be allocated a request processing quota according to their weight information. If the quota within a cycle is not used up, the quota will be reallocated in the next cycle, but the usage will still be re-counted starting from the first preset value.
[0100] To verify the effectiveness of the resource allocation method provided in this specification, the applicant conducted the following experiments.
[0101] (1) Assume three users with the same weight, with reserved resource amounts of 100, 60, and 40, respectively, request sending rates of 200, 100, and 10, and a total IO resource quota of 200. Through the resource allocation method provided in this specification, the final response rates of the three users are 115, 75, and 10. The response rate curves of the three users can be seen in Figure 3, which is a response rate curve provided by an exemplary embodiment.
[0102] (2) Set three users 1, 2, and 3 with weights of 1, 2, and 3 respectively, and reserve resources of 60, 30, and 20 respectively. The request sending rates are 100, 100, and 100, and the total IO resource quota is 200. Through the resource allocation method provided in this specification, the final response rates of the three users are 75, 60, and 65. The response rate curves of the three users can be seen in Figure 4, which is a response rate curve provided by an exemplary embodiment.
[0103] Corresponding to the aforementioned method embodiments, this specification also provides corresponding device embodiments.
[0104] Refer to Figure 5, which is a schematic structural diagram of a computing device provided by an exemplary embodiment. Please refer to Figure 5. At the hardware level, the device includes a processor 502, an internal bus 504, a network interface 506, a memory 508, and a non-volatile memory 510. Of course, it may also include hardware required for other tasks. One or more embodiments of this specification can be implemented based on software, such as the processor 502 reading the corresponding computer program from the non-volatile memory 510 into the memory 508 and then running it. Of course, in addition to software implementation, one or more embodiments of this specification do not exclude other implementation methods, such as logic devices or a combination of software and hardware, etc., that is, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.
[0105] This specification also provides a resource allocation device. Please refer to Figure 6. Figure 6 is a block diagram of a resource allocation device provided by an exemplary embodiment. The resource allocation device can be applied to the computing device shown in Figure 5 to implement the technical solution of this specification. The resource allocation device may include: a generation module 601, which is used to generate first tag information and second tag information for multiple resource allocation requests received for obtaining input and output IO resources, the first tag information is used to indicate the latest processing time of the resource allocation request, and the second tag information is used to indicate the weight priority information of the resource allocation request; a resource allocation module 602, which is used to allocate IO resources for multiple resource allocation requests based on the first tag information; an update module 603, which is used to update the second tag information of multiple resource allocation requests; and the resource allocation module 602 is also used to allocate IO resources for multiple resource allocation requests based on the updated second tag information.
[0106] In some embodiments, the generation module 601, when used to generate first tag information and second tag information for multiple resource allocation requests received for obtaining input and output (IO) resources, is used to: for the k+1th resource allocation request received from the target user, based on the first tag information of the kth resource allocation request of the target user, the reserved resource information pre-set for the target user, and the request reception time of the k+1th resource allocation request, generate first tag information for the first resource allocation request; based on the second tag information of the kth resource allocation request and the weight information pre-set for the target user, generate second tag information.
[0107] In some embodiments, the generation module 601, when used to generate the first tag information for the first resource allocation request based on the first tag information of the k-th resource allocation request of the target user, the reserved resource information pre-set for the target user, and the request reception time of the k+1-th resource allocation request, is used to: determine the first alternative tag information based on the cumulative result of the first tag information of the k-th resource allocation request of the target user and the inverse of the reserved resource information, and determine the second alternative tag information based on the request reception time of the k+1-th resource allocation request; determine the first tag information based on the maximum value of the first alternative tag information and the second alternative tag information.
[0108] In some embodiments, the generation module 601, when used to generate the second tag information based on the second tag information of the kth resource allocation request and the weight information pre-set for the target user, is used to: determine the second tag information based on the cumulative result of the second tag information of the kth resource allocation request and the inverse of the weight information.
[0109] In some embodiments, the generating module 601 is further configured to set the second tag information of the k-th resource allocation request to a first preset value every first preset time period.
[0110] In some embodiments, the resource allocation module 602, when used to perform IO resource allocation for multiple resource allocation requests based on the first tag information, is used to: for resource allocation requests whose first tag information is less than or equal to the current timestamp, perform IO resource allocation for the multiple resource allocation requests in ascending order of the first tag information.
[0111] In some embodiments, the update module 603, when used to update the second tag information of multiple resource allocation requests, is used to: for a first resource allocation request to which IO resources are allocated according to the first tag information, update the second tag information of a second resource allocation request, where the second resource allocation request is an unprocessed resource allocation request of the user corresponding to the first resource allocation request.
[0112] In some embodiments, the update module 603, when used to update the second tag information of the second resource allocation request, is used to: for any second resource allocation request in the second resource allocation request, subtract the inverse of the weight information of the user corresponding to the second resource allocation request from the second tag information of the second resource allocation request to obtain the updated second tag information.
[0113] In some embodiments, the resource allocation module 602 is further configured to allocate IO resources for multiple resource allocation requests according to the second tag information if there is no resource allocation request with the first tag information less than or equal to the current timestamp.
[0114] In some embodiments, when allocating IO resources for multiple resource allocation requests based on the updated second tag information, the resource allocation module 602 is configured to allocate IO resources for the multiple resource allocation requests in ascending order of the updated second tag information.
[0115] In some embodiments, the update module 603 is further configured to update the first tag information of the fourth resource allocation request for the third resource allocation request to which IO resources are allocated according to the second tag information, where the fourth resource allocation request is an unprocessed resource allocation request of the user corresponding to the third resource allocation request.
[0116] In some embodiments, the update module 603, when used to update the first tag information of the fourth resource allocation request, is used to: for any fourth resource allocation request in the fourth resource allocation request, subtract the inverse of the reserved resource amount of the user corresponding to the fourth resource allocation request from the first tag information of the fourth resource allocation request to obtain the updated first tag information.
[0117] In some embodiments, when IO resources are allocated for a resource allocation request based on the second tag information, the update module 603 is further used to: for a user whose resource allocation request has not been processed within a second preset time period, update the second tag information of the user's unprocessed resource allocation request based on the second tag information of the user's first target resource allocation request, the processing time of the first target resource allocation request, and the current time, where the first target resource allocation request is the processed resource allocation request whose processing time is closest to the current time among the user's processed resource allocation requests.
[0118] In some embodiments, the update module 603, when updating the second tag information based on the second tag information of the user's first target resource allocation request, the processing time of the first target resource allocation request and the current time, is used to: determine the attenuation coefficient based on the processing time of the first target resource allocation request, the current time and preset parameters; and update the second tag information of the target user's unprocessed resource allocation request based on the second tag information of the first target resource allocation request and the attenuation coefficient.
[0119] In some embodiments, the update module 603, when used to update the second tag information of the user's unprocessed resource allocation request based on the second tag information and the attenuation coefficient of the first target resource allocation request, is used to: determine the third alternative tag information based on the second tag information and the attenuation coefficient of the first target resource allocation request; determine the updated second tag information of the second target resource allocation request based on the third alternative tag information and the weight information pre-set for the user, the second target resource allocation request being the unprocessed resource allocation request among the user's unprocessed resource allocation requests whose request reception time is farthest from the current time; determine the updated second tag information of other unprocessed resource allocation requests of the user based on the updated second tag information of the second target resource allocation request.
[0120] The systems, devices, modules, or units described in the above embodiments may be implemented by computer chips or entities, or by products having certain functions. A typical implementation device is a computer, which may be in the form of a personal computer, laptop computer, cellular phone, camera phone, smartphone, personal digital assistant, media player, navigation device, email transceiver, game console, tablet computer, wearable device, or any combination of these devices.
[0121] In a typical configuration, a computer includes one or more processors (Central Processing Unit, CPU), input / output interfaces, network interfaces, and memory.
[0122] Memory may include non-permanent storage in a computer-readable medium, random access memory (RAM), and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of a computer-readable medium.
[0123] Computer-readable media include permanent and non-permanent, removable and non-removable media that can be used to store information by any method or technology. Information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change random access memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, magnetic disk storage, quantum memory, graphene-based storage media or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. According to the definition in this article, computer-readable media does not include temporary computer-readable media (transitory media), such as modulated data signals and carrier waves.
[0124] It should also be noted that the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, commodity, or apparatus that includes a series of elements includes not only those elements but also other elements not explicitly listed, or includes elements inherent to such process, method, commodity, or apparatus. In the absence of further limitations, an element defined by the phrase "comprises a ..." does not exclude the presence of other identical elements in the process, method, commodity, or apparatus that includes the element.
[0125] The foregoing description of this specification describes specific embodiments. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims can be performed in an order different from that described in the embodiments and still achieve the desired results. Furthermore, the processes depicted in the accompanying drawings do not necessarily require the specific order shown or the sequential order to achieve the desired results. In certain embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0126] The terms used in one or more embodiments of this specification are for the purpose of describing specific embodiments only and are not intended to limit one or more embodiments of this specification. The singular forms "a," "an," "the," and "the" used in one or more embodiments of this specification and the appended claims are also intended to include plural forms unless the context clearly indicates otherwise. It should also be understood that the term "and / or" used herein refers to and includes any or all possible combinations of one or more associated listed items.
[0127] It should be understood that although the terms first, second, third, etc. may be used to describe various information in one or more embodiments of this specification, such information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of one or more embodiments of this specification, first information may also be referred to as second information, and similarly, second information may also be referred to as first information. Depending on the context, the word "if" as used herein may be interpreted as "when..." or "when..." or "in response to determining."
[0128] The above description is merely a preferred embodiment of one or more embodiments of this specification and is not intended to limit one or more embodiments of this specification. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of one or more embodiments of this specification shall be included in the scope of protection of one or more embodiments of this specification.
Claims
1. A resource allocation method, the method comprising: Generate first tag information and second tag information for multiple resource allocation requests received for obtaining input and output (IO) resources, wherein the first tag information is used to indicate the latest processing time of the resource allocation request, and the second tag information is used to indicate weight priority information of the resource allocation request; Allocate IO resources for the multiple resource allocation requests according to the first label information, and update second label information of the multiple resource allocation requests; IO resources are allocated for the multiple resource allocation requests according to the updated second tag information.
2. The method according to claim 1, wherein generating first tag information and second tag information for a plurality of received resource allocation requests for obtaining input and output (IO) resources comprises: For the received k+1th resource allocation request of the target user, generating first label information for the first resource allocation request based on the first label information of the kth resource allocation request of the target user, the reserved resource information pre-set for the target user, and the request reception time of the k+1th resource allocation request; The second label information is generated based on the second label information of the kth resource allocation request and the weight information pre-set for the target user.
3. The method according to claim 2, wherein generating first label information for the first resource allocation request based on the first label information of the kth resource allocation request of the target user, the reserved resource information pre-set for the target user, and the request reception time of the k+1th resource allocation request comprises: Determine the first candidate label information based on the accumulation result of the first label information of the k-th resource allocation request of the target user and the inverse of the reserved resource information, and determine the second candidate label information based on the request reception time of the k+1-th resource allocation request; The first label information is determined based on a maximum value between the first candidate label information and the second candidate label information.
4. The method according to claim 2, wherein the generating the second label information based on the second label information of the k-th resource allocation request and the weight information pre-set for the target user comprises: The second label information is determined based on an accumulation result of the second label information of the kth resource allocation request and the inverse of the weight information.
5. The method according to claim 4, further comprising: Every first preset time period, the second tag information of the kth resource allocation request is set to a first preset value.
6. The method according to claim 1, allocating IO resources for the multiple resource allocation requests according to the first tag information, comprises: For resource allocation requests whose first tag information is less than or equal to the current timestamp, IO resources are allocated for the multiple resource allocation requests in ascending order of the first tag information.
7. The method according to claim 1, wherein updating the second tag information of the plurality of resource allocation requests comprises: For the first resource allocation request to which the IO resource is allocated according to the first label information, the second label information of the second resource allocation request is updated, where the second resource allocation request is an unprocessed resource allocation request of the user corresponding to the first resource allocation request.
8. The method according to claim 7, wherein updating the second tag information of the second resource allocation request comprises: For any second resource allocation request in the second resource allocation request, the inverse of the weight information of the user corresponding to the second resource allocation request is subtracted from the second label information of the second resource allocation request to obtain updated second label information.
9. The method according to claim 1, after generating the first tag information and the second tag information for the received multiple resource allocation requests for acquiring input and output (IO) resources, the method further comprises: If there is no resource allocation request whose first tag information is less than or equal to the current timestamp, IO resources are allocated for the multiple resource allocation requests according to the second tag information.
10. The method according to claim 1, wherein allocating IO resources for the multiple resource allocation requests according to the updated second tag information comprises: IO resources are allocated for the multiple resource allocation requests in ascending order of the updated second tag information.
11. The method according to claim 1, further comprising: For the third resource allocation request to which the IO resource is allocated according to the second label information, the first label information of the fourth resource allocation request is updated, and the fourth resource allocation request is an unprocessed resource allocation request of the user corresponding to the third resource allocation request.
12. The method according to claim 11, wherein updating the first tag information of the fourth resource allocation request comprises: For any fourth resource allocation request among the fourth resource allocation requests, the reciprocal of the reserved resource amount of the user corresponding to the fourth resource allocation request is subtracted from the first label information of the fourth resource allocation request to obtain updated first label information.
13. The method according to claim 1, when performing IO resource allocation for the resource allocation request according to the second tag information, the method further comprises: For a user whose resource allocation request has not been processed within a second preset time period, the second label information of the user's unprocessed resource allocation request is updated based on the second label information of the user's first target resource allocation request, the processing time of the first target resource allocation request, and the current time, where the first target resource allocation request is a processed resource allocation request whose processing time is closest to the current time among the user's processed resource allocation requests.
14. The method according to claim 13, wherein updating the second tag information based on the second tag information of the first target resource allocation request of the user, the processing time of the first target resource allocation request and the current time comprises: Determining a decay coefficient based on a processing time of the first target resource allocation request, a current time, and preset parameters; Based on the second label information of the first target resource allocation request and the attenuation coefficient, the second label information of the unprocessed resource allocation request of the user is updated.
15. The method according to claim 14, wherein updating the second tag information of the unprocessed resource allocation request of the user based on the second tag information of the first target resource allocation request and the attenuation coefficient comprises: Determining third candidate label information based on the second label information of the first target resource allocation request and the attenuation coefficient; Based on the third candidate label information and the weight information pre-set for the user, determine the updated second label information of the second target resource allocation request, where the second target resource allocation request is the unprocessed resource allocation request whose request reception time is farthest from the current time among the unprocessed resource allocation requests of the user; Based on the updated second tag information of the second target resource allocation request, the updated second tag information of other unprocessed resource allocation requests of the user is determined.
16. A resource allocation device, the device comprising: A generating module, configured to generate first tag information and second tag information for a plurality of resource allocation requests received for obtaining input and output IO resources, wherein the first tag information is used to indicate a latest processing time of the resource allocation request, and the second tag information is used to indicate weight priority information of the resource allocation request; A resource allocation module, configured to allocate IO resources for the multiple resource allocation requests according to the first tag information; An updating module, configured to update the second tag information of the plurality of resource allocation requests; The resource allocation module is further configured to perform IO resource allocation for the multiple resource allocation requests according to the updated second tag information.
17. A computing device comprising: processor; a memory for storing processor-executable instructions; The processor implements the method according to any one of claims 1 to 15 by running the executable instructions.
18. A computer-readable storage medium having computer instructions stored thereon, wherein the computer instructions, when executed by a processor, implement the steps of the method according to any one of claims 1 to 15.
Citation Information
Patent Citations
Resource allocation method and device, electronic equipment and storage medium
CN111309490A
Resource processing method and device
CN113590329A
Resource allocation method and device, equipment and medium
CN117632483A
Method for Use in Association With A Multi-Tab Interpretation and Rendering Function
US20120060083A1
Resource scheduling methods, device and system, and central server
US20200348977A1