CN118170549A - Resource allocation method and device and electronic equipment - Google Patents

Resource allocation method and device and electronic equipment Download PDF

Info

Publication number
CN118170549A
CN118170549A CN202410580305.8A CN202410580305A CN118170549A CN 118170549 A CN118170549 A CN 118170549A CN 202410580305 A CN202410580305 A CN 202410580305A CN 118170549 A CN118170549 A CN 118170549A
Authority
CN
China
Prior art keywords
resource
resource pool
resources
allocable
pool
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202410580305.8A
Other languages
Chinese (zh)
Other versions
CN118170549B (en
Inventor
王壮
纪光
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Mobile Communications Group Co Ltd
China Mobile Suzhou Software Technology Co Ltd
Original Assignee
China Mobile Communications Group Co Ltd
China Mobile Suzhou Software Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Mobile Communications Group Co Ltd, China Mobile Suzhou Software Technology Co Ltd filed Critical China Mobile Communications Group Co Ltd
Priority to CN202410580305.8A priority Critical patent/CN118170549B/en
Publication of CN118170549A publication Critical patent/CN118170549A/en
Application granted granted Critical
Publication of CN118170549B publication Critical patent/CN118170549B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5083Techniques for rebalancing the load in a distributed system
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5011Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
    • G06F9/5016Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals the resource being the memory
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5061Partitioning or combining of resources
    • G06F9/5072Grid computing

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Mathematical Physics (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The disclosure relates to a resource allocation method, a device and electronic equipment, and relates to the technical field of cloud computing, wherein the method comprises the following steps: receiving a resource allocation request initiated by a first resource pool manager; the method comprises the steps of obtaining the allocable resources in the second resource pool, carrying out resource allocation on the first resource pool through the allocable resources, deducting user application resources from the first resource pool, and by applying the scheme of the disclosure, when the use amount of the resource package of the first resource pool is close to or reaches the upper limit, initiating a resource allocation request, and after receiving the resource allocation request, a central resource pool manager formulates a reallocation strategy according to the current global allocable resource use condition, so that even if the use of the resource package of the first resource pool is exhausted, a user can use global residual resources, thereby improving the satisfaction degree of the user to services.

Description

Resource allocation method and device and electronic equipment
Technical Field
The present application relates to the field of cloud computing technologies, and in particular, to a resource allocation method, a device, and an electronic device.
Background
In current cloud computing environments, public cloud vendors typically establish resource pools across multiple regions of the country to provide various AI-capability products. The user can acquire a resource package of specific AI capabilities as needed and use these capabilities through the API interface. The resource package may provide a number of service uses.
In the existing solution, a separate-library isolation processing strategy is mainly utilized, namely, the use of a resource package is limited to a single affiliated resource pool, and a user can only use the resources in the resource pool of the affiliated area. However, in the case that the resource usage in the resource pool of a single home is exhausted, but the resource pools of other regions still have a margin, the resource pool providing capability of the exhausted resource package is refused, so that the user cannot use the residual resources, thereby reducing the satisfaction of the user to the service.
Disclosure of Invention
In view of this, the present application provides a method, an apparatus and an electronic device for allocating resources, which mainly aims to solve the technical problem that the user cannot use the remaining resources and thus reduce the satisfaction of the user to the service because the resource pool providing capability of the consumed resource pool is rejected under the condition that the use of the resource pool resource packet of a single area is consumed but the global margin is still remained.
According to a first aspect of the present disclosure, there is provided a resource allocation method applied to a central resource pool manager side for execution, the method comprising:
receiving a resource allocation request initiated by a first resource pool manager;
And obtaining the allocable resources in the second resource pool, and performing resource allocation on the first resource pool through the allocable resources, so that the user application resources are deducted from the first resource pool.
According to a second aspect of the present disclosure, there is provided a resource allocation method applied to a first resource pool manager side for execution, the method comprising:
receiving a resource application sent by a user, wherein the resource application is used for applying resources required by the user;
When the fact that the allocable resources of the first resource pool are insufficient is determined, a resource allocation request is sent to a central resource pool manager, and the central resource pool manager is used for acquiring allocable resources in the second resource pool and performing resource allocation on the first resource pool through the allocable resources, so that user application resources are deducted from the first resource pool.
According to a third aspect of the present disclosure, there is provided a resource allocation apparatus applied to a central resource pool manager side, the apparatus comprising:
the first receiving module is used for receiving a resource allocation request initiated by the first resource pool manager;
And the allocation module is used for acquiring the allocable resources in the second resource pool, and allocating the resources to the first resource pool through the allocable resources so as to deduct the user application resources from the first resource pool.
According to a fourth aspect of the present disclosure, there is provided a resource allocation apparatus applied to a first resource pool manager side, the apparatus comprising:
the second receiving module is used for receiving a resource application sent by a user, wherein the resource application is used for applying resources required by the user;
The sending module is used for sending a resource allocation request to the central resource pool manager when the fact that the allocable resources of the first resource pool are insufficient is determined, wherein the central resource pool manager is used for acquiring allocable resources in the second resource pool and carrying out resource allocation on the first resource pool through the allocable resources so as to deduct user application resources from the first resource pool.
According to a fifth aspect of the present disclosure, there is provided an electronic device comprising: at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of the first aspect or the method of the second aspect.
According to a sixth aspect of the present disclosure, there is provided a non-transitory computer readable storage medium storing computer instructions for causing a computer to perform the method of the foregoing first aspect or the method of the foregoing second aspect.
According to a seventh aspect of the present disclosure, there is provided a computer program product comprising a computer program which, when executed by a processor, implements the method of the first aspect as described above or the method of the second aspect as described above.
Compared with the prior art, the resource allocation method, the device and the electronic equipment provided by the disclosure receive the resource allocation request initiated by the first resource pool manager; and obtaining the allocable resources in the second resource pool, and performing resource allocation on the first resource pool through the allocable resources, so that the user application resources are deducted from the first resource pool. In the scheme of the disclosure, when the usage amount of the resource package of the first resource pool approaches or reaches the upper limit, a resource allocation request is initiated, and after the central resource pool manager receives the resource allocation request, a reallocation strategy is formulated according to the current global allocable resource usage condition, so that even if the usage amount of the resource package of the first resource pool is exhausted, a user can use global residual resources, and the satisfaction degree of the user to the service is improved.
The foregoing description is only an overview of the present application, and is intended to be implemented in accordance with the teachings of the present application in order that the same may be more clearly understood and to make the same and other objects, features and advantages of the present application more readily apparent.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the application and together with the description, serve to explain the principles of the application.
In order to more clearly illustrate the embodiments of the application or the technical solutions of the prior art, the drawings which are used in the description of the embodiments or the prior art will be briefly described, and it will be obvious to a person skilled in the art that other drawings can be obtained from these drawings without inventive effort.
Fig. 1 is a flow chart of a resource allocation method according to an embodiment of the present disclosure;
fig. 2 is a schematic logic processing diagram of a service module according to an embodiment of the disclosure;
Fig. 3 is a flowchart of another resource allocation method according to an embodiment of the present disclosure;
Fig. 4 is a flowchart of another resource allocation method according to an embodiment of the present disclosure;
Fig. 5 is a schematic flow chart of a trigger mechanism and an allocation mechanism provided in an embodiment of the disclosure;
fig. 6 is a schematic structural diagram of a resource allocation device according to an embodiment of the present disclosure;
Fig. 7 is a schematic structural diagram of a resource allocation device according to an embodiment of the present disclosure.
Detailed Description
Exemplary embodiments of the present disclosure are described below in conjunction with the accompanying drawings, which include various details of the embodiments of the present disclosure to facilitate understanding, and should be considered as merely exemplary. Accordingly, one of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the present disclosure. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness. It should be noted that, without conflict, the embodiments of the present disclosure and features in the embodiments may be combined with each other.
The following describes a resource allocation method, a device and an electronic device according to an embodiment of the present disclosure with reference to the accompanying drawings.
In order to solve the technical problems that the use of the resource pool resource package of the single affiliated resource pool is exhausted at present, but the resource pool providing capability of the exhausted resource package is refused under the condition that the overall situation still has a margin, so that the user cannot use the residual resource, and the satisfaction degree of the user to the service is reduced. The embodiment of the disclosure provides a resource allocation method, a resource allocation device and electronic equipment.
As shown in fig. 1, an embodiment of the present disclosure provides a resource allocation method, which may be applied to a central resource pool manager side for execution, and the method may include:
Step 101, a resource allocation request initiated by a first resource pool manager is received.
In cloud computing and distributed systems, a Resource Pool (Resource Pool) generally refers to a collection that contains available computing resources, storage resources, network resources, and the like. The resource pool may be a physical resource, such as a server, a storage device, or a logical resource, such as a virtual machine, a container, or the like.
The first resource pool may be a resource pool that provides resources for a particular region 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 satisfy the user's request; the first resource pool manager may be responsible for managing system components of the first resource pool.
For the embodiments of the present disclosure, the execution body may be a central resource pool manager, and when the usage of the resource package of the first resource pool approaches or reaches the upper limit, a resource allocation request is initiated to the central resource pool manager, so as to acquire additional resources to satisfy the request of the user.
For the embodiment of the disclosure, the method and the device further optimize based on the existing separate library isolation processing strategy, increase the coordination, allocation and management functions of global resources, increase the resource package consumption prediction function of the affiliated resource pool, not only meet the isolation of most API requests (namely resource applications sent by users), but also meet the global absolute availability of the user resource package, and shield the problem that the resources of a single resource pool are exhausted and unavailable.
As shown in fig. 2, blocks 1 and 3 represent resource pools of cloud computing vendors in different regions, which are physically completely isolated. Logically, these resource pools are divided into a central resource pool and a home resource pool. The central resource pool mainly bears the global management and distribution functions of the resource packages, and is also a generic resource pool for bearing generic service capacity.
The user can directly call the resource pool capability of the specific region through the region name, and can uniformly distribute the request to the resource pools of the regions by utilizing a load balancing mechanism through the unified domain name so as to complete the API request and response.
The service modules responded by the APIs of the resource pools of all the areas can be completely copied and deployed, and the user API requests are completely isolated and mainly comprise functional modules such as an API gateway (for realizing state verification, deduction and the like of resource packages), a Redis cache, API capacity, consumption statistics and the like.
The API request and response are isolated from the resource pool, but the API request and response are globally unique to the user for ordering the resource package order, and the globally consumes the same order resource package times. Based on the library dividing thought, the coordination and allocation management of the global resources, namely the management processes of initial and re-coordination allocation and the like aiming at the same order resource package, are also part of the content of a box 2 in fig. 2. Each resource pool is provided with a resource manager module which is responsible for managing the state updating, the margin increasing and decreasing and the like of the resource package of the resource pool, and a central resource pool manager is arranged in the logic central resource pool and is responsible for the coordination and distribution work of the global resource package.
The core of the application is mainly the coordination, allocation and management capability of global resources, and is mainly described from 3 aspects: allocation mechanism, trigger mechanism, and overall flow. The allocation mechanism is mainly the explanation of the thought of the resource package sub-library, and is divided into 3 stages-an optimization means of initial allocation, global coordination and global normalization; the trigger mechanism mainly comprises active prediction of global coordination and redistribution of resource packets and a threshold value arrival trigger strategy; the theme process integrates the distribution mechanism and the triggering mechanism, and further describes the scheme in depth, and the detail can be seen in the following.
Step 102, obtaining the allocable resources in the second resource pool, and performing resource allocation on the first resource pool through the allocable resources, so that the user application resources are deducted from the first resource pool.
Wherein the second resource pool may include a central resource pool and other resource pools, and the other resource pools may be resource pools other than the central resource pool and the first resource pool in the global resource pool.
For the embodiment of the disclosure, after receiving the resource allocation request, the central resource pool manager firstly obtains the allocable resources in the second resource pool, then processes the resource allocation request according to the allocable resources and the allocation policy in the second resource pool, allocates resources from other resource pools or the central resource pool to meet the requirement of the first resource pool, and even if the resources in the first resource pool are exhausted, the resources can be prevented from being wasted, the resource utilization rate can be improved, and the user can be ensured to continue to use the service, so that service interruption is avoided, and the satisfaction degree of the user to the service is improved.
In summary, compared with the prior art, the resource allocation method, the device and the electronic equipment provided by the present disclosure receive a resource allocation request initiated by a first resource pool manager; and obtaining the allocable resources in the second resource pool, and performing resource allocation on the first resource pool through the allocable resources so as to deduct the user application resources from the first resource pool. In the scheme of the disclosure, when the usage amount of the resource package of the first resource pool approaches or reaches the upper limit, a resource allocation request is initiated, and after the central resource pool manager receives the resource allocation request, a reallocation strategy is formulated according to the current global allocable resource usage condition, so that even if the usage amount of the resource package of the first resource pool is exhausted, a user can use global residual resources, and the satisfaction degree of the user to the service is improved.
Further, as a refinement and extension of the foregoing embodiments, for a complete description of a specific implementation of the method of the present disclosure, the present disclosure provides a specific method as shown in fig. 3, where the method includes:
Step 201, judging whether a reserved resource packet exists in a central resource pool; if the reserved resource packet exists in the central resource pool, the resource allocation is carried out on the first resource pool through the reserved resource packet, so that the user application resource is deducted from the first resource pool.
Wherein, the resource package can be a service package purchased by a user and represents a certain amount of cloud computing resources or services which can be used by the user; the resource packages are typically provided in a prepaid manner and may contain a number of service calls, computing power or data traffic, etc.
The reserved resource package may be a portion of the resource that is reserved in advance during the allocation process for the resource package to cope with possible future increases in resource demand or sudden peak demand. These resources are typically not immediately allocated to the user, but are reserved by the system for occasional use.
For the embodiment of the disclosure, firstly, judging whether a reserved resource packet exists in a central resource pool; if the reserved resource packet exists, when the resources in the first resource pool are insufficient to meet the application resources of the user, the system can give priority to the allocation of the resources from the reserved resource packet to the first resource pool, and the reserved resources are dynamically allocated, so that the resource waste can be avoided, the effective utilization of the resources and the continuity of the service are ensured, and the satisfaction degree of the user to the service can be improved.
In a specific application scenario, when a user subscribes to a resource package, the system may perform initialized partitioning and allocation on the resource package according to the number of resource pools (assumed to be n). The available resource packages can be equally divided into 2n parts according to the number n of the resource pools, wherein n parts are pre-allocated to n resource pools, so that each resource pool has one part of resource, and an API resource request can be responded immediately; on the other hand, the remaining n resources are reserved as reservations, and are held by the central resource pool management service for coping with the situation that some resource pool resources are exhausted or for coping with the imbalance of resource usage, thereby ensuring high availability of resources.
When the number of available resource packages of one resource pool is nearly exhausted, triggering a resource allocation request, and dividing the reserved n resource packages into the resource pools of the application party by the central resource pool management service until the reserved n resource packages are completely divided.
Under the condition that the resource package is sufficient, the initial allocation ensures that the API interfaces of the global resource pools are available, and each resource pool applies equally according to the using rate, so that the application and allocation of the resource package can be ensured more efficiently at this stage.
The allocation mechanism can ensure that all resource pools can provide services immediately after the resource packages are purchased, and response speed and user experience are improved. Meanwhile, the reserved resources can be used as emergency buffer, and when the resource consumption of a certain resource pool is too fast, the reserved resources can be supplemented, so that the stability of the service is maintained. This dynamic reassignment and coordination mechanism helps to avoid wasting resources while ensuring that users can use resources seamlessly in different resource pools.
Step 202, if there is no reserved resource packet in the central resource pool, controlling a manager of a plurality of other resource pools, and calculating the allocable resources of the plurality of other resource pools; and performing resource allocation on the first resource pool through a target allocable resource in the plurality of allocable resources, so that the user application resource is deducted from the first resource pool.
Wherein the target allocable resource may be the most resource of the plurality of allocable resources (i.e., the maximum number of resolvable resource packages of the other resource pools in the global coordination allocation phase). The allocatable resources of the plurality of other resource pools may be the number of resource packages allocated to the other resource pools by splitting the resources in the resource packages.
For the disclosed embodiments, the global coordination allocation phase is entered after all initially allocated reserved resource packet aliquots are allocated (i.e., if there are no reserved resource packets). At this stage, because the usage and the demand of each resource pool are different, the intervention of central resource pool management is needed to coordinate, and the usage of each resource pool (other resource pools) is queried, so that a preemptive allocation rule is used.
A manager controlling the plurality of other resource pools calculates the allocatable resources of the plurality of other resource pools (i.e., calculates the number of times the package of splittable resources
The calculation formula can be:
In the method, in the process of the invention, Can be the remaining times of a future time point of the resource pool,/>The remaining number of available resource packages for the resource pool may be used.
For the disclosed embodiments, the system may split a number of resource packages in a target allocable resource and allocate it to a first resource pool. The purpose of allocating the resource package is to supplement the shortage of the resource package in the first resource pool, and ensure that the user can obtain the applied resource.
In a specific application scenario, in the global coordination phase, the central resource pool management may receive the first resource poolAnd issue a partitionable pre-allocation computing task to each other resource pool.
The central resource pool management can collect the calculation results of other resource pools and selectTaking the maximum number of times of the splittable resource package (namely the target allocatable resource) as the splitting number of times of the allocation request, and taking other resource pools/>, which correspond to the maximum number of times of the splittable resource packageAs a target resource pool.
Then, the central resource pool management may coordinate the first resource pool Ps and the target resource pool Pt, and perform the available resource subdivision of the splitting number Ct.
And 203, if the plurality of allocable resources are smaller than the preset resource threshold, issuing a resource normalization request to other resource pools and the first resource pool so as to summarize the allocable resources of the first resource pool and the other resource pools in the central resource pool, and deducting the user application resources from the summarized allocable resources.
The resource normalization request can be used for summarizing globally available resources of a global resource pool and ensuring that the resources are uniformly managed and used in a global scope.
In a specific application scenario, when the global total available resources are reduced to a certain extent, each first resource pool frequently sends global coordination requests to the central resource pool manager to request additional resources or reallocate resources. Frequent requests may reduce the availability of the overall system as the system needs to continually process these requests and reallocate resources, and when resources are strained to some extent, the system may enter a global normalization phase. At this stage, the available resources of all resource pools are summarized to the central resource pool manager for global management and usage deduction.
In the global coordination stage, if the allocable resources (namely, the number of times of splitting the resource packet) of the current other resource pools are smaller than a preset resource threshold, entering a global normalization stage. The central resource pool manager issues a resource normalization request to each global resource pool, and the global resource pool needs to report and close the available resource package processing of the resource pool, namely stopping the resource deduction operation in the resource pool.
The API resource request of the global resource pool does not carry out deduction of available resources in the resource pool, but carries out resource deduction directly to the central resource pool until the global resources are exhausted, thereby ensuring unified management and optimized use of the global resources.
In summary, compared with the prior art, the resource allocation method, the device and the electronic equipment provided by the present disclosure receive a resource allocation request initiated by a first resource pool manager; and obtaining the allocable resources in the second resource pool, and performing resource allocation on the first resource pool through the allocable resources so as to deduct the user application resources from the first resource pool. In the scheme of the disclosure, when the usage amount of the resource package of the first resource pool approaches or reaches the upper limit, a resource allocation request is initiated, and after the central resource pool manager receives the resource allocation request, a reallocation strategy is formulated according to the current global allocable resource usage condition, so that even if the usage amount of the resource package of the first resource pool is exhausted, a user can use global residual resources, and the satisfaction degree of the user to the service is improved.
The foregoing embodiment is a resource allocation process described on the side of the central resource pool manager, and further, to fully explain implementation of this embodiment, this embodiment further provides another resource allocation method, which may be applied to the side of the first resource pool manager for execution. As shown in fig. 4, the method includes:
Step 301, receiving a resource application sent by a user, where the resource application is used for applying resources required by the user.
The resource application may 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.
For the embodiment of the disclosure, when a user initiates an API resource request, the system firstly checks the current available resource package state, and if the current available resource package state is in an unavailable state, the system indicates that the residual resources in the resource package are used up, the user can not use the resources any more, and the system refuses the API resource request of the user;
If the current available resource package status is in an unsubscribed status, indicating that the user has not purchased the resource package, i.e., no resources are available, the system also denies the user's API resource request to ensure efficient utilization of resources, avoid resource waste, and ensure that the user can only use resources that they have purchased and authorized.
Step 302, when it is determined that the allocable resources of the first resource pool are insufficient, a resource allocation request is sent to a central resource pool manager, where the central resource pool manager is configured to obtain allocable resources in the second resource pool, and allocate the resources to the first resource pool through the allocable resources, so that a user applies for resources from the first resource pool is deducted.
For the embodiment of the present disclosure, as a possible implementation method, determining that the allocable resources of the first resource pool are insufficient may specifically include:
Predicting the consumption resource of the first resource pool at a preset time point by utilizing the historical time interval point of the first resource pool and the corresponding historical consumption resource;
Counting total consumption resources from the current time point to a preset time point according to the consumption resources; if the total usage resource is greater than the allocable resource of the first resource pool, determining that the allocable resource of the first resource pool is insufficient.
Wherein the historical time interval point may be a certain point in time in the past, typically in the form of a time interval, such as every minute, hour, etc.; the historical usage resource can be the actual usage of the resource recorded at the historical time interval point and is used for reflecting the usage condition of the resource at the specific time point; the preset time point can be a future time point set by the system and can be used for predicting and planning the use of resources; the total usage resource may be a predicted total usage of the resource from a current time point to a preset time point, and may be used to evaluate a total demand of the resource in a future period of time.
For the disclosed embodiments, if the current resource is insufficient to support the predicted demand, i.e., when the total usage resource is greater than the current remaining resource usage of the first resource pool, to ensure that there are sufficient resources to meet the predicted demand before the preset point in time, it is necessary to initiate a resource allocation request to acquire additional resources from other resource pools or a central resource pool.
For the embodiment of the present disclosure, as another possible implementation method, determining that the allocable resources of the first resource pool are insufficient may specifically include:
if the allocable resources of the first resource pool are smaller than the preset resource threshold, determining that the allocable resources of the first resource pool are insufficient.
The preset resource threshold may be a value set according to practical situations and used for measuring the sufficiency of the remaining resources in the resource pool.
For the disclosed embodiments, if the allocable resources (i.e., the current remaining resource usage) of the first resource pool are less than the preset resource threshold, it is indicated that the remaining resources in the resource pool may be insufficient to meet future demands.
To avoid service interruption or denial of service, the system may initiate a resource allocation request, request additional resources or reallocate resources. By initiating the resource allocation request in advance, the system can obtain necessary resources before the resources are actually exhausted, thereby ensuring the continuity and reliability of the service.
For the embodiments of the present disclosure, the trigger mechanisms that trigger the first resource pool to initiate a resource allocation request may be divided into a predictive trigger mechanism and a threshold arrival trigger mechanism.
The prediction triggering mechanism may predict a future time point usage requirement for the first resource pool usage according to the past time period usage data set, and trigger the resource allocation request when the remaining resource packet usage does not satisfy the predicted requirement.
Because the data request quantity of the user is relatively linear and stable in the adjacent time period, the linear model is selected to be built to build the unitary linear regression model.
The model formula may be
In the method, in the process of the invention,Representing the amount of error, the system will have passed the time period of approach/>Data set in/>,...,/>In input model,/>Representing past fixed time interval points and dosage values, calculating regression parameter values a and b to obtain a prediction model p (/ >) of the current time point)。
The system inputs a data set (comprising a time interval point x and a dosage value y) in a certain past time period into a model, calculates regression parameters a and b, and obtains a prediction model p (xt) of the current time point.
The user request dosage p of the future time point ti can be predicted by a prediction model) Thereby obtaining the total amount of available resources (total resource consumption value)/>, which are required from the current time point to tiThe current remaining available resource packages do not meet the predicted resources, i.e. ></>When a reassignment request is triggered. Through a predictive trigger mechanism, hidden danger of insufficient resource packages can be discovered earlier and timely applied. The timing interval t of the predicted time and the test time point ti can be adjusted and configured according to the actual scene.
The threshold arrival triggering mechanism can provide a minimum configuration judgment for a supplement mechanism of the prediction triggering mechanism, and even if the prediction model fails to predict the condition of insufficient resources, the problem can be detected through real-time statistics and actions can be taken, so that the threshold arrival triggering mechanism is a protection mechanism for ensuring the usability of a user, even if the prediction model is wrong or the system meets unexpected peak demands, the user service interruption caused by insufficient resources can be avoided through real-time monitoring and quick response, and the user can be ensured to continuously access the service.
For the disclosed embodiment, as shown in fig. 5:
1. When receiving a user API resource request (resource application), judging a current available resource package state (rid), and refusing the user request if the current available resource package state is an unavailable/unsubscribed state; if the step is global normalization, a deduction request is applied to a central resource pool manager, the deduction is successful, the API processing is responded, and the deduction failure is performed, so that the user request is refused.
2. And counting the quantity of the resource package, and when status (rid) is in a global normalization stage, not calculating the residual quantity of the resource package of the current resource pool. Otherwise, judging whether the allowance reaches the threshold valueWhen the allocation request is satisfied, entering 4 to trigger the allocation request; and does not satisfy, and terminates.
3. And executing the timing prediction task, and when status (rid) is in a global normalization stage, not calculating the resource packet allowance of the current resource pool. Otherwise, whether the prediction margin satisfies the useWhen the allocation request is not satisfied, entering 4 to trigger the allocation request; and (5) meeting and terminating.
4. The central resource pool manager performs resource allocation. If the current available resource package state status (rid) is in the initial allocation stage, and a reserved resource package exists, the current available resource package state status (rid) is allocated to an application resource pool; if there is no reservation, update status (rid) is the global coordination phase, execute 5.
5. Global coordination, if the current available resource package state status (rid) is in the global coordination stage, issuing division tasks to each affiliated resource pool, and summarizing division resultsIf/>Then executing coordination result distribution; if not, update status (rid) to global normalization phase, execute 6.
6. Global normalization, which is to issue normalization processing to all the affiliated resource pools, update the affiliated resource pool status (rid) =global normalization, update the affiliated available resource package to 0, and the central resource pool manager gathers the sum of the available resource packages of all the resource pools. The subsequent user requests are uniformly deducted by the central resource pool manager.
In the whole business flow, the global status (rid) state is perceived by all resource pools, the global data consistency is maintained by the reassignment and normalization of resources, and a TCC final consistency scheme is selected, so that the scheme is not expanded.
In summary, compared with the prior art, the resource allocation method, the device and the electronic equipment provided by the present disclosure receive a resource allocation request initiated by a first resource pool manager; and obtaining the allocable resources in the second resource pool, and performing resource allocation on the first resource pool through the allocable resources so as to deduct the user application resources from the first resource pool. In the scheme of the disclosure, when the usage amount of the resource package of the first resource pool approaches or reaches the upper limit, a resource allocation request is initiated, and after the central resource pool manager receives the resource allocation request, a reallocation strategy is formulated according to the current global allocable resource usage condition, so that even if the usage amount of the resource package of the first resource pool is exhausted, a user can use global residual resources, and the satisfaction degree of the user to the service is improved.
Based on the specific implementation of the methods shown in fig. 1 and fig. 3, the disclosure provides a resource allocation apparatus, as shown in fig. 6, including: a first receiving module 31, an allocating module 32;
a first receiving module 31, configured to receive a resource allocation request initiated by a first resource pool manager;
and the allocation module 31 is configured to obtain an allocable resource in the second resource pool, and allocate the resource to the first resource pool through the allocable resource, so that a user application resource is deducted from the first resource pool.
In a specific application scenario, the second resource pool includes a central resource pool, and the allocation module 31 is configured to determine whether a reserved resource packet exists in the central resource pool; and if the reserved resource packet exists in the central resource pool, carrying out resource allocation on the first resource pool through the reserved resource packet, so that the user application resource is deducted from the first resource pool.
In a specific application scenario, the second resource pool comprises other resource pools, wherein the other resource pools are resource pools except the central resource pool and the first resource pool in a global resource pool; an allocation module 31, configured to, if the reserved resource packet does not exist in the central resource pool, control a manager of a plurality of other resource pools, and calculate allocable resources of the plurality of other resource pools;
And carrying out resource allocation on the first resource pool through target allocable resources in the allocable resources, so that the user application resources are deducted from the first resource pool, wherein the target allocable resources are the most resources in the allocable resources.
In a specific application scenario, the apparatus further includes: a delivery module 33;
And the issuing module 33 is configured to issue a resource normalization request to the other resource pools and the first resource pool if the plurality of allocable resources are smaller than a preset resource threshold, so as to summarize the allocable resources of the first resource pool and the other resource pools in the central resource pool, and deduct the user application resources from the summarized allocable resources.
It should be noted that, for other corresponding descriptions of each functional unit related to the resource allocation device provided in the present disclosure, reference may be made to corresponding descriptions in fig. 1 and fig. 3, which are not repeated herein.
Further, as a specific implementation of the method shown in fig. 6, this embodiment provides a resource allocation apparatus applicable to the first resource pool manager side, as shown in fig. 7, where the apparatus includes: a second receiving module 41, a transmitting module 42;
A second receiving module 41, configured to receive a resource application sent by a user, where the resource application is used to apply for a resource required by the user;
And the sending module 42 is configured to send a resource allocation request to a central resource pool manager when it is determined that the allocable resources in the first resource pool are insufficient, where the central resource pool manager is configured to obtain allocable resources in the second resource pool, and allocate the resources to the first resource pool through the allocable resources, so that a user application resource is deducted from the first resource pool.
In a specific application scenario, the sending module 42 may be configured to predict a usage resource of the first resource pool at a preset time point by using a historical time interval point of the first resource pool and a corresponding historical usage resource; counting total consumption resources from the current time point to the preset time point according to the consumption resources; and if the total consumption resource is larger than the allocable resource of the first resource pool, determining that the allocable resource of the first resource pool is insufficient.
In a specific application scenario, the sending module 42 may be configured to determine that the allocable resources of the first resource pool are insufficient if the allocable resources of the first resource pool are smaller than a preset resource threshold.
It should be noted that, for other corresponding descriptions of each functional unit related to the resource allocation apparatus provided in the present disclosure, reference may be made to the corresponding description in fig. 4, which is not repeated herein.
Based on the above-described methods shown in fig. 1, 3 and 4, accordingly, the present disclosure also provides a computer-readable storage medium having a computer program stored thereon, which when executed by a processor, implements the above-described methods shown in fig. 1, 3 and 4.
Based on such understanding, the technical solution of the present disclosure may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (may be a CD-ROM, a U-disk, a mobile hard disk, etc.), and includes several instructions for causing a computer device (may be a personal computer, a server, or a network device, etc.) to execute the method of each implementation scenario of the present disclosure.
Optionally, the physical device may further include a user interface, a network interface, a camera, radio frequency (RadioFrequency, RF) circuitry, sensors, audio circuitry, WI-FI modules, and so on. The user interface may include a Display screen (Display), an input unit such as a Keyboard (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 (e.g., WI-FI interface), etc.
It will be appreciated by those skilled in the art that the above-described physical device structure provided by the present disclosure is not limiting of the physical device, and may include more or fewer components, or may combine certain components, or a different arrangement of components.
The storage medium may also include an operating system, a network communication module. The operating system is a program that manages the physical device hardware and software resources described above, supporting the execution of information handling programs and other software and/or programs. The network communication module is used for realizing communication among all components in the storage medium and communication with other hardware and software in the information processing entity equipment.
From the above description of embodiments, it will be apparent to those skilled in the art that the present disclosure may be implemented by means of software plus necessary general hardware platforms, or may be implemented by hardware. According to the resource allocation method, the device and the electronic equipment provided by the disclosure, compared with the prior art, the method and the device for allocating the resources receive the resource allocation request initiated by the first resource pool manager; and obtaining the allocable resources in the second resource pool, and performing resource allocation on the first resource pool through the allocable resources, so that the user application resources are deducted from the first resource pool. In the scheme of the disclosure, when the usage amount of the resource package of the first resource pool approaches or reaches the upper limit, a resource allocation request is initiated, and after the central resource pool manager receives the resource allocation request, a reallocation strategy is formulated according to the current global allocable resource usage condition, so that even if the usage amount of the resource package of the first resource pool is exhausted, a user can use global residual resources, and the satisfaction degree of the user to the service is improved.
It should be noted that in this document, relational terms such as "first" and "second" and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises an element.
The above is merely a specific embodiment of the disclosure to enable one skilled in the art to understand or practice the disclosure. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the disclosure. Thus, the present disclosure is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (10)

1. A resource allocation method, applied to a central resource pool manager side for execution, the method comprising:
receiving a resource allocation request initiated by a first resource pool manager;
And obtaining the allocable resources in the second resource pool, and performing resource allocation on the first resource pool through the allocable resources, so that the user application resources are deducted from the first resource pool.
2. The method of claim 1, wherein the second resource pool comprises a central resource pool;
the obtaining the allocable resources in the second resource pool, and allocating the resources to the first resource pool through the allocable resources, so that the user application resources are deducted from the first resource pool, including:
judging whether a reserved resource packet exists in the central resource pool;
And if the reserved resource packet exists in the central resource pool, carrying out resource allocation on the first resource pool through the reserved resource packet, so that the user application resource is deducted from the first resource pool.
3. The method of claim 2, wherein the second resource pool comprises other resource pools that are ones of a global resource pool other than the central resource pool and the first resource pool;
the obtaining the allocable resources in the second resource pool, and allocating the resources to the first resource pool through the allocable resources, so that the user application resources are deducted from the first resource pool, and the method further comprises:
If the reserved resource packet does not exist in the central resource pool, controlling a manager of a plurality of other resource pools, and calculating the allocable resources of the other resource pools;
And carrying out resource allocation on the first resource pool through target allocable resources in the allocable resources, so that the user application resources are deducted from the first resource pool, wherein the target allocable resources are the most resources in the allocable resources.
4. A method according to claim 3, characterized in that the method further comprises:
and if the plurality of the allocable resources are smaller than a preset resource threshold, issuing a resource normalization request to the other resource pools and the first resource pool so as to summarize the allocable resources of the first resource pool and the other resource pools in the central resource pool, so that the user application resources are deducted from the summarized allocable resources.
5. A method for resource allocation, applied to a first resource pool manager side, the method comprising:
receiving a resource application sent by a user, wherein the resource application is used for applying resources required by the user;
When the fact that the allocable resources of the first resource pool are insufficient is determined, a resource allocation request is sent to a central resource pool manager, and the central resource pool manager is used for acquiring allocable resources in the second resource pool and performing resource allocation on the first resource pool through the allocable resources, so that user application resources are deducted from the first resource pool.
6. The method of claim 5, wherein the determining that the allocable resources of the first resource pool are insufficient comprises:
Predicting the consumption resource of the first resource pool at a preset time point by utilizing the historical time interval point and the corresponding historical consumption resource of the first resource pool;
Counting total consumption resources from the current time point to the preset time point according to the consumption resources;
And if the total consumption resource is larger than the allocable resource of the first resource pool, determining that the allocable resource of the first resource pool is insufficient.
7. The method of claim 5, wherein the determining that the allocable resources of the first resource pool are insufficient comprises:
and if the allocable resources of the first resource pool are smaller than a preset resource threshold, determining that the allocable resources of the first resource pool are insufficient.
8. A resource allocation apparatus for use on a central resource pool manager side, the apparatus comprising:
the first receiving module is used for receiving a resource allocation request initiated by the first resource pool manager;
And the allocation module is used for acquiring the allocable resources in the second resource pool, and allocating the resources to the first resource pool through the allocable resources so as to deduct the user application resources from the first resource pool.
9. A resource allocation apparatus, for use on a first resource pool manager side, the apparatus comprising:
the second receiving module is used for receiving a resource application sent by a user, wherein the resource application is used for applying resources required by the user;
The sending module is used for sending a resource allocation request to the central resource pool manager when the fact that the allocable resources of the first resource pool are insufficient is determined, wherein the central resource pool manager is used for acquiring allocable resources in the second resource pool and carrying out resource allocation on the first resource pool through the allocable resources so as to deduct user application resources from the first resource pool.
10. A computer program product comprising a computer program which, when executed by a processor, implements the method according to any one of claims 1-4, or the method according to any one of claims 5-7.
CN202410580305.8A 2024-05-11 2024-05-11 Resource allocation method and device and electronic equipment Active CN118170549B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410580305.8A CN118170549B (en) 2024-05-11 2024-05-11 Resource allocation method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410580305.8A CN118170549B (en) 2024-05-11 2024-05-11 Resource allocation method and device and electronic equipment

Publications (2)

Publication Number Publication Date
CN118170549A true CN118170549A (en) 2024-06-11
CN118170549B CN118170549B (en) 2024-09-03

Family

ID=91348856

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410580305.8A Active CN118170549B (en) 2024-05-11 2024-05-11 Resource allocation method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN118170549B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102279771A (en) * 2011-09-02 2011-12-14 北京航空航天大学 Method and system for adaptively allocating resources as required in virtualization environment
US20140289412A1 (en) * 2013-03-21 2014-09-25 Infosys Limited Systems and methods for allocating one or more resources in a composite cloud environment
CN106681835A (en) * 2016-12-28 2017-05-17 华为技术有限公司 Resource allocation method and resource manager
CN109710410A (en) * 2018-12-24 2019-05-03 微梦创科网络科技(中国)有限公司 A kind of internet information resource distribution method and device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102279771A (en) * 2011-09-02 2011-12-14 北京航空航天大学 Method and system for adaptively allocating resources as required in virtualization environment
US20140289412A1 (en) * 2013-03-21 2014-09-25 Infosys Limited Systems and methods for allocating one or more resources in a composite cloud environment
CN106681835A (en) * 2016-12-28 2017-05-17 华为技术有限公司 Resource allocation method and resource manager
CN109710410A (en) * 2018-12-24 2019-05-03 微梦创科网络科技(中国)有限公司 A kind of internet information resource distribution method and device

Also Published As

Publication number Publication date
CN118170549B (en) 2024-09-03

Similar Documents

Publication Publication Date Title
US9442763B2 (en) Resource allocation method and resource management platform
US9588789B2 (en) Management apparatus and workload distribution management method
US8346909B2 (en) Method for supporting transaction and parallel application workloads across multiple domains based on service level agreements
JP5939740B2 (en) Method, system and program for dynamically allocating resources
US20140165061A1 (en) Statistical packing of resource requirements in data centers
WO2012032679A1 (en) Computer system and control method for computer system
US11496413B2 (en) Allocating cloud computing resources in a cloud computing environment based on user predictability
US20080263553A1 (en) Dynamic Service Level Manager for Image Pools
WO2011142031A1 (en) Resource management method, resource management device and program
JP2013513174A (en) Method and system for managing virtual machine storage space and physical hosts
CN112269641A (en) Scheduling method, scheduling device, electronic equipment and storage medium
WO2021135263A1 (en) Cpu resource reservation method and apparatus, and related device
CN114072767B (en) Resource scheduling, application and pricing method, equipment, system and storage medium
CN110865881A (en) Resource scheduling method and device
WO2016041446A1 (en) Resource allocation method, apparatus and device
CN113302591A (en) Method and system for managing computing resources of cloud computing platform
CN109614223A (en) Hardware resource dispatching method, device and hardware resource controlling equipment
JP2017138895A (en) Virtualization environment management system and virtualization environment management method
CN114546587A (en) Capacity expansion and reduction method of online image recognition service and related device
CN110750330A (en) Virtual machine creating method, system, electronic equipment and storage medium
CN118170549B (en) Resource allocation method and device and electronic equipment
CN113010309A (en) Cluster resource scheduling method, device, storage medium, equipment and program product
CN106126319B (en) Central processing unit resource allocation methods and calculate node
CN110096352B (en) Process management method, device and computer readable storage medium
CN115794305B (en) Method and device for adjusting memory of virtual machine, storage medium and electronic device

Legal Events

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