A cloud task scheduling method and device based on immune annealing algorithm

Through the cloud task scheduling method based on the immune annealing algorithm, the problems of low resource utilization and unbalanced load in cloud computing are solved, and task scheduling time is shortened and system performance is improved.

CN114647493BActive Publication Date: 2024-11-12NANJING UNIV OF POSTS & TELECOMM
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202210155048.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-02-21
Publication Date
2024-11-12
Estimated Expiration
2042-02-21

AI Technical Summary

Technical Problem

The existing cloud computing scheduling algorithms have problems such as low resource utilization, unbalanced load and long waiting time for long job tasks, making it difficult to effectively schedule cloud tasks.

Method used

The cloud task scheduling method based on the immune annealing algorithm is adopted to prevent the algorithm from falling into local optimization through the initialization of the annealing table parameter, the update of the antibody population and the optimization of the fitness function, and the convergence speed is improved through the oscillating cooling parameters.

Benefits of technology

It achieves shortening of task scheduling time, load balancing and fairness improvement, avoids the algorithm from falling into local optimization, and improves resource utilization and system performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114647493B_ABST
    Figure CN114647493B_ABST
Patent Text Reader

Abstract

The present invention provides a cloud task scheduling method based on the immune annealing algorithm. First, the system resource usage and task execution time are considered, and a multi-objective evaluation model including task execution time, system load balancing, and system fairness is constructed on the traditional model. Secondly, an improved simulated annealing scheduling algorithm based on the immune mechanism is proposed. By introducing the idea of ​​accepting bad solutions of the simulated annealing algorithm into the immune algorithm, some inferior solutions are allowed to be added to the mutation, so as to better maintain the diversity of the population and avoid falling into the local optimal solution. Then, the cooling parameters in the simulated annealing algorithm are oscillated, which shortens the task scheduling time, and provides a better feasible initial solution group according to the resources required for the task and the system load balancing degree, so as to better balance the load and fairness of the system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to a cloud task scheduling method and device based on an immune annealing algorithm, and belongs to the technical field. Background Art

[0002] Cloud computing is a technology that has emerged in recent decades. It uses the Internet and remote servers located in the center to store and process data and applications. It is a practical way to deliver IT needs to data centers in the future. Virtualization is the main key technology behind the cloud computing model. It supports dynamic sharing between the number of physical resources in the cloud data center. Virtualization is the division of physical resources based on the CPU, network bandwidth and memory of one or more virtual machines, breaking the indivisible barriers between physical structures, allowing users to use resources in a better combination than before.

[0003] Cloud computing usually uses the MapReduce model, such as Figure 1 As shown in the figure. First, the user's request is divided into multiple subtasks, and then the data center allocates the subtasks to each virtual machine, and then allocates the virtual machine to each physical host for computing. During the allocation process, the data center selects the appropriate virtual machine to provide the corresponding resources for the subtask according to the computing resource requirements of the subtask, such as network bandwidth and storage size, and finally returns the task to the user. Although splitting the task into multiple subtasks and mapping them to each virtual machine can efficiently respond to user requests, how to map the subtasks to the virtual machine and the virtual machine to the physical machine is an NP-hard problem that needs to be solved by a suitable scheduling algorithm. However, the existing scheduling algorithms on the cloud platform currently have some problems, such as the FIFO algorithm, which has a low resource utilization rate; the fair scheduling algorithm, which does not consider the load balance of resources, resulting in an unbalanced resource load on each slave node; the SJF algorithm, which will prioritize short job tasks, but may cause long job tasks to wait for too long and cannot be executed. Summary of the invention

[0004] The purpose of the present invention is to overcome the deficiencies in the prior art and provide an improved simulated annealing algorithm based on an immune mechanism, which can shorten the task scheduling time while ensuring that the algorithm avoids falling into a local optimum and improve the efficiency of task deployment.

[0005] To achieve the above object, the present invention is implemented by adopting the following technical solutions:

[0006] In a first aspect, the present invention provides a cloud task scheduling method based on an immune annealing algorithm, comprising the following steps:

[0007] Step A: Obtain annealing table parameters and initialize the annealing table parameters, which include initial temperature T0, cooling parameter α, maximum number of iterations L max , termination temperature T e ;

[0008] Step B: each feasible allocation scheme of a virtual machine to a task is regarded as an antibody, multiple antibodies form an antibody group, the fitness function is regarded as an antigen, the degree of binding between the antibody and the antigen is regarded as affinity, and the greater the affinity, the better the degree of binding between the antibody and the antigen; the allocation scheme is a randomly generated mapping scheme of feasible virtual machines to tasks;

[0009] Establish the mapping relationship between the virtual machine and each task, initialize the antibody group, and calculate the affinity between each antibody and the antigen in the initialized antibody group;

[0010] Step C: updating the antibody population according to whether the affinity of each antibody is higher than a threshold;

[0011] Step D: Cooling down the initial temperature, and updating the temperature and the number of iterations according to the following iterative formula;

[0012] T k+1 =α*T k (2)

[0013] L=L+1 (3)

[0014] Among them, T k+1 is the temperature value after the initial temperature is cooled k times, that is, the current temperature, α is the cooling parameter used to control the temperature drop rate, and L is the current number of iterations;

[0015] Step E: Calculate the affinity of the new population and arrange them from large to small, determine whether L has reached the maximum number of iterations or whether the current temperature has reached the target temperature. If the maximum number of iterations or the termination temperature is reached, terminate the algorithm to obtain the optimal solution; if the maximum number of iterations or the target temperature is not reached, continue to loop and enter step C.

[0016] As a further improvement of the present invention, a mapping relationship between a virtual machine and each task is established according to the allocation scheme, and each solution of the allocation scheme is regarded as an antibody to form an antibody group. The method for initializing the antibody group includes the following steps:

[0017] A first-in-first-out queue is formed according to the resource requirements of the tasks, and then the tasks are assigned one by one to the virtual machines with the current minimum workload that meet their resource requirements to form an initial solution;

[0018] Sort all virtual machines after all current tasks have been assigned in descending order according to the size of their workloads, and assign the task with the shortest expected completion time on the virtual machine with the current largest workload to the virtual machine with the smallest workload, thus forming a neighborhood solution for the current solution.

[0019] The operation is repeated to generate multiple neighborhood solutions, each initial solution or neighborhood solution is regarded as an antibody, and all antibodies are set as an initial antibody group.

[0020] As a further improvement of the present invention, the fitness function includes completion time, load balance and fairness of each virtual machine, and the method for calculating the affinity between each antibody and antigen in the initialized antibody group includes the following steps:

[0021] Step 2.1) Deploy each task to the corresponding virtual machine and perform binary encoding. There are n tasks and m virtual machines. Define x ij Assign the i-th task to the j-th virtual machine for execution. If the i-th task is executed on the j-th virtual machine, then x ij =1, otherwise x ij =0;

[0022] Step 2.2) The user issues a task request. The time required for each virtual machine to complete each task is T j ,in Compare the completion time of each virtual machine and get the maximum completion time of the system as follows:

[0023] Makespan=time s +max(T j );

[0024] Among them, time s is the task scheduling time, time ij is the time it takes for each task to complete. Task i is the task length of the ith task, in Mips j is the computing power of the jth virtual machine running the ith task.

[0025] Step 2.3) The workload of the virtual machine that completes the i-th task is V i :

[0026]

[0027] In the formula, C cpuj and C memj are the remaining CPU and memory resources on the jth virtual machine, R cpui and R memiare the CPU and memory resources required for the i-th task respectively; then the load balance of the system is B:

[0028]

[0029] In the formula, r j is the total workload on the jth virtual machine, is the average workload of all current virtual machines,

[0030] Step 2.4) The fairness function of the i-th task can be expressed as β is a constant, β∈(0,1]; then the fairness function of the whole system is expressed as

[0031] In the formula, E cpui and E memi A is the CPU and memory resources expected to be allocated to the i-th task, cpui and A memi The CPU and memory resources actually allocated to the i-th task;

[0032] The total fitness function is C(s) = μ1*Makespan+μ2*B+μ3*F, and the affinity function is

[0033]

[0034] Where aff(s) represents the affinity of the current antibody, Makespan represents the system completion time, B represents the system load balance, F represents the global fairness of the system, μ1, μ2, and μ3 are the weights of the above three indicators, and μ1+μ2+μ3=1.

[0035] As a further improvement of the present invention, the method for updating the antibody population according to whether the affinity of each antibody is higher than a threshold value includes:

[0036] Add high-quality antibodies with affinity above a certain threshold to the new population,

[0037] Mutate the antibody to obtain a new antibody:

[0038] child=parent1+γ*(parent2-parent1)

[0039] Among them, child is the new antibody produced by mutation, parent1 is the cloned high-quality antibody or low-quality antibody to be mutated, parent2 is a high-quality antibody randomly selected from the above, and γ is a proportional factor generated by a random number uniformly distributed on [0,1];

[0040] The probability P of a new antibody group accepting a solution mutation is:

[0041]

[0042] In the formula, aff(s) and They represent the affinity of the current antibody and the average affinity of all antibodies respectively. η is a custom threshold. The smaller the fitness function value should be, the greater the affinity between the antibody and the antigen, and the better the solution obtained. P is the probability that the new antibody group accepts the new solution. When the affinity of the antibody is less than the threshold, a random number ρ (0<ρ<1) is generated. If P>ρ, the difference solution is mutated.

[0043] As a further improvement of the present invention, the cooling parameter α satisfies the following formula:

[0044]

[0045] Where c is the oscillation period, i is the number of iterations, λ is the oscillation amplitude, and ω is the adjustment factor. The values ​​of λ and ω are different in different oscillation periods.

[0046] In a second aspect, the present invention provides a cloud task scheduling device based on an immune annealing algorithm, comprising:

[0047] Acquisition module: used to acquire annealing table parameters and initialize the annealing table parameters, which include initial temperature T0, cooling parameter α, maximum number of iterations L max , termination temperature T e ;

[0048] Computation module: used to regard each feasible allocation scheme of virtual machines to tasks as an antibody, multiple antibodies form an antibody group, the fitness function as an antigen, and the degree of binding between the antibody and the antigen as affinity. The greater the affinity, the better the degree of binding between the antibody and the antigen. The allocation scheme is a randomly generated mapping scheme of feasible virtual machines to tasks.

[0049] Establish the mapping relationship between the virtual machine and each task, initialize the antibody group, and calculate the affinity between each antibody and the antigen in the initialized antibody group;

[0050] Update module: used to update the antibody population according to whether the affinity of each antibody is higher than the threshold;

[0051] Cooling module: used to cool down the initial temperature and update the temperature and iteration times according to the following iterative formula;

[0052] T k+1 =α*T k

[0053] L=L+1

[0054] Among them, T k+1 is the temperature value after the initial temperature is cooled k times, that is, the current temperature, α is the cooling parameter used to control the temperature drop rate, and L is the current number of iterations;

[0055] Output module: used to calculate the affinity of the new population and arrange them from large to small, determine whether L has reached the maximum number of iterations or whether the current temperature has reached the target temperature. If the maximum number of iterations or the termination temperature is reached, the algorithm is terminated to output the optimal solution.

[0056] In a third aspect, the present invention provides a cloud task scheduling device based on an immune annealing algorithm, comprising a processor and a storage medium;

[0057] The storage medium is used to store instructions;

[0058] The processor is used to operate according to the instructions to execute the steps of the method described in the first aspect.

[0059] Compared with the prior art, the present invention has the following beneficial effects:

[0060] 1. The present invention adopts an improved simulated annealing scheduling algorithm based on the immune mechanism, and adds the idea of ​​accepting bad solutions of the simulated annealing algorithm into the immune algorithm to prevent the algorithm from falling into the local optimum;

[0061] 2. The present invention adopts oscillating cooling parameters, which improves the convergence speed of the algorithm while avoiding the loss of the optimal value of the objective function. It establishes the mapping relationship from tasks to virtual machines through continuous iteration, and provides a better feasible initial solution group based on the usage of virtual machine resources, so that the system can achieve better load balancing and fairness requirements. BRIEF DESCRIPTION OF THE DRAWINGS

[0062] Figure 1 It is the current cloud computing resource scheduling model.

[0063] Figure 2 This is a flow chart of the improved simulated annealing scheduling algorithm based on the immune mechanism of the present invention.

[0064] Figure 3 This is a schematic diagram of the cooling parameter α in the improved simulated annealing scheduling algorithm based on the immune mechanism of the present invention. DETAILED DESCRIPTION

[0065] The present invention will be further described below in conjunction with the accompanying drawings. The following embodiments are only used to more clearly illustrate the technical solution of the present invention, and cannot be used to limit the protection scope of the present invention.

[0066] Embodiment 1:

[0067] This embodiment provides a cloud task scheduling method based on the immune annealing algorithm, comprising the following steps:

[0068] Step 1) Figure 1 As shown, in the present invention, the mapping relationship between tasks and virtual machines is first determined. Each task is deployed to the corresponding virtual machine and binary encoding is performed. Assuming there are n tasks and m virtual machines, define x ij Assign the i-th task to the j-th virtual machine for execution. If the i-th task is executed on the j-th virtual machine, then x ij =1, otherwise x ij =0.

[0069] Step 2) The user issues a task request. The time required for each virtual machine to complete each task is T j ,in Compare the completion time of each virtual machine and get the maximum completion time of the system Makespan = time s +max(T j ).

[0070] Among them, time s is the task scheduling time, time ij is the time it takes for each task to complete. Task i is the task length of the ith task, in Mips j is the computing power of the jth virtual machine running the ith task.

[0071] Step 3) The workload of the virtual machine that completes the i-th task is V i , C cpuj and C memj are the remaining CPU and memory resources on the jth virtual machine, R cpui and R memi are the CPU and memory resources required by the i-th task, r j is the total workload on the jth virtual machine, is the average workload of all current virtual machines, The load balance of the system is

[0072] Step 4) Record E cpui and E memi A is the CPU and memory resources expected to be allocated to the i-th task, cpui and A memi is the CPU and memory resources actually allocated to the ith task. The fairness function of the ith task can be expressed as β is a constant, β∈(0,1]. Then the fairness function of the whole system is expressed as

[0073] Let the total fitness function be C(s) = μ1*Makespan+μ2*B+μ3*F, then the affinity function is Among them, Makespan represents the system completion time, B represents the system load balance, F represents the global fairness of the system, μ1, μ2, and μ3 are the weights of the above three indicators respectively, and μ1+μ2+μ3=1.

[0074] Step 5) After determining the fitness function and affinity, Figure 2 As shown in the figure, according to the process in the figure, the parameters of the annealing table are first initialized. The annealing table parameters include the initial temperature T0, the cooling parameter α, the maximum number of iterations L max , termination temperature T e ;

[0075] Step 6) Generate an initial population for the system. First, form a first-in-first-out queue according to the resource requirements of the tasks, and then assign the tasks one by one to the virtual machines with the current minimum workload that meet their resource requirements to form an initial solution. Then sort the virtual machines after all current tasks are assigned in descending order according to the workload size, and assign the tasks with the minimum expected completion time on the virtual machine with the current maximum workload to the virtual machine with the minimum current workload to form a neighborhood solution of the current solution. Repeat the operation to generate multiple neighborhood solutions, set the initial solution and multiple neighborhood solutions as an initial antibody population, and calculate the affinity of each antibody in the initial population.

[0076] Step 7) Determine whether the affinity of each antibody is higher than a threshold, add high-quality antibodies with affinity higher than a specific threshold to the new population, and then clone and mutate the high-quality antibodies and add the new antibodies to the new population; mutate the low-quality antibodies with affinity lower than a specific threshold with a certain probability P and add them to the new population, and update the antibody population.

[0077] child=parent1+γ*(parent2-parent1) (1)

[0078]

[0079] In the above formula (1), child is the new antibody produced by mutation, parent1 is the cloned high-quality antibody or low-quality antibody to be mutated, parent2 is a high-quality antibody randomly selected from the above, and γ is a proportional factor generated by a random number uniformly distributed on [0,1];

[0080] In the above formula (2), aff(s) and Respectively represent the affinity of the current antibody and the average affinity of all antibodies. In the present invention, the smaller the fitness function value should be, the greater the affinity between the antibody and the antigen, and the better the solution obtained. P is the probability of accepting a new solution. When the affinity of the antibody is less than the threshold, a random number ρ (0<ρ<1) is generated. If P>ρ, there is still a certain probability of mutating the difference solution. When the temperature T is getting lower and lower, the probability of accepting a worse solution is also getting lower and lower. η is a custom threshold, which can be determined according to the affinity standard you want.

[0081] Step 8) Cool down the current temperature and update the temperature and number of iterations according to the following formula;

[0082] T k+1 =α*T k (3)

[0083] L=L+1 (4)

[0084] Among them, T k+1 is the temperature value after the initial temperature is cooled k times, and α is the cooling parameter used to control the temperature drop rate. The cooling parameter α satisfies the following formula:

[0085]

[0086] Where c is the oscillation period, i is the number of iterations, λ is the oscillation amplitude, and ω is the adjustment factor. The values ​​of λ and ω should be slightly different in different oscillation periods. α generally ranges from (0.5, 0.99). When α is large, a better solution can be obtained, but the convergence speed of the algorithm will be greatly reduced. When α is small, the convergence speed of the algorithm is very fast, but it may miss the optimal solution. λ is the oscillation amplitude, and ω is the adjustment factor. The role of the two parameters is to control the range of α within (0.5, 0.99) to prevent the algorithm from running out of the problem domain.

[0087] like Figure 3 As shown, it is a schematic diagram of the improved cooling parameters of the present invention. Formula (5) is the improved cooling parameters proposed by the present invention. During the cooling process, a smaller cooling parameter value ensures the convergence speed of the algorithm, and a larger cooling parameter value ensures that the algorithm will not miss the optimal solution. Then the oscillation period is reduced, which facilitates global search and finding the local optimal solution.

[0088] Step 9) Calculate the affinity of the new population and arrange them from large to small to determine whether the maximum number of iterations or the target temperature has been reached. If the maximum number of iterations or the termination temperature has been reached, terminate the algorithm to obtain the optimal solution; if the maximum number of iterations or the target temperature has not been reached, continue to loop and enter step 7.

[0089] The present invention adopts an improved simulated annealing scheduling algorithm based on immune mechanism, which is a widely used heuristic random intelligent optimization algorithm. The immune algorithm has the characteristics of the human immune system, adopts a group search strategy, and selects some characteristic information or knowledge in the problem to be solved through iterative calculation to suppress the degradation phenomenon in the optimization process to obtain the optimal solution. The simulated annealing algorithm simulates the annealing process in the thermodynamic system, takes the objective function as the energy function, and slowly cools the variable temperature object to achieve the state with the lowest energy between molecules. In the simulated annealing algorithm, there are multiple discrete states, each state has a corresponding state energy, and thermal equilibrium is reached after a period of cooling. The simulated annealing algorithm is also a greedy algorithm, but a random factor is introduced in its process, and a solution that is worse than the current solution is accepted with a certain probability, so that the simulated annealing algorithm can jump out of the local optimal solution, and this probability will decrease as the temperature drops.

[0090] In summary, the present invention provides a cloud task scheduling method based on the immune annealing algorithm, which considers the system resource usage and task execution time, and constructs a multi-objective evaluation model including task execution time, system load balancing, and system fairness. The idea of ​​accepting bad solutions of the simulated annealing algorithm is added to the immune algorithm during the solution process to prevent the algorithm from falling into the local optimum. The oscillating cooling parameters are used to accelerate the convergence speed of the algorithm during the solution process, avoid skipping the optimal value, and consider the resource usage during the solution process. By providing a better feasible initial solution group, it not only ensures the load balancing and fairness of the system, but also can further shorten the task completion time.

[0091] Embodiment 2:

[0092] This embodiment provides a cloud task scheduling device based on an immune annealing algorithm, the device comprising:

[0093] Acquisition module: used to acquire annealing table parameters and initialize the annealing table parameters, which include initial temperature T0, cooling parameter α, maximum number of iterations L max , termination temperature T e ;

[0094] Computation module: used to regard each feasible allocation scheme of virtual machines to tasks as an antibody, multiple antibodies form an antibody group, the fitness function as an antigen, and the degree of binding between the antibody and the antigen as affinity. The greater the affinity, the better the degree of binding between the antibody and the antigen. The allocation scheme is a randomly generated mapping scheme of feasible virtual machines to tasks.

[0095] Establish the mapping relationship between the virtual machine and each task, initialize the antibody group, and calculate the affinity between each antibody and the antigen in the initialized antibody group;

[0096] Update module: used to update the antibody population according to whether the affinity of each antibody is higher than the threshold;

[0097] Cooling module: used to cool down the initial temperature and update the temperature and iteration times according to the following iterative formula;

[0098] T k+1 =α*T k

[0099] L=L+1

[0100] Among them, T k+1 is the temperature value after the initial temperature is cooled k times, that is, the current temperature, α is the cooling parameter used to control the temperature drop rate, and L is the current number of iterations;

[0101] Output module: used to calculate the affinity of the new population and arrange them from large to small, determine whether L has reached the maximum number of iterations or whether the current temperature has reached the target temperature. If the maximum number of iterations or the termination temperature is reached, the algorithm is terminated to output the optimal solution.

[0102] The device of this embodiment can execute the method described in the first embodiment.

[0103] Embodiment three:

[0104] The embodiment of the present invention also provides a cloud task scheduling device based on immune annealing algorithm, including a processor and a storage medium;

[0105] The storage medium is used to store instructions;

[0106] The processor is used to operate according to the instructions to execute the steps of the method described in embodiment 1.

[0107] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.

[0108] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

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

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

[0111] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the technical principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.

Claims

1. A cloud task scheduling method based on immune annealing algorithm, characterized in that: The steps include: Step A: Obtain annealing table parameters and initialize the annealing table parameters, which include initial temperature T0, cooling parameter α, maximum number of iterations L max , termination temperature T e ; Step B: each feasible allocation scheme of a virtual machine to a task is regarded as an antibody, multiple antibodies form an antibody group, the fitness function is regarded as an antigen, the degree of binding between the antibody and the antigen is regarded as affinity, and the greater the affinity, the better the degree of binding between the antibody and the antigen; the allocation scheme is a randomly generated feasible virtual machine to task mapping scheme; a mapping relationship between the virtual machine and each task is established, the antibody group is initialized, and the affinity between each antibody and the antigen in the initialized antibody group is calculated; Step C: updating the antibody population according to whether the affinity of each antibody is higher than a threshold; Step D: Cooling down the initial temperature, and updating the temperature and the number of iterations according to the following iterative formula; T k+1 =α*T k L=L+1 Among them, T k+1 is the temperature value after the initial temperature is cooled k times, that is, the current temperature, α is the cooling parameter used to control the temperature drop rate, and L is the current number of iterations; Step E: Calculate the affinity of the new population and arrange them from large to small, determine whether L has reached the maximum number of iterations or whether the current temperature has reached the target temperature, if so, output the optimal solution; if not, proceed to step C; The method of updating the antibody population according to whether the affinity of each antibody is higher than a threshold value includes: High-quality antibodies with affinity above a certain threshold are added to the new population; Mutate the antibody to obtain a new antibody: child=parent1+γ*(parent2-parent1) Among them, child is the new antibody produced by mutation, parent1 is the cloned high-quality antibody or low-quality antibody to be mutated, parent2 is a randomly selected high-quality antibody, and γ is a proportional factor generated by a random number uniformly distributed on [0,1]; The probability P of a new antibody group accepting a solution mutation is: In the formula, aff(s) and They represent the affinity of the current antibody and the average affinity of all antibodies respectively. η is a custom threshold. The smaller the fitness function value should be, the greater the affinity between the antibody and the antigen, and the better the solution obtained. P is the probability that the new antibody group accepts the new solution. When the affinity of the antibody is less than the threshold, a random number ρ is generated, where 0<ρ<1. If P>ρ, the difference solution is mutated.

2. The cloud task scheduling method based on immune annealing algorithm according to claim 1 is characterized in that: The method of establishing a mapping relationship between a virtual machine and each task and initializing an antibody group includes the following steps: A first-in-first-out queue is formed according to the resource requirements of the tasks, and then the tasks are assigned one by one to the virtual machines with the current minimum workload that meet their resource requirements to form an initial solution; Sort all virtual machines after all current tasks have been assigned in descending order according to the size of their workloads, and assign the task with the shortest expected completion time on the virtual machine with the current largest workload to the virtual machine with the smallest workload, thus forming a neighborhood solution for the current solution. The operation is repeated to generate multiple neighborhood solutions, each initial solution or neighborhood solution is regarded as an antibody, and all antibodies are set as an initial antibody group.

3. The cloud task scheduling method based on immune annealing algorithm according to claim 2 is characterized in that: The fitness function includes completion time, load balance and fairness of each virtual machine. The method for calculating the affinity between each antibody and antigen in the initialized antibody group includes the following steps: Binary code each task to be deployed to the corresponding virtual machine. There are n tasks and m virtual machines. Define x ij Assign the i-th task to the j-th virtual machine for execution. If the i-th task is executed on the j-th virtual machine, then x ij =1, otherwise x ij =0; Receive task requests from users. The time required for each virtual machine to complete each task is T j ,in Compare the completion time of each virtual machine and get the maximum completion time of the system as follows: Makespan=time s +max(T j ); Among them, time s is the task scheduling time, time ij is the time it takes for each task to complete. Task i is the task length of the ith task, in Mips j is the computing power of the jth virtual machine running the i-th task; The workload of the virtual machine that completes the i-th task is V i : In the formula, C cpuj and C memj are the remaining CPU and memory resources on the jth virtual machine, R cpui and R memi are the CPU and memory resources required for the i-th task respectively; the load balance of the computing system is B: In the formula, r j is the total workload on the jth virtual machine, is the average workload of all current virtual machines, The following formula calculates the fairness function of the entire system: Among them, the fairness function of the i-th task is β is a constant, β∈(0,1]; In the formula, E cpui and E memi A is the CPU and memory resources expected to be allocated to the i-th task, cpui and A memi The CPU and memory resources actually allocated to the i-th task; The total fitness function is C(s) = μ1*Makespan+μ2*B+μ3*F, then the affinity function is used to calculate the affinity of the current antibody: Where aff(s) represents the affinity of the current antibody, Makespan represents the system completion time, B represents the system load balance, F represents the global fairness of the system, μ1, μ2, and μ3 are the weights of the above three indicators, and μ1+μ2+μ3=1.

4. The cloud task scheduling method based on immune annealing algorithm according to claim 1 is characterized in that: The cooling parameter α satisfies the following formula: Where c is the oscillation period, i is the number of iterations, λ is the oscillation amplitude, and ω is the adjustment factor. The values ​​of λ and ω are different in different oscillation periods.

5. A cloud task scheduling device based on immune annealing algorithm, characterized in that: include: Acquisition module: used to acquire annealing table parameters and initialize the annealing table parameters, which include initial temperature T0, cooling parameter α, maximum number of iterations L max , termination temperature T e ; Calculation module: used to regard each feasible allocation scheme of virtual machines to tasks as an antibody, multiple antibodies form an antibody group, the fitness function as the antigen, and the degree of binding between the antibody and the antigen as the affinity, and the greater the affinity, the better the degree of binding between the antibody and the antigen; the allocation scheme is a randomly generated feasible virtual machine to task mapping scheme; establish a mapping relationship between the virtual machine and each task, initialize the antibody group, and calculate the affinity of each antibody in the initialized antibody group to the antigen; Update module: used to update the antibody population according to whether the affinity of each antibody is higher than the threshold; Cooling module: used to cool down the initial temperature and update the temperature and iteration times according to the following iterative formula; T k+1 =α*T k L=L+1 Among them, T k+1 is the temperature value after the initial temperature is cooled k times, that is, the current temperature, α is the cooling parameter used to control the temperature drop rate, and L is the current number of iterations; Output module: used to calculate the affinity of the new population and arrange them from large to small, determine whether L has reached the maximum number of iterations or whether the current temperature has reached the target temperature, and output the optimal solution if the maximum number of iterations or the termination temperature has been reached; The method of updating the antibody population according to whether the affinity of each antibody is higher than a threshold value includes: High-quality antibodies with affinity above a certain threshold are added to the new population; Mutate the antibody to obtain a new antibody: child=parent1+γ*(parent2-parent1) Among them, child is the new antibody produced by mutation, parent1 is the cloned high-quality antibody or low-quality antibody to be mutated, parent2 is a randomly selected high-quality antibody, and γ is a proportional factor generated by a random number uniformly distributed on [0,1]; The probability P of a new antibody group accepting a solution mutation is: In the formula, aff(s) and aff represent the affinity of the current antibody and the average affinity of all antibodies respectively, η is a custom threshold, the smaller the fitness function value should be, the greater the affinity between the antibody and the antigen, and the better the solution obtained; P is the probability that the new antibody group accepts the new solution. When the affinity of the antibody is less than the threshold, a random number ρ is generated, where 0<ρ<1. If P>ρ, the difference solution is mutated.

6. A cloud task scheduling device based on immune annealing algorithm, characterized in that: including processor and storage medium; The storage medium is used to store instructions; The processor is configured to operate according to the instructions to execute the steps of the method according to any one of claims 1 to 4.

Citation Information

Patent Citations

  • Cloud computing multi-target task scheduling method based on an EDA-GA hybrid algorithm

    CN109491761A

  • A cloud computing center-oriented high-efficient load balancing optimization scheduling method.

    CN109542619A

  • Cloud task scheduling method of load-based improved simulated annealing algorithm

    CN112954012A

  • Container cloud task scheduling optimization method based on triple-elite incubation algorithm

    CN113568704A