Task scheduling method and system based on priority transformation in heterogeneous platform

By improving the priority transformation and chromosome coding optimization of genetic algorithms, the problem that task scheduling is prone to fall into local optimal solutions in heterogeneous computing platforms is solved, and more efficient task scheduling effects are achieved.

CN120295741AActive Publication Date: 2025-07-11NANJING UNIV OF AERONAUTICS & ASTRONAUTICS +1
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202510788754.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-13
Publication Date
2025-07-11
Estimated Expiration
2045-06-13

AI Technical Summary

Technical Problem

In heterogeneous computing platforms, the static task scheduling method of the prior art is difficult to effectively avoid local optimal solutions, and the scheduling effect is poor, especially based on random search algorithms, it is easy to fall into local optimal solutions, and the optimal scheduling results cannot be obtained.

Method used

The improved genetic algorithm is adopted to optimize the task scheduling process through priority transformation and chromosome coding improvement, combining insertion fitness function, tournament selection, subpath crossing, adaptive variability rate control, elite retention and degeneration extinction mechanisms.

Benefits of technology

It improves the effect and efficiency of task scheduling, reduces the probability of falling into local optimal solutions, and achieves more efficient task scheduling.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120295741A_ABST
    Figure CN120295741A_ABST
Patent Text Reader

Abstract

The invention relates to the field of heterogeneous computing platform improvement, and discloses a task scheduling method and system based on priority transformation in a heterogeneous platform. The method comprises the following steps: analyzing heterogeneous platform task information to obtain a task dependency relationship, task execution time, task data communication traffic and communication speeds among different processors, compiling an initial fitness function according to a completion time proportion before and after task scheduling, namely an acceleration ratio, and constructing a final fitness function based on the initial fitness function; and adopting an improved genetic algorithm to carry out multiple iterations to obtain a target fitness function, so as to obtain a target priority queue and a target processor queue, namely a target scheduling result. According to the method, a better scheduling effect can be obtained in a heterogeneous platform scheduling process, the total task scheduling time is shortened, meanwhile, the possibility of falling into a local optimal solution is reduced, prematurity of a genetic algorithm is avoided, and a faster and more stable optimal solution obtaining capability is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of improving heterogeneous computing platforms, and particularly to a task scheduling method and system based on priority transformation in a heterogeneous platform. Background Art

[0002] As a core part of heterogeneous computing, how to perform task scheduling is a very crucial issue, and static task scheduling occupies a large part in task scheduling algorithms. In static task scheduling, information such as the number of tasks, communication volume, execution time, and dependency relationships of tasks needs to be obtained in advance, and a solution is formulated based on these data to complete task scheduling before task execution.

[0003] Static task scheduling can be further divided into heuristic-based task scheduling and random search algorithm-based task scheduling. Among them, heuristic-based task scheduling has been widely studied because of its simple implementation, low complexity, and good scheduling effect. The algorithm based on random search obtains the optimal solution of the problem through a large number of iterations. Compared with the heuristic algorithm, it will obtain a better scheduling result. However, the random search algorithm is prone to falling into a local optimal solution, resulting in premature convergence and unable to obtain the best scheduling result.

[0004] To solve these problems, there is an urgent need for a task scheduling method and system based on priority transformation in a heterogeneous platform. Summary of the Invention

[0005] To solve the above problems, the present application proposes a task scheduling algorithm based on an improved genetic algorithm, which can not only improve the effect of task scheduling, reduce the execution time of the total tasks, but also avoid falling into a local optimal solution and stabilize the scheduling result.

[0006] A task scheduling method based on priority transformation in a heterogeneous platform includes the following steps: S1. Obtain the task information of the heterogeneous platform, and analyze the task information of the heterogeneous platform to obtain task dependency relationships, task execution times, task data communication volumes, and communication speeds between different processors; S2. Write an initial fitness function according to the completion time ratio before and after task scheduling, that is, the speedup ratio, and construct a final fitness function based on the initial fitness function. The completion time before task scheduling is the sum of the execution times of all tasks on a single processor, and the completion time after task scheduling refers to the total task time obtained according to the current scheduling result after one iteration of the genetic algorithm, which includes the data communication time between tasks, that is, the data communication volume between tasks with data dependency relationships but on different processors multiplied by the communication speed; S3. Use the improved genetic algorithm to perform multiple iterations to obtain the target fitness function, and then obtain the target priority queue and the target processor queue, that is, the target scheduling result.

[0007] Preferably, the expression of the initial fitness function in S2 is: ; wherein, represents the fitness magnitude, represents the ratio of the completion time before and after scheduling, represents the time to complete all tasks on only one processor before scheduling; represents the time to complete all tasks after scheduling.

[0008] Preferably, the specific content of constructing the final fitness function based on substituting the initial fitness function in S2 is to calculate in an insertion manner, and substitute into the initial fitness function to obtain the final fitness function.

[0009] Preferably, the specific content of calculating in an insertion manner is as follows: For the tasks executed successively on the processor , there is sufficient idle time between the two tasks to allow another task to be inserted into the idle time for execution. The specific calculation rule is: First, represents the initial start time of the task on the processor . The expression of is: ; wherein, represents the communication volume between tasks, represents the ready time when the processor is idle and ready to execute a new task, is the entry child node, i.e., the initial sub-task, is the task number, is the processor, is the task 's dependent task set; is 's predecessor task 's initial completion time (earliest completion time) on the processor , that is, the initial start time plus 's execution time on the processor . The expression of is: ; wherein, is the task Execution time on the processor ; There are two tasks already assigned on the processor and they are not consecutive. There is an idle time after it ends until it starts. When another task is also assigned to the processor if it meets the preset conditions, it is assigned to execute during this idle time period in an insertable manner; The expression of the preset conditions is: ; ; Among them, is the execution time of task on the processor ; After all tasks are assigned in an insertable manner, the final execution time is obtained. The expression of the final execution time is: ; Among them, is the exit sub - node, that is, the last sub - task, represents a certain processor where this task is located, is the exit sub - node, that is, the last sub - task on the processor where it is located, and it is the initial completion time (earliest completion time); The total execution time of unscheduled tasks is the time when all tasks are executed on the processor and the expression of is: ; ; Among them, is the execution time of task on the processor and N is the total number of tasks.

[0010] Preferably, the expression of the final fitness function is: ;

[0011] Among them, is the exit sub - node, that is, the last sub - task, represents a certain processor where this task is located, is the processor and N is the total number of tasks, is task on the processor The time executed thereon.

[0012] Preferably, in S3, an improved genetic algorithm is used for multiple iterations to obtain the target fitness function, and then the target priority queue and the target processor queue are obtained. Specifically, the content of the target scheduling result is as follows: S301. Determine the initial task priority sequence according to the task dependency relationship, and randomly determine the processor sequence for task allocation. Combine the priority queue and the processor mapping queue to form the chromosome of the genetic algorithm, and initialize the priority queue and the processor mapping queue respectively; S302. Use the tournament selection method to select chromosomes; When performing tournament selection, reduce the pressure on all chromosomes in the current iteration population, and increase the probability of low-fitness individuals being selected by adding random numbers; S303. Perform sub-path crossover processing on the task priority queue based on the sub-path crossover method; the crossover part performs sub-path crossover processing on the task priority queue, so as to ensure the correctness of the task dependency relationship; S304. Perform random mutation on the processor mapping part and regular mutation on the priority queue part. The mutation controls the convergence speed of the algorithm iteration by adaptively changing the mutation rate during iteration; S305. Adopt the elitist retention strategy to retain the target scheduling result in each generation of population, that is, retain the result with the shortest total task completion time, and reduce the iteration time; S306. Use the degradation extinction mechanism to further optimize the target scheduling result, ensure the improvement of the final scheduling effect, and reduce the possibility of falling into the local optimum; S307. Repeat S302 - S306 to iteratively obtain the target scheduling result.

[0013] Preferably, in S301, the chromosome is first equally divided, with the first half being the processor number to which the subtask is assigned, and the second half being the priority number of the subtask in the task queue; The chromosome encoding for task scheduling using the genetic algorithm is the processor mapping encoding; The method of simultaneously changing the priority number and the processor number mapping during iteration can not only improve the scheduling efficiency, but also search for the optimal solution globally, thus improving the scheduling effect.

[0014] The processor mapping part adopts the method of random encoding for initialization; The priority queue is initialized using two random priority sorting methods or the HEFT or CPOP algorithm.

[0015] Preferably, the specific content of the front and back recombination of the chromosome based on the sub-path crossover method in 303 is as follows: A continuous group of gene values is randomly selected from one of the chromosomes, such as Then, the same gene values are searched for in and the gene groups in are replaced according to the order of the selected genes in , while keeping other genes unchanged. After replacement, is obtained as For , Similarly, two completely new and compliant offspring chromosomes after recombination are obtained in this way .

[0016] Preferably, in S304, the specific content of randomly mutating the processor mapping part and regularly mutating the priority queue part is as follows: First, a gene value is randomly selected in a chromosome, and it is defined that the task is the second to be assigned. At the same time, the first precursor node and the first successor node of are searched for in this queue, that is, the task and the task . At this time can be randomly inserted between the task and . After insertion, the order of other tasks remains unchanged and they move forward or backward in turn, thus completing one mutation; At the same time, an adaptive mechanism is added. In the early stage of iteration, the mutation rate is 0.8 to expand the search range and jump out of the local optimal solution. In the later stage of iteration, the mutation rate drops to 0.1 to accelerate the convergence speed and avoid too long iteration time.

[0017] A task scheduling system based on priority transformation in a heterogeneous platform, comprising: Information acquisition unit: acquiring task information of the heterogeneous platform, and analyzing the task information of the heterogeneous platform to obtain task dependencies, task execution times, task data traffic, and communication speeds between different processors; Function writing unit: writing an initial fitness function according to the completion time ratio before and after task scheduling, that is, the speedup ratio, and constructing a final fitness function based on the initial fitness function. The completion time before task scheduling is the sum of the execution times of all tasks on a single processor, and the completion time after task scheduling refers to the total task time obtained according to the current scheduling result after one iteration of the genetic algorithm, which includes the data communication time between tasks, that is, the data traffic between tasks with data dependencies but on different processors multiplied by the communication speed; Result generation unit: performing multiple iterations using an improved genetic algorithm to obtain the target fitness function, and further obtaining the target priority queue and the target processor queue, that is, the target scheduling result.

[0018] In summary, for the task scheduling method and system based on priority transformation in a heterogeneous platform of the present invention, compared with the traditional technology, the present invention iterates the genetic algorithm on the premise of priority transformation, and at the same time improves selection, crossover, and mutation to enhance the scheduling effect, and adds elite retention, degradation, and extinction to reduce the possibility of falling into a local optimal solution, having the following advantages: (1) The present application adopts the idea of priority transformation and improves selection, crossover, and mutation while ensuring the correctness of the dependency relationship, thereby enhancing the effect of task scheduling; (2) The present application uses an improved genetic algorithm for scheduling, and at the same time adds an elite retention, degradation, and extinction mechanism, reducing the probability of falling into a local optimal solution, and thus improving the efficiency of task scheduling.

[0019] The technical method of the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. Description of the Drawings

[0020] Figure 1 It is a step diagram of the task scheduling method based on priority transformation in a heterogeneous platform of the present invention; Figure 2 It is a partial crossover schematic diagram of the processor mapping of the present invention; Figure 3 It is a partial crossover schematic diagram of the priority queue of the present invention; Figure 4 It is a schematic diagram of the task allocation diagram of CPOP, HEFT, and MGA of the present invention; Figure 5 It is a schematic diagram of the convergence process of MGA of the present invention; Figure 6 It is a schematic diagram of the convergence process of SGA of the present invention; Figure 7 It is a DAG (Directed acyclic graph) task graph of the present invention. Detailed Embodiment

[0021] The technical method of the present invention will be further described below with reference to the accompanying drawings and embodiments. It should be noted that: Unless otherwise specifically stated, the relative arrangements of components and steps, numerical expressions, and numerical values set forth in these embodiments do not limit the scope of the present application.

[0022] The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the present application, its application, or its use.

[0023] Technologies, systems, and devices known to those of ordinary skill in the relevant art may not be discussed in detail, but where appropriate, the technologies, systems, and devices should be regarded as part of the specification.

[0024] In all the examples shown and discussed herein, any specific values should be construed as merely exemplary and not as a limitation. Thus, other examples of the exemplary embodiments may have different values.

[0025] Unless otherwise defined, technical terms or scientific terms used in the present invention shall have the ordinary meanings as understood by those of ordinary skill in the field to which the present invention belongs.

[0026] The present invention provides a task scheduling method based on priority transformation in a heterogeneous platform, as Figure 1 shown, including the following steps: S1. Obtain the heterogeneous platform task information, and analyze the heterogeneous platform task information to obtain task dependencies, task execution times, task data traffic, and communication speeds between different processors.

[0027] S2. Write an initial fitness function according to the completion time ratio before and after task scheduling, i.e., the speedup ratio, and construct a final fitness function based on the initial fitness function. The completion time before task scheduling is the sum of the execution times of all tasks on a single processor, and the completion time after task scheduling refers to the total task time obtained according to the current scheduling result after one iteration of the genetic algorithm, which includes the data communication time between tasks, i.e., the data traffic between tasks with data dependencies but on different processors multiplied by the communication speed.

[0028] Further, the expression of the initial fitness function in S2 is: .

[0029] Wherein, represents the fitness size, represents the ratio of the completion times before and after scheduling, represents the time to complete all tasks on only one type of processor before scheduling. represents the time to complete all tasks after scheduling.

[0030] Further, the specific content of constructing the final fitness function based on substituting into the initial fitness function in S2 is to calculate in an insertion manner, and substitute into the initial fitness function to obtain the final fitness function.

[0031] Further, the specific content of calculating in an insertion manner is: For tasks executed successively on processor , there is enough idle time between two tasks for another task to be inserted and executed during the idle time. The specific calculation rule is as follows: First represents the initial start time of task on the processor . The expression of is: ; Among them, represents the communication volume between tasks, represents the ready time when the processor is in an idle state and ready to execute a new task, is the entry sub-node, that is, the initial sub-task, is the task number, is the processor, is task 's set of dependent tasks; is 's predecessor task 's initial completion time (earliest completion time) on the processor , that is, the initial start time plus 's execution time on the processor . The expression of is: ; Among them, is the execution time of task on the processor ; There are two already assigned tasks on the processor , and is not continuous. After ends and before starts, there is a period of idle time. When another task is also assigned to the processor , if it meets the preset conditions, it is assigned to execute within this idle time period in an insertable manner; ; Among them, is the execution time of task on the processor ; After all tasks are assigned in an insertable manner, the final execution time is obtained. The expression of the final execution time is: ; Among them, is the exit child node, that is, the last subtask, indicating a certain processor where the task is located, is the exit child node, that is, the last subtask at the initial completion time (earliest completion time) on the processor where it is located; The total execution time of unscheduled tasks is the time when all tasks are executed on the processor is , and the expression of is: ; Among them, is the execution time of task on processor , N is the total number of tasks.

[0032] Preferably, the expression of the final fitness function is: .

[0033] Among them, is the exit child node, that is, the last subtask, indicating a certain processor where the task is located, is the processor , N is the total number of tasks, is the execution time of task on processor .

[0034] The fitness function directly affects the quality of the results of the genetic algorithm, the convergence speed, and whether the optimal solution can be found. In order to obtain better scheduling results, this application uses the speedup ratio to calculate the fitness function, that is, the time to complete all tasks before scheduling divided by the time to complete all tasks after scheduling. However, as the genetic algorithm progresses, the fitness fluctuation becomes smaller, and a smaller difference may cause the algorithm to converge prematurely and fall into a local optimum.

[0035] S3. Use the improved genetic algorithm to perform multiple iterations to obtain the target fitness function, and then obtain the target priority queue and the target processor queue, that is, the target scheduling result.

[0036] Furthermore, the specific content of using the improved genetic algorithm in S3 to perform multiple iterations to obtain the target fitness function, and then obtain the target priority queue and the target processor queue, that is, the target scheduling result is: S301. Determine the initial task priority sequence according to the task dependency relationship, and randomly determine the processor sequence for task allocation. Combine the priority queue and the processor mapping queue to form the genetic algorithm chromosome, and initialize the priority queue and the processor mapping queue respectively.

[0037] Further, in S301, the chromosome is first evenly divided, with the first half being the processor numbers assigned to the subtasks and the second half being the priority numbers of the subtasks in the task queue.

[0038] The chromosome encoding for task scheduling using the genetic algorithm is the processor mapping encoding.

[0039] The method of simultaneously changing the priority number and the processor number mapping during iteration can not only improve the scheduling efficiency, but also search for the optimal solution globally, enhancing the scheduling effect.

[0040] The processor mapping part is initialized using the method of random encoding.

[0041] The priority queue is initialized using two random priority sorting methods or the HEFT or CPOP algorithm.

[0042] This application combines the priority queue and the processor mapping queue to form the encoding of the genetic algorithm chromosome. The first half of the chromosome is the processor number assigned to the subtask, and the second half is the priority of the subtask in the task queue. In some studies, the chromosome encoding for task scheduling using the genetic algorithm is the processor mapping encoding, which may lead to the inability to search for the optimal solution. For example, when using the processor mapping queue as the chromosome encoding, it is necessary to first determine the priority and then write the fitness function, which limits the search scope to only one execution order and is prone to falling into the local optimal solution. Therefore, the method proposed in this application of simultaneously changing the priority and the processor mapping during iteration can not only improve the scheduling efficiency, but also search for the optimal solution globally, enhancing the scheduling effect.

[0043] To improve the solution quality of the algorithm, the generation of the initial population should not only ensure the diversity of the population but also be representative, capable of representing the characteristics of the solution space. In this way, while reducing the probability of premature convergence, the convergence speed can also be increased. Therefore, the present invention adopts different initialization methods for the front and rear parts of the chromosome encoding. For the processor mapping part, to achieve the diversity of the population, a random encoding method is used to ensure the wide distribution of the population. Since there are fewer reasonable categories for the priority queue compared to the processor mapping queue, several representative priority sorting methods are used for initialization, namely two random priority sortings and the priorities calculated by the HEFT (Heterogeneous-Earliest-Finish-Time) and CPOP (Critical-Path-on-a-Processor) algorithms.

[0044] S302. Select chromosomes using the tournament selection method.

[0045] During tournament selection, reduce the pressure on all chromosomes in the current iteration population, and increase the probability of low-fitness individuals being selected by adding random numbers.

[0046] This application uses tournament selection for chromosome selection. However, to reduce the selection pressure and increase the possibility of low-fitness individuals being selected, a random number is added when comparing fitness to increase the diversity of the population. The range of the random number depends on the specific experimental situation.

[0047] S303. Perform sub-path crossover processing on the task priority queue based on the sub-path crossover method; the crossover part performs sub-path crossover processing on the task priority queue, thereby ensuring the correctness of the task dependency relationship.

[0048] Further, the specific content of the front and rear recombination of the chromosome based on the sub-path crossover method in 303 is as follows: For one chromosome randomly select a continuous group of gene values, such as , and then search for the same gene values in , and replace the gene group in in the order of the selected genes in , keeping other genes unchanged. After replacement, the obtained is . Similarly, two new and compliant offspring chromosomes after recombination are obtained. .

[0049] The process of selecting two chromosomes from the current generation for recombination to generate a pair of new individuals is called crossover. Crossover can improve the diversity of the population and enhance the optimization ability of the population, and it is one of the core parts of the genetic algorithm. This application recombines the front and back of the chromosome based on the methods of single-point crossover and sub-path crossover. As Figure 2 shown, it is the single-point crossover of the processor mapping part. The two chromosomes start to crossover at the sixth node, and the genes before and after are exchanged to obtain two new offspring chromosomes.

[0050] For the priority queue part, its order cannot be changed randomly, and crossover needs to be carried out while ensuring its correctness. To ensure that the data dependence is still satisfied after the priority queue crossover, this application adopts the method based on sub-path crossover. As Figure 3 shown, in one of the chromosomes a continuous group of gene values is randomly selected, such as , and then the same gene values are searched in , and the genes in are replaced in the order of the selected genes in , keeping other genes unchanged. After replacement, becomes . Similarly, two brand-new and compliant offspring chromosomes are obtained after recombination.

[0051] S304: Random mutation is performed on the processor mapping part, and regular mutation is performed on the priority queue part. Mutation controls the convergence speed of the algorithm iteration by adaptively changing the mutation rate during iteration.

[0052] The specific content of performing random mutation on the processor mapping part and regular mutation on the priority queue part in S304 is as follows: First, a gene value is randomly selected in a chromosome, and it is defined that task is the second assigned. At the same time, the first precursor node and the first successor node of are searched in this queue, that is, task and task . At this time, can be randomly inserted between task and . After insertion, the order of other tasks remains unchanged and they move forward or backward in turn, thus completing one mutation.

[0053] At the same time, an adaptive mechanism is added. In the early stage of iteration, the mutation rate is 0.8 to expand the search range and jump out of the local optimal solution. In the later stage of iteration, the mutation rate drops to 0.1 to accelerate the convergence speed and avoid too long iteration time.

[0054] Mutation is also one of the cores of the genetic algorithm. By randomly changing a part of the genes of an individual, new chromosomes are introduced to increase the diversity of the population, enabling search in the unknown solution space and avoiding being trapped in local optima. Similar to crossover, random mutation is performed on the processor mapping part, and for the mutation of the priority queue part, the principle of correct dependency must also be followed.

[0055] In addition, an adaptive mechanism is added to the mutation part of this application. In the early stage of the algorithm, the mutation rate is 0.8. Because a higher mutation rate can accelerate the improvement of population diversity, expand the search range, and jump out of local optimal solutions. However, if the mutation rate is too large, the algorithm will become a random search and lose its effect. Therefore, when the iteration reaches a certain number of times, the mutation rate drops to 0.1, which not only ensures the scheduling effect of the genetic algorithm but also accelerates the convergence speed and avoids too long iteration time.

[0056] S305. Adopt the elite retention strategy to retain the target scheduling result, that is, the best scheduling result, in each generation of the population, that is, retain the result with the shortest total task completion time to reduce the iteration time.

[0057] S306. Adopt the degradation and extinction mechanism to further optimize the target scheduling result, ensure the improvement of the final scheduling effect, and reduce the possibility of being trapped in local optima. Since the task scheduling problem itself is an NP-complete problem and is extremely likely to be trapped in local optimal solutions during the genetic algorithm iteration process, in order to further reduce the possibility of being trapped in local optimal solutions, this application proposes the elite retention, degradation, and extinction mechanisms. First, elite retention, that is, after each iteration ends, the individual with the highest fitness in this generation is saved to the elite population, and the best individual in each generation is separately retained. At the same time, after multiple iterations, the individual with the highest fitness after each iteration is exchanged with the individual with the lowest fitness in the elite population, which not only retains the better solutions but also increases the diversity of the population. Degradation and extinction are timely stop-loss mechanisms for premature convergence. If it is judged during the iteration process that the algorithm is about to converge prematurely, the population at this time is degraded to the previous population, and at the same time, the chromosomes removed by elite retention are re-introduced. If the number of degradations is too large, the population becomes extinct, and the genetic algorithm iteration starts again from the first-generation population.

[0058] S307. Repeat S302 - S306 to iteratively obtain the target scheduling result.

[0059] A task scheduling system based on priority transformation in a heterogeneous platform, including: Information acquisition unit: Acquire heterogeneous platform task information, analyze the heterogeneous platform task information to obtain task dependencies, task execution times, task data traffic, and communication speeds between different processors.

[0060] Function writing unit: Write an initial fitness function according to the completion time ratio before and after task scheduling, i.e., the speedup ratio, and construct a final fitness function based on the initial fitness function. The completion time before task scheduling is the sum of the execution times of all tasks on a single processor. The completion time after task scheduling refers to the total task time obtained according to the current scheduling result after one iteration of the genetic algorithm, which includes the data communication time between tasks, that is, the data communication volume between tasks with data dependence but on different processors multiplied by the communication speed.

[0061] Result generation unit: Use the improved genetic algorithm to perform multiple iterations to obtain the target fitness function, and then obtain the target priority queue and target processor queue, that is, the target scheduling result.

[0062] An electronic device, characterized in that it includes a memory and a processor. A computer program is stored in the memory, and when the processor calls the computer program in the memory, it implements the content of the task scheduling method based on priority transformation in a heterogeneous platform.

[0063] A storage medium, characterized in that a computer executable instruction is stored in the storage medium, and when the computer executable instruction is loaded and executed by a processor, it implements the content of the task scheduling method based on priority transformation in a heterogeneous platform.

[0064] Compared with the classical CPOP and HEFT algorithms, as Figure 4 shown, in the figure are the Modified Genetic Algorithm (MGA), the Critical Path on a Processor (CPOP), the Heterogeneous Earliest Finish Time (HEFT), P1, P2, and P3, which are three different processors respectively. The scheduling effect of MGA is improved by 22.17% and 15.08% compared with the CPOP and HEFT algorithms respectively.

[0065] As Figure 5 、 Figure 6 shown are the convergence processes of MGA and SGA respectively. Figure 5It is the convergence graph of the Modified Genetic Algorithm (MGA) based on priority transformation. As can be seen from the graph, the fitness values finally obtained by this algorithm are all stable at 7.63863, and the four simulations all converge before 50 iterations. Simulation 2 also jumps out of the local optimum and obtains the final result after degradation and extinction. It can be seen that this algorithm can not only find a better scheduling method, but also improve the convergence speed, and has the ability to stably obtain the optimal solution, achieving a huge improvement compared to the standard genetic algorithm. Figure 6 It is the convergence graph of the Standard Genetic Algorithm (SGA) to obtain the scheduling effect. When conducting the simulation experiment, in order to observe the effect of the algorithm, five simulation experiments were carried out for each algorithm. As can be seen from the graph, the fitness values obtained from multiple simulations are 7.27327, and it can be seen that Simulation 3 reaches a fitness value of 7.53241. It can be seen that the other simulations do not reach the optimal solution. The highest final convergence value of SGA is about 7.3791, while the final convergence value of MGA can reach 7.6396, proving that the method used in this invention is easier to find the global optimal solution compared to the traditional genetic algorithm. At the same time, the use of elitist retention in MGA not only makes the curve in the first half of the algorithm smoother, but also reduces the probability of falling into the local optimal solution, and the existence of the degradation and extinction mechanism ensures that the final convergence result of MGA must be the optimal fitness, greatly improving the optimization efficiency.

[0066] Embodiment To obtain the scheduling result, it is necessary to first obtain the dependency relationship between tasks, as well as the task execution time and data communication volume.

[0067] The following two tables are taken as examples in this application.

[0068] Table 1 Execution time of tasks on the processor (unit: microseconds) ;

[0069] Table 2 Task dependency relationship and data transfer size (unit: KB) ;

[0070] Thus, the dependency relationship of this task is as Figure 7 shown. The task model is represented by a Directed Acyclic Graph (DAG), and it is defined as , where represents the numbers of sub-task nodes, and represents the directed edges between each sub-node. At the same time, this application assumes that The execution time after being assigned to the specified processor Is the weight of the directed edge, representing the data transfer time between two sub-task nodes.

[0071] After obtaining the above data, the fitness function is first written as follows: .

[0072] Among them Represents the time to complete all tasks before scheduling; Represents the time to complete all tasks after scheduling.

[0073] In order to obtain a shorter total task execution time, the present invention calculates in an insertable manner , for the tasks executed successively on the processor , if there is enough idle time between two tasks, another task can be inserted to execute during the idle time, thus avoiding waste of time and improving the scheduling effect. The specific calculation rules are as follows.

[0074] First Represents the initial start time of task on the processor , as shown in Equation (1).

[0075] (1).

[0076] Among them Represents the amount of communication between tasks, Represents the ready time when the processor is in an idle state and ready to execute a new task. Is 's predecessor task 's initial completion time (earliest completion time) on the processor , that is, the initial start time plus 's execution time on the processor , as shown in Equation (2).

[0077] (2).

[0078] Among them Is the execution time of task on the processor .

[0079] Now assume that there are two already assigned tasks on the processor , and is not continuous, after There is an idle time before starting, and when another task is also assigned to the processor and if it meets the conditions of Equation (3), it can be assigned to execute within this idle time period in an insertable manner.

[0080] (3).

[0081] Among them, is the execution time of task on the processor .

[0082] After all tasks are assigned in an insertable manner, the final execution time is Equation (4).

[0083] (4).

[0084] At the same time, this application assumes that the total un-scheduled execution time is the time when all tasks are executed on the processor , as shown in Equation (5).

[0085] (5).

[0086] Among them, is the execution time of task on the processor .

[0087] Then the final fitness function can be obtained from Equation (6).

[0088] (6).

[0089] After completing the writing of the fitness function, the steps of the improved genetic algorithm are carried out in sequence. First, an initial population is generated. The present invention uses different initialization methods for the front and back parts of the chromosome coding. For the processor mapping part, to achieve the diversity of the population, a random coding method is adopted to ensure the wide distribution of the population; while there are fewer reasonable existing categories for the priority queue compared to the processor mapping queue, so several representative priority sorting methods are used for initialization, which are respectively two random priority sortings and the priorities calculated by the HEFT and CPOP algorithms.

[0090] Then, selection, crossover, and adaptive mutation are carried out. By comparing two randomly selected chromosomes, the one with higher fitness enters the next iteration. However, to reduce the selection pressure and increase the possibility of lower-fitness individuals being selected, a random number is added when comparing fitness to increase the diversity of the population. Then, single-point crossover and sub-path crossover are used for the processor mapping part and the priority queue part respectively to achieve the recombination of chromosomes while ensuring correctness. Then, the mutation of chromosomes is completed by randomly selecting a point for mutation, and the convergence speed of the algorithm is controlled by the adaptive mutation rate. Finally, after completing the iteration of the population, the global optimal solution is obtained through the screening of elite retention, degradation, and extinction, and the above steps are repeated in a loop until the algorithm converges to obtain the final scheduling result.

[0091] Finally, it should be noted that the above embodiments are only used to illustrate the technical method of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those of ordinary skill in the art should understand that they can still modify or equivalently replace the technical method of the present invention, and these modifications or equivalent replacements cannot make the modified technical method deviate from the spirit and scope of the technical method of the present invention.

Claims

1. A task scheduling method based on priority transformation in a heterogeneous platform, characterized in that, It includes the following steps: S1. Obtain heterogeneous platform task information, and analyze the heterogeneous platform task information to obtain task dependencies, task execution time, task data traffic, and communication speed between different processors; S2. Write an initial fitness function according to the completion time ratio before and after task scheduling, i.e., the speedup ratio, and construct a final fitness function based on the initial fitness function. The completion time before task scheduling is the sum of the execution times of all tasks on a single processor. The completion time after task scheduling refers to the total task time obtained according to the current scheduling result after one iteration of the genetic algorithm, which includes the data communication time between tasks, that is, the data traffic between tasks with data dependencies but on different processors multiplied by the communication speed; S3. Use an improved genetic algorithm to perform multiple iterations to obtain the target fitness function, and then obtain the target priority queue and target processor queue, that is, the target scheduling result.

2. The task scheduling method based on priority transformation in a heterogeneous platform according to claim 1, wherein, The expression of the initial fitness function in S2 is: ; Among them, represents the fitness size, represents the ratio of the completion time before and after scheduling, represents the time to complete all tasks on only one type of processor before scheduling; represents the time to complete all tasks after scheduling.

3. The task scheduling method based on priority transformation in a heterogeneous platform according to claim 2, wherein, The specific content of constructing the final fitness function based on substituting into the initial fitness function in S2 is to calculate in an insertion manner , and substitute into the initial fitness function to obtain the final fitness function.

4. The task scheduling method based on priority transformation in a heterogeneous platform according to claim 3, characterized in that Calculate using an insertable method The specific content is as follows: For tasks executed successively on a processor there is idle time between the two tasks, allowing another task to be inserted and executed during the idle time. The specific calculation rule is as follows: ​ First indicating the task at the initial start time on the processor is expressed as: The expression of ; Among them, represents the communication volume between tasks, represents the processor idle state and the ready time to execute a new task, is the entry child node, i.e., the initial subtask, is the task number, is the processor, is the task dependency task set; For the predecessor task of the initial completion time on the processor is, that is, the initial start time plus the execution time on the processor , and the expression of ; Among them, is the execution time of the task on the processor ; On the processor There are two tasks that have been allocated , and are not continuous After the end to Before the start, there is idle time, and when another task is also allocated to the processor When it meets the preset conditions, it is allocated to execute during this idle time in an inserted manner; The expression of the preset condition is: ; Wherein, is the execution time of the task on the processor ; After all tasks are allocated in an insertive manner, the final execution time is obtained. The expression of the final execution time is: ; Among them, is the exit sub-node, that is, the last sub-task, indicating a certain processor where the task is located, is the exit sub-node, that is, the last sub-task at the processor where it is located and the initial completion time on it; The total execution time without scheduling is the time when all tasks are executed on the processor is , The expression for ; Among them, is the time for a task to be executed on the processor, N and is the total number of tasks.

5. The task scheduling method based on priority transformation in a heterogeneous platform according to claim 4, characterized in that The expression of the final fitness function is: ; Among them, is the exit child node, that is, the last subtask, represents a certain processor where the task is located, is the processor , N is the total number of tasks, is the task executed on the processor at the time of.

6. The task scheduling method based on priority transformation in a heterogeneous platform according to claim 5, wherein, The specific content of using the improved genetic algorithm in S3 to perform multiple iterations to obtain the target fitness function, and then obtaining the target priority queue and target processor queue, that is, the target scheduling result is: S301. Determine the initial task priority sequence according to the task dependencies, and randomly determine the processor sequence for task allocation. Combine the priority queue and the processor mapping queue to form the genetic algorithm chromosome, and initialize the priority queue and the processor mapping queue respectively; S302. Use the tournament selection method to select chromosomes; When performing tournament selection, reduce the pressure on all chromosomes in the current iteration population, and increase the probability of low-fitness individuals being selected by adding random numbers; S303. Perform sub-path crossover processing on the task priority queue based on the sub-path crossover method; The crossover part performs sub-path crossover processing on the task priority queue to ensure the correctness of task dependencies; S304. Perform random mutation on the processor mapping part and regular mutation on the priority queue part. The mutation controls the convergence speed of the algorithm iteration by adaptively changing the mutation rate during iteration; S305. Use the elitist retention strategy to retain the target scheduling result in each generation of population; S306. Use the degradation and extinction mechanism to further optimize the target scheduling result; S307. Repeat S302 - S306 to iteratively obtain the target scheduling result.

7. A task scheduling method based on priority transformation in a heterogeneous platform according to claim 6, characterized in that In S301, the chromosome is first evenly divided, and the first half is the processor number to which the subtask is assigned, and the second half is the priority number of the subtask in the task queue; The chromosome encoding for task scheduling using the genetic algorithm is the processor mapping encoding; The processor mapping part is initialized using the random encoding method; The priority queue is initialized using two random priority sorting methods or the HEFT or CPOP algorithm; 8. A task scheduling method based on priority transformation in a heterogeneous platform according to claim 6, characterized in that The specific content of the front and back recombination of the chromosome based on the sub-path crossover method in S303 is: One of the chromosomes Randomly select a continuous set of gene values, and then search in for the same gene values, and replace the genomes of the selected genes in the order of the selected genes in , keeping the other genes unchanged. Similarly, two new and compliant offspring chromosomes after recombination are obtained in this way. .

9. The task scheduling method based on priority transformation in a heterogeneous platform according to claim 6, wherein The specific content of randomly mutating the processor mapping part and regularly mutating the priority queue part in S304 is as follows: First, randomly select a gene value in a chromosome to define the task is the second assigned, and at the same time, find 's first predecessor node and first successor node in the queue, that is, task and task . At this time can be randomly inserted between tasks and . After insertion, the order of other tasks remains unchanged and they move forward or backward in sequence, thus completing one mutation; Meanwhile, an adaptive mechanism is added. In the early stage of iteration, the mutation rate is 0.8 to expand the search scope and jump out of the local optimal solution. In the later stage of iteration, the mutation rate drops to 0.1 to accelerate the convergence speed and avoid too long iteration time.

10. A task scheduling system based on priority transformation in a heterogeneous platform, characterized in that, It includes: Information acquisition unit: Acquire heterogeneous platform task information, and analyze the heterogeneous platform task information to obtain task dependencies, task execution times, task data traffic, and communication speeds between different processors; Function writing unit: Write an initial fitness function according to the completion time ratio before and after task scheduling, that is, the speedup ratio, and construct a final fitness function based on the initial fitness function. The completion time before task scheduling is the sum of the execution times of all tasks on a single processor. The completion time after task scheduling refers to the total task time obtained according to the current scheduling result after one genetic algorithm iteration, which includes the data communication time between tasks, that is, the data traffic between tasks with data dependencies but on different processors multiplied by the communication speed; Result generation unit: Use the improved genetic algorithm to perform multiple iterations to obtain the target fitness function, and then obtain the target priority queue and target processor queue, that is, the target scheduling result.

Citation Information

Patent Citations

  • Heterogeneous multi-core energy-saving task schedule method based on improved genetic algorithm

    CN102508708A

  • Task scheduling method, device and equipment for multiple pieces of Internet of Things equipment and storage medium

    CN118916126A

  • Cloud task scheduling method based on phagocytosis-based hybrid particle swarm optimization and genetic algorithm

    US20210133534A1