A resource allocation method and device, electronic equipment and readable storage medium
By creating a fixed-specification pool in the resource pool and directly allocating reserved instance resources, the problems of large resource allocation scheduling and inventory calculation are solved, real-time consistency of host specification inventory is achieved, and the accuracy and efficiency of cloud server creation are improved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- ALIBABA (CHINA) CO LTD
- Filing Date
- 2022-09-23
- Publication Date
- 2026-06-19
AI Technical Summary
The computational workload of existing resource allocation scheduling and inventory calculation is increasing, leading to a greater deviation between the actual inventory specifications that the host machine can support and the displayed inventory specifications, which affects the normal creation of cloud servers.
Create a fixed-specification pool in the resource pool, which contains reserved instance resources of multiple specifications. Allocate reserved instance resources directly to users from the fixed-specification pool, reducing the computational load of the scheduling process and inventory calculation, and maintaining the consistency and real-time performance of inventory.
By using a fixed specification pool for resource allocation, the computational load of scheduling and inventory calculation is reduced, maintaining consistency and real-time performance between the actual specification inventory that the host machine can support and the displayed specification inventory, thus avoiding resource allocation errors caused by inventory deviations.
Smart Images

Figure CN115562855B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and more specifically, to a resource allocation method, apparatus, electronic device, and readable storage medium. Background Technology
[0002] During the elastic creation process of cloud servers, the optimal host machine at the current moment will be scheduled for resource allocation. This scheduling process requires processing the information of all host machines at the current moment. After resource allocation, since the specification inventory that a host machine can support is easily affected by other host machines, a full calculation of all host machines is also required to obtain accurate specification inventory.
[0003] As the number of host machines in the resource pool increases, the amount of computation required for resource allocation, scheduling, and inventory calculation processes becomes larger and takes longer. If the specification inventory after the previous resource allocation has not yet been calculated when the current resource allocation is performed, this data inconsistency will cause the deviation between the actual specification inventory that the host machine can support and the displayed specification inventory to become larger and larger, affecting the normal creation of cloud servers. Summary of the Invention
[0004] The problem addressed by this application is that the computational workload of existing resource allocation scheduling and inventory calculation is increasing, leading to a greater deviation between the actual inventory specifications that the host machine can support and the displayed inventory specifications.
[0005] To address the aforementioned problems, the first aspect of this application provides a resource allocation method, comprising:
[0006] Create a fixed-specification pool in the resource pool, which includes reserved instance resources of multiple specifications;
[0007] In response to a user's creation request, the reserved instance resources in the fixed-specification pool that meet the creation request are allocated to the user.
[0008] A second aspect of this application provides a resource allocation apparatus, comprising:
[0009] The specification pool creation module is used to create a fixed specification pool in the resource pool, wherein the fixed specification pool includes reserved instance resources of multiple specifications;
[0010] The resource allocation module is used to allocate the reserved instance resources in the fixed specification pool that meet the creation request to the user in response to the user's creation request.
[0011] A third aspect of this application provides an electronic device comprising: a memory and a processor;
[0012] The memory is used to store programs;
[0013] The processor, coupled to the memory, is used to execute the program for:
[0014] Create a fixed-specification pool in the resource pool, which includes reserved instance resources of multiple specifications;
[0015] In response to a user's creation request, the reserved instance resources in the fixed-specification pool that meet the creation request are allocated to the user.
[0016] A fourth aspect of this application provides a computer-readable storage medium having a computer program stored thereon, the program being executed by a processor to implement the resource allocation method described above.
[0017] In this application, the fixed specification pool contains reserved instance resources bound to the specification. Therefore, when allocating the reserved instance resources in the fixed specification pool to users, there is no need to schedule the optimal host machine at the current moment, which greatly reduces the amount of computation in the scheduling process. Moreover, the reserved instance resources are bound to the specification, and reserved instance resources of different specifications cannot be converted and will not affect each other. In the inventory calculation process after the resource allocation is completed, there is no need to perform a full calculation of all host machines. The allocated reserved instance resources of the specified specification are simply reduced by the corresponding quantity.
[0018] In this application, after receiving a user's creation request, the reserved instance resources that meet the creation request are directly selected from the fixed specification pool and allocated to the user. The allocated reserved instance resources are then subtracted from the inventory of the fixed specification pool. This eliminates the need for optimal host scheduling during the scheduling process and full calculation during the inventory calculation process, thereby avoiding a large amount of computation during the scheduling and inventory calculation processes and maintaining the consistency and real-time performance between the actual specification inventory that the host can support and the displayed specification inventory.
[0019] In this application, the fixed-specification pool is created through resource scheduling; the entire scheduling process of the fixed-specification pool is executed at once, which reduces the number of scheduling operations while ensuring the scheduling objective, thereby avoiding the huge amount of computation required for multiple scheduling operations. Attached Figure Description
[0020] Figure 1 This is a flowchart of a resource allocation method according to an embodiment of this application;
[0021] Figure 2 This is an example diagram of the fixed-specification resource pool and the mixed-fabric resource pool in this application;
[0022] Figure 3 This is a flowchart of a resource allocation method S300 according to an embodiment of this application;
[0023] Figure 4This is a flowchart of a resource allocation method according to another embodiment of this application;
[0024] Figure 5 This is a flowchart of a resource allocation method S100 according to an embodiment of this application;
[0025] Figure 6 Provide an example diagram showing the specifications and proportions of the user group for this application;
[0026] Figure 7 This is a flowchart illustrating the updating of the mixed-distribution resource pool in a resource allocation method according to an embodiment of this application;
[0027] Figure 8 This is a structural block diagram of a resource allocation apparatus according to an embodiment of the present application;
[0028] Figure 9 This is a structural block diagram of an electronic device according to an embodiment of this application. Detailed Implementation
[0029] To make the above-mentioned objects, features, and advantages of this application more apparent and understandable, specific embodiments of this application will be described in detail below with reference to the accompanying drawings. Although exemplary embodiments of this application are shown in the drawings, it should be understood that this application can be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided to enable a more thorough understanding of this application and to fully convey the scope of this application to those skilled in the art.
[0030] It should be noted that, unless otherwise stated, the technical or scientific terms used in this application shall have the ordinary meaning as understood by one of ordinary skill in the art to which this application pertains.
[0031] Cloud computing can allocate resources when users need to create cloud servers, thus achieving elastic resource allocation. As the scale of cloud computing expands, the elasticity of the cloud is becoming increasingly accepted by the public.
[0032] During the elastic creation process of cloud servers, the current tagging production solution involves two computationally intensive processes: First, the scheduling process. To achieve optimal scheduling, resources must be allocated based on the optimal host machine at the given moment. As the number of hosts increases from hundreds to tens or even hundreds of thousands, each selection of the optimal host machine requires significant computation, and the overall optimal scheduling time gradually increases with the increase in the number of hosts. Second, the inventory calculation process. After resource allocation, if the corresponding host machine changes due to resource availability, a full calculation of the inventory specifications produced by that host machine is required. When there are numerous host machine changes, the inventory calculation time becomes increasingly longer, and the discrepancy between the inventory displayed by the inventory system and the actual production inventory becomes increasingly larger. Ultimately, this can lead to situations where inventory is available when placing an order, but not available during production, resulting in refunds and order cancellations.
[0033] Currently, in order to reduce the number of inventory calculations, a fixed time interval method is used, such as calculating the specification inventory of all host machines every 5 minutes. Although this calculation method reduces the amount of calculation, the inventory is not updated within the fixed time interval, which still cannot solve the problems of data inconsistency and inventory deviation.
[0034] To address the aforementioned issues, this application provides a novel resource allocation scheme that reduces the amount of data required for resource scheduling and inventory calculation by reserving instance resources and establishing a fixed-size pool.
[0035] For ease of understanding, the following terms may be used and are explained below:
[0036] VM (Virtual Machine): A virtual host is a carrier of computing power for cloud computing users.
[0037] Host machine: The physical machine used to produce cloud servers, also known as the host machine.
[0038] RI (Reserved Instances) refers to the resources reserved for instances. These resources are pre-allocated on the host machine and can be directly deducted or bound to the cloud server during production.
[0039] DB: (Data Base) A database used to store various data generated by business operations.
[0040] ID (Identity Document): An identity identification number, also known as a serial number or account number, which is a relatively unique code within the system.
[0041] This application provides a resource allocation method, which can be executed by a resource allocation device. This device can be integrated into electronic devices such as tablets, computers, servers, server clusters, and data centers, or deployed in cloud environments such as public clouds, private clouds, hybrid clouds, virtual private clouds / private networks, and dedicated clouds. Figure 1 The diagram shown is a flowchart of a resource allocation method according to an embodiment of this application; wherein the resource allocation method includes:
[0042] S200, Create a fixed-specification pool in the resource pool, the fixed-specification pool including reserved instance resources of multiple specifications;
[0043] S300, in response to the user's creation request, the reserved instance resources in the fixed specification pool that meet the creation request are allocated to the user.
[0044] In this application, the resource pool consists of the available resources of the host machine. The currently available resource pool can be determined by traversing the available resources of each host machine.
[0045] It should be noted that if some available resources of a host in the resource pool are allocated and bound to a user, those resources no longer belong to the resource pool after allocation; if some available resources of an allocated host are unbound by the user, those unbound available resources can be re-added to the resource pool. In other words, the resources in the resource pool are constantly changing in real time due to resource allocation, resource scheduling, and resource unbinding.
[0046] In this application, resource scheduling within the resource pool involves determining the specific host machine and the resource location on the host machine through a scheduling algorithm, and then allocating the resources at that location to the user.
[0047] In this application, the fixed specification pool is a logical concept. Creating a fixed specification pool means selecting several host machines and specific resource locations on the host machines from the current resource pool, reserving / occupying the resources at those locations as part of the fixed specification resource pool, so as to facilitate subsequent scheduling and use.
[0048] In this application, after creating a fixed-specification resource pool, the remaining portion of the resource pool is a mixed-distribution resource pool. That is, the resource pool is divided into a fixed-specification resource pool and a mixed-distribution resource pool.
[0049] In this application, allocating reserved instance resources to users effectively binds the reserved instance resources to the users. Correspondingly, after the users have finished using the resources, they can reclaim them by unbinding the reserved instance resources from the users.
[0050] In this application, the fixed specification pool contains reserved instance resources associated with the specification. Therefore, when allocating the reserved instance resources in the fixed specification pool to users, it is not necessary to schedule the optimal host machine at the current moment, which greatly reduces the amount of computation in the scheduling process. Moreover, the reserved instance resources are associated with the specification, and reserved instance resources of different specifications cannot be converted to each other and will not affect each other. In the inventory calculation process after the resource allocation is completed, it is not necessary to perform a full calculation of all host machines. The allocated reserved instance resources of the specified specification are simply subtracted from the corresponding quantity.
[0051] For example, such as Figure 2 As shown, the frames in the fixed-specification pool are concrete representations of reserved instance resources. The area of the reserved instance resources (frames of specification A, specification B, specification C...) in the figure is used to illustrate the specifications of the reserved instance resources, such as 2 cores 4G, 2 cores 8G, 4 cores 16G, etc. Different areas represent different specifications. For ease of description, in this application, specification A, specification B, specification C... are used to represent different specific specifications.
[0052] The user's creation request includes the specifications and quantity of the resource to be created. For example, if 5 resources or instances of specification A need to be created, then 5 RIs of specification A can be selected from the fixed specification pool and assigned to the user (bound to the user); at the same time, the specification inventory in the fixed specification pool is reduced by 5.
[0053] In this application, after receiving a user's creation request, a reserved instance resource that meets the creation request is selected from the fixed specification pool and allocated to the user. The allocated reserved instance resource is then subtracted from the inventory of the fixed specification pool. This eliminates the need for optimal host scheduling during the scheduling process and full calculation during the inventory calculation process, thereby avoiding a large amount of computation during the scheduling and inventory calculation processes and maintaining consistency and real-time performance between the actual specification inventory that the host can support and the displayed specification inventory.
[0054] In this application, the reserved instance resources already allocated in the fixed specification pool can be retained, and only the inventory data of the reserved instance resources in the fixed specification pool can be modified. Thus, after the allocated reserved instance resources are reclaimed, they can be directly added to the fixed specification pool to increase the inventory data of the reserved instance resources.
[0055] For example, if there are 10 RIs of specification A in the fixed specification pool, after allocating 5 of the RIs of specification A to users, the inventory of RIs of specification A in the fixed specification pool will be updated to 5. After the 5 RIs of specification A are reclaimed, the 5 reclaimed RIs of specification A will still belong to the fixed specification pool, and the inventory of RIs of specification A in the fixed specification pool will be updated to 10.
[0056] In one implementation, the fixed-size pool is created through resource scheduling.
[0057] The scheduling objective can be fragment minimization or other scheduling objectives; no specific scheduling objective is restricted in this application.
[0058] After obtaining the specifications and quantity of each specification in the fixed specification pool, the fixed specification pool is pre-allocated through resource scheduling to determine the specifications, quantity, and corresponding positions to be scheduled; the underlying resource management system marks the corresponding positions in the scheduling to reserve / pre-occupy resources.
[0059] In this application, a scheduler is used for batch scheduling to create the fixed-size pool. Existing schedulers support batch scheduling, and the specific process of batch scheduling using a scheduler will not be elaborated upon in this application.
[0060] In this application, the fixed-specification pool is created through resource scheduling; the entire scheduling process of the fixed-specification pool is executed at once, which reduces the number of scheduling operations while ensuring the scheduling objective, thereby avoiding the huge amount of computation required for multiple scheduling operations.
[0061] In one embodiment, the method further includes:
[0062] After allocating the reserved instance resources to the user, update the inventory of the fixed-size pool.
[0063] In this application, updating the inventory of the fixed specification pool can be a simple overlay or deletion of the inventory corresponding to the specifications of the allocated reserved instance resources; thereby avoiding a large number of complex calculations in the inventory calculation process and maintaining the consistency and real-time performance of the specification inventory that the host machine can actually support and the displayed specification inventory.
[0064] In one implementation, the inventory of the fixed-size pool is updated after the reserved instance resources are reclaimed.
[0065] In this application, the reserved instance resources in the fixed specification pool are marked. After the reserved instance resources are reclaimed, the reserved instance resources are returned to the fixed specification pool to maintain the total amount of reserved instance resources in the fixed specification pool.
[0066] In one implementation, the creation request includes the target specifications and target quantity of the instances to be created; such as Figure 3 As shown, the following steps confirm that the fixed-specification pool meets the creation request:
[0067] S301, Obtain the specifications of the fixed specification pool and the inventory quantity of each specification;
[0068] S302, Query whether the specifications of the fixed specification pool include the target specification of the instance to be created;
[0069] S303, if included, query whether the inventory quantity of the specification in the fixed specification pool is greater than the target quantity of the target specification of the instance to be created;
[0070] S304, if it is greater than, then confirm that the fixed specification pool satisfies the creation request.
[0071] Specifically, if the specifications in the fixed specification pool and the inventory quantity of each specification both meet the creation request, then the fixed specification pool is confirmed to meet the creation request.
[0072] When the fixed specification pool satisfies the creation request, the corresponding number and specifications of reserved instance resources can be allocated to the user through the fixed specification pool alone, and the creation of the corresponding instance can be carried out.
[0073] In this application, the specific process of creating a corresponding instance for a user based on the resources and / or reserved instance resources after allocating resources and / or reserved instance resources to the user is a common practice in this field, and will not be described in detail here.
[0074] In one embodiment, the fixed specification pool includes a specification table and an inventory table, wherein the specification table records the specific specifications included in the fixed specification pool, and the inventory table records the inventory quantity of each specific specification in the fixed specification pool.
[0075] In one implementation, after allocating multiple reserved instance resources of several specifications in a fixed specification pool to users, the inventory quantity of the corresponding specifications in the inventory table is updated.
[0076] In one implementation, the fixed-specification pool is provided with a reserved instance resource information table, which contains data on multiple reserved instance resources. The data for each reserved instance resource includes a reserved instance resource identifier and a reserved instance resource specification.
[0077] In one implementation, after allocating multiple reserved instance resources of several specifications in a fixed specification pool to users, the corresponding multiple reserved instance resource data in the reserved instance resource information table are marked as allocated, or the corresponding multiple reserved instance resource data are deleted.
[0078] In one implementation, the resource pool further includes a mixed-distribution resource pool, such as... Figure 4 As shown, the method further includes:
[0079] S400, if the fixed specification pool does not meet the creation request, the resources in the mixed fabric resource pool are allocated to the user, or the reserved instance resources in the fixed specification pool that meet the creation request and the resources in the mixed fabric resource pool are allocated to the user.
[0080] In this application, the creation request includes the target specifications and target quantity of the instance to be created. If the specifications of the fixed specification pool and the inventory quantity of each specification meet the creation request, the fixed specification pool is confirmed to meet the creation request; if the specifications of the fixed specification pool or the inventory quantity of at least one specification do not meet the creation request, the fixed specification pool is confirmed to not meet the creation request.
[0081] In this application, if the fixed specification pool does not meet the creation request, resources can be directly scheduled from the mixed distribution resource pool to allocate to the user who made the creation request; or, a portion of the creation request can be satisfied by the reserved instance resources of the fixed specification pool, and the remaining portion can be completed by scheduling resources from the mixed distribution resource pool.
[0082] In this application, the reserved instance resources are first allocated to users through a fixed specification pool, and then the resources are allocated to users by the mixed deployment resource pool; this can reduce the amount of resources that the mixed deployment resource pool needs to schedule, thereby reducing the amount of computation generated.
[0083] In this application, the resources in the hybrid resource pool are allocated to the user based on a preset resource allocation strategy. This can be achieved by a scheduler scheduling resources in the hybrid resource pool according to the preset resource allocation strategy.
[0084] In this application, the existing scheduler supports batch scheduling. The specific process of batch scheduling through the scheduler will not be described in this application.
[0085] In one implementation, such as Figure 4 As shown, before creating a fixed-specification pool in the resource pool, the method further includes:
[0086] S100, predict the resource needs of the user group, the resource needs including at least the specifications and quantity of resources required by the user group within a preset time period.
[0087] Based on the resource requirements, a fixed-size pool is created within the resource pool.
[0088] In this application, it should be noted that the fixed specification pool includes reserved instance resources for each specification. These reserved instance resources are reserved for resources. If too many reserved instance resources for a certain specification are set in the fixed specification pool, it may lead to an oversupply of reserved instance resources for that specification and a shortage of reserved instance resources for other specifications, thus resulting in resource waste.
[0089] In one implementation, creating a fixed-specification pool in the resource pool according to the resource requirements includes: determining the specification ratio of reserved instance resources in the fixed-specification pool based on the proportion of resource requirements for each specification in the resource requirements.
[0090] In this application, by predicting the resource needs of the user group, the reserved instance resources of each specification in the fixed specification pool are determined, which can avoid the waste of resources caused by the excess of reserved instance resources and improve resource utilization.
[0091] In one implementation, such as Figure 5 As shown, S100, predicting the resource needs of the user group, includes:
[0092] S101, obtain historical data of the user group;
[0093] S102, Determine the user profile based on the historical data;
[0094] S103, determine the predicted information of the user group within a preset time period through user profiles to obtain the resource demand, wherein the predicted information includes at least the specifications and quantity of the demanded resources.
[0095] In this application, the historical data of the user group can be data such as the user's past creation data and usage habits obtained by the cloud vendor. The specific acquisition method can be provided by the cloud vendor or obtained by other methods.
[0096] In this application, determining user profiles based on historical data can be achieved by identifying various features in the user's historical data and then associating these features with the user; alternatively, it can involve directly extracting various features from the historical data and associating these extracted features with the user to create a user profile; or it can involve directly separating the user's historical data from the total historical data to create a user profile. The specific identification or association process will not be elaborated upon in this application.
[0097] In this application, the specific methods for determining predictive information through profiling can include cluster analysis, fitting analysis, and analysis using a pre-set model trained by a convolutional neural network. No specific analytical method is limited in this application.
[0098] It should be noted that in this application, the prediction information determined by the profile is the prediction of information about the user group. Taking the training of a pre-set model by a convolutional neural network as an example, the pre-set model can take the historical data of each user as input and output the specifications and number of the user group.
[0099] like Figure 6 The diagram shows an example of the specifications and proportions of the output user group. For ease of description, this application assumes that the proportions of specifications A, B, C, D, E, and F decrease sequentially. It should be noted that for a fixed-specification resource pool, the proportion of each specification in the specifications and quantity of the output user group represents the content to be acquired, and the quantity corresponding to that specification can be used to calculate the proportion corresponding to that specification.
[0100] In one implementation, the resource requirement further includes the confidence level of the prediction information, and the step of creating a fixed-specification pool in the resource pool according to the resource requirement further includes: determining the number of reserved instance resources of each specification in the created fixed-specification pool based on the confidence level, the specification ratio of the reserved instance resources, and the resource quantity of the resource pool.
[0101] In this application, the confidence level is used to describe the accuracy of the prediction information, and the specific method of obtaining it will not be described in detail.
[0102] In one implementation, the amount of reserved instance resources in the created fixed-specification pool is determined by the confidence level; the number of reserved instance resources of each specification is determined from the amount of reserved instance resources by the specification ratio of the reserved instance resources.
[0103] In one implementation, the amount of reserved instance resources for the created fixed-size pool is determined by the confidence level. Specifically, this can be done by obtaining the available resource pool's resource quantity and confidence level, and multiplying them as the amount of reserved instance resources for the fixed-size pool.
[0104] For example, if the confidence level is 70% and the resource pool has a resource quantity of 500 (unit not set), then the reserved instance resource quantity of the fixed specification pool will be set to 350 (unit not set).
[0105] In one implementation, determining the amount of reserved instance resources in the created fixed-size pool based on the confidence level can specifically involve: obtaining the available resource pool's resource quantity and confidence level, determining the ratio of the reserved instance resources in the fixed-size pool to the total resource quantity based on the confidence level, and then determining the amount of reserved instance resources in the fixed-size pool.
[0106] For example, the proportion of reserved instance resources to total resources is divided into five levels: 30%, 40%, ... 70%. The proportion level corresponding to a confidence level of 70% is 40%. If the resource pool has 500 resources (unit not set), then the reserved instance resources of the fixed specification pool will be set to 200 (unit not set).
[0107] In one implementation, the number of reserved instance resources of each specification is determined based on the amount of reserved instance resources in the fixed specification pool and the specification ratio of the reserved instance resources. Specifically, the number of reserved instance resources of each specification can be determined by multiplying the amount of reserved instance resources in the fixed specification pool by the specification ratio and then determining the number of reserved instance resources of that specification based on the product.
[0108] For example, the reserved instance resource quantity of the fixed specification pool is set to 200 (unit not set); the specification ratios of the reserved instance resources are 40%, 20%, 15%, 12%, 8%, and 5% for specifications A, B, C, D, E, and F, respectively; then the corresponding products (unit not set) are 80, 40, 30, 24, 16, and 10; this product is the resource quantity of reserved instance resources for specifications A, B, C, D, E, and F. Based on this resource quantity, the number of reserved instance resources for each specification can be determined.
[0109] It should be noted that in this application, the quantity of each specification in the fixed specification pool is an integer. Therefore, when determining the number of reserved instance resources for a specification, the specific quantity of each specification can be determined by estimation.
[0110] In one implementation, the mixed-distribution resource pool includes multiple host machines, each host machine corresponding to an inventory calculation queue; such as Figure 7 As shown, the method further includes:
[0111] S501, after the resources of the host machine are allocated, a change event is triggered; the change event is stored in the inventory calculation queue when the inventory calculation queue of the host machine is empty, and is discarded when the inventory calculation queue of the host machine is full.
[0112] S502, determine the inventory calculation queue that stores change events, read the current resource data of the host machine corresponding to the inventory calculation queue, calculate the inventory of different specifications of the host machine based on the current resource data, and obtain the inventory calculation result corresponding to the host machine;
[0113] S503, based on the inventory calculation results of each host machine in the multiple host machines, update the inventory of the mixed distribution resource pool.
[0114] In this application, each host machine is equipped with an inventory calculation queue. By setting up the inventory calculation queue, after the resources of the host machine are allocated, a change event is triggered on the host machine. If the inventory calculation queue is empty at this time, the change event is imported into the inventory calculation queue for consumption; if the inventory calculation queue is full at this time, the current change event is discarded.
[0115] In one implementation, the inventory calculation queue can hold one task. That is, the length of the inventory calculation queue is 1, meaning it can only hold one change event.
[0116] In this application, the inventory calculation queue is used to trigger the calculation of the specification inventory of the host machine. During the calculation process (the process of consuming change events in the inventory calculation queue), if the host machine triggers multiple change events again, all of these change events are discarded, so as to avoid the impact of the host machine frequently allocating resources to trigger change events on the inventory operation.
[0117] In this application, the inventory calculation queue containing change events can be determined by setting up an inventory calculation queue or a monitor for change events.
[0118] In this application, while obtaining the inventory calculation result corresponding to the host machine, the change events in the corresponding inventory calculation queue are discarded.
[0119] It should be noted that change events in the inventory calculation queue are merely triggering mechanisms for calculating the current inventory of the host machine corresponding to that inventory calculation queue. Therefore, it is only necessary to obtain information on whether a change event is stored in the inventory calculation queue. Thus, the consumption action for a change event in the inventory calculation queue can be to discard that change event.
[0120] In this application, the allocation of resources on the host machine triggers the calculation of the host machine's specification inventory, thereby enabling timely updates to the host machine's current specification inventory and maintaining consistency and real-time performance between the actual specification inventory that the host machine can support and the displayed specification inventory.
[0121] In this application, if multiple host machines trigger change events, the change events in the inventory calculation queues of the multiple host machines are consumed according to a preset order.
[0122] In this application, the preset order can be the order of multiple host machines, the time order in which change events are stored in the inventory calculation queue, or the order determined by other preset strategies.
[0123] In this application, the specification inventory of the mixed fabric resource pool is the sum of the specification inventory of each host machine.
[0124] In this application, the specification inventory of the resource pool is the sum of the specification inventory of the fixed specification pool and the specification inventory of the mixed fabric resource pool.
[0125] In this application, after the host machine allocates its idle resources, it stores the current resource data in a preset location.
[0126] In this application, the current resource data is read from the preset location to calculate the inventory of different specifications of the host machine.
[0127] It should be noted that in the mixed resource pool, the different specifications of the host machine's inventory refer to the quantity of that specification that the host machine can produce when producing a single specification of resource; since the host machine's idle resources are variable (can be scheduled into resources of multiple specifications), the different specifications of the inventory refer to the inventory that can be produced after setting a single specification.
[0128] For example, the inventory of specification A on the host machine is the quantity that the host machine can produce if it only produces specification A; similarly, the inventory of specification B on the host machine is the quantity that the host machine can produce if it only produces specification B.
[0129] It should be noted that, unlike the inventory of specifications in the mixed-spec resource pool, the inventory of specifications in the fixed-spec pool is the remaining quantity of reserved instance resources of that specification in the fixed-spec pool, not the quantity of that specification that can be produced when producing resources of a single specification.
[0130] In one implementation, the key of the inventory calculation queue is the host machine ID.
[0131] In one implementation, once the inventory calculation results for each host machine are determined, they are sent to the cache and DB (database) to update the corresponding content.
[0132] In this application, the mixed-distribution resource pool triggers the calculation of different specifications of the host machine's inventory through change events, thereby enabling timely calculation of specification inventory and solving the problem of untimely information updates.
[0133] In one embodiment, the prediction of resource demand for a user group further includes: iterating the prediction information of the user group and calculating the confidence level of the current iteration; if the difference between the confidence level after iteration and the current confidence level exceeds a preset threshold, or if the difference between the resource demand (prediction result set) of the user group after iteration and the resource demand (prediction result set) of the current user group exceeds a preset condition, steps S200-S400 / S503 are re-executed.
[0134] In this application, the difference between the resource requirements (prediction result set) of the user group after iteration and the resource requirements (prediction result set) of the current user group exceeds the preset conditions. This could be due to the difference between the ratio of specifications in the prediction result set after iteration and the ratio of specifications in the current prediction result set exceeding the threshold, or the specific specifications in the prediction result set after iteration being different from the specific specifications in the current prediction result set, or other differences.
[0135] In this way, through continuous iteration, the proportion of resources in the fixed-specification pool is increased, significantly reducing the computational load of overall resource scheduling and inventory calculation, improving the overall efficiency and accuracy of inventory calculation, and thus greatly enhancing the user experience of using cloud computing resources.
[0136] In one implementation, if the amount of resources in the resource pool increases or decreases significantly, steps S200-S400 / S503 are re-executed.
[0137] In this application, the resource pool has been significantly increased, which could be due to a large-scale purchase of host machines or a sudden influx of host machines.
[0138] In this application, the amount of resources in the resource pool has been significantly reduced, which could be due to large-scale purchases by major customers or unconventional usage by major customers.
[0139] It should be noted that when the amount of resources in the resource pool increases or decreases significantly, the predicted resource demand of the user group (prediction result set) does not change accordingly.
[0140] This application provides a resource allocation apparatus for executing the resource allocation method described above. The resource allocation apparatus will be described in detail below.
[0141] like Figure 8 As shown, the resource allocation device includes:
[0142] The specification pool creation module 102 is used to create a fixed specification pool in the resource pool, wherein the fixed specification pool includes reserved instance resources of multiple specifications.
[0143] Resource allocation module 103 is used to allocate the reserved instance resources in the fixed specification pool that meet the creation request to the user in response to the user's creation request.
[0144] In one embodiment, the resource pool further includes a mixed-distribution resource pool, and the resource allocation module 103 is further configured to:
[0145] If the fixed specification pool does not meet the creation request, the resources in the mixed-layout resource pool are allocated to the user; or, the reserved instance resources in the fixed specification pool that meet the creation request and the resources in the mixed-layout resource pool are allocated to the user.
[0146] In one implementation, the creation request includes the target specifications and target quantity of the instances to be created; the resource allocation module 103 is further configured to:
[0147] Obtain the specifications of the fixed specification pool and the inventory quantity of each specification; query whether the specifications of the fixed specification pool include the target specification of the instance to be created; if it includes, query whether the inventory quantity of the specification in the fixed specification pool is greater than the target quantity of the target specification of the instance to be created; if it is greater, confirm that the fixed specification pool satisfies the creation request.
[0148] In one implementation, such as Figure 8 As shown, the device further includes:
[0149] The group prediction module 101 is used to predict the resource needs of a user group, the resource needs including at least the specifications and quantity of resources required by the user group within a preset time period.
[0150] In one implementation, a fixed-size pool is created in the resource pool based on the resource requirements.
[0151] In one implementation, the specification pool creation module 102 is further configured to: determine the specification ratio of reserved instance resources in the fixed specification pool based on the proportion of each specification requirement resource in the resource requirements.
[0152] In one implementation, the population prediction module 101 is further configured to:
[0153] Obtain historical data of the user group; determine user profiles based on the historical data; determine the predicted information of the user group within a preset time period through the user profiles, so as to obtain the resource demand, wherein the predicted information includes at least the specifications and quantity of the demanded resources.
[0154] In one implementation, the resource requirement also includes the confidence level of the prediction information, and the specification pool creation module 102 is further configured to: determine the number of each specification of the reserved instance resources in the created fixed specification pool based on the confidence level, the specification ratio of the reserved instance resources, and the resource quantity of the resource pool.
[0155] In one implementation, the mixed-distribution resource pool includes multiple host machines, each host machine corresponding to an inventory calculation queue; the resource allocation module 103 is further configured to:
[0156] After the resources of the host machine are allocated, a change event is triggered. The change event is stored in the inventory calculation queue of the host machine when the queue is empty and discarded when the queue is full. The inventory calculation queue containing the change event is determined, the current resource data of the host machine corresponding to the inventory calculation queue is read, and the inventory of the host machine of different specifications is calculated based on the current resource data to obtain the inventory calculation result corresponding to the host machine. Based on the inventory calculation results of each host machine among the multiple host machines, the inventory of the mixed deployment resource pool is updated.
[0157] In one implementation, the inventory calculation queue can accommodate 1 task.
[0158] The resource allocation device and the resource allocation method provided in the above embodiments of this application are based on the same inventive concept and have the same beneficial effects as the methods adopted, run or implemented by the applications stored therein.
[0159] The above describes the internal functions and structure of the resource allocation device, such as... Figure 9 As shown, in practice, the resource allocation device can be implemented as an electronic device, including: a memory 301 and a processor 303.
[0160] Memory 301 can be configured to store a program.
[0161] Additionally, memory 301 can also be configured to store various other data to support operation on the electronic device. Examples of this data include instructions for any application or method used to operate on the electronic device, contact data, phonebook data, messages, pictures, videos, etc.
[0162] The memory 301 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory, electrically erasable programmable read-only memory, erasable programmable read-only memory, programmable read-only memory, read-only memory, magnetic memory, flash memory, magnetic disk or optical disk.
[0163] Processor 303, coupled to memory 301, is used to execute programs in memory 301 for:
[0164] Create a fixed-specification pool in the resource pool, which includes reserved instance resources of multiple specifications;
[0165] In response to a user's creation request, the reserved instance resources in the fixed-specification pool that meet the creation request are allocated to the user.
[0166] In one embodiment, the resource pool further includes a mixed-distribution resource pool, and the processor 303 is specifically used for:
[0167] If the fixed specification pool does not meet the creation request, the resources in the mixed-layout resource pool are allocated to the user; or, the reserved instance resources in the fixed specification pool that meet the creation request and the resources in the mixed-layout resource pool are allocated to the user.
[0168] In one implementation, the creation request includes the target specifications and target quantity of the instances to be created; the processor 303 is specifically used for:
[0169] Obtain the specifications of the fixed specification pool and the inventory quantity of each specification; query whether the specifications of the fixed specification pool include the target specification of the instance to be created; if it includes, query whether the inventory quantity of the specification in the fixed specification pool is greater than the target quantity of the target specification of the instance to be created; if it is greater, confirm that the fixed specification pool satisfies the creation request.
[0170] In one implementation, the processor 303 is specifically used to: predict the resource needs of a user group, the resource needs including at least the specifications and quantity of resources required by the user group within a preset time period.
[0171] In one implementation, a fixed-size pool is created in the resource pool based on the resource requirements.
[0172] In one implementation, the processor 303 is specifically used to: determine the specification ratio of reserved instance resources in the fixed specification pool based on the proportion of resource requirements for each specification in the resource requirements.
[0173] In one implementation, processor 303 is specifically used for:
[0174] Obtain historical data of the user group; determine user profiles based on the historical data; determine the predicted information of the user group within a preset time period through the user profiles, so as to obtain the resource demand, wherein the predicted information includes at least the specifications and quantity of the demanded resources.
[0175] In one implementation, the resource requirement further includes the confidence level of the prediction information, and the processor 303 is specifically used to: determine the number of reserved instance resources of each specification in the created fixed specification pool based on the confidence level, the specification ratio of the reserved instance resources, and the resource quantity of the resource pool.
[0176] In one implementation, the mixed-distribution resource pool includes multiple host machines, each host machine corresponding to an inventory calculation queue; the processor 303 is specifically used for:
[0177] After the resources of the host machine are allocated, a change event is triggered. The change event is stored in the inventory calculation queue of the host machine when the queue is empty and discarded when the queue is full. The inventory calculation queue containing the change event is determined, the current resource data of the host machine corresponding to the inventory calculation queue is read, and the inventory of the host machine of different specifications is calculated based on the current resource data to obtain the inventory calculation result corresponding to the host machine. Based on the inventory calculation results of each host machine among the multiple host machines, the inventory of the mixed deployment resource pool is updated.
[0178] In one implementation, the inventory calculation queue can accommodate 1 task.
[0179] In this application, Figure 9 The diagram only shows some components and does not mean that the electronic device includes only these components. Figure 9 The components shown.
[0180] The electronic device provided in this embodiment is based on the same inventive concept as the resource allocation method provided in the embodiments of this application, and has the same beneficial effects as the methods adopted, run or implemented by the applications stored therein.
[0181] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-readable storage media (including, but not limited to, disk storage, optical storage, etc.) containing computer-usable program code.
[0182] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0183] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, the instruction means being implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0184] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0185] In a typical configuration, a computing device includes one or more processors, input / output interfaces, network interfaces, and memory.
[0186] Memory may include non-persistent storage in computer-readable media, random access memory, and / or non-volatile memory, such as read-only memory or flash memory. Memory is an example of computer-readable media.
[0187] This application also provides a computer-readable storage medium corresponding to the resource allocation method provided in the foregoing embodiments, wherein a computer program (i.e., a program product) is stored thereon, and the computer program, when run by a processor, executes the resource allocation method provided in any of the foregoing embodiments.
[0188] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using 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 memory, static random access memory, dynamic random access memory, other types of random access memory, read-only memory, electrically erasable programmable read-only memory, flash memory or other memory technologies, optical disc read-only memory, digital versatile optical disc or other optical storage, magnetic tape, magnetic tape storage or other magnetic storage devices, or any other non-transfer medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.
[0189] The computer-readable storage medium provided in the above embodiments of this application and the resource allocation method provided in the embodiments of this application are based on the same inventive concept and have the same beneficial effects as the methods adopted, run or implemented by the applications stored therein.
[0190] It should be noted that numerous specific details are set forth in the specification provided herein. However, it will be understood that embodiments of this application may be practiced without these specific details. In some instances, well-known structures and techniques have not been shown in detail so as not to obscure the understanding of this specification.
[0191] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0192] The above description is merely an embodiment of this application and is not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.
Claims
1. A resource allocation method, characterized in that, include: Create a fixed-specification pool in the resource pool, which includes reserved instance resources of multiple specifications; In response to a user's creation request, the reserved instance resources in the fixed-specification pool that meet the creation request are allocated to the user; The resource pool also includes a mixed-distribution resource pool, which contains multiple host machines. Each host machine has a corresponding inventory calculation queue, which is used to trigger the calculation of the specification inventory of the host machine.
2. The method according to claim 1, characterized in that, Before creating a fixed-size pool in the resource pool, the method further includes: Predict the resource needs of a user group, wherein the resource needs include at least the specifications and quantity of resources required by the user group within a preset time period; The step of creating a fixed-size pool in the resource pool includes: Based on the resource requirements, a fixed-size pool is created within the resource pool.
3. The method according to claim 2, characterized in that, Based on the resource requirements, a fixed-specification pool is created within the resource pool, including: Based on the proportion of resources required for each specification in the resource requirements, the specification ratio of the reserved instance resources in the fixed specification pool is determined.
4. The method according to claim 3, characterized in that, The predicted resource needs of the user group include: Obtain historical data of the user group; Based on the historical data, user profiles are determined; The predicted information of a user group within a preset time period is determined by user profiling in order to obtain the resource demand. The predicted information includes at least the specifications and quantity of the demanded resources.
5. The method according to claim 4, characterized in that, The resource requirement also includes the confidence level of the prediction information, and the step of creating a fixed-size pool in the resource pool based on the resource requirement further includes: Based on the confidence level, the specification ratio of the reserved instance resources, and the resource pool quantity, the number of reserved instance resources of each specification in the created fixed specification pool is determined.
6. The method according to claim 1, characterized in that, The method further includes: If the fixed specification pool does not meet the creation request, the resources in the mixed-layout resource pool are allocated to the user; or, the reserved instance resources in the fixed specification pool that meet the creation request and the resources in the mixed-layout resource pool are allocated to the user.
7. The method according to claim 6, characterized in that, The method further includes: After the resources on the host machine are allocated, a change event is triggered; the change event is stored in the inventory calculation queue when the host machine's inventory calculation queue is empty, and is discarded when the host machine's inventory calculation queue is full. The inventory calculation queue containing change events is identified, the current resource data of the host machine corresponding to the inventory calculation queue is read, and the inventory of different specifications of the host machine is calculated based on the current resource data to obtain the inventory calculation result corresponding to the host machine. Based on the inventory calculation results of each host machine among the multiple host machines, the inventory of the mixed distribution resource pool is updated.
8. The method according to claim 7, characterized in that, The inventory calculation queue can accommodate 1 task.
9. The method according to claim 1, characterized in that, The creation request includes the target specifications and target quantity of the instances to be created; The following steps confirm that the fixed-specification pool meets the creation request: Obtain the specifications of the fixed specification pool and the inventory quantity of each specification; Check whether the specifications of the fixed specification pool include the target specification of the instance to be created; If included, query whether the inventory quantity of the specified specification in the fixed specification pool is greater than the target quantity of the target specification of the instance to be created; If it is greater than the specified value, then the fixed specification pool is confirmed to meet the creation request.
10. A resource allocation device, characterized in that, include: The specification pool creation module is used to create a fixed specification pool in the resource pool, wherein the fixed specification pool includes reserved instance resources of multiple specifications; The resource allocation module is used to allocate the reserved instance resources in the fixed specification pool that meet the creation request to the user in response to the user's creation request; The resource pool also includes a mixed-distribution resource pool, which contains multiple host machines. Each host machine has a corresponding inventory calculation queue, which is used to trigger the calculation of the specification inventory of the host machine.
11. An electronic device, characterized in that, include: Memory and processor; The memory is used to store programs; The processor, coupled to the memory, is used to execute the program for: Create a fixed-specification pool in the resource pool, which includes reserved instance resources of multiple specifications; In response to a user's creation request, the reserved instance resources in the fixed-specification pool that meet the creation request are allocated to the user; The resource pool also includes a mixed-distribution resource pool, which contains multiple host machines. Each host machine has a corresponding inventory calculation queue, which is used to trigger the calculation of the specification inventory of the host machine.
12. A computer-readable storage medium having a computer program stored thereon, characterized in that, The program is executed by a processor to implement the method described in any one of claims 1-9.
Citation Information
Patent Citations
A dynamic scheduling method and device of a reserved resource pool, a computer device and a storage medium
CN109032788A
Resource management method and system
CN110287003A
Virtual machine stock management system and method
US20140089392A1