A method for determining priority of cloud computing task scheduling based on genetic algorithm
By applying the task scheduling priority determination method based on genetic algorithm in the cloud computing environment, the problems of low task scheduling efficiency and low resource utilization in the prior art are solved, and efficient and flexible task scheduling and resource utilization are achieved.
Patent Information
- Application Number
- CN202411054796.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-02
- Publication Date
- 2025-04-11
- Estimated Expiration
- 2044-08-02
AI Technical Summary
The prior art is difficult to effectively schedule tasks in dynamic and complex cloud computing environments, resulting in low resource utilization and low task execution efficiency.
The cloud computing task scheduling priority determination method based on genetic algorithm is adopted. By obtaining task information and resource status information, initializing genetic algorithm parameters, calculating fitness values, selecting excellent individuals for crossing and mutating, updating populations until convergence conditions are reached, and the optimal task scheduling scheme is output.
It significantly improves the efficiency and resource utilization of task scheduling, enhances the adaptability and flexibility of the scheduling scheme, shortens the convergence time of the algorithm, and can find the optimal scheduling scheme in a short time.
Smart Images

Figure CN118963953B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of cloud computing, and in particular to a method for determining cloud computing task scheduling priorities based on a genetic algorithm. Background Art
[0002] The development of cloud computing technology has provided strong support for large-scale data processing and efficient resource utilization. With the popularization of cloud computing applications, how to effectively schedule tasks in a dynamic and complex cloud computing environment has become a key issue to improve system performance and resource utilization. Existing task scheduling algorithms usually face multiple challenges and limitations when processing tasks in a cloud computing environment.
[0003] The task scheduling algorithms in the prior art mainly include static scheduling algorithms and dynamic scheduling algorithms. The static scheduling algorithm has already determined the task scheduling scheme before the scheduling begins, and will not be adjusted according to changes in the environment. Typical static scheduling algorithms include the first-come-first-served algorithm and the shortest job first algorithm. These algorithms can achieve good results in a fixed environment, but in a dynamically changing environment such as cloud computing, they lack adaptability and are difficult to cope with real-time changes in task load and resource status, which easily leads to low resource utilization and low task execution efficiency.
[0004] Dynamic scheduling algorithms make adjustments based on real-time environmental information during the scheduling process, such as the earliest deadline priority algorithm and the dynamic priority scheduling algorithm. These algorithms can adapt to environmental changes to a certain extent, but due to their high complexity and the fact that they can only optimize a single goal (such as task completion time or resource utilization), they are unable to cope with multi-objective optimization problems. In addition, these algorithms usually rely on accurate task and resource information. In a cloud computing environment, it is not easy to obtain accurate information, and the uncertainty of information further reduces the effectiveness and robustness of the algorithm. Summary of the invention
[0005] One object of the present invention is to propose a method for determining cloud computing task scheduling priorities based on a genetic algorithm. The present invention not only improves the adaptability and flexibility of the scheduling scheme, but also accelerates the convergence speed of the algorithm through efficient selection, crossover and mutation strategies, ensuring that the optimal scheduling scheme can be found in a relatively short time.
[0006] A method for determining cloud computing task scheduling priority based on a genetic algorithm according to an embodiment of the present invention comprises the following steps:
[0007] S1. Obtain task information and resource status information in the cloud computing environment, and input the task set to be scheduled and the available computing resource set into the system;
[0008] S2. Initialize the genetic algorithm parameters, including population size, crossover probability, mutation probability and evolutionary generations, and randomly generate the initial population. Each individual represents a task scheduling scheme, and each task scheduling scheme includes the priority allocation of cloud computing tasks.
[0009] S3. Calculate the fitness value of each individual. The fitness function comprehensively considers performance indicators such as task completion time, resource utilization, and task waiting time to evaluate the scheduling plan of each individual.
[0010] S4, select excellent individuals for mating based on fitness values, and use the improved tournament selection algorithm to select individuals, so that the selected individuals have higher fitness in priority allocation;
[0011] S5. Perform a crossover operation on the selected individuals and generate new individuals using a multi-point crossover method. The new individuals inherit the priority allocation characteristics of the parent individuals and optimize the priority allocation of cloud computing task scheduling during the generation process.
[0012] S6. Perform mutation operations on the newly generated individuals, and use gene mutation strategies to randomly change part of the gene values of the individuals, including the adjustment of cloud computing task priorities;
[0013] S7, update the population, and form a new generation population with the newly generated individuals and the retained excellent individuals. Each individual in the new generation population contains the optimized cloud computing task priority allocation;
[0014] S8, check whether the preset evolutionary number is reached or the convergence condition is met. If not, return to step S3, continue iteration, and further optimize the cloud computing task priority;
[0015] S9, outputting the optimal cloud computing task scheduling scheme, determining the priority of each cloud computing task according to the gene sequence of the optimal individual, and allocating the cloud computing tasks to the corresponding computing resources for execution in order of priority;
[0016] S10. Dynamically monitor the task load and resource status in the cloud computing environment, adjust the genetic algorithm parameters in real time, and re-determine the task scheduling priority to correspond to the changes in the cloud computing environment.
[0017] Optionally, the S1 specifically includes the following sub-steps:
[0018] S11, obtaining task information in the cloud computing environment, including the task ID, task type, task size, task deadline, and task dependency of each task;
[0019] S12, obtaining resource status information in the cloud computing environment, including resource ID, resource type, resource capacity, resource load and resource available time of each computing resource;
[0020] S13, inputting the task set T to be scheduled and the available computing resource set R into the system;
[0021] S14. Constructing task information matrix M T and resource status matrix M R , where the task information matrix M T The dimension is n×k, each row represents the attribute of a task, and the resource status matrix M R The dimension is m×l, each row represents the attribute of a resource, k and l are the number of attributes of tasks and resources respectively;
[0022] S15. Define the task priority allocation matrix P T , whose dimension is n×1, indicating the priority of each task;
[0023] S16, preprocessing the acquired task information and resource status information, including data cleaning, standardization and format conversion;
[0024] S17, the preprocessed task information matrix M T and resource status matrix M R Stored in the system database.
[0025] Optionally, S2 specifically includes the following sub-steps:
[0026] S21, initialize genetic algorithm parameters, set population size N, crossover probability P c , mutation probability P m and evolutionary generation G, where N is the number of task scheduling solutions in the initial population, P c is the probability of crossover operations between task scheduling schemes, P m is the probability of mutation of the task scheduling scheme gene, G is the maximum evolutionary generation of the genetic algorithm;
[0027] S22. Randomly generate an initial population P(0), each individual represents a task scheduling scheme, each individual is composed of a gene sequence of length n, and each gene in the gene sequence represents the priority allocation of a cloud computing task.
[0028] Optionally, the calculation of the fitness value of each individual includes defining a fitness function f(x) for each task scheduling scheme, which is used to evaluate the pros and cons of the individual, and the fitness function comprehensively considers the performance indicators of task completion time, resource utilization and task waiting time:
[0029] f(x)=w 1 Task completion time (x) + w 2 Resource utilization (x) + w 3Task waiting time (x);
[0030] Among them, w 1 ,w 2 ,w 3 is the weight coefficient of different performance indicators, and x is the task scheduling scheme;
[0031] Calculate the task completion time of each task scheduling scheme. The task completion time (x) is defined as the nonlinear weighted sum of all task completion times, taking into account the priority of the task and the execution complexity of the task. Its expression is:
[0032]
[0033] Among them, C i is the completion time of the ith task, P i is the priority of the ith task, E i is the execution complexity of the i-th task, α is the adjustment factor, and n is the number of tasks;
[0034] Calculate the resource utilization of each task scheduling scheme. Resource utilization (x) is defined as the weighted utilization of all computing resources during the scheduling period, taking into account resource load balancing and resource utilization fluctuations. Its expression is:
[0035]
[0036] Among them, U j is the utilization rate of the jth computing resource, P j is the priority of the jth computing resource, V j is the utilization fluctuation of the jth computing resource, β is the adjustment factor, and m is the number of resources;
[0037] The task waiting time (x) of each task scheduling scheme is calculated, which is defined as the sum of the nonlinear weighted waiting time of all tasks from the time they arrive at the system to the time they start executing, taking into account the priority and importance of the tasks. The expression is:
[0038]
[0039] Among them, W i is the waiting time of the ith task, P i is the priority of the ith task, is the importance of the i-th task, γ is the adjustment factor, and n is the number of tasks.
[0040] Optionally, the S4 specifically includes the following sub-steps:
[0041] S41, calculating the fitness value f(x) of each individual in the initial population, and sorting the individuals in the population according to the fitness value;
[0042] S42. A dynamically improved tournament selection algorithm based on the characteristics of the cloud computing platform is used for individual selection. The tournament size k(t) is dynamically adjusted in each selection process, where k(t) is adjusted as the cloud computing task load and resource status change dynamically:
[0043]
[0044] Where k(t) is the tournament size of the current generation t, k 0 is the initial tournament size, Δk is the adjustment factor used to adjust the tournament size according to resource load changes, L j (t) is the load of the jth resource in the tth generation, indicating the current load of each resource in the cloud platform, and m is the number of resources;
[0045] S43. In each tournament, the individual with the highest fitness value is selected from the k(t) individuals as the parent individual and added to the parent individual set P parents middle:
[0046]
[0047] Among them, P parents (t) is the set of parent individuals of the tth generation, P selected (t) is the set of individuals selected in the tth generation, and f(x) is the fitness value of the individual;
[0048] S44, repeat steps S42 and S43 until the parent individual set P parents The size of reaches half of the population size N, that is,
[0049]
[0050] Where N is the population size, |P parents (t)| is the size of the set of individuals in the t-th generation parent generation;
[0051] S45, for the parent individual set P parents Check the priority allocation of individuals in to ensure that each selected individual has a high fitness in the priority allocation of cloud computing tasks:
[0052]
[0053] Among them, threshold is the set fitness value threshold, which ensures that the selected parent individuals have higher fitness in priority allocation;
[0054] S46, in the parent individual set P parentsTwo individuals are randomly selected for mating, and two offspring individuals are generated using a dynamic crossover strategy based on task dependency and resource status. The offspring individuals are added to the offspring individual set P offspring middle.
[0055] Optionally, the S46 specifically includes the following sub-steps:
[0056] S461, in the parent individual set P parents (t) randomly select two individuals x 1 and x 2 , represents two task scheduling schemes;
[0057] S462. Define a task dependency matrix D, whose dimension is n×n, where D ij =1 indicates task t i Depends on task t j , D ij =0 means task t i and task t j There is no dependency between them, n is the number of tasks;
[0058] S463, define a current resource state matrix R(t), whose dimension is m×p, representing the resource state in the tth generation, where m is the number of resources and p is the number of state attributes of each resource;
[0059] S464、Design of dynamic crossover strategy function DMOC(x based on multi-objective optimization 1 ,x 2 ,R(t),D):
[0060] Multi-objective fitness evaluation: The NSGA-II algorithm is introduced to perform multi-objective fitness evaluation on the task scheduling scheme, considering multiple performance indicators such as task completion time, resource utilization, and task waiting time, and calculating the Pareto frontier fitness of each individual ParetoFitness(x):
[0061] ParetoFitness(x)=[f 1 (x),f 2 (x),f 3 (x)];
[0062] Among them, f 1 (x) is the task completion time, f 2 (x) is the resource utilization rate, f 3 (x) is the task waiting time;
[0063] Intelligent crosspoint selection: Combined with the resource status and network latency of the cloud computing platform, multiple crosspoints are dynamically selected to ensure that crosspoint operations are reduced on high-load resource nodes and increased on low-load nodes:
[0064]
[0065] Among them, L j (t is the load of the j-th resource in the t-th generation, SelectPoints(x,y) is the intersection selection function based on resource load;
[0066] Multi-point crossover and fitness guidance: In individual x 1 and x 2 Select multiple crossover points in the gene sequence and use a multi-point crossover method guided by multi-objective fitness to generate two new individuals x′ 1 and x′ 2 , the gene sequence of the new individual represents the new task scheduling priority allocation:
[0067] x′ 1 =[g′ 1 ,g′ 2 ,…,g′ k ],x′ 2 =[g″ 1 ,g″ 2 ,…,g″ k ];
[0068] Among them, g i ' and g″ i It is the gene segment after crossover. During the crossover process, high fitness segments are preferentially retained;
[0069] Dynamic network transmission optimization: Based on the network transmission delay and bandwidth information of the cloud platform, the network transmission of the generated new individuals is optimized, and the task scheduling scheme is adjusted to minimize the network transmission time:
[0070]
[0071] Among them, T net (t i , R(t)) is task t i Network transmission time under resource state R(t);
[0072] Resource adaptability check: for the generated new individual x′ 1 and x′ 2 Perform resource adaptability check to ensure that the task scheduling scheme of the new individual under the current resource state R(t) has high adaptability and complies with the constraints of the task dependency matrix D:
[0073] CheckAdaptability(x,R(t),D)≥threshold;
[0074] Among them, CheckAdaptability(x',R(t),D) is the adaptability check function, which ensures that the fitness of the new individual is not lower than the set threshold;
[0075] S465, the two offspring individuals x' generated 1 and x′ 2 Add to the collection of offspring individuals.
[0076] Optionally, the S6 specifically includes the following sub-steps:
[0077] S61. Define the gene mutation probability P for each newly generated individual m , represents the probability of individual gene mutation, set P m The initial value of the cloud computing environment is adjusted according to the dynamic changes of the cloud computing environment;
[0078] S62, perform gene mutation operation on each newly generated individual x, and each gene g in the gene sequence i With probability P m (t) mutation, the mutation process uses random selection to change the gene g i Randomly change to another task priority value:
[0079]
[0080] Among them, g i ' is the gene value after mutation, Random{P T ) represents the task priority assignment matrix P T Randomly select a priority value in;
[0081] S63, evaluate the fitness of the mutated individual x', and recalculate its fitness value f(x') to ensure that the mutated individual has a higher fitness in task priority allocation;
[0082] S64. Perform task dependency check on the mutated individuals to ensure that the priority allocation of each task complies with the constraints of the task dependency matrix D:
[0083]
[0084] Among them, t i and t j is a task in the task set T, and They are task t i and t j Priority, Dij are the elements of the task dependency matrix;
[0085] S65. Add the mutant individuals that have passed the fitness evaluation and task dependency check to the new population to ensure that each individual in the new population has a high fitness in task priority allocation.
[0086] Optionally, the S9 specifically includes the following sub-steps:
[0087] S91. In the evolution process of the genetic algorithm, the individual with the highest fitness value is selected in each generation as the optimal individual of the current generation, and the gene sequence G of the optimal individual is recorded. best ;
[0088] S92, after reaching the preset evolutionary number or satisfying the convergence condition, select the global optimal individual G global , whose gene sequence represents the optimal task scheduling scheme;
[0089] S93, according to the optimal individual G global The gene sequence of 1 ,g 2 ,…,g n ]Determine the priority of each cloud computing task T , where g i Indicates the priority value of the i-th task:
[0090]
[0091] Among them, P Ti is the priority of the i-th task, and n is the number of tasks;
[0092] S94. Sort the cloud computing tasks in order of priority, and arrange the tasks from high to low priority to form a task scheduling queue Q T ;
[0093] S95, according to the resource status information matrix, the task scheduling queue Q T The tasks in are assigned to the corresponding computing resources in order for execution:
[0094]
[0095] Among them, R assign (t i ) is task t i The allocated computing resource, Load(r) is the current load of computing resource r;
[0096] S96, record the task allocation plan and generate a cloud computing task scheduling plan table S schedule, including each task’s ID, priority, assigned computing resource ID, and estimated completion time;
[0097] S97, monitor the task execution process, record the task execution status and resource usage in real time, and ensure that the task is completed according to the scheduling schedule S schedule If an abnormal situation occurs during execution, the task scheduling plan is dynamically adjusted to ensure the effectiveness and robustness of the scheduling.
[0098] The beneficial effects of the present invention are:
[0099] Through the global search and optimization capabilities of genetic algorithms, the present invention can dynamically adapt to changes in task load and resource status in a complex and changeable cloud computing environment, and realize comprehensive optimization of multiple performance indicators such as task completion time, resource utilization and task waiting time through a multi-objective fitness function, thereby significantly improving the efficiency of task scheduling and resource utilization. It not only improves the adaptability and flexibility of the scheduling scheme, but also accelerates the convergence speed of the algorithm through efficient selection, crossover and mutation strategies, ensuring that the optimal scheduling scheme can be found in a relatively short time. BRIEF DESCRIPTION OF THE DRAWINGS
[0100] The accompanying drawings are used to provide a further understanding of the present invention and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the present invention and do not constitute a limitation of the present invention. In the accompanying drawings:
[0101] Figure 1 This is a flow chart of a method for determining cloud computing task scheduling priority based on a genetic algorithm proposed by the present invention. DETAILED DESCRIPTION
[0102] The present invention will now be described in further detail with reference to the accompanying drawings. These drawings are simplified schematic diagrams, which only illustrate the basic structure of the present invention in a schematic manner, and therefore only show the components related to the present invention.
[0103] refer to Figure 1 , a method for determining the priority of cloud computing task scheduling based on genetic algorithm, comprising the following steps:
[0104] S1. Obtain task information and resource status information in the cloud computing environment, and input the task set to be scheduled and the available computing resource set into the system;
[0105] S2. Initialize the genetic algorithm parameters, including population size, crossover probability, mutation probability and evolutionary generations, and randomly generate the initial population. Each individual represents a task scheduling scheme, and each task scheduling scheme includes the priority allocation of cloud computing tasks.
[0106] S3. Calculate the fitness value of each individual. The fitness function comprehensively considers performance indicators such as task completion time, resource utilization, and task waiting time to evaluate the scheduling plan of each individual.
[0107] S4, select excellent individuals for mating based on fitness values, and use the improved tournament selection algorithm to select individuals, so that the selected individuals have higher fitness in priority allocation;
[0108] S5. Perform a crossover operation on the selected individuals and generate new individuals using a multi-point crossover method. The new individuals inherit the priority allocation characteristics of the parent individuals and optimize the priority allocation of cloud computing task scheduling during the generation process.
[0109] S6. Perform mutation operations on the newly generated individuals, and use gene mutation strategies to randomly change part of the gene values of the individuals, including the adjustment of cloud computing task priorities;
[0110] S7, update the population, and form a new generation population with the newly generated individuals and the retained excellent individuals. Each individual in the new generation population contains the optimized cloud computing task priority allocation;
[0111] S8, check whether the preset evolutionary number is reached or the convergence condition is met. If not, return to step S3, continue iteration, and further optimize the cloud computing task priority;
[0112] S9, outputting the optimal cloud computing task scheduling scheme, determining the priority of each cloud computing task according to the gene sequence of the optimal individual, and allocating the cloud computing tasks to the corresponding computing resources for execution in order of priority;
[0113] S10. Dynamically monitor the task load and resource status in the cloud computing environment, adjust the genetic algorithm parameters in real time, and re-determine the task scheduling priority to correspond to the changes in the cloud computing environment.
[0114] In this implementation, S1 specifically includes the following sub-steps:
[0115] S11, obtaining task information in the cloud computing environment, including the task ID, task type, task size, task deadline, and task dependency of each task;
[0116] S12, obtaining resource status information in the cloud computing environment, including resource ID, resource type, resource capacity, resource load and resource available time of each computing resource;
[0117] S13, inputting the task set T to be scheduled and the available computing resource set R into the system;
[0118] S14. Constructing task information matrix M Tand resource status matrix M R , where the task information matrix M T The dimension is n×k, each row represents the attribute of a task, and the resource status matrix M R The dimension is m×l, each row represents the attribute of a resource, k and l are the number of attributes of tasks and resources respectively;
[0119] S15. Define the task priority allocation matrix P T , whose dimension is n×1, indicating the priority of each task;
[0120] S16, preprocessing the acquired task information and resource status information, including data cleaning, standardization and format conversion;
[0121] S17, the preprocessed task information matrix M T and resource status matrix M R Stored in the system database.
[0122] The present invention dynamically adjusts the genetic algorithm parameters so that the scheduling scheme can adapt to the changes in task load and resource status in the cloud computing environment in real time. The task and resource status information acquisition and processing method described in detail in this embodiment ensures that the scheduling system can obtain and use the latest environmental information, adjust task priority and resource allocation in real time, and the dynamic adaptability improves the robustness and flexibility of the system, ensuring that resources can be efficiently used in the cloud computing environment, avoiding the problem of resource waste and low scheduling efficiency caused by environmental changes.
[0123] In this implementation, S2 specifically includes the following sub-steps:
[0124] S21, initialize genetic algorithm parameters, set population size N, crossover probability P c , mutation probability P m and evolutionary generation G, where N is the number of task scheduling solutions in the initial population, P c is the probability of crossover operations between task scheduling schemes, P m is the probability of mutation of the task scheduling scheme gene, G is the maximum evolutionary generation of the genetic algorithm;
[0125] S22. Randomly generate an initial population P(0), each individual represents a task scheduling scheme, each individual is composed of a gene sequence of length n, and each gene in the gene sequence represents the priority allocation of a cloud computing task.
[0126] In this implementation, calculating the fitness value of each individual includes defining a fitness function f(x) for each task scheduling scheme to evaluate the pros and cons of the individual. The fitness function comprehensively considers the performance indicators of task completion time, resource utilization, and task waiting time:
[0127] f(x)=w 1 Task completion time (x) + w 2 Resource utilization (x) + w 3 Task waiting time (x);
[0128] Among them, w 1 ,w 2 ,w 3 is the weight coefficient of different performance indicators, and x is the task scheduling scheme;
[0129] Calculate the task completion time of each task scheduling scheme. The task completion time (x) is defined as the nonlinear weighted sum of all task completion times, taking into account the priority of the task and the execution complexity of the task. Its expression is:
[0130]
[0131] Among them, C i is the completion time of the ith task, P i is the priority of the ith task, E i is the execution complexity of the i-th task, α is the adjustment factor, and n is the number of tasks;
[0132] Calculate the resource utilization of each task scheduling scheme. Resource utilization (x) is defined as the weighted utilization of all computing resources during the scheduling period, taking into account resource load balancing and resource utilization fluctuations. Its expression is:
[0133]
[0134] Among them, U j is the utilization rate of the jth computing resource, P j is the priority of the jth computing resource, V j is the utilization fluctuation of the jth computing resource, β is the adjustment factor, and m is the number of resources;
[0135] The task waiting time (x) of each task scheduling scheme is calculated, which is defined as the sum of the nonlinear weighted waiting time of all tasks from the time they arrive at the system to the time they start executing, taking into account the priority and importance of the tasks. The expression is:
[0136]
[0137] Among them, W i is the waiting time of the ith task, P i is the priority of the ith task, is the importance of the i-th task, γ is the adjustment factor, and n is the number of tasks.
[0138] In this implementation, S4 specifically includes the following sub-steps:
[0139] S41, calculating the fitness value f(x) of each individual in the initial population, and sorting the individuals in the population according to the fitness value;
[0140] S42. A dynamically improved tournament selection algorithm based on the characteristics of the cloud computing platform is used for individual selection. The tournament size k(t) is dynamically adjusted in each selection process, where k(t) is adjusted as the cloud computing task load and resource status change dynamically:
[0141]
[0142] Where k(t) is the tournament size of the current generation t, k 0 is the initial tournament size, Δk is the adjustment factor used to adjust the tournament size according to resource load changes, L j (t) is the load of the jth resource in the tth generation, indicating the current load of each resource in the cloud platform, and m is the number of resources;
[0143] S43. In each tournament, the individual with the highest fitness value is selected from the k(t) individuals as the parent individual and added to the parent individual set P parents middle:
[0144]
[0145] Among them, P parents (t) is the set of parent individuals of the tth generation, P selected (t) is the set of individuals selected in the tth generation, and f(x) is the fitness value of the individual;
[0146] S44, repeat steps S42 and S43 until the parent individual set P parents The size of reaches half of the population size N, that is,
[0147]
[0148] Where N is the population size, |P parents (t)| is the size of the set of individuals in the t-th generation parent generation;
[0149] S45, for the parent individual set P parents Check the priority allocation of individuals in to ensure that each selected individual has a high fitness in the priority allocation of cloud computing tasks:
[0150]
[0151] Among them, threshold is the set fitness value threshold, which ensures that the selected parent individuals have higher fitness in priority allocation;
[0152] S46, in the parent individual set P parents Two individuals are randomly selected for mating, and two offspring individuals are generated using a dynamic crossover strategy based on task dependency and resource status. The offspring individuals are added to the offspring individual set P offspring middle.
[0153] The present invention realizes the comprehensive optimization of the scheduling scheme by designing a multi-objective fitness function and comprehensively considering multiple performance indicators such as task completion time, resource utilization and task waiting time. The fitness function definition and calculation method described in detail in this embodiment enable the scheduling system to find a balance point between multiple objectives and optimize the overall system performance. Compared with the limitation that traditional algorithms can only optimize a single objective, the present invention can optimize multiple key performance indicators at the same time, ensuring the superiority of the task scheduling scheme in all aspects.
[0154] In this implementation, S46 specifically includes the following sub-steps:
[0155] S461, in the parent individual set P parents (t) randomly select two individuals x 1 and x 2 , represents two task scheduling schemes;
[0156] S462. Define a task dependency matrix D, whose dimension is n×n, where D ij =1 indicates task t i Depends on task t j , D ij =0 means task t i and task t j There is no dependency between them, n is the number of tasks;
[0157] S463, define a current resource state matrix R(t), whose dimension is m×p, representing the resource state in the tth generation, where m is the number of resources and p is the number of state attributes of each resource;
[0158] S464、Design of dynamic crossover strategy function DMOC(x based on multi-objective optimization 1 ,x 2 ,R(t),D):
[0159] Multi-objective fitness evaluation: The NSGA-II algorithm is introduced to perform multi-objective fitness evaluation on the task scheduling scheme, considering multiple performance indicators such as task completion time, resource utilization, and task waiting time, and calculating the Pareto frontier fitness of each individual ParetoFitness(x):
[0160] ParetoFitness(x)=[f 1 (x),f 2 (x),f 3 (x)];
[0161] Among them, f 1 (x) is the task completion time, f 2 (x) is the resource utilization rate, f 3 (x) is the task waiting time;
[0162] Intelligent crosspoint selection: Combined with the resource status and network latency of the cloud computing platform, multiple crosspoints are dynamically selected to ensure that crosspoint operations are reduced on high-load resource nodes and increased on low-load nodes:
[0163]
[0164] Among them, L j (t is the load of the j-th resource in the t-th generation, SelectPoints(x,y) is the intersection selection function based on resource load;
[0165] Multi-point crossover and fitness guidance: In individual x 1 and x 2 Select multiple crossover points in the gene sequence and use a multi-point crossover method guided by multi-objective fitness to generate two new individuals x′ 1 and x′ 2 , the gene sequence of the new individual represents the new task scheduling priority allocation:
[0166] x′ 1 =[g′ 1 ,g′ 2 ,…,g′ k ],x′ 2 =[g″ 1 ,g″ 2 ,…,g″ k ];
[0167] Among them, g i ' and g″ i It is the gene segment after crossover. During the crossover process, high fitness segments are preferentially retained;
[0168] Dynamic network transmission optimization: Based on the network transmission delay and bandwidth information of the cloud platform, the network transmission of the generated new individuals is optimized, and the task scheduling scheme is adjusted to minimize the network transmission time:
[0169]
[0170] Among them, Tnet (t i , R(t)) is task t i Network transmission time under resource state R(t);
[0171] Resource adaptability check: for the generated new individual x′ 1 and x′ 2 Perform resource adaptability check to ensure that the task scheduling scheme of the new individual under the current resource state R(t) has high adaptability and complies with the constraints of the task dependency matrix D:
[0172] CheckAdaptability(x,R(t),D)≥threshold;
[0173] Among them, CheckAdaptability(x',R(t),D) is the adaptability check function, which ensures that the fitness of the new individual is not lower than the set threshold;
[0174] S465, the two offspring individuals x' generated 1 and x′ 2 Add to the collection of offspring individuals.
[0175] In this implementation, S6 specifically includes the following sub-steps:
[0176] S61. Define the gene mutation probability P for each newly generated individual m , represents the probability of individual gene mutation, set P m The initial value of the cloud computing environment is adjusted according to the dynamic changes of the cloud computing environment;
[0177] S62, perform gene mutation operation on each newly generated individual x, and each gene g in the gene sequence i With probability P m (t) mutation, the mutation process uses random selection to change the gene g i Randomly change to another task priority value:
[0178]
[0179] Among them, g i ' is the gene value after mutation, Random(P T ) represents the task priority assignment matrix P T Randomly select a priority value in;
[0180] S63, evaluate the fitness of the mutated individual x', and recalculate its fitness value f(x') to ensure that the mutated individual has a higher fitness in task priority allocation;
[0181] S64. Perform task dependency check on the mutated individuals to ensure that the priority allocation of each task complies with the constraints of the task dependency matrix D:
[0182]
[0183] Among them, t i and t j is a task in the task set T, and They are task t i and t j Priority, D ij are the elements of the task dependency matrix;
[0184] S65. Add the mutant individuals that have passed the fitness evaluation and task dependency check to the new population to ensure that each individual in the new population has a high fitness in task priority allocation.
[0185] The present invention introduces efficient selection, crossover and mutation strategies into the genetic algorithm, accelerates the convergence speed of the algorithm, and improves the optimization effect of the scheduling scheme. The improved tournament selection algorithm and dynamic crossover strategy described in detail in this embodiment enable the selection and crossover process to better retain excellent genes, generate offspring individuals with higher fitness, further increase population diversity, and improve the global search capability of the algorithm. Through these improvements, the present invention can find the optimal scheduling scheme in a relatively short time, significantly improving the scheduling efficiency.
[0186] In this implementation, S9 specifically includes the following sub-steps:
[0187] S91. In the evolution process of the genetic algorithm, the individual with the highest fitness value is selected in each generation as the optimal individual of the current generation, and the gene sequence G of the optimal individual is recorded. best ;
[0188] S92, after reaching the preset evolutionary number or satisfying the convergence condition, select the global optimal individual G global , whose gene sequence represents the optimal task scheduling scheme;
[0189] S93, according to the optimal individual G global The gene sequence of 1 ,g 2 ,…,g n ]Determine the priority of each cloud computing task T , where g i Indicates the priority value of the i-th task:
[0190]
[0191] in, is the priority of the i-th task, and n is the number of tasks;
[0192] S94. Sort the cloud computing tasks in order of priority, and arrange the tasks from high to low priority to form a task scheduling queue Q T ;
[0193] S95, according to the resource status information matrix, the task scheduling queue Q T The tasks in are assigned to the corresponding computing resources in order for execution:
[0194]
[0195] Among them, R assign (t i ) is task t i The allocated computing resource, Load(r) is the current load of computing resource r;
[0196] S96, record the task allocation plan and generate a cloud computing task scheduling plan table S schedule , including each task’s ID, priority, assigned computing resource ID, and estimated completion time;
[0197] S97, monitor the task execution process, record the task execution status and resource usage in real time, and ensure that the task is completed according to the scheduling schedule S schedule If an abnormal situation occurs during execution, the task scheduling plan is dynamically adjusted to ensure the effectiveness and robustness of the scheduling.
[0198] The present invention introduces resource adaptability check and dynamic optimization mechanism in the task scheduling process to ensure that the generated scheduling scheme can effectively adapt to the current resource status and task dependency. The optimal individual gene sequence determination and task scheduling scheme generation method described in detail in this embodiment ensures the effectiveness and executability of the scheduling scheme through accurate calculation and reasonable allocation of task priorities. At the same time, by real-time monitoring of the task execution process and resource usage, the scheduling scheme is dynamically adjusted to ensure the stability and efficiency of the system.
[0199] In summary, the present invention achieves high efficiency of task scheduling and maximization of resource utilization in cloud computing environment by introducing multi-objective optimization, efficient evolution strategy, resource adaptability check and dynamic optimization mechanism on the basis of genetic algorithm. Compared with the prior art, the present invention has significant innovation and practicality, and can provide flexible, reliable and efficient task scheduling solutions in complex and changeable cloud computing environment.
[0200] Embodiment 1:
[0201] This embodiment chooses to be tested in a cloud computing environment of a large online education platform. The platform needs to process a large number of student online learning tasks and teacher course recording tasks every day, and these tasks have different priorities and complexities. At the same time, the computing resources of the platform include multiple high-performance computing servers and storage servers, and the load and state of these resources will change dynamically. When dealing with such complex tasks, traditional task scheduling algorithms are usually unable to efficiently utilize resources, resulting in low task execution efficiency and waste of resources. In order to verify the effectiveness of the present invention, we conducted a task scheduling experiment in the cloud computing environment of the platform and compared the effects of the method of the present invention and the traditional task scheduling method.
[0202] In this scenario, we first obtained the information of all tasks to be scheduled on the platform, including task ID, task type (such as student online learning tasks and teacher course recording tasks), task size, task deadline, and task dependencies. At the same time, we also obtained the status information of all current computing resources, including resource ID, resource type, resource capacity, resource load, and resource available time.
[0203] We use the method of the present invention to determine the priority of cloud computing task scheduling, and the specific steps are as follows:
[0204] Set the population size to 50, the crossover probability to 0.8, the mutation probability to 0.05, and the evolutionary generation to 100. The initial population is randomly generated, and each individual represents a task scheduling scheme.
[0205] We define a fitness function for each task scheduling scheme, taking into account performance indicators such as task completion time, resource utilization, and task waiting time. The weight coefficients of the fitness function are set to 0.4, 0.3, and 0.3, respectively.
[0206] Based on the fitness value, excellent individuals are selected for mating, and the improved tournament selection algorithm is used for individual selection, so that the selected individuals have higher fitness in priority allocation. New individuals are generated using the multi-point crossover method, and gene mutation operations are performed to randomly change part of the gene values of the individuals.
[0207] After reaching the preset evolutionary number, we output the optimal cloud computing task scheduling scheme. According to the gene sequence of the optimal individual, the priority of each task is determined, and the tasks are assigned to the corresponding computing resources for execution in order of priority.
[0208] In order to verify the effectiveness of the method of the present invention, we selected 1000 tasks and 20 computing resources as training samples, and compared them with the traditional first-come, first-served (FCFS) algorithm. The comparison data is shown in Table 1 below:
[0209] Table 1 compares the present invention with the traditional FCFS algorithm
[0210]
[0211] From the data in Table 1 above, it can be seen that the method of the present invention is superior to the traditional FCFS algorithm in terms of task completion time, resource utilization and task waiting time. The method of the present invention reduces the task completion time from 12,500 seconds to 8,500 seconds, an increase of 32%; the resource utilization rate is increased from 65% to 85%, an increase of 20 percentage points; the task waiting time is reduced from 800 seconds to 400 seconds, a reduction of 50%. In addition, the average task completion time is also reduced from 12.5 seconds to 8.5 seconds, which significantly improves the efficiency of task scheduling.
[0212] To further demonstrate the effectiveness of the present invention, we conducted a long-term experiment in an actual operating environment. The experiment was conducted from May 1, 2023 to June 30, 2023, at the cloud computing center of a large online education platform. During the experiment, we randomly selected 1,000 tasks from the platform for scheduling every day, and compared the effects of the method of the present invention and the traditional FCFS algorithm. The results are shown in Table 2 below:
[0213] Table 2 Comparison of the effects of the method of the present invention and the traditional FCFS algorithm in the experiment
[0214]
[0215] The data in Table 2 above show that the method of the present invention continues to perform well in practical applications, significantly improves the scheduling efficiency and resource utilization of cloud computing tasks, reduces task waiting time, and verifies the effectiveness and practicality of the present invention.
[0216] Through the global search and optimization capabilities of genetic algorithms, the present invention can dynamically adapt to changes in task load and resource status in a complex and changeable cloud computing environment, and realize comprehensive optimization of multiple performance indicators such as task completion time, resource utilization and task waiting time through a multi-objective fitness function, thereby significantly improving the efficiency of task scheduling and resource utilization. It not only improves the adaptability and flexibility of the scheduling scheme, but also accelerates the convergence speed of the algorithm through efficient selection, crossover and mutation strategies, ensuring that the optimal scheduling scheme can be found in a relatively short time.
[0217] The above description is only a preferred specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can make equivalent replacements or changes according to the technical scheme and inventive concept of the present invention within the technical scope disclosed by the present invention, which should be covered by the protection scope of the present invention.
Claims
1. A method for determining cloud computing task scheduling priority based on genetic algorithm, characterized in that: The steps include: S1. Obtain task information and resource status information in the cloud computing environment, and input the task set to be scheduled and the available computing resource set into the system; S2. Initialize the genetic algorithm parameters, including population size, crossover probability, mutation probability and evolutionary generations, and randomly generate the initial population. Each individual represents a task scheduling scheme, and each task scheduling scheme includes the priority allocation of cloud computing tasks. S3. Calculate the fitness value of each individual. The fitness function comprehensively considers the performance indicators of task completion time, resource utilization and task waiting time to evaluate the scheduling plan of each individual. S4, selecting excellent individuals for mating based on fitness values, and using an improved tournament selection algorithm to select individuals so that the selected individuals have a fitness higher than the fitness value threshold in priority allocation; S5. Perform a crossover operation on the selected individuals and generate new individuals using a multi-point crossover method. The new individuals inherit the priority allocation characteristics of the parent individuals and optimize the priority allocation of cloud computing task scheduling during the generation process. S6. Perform mutation operations on the newly generated individuals, and use gene mutation strategies to randomly change part of the gene values of the individuals, including the adjustment of cloud computing task priorities; S7, update the population, and form a new generation population with the newly generated individuals and the retained excellent individuals. Each individual in the new generation population contains the optimized cloud computing task priority allocation; S8, check whether the preset evolutionary number is reached or the convergence condition is met. If not, return to step S3, continue iteration, and further optimize the cloud computing task priority; S9, outputting the optimal cloud computing task scheduling scheme, determining the priority of each cloud computing task according to the gene sequence of the optimal individual, and allocating the cloud computing tasks to the corresponding computing resources for execution in order of priority; S10, dynamically monitor the task load and resource status in the cloud computing environment, adjust the genetic algorithm parameters in real time, and re-determine the task scheduling priority to correspond to the changes in the cloud computing environment; The calculation of the fitness value of each individual includes defining a fitness function f(x) for each task scheduling scheme, which is used to evaluate the pros and cons of the individual. The fitness function comprehensively considers the performance indicators of task completion time, resource utilization and task waiting time: ; in, , , is the weight coefficient of different performance indicators, and x is the task scheduling scheme; Calculate the scheduling of each task , defined as the nonlinear weighted sum of the completion time of all tasks, considering the priority of the task and the execution complexity of the task, its expression is: ; in, is the completion time of the ith task, is the priority of the ith task, is the execution complexity of the ith task, is the adjustment factor, n is the number of tasks; Calculate the scheduling of each task , defined as the weighted utilization rate of all computing resources during scheduling, considering the resource load balance and resource utilization fluctuation, its expression is: ; in, is the utilization rate of the jth computing resource, is the priority of the jth computing resource, is the utilization fluctuation of the jth computing resource, is the adjustment factor, m is the number of resources; The task waiting time (x) of each task scheduling scheme is calculated, which is defined as the sum of the nonlinear weighted waiting time of all tasks from the time they arrive at the system to the time they start executing, taking into account the priority and importance of the tasks. The expression is: ; in, is the waiting time of the ith task, is the priority of the ith task, is the importance of the i-th task, is the adjustment factor, n is the number of tasks; The S4 specifically includes the following sub-steps: S41, calculating the fitness value f(x) of each individual in the initial population, and sorting the individuals in the population according to the fitness value; S42. A dynamically improved tournament selection algorithm based on the characteristics of the cloud computing platform is used for individual selection. The tournament size k(t) is dynamically adjusted in each selection process, where k(t) is adjusted as the cloud computing task load and resource status change dynamically: ; Where k(t) is the tournament size of the current generation t, is the initial tournament size, is the adjustment factor used to adjust the tournament size based on changes in resource load, is the load of the jth resource in the tth generation, indicating the current load of each resource in the cloud platform, and m is the number of resources; S43. In each tournament, select the individual with the highest fitness value from k(t) individuals as the parent individual and add it to the parent individual set middle: ; in, is the set of parent individuals of the tth generation, is the set of individuals selected in the tth generation, and f(x) is the fitness value of the individual; S44, repeat steps S42 and S43 until the parent individual set The size of reaches half of the population size N, that is, ; Where N is the population size, is the size of the set of individuals of the t-th generation parent; S45. Parent individual set Perform a priority allocation check on the individuals in to ensure that each selected individual has a fitness value higher than the fitness value threshold in the cloud computing task priority allocation: ; in, The fitness value threshold is set to ensure that the selected parent individuals have a fitness higher than the fitness value threshold in priority allocation; S46, in the parent individual set Randomly select two individuals for mating, use a dynamic crossover strategy based on task dependency and resource status to generate two offspring individuals, and add the offspring individuals to the offspring individual set middle.
2. The method for determining cloud computing task scheduling priority based on genetic algorithm according to claim 1, characterized in that: The S1 specifically includes the following sub-steps: S11, obtaining task information in the cloud computing environment, including the task ID, task type, task size, task deadline, and task dependency of each task; S12, obtaining resource status information in the cloud computing environment, including resource ID, resource type, resource capacity, resource load and resource available time of each computing resource; S13, inputting the task set T to be scheduled and the available computing resource set R into the system; S14. Constructing the task information matrix and resource status matrix , where the task information matrix The dimension is , each row represents the attributes of a task, resource status matrix The dimension is , each row represents the attribute of a resource, k and l are the number of attributes of tasks and resources respectively; S15. Define the task priority assignment matrix , whose dimensions are , indicating the priority of each task; S16, preprocessing the acquired task information and resource status information, including data cleaning, standardization and format conversion; S17, the preprocessed task information matrix and resource status matrix Stored in the system database.
3. The method for determining cloud computing task scheduling priority based on genetic algorithm according to claim 2, characterized in that: The S2 specifically includes the following sub-steps: S21, initialize genetic algorithm parameters, set population size N, crossover probability , mutation probability and evolutionary generation G, where N is the number of task scheduling solutions in the initial population, is the probability of crossover operations between task scheduling schemes, is the probability of mutation of the task scheduling scheme gene, G is the maximum evolutionary generation of the genetic algorithm; S22. Randomly generate an initial population P(0), each individual represents a task scheduling scheme, each individual is composed of a gene sequence of length n, and each gene in the gene sequence represents the priority allocation of a cloud computing task.
4. The method for determining cloud computing task scheduling priority based on genetic algorithm according to claim 1, characterized in that: The S46 specifically includes the following sub-steps: S461, in the parent individual set Randomly select two individuals and , represents two task scheduling schemes; S462. Define the task dependency matrix D, whose dimension is ,in Indicates the task Depends on the task , Indicates the task and tasks There is no dependency between them, n is the number of tasks; S463. Define the current resource state matrix R(t), whose dimension is , represents the resource status in the tth generation, where m is the number of resources and p is the number of status attributes of each resource; S464、Design of dynamic crossover strategy function based on multi-objective optimization : Multi-objective fitness evaluation: The NSGA-II algorithm is introduced to perform multi-objective fitness evaluation on the task scheduling scheme, considering multiple performance indicators such as task completion time, resource utilization, and task waiting time, and calculating the Pareto frontier fitness of each individual : ; in, is the task completion time, is the resource utilization rate, Waiting time for tasks; Intelligent crosspoint selection: Combined with the resource status and network latency of the cloud computing platform, multiple crosspoints are dynamically selected to ensure that crosspoint operations are reduced on high-load resource nodes and increased on low-load nodes: ; in, is the load of the jth resource in the tth generation, Select functions for intersections based on resource load; Multi-point crossover and fitness guidance: and Select multiple crossover points in the gene sequence and use a multi-point crossover method guided by multi-objective fitness to generate two new individuals and , the gene sequence of the new individual represents the new task scheduling priority allocation: ; in, and It is the gene segment after crossover. During the crossover process, high fitness segments are preferentially retained; Dynamic network transmission optimization: Based on the network transmission delay and bandwidth information of the cloud platform, the network transmission of the generated new individuals is optimized, and the task scheduling scheme is adjusted to minimize the network transmission time: ; in, For the task Network transmission time under resource state R(t); Resource adaptability check: for the generated new individuals and Perform resource adaptability check to ensure that the task scheduling scheme of the new individual under the current resource state R(t) has a fitness higher than the fitness value threshold and complies with the constraints of the task dependency matrix D: ; in, It is a fitness check function to ensure that the fitness of the new individual is not lower than the set threshold; S465, the two offspring individuals generated and Add to the collection of offspring individuals.
5. The method for determining cloud computing task scheduling priority based on genetic algorithm according to claim 4, characterized in that: The S6 specifically includes the following sub-steps: S61. Define the probability of gene mutation for each newly generated individual , represents the probability of individual gene mutation, set The initial value of the cloud computing environment is adjusted according to the dynamic changes of the cloud computing environment; S62, perform gene mutation operation on each newly generated individual x, and each gene in the gene sequence By probability The mutation process uses random selection to change the gene Randomly change to another task priority value: ; in, is the gene value after mutation, Represents the task priority assignment matrix Randomly select a priority value in; S63, performing fitness evaluation on the mutated individual x', and recalculating its fitness value f(x'), to ensure that the mutated individual has a fitness higher than the fitness value threshold in task priority allocation; S64. Perform task dependency check on the mutated individuals to ensure that the priority allocation of each task complies with the constraints of the task dependency matrix D: ; in, and is a task in the task set T, and Respectively for tasks and The priority of are the elements of the task dependency matrix; S65. Add the mutant individuals that have passed the fitness evaluation and task dependency check to the new population, ensuring that each individual in the new population has a fitness value higher than the fitness value threshold in task priority allocation.
6. The method for determining cloud computing task scheduling priority based on genetic algorithm according to claim 5, characterized in that: The S9 specifically includes the following sub-steps: S91. In the evolution process of the genetic algorithm, the individual with the highest fitness value is selected in each generation as the optimal individual of the current generation, and the gene sequence of the optimal individual is recorded. ; S92. After reaching the preset evolutionary number or meeting the convergence condition, select the global optimal individual , whose gene sequence represents the optimal task scheduling scheme; S93, according to the best individual The gene sequence Prioritize each cloud computing task ,in Indicates the priority value of the i-th task: ; in, is the priority of the i-th task, and n is the number of tasks; S94. Sort the cloud computing tasks in order of priority, and arrange the tasks from high to low priority to form a task scheduling queue. ; S95, according to the resource status information matrix, the task scheduling queue The tasks in are assigned to the corresponding computing resources in order for execution: ; in, For the task The allocated computing resources, is the current load of computing resource r; S96. Record the task allocation plan and generate a cloud computing task scheduling plan , including each task’s ID, priority, assigned computing resource ID, and estimated completion time; S97, monitor the task execution process, record the task execution status and resource usage in real time, and ensure that the task is executed according to the schedule If an abnormal situation occurs during execution, the task scheduling plan is dynamically adjusted to ensure the effectiveness and robustness of the scheduling.
Citation Information
Patent Citations
Cloud task scheduling method based on improved genetic algorithm
CN103902375A