A cloud computing task scheduling method based on MPA algorithm
By using a task scheduling method based on the MPA algorithm, and combining task and virtual machine information to optimize the scheduling strategy, the time and energy consumption problems of cloud computing tasks are solved, and more efficient task scheduling and energy utilization are achieved.
Patent Information
- Application Number
- CN202211657958.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-22
- Publication Date
- 2026-08-25
- Estimated Expiration
- 2042-12-22
AI Technical Summary
Existing technologies are insufficient to effectively reduce the completion time of cloud computing tasks and the energy consumption of cloud data centers, and they also suffer from local optima.
A task scheduling method based on the MPA algorithm is adopted. By reading task and virtual machine information, encoding virtual machines, calculating the execution time matrix, setting the initial population size and fitness function, and iteratively updating the individual positions, the optimal solution is found.
In cloud computing task scheduling, it reduces task completion time and cloud data center energy consumption, and has a strong ability to escape local optima and high accuracy.
Smart Images

Figure CN116382885B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of scheduling methods, and more specifically, to a cloud computing task scheduling method based on the MPA algorithm. Background Technology
[0002] With the increasing number of cloud users and IoT applications, the number of tasks carried in the cloud is growing explosively, necessitating a reasonable and effective task scheduling method to reduce task computation time and lower energy consumption in cloud data centers. This invention proposes a task scheduling method based on the MPA algorithm. This method sets the dimension of an individual to the number of tasks, and the value of each dimension of the individual to the virtual machine number. The population is initialized and a fitness function is set. Through continuous iteration, the optimal solution is sought to reduce task completion time and data center energy consumption. The algorithm proposed in this invention has the advantages of strong ability to escape local optima and high accuracy. Summary of the Invention
[0003] To overcome the aforementioned deficiencies of the prior art, embodiments of the present invention provide a cloud computing task scheduling method based on the MPA algorithm to solve the problems mentioned in the background art.
[0004] To achieve the above objectives, the present invention provides the following technical solution: a cloud computing task scheduling method based on the MPA algorithm, comprising the following steps:
[0005] Step 1: Read task and virtual machine information;
[0006] Step two: Encode the virtual machine;
[0007] Step 3: Calculate the execution time matrix;
[0008] Step 4: Set the initial population size;
[0009] Step 5: Set the fitness function;
[0010] Step 6: Calculate the fitness value of the individual and update the global optimal position and the individual's historical optimal position;
[0011] Step 7: Update the individual's current location;
[0012] Step 8: Determine the iteration termination condition. If the condition is met, output the optimal solution; otherwise, return to Step 6.
[0013] As a preferred technical solution of the present invention, in step one, reading task and virtual machine information means reading the number and load size of input tasks, as well as the number and processing speed of virtual machines.
[0014] As a preferred technical solution of the present invention, in step two, the method for encoding the virtual machines is as follows: number the M virtual machines from 1 to M, with each virtual machine corresponding to a number, that is, the input virtual machines are {VM1,VM2,VM3}, and the corresponding virtual machine numbers are {1,2,3}.
[0015] As a preferred embodiment of the present invention, in step three, the formula for calculating the execution time matrix is:
[0016]
[0017] Where E ij This represents the execution time of the i-th task on the j-th virtual machine.
[0018] As a preferred technical solution of the present invention, in step four, the value of initializing the population size is set to 50, the dimension of the individual is set to the number of tasks, that is, if the number of tasks is m, then the dimension of the individual is m, and the value of each dimension of the individual is set to a random virtual machine number.
[0019] In a preferred embodiment of the present invention, the expression for setting the fitness function in step five is as follows:
[0020] FitnessFunction=0.5*TEC+O.5*Makespan,
[0021] Where TEC represents the energy consumption of the cloud data center, and Makespan represents the maximum completion time of the virtual machine.
[0022] As a preferred technical solution of the present invention, in step six, the method for calculating the fitness value of an individual is: to calculate the TEC and Makespan of the current situation based on the individual's position, thereby calculating the fitness value at the current position.
[0023] As a preferred technical solution of the present invention, in step seven, the method for updating the individual's historical best position and global best position is as follows: the fitness value of the current individual is calculated and compared with the historical best fitness value of the individual. If it is less than the historical best fitness value, the current position is used to replace the historical best position and the current fitness value is used to replace the historical best fitness value. Otherwise, the historical best position and the historical best fitness value are retained. Finally, the historical best fitness values of all individuals are compared, and the historical best position with the smallest fitness value is set as the global best position. In step seven, the basis for updating the individual's current position is: the adjustment of the individual's current position is performed based on the global best position and the individual's historical best position.
[0024] As a preferred technical solution of the present invention, in step seven, the algorithm for updating the current position of an individual is as follows: when the number of iterations is one-third of the maximum number of iterations, the crowding degree of the individuals is calculated and ranked from smallest to largest. The top half of the individuals perform development in the second stage, and the bottom half of the individuals perform exploration. The expression for crowding degree is:
[0025]
[0026]
[0027] Where i represents the current individual, j represents the remaining individuals, and CD represents the crowding degree, the expression used in step seven for calculating the learning rate of an individual in the second stage is:
[0028]
[0029] Where N = 50, c = 0.05, e = 0.5, and Ranking[i] represents the crowding ranking of the i-th individual. In step seven, the current position of the individual is updated, and the step size scaling parameter for the first stage is set to P1, with the specific expression as follows:
[0030]
[0031] The step size scaling parameter for the second stage is set to P2, and the specific expression is:
[0032]
[0033]
[0034] The step scaling parameter for the third stage is set to P3, and the specific expression is:
[0035]
[0036] The technical effects and advantages of this invention are as follows: This invention can be used in cloud computing task scheduling to combine the dimension of an individual with the number of tasks, and combine the dimension value of an individual with the virtual machine number. The individual is initialized and its fitness function is set. During the continuous iteration process, the fitness value of the individual is calculated, and the historical best position and the global best position of the individual are updated. The individual adjusts its position according to the historical best position and the global best position. If the condition for the end of the iteration is met, the optimal solution is output to reduce the task completion time and the energy consumption of the cloud data center. Attached Figure Description
[0037] Figure 1 This is a flowchart of the present invention. Detailed Implementation
[0038] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.
[0039] As attached Figure 1 The cloud computing task scheduling method based on the MPA algorithm shown includes the following steps:
[0040] Step 1: Read task and virtual machine information;
[0041] Step two: Encode the virtual machine;
[0042] Step 3: Calculate the execution time matrix;
[0043] Step 4: Set the initial population size;
[0044] Step 5: Set the fitness function;
[0045] Step 6: Calculate the fitness value of the individual and update the global optimal position and the individual's historical optimal position;
[0046] Step 7: Update the individual's current location;
[0047] Step 8: Determine the iteration termination condition. If the condition is met, output the optimal solution; otherwise, return to step 6.
[0048] In step one, reading task and virtual machine information means reading the number and load of input tasks, as well as the number and processing speed of virtual machines. Specifically, assuming there are 9 input tasks, namely {T1,T2,T3,T4,T5,T6,T7,T8,T9}, and 3 available virtual machines, namely {VM1,VM2,VM3}, where the load of Ti is Wi, and the processing speed of virtual machine VMj is Sj.
[0049] In step two, the method for encoding the virtual machines is as follows: number the M virtual machines from 1 to M, with each virtual machine corresponding to a number. That is, if the input virtual machines are {VM1,VM2,VM3}, the corresponding virtual machine numbers are {1,2,3}. In specific operation, based on the assumptions of the previous step, the virtual machines are encoded, with VM1 numbered as 1, VM2 as 2, and VM3 as 3.
[0050] In step three, the formula used to calculate the execution time matrix is:
[0051]
[0052] Where Eij This represents the execution time of the i-th task on the j-th virtual machine. Specifically, based on the assumptions made in the previous step, the execution time matrix ETC is calculated. Each element in ETC...
[0053] In step four, the initial population size is set to 50. The dimension of each individual is set to the number of tasks; that is, if the number of tasks is m, then the dimension of the individual is m. The value of each dimension of the individual is set to a random virtual machine number. Specifically, based on the assumptions of the previous step, the population size is set to 50, the dimension of each individual is set to 9, and the number of iterations is Maxiter. Any individual is represented as... The set of values for Xi is {1,2,3}. Initializing an individual involves randomly selecting a virtual machine number from {1,2,3} as the value of X1, X2, X3, X4, X5, X6, X7, X8, X9. For example, {1,2,3,2,3,1,2,3,1} means that tasks T1, T2, T3, T4, T5, T6, T7, T8, and T9 are assigned to virtual machines numbered 1, 2, 3, 2, 3,1, 2, 3,1 respectively.
[0054] In step five, the expression used to set the fitness function is:
[0055] FitnessFunction=0.5*TEC+O.5*Makespan,
[0056] Where TEC represents the energy consumption of the cloud data center, Makespan represents the maximum completion time of the virtual machine. In specific operation, based on the assumptions of the previous step, Makespan, representing the maximum completion time of the virtual machine, is calculated using formulas (1) and (2), TEC, representing the total energy consumption, is calculated using formulas (3) and (4), and TEj represents the energy consumption of the j-th virtual machine.
[0057]
[0058] Makespan = max TV j (j=1,2,3) (2),
[0059] in
[0060] TE j =(TV) j ×α+(Makespan-TV j )×β)×S j (3),
[0061]
[0062] in α = 0.6 × β;
[0063] In step six, the method for calculating the fitness value of an individual is as follows: Calculate the TEC and Makespan of the individual in the current situation based on the individual's position, and then calculate the fitness value at the current position. Specifically, based on the assumptions of the previous step, calculate the TEC and Makespan of the individual using the individual's current position {X1, X2, X3, X4, X5, X6, X7, X8, X9} to obtain the FitnessFunction value. Compare this value with the previous historical best fitness value. If the fitness value is less than the historical best fitness value, replace the historical best fitness value with the current fitness value and replace the historical best position with the current position. Otherwise, continue to retain the individual's historical best position and the individual's historical best fitness value. Finally, compare the historical best fitness values of all individuals to obtain the global best position.
[0064] In step seven, the method for updating the individual's historical best position and global best position is as follows: The fitness value of the current individual is compared with its historical best fitness value. If the current fitness value is less than the historical best fitness value, the current position replaces the historical best position, and the current fitness value replaces the historical best fitness value. Otherwise, the historical best position and historical best fitness value are retained. Finally, the historical best fitness values of all individuals are compared, and the historical best position with the smallest fitness value is set as the global best position. The basis for updating the individual's current position in step seven is: adjusting the individual's current position based on the global best position and the individual's historical best position. The algorithm for updating the individual's current position in step seven is: when the number of iterations is one-third of the maximum number of iterations, the crowding of individuals is calculated and ranked from smallest to largest. The top half of the ranked individuals perform development in the second stage, and the bottom half perform exploration. The expression for crowding is:
[0065]
[0066]
[0067] Where i represents the current individual, j represents the remaining individuals, and CD represents the crowding degree, the expression used in step seven for calculating the learning rate of an individual in the second stage is:
[0068]
[0069] Where N = 50, c = 0.05, e = 0.5, and Ranking[i] represents the crowding ranking of the i-th individual. In step seven, the current position of the individual is updated, and the step size scaling parameter for the first stage is set to P1, with the specific expression as follows:
[0070]
[0071] The step size scaling parameter for the second stage is set to P2, and the specific expression is:
[0072]
[0073]
[0074] The step scaling parameter for the third stage is set to P3, and the specific expression is:
[0075]
[0076] Based on the content of step seven, in specific implementation, the position of the individual is updated according to the assumptions of the previous step. In the first stage, that is, when the number of iterations is less than one-third of the total number of iterations, i.e. Choose formulas (5) and (6) to update the individual's current position;
[0077]
[0078]
[0079] in, This represents the current globally optimal position. Indicates the step size of an individual. It is a vector containing normally distributed random numbers, with dimensions of 9. It is a normally distributed random number between [0,1], and P is a constant;
[0080] In the second stage, when the number of iterations is greater than one-third of the maximum number of iterations but less than two-thirds of the maximum number of iterations, the crowding level of individuals is calculated according to formula (7) and ranked. The learning rate of individuals is calculated using formula (8). The top half of the individuals are updated with their positions using formulas (9) and (10), and the bottom half are updated with their positions using formulas (11) and (12).
[0081]
[0082]
[0083]
[0084]
[0085]
[0086]
[0087] in It is a random number vector based on the Levy distribution, CF is an adaptive step size control parameter, which is calculated using formula (13), and c1 and c2 are calculated using formulas (14) and (15).
[0088]
[0089]
[0090]
[0091] In the third stage, when the number of iterations is greater than two-thirds of the maximum number of iterations but less than the maximum number of iterations, the position of the individual is updated using formulas (16) and (17).
[0092]
[0093]
[0094] The fitness value is calculated based on the updated position, and the individual's historical best position and global best position are updated.
[0095] External conditions are applied, meaning the individual updates its current position according to formula (18).
[0096]
[0097] Where FADs = 0.2, This represents the minimum value of 1 for each dimension. This indicates that the maximum value for each dimension is 3. Represents a binary number, i1 and i2 are random indices of an individual, R is a random number vector, and r is a random number in the range [0,1].
[0098] Finally, in step eight, determine the iteration termination condition. If the condition is met, output the optimal solution; otherwise, return to step six, which is to determine if the current iteration count is equal to the maximum iteration count. If yes, output the globally optimal position, i.e., the optimal task scheduling scheme; otherwise, continue iterating.
[0099] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus.
[0100] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.
Claims
1. A cloud computing task scheduling method based on the MPA algorithm, characterized in that, Includes the following steps: Step 1: Read task and virtual machine information; Step two: Encode the virtual machine; Step 3: Calculate the execution time matrix; Step 4: Set the initial population size; Step 5: Set the fitness function; Step 6: Calculate the fitness value of the individual and update the global optimal position and the individual's historical optimal position; Step 7: Update the individual's current location; Step 8: Determine the iteration termination condition. If the condition is met, output the optimal solution; otherwise, output the solution. If sufficient, return to step six; If the number of tasks is m, then the dimension of the individual is m, and the value of each dimension of the individual is set to a random virtual machine number; In step seven, the algorithm for updating the current position of an individual is as follows: when the number of iterations is one-third of the maximum number of iterations, the crowding degree of the individuals is calculated and they are ranked from smallest to largest. The top half of the ranked individuals perform development in the second stage, and the bottom half of the ranked individuals perform exploration. The expression for crowding degree is: , , , Where i represents the current individual, j represents the remaining individuals, and CD represents the crowding degree, the expression used in step seven for calculating the learning rate of an individual in the second stage is: , Where N=50, c=0.05, e=0.5, and Ranking[i] represents the crowding ranking of the i-th individual. In step seven, the current position of the individual is updated, and the step size scaling parameter for the first stage is set to P1, with the specific expression as follows: , The step size scaling parameter for the second stage is set to P2, and the specific expression is: , , The step scaling parameter for the third stage is set to P3, and the specific expression is: 。 2. The cloud computing task scheduling method based on the MPA algorithm according to claim 1, characterized in that: In step one, reading task and virtual machine information means reading the number and load size of input tasks, as well as the number and processing speed of virtual machines.
3. The cloud computing task scheduling method based on the MPA algorithm according to claim 2, characterized in that: In step two, the method for encoding the virtual machines is as follows: number the M virtual machines from 1 to M, with each virtual machine corresponding to a number. That is, the input virtual machines are {VM1, VM2, VM3}, and the corresponding virtual machine numbers are {1, 2, 3}.
4. The cloud computing task scheduling method based on the MPA algorithm according to claim 3, characterized in that: In step three, the formula used to calculate the execution time matrix is: , in This represents the execution time of the i-th task on the j-th virtual machine.
5. The cloud computing task scheduling method based on the MPA algorithm according to claim 4, characterized in that: In step four, the initial population size is set to 50, and the individual dimension is set to the number of tasks.
6. The cloud computing task scheduling method based on the MPA algorithm according to claim 5, characterized in that: In step five, the expression used to set the fitness function is: , Where TEC represents the energy consumption of the cloud data center, and Makespan represents the maximum completion time of a virtual machine.
7. The cloud computing task scheduling method based on the MPA algorithm according to claim 6, characterized in that: In step six, the method for calculating the fitness value of an individual is to calculate the TEC and Makespan of the current situation based on the individual's position, thereby calculating the fitness value at the current position.
8. The cloud computing task scheduling method based on the MPA algorithm according to claim 7, characterized in that: In step seven, the method for updating the individual's historical best position and global best position is as follows: the fitness value of the current individual is calculated and compared with its historical best fitness value. If the fitness value is less than the historical best fitness value, the current position replaces the historical best position, and the current fitness value replaces the historical best fitness value. Otherwise, the historical best position and historical best fitness value are retained. Finally, the historical best fitness values of all individuals are compared, and the historical best position with the smallest fitness value is set as the global best position. In step seven, the basis for updating the individual's current position is: the adjustment of the individual's current position is performed based on the global best position and the individual's historical best position.
Citation Information
Patent Citations
Optimization implementation method of butterfly algorithm
CN111814947A
Cloud computing task scheduling method and device based on one-dimensional grey wolf algorithm and storage medium
CN115145694A