Resource allocation method, device and medium
By building a resource allocation tree and optimizing resource allocation, the problem of resource waste in traditional scheduling algorithms is solved, and resource utilization is improved, especially in scenarios of resource tight or unbalanced resources.
Patent Information
- Application Number
- CN202111441879.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-30
- Publication Date
- 2024-11-15
- Estimated Expiration
- 2041-11-30
AI Technical Summary
In a multi-node resource pool, traditional scheduling algorithms find it difficult to effectively utilize platform resources, resulting in some jobs occupying specific resources and other jobs being unable to deploy, resulting in waste of resources.
By obtaining resource status information of the resource pool and the resource requirements of the job, building a resource allocation tree, determining a reasonable resource allocation plan, optimizing resource allocation, and ensuring the rational utilization of resources.
It significantly improves the utilization rate of resources and reduces the situation where the inability to undertake operations due to exhaustion of resources, especially in scenarios of tight resources or unbalanced resources.
Smart Images

Figure CN114138484B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure generally relates to a method, apparatus, and medium for allocating resources in a resource pool. Background Art
[0002] In scenarios such as IoT business scenarios or cloud computing business scenarios that include a resource pool composed of multiple computing nodes, when a business such as IoT business or computing business (hereinafter, also referred to as a job) arrives, it is executed on one or more physical nodes (i.e., computing nodes, servers) in the cluster through platform scheduling. Each job has different requirements for platform resources. The most important indicators of platform resource requirements include, for example, the number of CPU cores and memory size. In heterogeneous resource IoT business, indicators also include, for example, GPU, storage, bandwidth, etc. After each IoT business is allocated the required resources and starts execution, it cannot be interrupted or migrated. If an interruption occurs, it needs to be re-executed. The main function of the job scheduling system is to allocate reasonable platform resources to the job in the computing platform according to the job's demand for platform resources, and start the job. When the computing platform is busy and cannot meet the platform resource requirements, the scheduling system will place the job in the waiting queue and wait for the computing platform to be idle.
[0003] The traditional scheduling algorithm compares the resource requirements of the IoT business with the remaining resources in the computing nodes. When the remaining resources meet the IoT business requirements, the scheduler deploys the job on the corresponding node. When there are multiple nodes that meet the requirements, they are deployed in the node with the most remaining resources. When the resources are not met, a queue is built to let the job queue up and wait for resources. The waiting methods include first-in-first-out, weight priority, or fill-in construction. However, the traditional method faces a problem, that is, the platform resources cannot be well utilized, because the traditional method will have the following situation when scheduling jobs: some jobs occupy too much of a certain resource, resulting in the new job cannot be deployed due to the lack of the resource, but other resources are idle, resulting in resource waste. Some scheduling methods propose to use a scheduling method that divides job boxes and different queues according to the size and category of resource consumption, but it cannot solve the problem of how many different job boxes should be deployed, and it still causes resource waste. Summary of the invention
[0004] A brief overview of the disclosure is given below in order to provide a basic understanding of some aspects of the disclosure. However, it should be understood that this overview is not an exhaustive overview of the disclosure. It is not intended to identify the key or important parts of the disclosure, nor is it intended to limit the scope of the disclosure. Its purpose is simply to give some concepts of the disclosure in a simplified form as a prelude to a more detailed description given later.
[0005] According to one aspect of the present disclosure, a method for allocating resources in a resource pool is provided, comprising: when allocating resources for a computing job request, obtaining resource status information of the resource pool and resource requirements corresponding to the computing job request, wherein the resource status information includes resource information of each resource node in the resource pool; constructing a resource allocation tree according to the resource status information, and determining a resource allocation scheme corresponding to the computing job request based on the resource requirements and the resource allocation tree, wherein the root node of the resource allocation tree represents the resource status information and the computing job request, and the leaf node represents the resource status information of the remaining resources of each resource node after the corresponding resource node is allocated the computing job request; and allocating resources to the computing job request according to the resource allocation scheme.
[0006] According to another aspect of the present disclosure, a resource allocation device is provided, comprising: a memory on which instructions are stored; and a processor configured to execute the instructions stored in the memory to perform the method as described above.
[0007] According to another aspect of the present disclosure, a computer-readable storage medium is provided, which includes computer-executable instructions. When the computer-executable instructions are executed by one or more processors, the one or more processors execute the method according to the above aspects of the present disclosure.
[0008] According to another aspect of the present disclosure, a resource allocation device is provided, comprising: a resource information acquisition module, used to acquire resource status information of a resource pool and resource requirements corresponding to the computing job request when allocating resources to a computing job request, wherein the resource status information includes resource information of each resource node in the resource pool; an allocation scheme formulation module, used to construct a resource allocation tree according to the resource status information, and determine a resource allocation scheme corresponding to the computing job request based on the resource requirements and the resource allocation tree, wherein the root node of the resource allocation tree represents the resource status information and the computing job request, and the leaf node represents the resource status information of the remaining resources of each resource node after the corresponding resource node is allocated the computing job request; and a resource allocation module, used to allocate resources to the computing job request according to the resource allocation scheme. BRIEF DESCRIPTION OF THE DRAWINGS
[0009] The accompanying drawings, which constitute a part of the specification, illustrate embodiments of the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0010] The present disclosure may be more clearly understood from the following detailed description with reference to the accompanying drawings, in which:
[0011] Figure 1is a flowchart of a resource allocation method according to an embodiment of the present disclosure;
[0012] Figure 2A , 2B 2C and 2D are schematic diagrams of resource allocation according to a resource allocation method according to an embodiment of the present disclosure;
[0013] Figure 3A , 3B and 3C is a schematic diagram of resource allocation of a resource allocation method according to another embodiment of the present disclosure;
[0014] Figure 4 is a module schematic diagram of a resource allocation device according to an embodiment of the present disclosure;
[0015] Figure 5 is a module schematic diagram of a resource allocation device according to another embodiment of the present disclosure;
[0016] Figure 6 is a module schematic diagram of a service scheduling device according to an embodiment of the present disclosure;
[0017] Figure 7 An exemplary configuration of a computing device that can implement an embodiment according to the present disclosure is shown. DETAILED DESCRIPTION
[0018] The following detailed description is made with reference to the accompanying drawings, and the following detailed description is provided to assist in a comprehensive understanding of the various exemplary embodiments of the present disclosure. The following description includes various details to assist in understanding, but these details are considered to be examples only and not to limit the present disclosure, which is defined by the appended claims and their equivalents. The words and phrases used in the following description are only used to enable a clear and consistent understanding of the present disclosure. In addition, for the sake of clarity and brevity, descriptions of well-known structures, functions, and configurations may be omitted. Those of ordinary skill in the art will recognize that various changes and modifications may be made to the examples described herein without departing from the spirit and scope of the present disclosure.
[0019] The present disclosure proposes a resource allocation method in a resource pool, which can automatically determine a resource allocation scheme according to the resource pool state and resource demand, and can improve resource utilization. The resource pool in the present disclosure refers to a resource pool (or a cluster of nodes or a computing cluster) composed of multiple computing nodes (sometimes referred to as physical nodes, servers).
[0020] Figure 1 FIG. 1 is a flow chart of an embodiment of a method for allocating resources in a resource pool according to the present disclosure, as shown in FIG. Figure 1 As shown, the method includes:
[0021] When allocating resources for a computing job request, obtaining resource status information of a resource pool and resource requirements corresponding to the computing job request, wherein the resource status information includes resource information of each resource node in the resource pool (101);
[0022] constructing a resource allocation tree according to the resource status information, and determining a resource allocation scheme corresponding to the computing job request based on the resource demand and the resource allocation tree, wherein a root node of the resource allocation tree represents the resource status information and the computing job request, and a leaf node represents resource status information of remaining resources of each resource node after the corresponding resource node is allocated the computing job request (102); and
[0023] According to the resource allocation plan, resources are allocated to the computing job request (103).
[0024] In one embodiment, the resource information of the resource node includes the total amount and used amount of CPU, memory, storage, etc.; the demand information carried in the computing job request includes the demand information for CPU, memory and storage, etc.
[0025] In one embodiment, multiple computing job requests are placed in a queue in the order of arrival, and a computing job request is read from the queue one by one to allocate resources to the computing job request. For example, computing jobs (represented as computing resource requests in the scheduling job) are placed in a queue in the order of arrival, and a computing job request is read from the queue one by one to determine a resource allocation plan, and corresponding resources in the resource pool are provided to the computing job according to the resource allocation plan, and the resources are released after the computing job is completed.
[0026] In one embodiment, constructing a resource allocation tree according to the resource status information, and determining a resource allocation scheme corresponding to the computing job request based on the resource demand and the resource allocation tree includes: initializing the resource allocation tree.
[0027] In one embodiment, initializing the resource allocation tree includes: establishing a corresponding leaf node for each resource node, and setting the corresponding resource node allocation times and stable score value for the leaf node; selecting a first leaf node that can meet the resource requirements of the randomly generated simulated computing job or the resource requirements requested by the computing job; simulating and allocating the resource requirements of the simulated computing job or the resource requirements requested by the computing job to the first leaf node; and updating the allocation times and stable score value of each first leaf node.
[0028] In one embodiment, the resource allocation method may further include:
[0029] Randomly generate new simulation computing jobs;
[0030] Use a new simulation job and execute the following steps again:
[0031] Establish a corresponding leaf node for each resource node, and set the allocation times and stable score value of the corresponding resource node for the leaf node;
[0032] Selecting a first leaf node that can meet the resource requirements of the randomly generated simulation computing job or the resource requirements requested by the computing job;
[0033] Allocating the resource requirements of the simulated computing job or the resource requirements requested by the computing job to the first leaf node; and
[0034] Update the number of allocations and the stable score value of each first leaf node;
[0035] Repeat the above steps of random generation and re-execution until no leaf node can meet the resource requirements of the new simulation computing job.
[0036] In one embodiment, the step of randomly generating a new simulation computing job may include randomly generating a new simulation computing job according to a probability distribution of real business.
[0037] When real computing jobs are insufficient, the allocation tree can be trained by randomly generating new simulated computing jobs to improve the robustness of the allocation scheme.
[0038] In one embodiment, the resource allocation method may further include: after allocating resources to the computing job request according to the resource allocation scheme,
[0039] Randomly generate new simulation computing jobs;
[0040] Use a new simulation job and execute the following steps again:
[0041] Establish a corresponding leaf node for each resource node, and set the allocation times and stable score value of the corresponding resource node for the leaf node;
[0042] Selecting a first leaf node that can meet the resource requirements of the randomly generated simulation computing job or the resource requirements requested by the computing job;
[0043] Allocating the resource requirement of the simulated computing job or the resource requirement simulation to the first leaf node; and
[0044] Update the number of allocations and the stable score value of each first leaf node;
[0045] Repeat the above steps of random generation and re-execution until no leaf node can meet the resource requirements of the new simulation computing job.
[0046] In one embodiment, the first leaf node is selected based on the similarity between the resource requirement of the simulated computing job or the resource requirement of the computing job request and the remaining resource status of each computing node.
[0047] In one embodiment, according to the resource allocation scheme, the step of allocating resources to the computing job request includes: selecting the first leaf node with the highest stability score value as the first target leaf node, and using the first target leaf node to allocate resources to the computing job request.
[0048] In one embodiment, the resource allocation method may further include: placing multiple computing job requests into a queue in the order of arrival; reading a computing job request from the queue in the order of arrival, and allocating resources to the computing job request.
[0049] In one embodiment, the resource information of the resource node includes resource information of two or more resources; and the demand information carried in the computing job request includes demand information for two or more resources.
[0050] In one embodiment, when no leaf node can meet the resource requirements of a new simulation computing job, the allocation times and stable score value of each first leaf node are updated based on the total resources and remaining resources of each resource, the current allocation times and stable score value of each first leaf node.
[0051] In one embodiment, the resource allocation tree of the present invention is a tree structure that defines a solution space of feasible solutions. Each path from a leaf node to a root node corresponds to a final resource allocation plan, and the final resource allocation plan is represented by the remaining resource space being unable to satisfy newly arrived computing jobs.
[0052] The root node represents the current resource state information state (i.e., state) and computing jobs. The resource state information includes the resource information of the resource nodes in the resource pool, such as the total amount and used amount of CPU, memory, and storage. Optionally, the resource state information may also include the resource node distribution. The leaf node represents the resource state state_end of the final resource allocation method (the total amount of remaining computing resources, because a certain computing resource cannot bear the newly arrived computing business).
[0053] If the resource allocation tree is not constructed, there are four main steps to construct the resource allocation tree and determine the resource allocation scheme (initialization state): 1.1, build the tree; 1.2, select (initialization state); 1.3, simulate; 1.4, return. The above steps 1.2 to 1.4 are repeated k times to complete the initialization state. If the resource allocation tree has been constructed, there are three steps to determine the resource allocation scheme (allocation phase): 2.1, select (allocation state); 2.2, execute; 2.3, return.
[0054] 1.1. Building a tree: based on each root node s new , create child nodes representing all resource nodes* for leaf nodes, initialize and record two values: Stable score value: V(s new ,*)=0, the allocation scheme is selected times N(s new ,*)=0.
[0055] 1.2. Selection: Starting from the root node, first filter out the resource nodes (first leaf nodes) that can meet the resource requirements of jobs such as computing jobs or IoT jobs, and then search for leaf nodes according to different strategies based on whether the resource allocation tree is in the initialization state or the allocation state.
[0056] The selection formula for leaf nodes is:
[0057]
[0058] When the stable score value and the number of times selected of all leaf nodes are 0, the following formula is used:
[0059] a=max(P(s,a))a∈(resource nodes that meet the computing job requirements) (1-2);
[0060] Wherein, a represents the leaf node a selected to represent the resource node a;
[0061] V(s,a) represents the stable score value of the node selected in the state of the allocation tree;
[0062] P(s,a) is represented as the score of this allocation tree, which is represented by the similarity (e.g., cosine similarity or any other appropriate similarity) between the resource demand and the existing resource status in each computing node (or node, physical node, server);
[0063] N(s,a) represents the total number of times that resources in node a are allocated to this job (i.e., computing job, IoT job, or other job that needs to be processed by the node) in state s (resource state);
[0064] It is represented as the total number of possible solutions other than allocating resources in node a to this computing job in state s;
[0065] c represents the strategy. When in the initialization state, c is the search coefficient; when in the allocation state, c = 0. When there is no root node (s, a), random allocation is sufficient. (s, a) represents the current and behavior state. If there is no root node, it is the state when the first selection is made.
[0066] In one embodiment, the larger the c is, the more attention is paid to other possibilities, and the greater the result changes. The smaller the c is, the more stable it is, and it is easy to fall into the local optimal solution. The specific value of C can be set according to actual business needs or adjusted according to specific resource environment conditions, business conditions, and simulation conditions. c is 1, which means that exploration and stability are equally important.
[0067] 1.3. Simulation / Execution: Simulation: Use a random method to allocate computing resources (or platform resources) to any resource node that can meet the requirements, and simulate several experiments. When the simulation reaches the final state, the score V obtained by the current simulation can be obtained.
[0068] Execution: Allocate resources according to the resource allocation tree until the final state, and then you can get the score of the current execution. Optionally, you can continue to use the simulation method after executing this business scheduling to further optimize the resource allocation tree.
[0069] The formula for calculating the score is:
[0070]
[0071] Among them, X j总 Represents the total amount of the jth resource of all nodes in the resource pool;
[0072] X j剩余 It indicates the total amount of the jth resource remaining when all nodes in the resource pool cannot load new computing jobs.
[0073] This formula (1-3) allows a solution that can use various resources in a more balanced manner to have a higher score.
[0074] 1.4. Feedback: Update the simulation times (i.e., the number of times selected) and the score of the current child node according to the scores of several simulations of the child node. At the same time, feed the simulation times and the score back to all its ancestor nodes and update the ancestor nodes. For example,
[0075] V(s,a)=(V+V(s,a)×N(s,a)) / (N(s,a)+1) (1-4);
[0076] N(s,a)=N(s,a)+1 (1-5).
[0077] In one embodiment, the present disclosure provides a resource allocation method, comprising:
[0078] 3.1. Initialize the resource allocation tree;
[0079] 3.2. The resource allocation tree enters the allocation state;
[0080] 3.3. Read new computing job requests (resource requests) from the queue;
[0081] 3.4. Update resource information state;
[0082] 3.5. Search the resource allocation tree to obtain the resource allocation plan based on the state and computing job;
[0083] 3.6. Allocate resources in the resource pool to meet resource requests based on the resource allocation plan;
[0084] 3.7. Clear the computing job request in the queue;
[0085] 3.8. Repeat 3.1-3.7 to complete resource allocation for computing job requests.
[0086] In one embodiment, assuming that the resource pool is composed of three resource nodes, each tree node of the resource allocation tree has three leaf nodes, and the resource information of the resource node includes three resource attributes: vcpu, memory, and storage, that is, i=3, the weight coefficients of the three attributes are all 1, and the search coefficient c is set to 1.
[0087] The current state is: Node A has 100 vcpus, 100G memory, and 10T storage remaining; Node B has 10 vcpus, 1000G memory, and 10T storage remaining; Node C has 50 vcpus, 100G memory, and 100T storage remaining. The computing resource requirements of the current incoming computing job are: 30 vcpus, 10G memory, and 1T storage. The second-level leaf nodes from left to right represent the resource requirements for selecting resource nodes A / B / C to undertake computing jobs. The numbers in the nodes are represented by V(s,a) / N(s,a).
[0088] The resource allocation method (initialization state) when the resource allocation tree is not constructed is:
[0089] 4.1. Build tree:
[0090] Based on each root node s new , create child nodes representing all resource nodes* for leaf nodes, initialize and record two values: Stable score value: V(s new ,*)=0; the number of times the allocation scheme is selected: N(s new,*)=0, such as Figure 2A shown.
[0091] 4.2. Selection: Assume that after multiple rounds of iterations, the stable score value and the number of times the allocation scheme is selected are as follows: Figure 2B As shown in FIG. 1 , P(s,1)=0.7, P(s,3)=0.65, which is represented by the similarity (eg, cosine similarity) between the resource demand and the existing resource status of each server.
[0092] According to formula (1-1):
[0093]
[0094] The score of node A is 0.65+1*0.7*0.08=0.71. Node B will not be selected because it cannot meet the computing job resource requirements. The score of node C is 0.3+1*0.65*0.78=0.81. Therefore, node C is selected to undertake this computing job in this round.
[0095] 4.3. Simulation: After selecting the C node, a computing job is randomly generated, and then the selection algorithm is continued to be executed to select a node to undertake the computing job. This step is repeated until there is no node that can undertake the newly randomly generated computing job.
[0096] like Figure 2C As shown, assuming that at this time node A has 1 vcpu, 1G memory and 0.5T storage left; node B has 2 vcpu, 0.5G memory and 0.1T storage left; node C has 1 vcpu, 0G memory and 0.02T storage left; the final score V = 0.98.
[0097] 4.4. Backtracking: After the simulation is finished, all selected nodes update their stable scores and the number of times they have been selected. Figure 2D As shown, taking node C as an example, the stability score value is updated to (0.98+0.3*6) / 7=0.40, and the number of selections is updated to 7.
[0098] The resource allocation method (allocation status) when the resource allocation tree has been constructed is:
[0099] 5.1. Selection: Same as the initialization state assumption, such as Figure 3A As shown in the figure, according to the formula a=max(V(s,a)), the score of node A is 0.65; node B cannot meet the computing job resource requirements and will not be selected; node C scores 0.3. Therefore, node A (the target leaf node) is selected to undertake this computing job in this round.
[0100] 5.2. Execution: After selecting node A, allocate resources (notify the master control module to allocate resources), such as Figure 3B shown.
[0101] 5.3. Backtracking (i.e., backhaul): When no node can take over new computing jobs, assume that node A has 1 vcpu, 1G memory, and 0.5T storage left; node B has 2 vcpu, 0.5G memory, and 0.1T storage left; node C has 1 vcpu, 0G memory, and 0.02T storage left; the final score V = 0.98. All selected nodes update their stable score values and the number of times they have been selected. For example, node A: the stable score value is updated to (0.98+0.65*30) / 31=0.66, and the number of times it has been selected is updated to 31. Figure 3C shown.
[0102] In one embodiment, Figure 4 As shown, the present disclosure provides a resource allocation device 40, including: a resource information acquisition module 41, an allocation plan formulation module 42 and a resource allocation module 43.
[0103] When allocating resources for a computing job request, the resource information acquisition module 41 acquires resource status information of the resource pool and resource requirements corresponding to the computing job request, wherein the resource status information includes resource information of each resource node in the resource pool.
[0104] The allocation plan formulation module 42 constructs a resource allocation tree according to the resource status information, and determines the resource allocation plan corresponding to the computing job request based on the resource demand and the resource allocation tree, wherein the root node of the resource allocation tree represents the resource status information and the computing job request, and the leaf node represents the resource status information of the remaining resources of each resource node after the corresponding resource node is allocated the computing job request.
[0105] The resource allocation module 43 allocates resources to the computing job request according to the resource allocation scheme.
[0106] In one embodiment, if the resource allocation tree is not constructed, the allocation scheme formulation module 42 constructs and initializes the resource allocation tree based on the resource status information, and determines the resource allocation scheme based on the resource demand and the resource allocation tree. If the resource allocation tree is already constructed, the allocation scheme formulation module 42 determines the resource allocation scheme based on the resource demand and the constructed resource allocation tree.
[0107] In one embodiment, Figure 5 As shown, the resource allocation device 40 also includes a queue processing module 44. The queue processing module 44 puts multiple computing job requests into a queue according to the order of arrival, and reads one computing job request from the queue in turn to allocate resources to the computing job request.
[0108] The resource allocation method, device and storage medium provided in the above-mentioned embodiments construct a resource allocation tree according to resource status information, and determine the resource allocation plan corresponding to the computing job request based on resource requirements and the resource allocation tree. This can reasonably allocate computing resource nodes, reduce the waste of remaining computing resources due to the inability to undertake computing jobs due to the exhaustion of certain computing resources, and significantly improve resource utilization, especially in scenarios where computing resources are tight or there are certain computing resource imbalances, and have obvious advantages over traditional methods.
[0109] In one embodiment, Figure 6 As shown, a service scheduling device is provided, comprising:
[0110] 1. Queue module (computing task receiving module): puts the business (represented as platform resource request in scheduling job) into the queue module according to the arrival order.
[0111] 2. Status update module: responsible for updating the current IoT resource information state, which may include the IoT resource pool node distribution, the resource status of each IoT resource pool, including but not limited to the total amount and used amount of CPU, memory, and storage.
[0112] 3. Allocation tree module: responsible for building the resource allocation tree and providing resource allocation solutions based on the state and IoT business resource requests.
[0113] 4. Master control module: Allocate corresponding resources in the resource pool to IoT services according to the resource allocation plan, and release the resources after the services are completed.
[0114] The present disclosure proposes an Internet of Things service scheduling method and system, which can automatically determine the deployment mode according to the resource pool status and resource demand, and improve resource utilization.
[0115] In the present disclosure, the search tree simulates and optimizes an algorithm for finding the optimal way to allocate resources. Through the recommendation of this method, the optimal resource allocation solution can be obtained.
[0116] Figure 7 An exemplary configuration of a computing device 1200 capable of implementing embodiments according to the present disclosure is shown.
[0117] The computing device 1200 is an example of a hardware device to which the above aspects of the present disclosure can be applied. The computing device 1200 can be any machine configured to perform processing and / or computing. The computing device 1200 can be, but is not limited to, a workstation, a server, a desktop computer, a laptop computer, a tablet computer, a personal data assistant (PDA), a smart phone, a vehicle-mounted computer, or a combination thereof.
[0118] like Figure 7 As shown, the computing device 1200 may include one or more elements that can be connected or communicated with the bus 1202 via one or more interfaces. The bus 1202 may include, but is not limited to, an Industry Standard Architecture (ISA) bus, a Micro Channel Architecture (MCA) bus, an Enhanced ISA (EISA) bus, a Video Electronics Standards Association (VESA) local bus, and a Peripheral Component Interconnect (PCI) bus, etc. The computing device 1200 may include, for example, one or more processors 1204, one or more input devices 1206, and one or more output devices 1208. The one or more processors 1204 may be any kind of processor, and may include, but is not limited to, one or more general-purpose processors or special-purpose processors (such as special-purpose processing chips). The processor 1204 may be configured to implement the resource allocation method in the above-mentioned resource pool, for example. The input device 1206 may be any type of input device capable of inputting information to the computing device, and may include, but is not limited to, a mouse, a keyboard, a touch screen, a microphone, and / or a remote controller. The output device 1208 may be any type of device capable of presenting information, and may include, but is not limited to, a display, a speaker, a video / audio output terminal, a vibrator, and / or a printer.
[0119] The computing device 1200 may also include or be connected to a non-transitory storage device 1214, which may be any non-transitory storage device that can implement data storage, and may include, but is not limited to, a disk drive, an optical storage device, a solid-state memory, a floppy disk, a flexible disk, a hard disk, a tape, or any other magnetic medium, a compressed disk or any other optical medium, a cache memory, and / or any other storage chip or module, and / or any other medium from which a computer can read data, instructions, and / or code. The computing device 1200 may also include a random access memory (RAM) 1210 and a read-only memory (ROM) 1212. The ROM 1212 may store programs, utilities, or processes to be executed in a non-volatile manner. The RAM 1210 may provide volatile data storage and store instructions related to the operation of the computing device 1200. The computing device 1200 may also include a network / bus interface 1216 coupled to a data link 1218. The network / bus interface 1216 can be any type of device or system capable of enabling communication with an external device and / or a network, and can include but is not limited to a modem, a network card, an infrared communication device, a wireless communication device and / or a chipset (such as a Bluetooth™ device, an 802.11 device, a WiFi device, a WiMax device, a cellular communication facility, etc.).
[0120] The present disclosure may be implemented as any combination of an apparatus, a system, an integrated circuit, and a computer program on a non-transitory computer-readable medium. One or more processors may be implemented as an integrated circuit (IC), an application specific integrated circuit (ASIC), or a large scale integrated circuit (LSI), a system LSI, a super LSI, or a super LSI component that performs some or all of the functions described in the present disclosure.
[0121] The present disclosure includes the use of software, applications, computer programs, or algorithms. The software, applications, computer programs, or algorithms may be stored on a non-transitory computer-readable medium to enable a computer such as one or more processors to perform the above steps and the steps described in the accompanying drawings. For example, one or more memories store the software or algorithm in executable instructions, and one or more processors may associate a set of instructions to execute the software or algorithm to provide various functions according to the embodiments described in the present disclosure.
[0122] Software and computer programs (which may also be referred to as programs, software applications, applications, components or code) include machine instructions for a programmable processor and may be implemented in a high-level procedural language, an object-oriented programming language, a functional programming language, a logic programming language, or an assembly language or a machine language. The term "computer-readable medium" refers to any computer program product, apparatus or device for providing machine instructions or data to a programmable data processor, such as magnetic disks, optical disks, solid-state storage devices, memories and programmable logic devices (PLDs), including computer-readable media that receive machine instructions as computer-readable signals.
[0123] For example, computer readable media may include dynamic random access memory (DRAM), random access memory (RAM), read-only memory (ROM), electrically erasable read-only memory (EEPROM), compact disk read-only memory (CD-ROM) or other optical disk storage devices, magnetic disk storage devices or other magnetic storage devices, or any other medium that can be used to carry or store the desired computer readable program code in the form of instructions or data structures and can be accessed by a general or special purpose computer or a general or special purpose processor. As used herein, disk or disc includes compact disc (CD), laser disc, optical disc, digital versatile disc (DVD), floppy disk and Blu-ray disc, where disks usually reproduce data magnetically, while discs reproduce data optically by laser. Combinations of the above are also included in the scope of computer readable media.
[0124] The subject matter of the present disclosure is provided as an example of devices, systems, methods and programs for performing the features described in the present disclosure. However, in addition to the above-mentioned features, other features or variations may also be expected. It is expected that the implementation of the components and functions of the present disclosure may be completed with any emerging technology that may replace any of the above-mentioned implementation technologies.
[0125] In addition, the above description provides examples without limiting the scope, applicability or configuration set forth in the claims. Without departing from the spirit and scope of the present disclosure, the functions and arrangements of the elements discussed may be changed. Various embodiments may appropriately omit, replace or add various processes or components. For example, features described with respect to certain embodiments may be combined in other embodiments.
[0126] In addition, in the description of the present disclosure, the terms “first”, “second”, “third”, etc. are used for descriptive purposes only and cannot be understood as indicating or implying relative importance and order.
[0127] Similarly, while operations are depicted in a particular order in the drawings, this should not be understood as requiring that such operations be performed in the particular order shown or in sequential order, or that all illustrated operations be performed to achieve desired results. In certain circumstances, multitasking and parallel processing can be advantageous.
Claims
1. A method for allocating resources in a resource pool, comprising: When allocating resources for a computing job request, obtaining resource status information of a resource pool and resource requirements corresponding to the computing job request, wherein the resource status information includes resource information of each resource node in the resource pool; Constructing a resource allocation tree according to the resource status information, and determining a resource allocation scheme corresponding to the computing job request based on the resource demand and the resource allocation tree, including: initializing the resource allocation tree, wherein the root node of the resource allocation tree represents the resource status information and the computing job request, and the leaf nodes represent the resource status information of the remaining resources of each resource node after the corresponding resource node is allocated the computing job request; and Allocating resources to the computing job request according to the resource allocation scheme, Initializing the resource allocation tree includes: Establish a corresponding leaf node for each resource node, and set the allocation times and stable score value of the corresponding resource node for the leaf node; Based on the cosine similarity between the resource demand of the simulated computing job or the resource demand of the computing job request and the remaining resource state of each computing node, selecting a first leaf node that can meet the resource demand of the randomly generated simulated computing job or the resource demand of the computing job request; Allocating the resource requirements of the simulated computing job or the resource requirements requested by the computing job to the first leaf node; and Update the allocation times and stable score value of each first leaf node.
2. The method according to claim 1, wherein: Initializing the resource allocation tree also includes: Randomly generate new simulation computing jobs; Using the new simulation computing job, executing again the steps of initializing the resource allocation tree in claim 1; Repeat the above steps of random generation and re-execution until no leaf node can meet the resource requirements of the new simulation computing job.
3. The method according to claim 1, wherein: After allocating resources to the computing job request according to the resource allocation scheme, Randomly generate new simulation computing jobs; and Use a new simulation job and execute the following steps again: Establish a corresponding leaf node for each resource node, and set the allocation times and stable score value of the corresponding resource node for the leaf node; Selecting the first leaf node that can meet the resource requirements of the new simulation computing job; Simulate and allocate the resource requirements of the simulated computing job to the first leaf node; as well as Update the number of allocations and the stable score value of each first leaf node; Repeat the above steps of random generation and re-execution until no leaf node can meet the resource requirements of the new simulation computing job.
4. The method according to claim 3, wherein: After allocating resources to the computing job request according to the resource allocation scheme, a first leaf node is selected based on the cosine similarity between the resource requirement of the simulated computing job or the resource requirement of the computing job request and the remaining resource status of each computing node.
5. The method according to claim 1 or 3, wherein: Allocating resources to the computing job request according to the resource allocation scheme includes: A first leaf node with the highest stability score is selected as a first target leaf node, and the first target leaf node is used to allocate resources for the computing job request.
6. The method of claim 1, further comprising: Put multiple computing job requests into a queue in the order they arrive; A computing job request is read from the queue in the order of arrival, and resources are allocated to the computing job request.
7. The method according to any one of claims 1 to 3, wherein: The resource information of the resource node includes resource information of two or more resources; and The demand information carried in the computing job request includes demand information for two or more resources.
8. The method according to claim 7, wherein: When no leaf node can meet the resource requirements of a new simulation computing job, the allocation times and stable score value of each first leaf node are updated based on the total resources and remaining resources of each resource, the current allocation times and stable score value of each first leaf node.
9. A resource allocation device, comprising: a memory having instructions stored therein; as well as A processor configured to execute instructions stored on the memory to perform the method according to any one of claims 1 to 8.
10. A computer-readable storage medium comprising computer-executable instructions, which, when executed by one or more processors, cause the one or more processors to perform the method according to any one of claims 1 to 8.
11. A resource allocation device, comprising: A resource information acquisition module, used to acquire resource status information of a resource pool and resource requirements corresponding to the computing job request when allocating resources to the computing job request, wherein the resource status information includes resource information of each resource node in the resource pool; an allocation scheme formulation module, configured to construct a resource allocation tree according to the resource status information, and determine a resource allocation scheme corresponding to the computing job request based on the resource demand and the resource allocation tree, comprising: initializing the resource allocation tree, wherein the root node of the resource allocation tree represents the resource status information and the computing job request, and the leaf node represents the resource status information of the remaining resources of each resource node after the corresponding resource node is allocated the computing job request, Initializing the resource allocation tree includes: Establish a corresponding leaf node for each resource node, and set the allocation times and stable score value of the corresponding resource node for the leaf node; Based on the cosine similarity between the resource demand of the simulated computing job or the resource demand of the computing job request and the remaining resource state of each computing node, selecting a first leaf node that can meet the resource demand of the randomly generated simulated computing job or the resource demand of the computing job request; Allocating the resource requirements of the simulated computing job or the resource requirements requested by the computing job to the first leaf node; and Update the number of allocations and the stability score value of each first leaf node; and A resource allocation module is used to allocate resources to the computing job request according to the resource allocation scheme.
