A multi-objective dynamic task scheduling method and system based on improved ant colony algorithm
By improving the ant colony algorithm, comprehensively considering task priority, execution time and load balancing, the problems of load imbalance and local optimization in cloud computing task scheduling are solved, and the timeliness of task allocation and resource utilization are improved.
Patent Information
- Application Number
- CN202111616181.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-27
- Publication Date
- 2025-02-07
- Estimated Expiration
- 2041-12-27
AI Technical Summary
The existing cloud computing task scheduling methods are difficult to take into account the real-time task and system performance, and there are load imbalance and local optimization problems.
The improved ant colony algorithm is adopted to achieve multi-objective dynamic task scheduling through pheromone update strategy and heuristic information optimization, comprehensively consider task priority, execution time and load balancing.
It improves the timeliness of task allocation and the utilization rate of computing resources, reduces task scheduling overhead, and realizes global multi-objective task optimization scheduling.
Smart Images

Figure CN114968510B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of cloud computing, and in particular relates to a multi-objective dynamic task scheduling method and system based on an improved ant colony algorithm. Background Art
[0002] With the popularization of mobile smart terminal devices and the improvement of network bandwidth and load performance, cloud computing, as a new type of parallel and distributed computing technology, has developed rapidly. In a cloud computing environment, users submit task requests, and the dispatch center allocates resources according to user requests, providing users with fast, on-demand and scalable data storage and computing services, and striving to maximize resource utilization.
[0003] Cloud computing task scheduling is the process of mapping tasks to available computing nodes to complete computing processing based on task characteristics and resource requirements. It is mainly divided into three steps: first, scheduling the tasks to be processed according to certain rules, that is, calculating the resources required for processing tasks according to the scheduling algorithm; second, assigning tasks to various computing nodes for processing through the cloud computing resource management center; third, returning the task-resource allocation plan of the user's requested task to the user. Due to the large variety and scale of tasks, different task scheduling strategies will directly affect the execution efficiency of user tasks and the efficiency of resource utilization in the cloud environment. Therefore, how to reasonably assign the requests submitted by users to computing nodes for processing and complete the reasonable scheduling of cloud computing tasks has become an urgent problem to be solved in the current cloud computing system.
[0004] Task scheduling in cloud computing is an NP-hard problem, and task scheduling based on heuristic algorithms is the mainstream method to solve this problem. However, this type of method mainly optimizes single goals such as shortening task execution time and minimizing execution cost, without considering performance problems caused by unbalanced load on system computing nodes and priorities of different types of tasks. When optimizing task scheduling, there are problems such as long search time and easy to fall into local optimality, which cannot take into account both the real-time requirements of user tasks and the performance requirements of the system. Summary of the invention
[0005] The technology of the present invention solves the problem: overcomes the shortcomings of the prior art, provides a multi-objective dynamic task scheduling method and system based on an improved ant colony algorithm, comprehensively considers factors such as the system computing node load capacity, task execution time and task priority, optimizes the pheromone update strategy and heuristic information in the basic ant colony algorithm to avoid local optimality and achieve rapid convergence, improves the timeliness of task allocation and the utilization rate of computing resources, reduces the cloud computing task scheduling overhead, and realizes global multi-objective task optimization scheduling.
[0006] In order to solve the above technical problems, the present invention discloses a multi-objective dynamic task scheduling method based on an improved ant colony algorithm, comprising:
[0007] Step 101, determining a number of tasks requested by a task request submitted by a user;
[0008] Step 102, split each requested task into a number of subtasks, and sort the subtasks of each task in ascending order according to the priority of each task to obtain a sequence of tasks to be scheduled;
[0009] Step 103, assigning the tasks to be scheduled in the task sequence to each computing node by sequential scheduling to obtain an initial task-computing node allocation scheme, and then calculating the task execution time and computing cluster load factor according to the characteristics of the task itself and the computing node capabilities as the preset task deadline and load balancing threshold;
[0010] Step 104, based on the improved ant colony algorithm, the tasks to be scheduled in the task sequence to be scheduled are allocated to the computing nodes for processing, and the optimal allocation scheme under the constraints of the preset task deadline and load balancing threshold is obtained to realize the scheduling of multi-objective dynamic tasks.
[0011] In the above-mentioned multi-objective dynamic task scheduling method based on the improved ant colony algorithm, the step 102 includes:
[0012] Sub-step 1021, topologically sorting the requested tasks, and increasing the number of subtasks of each task according to the order in which they enter the queue in the topological sorting, to obtain a plurality of topological sorting sequences; wherein the subtask with a smaller number is executed first;
[0013] Sub-step 1022, sorting the multiple topological sorting sequences obtained in sub-step 1021 in ascending order of number and task priority, thereby obtaining a sorted sequence of tasks to be scheduled; among which, sub-tasks with higher priorities for different tasks with the same number are placed at the front.
[0014] In the above-mentioned multi-objective dynamic task scheduling method based on the improved ant colony algorithm, the step 103 includes:
[0015] Sub-step 1031, mapping the task sequence to be scheduled to the computing node in ascending order of the computing node numbers to obtain an initial task-computing node allocation scheme;
[0016] Sub-step 1032, according to the computational load required by different tasks, the size of input and output files, and the CPU processing capacity, memory utilization, and network bandwidth parameters of the computing nodes, the completion time of each task under the initial task-computing node allocation scheme is calculated to obtain the maximum execution time required to complete all tasks, and the maximum execution time required to complete all tasks is set as the initial task deadline threshold;
[0017] Sub-step 1033, collects the CPU, memory and network bandwidth occupancy rates of each computing node, calculates the current load balancing degree of each node, thereby obtaining the overall load factor of the computing node cluster, and sets the cluster load factor as the initial load factor threshold.
[0018] In the above-mentioned multi-objective dynamic task scheduling method based on the improved ant colony algorithm, the step 104 includes:
[0019] Sub-step 1041, using the CPU processing capacity and network bandwidth parameters of the computing node to initialize the pheromone concentration of each computing node for the task, obtain the pheromone matrix, and initialize the ant colony;
[0020] In sub-step 1042, the ant colony starts to iterate, and the probability of each task in the task sequence to be scheduled being assigned to each computing node is calculated for all ants in the ant colony in turn. After obtaining the assignment probability, the tasks are assigned to the computing nodes for processing in a roulette manner. In the tth iteration, for a single ant ant in the ant colony, k Calculate each task t in the task sequence to be scheduled in turn i Assigned to each computing node v j The probability p ti,vj , and randomly select the next task to be scheduled t j , t j Add this ant to the taboo table tabu k until ant k The taboo table contains all the tasks to be scheduled. At this time, an ant completes the scheduling and generates a scheduling plan E k (t); Repeat this step until all q ants complete the task scheduling;
[0021] Sub-step 1043, locally updating the pheromone matrix according to the execution time of the single ant task scheduling scheme and the cluster load factor;
[0022] Sub-step 1044, after all ants have completed their task scheduling calculations in one iteration, compare the execution time and cluster load factor of each solution and select the best solution for both. As the optimal solution for this round of iteration, compared with the execution time and cluster load factor of the current optimal allocation solution, if If it is better, the optimal scheduling scheme, execution time and cluster load factor parameters are updated, otherwise, no update is performed; after this iteration, the global update of the pheromone matrix τ(t) is completed; repeat this step until the maximum number of iterations is reached;
[0023] Sub-step 1045, after the iteration is completed, it is determined whether the current optimal allocation plan is empty. If it is empty, the optimal task scheduling plan without the current execution time and load factor constraints is returned. Otherwise, the task distribution process is performed according to the optimal task scheduling plan.
[0024] Correspondingly, the present invention also discloses a multi-objective dynamic task scheduling system based on an improved ant colony algorithm, comprising:
[0025] A task determination module, used to determine a number of tasks requested by a task request submitted by a user;
[0026] The sorting module is used to split each requested task into several subtasks, and sort the subtasks of each task in ascending order according to the priority of each task to obtain a sequence of tasks to be scheduled;
[0027] The threshold determination module is used to allocate the tasks to be scheduled in the task sequence to each computing node by sequential scheduling, obtain the initial task-computing node allocation plan, and then calculate the task execution time and computing cluster load factor according to the characteristics of the task itself and the computing node capabilities as the preset task deadline and load balancing threshold;
[0028] The task scheduling module is used to allocate the tasks to be scheduled in the task sequence to the computing nodes for processing based on the improved ant colony algorithm, obtain the optimal allocation plan under the constraints of preset task deadlines and load balancing thresholds, and realize the scheduling of multi-objective dynamic tasks.
[0029] In the above multi-objective dynamic task scheduling system based on the improved ant colony algorithm, the sorting module includes:
[0030] The first sorting submodule is used to topologically sort the requested tasks, and to increase the number of subtasks of each task according to the order in which they enter the queue in the topological sorting, to obtain a number of topological sorting sequences; wherein the subtask with a smaller number is executed first;
[0031] The second sorting submodule is used to sort the topological sorting sequences obtained by the first sorting submodule in ascending order of number and task priority, so as to obtain a sorted sequence of tasks to be scheduled; among which, different tasks with the same number but with higher priority have the higher priority.
[0032] In the above-mentioned multi-objective dynamic task scheduling system based on the improved ant colony algorithm, the threshold determination module includes:
[0033] The allocation scheme determination submodule is used to complete the task-computing node mapping of the task sequence to be scheduled in ascending order of the computing node numbers to obtain the initial task-computing node allocation scheme;
[0034] The first threshold determination submodule is used to calculate the completion time of each task under the initial task-computing node allocation scheme according to the computational load required by different tasks, the size of input and output files, and the CPU processing capacity, memory utilization, and network bandwidth parameters of the computing nodes, and obtain the maximum execution time required to complete all tasks, and set the maximum execution time required to complete all tasks as the initial task deadline threshold;
[0035] The second threshold determination submodule is used to collect the CPU, memory and network bandwidth occupancy of each computing node, calculate the current load balancing degree of each node, thereby obtaining the overall load factor of the computing node cluster, and setting the cluster load factor as the initial load factor threshold.
[0036] In the above multi-objective dynamic task scheduling system based on the improved ant colony algorithm, the task scheduling module includes:
[0037] The initialization submodule is used to initialize the pheromone concentration of each computing node for the task using the CPU processing power and network bandwidth parameters of the computing node, obtain the pheromone matrix, and initialize the ant colony;
[0038] The task allocation submodule is used for the ant colony to start the iteration. For all the ants in the ant colony, the probability of each task in the task sequence to be scheduled being allocated to each computing node is calculated in turn. After obtaining the allocation probability, the tasks are allocated to the computing nodes for processing in a roulette manner. In the tth iteration, for a single ant in the ant colony, k Calculate each task t in the task sequence to be scheduled in turn i Assigned to each computing node v j Probability And randomly select the next task to be scheduled t j , t j Add this ant to the taboo table tabu k until ant k The taboo table contains all the tasks to be scheduled. At this time, an ant completes the scheduling and generates a scheduling plan E k (t); Repeat this module until all q ants complete the task scheduling;
[0039] The local update submodule is used to locally update the pheromone matrix according to the execution time of the task scheduling scheme of a single ant and the cluster load factor;
[0040] The comparison iterator module is used to iterate all ants once to calculate their task scheduling solutions, compare the execution time and cluster load factor of each solution, and select the best solution for both. As the optimal solution for this round of iteration, compared with the execution time and cluster load factor of the current optimal allocation solution, if If the optimal scheduling scheme, execution time and cluster load factor parameters are better, then the optimal scheduling scheme, execution time and cluster load factor parameters are updated; otherwise, no update is performed; after this iteration, the global update of the pheromone matrix τ(t) is completed; repeat this module until the maximum number of iterations is reached;
[0041] The task scheduling module submodule is used to determine whether the current optimal allocation plan is empty after the iteration is completed. If it is empty, it returns the optimal task scheduling plan without the constraints of the current execution time and load factor. Otherwise, it distributes tasks according to the optimal task scheduling plan.
[0042] The present invention has the following advantages:
[0043] The present invention discloses a multi-objective dynamic task scheduling method and system based on an improved ant colony algorithm, which comprehensively considers the multi-objective task scheduling that satisfies the priority of the calculation task, the task execution time and the system load balance, improves the timeliness of task allocation and the utilization rate of computing resources, and reduces the task scheduling overhead. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] Figure 1 is a flowchart of the steps of a multi-objective dynamic task scheduling method based on an improved ant colony algorithm in an embodiment of the present invention;
[0045] Figure 2 is an execution flow chart of a task sequence to be scheduled in an embodiment of the present invention;
[0046] Figure 3 is an execution flow chart of a task deadline and a cluster load factor in an embodiment of the present invention;
[0047] Figure 4 It is an execution flow chart of an optimal solution for task sequence scheduling in an embodiment of the present invention. DETAILED DESCRIPTION
[0048] In order to make the objectives, technical solutions and advantages of the present invention more clear, the embodiments disclosed in the present invention will be further described in detail below with reference to the accompanying drawings.
[0049] One of the core ideas of the present invention is to solve the problems of poor performance caused by unbalanced load of system computing nodes in current cloud computing task scheduling, failure to consider task priority, long search time and easy falling into local optimality when solving heuristic algorithms, etc. The present invention proposes a multi-objective dynamic task scheduling method based on an improved ant colony algorithm, which mainly includes the following steps: determining the scheduling sequence of independent subtasks, initializing task deadlines and cluster load factors, and calculating the optimal scheduling solution for the task sequence.
[0050] like Figure 1 In this embodiment, the multi-objective dynamic task scheduling method based on the improved ant colony algorithm includes:
[0051] Step 101: determine a number of tasks requested by a task request submitted by a user.
[0052] Step 102 , split each requested task into a number of subtasks, and sort the subtasks of each task in ascending order according to the priority of each task to obtain a sequence of tasks to be scheduled.
[0053] In this embodiment, step 102 may specifically include:
[0054] Sub-step 1021 , topologically sorting the requested tasks, and increasing the number of subtasks of each task according to the order in which they enter the queue in the topological sorting, to obtain a number of topological sorting sequences; wherein the subtask with a smaller number is executed first.
[0055] Sub-step 1022, sorting the multiple topological sorting sequences obtained in sub-step 1021 in ascending order of number and task priority, thereby obtaining a sorted sequence of tasks to be scheduled; among which, sub-tasks with higher priorities for different tasks with the same number are placed at the front.
[0056] The sequence of tasks to be scheduled obtained in step 102 may be used as input of step 103 .
[0057] Step 103, allocate the tasks to be scheduled in the task sequence to each computing node by sequential scheduling, obtain the initial task-computing node allocation plan, and then calculate the task execution time and computing cluster load factor according to the characteristics of the task itself and the computing node capabilities as the preset task deadline and load balancing threshold.
[0058] In this embodiment, step 103 may specifically include:
[0059] Sub-step 1031, mapping the task sequence to be scheduled to the computing nodes in ascending order of the computing node numbers is completed to obtain an initial task-computing node allocation scheme.
[0060] Sub-step 1032, calculates the completion time of each task under the initial task-computing node allocation scheme based on the amount of computing required for different tasks, the size of input and output files, and the CPU processing power, memory utilization, and network bandwidth parameters of the computing nodes, and obtains the maximum execution time required to complete all tasks, and sets the maximum execution time required to complete all tasks as the initial task deadline threshold.
[0061] Sub-step 1033, collects the CPU, memory and network bandwidth occupancy rates of each computing node, calculates the current load balancing degree of each node, thereby obtaining the overall load factor of the computing node cluster, and sets the cluster load factor as the initial load factor threshold.
[0062] The cluster load factor obtained in step 103 is set as an initial load factor threshold and can be used as an input of step 104 .
[0063] Step 104, based on the improved ant colony algorithm, the tasks to be scheduled in the task sequence to be scheduled are allocated to the computing nodes for processing, and the optimal allocation scheme under the constraints of the preset task deadline and load balancing threshold is obtained to realize the scheduling of multi-objective dynamic tasks.
[0064] In this embodiment, step 104 may specifically include:
[0065] Sub-step 1041, using the CPU processing capacity and network bandwidth parameters of the computing node to initialize the pheromone concentration of each computing node for the task, obtain the pheromone matrix, and initialize the ant colony.
[0066] In sub-step 1042, the ant colony starts iteration, and the probability of each task in the task sequence to be scheduled being assigned to each computing node is calculated for all ants in the ant colony in turn. After obtaining the assignment probability, the tasks are assigned to the computing nodes for processing in a roulette manner. In the tth iteration, for a single ant ant in the ant colony, k Calculate each task t in the task sequence to be scheduled in turn i Assigned to each computing node v j Probability And randomly select the next task to be scheduled t j , t j Add this ant to the taboo table tabu k until ant k The taboo table contains all the tasks to be scheduled. At this time, an ant completes the scheduling and generates a scheduling plan E k (t); Repeat this step until all q ants complete the task scheduling.
[0067] Sub-step 1043, locally updating the pheromone matrix according to the execution time of the single ant task scheduling solution and the cluster load factor.
[0068] Sub-step 1044, after all ants have completed their task scheduling calculations in one iteration, compare the execution time and cluster load factor of each solution and select the best solution for both. As the optimal solution for this round of iteration, compared with the execution time and cluster load factor of the current optimal allocation solution, if If it is better, the optimal scheduling scheme, execution time and cluster load factor parameters are updated, otherwise, no update is performed; after this iteration, the global update of the pheromone matrix τ(t) is completed; repeat this step until the maximum number of iterations is reached.
[0069] Sub-step 1045, after the iteration is completed, it is determined whether the current optimal allocation plan is empty. If it is empty, the optimal task scheduling plan without the current execution time and load factor constraints is returned. Otherwise, the task distribution process is performed according to the optimal task scheduling plan.
[0070] The result obtained by executing the above step 104 is the optimal scheduling solution for the several tasks requested by the task request submitted by the user this time. At this point, the multi-objective dynamic task scheduling process is completely completed.
[0071] Based on the above embodiment, a specific example is described below.
[0072] (1) Define the task scheduling model: assign m tasks to n computing nodes, m>n. Let m tasks be denoted by T = {t1, t2, ..., t m}, n computing nodes are denoted as V = {v1,v1,...,v n}. Then each task t i Use a directed acyclic graph to represent the partial order relationship of each subtask of the task, and have a priority attribute priority i .
[0073] This embodiment finally completes the scheduling of the independent subtasks. For convenience, each independent subtask sequence is still represented as T.
[0074] (2) Define the task-computing node scheduling scheme as an m×n dimensional matrix E:
[0075]
[0076] Among them, 1≤i≤m,1≤j≤n,e ij =0 / 1.
[0077] In order to solve the problem that single-objective optimization in current cloud computing task scheduling cannot meet the requirements of users and systems, the present invention proposes a multi-objective dynamic task scheduling method based on an improved ant colony algorithm, which comprehensively considers the computational cost, task execution time and load balancing of computing to meet task requirements, improves the timeliness of task allocation and the utilization rate of computing resources, and reduces the task scheduling overhead.
[0078] The multi-objective dynamic task scheduling method based on the improved ant colony algorithm mainly includes the following parts:
[0079] Part 1: Determine the sequence of tasks to be scheduled.
[0080] Determining the sequence of tasks to be scheduled refers to the process of splitting the task request submitted by the user into individual independent subtasks after obtaining it, and sorting the subtasks in ascending order according to the priority of the task, thereby generating the sequence of tasks to be scheduled. Figure 2 As shown, this section contains the following steps:
[0081] Step S110: multiple tasks T = {t1, t2, ..., t m} Perform topological sorting, and number the subtasks of each task in ascending order according to the order in which they enter the queue during topological sorting (the subtasks with smaller numbers need to be scheduled first).
[0082] Step S120: sort the multiple topological sorting sequences obtained in step S110 in ascending order of number and priority, and the higher the priority of different tasks with the same number, the higher the priority of the subtask, so as to obtain the sorted subtask sequence T' to be scheduled. For convenience, it is assumed that there are also m independent subtasks in T'.
[0083] The independent subtask scheduling sequence and computing node set obtained in the first part will serve as the input of the second part.
[0084] Part 2: Initializing task deadlines and cluster load factors
[0085] Initializing the task deadline and cluster load factor means: assigning the scheduled tasks to each computing node through sequential scheduling to obtain the initial task-computing node allocation plan, and then calculating the task execution time and computing cluster load factor based on the characteristics of the task itself and the computing node capabilities as the preset task deadline and load balancing threshold. Figure 3 As shown, this section contains the following steps:
[0086] Step S210: Set the independent subtask sequence to be scheduled T'={t1, t2, ..., t m} according to the calculation nodes V={v1,v1,...,vn}Complete the task-computing node mapping in ascending order and obtain the initial task-computing node allocation scheme E initial .
[0087] Step S220: According to different tasks t i The amount of computation required task_length i , input file size fileSize i , output file size outputSize i And each computing node v j CPU processing power mips j , memory utilization u j and network bandwidth parameter bw j , according to the formula t ij =te ij +ts ij +tr ij Calculate the time t for each computing node to complete the assigned task under the allocation scheme in step S210 ij ,in, It is the task i At node v j Actual execution time, ts ij =fileSize i / bw j and tr ij =outputSize i / bw j It is the transmission time required for the task to be sent to the computing node and returned from the computing node, and then the maximum execution time required to complete all tasks is obtained. (k is the number of tasks assigned to the computing nodes), set it as the initial task deadline threshold parameter makespan initial .
[0088] Step S230: Collect the CPU, memory and network bandwidth occupancy parameters P of each computing node t j ={mips t j ,mem t j ,bw t j} and the maximum computing storage parameter P of the computing node j ={mips j ,mem j ,bw j}, calculate the load balancing degree of each node j, and then calculate the standard deviation of the load level of each node as the overall load factor of the cluster, and set the cluster load factor to the initial load factor threshold parameter load initial The specific calculation formula is as follows:
[0089]
[0090] Among them, a single computing node v j The load level at the current time t (λ1+λ2+λ3=1).
[0091] The task deadline obtained in the first part makespan initial and calculate the cluster load factor parameter load initial , which will be used as input for the third part.
[0092] Part III: Calculating the optimal solution for task sequence scheduling
[0093] The optimal solution for scheduling computing task sequences refers to the process of using the improved ant colony algorithm to allocate the task sequences to be scheduled to the computing nodes for processing, obtaining the optimal allocation solution under the constraints of execution time and load factor, and ensuring the efficiency and results of scheduling. Figure 4 As shown, this section contains the following steps:
[0094] Step S310: Using the CPU processing capacity mips of the computing node j and network bandwidth parameter bw j Initialize each computing node v j For task t i Pheromone concentration Get the pheromone matrix τ(0), and initialize the number of ant colony iterations N, with the number of ants being q:
[0095]
[0096] Step S320: The ant colony starts iteration. In the tth iteration, for a single ant ant in the ant colony k Calculate each task t in the task sequence to be scheduled in turn i Assigned to each computing node v j Probability And randomly select the next task to be scheduled t j , t j Add this ant to the taboo table tabu k until ant k The taboo table contains all the tasks to be scheduled. At this time, an ant completes the scheduling and generates a scheduling plan E k(t). Repeat step S320 until all q ants complete the task scheduling:
[0097]
[0098] Among them, the heuristic function Represents a task t i Assign to compute node v j In order to increase the probability of selecting nodes with smaller loads and achieve system load balancing, the heuristic function is set to:
[0099]
[0100] Step S330: Calculate the number of ants in step S320 k Task Scheduling Solution Execution time and cluster load factor (t is the current iteration number), locally update the pheromone matrix τ(t):
[0101]
[0102] Among them, σ max and σ min To avoid premature convergence and localization, the upper and lower threshold parameters of pheromone are set. To achieve the increase of pheromone diffusion speed with the increase of ant iterations, the pheromone update rule is set as t is the number of iterations of the current ant, ρ is the pre-set pheromone volatility coefficient, is the pheromone overall diffusion rate constant, Indicates that task t is within time t i To the computing node v j Pheromone increment:
[0103]
[0104] is the task t generated by ant k in time t i To the computing node v j Pheromone increment:
[0105]
[0106] γPheromone adjustment factor added to reduce virtual machine overload and achieve load balancing of task allocation:
[0107]
[0108] Among them, ETC j is the computing node vj The execution time of the task in the last iteration, ETC ave It is the average value of tasks executed by all computing nodes in the previous iteration.
[0109] Step S340: In one iteration (iteration t), all ants complete their task scheduling calculations. Then, we compare the execution time of each solution. and cluster load factor Choose the best solution for both As the optimal solution for this round of iteration, compared with the execution time and cluster load factor of the current optimal allocation solution, if If the optimal scheduling scheme, execution time and cluster load factor parameters are better, then no update is performed. After this iteration, the global update of the pheromone matrix τ(t) is completed, and the calculation method of the update rule is as follows;
[0110]
[0111]
[0112] Repeat step S340 until the maximum number of iterations N is reached.
[0113] Step S350: After the iteration is completed, determine whether the current optimal allocation plan is empty. If it is empty, return the optimal task scheduling plan without the current execution time and load factor constraints. Otherwise, perform task distribution processing according to the optimal task scheduling plan.
[0114] The result obtained by executing the third part is the optimal scheduling plan for the task requested by the user this time, and the task scheduling process is now complete.
[0115] On the basis of the above embodiments, the present invention further discloses a multi-objective dynamic task scheduling system based on an improved ant colony algorithm, comprising:
[0116] The task determination module is used to determine a number of tasks requested by the task request submitted by the user.
[0117] The sorting module is used to split each requested task into several subtasks, and sort the subtasks of each task in ascending order according to the priority of each task to obtain a sequence of tasks to be scheduled.
[0118] The threshold determination module is used to allocate the tasks to be scheduled in the task sequence to each computing node through sequential scheduling, obtain the initial task-computing node allocation plan, and then calculate the task execution time and computing cluster load factor according to the characteristics of the task itself and the computing node capabilities as the preset task deadline and load balancing threshold.
[0119] The task scheduling module is used to allocate the tasks to be scheduled in the task sequence to the computing nodes for processing based on the improved ant colony algorithm, obtain the optimal allocation plan under the constraints of preset task deadlines and load balancing thresholds, and realize the scheduling of multi-objective dynamic tasks.
[0120] Preferably, the sorting module may specifically include: a first sorting submodule, used to topologically sort the requested tasks, and to increase the number of subtasks of each task according to the order in which they enter the queue in topological sorting, to obtain a number of topological sorting sequences; wherein, the subtask with a smaller number is executed first. A second sorting submodule, used to sort the topological sorting sequences obtained by the first sorting submodule according to the ascending order of number and the priority of the task, so as to obtain a sorted sequence of tasks to be scheduled; wherein, the subtask with the same number but a higher priority is placed first.
[0121] Preferably, the threshold determination module may specifically include: an allocation scheme determination submodule, which is used to complete the task-computing node mapping of the task sequence to be scheduled in ascending order of the computing node number, and obtain the initial task-computing node allocation scheme. The first threshold determination submodule is used to calculate the completion time of each task under the initial task-computing node allocation scheme according to the computing amount required for different tasks, the input and output file size, and the CPU processing capacity, memory utilization and network bandwidth parameters of the computing node, and obtain the maximum execution time required to complete all tasks, and set the maximum execution time required to complete all tasks as the initial task deadline threshold. The second threshold determination submodule is used to collect the CPU, memory and network bandwidth occupancy of each computing node, calculate the load balancing degree of each current node, thereby obtaining the overall load factor of the computing node cluster, and set the cluster load factor as the initial load factor threshold.
[0122] Preferably, the task scheduling module may specifically include: an initialization submodule, which is used to initialize the pheromone concentration of each computing node for the task using the CPU processing power and network bandwidth parameters of the computing node, obtain the pheromone matrix, and initialize the ant colony. A task allocation submodule, which is used to start the iteration of the ant colony, calculate the probability of each task in the task sequence to be scheduled to be allocated to each computing node in turn for all ants in the ant colony, and after obtaining the allocation probability, allocate the tasks to the computing nodes for processing in a roulette manner; wherein, in the tth round of iteration, for a single ant ant in the ant colony, k Calculate each task t in the task sequence to be scheduled in turn i Assigned to each computing node v j Probability And randomly select the next task to be scheduled tj , t j Add this ant to the taboo table tabu k until ant k The taboo table contains all the tasks to be scheduled. At this time, an ant completes the scheduling and generates a scheduling plan E k (t); Repeat this module until all q ants complete the task scheduling. The local update submodule is used to locally update the pheromone matrix according to the execution time and cluster load factor of the task scheduling plan of a single ant. The comparison iteration submodule is used to compare the execution time and cluster load factor of each plan after all ants have completed their task scheduling plans in one iteration, and select the best plan for both. As the optimal solution for this round of iteration, compared with the execution time and cluster load factor of the current optimal allocation solution, if If it is better, the optimal scheduling scheme and execution time and cluster load factor parameters are updated, otherwise, no update is performed; after this iteration, the global update of the pheromone matrix τ(t) is completed; this module is repeated until the maximum number of iterations is reached. The task scheduling module submodule is used to determine whether the current optimal allocation plan is empty after the iteration. If it is empty, the optimal task scheduling plan without the current execution time and load factor constraints is returned, otherwise the task distribution is processed according to the optimal task scheduling plan.
[0123] Although the present invention has been disclosed as above in the form of a preferred embodiment, it is not intended to limit the present invention. Any person skilled in the art may make possible changes and modifications to the technical solution of the present invention by using the methods and technical contents disclosed above without departing from the spirit and scope of the present invention. Therefore, any simple modifications, equivalent changes and modifications made to the above embodiments based on the technical essence of the present invention without departing from the content of the technical solution of the present invention shall fall within the protection scope of the technical solution of the present invention.
[0124] The contents not described in detail in the specification of the present invention belong to the common knowledge of the professionals in this field.
Claims
1. A multi-objective dynamic task scheduling method based on an improved ant colony algorithm, characterized in that: include: Step 101, determining a number of tasks requested by a task request submitted by a user; Step 102, split each requested task into a number of subtasks, and sort the subtasks of each task in ascending order according to the priority of each task to obtain a sequence of tasks to be scheduled; The step 102 includes: Sub-step 1021, topologically sorting the requested tasks, and increasing the number of subtasks of each task according to the order in which they enter the queue in the topological sorting, to obtain a plurality of topological sorting sequences; wherein the subtask with a smaller number is executed first; Sub-step 1022, sorting the topological sorting sequences obtained in sub-step 1021 in ascending order of number and task priority, thereby obtaining a sorted sequence of tasks to be scheduled; wherein, for different tasks with the same number, the sub-task with a higher priority is placed at the front; Step 103, assigning the tasks to be scheduled in the task sequence to each computing node by sequential scheduling to obtain an initial task-computing node allocation scheme, and then calculating the task execution time and computing cluster load factor according to the characteristics of the task itself and the computing node capabilities as the preset task deadline and load balancing threshold; The step 103 includes: Sub-step 1031, mapping the task sequence to be scheduled to the computing node in ascending order of the computing node numbers to obtain an initial task-computing node allocation plan; Sub-step 1032, according to the computational load required by different tasks, the size of input and output files, and the CPU processing capacity, memory utilization, and network bandwidth parameters of the computing nodes, the completion time of each task under the initial task-computing node allocation scheme is calculated to obtain the maximum execution time required to complete all tasks, and the maximum execution time required to complete all tasks is set as the initial task deadline threshold; Sub-step 1033, collecting the CPU, memory and network bandwidth occupancy rates of each computing node, calculating the current load balancing degree of each node, thereby obtaining the overall load factor of the computing node cluster, and setting the cluster load factor as the initial load factor threshold; Step 104, based on the improved ant colony algorithm, the tasks to be scheduled in the task sequence to be scheduled are allocated to the computing nodes for processing, and the optimal allocation scheme under the constraints of the preset task deadline and load balancing threshold is obtained to realize the scheduling of multi-objective dynamic tasks.
2. The multi-objective dynamic task scheduling method based on the improved ant colony algorithm according to claim 1 is characterized in that: The step 104 includes: Sub-step 1041, using the CPU processing capacity and network bandwidth parameters of the computing node to initialize the pheromone concentration of each computing node for the task, obtain the pheromone matrix, and initialize the ant colony; In sub-step 1042, the ant colony begins to iterate, and for all ants in the ant colony, the probability of each task in the task sequence to be scheduled being assigned to each computing node is calculated in turn. After obtaining the assignment probability, the tasks are assigned to the computing nodes for processing in a roulette manner; wherein, in the first In the round iteration, for a single ant in the ant colony Calculate each task in the task sequence to be scheduled in turn Assigned to each compute node Probability , and randomly select the next task to be scheduled ,Will Add to the taboo list of this ant until the ants The taboo table contains all the tasks to be scheduled. At this time, an ant completes the scheduling and generates a scheduling plan Repeat this step until all Only ants complete the task scheduling; Sub-step 1043, locally updating the pheromone matrix according to the execution time of the single ant task scheduling scheme and the cluster load factor; Sub-step 1044, after all ants have completed their task scheduling solutions in one iteration, compare the execution time and cluster load factor of each solution and select the best solution for both. As the optimal solution for this round of iteration, compared with the execution time and cluster load factor of the current optimal allocation solution, if If the optimal scheduling scheme, execution time and cluster load factor parameters are better, then update the optimal scheduling scheme, execution time and cluster load factor parameters; otherwise, no update is performed; after this iteration, the pheromone matrix is completed. Global update; repeat this step until the maximum number of iterations is reached; Sub-step 1045, after the iteration is completed, determine whether the current optimal allocation plan is empty. If it is empty, return the optimal task scheduling plan without the current execution time and load factor constraints. Otherwise, perform task distribution processing according to the optimal task scheduling plan.
3. A multi-objective dynamic task scheduling system based on improved ant colony algorithm, characterized in that: include: A task determination module, used to determine a number of tasks requested by a task request submitted by a user; The sorting module is used to split each requested task into several subtasks, and sort the subtasks of each task in ascending order according to the priority of each task to obtain a sequence of tasks to be scheduled; Sorting module, including: The first sorting submodule is used to topologically sort the requested tasks, and to increase the number of subtasks of each task according to the order in which they enter the queue in the topological sorting, so as to obtain a plurality of topological sorting sequences; wherein the subtask with a smaller number is executed first; The second sorting submodule is used to sort the topological sorting sequences obtained by the first sorting submodule in ascending order of number and task priority, so as to obtain a sorted sequence of tasks to be scheduled; wherein, the higher the priority of different tasks with the same number, the higher the priority of the subtask; The threshold determination module is used to allocate the tasks to be scheduled in the task sequence to each computing node by sequential scheduling, obtain the initial task-computing node allocation plan, and then calculate the task execution time and computing cluster load factor according to the characteristics of the task itself and the computing node capabilities as the preset task deadline and load balancing threshold; The task scheduling module is used to allocate the tasks to be scheduled in the task sequence to the computing nodes for processing based on the improved ant colony algorithm, obtain the optimal allocation plan under the constraints of the preset task deadline and load balancing threshold, and realize the scheduling of multi-objective dynamic tasks; A threshold determination module, comprising: The allocation scheme determination submodule is used to complete the task-computing node mapping of the task sequence to be scheduled in ascending order of the computing node numbers to obtain the initial task-computing node allocation scheme; The first threshold determination submodule is used to calculate the completion time of each task under the initial task-computing node allocation scheme according to the computational load required by different tasks, the size of input and output files, and the CPU processing capacity, memory utilization, and network bandwidth parameters of the computing nodes, and obtain the maximum execution time required to complete all tasks, and set the maximum execution time required to complete all tasks as the initial task deadline threshold; The second threshold determination submodule is used to collect the CPU, memory and network bandwidth occupancy of each computing node, calculate the current load balancing degree of each node, thereby obtaining the overall load factor of the computing node cluster, and setting the cluster load factor as the initial load factor threshold.
4. The multi-objective dynamic task scheduling system based on the improved ant colony algorithm according to claim 3 is characterized in that: Task scheduling module, including: The initialization submodule is used to initialize the pheromone concentration of each computing node for the task using the CPU processing power and network bandwidth parameters of the computing node, obtain the pheromone matrix, and initialize the ant colony; The task allocation submodule is used for the ant colony to start iteration. For all ants in the ant colony, the probability of each task in the task sequence to be scheduled being allocated to each computing node is calculated in turn. After obtaining the allocation probability, the tasks are allocated to the computing nodes for processing in a roulette manner. In the round iteration, for a single ant in the ant colony Calculate each task in the task sequence to be scheduled in turn Assigned to each compute node Probability , and randomly select the next task to be scheduled ,Will Add to the taboo list of this ant until the ants The taboo table contains all the tasks to be scheduled. At this time, an ant completes the scheduling and generates a scheduling plan ; Repeat this module until all Only ants complete the task scheduling; The local update submodule is used to locally update the pheromone matrix according to the execution time of the task scheduling scheme of a single ant and the cluster load factor; The comparison iterator module is used to iterate all ants once to calculate their task scheduling solutions, compare the execution time and cluster load factor of each solution, and select the best solution for both. As the optimal solution for this round of iteration, compared with the execution time and cluster load factor of the current optimal allocation solution, if If the optimal scheduling scheme, execution time and cluster load factor parameters are better, then update the optimal scheduling scheme, execution time and cluster load factor parameters; otherwise, no update is performed; after this iteration, the pheromone matrix is completed. Global update; repeat this module until the maximum number of iterations is reached; The task scheduling module submodule is used to determine whether the current optimal allocation plan is empty after the iteration is completed. If it is empty, it returns the optimal task scheduling plan without the constraints of the current execution time and load factor. Otherwise, it distributes tasks according to the optimal task scheduling plan.
Citation Information
Patent Citations
A cloud computing center-oriented high-efficient load balancing optimization scheduling method.
CN109542619A
Spark platform task scheduling method based on improved quantum ant colony algorithm
CN111459628A