Q learning-based cluster computing task resource allocation method and equipment

By adopting hierarchical reinforcement learning strategies based on Q learning on data centers and cloud computing platforms, decomposing task allocation and resource allocation problems, and using Rainbow and DDQN algorithms, the efficiency and performance problems of traditional strategies in large-scale dynamic task management are solved. , achieving efficient and scalable resource management.

CN118585329APending Publication Date: 2024-09-03SOUTHEAST UNIV
View PDF 0 Cites 4 Cited by

Patent Information

Application Number
CN202410727978.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-06
Publication Date
2024-09-03

AI Technical Summary

Technical Problem

Traditional computing resource allocation strategies are difficult to meet the dual requirements of efficiency and performance in modern data centers and cloud computing platforms, especially when dealing with large-scale and dynamically changing computing tasks. It is also difficult to design a system that can quickly adapt to the environment. Changes can continue to provide reinforcement learning models that optimize performance.

Method used

A hierarchical reinforcement learning strategy based on Q-learning is used to decompose task allocation and resource allocation into two cooperating sub-problems. The Rainbow algorithm and DDQN algorithm are used to handle task allocation and resource allocation respectively, and the overall performance is optimized through joint training of two-layer networks. .

Benefits of technology

It achieves more effective resource utilization, reduces resource waste, adapts to changing computing needs, provides efficient and scalable resource management solutions, and ensures the optimization of system resource utilization and maximization of operating efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118585329A
    Figure CN118585329A
Patent Text Reader

Abstract

The invention discloses a Q learning-based cluster computing task resource allocation method and equipment. The method comprises the following steps of: dividing computing task resource allocation of a cluster into a task allocation module and a computing resource allocation module; the task allocation module is responsible for allocating calculation tasks to the calculation servers, and the calculation resource allocation module is responsible for allocating calculation resources to the selected tasks; establishing an optimization target of computing task resource allocation, and defining corresponding constraint conditions; modeling a calculation task resource allocation problem into a Markov decision process, and designing related reinforcement learning elements; a hierarchical reinforcement learning strategy is adopted, a high-level agent uses a Rainbow algorithm to process a task allocation problem, and a low-level agent uses a DDQN algorithm to process a computing resource allocation problem; and a double-layer network joint training strategy is adopted to optimize the overall performance. According to the method, intelligent task and computing resource allocation can be realized, and an allocation result can be effectively obtained in a relatively short time.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of edge computing and resource scheduling, and in particular to a cluster computing task resource allocation method and device based on Q learning. Background Art

[0002] In modern computing environments, especially in data centers and cloud computing platforms, how to efficiently manage and allocate computing resources has become an important issue. With the growing computing demand and increasing complexity of computing tasks, traditional resource allocation strategies have been unable to meet the dual requirements of efficiency and performance. These strategies are usually inflexible and perform poorly when dealing with large-scale, dynamically changing computing tasks.

[0003] To solve these problems, researchers and engineers began to explore the use of machine learning methods, especially reinforcement learning, to optimize task and resource allocation problems. Reinforcement learning is a trial-and-error based learning method that can optimize decision-making strategies, adapt to environmental changes, and maximize long-term rewards in continuous interactions. Among them, Q-learning is a widely used model-free reinforcement learning algorithm that evaluates the expected utility of taking an action in a specific state by maintaining an action-value function (i.e., Q function).

[0004] In cluster computing environments, task allocation and resource management problems can be modeled as a complex decision-making process, in which the results of each decision affect the subsequent resource utilization efficiency and task execution performance. By adopting Q-learning, intelligent resource allocation strategies can be developed that can dynamically adjust allocation decisions in response to changes in task load and real-time information about server status. In addition, in order to handle larger state spaces and action spaces, researchers have introduced hierarchical reinforcement learning and deep reinforcement learning techniques, such as DDQN (Double Deep Q-Network) and Rainbow algorithm, which further improve the learning efficiency of strategies and the quality of decisions by introducing deep learning models to approximate Q functions. Although current research and practice have made some progress, in practical applications, how to design a reinforcement learning model that can quickly adapt to environmental changes and continuously provide optimized performance remains a challenge. In addition, the efficient allocation of computing resources requires not only optimizing immediate task allocation decisions, but also considering long-term system stability and scalability, which requires the addition of more advanced algorithms and strategies to the reinforcement learning framework. Summary of the invention

[0005] Purpose of the invention: The purpose of the present invention is to provide a cluster computing task resource allocation method and device based on Q learning, aiming to optimize the computing resource management of data centers and cloud computing platforms. The method introduces a hierarchical reinforcement learning strategy to decompose task allocation and resource allocation into two mutually cooperative sub-problems, and structurally handles the dynamic allocation problem of computing resources, which can more effectively adapt to environmental changes, improve resource utilization, and reduce resource waste.

[0006] Technical solution: In order to achieve the above invention objectives, the present invention adopts the following technical solution:

[0007] A cluster computing task resource allocation method based on Q learning includes the following steps:

[0008] Step 1: Divide the computing task resource allocation of the cluster into a task allocation module and a computing resource allocation module. The task allocation module is responsible for allocating computing tasks to computing servers, while the computing resource allocation module is responsible for allocating computing resources to selected tasks. The task allocation module contains a task allocator, which allocates N tasks to M computing servers in sequence. Each task is divided into multiple computing stages. The specific computing requirements of each stage include a certain computing time and the required number of computing units. The computing resource allocation module contains a task computing sequence planner and a resource allocator. The task sequence planner is responsible for planning the computing sequence of the allocated tasks, and the resource allocator allocates the corresponding computing units according to the planned task computing sequence, and plans the start and end time of the calculation.

[0009] Step 2: Establish the optimization goal of computing task resource allocation and define the corresponding constraints. The optimization goal is to design the execution time of each computing stage of all tasks. and the assigned object To reduce task computing time and improve system efficiency, the constraint is that the computing capacity of all computing servers will not overflow at any time;

[0010] Step 3: Model the computing task resource allocation problem as a Markov decision process and design related reinforcement learning elements. A hierarchical reinforcement learning strategy is adopted. The high-level agent corresponds to the task allocation Markov model, which is used in the task allocation module. The low-level agent corresponds to the computing resource and task sequence planning Markov model, which is used in the computing resource allocation module.

[0011] Step 4: Based on the hierarchical reinforcement learning strategy, the high-level agent uses the Rainbow algorithm to handle the task allocation problem, and the low-level agent uses the DDQN algorithm to handle the computing resource allocation problem;

[0012] Step 5: A two-layer network joint training strategy is used to optimize the overall performance of the task allocation module and the computing resource allocation module. The trained model is directly applied to practice to obtain a computing task resource allocation solution.

[0013] Furthermore, the processing of the computing resource allocation module includes the following steps:

[0014] Step a: Create a space-time matrix with width representing the number of computing units and height representing time, which is used to record the time occupied by each task on the computing unit. The ID number of each task is filled in the corresponding matrix unit;

[0015] Step b: Fill the task ID numbers into the free cells of the space-time matrix in the order of task calculation, using a greedy strategy to prioritize the cells on the left, while ensuring that the number of calculation cells required for the tasks at the same time is sufficient;

[0016] Step c: When all task ID numbers are successfully filled into the space-time matrix, the computing unit allocation of all tasks and the corresponding start and end times are output.

[0017] Furthermore, in step 1, the computing task resource allocation of the cluster is divided into a task allocation module and a computing resource allocation module, and the specific method is as follows:

[0018] Step 11: Build a task storage pool to store various tasks and assign tasks in order of priority;

[0019] Step 12: Whenever a task is assigned to a computing server, the server re-plans the computing order of the tasks that have not started computing through the task sequence planner, and reallocates resources through the resource allocator;

[0020] Step 13: When the current stage of the task completes the calculation, if it is not the final stage, the task enters the next stage and is put back into the task pool to wait for the allocation of the next stage.

[0021] Furthermore, in step 2, an optimization goal for computing task resource allocation is established, and the objective function is as follows:

[0022]

[0023] where f i represents the completion time of the last stage of each task, i∈{1,2,...,N} represents each task, j∈{1,2,...,M} represents each computing server, i k represents the kth stage of task i, K i represents the number of stages of task i, and Respectively represent i k Whether the task phase is executed at time t and i k An indicator variable indicating whether the task stage is executed by compute server j,

[0024] The constraints are:

[0025]

[0026] in, represents the computing capacity occupied by the kth stage of task i, represents the duration of the kth stage of task i; when t = 0, the duration of stage task i on server j is calculated k The computational effort is The amount of computation occupied by tasks in all stages When t>0, in addition to the stage tasks that started at time t, the stage tasks that started before time t and have not yet ended also occupy the computational load. k It has not ended at time t if and only if and The computational workload of all stage tasks on server j is

[0027] Furthermore, in step 3, the observation of the high-level agent is described as follows: The observation space of the task allocator It consists of the following parts: the remaining proportion p of each task on each computing server task , the number of computing units on each computing server n unit , the number of tasks n that have been assigned to each computing server ctask , the stage l of the current assigned task c , required computing unit u c , the required computing time t c ;

[0028] The action description of the high-level agent is as follows: At each time step, a task is assigned to one of the computing servers, so the action space is

[0029] The rewards of high-level agents are described as follows: The rewards R are evenly distributed aver =α aver ·(R var,T +R var,N +R var,E ), where α aver is the average reward coefficient, R var,T ,R var,N ,R var,EThey represent the impact of the task allocation steps on the time variance, task quantity variance, and resource consumption variance respectively;

[0030] When all tasks are assigned, the final reward is used to measure the quality of the generated task assignment plan, and the time reward R for task assignment is defined. time for:

[0031]

[0032] where α t is the time reward coefficient, is the average time required for each task, t max is the maximum time consumed by all servers to complete the task, n task is the total number of tasks to be completed, Indicates the average maximum completion time of each task.

[0033] The observation description of the low-level agent is as follows: The observation space of the resource allocator It consists of the following components: the number of tasks remaining in each stage on the server, the number of computing units on the server, and the completion time of each computing unit on the server;

[0034] The action description of the low-level agent is as follows: at each time step, a task phase is selected and a task is randomly selected from the task phase, so the action space is K means there are K task stages;

[0035] The reward of the low-level agent is described as follows: the computational occupancy of the space-time matrix, that is, the ratio of the number of non-empty cells to the number of all cells.

[0036] Furthermore, in step 4, during the solution process, the decision-making of the high-level agent and the decision-making of the low-level agent are automatically switched and performed independently. The time step of the high-level agent decision is called the high-level time step, and the time step of the low-level agent decision is called the low-level time step. The actual time increase of each step is called the actual time step. At each high-level time step t h , the high-level agent chooses an action to perform a h (t h ), assign the task to a server; at each low-level time step t l , the low-level agent performs an action a l (t l), indicating the tth calculation of the task; at each real time step, the calculation completion status of all current tasks is updated and the tasks that have completed the current stage calculation but have not completed all stages are recovered to the task calculation pool; when the high-level task allocation module has allocated the tasks in the task pool, the system automatically switches to the low-level task sequence selection module to re-plan the sequence of tasks that have not started calculation; when the task pool is not empty, the system automatically switches to the high-level task allocation stage.

[0037] Furthermore, in step 5, the specific process of the two-layer network joint training strategy is as follows: first, train the lower-layer resource planner agent until its performance is saturated, then freeze the Q network of the resource sequential planning algorithm, and then start training the high-level agent of the task allocation algorithm. When the high-level agent training reaches a specified level, unfreeze the network of the low-level agent. At this stage, the resource sequential planning algorithm is allowed to readjust its strategy while the task allocation algorithm continues to learn.

[0038] The present invention also provides a computer device, comprising: one or more processors; a memory; and one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by the one or more processors, and when the programs are executed by the processors, the steps of the cluster computing task resource allocation method based on Q learning as described above are implemented.

[0039] The present invention also provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of the cluster computing task resource allocation method based on Q learning as described above are implemented.

[0040] The beneficial effects of the present invention are as follows: (1) The present invention divides the cluster computing task resource allocation task into a task allocation module and a computing resource allocation module. This modular approach improves the manageability and maintainability of the processing process, so that task allocation and resource allocation can be optimized and adjusted more independently; (2) The present invention adopts a task pool recycling strategy to recycle unfinished tasks into the task pool, so it can naturally adapt to multi-stage task static allocation (tasks are given), multi-stage task dynamic allocation (tasks are continuously generated over time) and server abnormalities that require reallocation. This strategy effectively solves the uncertainty problem in task allocation and ensures flexible allocation and efficient use of resources; (3) The present invention can achieve refined management and automatic optimization, adapt to changing computing needs and environments, and provide an efficient and scalable resource management solution for modern data centers and cloud services. These steps not only contribute independently to the improvement of overall performance, but also form effective synergy with each other, ensuring the optimization of system resource utilization and maximization of operating efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] Figure 1 It is a schematic diagram of the method steps of the present invention.

[0042] Figure 2 It is a schematic diagram of the network model structure of the present invention.

[0043] Figure 3 The figure is a schematic diagram of a specific process of the method of the present invention.

[0044] Figure 4 This is a diagram of the algorithm solution and training process architecture of the present invention.

[0045] Figure 5 Cumulative reward graph for the low-level agent provided by the present invention.

[0046] Figure 6 Cumulative reward graph for the high-level agent provided by the present invention.

[0047] Figure 7 This is a practical effect diagram provided by the present invention. DETAILED DESCRIPTION

[0048] In order to have a clearer understanding of the features and advantages of the technical solution of the present invention, the composition and implementation of the specific solution are explained below in conjunction with the accompanying drawings.

[0049] Reference Figure 1 , Figure 2 and Figure 3 The present invention proposes a cluster computing task resource allocation method based on Q learning, comprising the following steps:

[0050] Step 1: divide the computing task resource allocation of the cluster into a task allocation module and a computing resource allocation module; the task allocation module is responsible for allocating computing tasks to computing servers, while the computing resource allocation module is responsible for allocating computing resources to selected tasks;

[0051] Step 2: Establish the optimization goal of computing task resource allocation and define the corresponding constraints;

[0052] Step 3: Model the computing task resource allocation problem as a Markov decision process and design relevant reinforcement learning elements;

[0053] Step 4: By adopting a hierarchical reinforcement learning strategy, the high-level agent uses the Rainbow algorithm to handle the task allocation problem, while the low-level agent uses the DDQN algorithm to handle the computing resource allocation problem;

[0054] Step 5: Adopt a two-layer network joint training strategy to optimize the overall performance of the task allocation module and the computing resource allocation module.

[0055] According to an embodiment of the present invention, in step 1, the task allocation module includes a task allocator, which allocates N tasks to M computing servers in sequence. Each task is divided into multiple computing stages, and the specific computing requirements of each stage include a certain computing time and the required number of computing units. The same stage of each task must be completed on the same computing server, while different stages can be completed by different computing servers. It is assumed that the computing time and number of computing units required for the same stage of all tasks are the same.

[0056] The computing resource allocation module includes a task computing sequence planner and a resource allocator. The task sequence planner is responsible for planning the computing sequence of the assigned tasks, and the resource allocator allocates the corresponding computing units according to the planned task computing sequence and plans the start and end time of the computing. The specific steps are as follows:

[0057] Step a: Create a space-time matrix with a width representing the number of computing units and a height representing time, which is used to record the time occupied by each task on the computing unit. The ID number of each task is filled in the corresponding matrix unit.

[0058] Step b: Fill the task ID numbers into the free cells of the space-time matrix in the order of task calculation, using a greedy strategy to prioritize filling the leftmost cells, while ensuring that there are enough computing cells required for tasks at the same time.

[0059] Step c: When all task ID numbers are successfully filled into the space-time matrix, the computing unit allocation of all tasks and the corresponding start and end times are output.

[0060] According to an embodiment of the present invention, the specific process of step 1 is described as follows:

[0061] Step 11: Build a task storage pool to store various tasks and assign tasks in order of priority.

[0062] Step 12: Whenever a task is assigned to a computing server, the server re-plans the computing order of the tasks that have not started computing through the task sequence planner and reallocates resources through the resource allocator.

[0063] Step 13: When the current stage of the task completes the calculation, if it is not the final stage, the task enters the next stage and is put back into the task pool to wait for the allocation of the next stage.

[0064] According to an embodiment of the present invention, in step 2, establishing the optimization goal of computing task resource allocation includes: by designing each computing stage of all tasks Execution time and allocation objects To reduce task computing time and improve system efficiency. First, establish the objective function of the system efficiency optimization problem, and then establish the constraints of the system efficiency optimization problem. The constraints of the system efficiency optimization problem are that the computing capacity of all computing servers will not overflow at any time.

[0065] The objective function of the efficiency optimization problem is described as:

[0066]

[0067] where f i represents the completion time of the last stage of each task, i∈{1,2,...,N} represents each task, j∈{1,2,...,M} represents each computing server, i k represents the kth stage of task i, and K i represents the number of stages of task i, and Respectively represent i k Whether the task phase is executed at time t and i k An indicator variable indicating whether the task stage is executed by compute server j,

[0068] The constraints of the efficiency optimization problem are described as:

[0069]

[0070] in, represents the computing capacity occupied by the kth stage of task i, Indicates the duration of the kth stage of task i. When t = 0, calculate the duration of stage i of task i on server j. k The computational effort is The amount of computation occupied by tasks in all stages When t>0, in addition to the stage tasks that started at time t, the stage tasks that started before time t and have not yet ended also occupy the computational load. k It has not ended at time t if and only if and The computational workload of all stage tasks on server j is

[0071] According to the implementation mode of the present invention, in step 3, the cluster computing task resource allocation optimization problem is modeled as a reinforcement learning problem, the Q learning algorithm elements are designed, and the hierarchical reinforcement learning strategy is adopted to establish a high-level intelligent agent, corresponding to the task method allocation Markov model to solve the task allocation problem; establish a low-level intelligent agent, corresponding to the computing resource and task sequence planning Markov model to solve the computing resource allocation problem; the establishment of each layer of intelligent agents involves corresponding observation states, actions and rewards, and the specific method is as follows:

[0072] For high-level agents, the observation description of high-level agents is as follows: The observation space of the task allocator It consists of the following parts: the remaining proportion p of each task on each computing server task , the number of computing units on each computing server n unit , the number of tasks n that have been assigned to each computing server ctask , the stage l of the current assigned task c , required computing unit u c , the required computing time t c ;

[0073] The action description of the high-level agent is as follows: At each time step, a task is assigned to one of the computing servers, so the action space is

[0074] The rewards of high-level agents are described as follows: The rewards of high-level agents are composed of the following parts. To ensure that all tasks are completed as quickly as possible, tasks need to be evenly distributed so that each computing server is as short as possible to maximize the reasonable use of computing resources. Therefore, the rewards R are evenly distributed. aver for:

[0075] R aver =α aver ·(R var,T +R var,N +R var,E )

[0076] where α aver is the average reward coefficient, R var,T ,R var,N ,R var,E They respectively represent the impact of the task allocation step on the time variance, task quantity variance, and resource consumption variance. The specific calculation method is:

[0077]

[0078] Where var(T t ) represents the variance of the time taken by the server to complete the assigned task at time t, var(N t) represents the variance of the number of unfinished tasks assigned to each server at time t, var(E t ) represents the variance of computing resource consumption of each server at time t.

[0079] When all tasks are assigned, the final reward is needed to measure the quality of the generated task assignment plan, so the time reward R for task assignment is defined as time for:

[0080]

[0081] where α t is the time reward coefficient, is the average time required for each task, t max is the maximum time consumed by all servers to complete the task, n task is the total number of tasks to be completed, Indicates the average maximum completion time of each task.

[0082] For the low-level agent, the observation description of the low-level agent is as follows: The observation space of the resource allocator It consists of the following components: the number of tasks remaining in each stage on the server, the number of computing units on the server, and the completion time of each computing unit on the server;

[0083] The action description of the low-level agent is as follows: at each time step, a task phase is selected and a task is randomly selected from the task phase, so the action space is K means there are K task stages;

[0084] The reward of the low-level agent is described as follows: In order to select the solution that minimizes the overall computing time, it is necessary to increase the computing utilization of each service, so the reward is set to the computing occupancy rate of the space-time matrix (the ratio of non-empty cells to all cells).

[0085] According to an embodiment of the present invention, hierarchical reinforcement learning is used in step 4, the high-level agent uses the Rainbow algorithm to handle the task allocation problem, and the low-level agent uses the DDQN algorithm to handle the resource allocation problem. Figure 4 , the specific method is as follows:

[0086] In order to solve the problem of a large action space caused by the two decisions, hierarchical reinforcement learning is used to be responsible for the task allocation problem and the resource allocation problem respectively, and the large action space is divided into two smaller action spaces, so that the action space is Reduced to M+K, effectively reducing the training complexity, where M represents the number of servers and K represents the number of task stages. Indicates that u is extracted from U units cAssigned to the task. During the solution process, the decision-making of the high-level agent and the decision-making of the low-level agent are automatically switched and carried out independently. The time step of the high-level agent decision is called the high-level time step, and the time step of the low-level agent decision is called the low-level time step. At each high-level time step t h , the high-level agent chooses an action to perform a h (t h ), assign the task to a server; at each low-level time step t l , the lower-level agent will perform an action a l (t l ), indicating the tth calculation of the task; at each real time step, the calculation completion status of all current tasks is updated and the tasks that have completed the current stage calculation but have not completed all stages are recovered to the task calculation pool; when the high-level task allocation module has allocated the tasks in the task pool, the system automatically switches to the low-level task sequence selection module to re-plan the sequence of tasks that have not started calculation; when the task pool is not empty, the system automatically switches to the high-level task allocation stage.

[0087] Preferably, for the selection of execution actions, in processing allocation problems, at each high-level time step, the Rainbow algorithm outputs the Q value of each server selected by the task according to the task to be assigned and the state of each server, and selects the server with the largest Q value as the server assigned to the task; in processing resource allocation tasks, at the t-th low-level time step, the DDQN algorithm selects the Q value of the task in each stage according to the state output of each computing unit, and then in the task stage with the largest Q value, extracts a task belonging to that stage as the t-th task to be calculated.

[0088] Preferably, when the Rainbow algorithm is used to process the task allocation problem in step 4, a network structure that adapts to the variable number of actions is adopted, and the overall computing speed can be improved by GPU parallel computing. The specific steps are as follows:

[0089] Step 41: Extract a batch of data (s, a, s', r) required for task assignment Q learning from the data set. Here, the action index a of the selected server is mapped to the encoding a of the server node through the neural network. e .

[0090] Step 42: Since the number of servers in different scenarios is different, extract a series of encoded actions a for each state s e . Encode each action as e The corresponding state s is concatenated into s||a e vectors, and record which state s these vectors belong to.

[0091] Step 43: Put the spliced ​​s||a eThe vector is input into the Q(s,a) network to calculate the action state value. According to the record of step 42, the action state value required for each state in different states is calculated.

[0092] Preferably, the training objective of the DDQN algorithm network is defined as

[0093]

[0094] where r t The reward γ at time step t is a discount factor, usually between 0 and 1, used to attenuate the importance of future rewards. Q is the action-state value function, which represents the expected return that can be obtained by taking action a in state s. t+1 is the state at time step t+1. argmax a′ Q(s t+1 ,a′;θ) is in state s t+1 Select the action a′ that maximizes the Q value. θ is the parameter of the Q network. θ - are the parameters of the target Q network.

[0095] Preferably, the training objective of the Rainbow algorithm network is defined as:

[0096]

[0097] Where L(θ) is the loss function, and the parameter θN used to update the Q network is the number of atoms in the distribution. i is the i-th atomic value of the distribution. ij (θ) is the projection operation of the distribution, which transforms the atom z i Project onto the target distribution.

[0098] According to an embodiment of the present invention, in step 5, the joint training method of the two-layer network is as follows: first, train the low-level resource planner agent until its performance is saturated, and then freeze the Q network of the resource planning algorithm. Then start training the high-level agent for task allocation. When the high-level agent training reaches a certain level, unfreeze the network of the low-level agent. At this stage, the resource sequence planning algorithm is allowed to readjust its strategy while the task allocation algorithm continues to learn. This method ensures that the two-layer strategies can adapt to each other's changes and achieve more efficient collaborative work. Through multiple iterations, both layers of strategies are further optimized until the system reaches the expected performance or meets other termination criteria. The model after training can be directly applied to practice to obtain a computing task resource allocation solution.

[0099] In order to verify the performance of the proposed method, the following experiments were conducted. Five computing servers were designed (4 of them had 10 computing units and 1 had 4 computing units), with 280 tasks to be processed. Each task had two stages. The computing time and computing units required for each task stage are shown in Table 1. To improve robustness, some tasks being calculated were randomly added to the server before the allocation started. During training, 2-20 servers and 100-300 tasks were randomly generated for training. The low-level agents were first trained to performance saturation, and then the high-level agents were trained, and then joint training optimization was performed.

[0100] Table 1 Mission phase parameters

[0101]

[0102] Table 2 MLP structure of low-level agents

[0103]

[0104] Table 3 Network structure of high-level intelligent agents

[0105]

[0106] In the computing resource allocation module, the training of the low-level agent uses the DDQN algorithm, and a multi-layer perceptron is used to output the state-action value. The specific structure is shown in Table 2. In the task allocator module, the training of the high-level agent uses the Rainbow algorithm. First, an Encoder network is used to extract the global features and the features of each server. Then the extracted global features and server features are input into the V network and the A network, and the state-action value is calculated according to Q(s,a)=V(s)+A(s,a). The specific structure is shown in Table 3. In each training step, the agent will randomly sample from the experience replay pool. The capacity of the experience replay pool set in the experiment is 10,000.

[0107] Figure 5-Figure 7 This is the result diagram of the experimental part. Figure 5 is the cumulative reward graph of the low-level agent, Figure 6 is the cumulative reward graph of the high-level agent, Figure 7 This is an experimental effect diagram, showing the utilization distribution of 5 nodes (5 servers). It can be seen that the method of the present invention can make the task intensity assigned to each server more evenly distributed, and the resource utilization rate of each server has reached more than 75%, and the average resource utilization rate of each server has reached more than 85%.

[0108] The present invention also provides a computer device, comprising: one or more processors; a memory; and one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by the one or more processors, and when the programs are executed by the processors, the steps of the cluster computing task resource allocation method based on Q learning as described above are implemented.

[0109] The present invention also provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of the cluster computing task resource allocation method based on Q learning as described above are implemented.

[0110] It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as methods, devices (systems), computer equipment or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.

[0111] The present invention is described with reference to a flowchart of a method according to an embodiment of the present invention. It should be understood that each process in the flowchart and a combination of processes in the flowchart can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the process in the flowchart. Figure 1 A device that specifies functions in a process or multiple processes.

[0112] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A function specified in a process or multiple processes.

[0113] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 The steps of a specified function in a process or multiple processes.

Claims

1. A cluster computing task resource allocation method based on Q learning, characterized in that: The following steps are involved: Step 1: Divide the computing task resource allocation of the cluster into a task allocation module and a computing resource allocation module. The task allocation module is responsible for allocating computing tasks to computing servers, and the computing resource allocation module is responsible for allocating computing resources to the selected tasks. The task allocation module contains a task allocator, which allocates N tasks to M computing servers in sequence. Each task is divided into multiple computing stages. The specific computing requirements of each stage include a certain computing time and the required number of computing units. The computing resource allocation module contains a task computing sequence planner and a resource allocator. The task sequence planner is responsible for planning the computing sequence of the allocated tasks, and the resource allocator allocates the corresponding computing units according to the planned task computing sequence, and plans the start and end time of the calculation. Step 2: Establish the optimization goal of computing task resource allocation and define the corresponding constraints. The optimization goal is to design the execution time tω of each computing stage of all tasks ikt and the assigned object jω ikj To reduce task computing time and improve system efficiency, the constraint is that the computing capacity of all computing servers will not overflow at any time; Step 3: Model the computing task resource allocation problem as a Markov decision process and design related reinforcement learning elements. A hierarchical reinforcement learning strategy is adopted. The high-level agent corresponds to the task allocation Markov model, which is used in the task allocation module. The low-level agent corresponds to the computing resource and task sequence planning Markov model, which is used in the computing resource allocation module. Step 4: Based on the hierarchical reinforcement learning strategy, the high-level agent uses the Rainbow algorithm to handle the task allocation problem, and the low-level agent uses the DDQN algorithm to handle the computing resource allocation problem; Step 5: A two-layer network joint training strategy is used to optimize the overall performance of the task allocation module and the computing resource allocation module. The trained model is directly applied to practice to obtain a computing task resource allocation solution.

2. The method according to claim 1, characterized in that The processing of the computing resource allocation module includes the following steps: Step a: Create a space-time matrix with width representing the number of computing units and height representing time, which is used to record the time occupied by each task on the computing unit. The ID number of each task is filled in the corresponding matrix unit; Step b: Fill the task ID numbers into the free cells of the space-time matrix in the order of task calculation, using a greedy strategy to prioritize the cells on the left, while ensuring that the number of calculation cells required for the tasks at the same time is sufficient; Step c: When all task ID numbers are successfully filled into the space-time matrix, the computing unit allocation of all tasks and the corresponding start and end times are output.

3. The method according to claim 1, characterized in that In step 1, the computing task resource allocation of the cluster is divided into a task allocation module and a computing resource allocation module. The specific method is as follows: Step 11: Build a task storage pool to store various tasks and assign tasks in order of priority; Step 12: Whenever a task is assigned to a computing server, the server re-plans the computing order of the tasks that have not started computing through the task sequence planner, and reallocates resources through the resource allocator; Step 13: When the current stage of the task completes the calculation, if it is not the final stage, the task enters the next stage and is put back into the task pool to wait for the allocation of the next stage.

4. The method according to claim 1, characterized in that: In step 2, the optimization goal of computing task resource allocation is established, and the objective function is as follows: where f i represents the completion time of the last stage of each task, i∈{1,2,...,N} represents each task, j∈{1,2,...,M} represents each computing server, i k represents the kth stage of task i, K i represents the number of stages of task i, and Respectively represent i k Whether the task phase is executed at time t and i k An indicator variable indicating whether the task stage is executed by compute server j, The constraints are: in, represents the computing capacity occupied by the kth stage of task i, represents the duration of the kth stage of task i; when t = 0, the duration of stage task i on server j is calculated k The computational effort is The amount of computation occupied by tasks in all stages When t>0, in addition to the stage tasks that started at time t, the stage tasks that started before time t and have not yet ended also occupy the computational load. k It has not ended at time t if and only if and The computational effort of all stage tasks on server j is 5. The method according to claim 1, characterized in that In step 3, the observation of the high-level agent is described as follows: The observation space of the task allocator The following parts Composition: The remaining proportion p of each task on each computing server task , the number of computing units on each computing server n unit , the number of tasks n that have been assigned to each computing server ctask , the stage l of the current assigned task c , required computing unit u c , the required computing time t c ; The action description of the high-level agent is as follows: At each time step, a task is assigned to one of the computing servers, so the action space is The rewards of high-level agents are described as follows: The rewards R are evenly distributed aver =α aver ·(R var,T +R var,N +R var,E ), where α aver is the average reward coefficient, R var,T ,R var,N ,R var,E They represent the impact of the task allocation steps on the time variance, task quantity variance, and resource consumption variance respectively; When all tasks are assigned, the final reward is used to measure the quality of the generated task assignment plan, and the time reward R for task assignment is defined. time for: where α t is the time reward coefficient, is the average time required for each task, t max is the maximum time consumed by all servers to complete the task, n task is the total number of tasks to be completed, Indicates the average maximum completion time of each task.

6. The method according to claim 2, characterized in that In step 3, the observation of the low-level agent is described as follows: The observation space of the resource allocator It consists of the following components: the number of tasks remaining in each stage on the server, the number of computing units on the server, and the completion time of each computing unit on the server; The action description of the low-level agent is as follows: at each time step, a task phase is selected and a task is randomly selected from the task phase, so the action space is K means there are K task stages; The reward of the low-level agent is described as follows: the computational occupancy of the space-time matrix, that is, the ratio of the number of non-empty cells to the number of all cells.

7. The method according to claim 1, characterized in that In step 4, the decision-making of the high-level agent and the decision-making of the low-level agent are automatically switched and performed independently during the solution process. The time step of the high-level agent decision is called the high-level time step, and the time step of the low-level agent decision is called the low-level time step. The actual time increase of each step is called the actual time step. At each high-level time step t h , the high-level agent chooses an action to perform a h (t h ), assign the task to a server; at each low-level time step t l , the low-level agent performs an action a l (t l ), indicating the tth calculation of the task; at each real time step, the calculation completion status of all current tasks is updated and the tasks that have completed the current stage calculation but have not completed all stages are recovered to the task calculation pool; when the high-level task allocation module has allocated the tasks in the task pool, the system automatically switches to the low-level task sequence selection module to re-plan the sequence of tasks that have not started calculation; when the task pool is not empty, the system automatically switches to the high-level task allocation stage.

8. The method according to claim 1, characterized in that In step 5, the specific process of the two-layer network joint training strategy is as follows: first, train the lower-layer resource planner agent until its performance is saturated, then freeze the Q network of the resource sequential planning algorithm, and then start training the high-level agent of the task allocation algorithm. When the high-level agent training reaches a specified level, unfreeze the network of the low-level agent. At this stage, the resource sequential planning algorithm is allowed to readjust its strategy while the task allocation algorithm continues to learn.

9. A computer device, characterized in that: include: one or more processors; Memory; And one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by the one or more processors, and when the programs are executed by the processors, the steps of the cluster computing task resource allocation method based on Q learning as described in any one of claims 1-8 are implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the cluster computing task resource allocation method based on Q learning as described in any one of claims 1 to 8 are implemented.

Citation Information

Cited By

  • Big data dynamic allocation and optimal scheduling method based on reinforcement learning

    CN119311407A

  • Unmanned cluster task resource allocation method based on deep reinforcement learning

    CN119521419A

  • An unmanned cluster task resource allocation method based on deep reinforcement learning

    CN119521419B

  • Deep reinforcement learning method and system based on multiple agents

    CN119561829A