Resource allocation method, device and electronic equipment
By implementing resource allocation methods and devices in a cloud computing environment, the problem of the system refusing to provide resources when a single local resource pool resource package is exhausted but there is global surplus is solved, ensuring that users can use global remaining resources, and improving User satisfaction and resource utilization.
Patent Information
- Application Number
- CN202410580305.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-11
- Publication Date
- 2024-09-03
- Estimated Expiration
- 2044-05-11
AI Technical Summary
In a cloud computing environment, when the resource package of a single local resource pool is exhausted but there is still global surplus, the system will refuse the resource pool provided by the exhausted resource package, causing users to be unable to use the remaining resources, thereby reducing the user's service requirements. of satisfaction.
By implementing the resource allocation method and device on the central resource pool manager side, the resource allocation request initiated by the first resource pool manager is received, the allocable resources in the second resource pool are obtained, and the user applied for is deducted from the first resource pool. resources to ensure that even if the first resource pool resource package is exhausted, users can still use global remaining resources.
It improves user satisfaction with services, avoids waste of resources and service interruptions, improves resource utilization, and ensures that users can continue to use services.
Smart Images

Figure CN118170549B
Abstract
Description
Technical Field
[0001] The present application relates to the field of cloud computing technology, and in particular to a resource allocation method, device and electronic device. Background Art
[0002] In the current cloud computing environment, public cloud vendors usually establish resource pools in multiple regions across the country to provide various AI capability products. Users can obtain resource packages with specific AI capabilities as needed and use these capabilities through API interfaces. Resource packages can provide a certain number of service uses.
[0003] The existing solutions mainly use the database isolation processing strategy, which limits the use of resource packages to a single local resource pool, and users can only use resources in the resource pool of their own region. However, if the resources in a single local resource pool are exhausted, but there is still surplus in resource pools in other regions, this strategy will refuse to provide capacity to the resource pool with exhausted resource packages, making it impossible for users to use the remaining resources, thereby reducing user satisfaction with the service. Summary of the invention
[0004] In view of this, the present application provides a resource allocation method, device and electronic device, the main purpose of which is to solve the current technical problem that when the resource package of a single local resource pool is exhausted, but there is still a global surplus, the resource pool with exhausted resource packages will be refused to provide capacity, making it impossible for users to use the remaining resources, thereby reducing user satisfaction with the service.
[0005] According to a first aspect of the present disclosure, a resource allocation method is provided, which is applied to a central resource pool manager for execution, and the method includes:
[0006] receiving a resource allocation request initiated by a first resource pool manager;
[0007] The allocatable resources in the second resource pool are acquired, and resources are allocated to the first resource pool by using the allocatable resources, so that the resources applied for by the user are deducted from the first resource pool.
[0008] According to a second aspect of the present disclosure, a resource allocation method is provided, which is applied to a first resource pool manager for execution, and the method includes:
[0009] Receive a resource application sent by a user, where the resource application is used to apply for resources required by the user;
[0010] When it is determined that the allocatable resources of the first resource pool are insufficient, a resource allocation request is sent to the central resource pool manager, which is used to obtain the allocatable resources in the second resource pool and allocate resources to the first resource pool through the allocatable resources, so that the user's requested resources are deducted from the first resource pool.
[0011] According to a third aspect of the present disclosure, a resource allocation device is provided, which is applied to a central resource pool manager side, and the device includes:
[0012] A first receiving module, configured to receive a resource allocation request initiated by a first resource pool manager;
[0013] The allocation module is used to obtain allocatable resources in the second resource pool, and allocate resources to the first resource pool through the allocatable resources, so that the user's applied resources are deducted from the first resource pool.
[0014] According to a fourth aspect of the present disclosure, a resource allocation device is provided, which is applied to a first resource pool manager side, and the device includes:
[0015] A second receiving module is used to receive a resource application sent by a user, where the resource application is used to apply for resources required by the user;
[0016] The sending module is used to send a resource allocation request to the central resource pool manager when it is determined that the allocatable resources in the first resource pool are insufficient. The central resource pool manager is used to obtain the allocatable resources in the second resource pool and allocate resources to the first resource pool through the allocatable resources, so that the user's requested resources are deducted from the first resource pool.
[0017] According to the fifth aspect of the present disclosure, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method of the aforementioned first aspect or the method of the aforementioned second aspect.
[0018] According to a sixth aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable a computer to execute the method of the aforementioned first aspect or the aforementioned second aspect.
[0019] According to a seventh aspect of the present disclosure, a computer program product is provided, comprising a computer program, which implements the method of the aforementioned first aspect or the aforementioned second aspect when executed by a processor.
[0020] Compared with the prior art, the resource allocation method, device and electronic device provided by the present disclosure receive a resource allocation request initiated by the first resource pool manager; obtain the allocatable resources in the second resource pool, and allocate resources to the first resource pool through the allocatable resources, so that the user's application resources are deducted from the first resource pool. In the scheme of the present disclosure, when the usage of the resource package of the first resource pool approaches or reaches the upper limit, a resource allocation request will be initiated. After receiving the resource allocation request, the central resource pool manager will formulate a reallocation strategy based on the current global allocatable resource usage, so that even if the resource package of the first resource pool is exhausted, the user can use the global remaining resources, thereby improving the user's satisfaction with the service.
[0021] The above description is only an overview of the technical solution of the present application. In order to more clearly understand the technical means of the present application, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the specific implementation methods of the present application are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0023] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0024] Figure 1 A schematic diagram of a flow chart of a resource allocation method provided by an embodiment of the present disclosure;
[0025] Figure 2 A logical processing diagram of a business module provided by an embodiment of the present disclosure;
[0026] Figure 3 A flowchart of another resource allocation method provided by an embodiment of the present disclosure;
[0027] Figure 4 A flowchart of another resource allocation method provided by an embodiment of the present disclosure;
[0028] Figure 5 A schematic diagram of a trigger mechanism and allocation mechanism flow chart provided by an embodiment of the present disclosure;
[0029] Figure 6 A schematic diagram of the structure of a resource allocation device provided by an embodiment of the present disclosure;
[0030] Figure 7 A schematic diagram of the structure of a resource allocation device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0031] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description. It should be noted that, in the absence of conflict, the embodiments of the present disclosure and the features in the embodiments may be combined with each other.
[0032] The resource allocation method, device and electronic device according to the embodiments of the present disclosure are described below with reference to the accompanying drawings.
[0033] In order to solve the current technical problem that when a resource package of a single local resource pool is exhausted but there is still surplus in the global resource pool, the resource pool with exhausted resource packages will be rejected to provide capacity, so that users will not be able to use the remaining resources, thereby reducing user satisfaction with the service. The embodiments of the present disclosure provide a resource allocation method, device and electronic device.
[0034] like Figure 1 As shown, an embodiment of the present disclosure provides a resource allocation method, which can be applied to a central resource pool manager for execution. The method may include:
[0035] Step 101: Receive a resource allocation request initiated by a first resource pool manager.
[0036] In cloud computing and distributed systems, a resource pool usually refers to a collection of available computing resources, storage resources, network resources, etc. A resource pool can be a physical resource, such as a server or storage device, or a logical resource, such as a virtual machine or container.
[0037] The first resource pool may be a resource pool that provides resources for a specific area or data center; the resource allocation request may be a request initiated by the resource pool to other resource pools or a central resource pool manager to request additional resources or reallocate resources when the resources in the resource pool are insufficient to meet the user's request; the first resource pool manager may be responsible for managing the system components of the first resource pool.
[0038] For the embodiment of the present disclosure, the execution subject may be a central resource pool manager. When the usage of resource packages in the first resource pool approaches or reaches the upper limit, a resource allocation request will be initiated to the central resource pool manager to obtain additional resources to meet the user's request.
[0039] For the disclosed embodiments, the present application has been further optimized on the basis of the existing database isolation processing strategy, adding the coordination, allocation, and management functions of global resources, and adding the usage prediction function of the local resource pool resource package, which can satisfy the isolation of the vast majority of API requests (that is, resource applications sent by users) and the global absolute availability of user resource packages, thus shielding the problem of exhaustion and unavailability of resources in a single resource pool.
[0040] like Figure 2 As shown in the figure, boxes 1 and 3 represent the resource pools of cloud computing vendors in different regions. These resource pools are physically completely isolated. Logically, these resource pools are divided into central resource pools and local resource pools. The central resource pool mainly carries the global management and allocation functions of resource packages. It is also a local resource pool that carries local business capabilities.
[0041] Users can directly call the resource pool capabilities of a specific region through the local domain name, or they can use a unified domain name and the load balancing mechanism to evenly distribute requests to resource pools in various regions to complete API requests and responses.
[0042] The business modules of each local resource pool API response can be fully replicated and deployed, and user API requests are completely isolated. They mainly include API gateway (to implement resource package status verification, deduction, etc.), Redis cache, API capabilities, usage statistics and other functional modules.
[0043] API requests and responses are isolated from the resource pool, but for user order resource packages, they are globally unique and consume the same order resource package times. This application proposes the coordination and allocation management of global resources based on the idea of sub-library, that is, the initial and re-coordinated allocation management process for the same order resource package. Figure 2 Part 2 of the middle frame. In each resource pool, there is a resource manager module, which is responsible for managing the resource package status update, surplus increase and decrease of this resource pool, etc. In the logical central resource pool, a central resource pool manager is set up to be responsible for the coordination and allocation of global resource packages.
[0044] The core of this application is the coordination, allocation, and management capabilities of global resources, which are mainly described from three aspects: allocation mechanism, trigger mechanism, and overall process. The allocation mechanism is mainly an explanation of the idea of resource package sub-library, divided into three stages - initial allocation, global coordination, and global normalization optimization means; the trigger mechanism is mainly global coordination of resource packages, active prediction of redistribution, and threshold reaching trigger strategy; the theme process integrates the allocation mechanism and trigger mechanism into the process, and further explains this plan in more depth, please refer to the following for details.
[0045] Step 102: Acquire allocatable resources in the second resource pool, and allocate resources to the first resource pool using the allocatable resources, so that the resources requested by the user are deducted from the first resource pool.
[0046] The second resource pool may include a central resource pool and other resource pools, and the other resource pools may be resource pools in the global resource pool except the central resource pool and the first resource pool.
[0047] According to the embodiments of the present disclosure, after receiving a resource allocation request, the central resource pool manager will first obtain the allocatable resources in the second resource pool, and then process the resource allocation request according to the allocatable resources and allocation policy in the second resource pool, and allocate resources from other resource pools or the central resource pool to meet the needs of the first resource pool. Even when the resources in the first resource pool are exhausted, through the coordination and allocation of global resources, resource waste can be avoided, resource utilization can be improved, and users can continue to use the service, thereby avoiding service interruptions and improving user satisfaction with the service.
[0048] In summary, compared with the prior art, the resource allocation method, device and electronic device provided by the present disclosure receive a resource allocation request initiated by the first resource pool manager; obtain the allocatable resources in the second resource pool, and allocate resources to the first resource pool through the allocatable resources, so that the user's application resources are deducted from the first resource pool. In the scheme disclosed in the present disclosure, when the usage of the resource package of the first resource pool approaches or reaches the upper limit, a resource allocation request will be initiated. After receiving the resource allocation request, the central resource pool manager will formulate a reallocation strategy based on the current global allocatable resource usage, so that even if the resource package of the first resource pool is exhausted, the user can use the global remaining resources, thereby improving the user's satisfaction with the service.
[0049] Further, as a refinement and expansion of the above embodiment, in order to fully illustrate the specific implementation process of the disclosed method, the present disclosure provides the following Figure 3 The specific method shown includes:
[0050] Step 201, determine whether there is a reserved resource package in the central resource pool; if there is a reserved resource package in the central resource pool, allocate resources to the first resource pool through the reserved resource package, so that the user's application resources are deducted from the first resource pool.
[0051] Among them, a resource package can be a service package purchased by a user, representing a certain amount of cloud computing resources or services that the user can use; a resource package is usually provided in a prepaid manner and may include a certain number of service calls, computing power or data transmission volume, etc.
[0052] The reserved resource package is a part of the resources reserved in advance during the resource package allocation process in order to cope with the possible future resource demand growth or sudden peak demand. These resources are usually not allocated to users immediately, but are reserved by the system for emergency use.
[0053] For the disclosed embodiment, it is first determined whether there is a reserved resource package in the central resource pool; if there is a reserved resource package, when the resources in the first resource pool are insufficient to meet the user's requested resources, the system will give priority to allocating resources from the reserved resource package to the first resource pool. By dynamically allocating reserved resources, resource waste can be avoided, ensuring effective utilization of resources and continuity of services, which can improve user satisfaction with the service.
[0054] In a specific application scenario, when a user orders a resource package, the system can initialize and allocate the resource package according to the number of resource pools (assuming it is n). The available resource package can be divided into 2n equal parts according to the number of resource pools n, of which n parts are pre-allocated to n resource pools, so that each resource pool has a resource and can immediately respond to API resource requests; on the other hand, the remaining n resources are reserved and held by the central resource pool management service to deal with the exhaustion of resources in some resource pools or to deal with the imbalance of resource use, ensuring the high availability of resources.
[0055] When the number of available resource packages in one resource pool is close to exhaustion, a resource allocation request is triggered, and the central resource pool management service allocates the reserved n resource packages to the applicant's resource pool until all the reserved n packages are allocated.
[0056] Initial allocation is when there are sufficient resource packages. This ensures that the global resource pool API interfaces are available, and each resource pool applies for resources in equal parts based on usage rate. This stage can ensure more efficient application and allocation of resource packages.
[0057] This allocation mechanism ensures that all resource pools can provide services immediately after the resource package is purchased, improving response speed and user experience. At the same time, the reserved resources can be used as an emergency buffer. When the resources of a resource pool are consumed too quickly, they can be supplemented from the reserved resources to maintain service stability. This dynamic reallocation and coordination mechanism helps avoid resource waste while ensuring that users can use resources seamlessly in different resource pools.
[0058] Step 202: If there is no reserved resource package in the central resource pool, the managers of multiple other resource pools are controlled to calculate the allocatable resources of the multiple other resource pools; resources are allocated to the first resource pool through the target allocatable resources among the multiple allocatable resources, so that the user's requested resources are deducted from the first resource pool.
[0059] The target allocatable resource may be the maximum resource among multiple allocatable resources (i.e., the maximum number of split resource packages of other resource pools in the global coordination allocation phase). The allocatable resources of multiple other resource pools may be the number of resource packages that are split from resources in a resource package and allocated to other resource pools.
[0060] For the disclosed embodiment, after all the initially allocated reserved resource packages are equally allocated (i.e., if there are no reserved resource packages), the global coordinated allocation phase is entered. In this phase, since the usage and demand of each resource pool are different, the central resource pool management needs to intervene to coordinate, query the usage of each resource pool (other resource pools), and use a preemptive allocation rule.
[0061] The manager that controls multiple other resource pools calculates the allocatable resources of multiple other resource pools (i.e., calculates the number of split resource packages). )
[0062] The calculation formula can be:
[0063] In the formula, It can be the remaining number of times in the resource pool at a certain point in the future. The remaining number of available resource packages in the resource pool.
[0064] For the disclosed embodiment, the system can split a certain number of resource packages from the target allocatable resources and allocate them to the first resource pool. The purpose of allocating resource packages is to supplement the shortage of resource packages in the first resource pool and ensure that users can obtain the resources they apply for.
[0065] In a specific application scenario, during the global coordination phase, the central resource pool management can receive the first resource pool resource allocation request, and issue divisible pre-allocated computing tasks to other resource pools.
[0066] Central resource pool management can aggregate the calculation results of other resource pools and select The maximum number of split resource packages (i.e., the target allocatable resources) is used as the number of splits for this allocation request, and the other resource pools corresponding to the maximum number of split resource packages are used. as the target resource pool.
[0067] Then, the central resource pool management can coordinate the first resource pool Ps and the target resource pool Pt to re-divide the available resources for the number of splits Ct.
[0068] Step 203: If multiple allocatable resources are all less than the preset resource threshold, a resource unification request is sent to other resource pools and the first resource pool to aggregate the allocatable resources of the first resource pool and other resource pools in the central resource pool, so that the user's requested resources are deducted from the aggregated allocatable resources.
[0069] Among them, the resource normalization request can be used to aggregate the globally available resources of the global resource pool and ensure that these resources are uniformly managed and used in a global scope.
[0070] In specific application scenarios, when the total global available resources are reduced to a certain extent, each first resource pool will frequently send global coordination requests to the central resource pool manager to request additional resources or reallocate resources. Since the system needs to continuously process these requests and reallocate resources, frequent requests may reduce the availability of the entire system. When resources are tight to a certain extent, the system will enter the global normalization stage. In this stage, the available resources of all resource pools will be normalized and aggregated to the central resource pool manager for global management and usage reduction.
[0071] In the global coordination phase, if the allocatable resources (i.e. the number of split resource packages) of other resource pools are less than the preset resource threshold, the global normalization phase will begin. The central resource pool manager will send resource normalization requests to each global resource pool, and the global resource pool needs to report and close the available resource package processing of this resource pool, that is, stop the resource deduction operation in this resource pool.
[0072] API resource requests for the global resource pool no longer deduct available resources within the local resource pool, but directly deduct resources from the central resource pool until the global resources are exhausted, thereby ensuring unified management and optimized use of global resources.
[0073] In summary, compared with the prior art, the resource allocation method, device and electronic device provided by the present disclosure receive a resource allocation request initiated by the first resource pool manager; obtain the allocatable resources in the second resource pool, and allocate resources to the first resource pool through the allocatable resources, so that the user's application resources are deducted from the first resource pool. In the scheme disclosed in the present disclosure, when the usage of the resource package of the first resource pool approaches or reaches the upper limit, a resource allocation request will be initiated. After receiving the resource allocation request, the central resource pool manager will formulate a reallocation strategy based on the current global allocatable resource usage, so that even if the resource package of the first resource pool is exhausted, the user can use the global remaining resources, thereby improving the user's satisfaction with the service.
[0074] The above embodiment is a resource allocation process described on the central resource pool manager side. Further, in order to fully illustrate the implementation of this embodiment, this embodiment also provides another resource allocation method, which can be applied to the first resource pool manager side. Figure 4 As shown, the method includes:
[0075] Step 301: Receive a resource application sent by a user, where the resource application is used to apply for resources required by the user.
[0076] Among them, resource application can be a request sent by a user to a service provider through an application programming interface (API) or other interface to obtain a certain resource or service.
[0077] For the disclosed embodiment, when a user initiates an API resource request, the system first checks the status of the currently available resource package. If the currently available resource package is in an unavailable state, it indicates that the remaining resources in the resource package have been used up and the user can no longer use these resources. The system will reject the user's API resource request;
[0078] If the current available resource package status is unsubscribed, it means that the user has not purchased the resource package yet, that is, there are no available resources. The system will also reject the user's API resource request to ensure the effective use of resources, avoid resource waste, and ensure that users can only use the resources they have purchased and authorized.
[0079] Step 302: When it is determined that the allocatable resources of the first resource pool are insufficient, a resource allocation request is sent to the central resource pool manager. The central resource pool manager is used to obtain the allocatable resources in the second resource pool and allocate resources to the first resource pool through the allocatable resources, so that the user's requested resources are deducted from the first resource pool.
[0080] For the embodiment of the present disclosure, as a possible implementation method, determining that the allocatable resources of the first resource pool are insufficient may specifically include:
[0081] Using the historical time interval points and corresponding historical usage resources of the first resource pool, predicting the usage resources of the first resource pool at a preset time point;
[0082] According to the usage resources, the total usage resources from the current time point to the preset time point are counted; if the total usage resources are greater than the allocatable resources of the first resource pool, it is determined that the allocatable resources of the first resource pool are insufficient.
[0083] Among them, the historical time interval point can be a certain time point in the past, usually in the form of a time interval, such as every minute, every hour, etc.; the historical usage resources can be the actual resource usage recorded at the historical time interval points, which is used to reflect the resource usage at a specific time point; the preset time point can be a future time point set by the system, which can be used to predict and plan the use of resources; the total usage resources can be the predicted total resource usage from the current time point to the preset time point, which can be used to evaluate the total resource demand in the future period of time.
[0084] For the embodiments of the present disclosure, if the current resources are insufficient to support the predicted demand, that is, when the total usage resources are greater than the current remaining resource usage of the first resource pool, in order to ensure that there are sufficient resources to meet the predicted demand before a preset time point, it is necessary to initiate a resource allocation request to obtain additional resources from other resource pools or the central resource pool.
[0085] For the embodiment of the present disclosure, as another possible implementation method, determining that the allocatable resources of the first resource pool are insufficient may specifically include:
[0086] If the allocatable resources of the first resource pool are less than the preset resource threshold, it is determined that the allocatable resources of the first resource pool are insufficient.
[0087] The preset resource threshold may be a value set according to actual conditions and used to measure the sufficiency of the remaining resources in the resource pool.
[0088] For the embodiment of the present disclosure, if the allocatable resources (ie, the current remaining resource usage) of the first resource pool are less than the preset resource threshold, it indicates that the remaining resources in the resource pool may not be sufficient to meet future demand.
[0089] In order to avoid service interruption or denial of service, the system will initiate a resource allocation request to request additional resources or reallocate resources. By initiating resource allocation requests in advance, the system can obtain the necessary resources before the resources are actually exhausted, thereby ensuring service continuity and reliability.
[0090] For the embodiments of the present disclosure, the triggering mechanism for triggering the first resource pool to initiate a resource allocation request can be divided into a prediction triggering mechanism and a threshold reaching triggering mechanism.
[0091] Among them, the prediction trigger mechanism can be to regularly monitor the usage of the first resource pool based on the usage data set of the past time period, predict the usage demand at a future time point, and trigger a resource allocation request when the usage of the remaining resource packages does not meet the predicted demand.
[0092] Since the amount of data requests from users is relatively linear and stable in the near time period, we choose to establish a linear model to build a univariate linear regression model.
[0093] The model formula can be
[0094] In the formula, Represents the error amount, the system will pass the near time period Datasets within ,..., In the input model, represents the fixed time interval points and usage values in the past, calculates the regression parameter values a and b, and obtains the prediction model p( ).
[0095] The system inputs the data set within a certain period of time in the past (including the time interval point x and the usage value y) into the model, calculates the regression parameters a and b, and obtains the prediction model p(xt) at the current time point.
[0096] Through the prediction model, we can predict the user request usage p at the future time point ti ( ), so that the total available resources required from the current time point to ti (total resource usage value) can be obtained , the current remaining available resource packages do not meet the predicted resources, that is, < When the resource package is insufficient, the reallocation request is triggered. Through the prediction trigger mechanism, the hidden danger of insufficient resource packages can be discovered early and applied for in time. The timing interval t of the prediction time and the test time point ti can be adjusted according to the actual scenario.
[0097] The threshold-reaching trigger mechanism can be a supplementary mechanism for the prediction trigger mechanism, providing a minimum configuration judgment. Even if the prediction model fails to predict insufficient resources, it can detect the problem and take action through real-time statistics. Therefore, the threshold-reaching trigger mechanism is a protection mechanism to ensure user availability. Even if the prediction model is wrong or the system encounters an unexpected peak demand, real-time monitoring and rapid response can avoid user service interruptions caused by insufficient resources, ensuring that users can continue to access services.
[0098] For the embodiments of the present disclosure, Figure 5 As shown:
[0099] 1. When receiving a user API resource request (resource application), determine the current available resource package status (rid). If it is unavailable / unordered, reject the user request. If it is in the global normalization stage, apply for a deduction request to the central resource pool manager. If the deduction is successful, respond to the API processing. If the deduction fails, reject the user request.
[0100] 2. Resource package usage statistics: When status(rid) is in the global normalization stage, the current resource pool resource package surplus is not calculated. Otherwise, determine whether the surplus reaches the threshold. , when satisfied, go to step 4 to trigger the allocation request; if not satisfied, terminate.
[0101] 3. Scheduled prediction task execution, when status(rid) is in the global normalization stage, the current resource pool resource package surplus is not calculated. Otherwise, the prediction surplus meets the usage , when not satisfied, go to 4 to trigger allocation request; if satisfied, terminate.
[0102] 4. The central resource pool manager allocates resources. If the current available resource package status (rid) is in the initial allocation stage and there are reserved resource packages, they are allocated to the application resource pool; if there are no reservations, status (rid) is updated to the global coordination stage and 5 is executed.
[0103] 5. Global coordination, current available resource package status status (rid) If it is in the global coordination stage, issue division tasks to each local resource pool and summarize the division results ,if , then execute the coordination result allocation; if it is not satisfied, update status(rid) to the global normalization stage and execute 6.
[0104] 6. Global normalization, send normalization processing to all local resource pools, update the status (rid) of each local resource pool = global normalization, update the local available resource package to 0, and the central resource pool manager summarizes the total available resource packages of each resource pool. Subsequent user requests will be uniformly deducted by the central resource pool manager.
[0105] In the entire business process, the global status (rid) state must be perceived by all resource pools, and the redistribution and normalization of resources must maintain global data consistency. The TCC eventual consistency solution can be selected, and this solution will not be expanded.
[0106] In summary, compared with the prior art, the resource allocation method, device and electronic device provided by the present disclosure receive a resource allocation request initiated by the first resource pool manager; obtain the allocatable resources in the second resource pool, and allocate resources to the first resource pool through the allocatable resources, so that the user's application resources are deducted from the first resource pool. In the scheme disclosed in the present disclosure, when the usage of the resource package of the first resource pool approaches or reaches the upper limit, a resource allocation request will be initiated. After receiving the resource allocation request, the central resource pool manager will formulate a reallocation strategy based on the current global allocatable resource usage, so that even if the resource package of the first resource pool is exhausted, the user can use the global remaining resources, thereby improving the user's satisfaction with the service.
[0107] Based on the above Figure 1 and Figure 3 The present disclosure provides a resource allocation device, such as Figure 6 As shown, the device includes: a first receiving module 31, a distribution module 32;
[0108] A first receiving module 31, configured to receive a resource allocation request initiated by a first resource pool manager;
[0109] The allocation module 31 is used to obtain allocatable resources in the second resource pool, and allocate resources to the first resource pool through the allocatable resources, so that the user's requested resources are deducted from the first resource pool.
[0110] In a specific application scenario, the second resource pool includes a central resource pool, and an allocation module 31 can be used to determine whether there is a reserved resource package in the central resource pool; if the reserved resource package exists in the central resource pool, resources are allocated to the first resource pool through the reserved resource package, so that the user-applied resources are deducted from the first resource pool.
[0111] In a specific application scenario, the second resource pool includes other resource pools, and the other resource pools are resource pools in the global resource pool except the central resource pool and the first resource pool; the allocation module 31 can be used to control managers of multiple other resource pools to calculate the allocatable resources of the multiple other resource pools if the reserved resource package does not exist in the central resource pool;
[0112] The first resource pool is allocated resources by using a target allocatable resource among the multiple allocatable resources, so that the user applied resources are deducted from the first resource pool, and the target allocatable resource is the largest resource among the multiple allocatable resources.
[0113] In a specific application scenario, the device further includes: a sending module 33;
[0114] The sending module 33 is used to send a resource unification request to the other resource pools and the first resource pool if the multiple allocatable resources are all less than the preset resource threshold, so as to aggregate the allocatable resources of the first resource pool and the other resource pools in the central resource pool, so that the user's requested resources are deducted from the aggregated allocatable resources.
[0115] It should be noted that for other corresponding descriptions of the functional units involved in the resource allocation device provided in the present disclosure, please refer to Figure 1 and Figure 3 The corresponding description in will not be repeated here.
[0116] Further, as Figure 6 The specific implementation of the method shown in the embodiment provides a resource allocation device that can be applied to the first resource pool manager side, such as Figure 7 As shown, the device includes: a second receiving module 41, a sending module 42;
[0117] The second receiving module 41 is used to receive a resource application sent by a user, where the resource application is used to apply for resources required by the user;
[0118] The sending module 42 is used to send a resource allocation request to the central resource pool manager when it is determined that the allocatable resources in the first resource pool are insufficient. The central resource pool manager is used to obtain the allocatable resources in the second resource pool and allocate resources to the first resource pool through the allocatable resources, so that the user's requested resources are deducted from the first resource pool.
[0119] In a specific application scenario, the sending module 42 can be used to use the historical time interval points and corresponding historical usage resources of the first resource pool to predict the usage resources of the first resource pool at a preset time point; based on the usage resources, the total usage resources from the current time point to the preset time point are counted; if the total usage resources are greater than the allocatable resources of the first resource pool, it is determined that the allocatable resources of the first resource pool are insufficient.
[0120] In a specific application scenario, the sending module 42 may be used to determine that the allocatable resources in the first resource pool are insufficient if the allocatable resources in the first resource pool are less than a preset resource threshold.
[0121] It should be noted that for other corresponding descriptions of the functional units involved in the resource allocation device provided in the present disclosure, please refer to Figure 4 The corresponding description in will not be repeated here.
[0122] Based on the above Figure 1 , Figure 3 and Figure 4 The method shown in the present disclosure, accordingly, also provides a computer-readable storage medium having a computer program stored thereon, which implements the above-mentioned Figure 1 , Figure 3 and Figure 4 The method shown.
[0123] Based on this understanding, the technical solution of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.), and includes a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods of various implementation scenarios of the present disclosure.
[0124] Optionally, the above-mentioned physical device may also include a user interface, a network interface, a camera, a radio frequency (RF) circuit, a sensor, an audio circuit, a WI-FI module, etc. The user interface may include a display, an input unit such as a keyboard, etc., and the optional user interface may also include a USB interface, a card reader interface, etc. The network interface may optionally include a standard wired interface, a wireless interface (such as a WI-FI interface), etc.
[0125] Those skilled in the art will appreciate that the above-mentioned physical device structure provided by the present disclosure does not constitute a limitation on the physical device, and may include more or fewer components, or a combination of certain components, or different arrangements of components.
[0126] The storage medium may also include an operating system and a network communication module. The operating system is a program that manages the hardware and software resources of the above-mentioned physical device, and supports the operation of the information processing program and other software and / or programs. The network communication module is used to realize the communication between the components inside the storage medium, and the communication with other hardware and software in the information processing physical device.
[0127] Through the description of the above implementation methods, the technical personnel in this field can clearly understand that the present disclosure can be implemented by means of software plus the necessary general hardware platform, or by hardware. According to the resource allocation method, device and electronic device provided by the present disclosure, compared with the prior art, the present disclosure receives a resource allocation request initiated by the first resource pool manager; obtains the allocatable resources in the second resource pool, and allocates resources to the first resource pool through the allocatable resources, so that the user's application resources are deducted from the first resource pool. In the scheme of the present disclosure, when the usage of the resource package of the first resource pool approaches or reaches the upper limit, a resource allocation request will be initiated. After receiving the resource allocation request, the central resource pool manager will formulate a reallocation strategy based on the current global allocatable resource usage, so that even if the resource package of the first resource pool is exhausted, the user can use the global remaining resources, thereby improving the user's satisfaction with the service.
[0128] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the term "comprising" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprising a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0129] The above are only specific embodiments of the present disclosure, so that those skilled in the art can understand or implement the present disclosure. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present disclosure. Therefore, the present disclosure will not be limited to these embodiments herein, but will conform to the widest scope consistent with the principles and novel features applied herein.
Claims
1. A resource allocation method, characterized in that: Applied to the central resource pool manager side for execution, the method includes: receiving a resource allocation request initiated by a first resource pool manager; Acquire allocatable resources in the second resource pool, and allocate resources to the first resource pool through the allocatable resources so that the user-applied resources are deducted from the first resource pool, wherein the second resource pool includes a central resource pool or other resource pools, and the other resource pools are resource pools in the global resource pool except the central resource pool and the first resource pool, including: if there is a reserved resource package in the central resource pool, allocate resources to the first resource pool through the reserved resource package so that the user-applied resources are deducted from the first resource pool; if the reserved resource package does not exist in the central resource pool, calculate the allocatable resources of multiple other resource pools; allocate resources to the first resource pool through the target allocatable resources among the multiple allocatable resources so that the user-applied resources are deducted from the first resource pool, and the target allocatable resources are the largest resources among the multiple allocatable resources.
2. The method according to claim 1, characterized in that The method further comprises: If the multiple allocatable resources are all less than the preset resource threshold, a resource unification request is sent to the other resource pools and the first resource pool to aggregate the allocatable resources of the first resource pool and the other resource pools in the central resource pool, so that the user-applied resources are deducted from the aggregated allocatable resources.
3. A resource allocation method, characterized in that: Applied to the first resource pool manager side for execution, the method includes: Receive a resource application sent by a user, where the resource application is used to apply for resources required by the user; When it is determined that the allocatable resources of the first resource pool are insufficient, a resource allocation request is sent to the central resource pool manager, and the central resource pool manager is used to obtain the allocatable resources in the second resource pool, and allocate resources to the first resource pool through the allocatable resources, so that the user-applied resources are deducted from the first resource pool, wherein the second resource pool includes the central resource pool or other resource pools, and the other resource pools are resource pools in the global resource pool except the central resource pool and the first resource pool. If there is a reserved resource package in the central resource pool, resources are allocated to the first resource pool through the reserved resource package, so that the user-applied resources are deducted from the first resource pool; if the reserved resource package does not exist in the central resource pool, the allocatable resources of multiple other resource pools are calculated; resources are allocated to the first resource pool through the target allocatable resources among the multiple allocatable resources, so that the user-applied resources are deducted from the first resource pool, and the target allocatable resources are the largest resources among the multiple allocatable resources.
4. The method according to claim 3, characterized in that The determining that the allocatable resources in the first resource pool are insufficient includes: Using the historical time intervals and corresponding historical usage resources of the first resource pool, predicting the usage resources of the first resource pool at a preset time point; According to the usage resources, counting the total usage resources from the current time point to the preset time point; If the total usage resources are greater than the allocatable resources of the first resource pool, it is determined that the allocatable resources of the first resource pool are insufficient.
5. The method according to claim 3, characterized in that: The determining that the allocatable resources in the first resource pool are insufficient includes: If the allocatable resources in the first resource pool are less than a preset resource threshold, it is determined that the allocatable resources in the first resource pool are insufficient.
6. A resource allocation device, characterized in that: Applied to the central resource pool manager side, the device includes: A first receiving module, configured to receive a resource allocation request initiated by a first resource pool manager; An allocation module is used to obtain allocatable resources in a second resource pool, and to allocate resources to the first resource pool through the allocatable resources so that the user-applied resources are deducted from the first resource pool, wherein the second resource pool includes a central resource pool or other resource pools, and the other resource pools are resource pools in the global resource pool other than the central resource pool and the first resource pool, including: if there is a reserved resource package in the central resource pool, then allocatable resources to the first resource pool through the reserved resource package so that the user-applied resources are deducted from the first resource pool; if the reserved resource package does not exist in the central resource pool, then allocatable resources of multiple other resource pools are calculated; and resource allocation to the first resource pool through target allocatable resources among the multiple allocatable resources so that the user-applied resources are deducted from the first resource pool, and the target allocatable resources are the largest number of resources among the multiple allocatable resources.
7. A resource allocation device, characterized in that: Applied to the first resource pool manager side, the device includes: A second receiving module is used to receive a resource application sent by a user, where the resource application is used to apply for resources required by the user; A sending module is used to send a resource allocation request to a central resource pool manager when it is determined that the allocatable resources of the first resource pool are insufficient, and the central resource pool manager is used to obtain the allocatable resources in the second resource pool, and allocate resources to the first resource pool through the allocatable resources, so that the user's requested resources are deducted from the first resource pool, wherein the second resource pool includes a central resource pool or other resource pools, and the other resource pools are resource pools in the global resource pool except the central resource pool and the first resource pool. If there is a reserved resource package in the central resource pool, the first resource pool is allocated resources through the reserved resource package, so that the user's requested resources are deducted from the first resource pool; if the reserved resource package does not exist in the central resource pool, the allocatable resources of multiple other resource pools are calculated; the first resource pool is allocated resources through the target allocatable resources among the multiple allocatable resources, so that the user's requested resources are deducted from the first resource pool, and the target allocatable resources are the largest resources among the multiple allocatable resources.
8. A computer program product, characterized in that The invention comprises a computer program, which, when executed by a processor, implements the method according to any one of claims 1-2, or any one of claims 3-5.
