A multi-type task scheduling method based on a heterogeneous processor platform

By modeling tasks as DAG tasks on heterogeneous processor platforms, calculating processor scores and cluster scores, and rationally allocating resources, the problems of poor task schedulability and resource waste in existing technologies are solved, and the acceptance rate of task execution and resource utilization are improved.

CN118963930BActive Publication Date: 2025-10-14HUAZHONG UNIV OF SCI & TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410878733.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-02
Publication Date
2025-10-14
Estimated Expiration
2044-07-02

AI Technical Summary

Technical Problem

Existing multi-type task scheduling methods for heterogeneous processor platforms only consider the speed ranking of processors executing subtasks when performing scheduling, resulting in poor task schedulability and waste of computing resources, leading to a low acceptance rate of the platform executing DAG tasks.

Method used

Each type of subtask in the task set to be executed on a heterogeneous multi-processor platform is modeled as a directed acyclic graph (DAG) task. The worst execution time of each type of subtask on different types of processors is calculated. The processor score and cluster score are calculated based on the speed sequence. A reasonable processor cluster is selected to execute the task, and a new processor cluster is constructed to meet the schedulability requirements.

Benefits of technology

It improves the acceptance rate of DAG tasks executed by heterogeneous processor platforms, reasonably allocates computing resources, improves the utilization and execution efficiency of computing resources, and is suitable for multi-type task scheduling on heterogeneous multi-processor platforms.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118963930B_ABST
    Figure CN118963930B_ABST
Patent Text Reader

Abstract

The application discloses a multi-type task scheduling method based on a heterogeneous processor platform and belongs to the technical field of operating system control, which calculates processor scores of each type of processor under each DAG task in a current to-be-executed task set according to a speed sequence of each type of subtask in executing tasks on each type of processor; pre-allocates processors for each DAG task according to the processor scores and determines cluster scores of the processor clusters; selects a DAG task with the highest cluster score from the current to-be-executed task set, judges whether the DAG task has schedulability on an existing single-processor cluster, and then executes the DAG task according to the schedulability of the corresponding processor cluster until all the DAG tasks in the current to-be-executed task set are completed scheduling. Compared with the prior scheduling method, the application comprehensively considers the speed of the processor in executing tasks and the efficiency of scheduling tasks, can schedule more DAG tasks, and makes the acceptance rate of the platform in executing the DAG tasks higher.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application belongs to the technical field of operating system control, and more particularly relates to a multi-type task scheduling method based on a heterogeneous processor platform. BACKGROUND

[0002] With the development of industrial modernization, real-time embedded systems have been applied in many fields of human life and production. People's demand for real-time embedded systems in safety and quality of service continues to grow, and more and more new functions are gradually implemented in real-time embedded systems, so the requirement for the computing power of real-time embedded systems is also increasing. Higher computing performance and energy efficiency requirements have gradually shifted the focus of research in this field from academia and industry to heterogeneous multi-processors. Heterogeneous multi-processors contain multiple computing cores, and different types of cores have different performance and functional characteristics. Parallel application programs in real-time embedded systems can be executed in parallel on a heterogeneous processor platform to meet stringent performance and real-time requirements. However, a major difficulty in implementing hard real-time systems on a heterogeneous processor platform is the need to design an effective scheduling algorithm and perform schedulability analysis to ensure the real-time performance of parallel applications on the heterogeneous platform.

[0003] Currently, the scheduling algorithm research for real-time embedded systems is usually based on a directed acyclic graph (DAG) to model parallel application programs as DAG tasks. A DAG task is composed of a set of nodes and corresponding edges, where a node represents a subtask under the DAG task, and an edge represents the dependency relationship between two subtasks. In addition, to represent different types of subtasks in multi-type tasks, each node in the DAG task corresponds to a subtask type. When executing multi-type tasks on a heterogeneous multi-processor platform, the speed at which a processor executes a subtask is determined by both the processor type and the subtask type. Therefore, the complex speed relationship between subtasks in the DAG and heterogeneous processors makes the research of scheduling methods challenging.

[0004] Existing multi-type task scheduling methods for heterogeneous processor platforms only consider the speed ranking of processors executing subtasks when performing scheduling, which results in poor schedulability and waste of computing resources, leading to a low acceptance rate of the platform executing DAG tasks. SUMMARY

[0005] In view of the above defects or improvement needs of the prior art, the present application provides a multi-type task scheduling method based on a heterogeneous multi-processor platform to solve the technical problem of low acceptance rate when a heterogeneous multi-processor platform executes a DAG task.

[0006] To achieve the above-mentioned purpose, according to one aspect of the present application, a multi-type task scheduling method based on a heterogeneous processor platform is provided, comprising:

[0007] S1: Model each type of subtask in the task set to be executed on a heterogeneous multi-processor platform as a directed acyclic graph (DAG) task to obtain the worst-case execution time of each type of subtask on different types of processors;

[0008] S2: Calculate the execution speed sequence of each type of subtask on each type of processor using the worst execution time corresponding to each type of subtask;

[0009] S3: Calculating processor scores for each type of processor under each DAG task in the current set of tasks to be executed based on the speed sequence; pre-allocating a processor to each DAG task in the current set of tasks to be executed based on the processor scores to determine a cluster score for the processor cluster to which each DAG task belongs;

[0010] S4: Select the DAG task with the highest cluster score from the current set of tasks to be executed, and determine whether it is schedulable on the existing single-processor cluster; if so, execute the DAG task sequentially on the single-processor cluster with the highest processor score; otherwise, build a new processor cluster based on the pre-assigned processors, and control the new processor cluster to execute the DAG task according to the subtask ready queue and subtask type priority queue corresponding to the DAG task;

[0011] S5: Update the current set of tasks to be executed and enter S3 until all DAG tasks in the current set of tasks to be executed are scheduled.

[0012] In one embodiment, the S3 includes:

[0013] S31: Create an empty temporary processor cluster for each DAG task in the current task set to be executed;

[0014] S32: Calculating the execution speed of each type of processor at different indexes in all speed sequences according to the speed sequence;

[0015] S33: Calculating processor scores of various types of processors under different DAG tasks in the current set of tasks to be executed using execution speed;

[0016] S34: Processors with high processor scores are preferentially assigned to the temporary processor cluster that executes the corresponding DAG task. Each time a processor is assigned to the temporary processor cluster, the schedulability of the DAG task is determined. If the DAG task is schedulable, processor allocation is stopped and the corresponding processor pre-allocation result is obtained. Otherwise, processor allocation continues until the DAG task is schedulable or no processors are available for allocation, and the DAG task is deemed unschedulable.

[0017] S35: Calculate a cluster score of the current temporary processor cluster according to the processor pre-allocation result, where the cluster score is the sum of the processor scores of all processors in the cluster.

[0018] In one embodiment, the S32 includes:

[0019] Using the formula Calculate the execution speed of each type of processor at different indexes in the speed sequence of all subtasks; Represents a temporary processor cluster Processor in As a DAG task Internal subtasks The speed sequence of Processor-hour execution speed, Represents a DAG task Internal subtasks All on the platform processors Fast speed, For DAG tasks Internal subtasks In temporary processor clusters Processor in The worst execution time on .

[0020] In one embodiment, the S33 includes:

[0021] Using the formula Calculate the processor score of each type of processor relative to each DAG task;

[0022] in, For executing DAG tasks Processor cluster mid-processor Processor rating, for Internal subtasks In the processor The worst execution time on for Corresponding processor First Fast execution The sum of the worst execution times of the subtasks, is the total number of DAG tasks, For temporary processor clusters The total number of .

[0023] In one embodiment, the S4 includes:

[0024] S41: Select the DAG task with the highest cluster score from the current set of tasks to be executed, and calculate the utilization rate of each single processor cluster after adding it to the single processor cluster;

[0025] S42: If the utilization rate is less than or equal to the threshold, sequentially executing the DAG tasks on the single processor cluster with the highest processor score;

[0026] S43: If the utilization rate is greater than the threshold, a new processor cluster is constructed based on the pre-assigned processors, and the new processor cluster is controlled to execute the DAG task according to the subtask ready queue and subtask type priority queue corresponding to the DAG task; until all DAG tasks in the current task set to be executed are scheduled.

[0027] In one embodiment, the S41 includes:

[0028] Using the formula Calculate the utilization of each single-processor cluster after the DAG task with the highest score is added to the single-processor cluster;

[0029] in, For a single processor Cluster utilization, For single processor clusters The current set of tasks to be executed consists of all tasks executed on for Internal subtasks In the processor The worst execution time on is the total number of DAG tasks, The period of the DAG task.

[0030] In one embodiment, the S43 includes:

[0031] Build a new processor cluster based on the processor pre-allocation results, obtain the subtask ready queue and subtask type priority queue corresponding to the current DAG task, and execute the current DAG task on the new processor cluster:

[0032] When there is an idle processor, the subtask being executed is migrated to the idle processor as much as possible for faster execution, and then the subtask waiting to be executed is attempted to be scheduled to the idle processor according to the subtask ready queue and the subtask type priority queue.

[0033] According to another aspect of the present invention, a multi-type task scheduling device based on a heterogeneous processor platform is provided, comprising:

[0034] A modeling module is used to model each type of subtask in the task set to be executed on a heterogeneous multi-processor platform as a directed acyclic graph (DAG) task to obtain the worst-case execution time of each type of subtask on different types of processors;

[0035] A calculation module, configured to calculate a speed sequence of each type of subtask executing tasks on each type of processor using the worst execution time corresponding to each type of subtask;

[0036] A scoring module is configured to calculate a processor score for each type of processor under each DAG task in the current set of tasks to be executed based on the speed sequence; pre-assign a processor to each DAG task in the current set of tasks to be executed based on the processor score to determine a cluster score for the processor cluster to which each DAG task belongs;

[0037] The scheduling module is used to select the DAG task with the highest cluster score from the current set of tasks to be executed, and determine whether it is schedulable on the existing single-processor cluster; if so, the DAG task is sequentially executed on the single-processor cluster with the highest processor score; otherwise, a new processor cluster is constructed based on the pre-assigned processors, and the new processor cluster is controlled to execute the DAG task according to the subtask ready queue and subtask type priority queue corresponding to the DAG task;

[0038] The loop module is used to update the current set of tasks to be executed and transmit the current set of tasks to be executed to the scoring module until all DAG tasks in the current set of tasks to be executed are scheduled.

[0039] According to another aspect of the present invention, an electronic device is provided, comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the method when executing the computer program.

[0040] According to another aspect of the present invention, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of the method described above are implemented.

[0041] In general, the above technical solutions conceived by the present invention can achieve the following beneficial effects compared with the prior art:

[0042] (1) The present invention provides a multi-type task scheduling method based on a heterogeneous processor platform. The method calculates the processor score of each type of processor under each DAG task in the current set of tasks to be executed based on the speed sequence of each type of subtask executing tasks on each type of processor, and comprehensively evaluates the actual execution speed and workload of the subtask on the processor; pre-allocates a processor to each DAG task in the current set of tasks to be executed based on the processor score to determine the cluster score of the processor cluster to which each DAG task belongs; selects the DAG task with the highest cluster score from the current set of tasks to be executed, determines whether it is schedulable on an existing single processor cluster, and then selects the corresponding processor cluster to execute the DAG task based on whether it is schedulable, until all DAG tasks in the current set of tasks to be executed are scheduled. Compared with the existing scheduling method process, the multi-type task scheduling method provided by the present invention comprehensively considers the speed of processor execution and the efficiency of scheduling tasks, can schedule and execute more DAG tasks in the set of tasks to be executed, and the allocation of processors when the cluster is constructed is more reasonable, which ultimately makes the platform have a higher acceptance rate for executing DAG tasks. In addition, the heterogeneous multi-processor platform on which the multi-type task scheduling method provided by the present invention is based can model the platforms of various types of processors and proprietary application accelerators today. At the same time, the DAG model on which the scheduling method is based can reflect the structural characteristics of most parallel applications and has good versatility.

[0043] (2) In this scheme, the execution speed of each type of processor at different indexes in all speed sequences is calculated based on the speed sequence; the processor score of each type of processor under different DAG tasks in the current set of tasks to be executed is calculated using the execution speed, taking into account the two factors of the speed and workload of the processor in executing the corresponding subtask, and realizing the performance score of the processor in executing the DAG task.

[0044] (3) This scheme uses the formula Calculating the execution speed of each type of processor at different indexes in the speed sequence of all subtasks has low computational complexity and can improve the execution efficiency of the entire algorithm.

[0045] (4) This scheme uses the formula Calculates the processor score of each type of processor relative to each DAG task; considers the processor workload and uses the ranking in the speed series as the weight of the processor score, which more clearly reflects the efficiency of the processor in executing DAG tasks.

[0046] (5) This scheme selects the DAG task with the highest cluster score from the current set of tasks to be executed, calculates the utilization rate of each single processor cluster after it is added to the single processor cluster, and selects the corresponding processor cluster to execute the DAG task with the highest cluster score based on the relationship between the utilization rate and the threshold.

[0047] (6) This scheme uses the formula The utilization rate of each single-processor cluster after the DAG task with the highest score is added to the single-processor cluster is calculated; the possibility of the current DAG task being executed on the existing single-processor cluster is considered, thereby improving the utilization rate of computing resources.

[0048] (7) The subtask ready queue and subtask type priority queue provided by this solution can schedule subtasks that are more suitable for execution on the processor based on the type of idle processor when scheduling a single DAG task on a cluster containing multiple processors, thereby improving the execution efficiency of subtasks on the processor. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] Figure 1 1 is a flow chart of a multi-type task scheduling method based on a heterogeneous multi-processor platform provided by Example 1 of the present invention;

[0050] Figure 2 This is a schematic diagram of the structure of the subtask type priority queue provided in Example 1 of the present invention;

[0051] Figure 3 This is a schematic diagram of the structure of the task ready queue provided in Example 1 of the present invention;

[0052] Figure 4 This is a flow chart of the single DAG task scheduling method provided in Example 1 of the present invention;

[0053] Figure 5 This is a flow chart of the method for scheduling a DAG task set to be executed provided in Example 1 of the present invention. DETAILED DESCRIPTION

[0054] In order to make the objectives, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely for the purpose of explaining the present invention and are not intended to limit the present invention. In addition, the technical features involved in the various embodiments of the present invention described below may be combined with each other as long as they do not conflict with each other.

[0055] Example 1

[0056] like Figure 1 As shown, this embodiment provides a multi-type task scheduling method based on a heterogeneous processor platform, including S1-S5.

[0057] S1: Model each type of subtask in the task set to be executed on the heterogeneous multi-processor platform as a directed acyclic graph (DAG) task to obtain the worst-case execution time of each type of subtask on different types of processors.

[0058] Specifically, a set of pending tasks to be executed on a heterogeneous multi-processor platform in a real-time embedded system is obtained, a DAG model is performed on each task in the pending task set, and the worst execution time of each subtask on different types of processors is obtained.

[0059] Specifically, for the heterogeneous multi-processor platform in this step, it contains processors, of which the number of processor types is ( ), the processor has index ,The set of processor indices is composed of Said, "Processor " indicates that it has an index processor.

[0060] For the set of tasks to be executed in this step, it is composed of It is composed of DAG tasks, represented as , DAG task Represents a task in the set of tasks to be executed, which has an index , each Cycle Repeated release, after release, must be within its relative deadline Complete execution within With an implicit deadline, .

[0061] For the DAG task in this step, a DAG task By node set and edge sets , where the node set Depend on All nodes, a node represents a subtask within the DAG task, With index ( ), edge set Depend on It is composed of all directed edges in , reflecting the dependency relationship between subtasks. , it means that when the subtask When the subtask completes execution, It enters the ready state and waits for execution. The number of subtask types included is , a subtask Belongs to a subtask type ,Subtask type set ,in The index of the subtask type.

[0062] S2: Calculate the speed sequence of each type of subtask executing tasks on each type of processor using the worst execution time corresponding to each type of subtask.

[0063] Specifically, based on the worst execution time obtained in S1, the execution speed and speed sequence of each type of subtask on each type of processor are obtained. Specifically, this step includes the following sub-steps:

[0064] (2-1) Based on the worst execution time obtained by S1, calculate the speed of the subtask on the processor. The specific calculation formula is: ,in, Represents a DAG task Internal subtasks In the processor The execution speed of Represents a subtask The minimum of the worst-case execution time on all processors, Represents a subtask In the processor The worst execution time on .

[0065] (2-2) According to the speed of the subtask on the processor obtained in step (2-1), the speed sequence of the subtask is obtained, which is specifically expressed as: ,in, Represents a subtask In all processors Fast speed ( ), index value The smaller the number, the more subtasks The faster it executes on its corresponding processor.

[0066] S3: Calculate the processor score of each type of processor for each DAG task in the current set of tasks to be executed based on the speed sequence. Pre-assign a processor to each DAG task in the current set of tasks to be executed based on the processor score to determine the cluster score of the processor cluster to which each DAG task belongs.

[0067] S4: Select the DAG task with the highest cluster score from the current set of pending tasks and determine whether it is schedulable on an existing single-processor cluster. If so, execute the DAG task sequentially on the single-processor cluster with the highest processor score. Otherwise, construct a new processor cluster based on the pre-assigned processors and control the new processor cluster to execute the DAG task according to the subtask ready queue and subtask type priority queue corresponding to the DAG task.

[0068] S5: Update the current set of tasks to be executed and enter S3 until all DAG tasks in the current set of tasks to be executed are scheduled.

[0069] As an optional implementation, S3 includes: S31: creating an empty temporary processor cluster for each DAG task in the current set of tasks to be executed. S32: calculating the execution speed of each type of processor at different indexes in all speed sequences based on the speed sequence. S33: using the execution speed to calculate the processor score of each type of processor under different DAG tasks in the current set of tasks to be executed. S34: processors with high processor scores are preferentially assigned to the temporary processor cluster that executes the corresponding DAG task. Each time a processor is assigned to the temporary processor cluster, the schedulability of the DAG task is judged. If it is schedulable, the processor allocation is stopped, and the corresponding processor pre-allocation result is obtained. Otherwise, processors are continuously allocated until the DAG task is schedulable or no processor can be allocated, and the DAG task is deemed unschedulable. S35: calculating the cluster score of the current temporary processor cluster based on the processor pre-allocation result. The cluster score is the sum of the processor scores of all processors in the cluster.

[0070] As an optional implementation, S32 includes: using the formula Calculate the execution speed of each type of processor at different indexes in the speed sequence of all subtasks. Represents a temporary processor cluster Processor in As a DAG task Internal subtasks The speed sequence of Processor-hour execution speed, Represents a DAG task Internal subtasks All on the platform processors Fast speed, For DAG tasks Internal subtasks In temporary processor clusters Processor in The worst execution time on .

[0071] As an optional implementation, S33 includes: using the formula Calculate the processor score of each type of processor relative to each DAG task; where, For executing DAG tasks Processor cluster mid-processor Processor rating, for Internal subtasks In the processor The worst execution time on for Corresponding processor First Fast execution The sum of the worst execution times of the subtasks, is the total number of DAG tasks, For temporary processor clusters The total number of .

[0072] Specifically, based on the speed sequence obtained in S2, the processor scores of each processor type under different DAG tasks in the task set to be executed are obtained, and a processor is pre-allocated to each DAG task in the task set to be executed based on the processor score, and the cluster score of the processor cluster to which the DAG task belongs is obtained.

[0073] Specifically, this step includes the following sub-steps:

[0074] (3-1) Create an empty temporary processor cluster for each DAG task in the task set to be executed.

[0075] (3-2) According to the speed sequence obtained by S2, the execution speed of each processor at different indexes in the speed sequence of all subtasks is obtained. The specific calculation formula is: ;in, Represents a temporary processor cluster Processor in As a DAG task Internal subtasks The speed sequence of processor-hour execution speed.

[0076] (3-3) Based on the execution speed obtained in step (3-2), calculate the processor score of each processor relative to each DAG task. The specific calculation formula is: ;in, For executing DAG tasks Processor cluster mid-processor Processor rating, for Internal subtasks In the processor The worst execution time on for Corresponding processor First Fast execution The sum of the worst execution times of the subtasks.

[0077] (3-4) Based on the processor scores obtained in step (3-3), processors with high scores are preferentially assigned to the temporary processor cluster that executes the task. Each time a processor is assigned, the schedulability of the task is determined. If the task is schedulable, processor allocation is stopped and step (3-5) is entered. Otherwise, processor allocation continues until the task is schedulable or no processors are available, indicating that the task is unschedulable. Specifically, the schedulability analysis is performed by calculating the longest execution time of the task on the current temporary processor cluster. The specific calculation formula for the longest execution time is: ;in, Execute the current DAG task for a temporary processor cluster The longest execution time, for The sum of the minimum worst execution time of each subtask, for The minimum sum of the worst execution times of subtasks on the critical path, is the minimum speed of all processors on the platform, the heterogeneity factor It reflects the degree of difference between heterogeneous processors on the platform. The specific calculation formula is: ; Among them, the platform idle speed is the sum of the maximum execution speeds of other unexecuted subtasks on the processor, It is a subtask For a subset of the corresponding speed sequence, the maximum execution speed of each unexecuted subtask cannot be greater than the subtask In the processor The speed of execution ,Right now The elements in are not less than ,therefore The speed corresponding to the index in No more than If the maximum execution time No larger than DAG task Deadline , it means Can be scheduled on the current processor cluster, otherwise it means Not schedulable on the current processor cluster.

[0078] (3-5) Based on the processor pre-allocation result obtained in step (3-4), the cluster score of the current temporary processor cluster is calculated, which is the sum of the processor scores of all processors in the cluster.

[0079] As an optional implementation, S4 includes: S41: Select the DAG task with the highest cluster score from the current set of tasks to be executed, and calculate the utilization of each single processor cluster after it is added to the single processor cluster. S42: If the utilization is less than or equal to the threshold, the DAG task is executed sequentially on the single processor cluster with the highest processor score. S43: If the utilization is greater than the threshold, a new processor cluster is constructed based on the pre-assigned processors, and the new processor cluster is controlled to execute the DAG task according to the subtask ready queue and subtask type priority queue corresponding to the DAG task. Until all DAG tasks in the current set of tasks to be executed are scheduled.

[0080] As an optional implementation, S41 includes: using the formula Calculate the utilization of each single-processor cluster after the DAG task with the highest score is added to the single-processor cluster. For a single processor Cluster utilization, For single processor clusters The current set of tasks to be executed consists of all tasks executed on for Internal subtasks In the processor The worst execution time on is the total number of DAG tasks, The period of the DAG task.

[0081] As an optional implementation, S43 includes: building a new processor cluster based on the processor pre-allocation results, obtaining the subtask ready queue and subtask type priority queue corresponding to the current DAG task, and executing the current DAG task on the new processor cluster: when there are idle processors, migrate the executing subtasks to the idle processors as much as possible for faster execution, and then try to schedule the subtasks waiting to be executed to the idle processors according to the subtask ready queue and subtask type priority queue.

[0082] Specifically, based on the cluster score obtained in S3, the DAG task with the highest cluster score is selected to determine whether it is schedulable on the existing single-processor cluster. If so, the DAG task is executed sequentially on the single-processor cluster with the highest processor score. Otherwise, a processor cluster is constructed based on the pre-assigned processors, and the subtask ready queue and subtask type priority queue corresponding to the DAG task are obtained to execute the DAG task.

[0083] Specifically, this step includes the following sub-steps:

[0084] (4-1) Based on the cluster score obtained in S3, select the DAG task with the highest cluster score and calculate the utilization of each single-processor cluster after adding it to the single-processor cluster. This is the ratio of the sum of the minimum worst-case execution time of each subtask in each DAG task in the cluster to its period. The specific calculation formula is: ;in, For a single processor Cluster utilization, For single processor clusters The set of tasks to be executed consists of all tasks executed on the task list.

[0085] (4-2) Based on the utilization rate in step (4-1), determine whether the cluster utilization rate of the current DAG task is not greater than 1 after joining the existing single-processor cluster. If so, schedule the current DAG task to the single-processor cluster with the highest processor score for sequential execution. Otherwise, build a processor cluster based on the processor pre-allocation result obtained in step (3-4), obtain the subtask ready queue and subtask type priority queue corresponding to the DAG task, and proceed to step (4-3).

[0086] Specifically, if Figure 2 As shown, when the current DAG task cannot be executed on the existing single-processor cluster and needs to be executed on a multi-processor cluster, for the DAG task , build a subtask type priority queue ,in is the type of processor ( ), For the subtask type ( ). Each processor type corresponds to a subtask type priority queue. The subtask types in the queue are arranged in descending order according to the processor's execution speed of the subtask type. When scheduling subtasks waiting to be executed to an idle processor, the priority subtask type is queried in order from the corresponding subtask type priority queue based on the idle processor type. In addition, if Figure 3 As shown, build the subtask ready queue ,in is the index of the subtask type, satisfying . Subtasks in the queue All subtask ready queues form a subtask ready queue set. Preferably, the set can be implemented through a dictionary or hash table structure, where the key is the subtask type and the value is the subtask ready queue corresponding to the subtask type.

[0087] (4-3) Execute the current DAG task on the processor cluster constructed in step (4-2): When there are idle processors, first migrate the executing subtasks to the idle processors as much as possible for faster execution, and then try to schedule the subtasks waiting to be executed to the idle processors according to the subtask ready queue and the subtask type priority queue.

[0088] Specifically, if Figure 4 As shown in the figure, when a new DAG task is started or a subtask of the currently executing DAG task is completed, an idle processor will appear on the platform. First, the subtask execution queue is traversed to try to migrate the executing subtask to the idle processor for faster execution. Processing Speed Execution, Processor Becomes idle, subtask In the processor The execution speed on ,like , then the subtask in the subtask execution queue Migrate to processor If and only if there is no other subtask in the subtask execution queue (subtask being executed) that can be executed faster than its first ( ) Fast speed in processor When executing, the subtask It can be migrated. When there are no subtasks to migrate, try to schedule the subtasks waiting to be executed to the idle processor: according to the subtask type priority query result, schedule the subtasks from the corresponding subtask ready queue to the idle processor in order. Preferably, traverse all idle processors, and try to schedule the subtask with the subtask type indexed as 1 in the subtask priority queue to the current processor in turn. After completing the first traversal, if there are still idle processors and subtasks to be executed, traverse all idle processors again, and try to schedule the subtask with the subtask type indexed as 2 in the subtask priority queue to the current processor in turn, and so on, until there are no more idle processors or subtasks to be executed.

[0089] Finally, if Figure 5 As shown, steps S3-S4 are repeated until all DAG tasks in the task set to be executed are scheduled to the processor cluster, indicating that the task set to be executed is schedulable on the heterogeneous multi-processor platform.

[0090] Example 2

[0091] The embodiment provides a multi-type task scheduling device based on a heterogeneous processor platform, which comprises a modeling module, a calculation module, a scoring module, a scheduling module and a circulation module.

[0092] The modeling module is used for modeling each type of subtask in a task set to be executed on a heterogeneous multi-processor platform as a directed acyclic graph (DAG) task, so as to obtain the worst execution time of each type of subtask on different types of processors.

[0093] The calculation module is used for calculating a speed sequence of each type of subtask in executing a task on each type of processor by using the worst execution time corresponding to each type of subtask.

[0094] The scoring module is used for calculating processor scores of each type of processor under each DAG task in a current task set to be executed according to the speed sequence, pre-allocating processors for each DAG task in the current task set to be executed according to the processor scores, and determining cluster scores of processor clusters to which the DAG tasks belong.

[0095] The scheduling module is used for selecting a DAG task with the highest cluster score from the current task set to be executed, judging whether the DAG task has schedulability on an existing single-processor cluster, sequentially executing the DAG task on a single-processor cluster with the highest processor score if the DAG task has the schedulability, otherwise constructing a new processor cluster according to the pre-allocated processors, and controlling the new processor cluster to execute the DAG task according to a subtask ready queue and a subtask type priority queue corresponding to the DAG task.

[0096] The circulation module is used for updating the current task set to be executed, and transmitting the current task set to be executed to the scoring module until all the DAG tasks in the current task set to be executed are completed.

[0097] Embodiment 3

[0098] The embodiment provides an electronic device, which comprises a memory and a processor, the memory stores a computer program, and the processor implements the steps of the above method when executing the computer program.

[0099] Embodiment 4

[0100] The embodiment provides a computer readable storage medium, which stores a computer program, and the computer program implements the steps of the above method when executed by a processor.

[0101] Those skilled in the art can easily understand that the above description is only the preferred embodiment of the present application, and is not used to limit the present application, and any modification, equivalent replacement and improvement made within the spirit and principle of the present application should be included in the protection scope of the present application.

Claims

1. A multi-type task scheduling method based on a heterogeneous processor platform, characterized in that: include: S1: Model each type of subtask in the task set to be executed on a heterogeneous multi-processor platform as a directed acyclic graph (DAG) task to obtain the worst-case execution time of each type of subtask on different types of processors; S2: Calculate the execution speed sequence of each type of subtask on each type of processor using the worst execution time corresponding to each type of subtask; S3: Calculating processor scores for each type of processor under each DAG task in the current set of tasks to be executed based on the speed sequence; pre-allocating a processor to each DAG task in the current set of tasks to be executed based on the processor scores to determine a cluster score for the processor cluster to which each DAG task belongs; S4: Select the DAG task with the highest cluster score from the current set of tasks to be executed, and determine whether it is schedulable on the existing single-processor cluster; if so, execute the DAG task sequentially on the single-processor cluster with the highest processor score; otherwise, build a new processor cluster based on the pre-assigned processors, and control the new processor cluster to execute the DAG task according to the subtask ready queue and subtask type priority queue corresponding to the DAG task; S5: Update the current set of tasks to be executed and enter S3 until all DAG tasks in the current set of tasks to be executed are scheduled.

2. The multi-type task scheduling method based on a heterogeneous processor platform according to claim 1, characterized in that: The S3 includes: S31: Create an empty temporary processor cluster for each DAG task in the current task set to be executed; S32: Calculating the execution speed of each type of processor at different indexes in all speed sequences according to the speed sequence; S33: Calculating processor scores of various types of processors under different DAG tasks in the current set of tasks to be executed using execution speed; S34: Processors with high processor scores are preferentially assigned to the temporary processor cluster that executes the corresponding DAG task. Each time a processor is assigned to the temporary processor cluster, the schedulability of the DAG task is determined. If the DAG task is schedulable, processor allocation is stopped and the corresponding processor pre-allocation result is obtained. Otherwise, processor allocation continues until the DAG task is schedulable or no processors are available for allocation, and the DAG task is deemed unschedulable. S35: Calculate a cluster score of the current temporary processor cluster according to the processor pre-allocation result, where the cluster score is the sum of the processor scores of all processors in the cluster.

3. The multi-type task scheduling method based on a heterogeneous processor platform according to claim 2, characterized in that: The S32 includes: Using the formula Calculate the execution speed of each type of processor at different indexes in the speed sequence of all subtasks; Represents a temporary processor cluster Processor in As a DAG task Internal subtasks The speed sequence of Processor-hour execution speed, Represents a DAG task Internal subtasks All on the platform processors Fast speed, For DAG tasks Internal subtasks In temporary processor clusters Processor in The worst execution time on .

4. The multi-type task scheduling method based on a heterogeneous processor platform according to claim 3, characterized in that: The S33 includes: Using the formula Calculate the processor score of each type of processor relative to each DAG task; in, For executing DAG tasks Processor cluster mid-processor Processor ratings, for Internal subtasks In the processor The worst execution time on for Corresponding processor First Fast execution The sum of the worst execution times of the subtasks, is the total number of DAG tasks, For temporary processor clusters The total number of .

5. The multi-type task scheduling method based on a heterogeneous processor platform according to claim 1, characterized in that: The S4 includes: S41: Select the DAG task with the highest cluster score from the current set of tasks to be executed, and calculate the utilization rate of each single processor cluster after adding it to the single processor cluster; S42: If the utilization rate is less than or equal to the threshold, sequentially executing the DAG tasks on the single processor cluster with the highest processor score; S43: If the utilization rate is greater than the threshold, a new processor cluster is constructed based on the pre-assigned processors, and the new processor cluster is controlled to execute the DAG task according to the subtask ready queue and subtask type priority queue corresponding to the DAG task; until all DAG tasks in the current task set to be executed are scheduled.

6. The multi-type task scheduling method based on a heterogeneous processor platform according to claim 5, characterized in that: The S41 includes: Using the formula Calculate the utilization of each single-processor cluster after the DAG task with the highest score is added to the single-processor cluster; in, For a single processor Cluster utilization, For single processor clusters The current set of tasks to be executed consists of all tasks executed on for Internal subtasks In the processor The worst execution time on is the total number of DAG tasks, The period of the DAG task.

7. The multi-type task scheduling method based on a heterogeneous processor platform according to claim 5, characterized in that: The S43 includes: Build a new processor cluster based on the processor pre-allocation results, obtain the subtask ready queue and subtask type priority queue corresponding to the current DAG task, and execute the current DAG task on the new processor cluster: When there is an idle processor, the subtask being executed is migrated to the idle processor as much as possible for faster execution, and then the subtask waiting to be executed is attempted to be scheduled to the idle processor according to the subtask ready queue and the subtask type priority queue.

8. A multi-type task scheduling device based on a heterogeneous processor platform, characterized in that: include: A modeling module is used to model each type of subtask in the task set to be executed on a heterogeneous multi-processor platform as a directed acyclic graph (DAG) task to obtain the worst-case execution time of each type of subtask on different types of processors; A calculation module, configured to calculate a speed sequence of each type of subtask executing tasks on each type of processor using the worst execution time corresponding to each type of subtask; The scoring module is used to calculate the processor score of each type of processor under each DAG task in the current set of tasks to be executed based on the speed sequence; Pre-allocating a processor for each DAG task in the current set of tasks to be executed based on the processor score, so as to determine a cluster score of the processor cluster to which each DAG task belongs; The scheduling module is used to select the DAG task with the highest cluster score from the current set of tasks to be executed, and determine whether it is schedulable on the existing single-processor cluster; if so, the DAG task is sequentially executed on the single-processor cluster with the highest processor score; otherwise, a new processor cluster is constructed based on the pre-assigned processors, and the new processor cluster is controlled to execute the DAG task according to the subtask ready queue and subtask type priority queue corresponding to the DAG task; The loop module is used to update the current set of tasks to be executed and transmit the current set of tasks to be executed to the scoring module until all DAG tasks in the current set of tasks to be executed are scheduled.

9. An electronic device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.