Complex cooperative task scheduling method based on load balancing in heterogeneous cloud environment
By applying ant colony algorithm to load balancing in heterogeneous cloud environments, the problems of low resource utilization, neglected task complexity and lack of dynamic adjustment in traditional strategies are solved, and more efficient resource utilization and system are achieved Performance improvement.
Patent Information
- Application Number
- CN202411446473.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-16
- Publication Date
- 2025-02-14
AI Technical Summary
In heterogeneous cloud environments, traditional task scheduling strategies cannot fully utilize heterogeneous resources, resulting in low resource utilization, neglecting task complexity, lacking dynamic adjustment mechanisms, affecting system performance and efficiency.
Ant colony algorithm is used to perform complex collaborative task scheduling for load balancing in heterogeneous cloud environments, considering task complexity and introducing a dynamic adjustment mechanism, and achieving global optimization and dynamic adjustment through the guidance of pheromones and random exploration.
It improves resource utilization, takes into account task complexity, has dynamic adjustment capabilities, improves the performance and efficiency of the system, and realizes better task allocation and scheduling solutions.
Smart Images

Figure CN119440809A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of information technology and relates to a complex collaborative task scheduling method based on load balancing in a heterogeneous cloud environment. Background Art
[0002] In existing computing systems, task scheduling and load balancing become an important challenge due to the heterogeneity of resources and the complexity of tasks.
[0003] When scheduling complex collaborative tasks in a heterogeneous cloud environment, traditional task scheduling strategies have the following disadvantages:
[0004] 1. Low resource utilization: Traditional task scheduling strategies often fail to fully utilize the characteristics of heterogeneous resources, resulting in some resource nodes being overloaded while other nodes are idle, which leads to a waste of resources and a decrease in system performance.
[0005] 2. Lack of consideration of task complexity: Traditional strategies usually schedule tasks based only on resource availability and load conditions, while ignoring the complexity of tasks. Complex tasks may require more computing resources and longer execution time, and traditional strategies cannot optimize the allocation for different task complexities.
[0006] 3. Lack of dynamic adjustment mechanism: Traditional strategies are usually static and cannot be dynamically adjusted according to the real-time status of the system and the execution of tasks. This makes the system unable to flexibly respond to changing load conditions and task requirements, affecting the performance and efficiency of the system.
[0007] Therefore, a new approach is needed to solve this problem. Summary of the invention
[0008] The purpose of the invention is to provide a complex collaborative task scheduling method based on load balancing in a heterogeneous cloud environment, apply the ant colony algorithm to consider the complexity of tasks during scheduling and introduce a dynamic adjustment mechanism to improve resource utilization, and solve the problems existing in the prior art in the scheduling of complex collaborative tasks in a heterogeneous cloud environment.
[0009] The object of the present invention is achieved through the following technical solutions:
[0010] A complex collaborative task scheduling method based on load balancing in a heterogeneous cloud environment includes the following steps:
[0011] Step 1: When the system starts running, initialize n tasks, m resource nodes and t virtual ants, and randomly assign the virtual ants to different resource nodes; each virtual ant represents a task allocation strategy, and maintains a two-bit matrix Allocate[n][m], Allocate[i][j] = 1 means that task i is assigned to node j, and Allocate[i][j] = 0 means that task i is not assigned to node j;
[0012] Step 2: The tasks and resource nodes are combined into a pheromone matrix M. Each virtual ant dispatches the tasks to the resource nodes, maintains Allocate[n][m] according to the completion of the tasks, and updates each element M in the pheromone matrix according to the task completion time and resource occupancy. i,j concentration;
[0013] Step 3: Repeat step 2 until the maximum number of iterations is reached. For each task i, assign it to M i,j The largest resource node j.
[0014] Preferably, in step 1, when initializing n tasks, each task is given corresponding attributes, including computing time, memory usage, CPU usage, and collaborative dependencies between tasks.
[0015] Preferably, in step 1, when initializing m resource nodes, each resource node is provided with corresponding attributes, including memory and CPU.
[0016] Preferably, step 2 comprises the following steps:
[0017] 2.1 Initialize the pheromone matrix M and set each element in the matrix to the same initial value;
[0018] 2.2 Each virtual ant dispatches tasks to resource nodes;
[0019] 2.3 Record task completion status, including:
[0020] After the scheduling is completed, each virtual ant maintains two pieces of information:
[0021] (1) Scheduling result, i.e., Allocate[n][m];
[0022] (2) The total completion time of the task group under this scheduling method;
[0023] After the scheduling is completed, each virtual ant simulates according to its own scheduling results and maintains two pieces of information:
[0024] (1) Average CPU usage of each resource node during the simulation process (CpuUse[m]);
[0025] (2) The average memory usage of each resource node during the simulation, RamUse[m];
[0026] 2.4 Update pheromone matrix element M i,j value, including the following steps:
[0027] (1) First, each element M i,j The value is diluted, that is, multiplied by the parameter p, 0 <p<1;
[0028] (2) Among the t ants, find the ant bestAnt with the best scheduling result. The criteria are as follows:
[0029] Find the minimum and maximum total task group completion time among all ants, calculate the CPU usage variance and memory usage variance of each node, and perform maximum and minimum normalization on the total task group completion time and resource usage variance of each ant;
[0030] The scheduling result of each virtual ant is scored using the formula:
[0031] Score = (1-normalized total completion time of task group) + load balancing score;
[0032] Load balancing score = (1-normalized CPU usage variance) + (1-normalized memory usage variance)
[0033] Select the ant with the highest score as bestAnt
[0034] (3) bestAnt maintains the scheduling result Allocate[n][m]. If Allocate[i][j] = 1, that is, task i is assigned to resource node j, then M i,j The value is increased, that is, multiplied by the parameter q, q>1.
[0035] The beneficial effects of the present invention are:
[0036] 1. Global optimization capability: The ant colony algorithm has global optimization capabilities through the guidance of pheromones and random exploration, which can help the system find better task allocation and scheduling solutions.
[0037] 2. Consider the complexity of the task: Based on heuristic rules, the ant colony algorithm can reasonably select the path and nodes for task allocation according to the complexity of the task (collaborative dependencies) and the performance characteristics of the nodes to meet the requirements of the task.
[0038] 3. Dynamic adjustment strategy: The ant colony algorithm can dynamically adjust the pheromone concentration and heuristic rules according to the real-time status of the system and the execution of the task to adapt to the changing load conditions and task requirements. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] Figure 1 The present invention is a flowchart of a method for scheduling complex collaborative tasks based on load balancing in a heterogeneous cloud environment as shown in an embodiment. DETAILED DESCRIPTION
[0040] The present invention is further described in detail below in conjunction with the accompanying drawings and embodiments.
[0041] This embodiment uses the ant colony algorithm to implement complex collaborative task scheduling based on load balancing in a heterogeneous cloud environment. The ant colony algorithm is a heuristic optimization algorithm that achieves task allocation and scheduling optimization by simulating the behavior of ants in the process of searching for food.
[0042] Ant colony algorithm principle:
[0043] The ant colony algorithm is based on the pheromones and random behaviors left by ants when searching for food. Ants release pheromones to guide other ants to choose paths, and use randomness to explore new paths. The concentration of pheromones is affected by the quality of the path and the number of ants. The higher the pheromone concentration on the path, the more likely it is to be chosen by other ants.
[0044] See also Figure 1 As shown, the present embodiment shows a method for scheduling complex collaborative tasks based on load balancing in a heterogeneous cloud environment, and the specific steps are as follows:
[0045] 1. Initialization:
[0046] When the system starts running, n tasks, m resource nodes and t virtual ants are initialized, and the virtual ants are randomly assigned to different resource nodes. Each virtual ant represents a task allocation strategy.
[0047] Based on the number of tasks in the task set:
[0048] (1) Initialize n tasks, each of which has corresponding attributes (such as computing time, memory usage, CPU usage, and collaborative dependencies between tasks).
[0049] (2) Initialize m resource nodes, each resource node has corresponding attributes (such as memory, CPU).
[0050] (3) Initialize t virtual ants, each ant represents a task allocation strategy, and maintain a two-bit matrix Allocate[n][m], where Allocate[i][j]=1 means that task i is allocated to node j, and Allocate[i][j]=0 means that task i is not allocated to node j.
[0051] 2. Pheromone update:
[0052] Form a pheromone matrix M with tasks and resource nodes. Each virtual ant schedules tasks to resource nodes and updates the concentration of the pheromone matrix according to the task completion situation. It includes the following steps:
[0053] 2.1 Initialize the pheromone matrix M;
[0054] M is a two-dimensional matrix of n×m. Initially, each element in the matrix is set to the same initial value M0.
[0055] 2.2 Each virtual ant schedules tasks to resource nodes
[0056] For task i, intercept a one-dimensional array M[i] of length m from the pheromone matrix M, and randomly allocate the task to a resource node. For each resource node j, the higher the value of M[i][j], the higher the probability that task i is allocated to node j.
[0057] 2.3 Record the task completion situation
[0058] After the scheduling is completed, each virtual ant maintains two pieces of information:
[0059] (1) The scheduling result, that is, the defined Allocate[n][m];
[0060] (2) The total completion time of the task group under this scheduling method.
[0061] After the scheduling is completed, each virtual ant conducts a simulation based on its own scheduling result and maintains two pieces of information:
[0062] (1) The average CPU utilization rate CpuUse[m] of each resource node during the simulation;
[0063] (2) The average memory utilization rate RamUse[m] of each resource node during the simulation.
[0064] In this step, each ant maintains four pieces of information.
[0065] 2.4 Update the elements M of the pheromone matrix i,j Value
[0066] (1) First, dilute each element M i,j by multiplying it with the parameter p (0 < p < 1, a user-defined parameter);
[0067] (2) Among the t ants, find the ant bestAnt with the best scheduling result, and the criteria are as follows:
[0068] Find the minimum and maximum total task group completion time of all ants, calculate the CPU usage variance and memory usage variance of each node, and perform maximum and minimum normalization on the variance of total task group completion time and resource usage of each ant.
[0069] The scheduling result of each virtual ant is scored using the formula:
[0070] Score = (1-normalized total completion time of task group) + load balancing score;
[0071] Load balancing score = (1-normalized CPU usage variance) + (1-normalized memory usage variance)
[0072] Select the ant with the highest score as bestAnt
[0073] (3) bestAnt maintains the scheduling result Allocate[n][m]. For each element Allocate[i][j] in the matrix, if Allocate[i][j] = 1, that is, task i is assigned to resource node j, then M i,j The value is increased, that is, multiplied by the parameter q (q>1, custom parameter).
[0074] 3. Task selection and allocation
[0075] Repeat 2.2-2.4maxIterator times (custom parameter, maximum number of iterations) to get the final optimization scheduling result: for each task i, assign it to M i,j The largest resource node j.
[0076] According to the above-mentioned complex collaborative task scheduling method based on load balancing in a heterogeneous cloud environment, this embodiment has the following advantages:
[0077] 1. Complex collaborative task scheduling in heterogeneous cloud environments: The technical solution proposed in this invention aims at the task scheduling problem in heterogeneous cloud environments, and solves the shortcomings of traditional methods in terms of resource utilization, task complexity and dynamic adjustment. By adopting the ant colony algorithm, complex collaborative task scheduling based on load balancing is realized, which improves the performance and efficiency of the system.
[0078] 2. Application of ant colony algorithm: This invention applies ant colony algorithm to the field of task scheduling and load balancing, and uses the behavior pattern of ants when looking for food to achieve global optimization and dynamic adjustment capabilities. The application of this algorithm makes task allocation more balanced, resource utilization more efficient, and has strong adaptability and optimization capabilities.
[0079] 3. Optimization strategy considering task complexity: The technical solution of the present invention takes into account the complexity of tasks and allocates complex tasks to suitable resource nodes through heuristic rules and priority division to meet the needs of tasks. This optimization strategy can improve task execution efficiency and reduce system response time.
[0080] It is understandable that those skilled in the art can make equivalent substitutions or changes based on the technical solution and inventive concept of the present invention, and all these changes or substitutions should fall within the protection scope of the claims attached to the present invention.
Claims
1. A complex collaborative task scheduling method based on load balancing in a heterogeneous cloud environment, characterized in that The following steps are involved: Step 1: When the system starts running, initialize n tasks, m resource nodes and t virtual ants, and randomly assign virtual ants to different resource nodes; each virtual ant represents a task allocation strategy; maintain a two-bit matrix Allocate[n][m], Allocate[i][j] = 1 means that task i is assigned to node j, and Allocate[i][j] = 0 means that task i is not assigned to node j; Step 2: The tasks and resource nodes are combined into a pheromone matrix M. Each virtual ant dispatches the tasks to the resource nodes, maintains Allocate[n][m] according to the completion of the tasks, and updates each element M in the pheromone matrix according to the task completion time and resource occupancy. i,j concentration; Step 3: Repeat step 2 until the maximum number of iterations is reached. For each task i, assign it to M i,j The largest resource node j.
2. According to claim 1, a method for scheduling complex collaborative tasks based on load balancing in a heterogeneous cloud environment is characterized in that Step 1: When initializing n tasks, each task is given corresponding attributes, including computing time, memory usage, CPU usage, and collaborative dependencies between tasks.
3. According to claim 1, a method for scheduling complex collaborative tasks based on load balancing in a heterogeneous cloud environment is characterized in that Step 1: When initializing m resource nodes, each resource node is given corresponding attributes, including memory and CPU.
4. According to claim 1, a method for scheduling complex collaborative tasks based on load balancing in a heterogeneous cloud environment is characterized in that Step 2 includes the following steps: 2.1 Initialize the pheromone matrix M and set each element in the matrix to the same initial value; 2.2 Each virtual ant dispatches tasks to resource nodes; 2.3 Record task completion status, including: After the scheduling is completed, each virtual ant maintains two pieces of information: (1) Scheduling result, i.e., Allocate[n][m]; (2) The total completion time of the task group under this scheduling method; After the scheduling is completed, each virtual ant simulates according to its own scheduling results and maintains two pieces of information: (1) Average CPU usage of each resource node during the simulation process (CpuUse[m]); (2) The average memory usage of each resource node during the simulation, RamUse[m]; 2.4 Update pheromone matrix element M i,j value, including the following steps: (1) First, each element M i,j The value is diluted, that is, multiplied by the parameter p, 0 <p<1; (2) Among the t ants, find the ant bestAnt with the best scheduling result. The criteria are as follows: Find the minimum and maximum total task group completion time among all ants, calculate the CPU usage variance and memory usage variance of each node, and perform maximum and minimum normalization on the total task group completion time and resource usage variance of each ant; The scheduling result of each virtual ant is scored using the formula: Score = (1-normalized total completion time of task group) + load balancing score; Load balancing score = (1-normalized CPU usage variance) + (1-normalized memory usage variance) Select the ant with the highest score as bestAnt (3) bestAnt maintains the scheduling result Allocate[n][m]. If Allocate[i][j] = 1, that is, task i is assigned to resource node j, then M i,j The value is increased, that is, multiplied by the parameter q, q>1.