Multi-core task scheduling method and device under full connection architecture, equipment and medium

By building a fully connected system model and optimizing the task scheduling strategy, the problems of high hardware complexity and uneven core utilization in the fully connected architecture are solved, and efficient and low-power multi-core task scheduling is achieved, which is suitable for a variety of application scenarios.

CN120371486BActive Publication Date: 2025-10-21SHANDONG INSPUR SCI RES INST CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510873180.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-06-27
Publication Date
2025-10-21
Estimated Expiration
2045-06-27

AI Technical Summary

Technical Problem

The fully connected architecture multi-core processor has high hardware design complexity and high power consumption in task scheduling, and the traditional scheduling algorithm cannot fully utilize the bandwidth and low latency advantages, resulting in uneven core utilization and low task execution efficiency.

Method used

By building a fully connected system model, calculating the communication overhead between related tasks, and selecting a reasonable scheduling strategy based on real-time or performance scheduling scenarios, we can generate a task scheduling list, optimize task allocation, reduce inter-core communication, and improve core utilization.

Benefits of technology

It achieves efficient task scheduling in different application scenarios, meets real-time requirements, reduces system power consumption, and improves the overall scheduling efficiency and performance of multi-core processors.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120371486B_ABST
    Figure CN120371486B_ABST
Patent Text Reader

Abstract

The application provides a multi-core task scheduling method and device under a full connection architecture, equipment and medium, belonging to the technical field of multi-core task scheduling. The method comprises the following steps: establishing a system model for a full connection system, calculating the average communication overhead between associated tasks based on static time delay and communication link transmission rate; identifying an application scenario, when it is a real-time scheduling scenario, introducing the deadline of the task flow as a constraint condition, calculating the latest start time ALAP value of each task, and arranging the tasks in ascending order to construct a task scheduling list; calculating the total execution time on each task core, finding the core with the minimum total execution time as the best core, and distributing tasks according to the relationship between the total execution time and the deadline of the task flow. The application ensures that the tasks are completed on time by constructing a task scheduling list and distributing tasks, optimizes the performance of the full connection system, meets the time constraint in real-time scheduling, reduces power consumption, and reduces the inter-core communication overhead.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the technical field of multi-core task scheduling, and specifically relates to a multi-core task scheduling method, apparatus, device and medium under a fully connected architecture. Background Art

[0002] With the development of multi-core processors, fully connected architectures have become increasingly popular due to their advantages in high-performance computing. By directly connecting each processor core to all other cores, this architecture creates a complete graph topology, achieving extremely high communication parallelism. A fully connected architecture enables multiple cores to exchange data simultaneously, ideally increasing the total bandwidth as the square of the number of cores while maintaining extremely low communication latency between any two cores, eliminating the need for complex routing. Multi-core processors with fully connected architectures can accelerate the completion of complex computing tasks, particularly in high-performance scenarios such as meteorological simulations and molecular dynamics simulations, which require extremely high real-time performance and data transfer rates.

[0003] However, while fully connected architectures offer high performance, they also have the following limitations when scheduling task execution: First, as the number of cores increases, the number of connections required by fully connected architectures grows exponentially (N cores require N(N-1) / 2 links), dramatically increasing the complexity of hardware design and implementation and significantly increasing system power consumption. Second, traditional task scheduling algorithms (such as priority-based scheduling and earliest deadline first scheduling) fail to fully account for the characteristics of fully connected architectures and are unable to effectively leverage their bandwidth and low latency advantages, resulting in uneven core utilization and inefficient task execution. Summary of the Invention

[0004] In a first aspect, an embodiment of the present application provides a multi-core task scheduling method in a fully connected architecture, comprising the following steps:

[0005] S1. Build a system model for the fully connected system characterized by all processor cores and inter-core communication rates. Calculate the average communication overhead between associated tasks in the task flow based on static time delay and communication link transmission rate.

[0006] S2. Identify application scenarios;

[0007] When it is a real-time scheduling application scenario, go to step S3;

[0008] S3. Introduce the task process deadline as a constraint, calculate the latest possible start time for each task, define it as the task ALAP value, and then construct a task scheduling list based on the task ALAP values ​​in ascending order.

[0009] S4. Calculate the total execution time of each task on each core, find the core with the shortest total execution time as the optimal core, denoted as Pmin, and determine whether the total execution time is greater than the deadline of the task flow;

[0010] If yes, go to step S5;

[0011] If not, assign all tasks to the best kernel Pmin for execution according to the order of the task scheduling list, and end;

[0012] S5. Calculate the relative deadline PDT and the earliest completion time EFT of the best kernel Pmin according to the task scheduling list, and assign the current task to the best kernel Pmin when EFT≤PDT, and when EFT>PDT, proceed to step S6;

[0013] S6. Calculate the relative deadline PDT, the earliest possible completion time EFT, the correlation R representing the reduction in communication overhead, and the decision function F that maximizes the correlation R and minimizes the EFT for the current task for each non-optimal core. Select the core that maximizes the correlation R and satisfies the conditions for EFT ≤ PDT for the current task assignment. If no core meets these conditions, select the core that maximizes the decision function F for the current task assignment.

[0014] Repeat steps S5-S6 until all tasks in the task scheduling list are assigned.

[0015] Furthermore, if the application scenario in step S2 is performance scheduling, the process goes to step S7;

[0016] S7. Based on the average communication overhead between the associated tasks, calculate the longest path time from each task in the task scheduling list to the exit task and define it as the task uplink value. Then, construct the task scheduling list based on the task uplink value in descending order.

[0017] S8. Calculate the earliest possible completion time EFT of each task in the task scheduling list and the correlation R, which represents the reduction in communication overhead, on each core in turn, and select the core that minimizes the EFT for task allocation. If there are multiple cores that meet the conditions, preferably select the core with the largest correlation R for task allocation.

[0018] Furthermore, the specific steps of step S1 are as follows:

[0019] S11. Build a collection of processor cores for a fully connected system:

[0020] P={P1,P2...P x ,...P m}

[0021] Among them, P xrepresents the xth core of the processor, and m represents the number of cores integrated in the processor;

[0022] S12. Construct a set of communication rates between any two cores for a fully connected system:

[0023] rate={rate(P1,P2),...rate(P x ,P y ),...,rate(P m-1 ,P m )}

[0024] Among them, P x Indicates the xth core of the processor, P y represents the yth core of the processor, and m represents the number of cores integrated in the processor;

[0025] S13. Integrate the processor core set P and the communication rate set rate between any two cores into a fully connected system model SM = {P, rate};

[0026] S14. Count the tasks T that have data dependencies in the task flow k and T i , Task T i The output of task T i Input;

[0027] S15. Task T k and task Tᵢ as a pair of associated tasks T k →T i ;

[0028] S16. Calculate the average inter-core communication rate based on the set of inter-core communication rates of any two cores in the fully connected system ;

[0029]

[0030] Where m represents the number of cores integrated in the processor;

[0031] S17. Get each pair of associated tasks T k →T i The amount of data transmitted , calculate the associated task T k →T i The average communication cost between ;

[0032]

[0033] in, Indicates the average static delay time of each core startup communication component.

[0034] Furthermore, the specific steps of step S3 are as follows:

[0035] S31. Get the completion time of the entire task process, recorded as the deadline DT;

[0036] S32. Based on the deadline DT, the average communication overhead between associated tasks, and the relationship between associated tasks in the task flow, the latest possible start time of each task is calculated backwards from the last task as the exit task, and is defined as the ALAP value of the task;

[0037]

[0038] in, Represents the associated task T i →T j The average communication cost between Indicates a task The execution time, Represents task T i The set of successor tasks, among the tasks with dependency relationships, the dependent ones are predecessor tasks, and the ones that depend on other tasks are successor tasks;

[0039] S33. Build a task scheduling list and sort the tasks in ascending order based on their ALAP values.

[0040] Furthermore, in step S5, the relative deadline PDT of each task in the task scheduling list on the best core is based on the task T i The execution time of the optimal kernel Pmin and task T i Calculation of ALAP value:

[0041]

[0042] in, Represents task T i At the execution time of the optimal kernel Pmin, Represents task T i ALAP value, i.e. the latest possible start time;

[0043] In step S5, the earliest possible completion time EFT of each task in the task scheduling list on the optimal kernel Pmin is calculated as follows:

[0044] Computational task T i The earliest completion time of the predecessor task is:

[0045]

[0046] in, Represents the predecessor task Tk Task T i Communication events; represents the physical link connecting kernel Py and the optimal kernel Pmin; the predecessor task T k In kernel Py execution, task T i Execute on the optimal kernel Pmin; Represents the predecessor task T k To Task T i Communication events in the link The earliest completion time on

[0047] Based on the task i The earliest completion time calculation task T of the predecessor task i Earliest start time at the optimal kernel Pmin:

[0048]

[0049] in, is the current available time of the optimal kernel Pmin, that is, the idle time after the optimal kernel Pmin completes all previously assigned tasks;

[0050] Based on the task i Calculate the earliest finishable time at the best kernel's earliest start time:

[0051]

[0052] in, Represents task T i Execution time at the optimal kernel Pmin.

[0053] Furthermore, the calculation method of the relative deadline time PDT and the earliest possible completion time EFT of the current task for each non-optimal core in step S6 is the same as the calculation method of the relative deadline time PDT and the earliest possible completion time EFT of the optimal core Pmin in step S5;

[0054] In step S6, the correlation R representing the reduction in communication overhead is calculated as follows:

[0055]

[0056] in, It represents the predecessor task T k With Task T i Communication events,

[0057] The decision function F that represents the maximum relevance R and the minimum EFT is calculated as follows:

[0058] Represents task Tk It is task T i Precursor tasks;

[0059] Is an indicator function, if the predecessor task T k If it has been executed on kernel Px, the indicator function takes 1, if it has not been executed, it takes 0;

[0060] In step S6, the decision function F representing the maximum relevance R and the minimum EFT is calculated by the difference between the relevance R and the earliest completion time EFT:

[0061] .

[0062] Furthermore, the task uplink value in step S7 is calculated as follows:

[0063] Based on the average communication overhead between associated tasks and the relationship between associated tasks in the task flow, the longest path time from each task to the exit task is calculated and defined as the uplink value of the task;

[0064]

[0065] in, Indicates a task Execution time; Represents task T i The set of successor tasks of

[0066] In step S8, the earliest possible completion time EFT and the correlation R of each task in the task scheduling list are calculated on each core in the same manner as in step S6.

[0067] In a second aspect, an embodiment of the present application further provides a multi-core task scheduling device under a fully connected architecture, comprising:

[0068] A model building module is used to build a system model for a fully connected system characterized by all processor cores and inter-core communication rates, and calculate the average communication overhead between associated tasks in a task flow based on static time delay and communication link transmission rate;

[0069] The scheduling strategy selection module is used to select the corresponding scheduling process according to the application scenario of real-time scheduling or performance scheduling;

[0070] The real-time scheduling control module includes:

[0071] The ALAP value calculation and task sorting unit is used in real-time scheduling applications to introduce the task process deadline as a constraint, calculate the latest possible start time of each task, define it as the task ALAP value, and then construct a task scheduling list based on the task ALAP value in ascending order.

[0072] The global allocation evaluation unit is used to calculate the total execution time of each task on each core and find the core with the minimum total execution time as the optimal core, which is recorded as Pmin;

[0073] The dynamic allocation unit is used to allocate all tasks to the optimal core Pmin for execution according to the order of the task scheduling list when the total execution time is greater than or equal to the deadline of the task flow;

[0074] When the total execution time is less than the deadline of the task flow, the relative deadline PDT and the earliest completion time EFT of the tasks in the task scheduling list are calculated in sequence on the best core Pmin, and when EFT ≤ PDT, the current task is assigned to the best core Pmin;

[0075] When EFT>PDT, calculate the relative deadline PDT of the current task for each non-optimal core, the earliest completion time EFT, the correlation R that represents the reduction of communication overhead, and the decision function F that represents the maximum correlation R and the minimum EFT. Select the core that makes EFT≤PDT and has the largest correlation R to assign the current task. If no core meets the conditions, select the core that makes the decision function F the largest to assign the current task; until all tasks in the task scheduling list are assigned.

[0076] In a third aspect, an embodiment of the present application further provides an electronic device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the program, the steps of the multi-core task scheduling method under the fully connected architecture as described in the first aspect are implemented.

[0077] In a fourth aspect, an embodiment of the present application further provides a storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of the multi-core task scheduling method under the fully connected architecture as described in the first aspect are implemented.

[0078] It can be seen from the above technical solutions that this application has the following advantages:

[0079] The multi-core task scheduling method, system, device, and medium provided in this application, under a fully connected architecture, accurately calculates the communication overhead between related tasks by constructing a fully connected system model. Based on the corresponding scheduling strategies for different application scenarios, a reasonable task scheduling list is generated, achieving efficient task allocation among multiple cores and improving overall scheduling efficiency. In real-time scheduling scenarios, task deadline constraints are introduced, and task ALAP values ​​are calculated to construct a task scheduling list, ensuring that tasks are completed within the deadline and enhancing system real-time performance. In performance scheduling scenarios, a task scheduling list is generated based on task uplink values, prioritizing cores with short execution times and low communication overhead, thereby improving fully connected system performance. A decision function F comprehensively considers the relevance R and the earliest completion time (EFT) to prioritize cores with low communication overhead and fast execution for task allocation. This reduces inter-core communication and system power consumption while ensuring time constraints. This method is highly applicable to a variety of application scenarios and can flexibly adjust task allocation strategies based on real-time or performance scheduling requirements, enabling fully connected systems to achieve efficient task scheduling under different operating conditions. BRIEF DESCRIPTION OF THE DRAWINGS

[0080] In order to more clearly illustrate the technical solution of the present application, the following is a brief introduction to the drawings required for the description. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0081] Figure 1 Schematic diagram of the multi-core task scheduling method under the fully connected architecture of the present invention.

[0082] Figure 2 Schematic diagram of a multi-core task scheduling device under a fully connected architecture of the present invention. DETAILED DESCRIPTION

[0083] The various embodiments of the present disclosure will be described in more detail below in the specific steps of the multi-core task scheduling method under the fully connected architecture. The present disclosure may have various embodiments, and adjustments and changes may be made therein. However, it should be understood that there is no intention to limit the various embodiments of the present disclosure to the specific embodiments disclosed herein, but rather that the present disclosure should be understood to cover all adjustments, equivalents and / or alternatives that fall within the spirit and scope of the various embodiments of the present disclosure.

[0084] This embodiment provides a multi-core task scheduling method in a fully connected architecture. By building a task scheduling list and assigning tasks, this method ensures that tasks are completed on time. It also optimizes the performance of the fully connected system to meet time constraints in real-time scheduling. It also reduces power consumption and inter-core communication overhead.

[0085] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.

[0086] See also Figure 1 FIG. 1 is a flowchart of a multi-core task scheduling method under a fully connected architecture in a specific embodiment, the method comprising the following steps:

[0087] S1. Build a system model for the fully connected system characterized by all processor cores and inter-core communication rates. Calculate the average communication overhead between associated tasks in the task flow based on static time delay and communication link transmission rate.

[0088] It should be noted that by establishing a system model and calculating the average communication overhead, basic information about the fully connected system and communication cost evaluation are provided for subsequent task scheduling. This enables scheduling decisions to be based on accurate system descriptions and communication conditions, improving scheduling rationality.

[0089] S2. Identify application scenarios;

[0090] When it is a real-time scheduling application scenario, go to step S3;

[0091] It should be noted that different application scenarios can determine the needs and goals of task scheduling, provide a basis for the subsequent selection of appropriate scheduling processes, and ensure that the scheduling strategy matches the actual application scenario;

[0092] S3. Introduce the task process deadline as a constraint, calculate the latest possible start time for each task, define it as the task ALAP value, and then construct a task scheduling list based on the task ALAP values ​​in ascending order.

[0093] It should be noted that introducing deadline constraints and calculating the ALAP value of tasks provides clear time limits and sequence basis for task allocation in real-time scheduling scenarios, ensuring that tasks can be completed within the specified time and meet real-time requirements;

[0094] S4. Calculate the total execution time of each task on each core, find the core with the shortest total execution time as the optimal core, denoted as Pmin, and determine whether the total execution time is greater than the deadline of the task flow;

[0095] If yes, go to step S5;

[0096] If not, assign all tasks to the best kernel Pmin for execution according to the order of the task scheduling list, and end;

[0097] It should be noted that by calculating the total execution time of each task on each core and finding the optimal core, a quantitative evaluation is provided for the initial task allocation. This allows the most suitable core to be selected for task allocation while meeting the deadline requirements, thus improving the efficiency of task allocation.

[0098] S5. Calculate the relative deadline PDT and the earliest completion time EFT of the best kernel Pmin according to the task scheduling list, and assign the current task to the best kernel Pmin when EFT≤PDT, and when EFT>PDT, proceed to step S6;

[0099] It should be noted that by sequentially calculating the relative deadlines and earliest completion times of tasks on the best core and deciding whether to assign a task to the best core based on the comparison results, dynamic adjustment is provided for task allocation, ensuring that tasks can utilize the resources of the best core as much as possible while meeting time constraints;

[0100] S6. Calculate the relative deadline PDT, the earliest possible completion time EFT, the correlation R representing the reduction in communication overhead, and the decision function F that maximizes the correlation R and minimizes the EFT for the current task for each non-optimal core. Select the core that maximizes the correlation R and satisfies the conditions for EFT ≤ PDT for the current task assignment. If no core meets these conditions, select the core that maximizes the decision function F for the current task assignment.

[0101] Repeat steps S5-S6 until all tasks in the task scheduling list are assigned;

[0102] It should be noted that when a task cannot be assigned to the optimal core, by calculating the relevant parameters and selecting the appropriate non-optimal core for task allocation based on the decision function, a clear basis and method are provided for task reallocation, ensuring that the task can select a better core while meeting the time constraints, further optimizing the scheduling results.

[0103] This embodiment provides a solution for multi-core task scheduling by going through a process from establishing a system model, identifying application scenarios, to scheduling and allocating tasks according to different scenarios, ensuring comprehensive and effective task scheduling. By identifying application scenarios, different subsequent steps are taken for real-time scheduling and performance scheduling, respectively, so that the scheduling strategy matches the application scenario, improving the pertinence and adaptability of scheduling. By introducing deadline constraints in real-time scheduling application scenarios, calculating the latest possible start time of tasks and constructing a task scheduling list, a clear time basis is provided for task allocation, ensuring that tasks can be completed within the specified time and meeting real-time requirements.

[0104] Furthermore, as a refinement and extension of the specific implementation of the above embodiment, in order to fully illustrate the specific implementation process of this embodiment, another multi-core task scheduling method under a fully connected architecture is provided, which includes the following steps:

[0105] S1. Establish a system model for the fully connected system characterized by all processor cores and inter-core communication rates. Calculate the average communication overhead between associated tasks in the task flow based on static time delay and communication link transmission rate. The specific steps of step S1 are as follows:

[0106] S11. Build a collection of processor cores for a fully connected system:

[0107] P={P1,P2...P x ,...P m}

[0108] Among them, P x represents the xth core of the processor, and m represents the number of cores integrated in the processor;

[0109] S12. Construct a set of communication rates between any two cores for a fully connected system:

[0110] rate={rate(P1,P2),...rate(P x ,P y ),...,rate(P m-1 ,P m )}

[0111] Among them, P x Indicates the xth core of the processor, P y represents the yth core of the processor, and m represents the number of cores integrated in the processor;

[0112] S13. Integrate the processor core set P and the communication rate set rate between any two cores into a fully connected system model SM = {P, rate};

[0113] S14. Count the tasks T that have data dependencies in the task flow k and T i , Task T i The output of task T i Input;

[0114] S15. Task T k and Task T i As a pair of associated tasks T k →T i ;

[0115] S16. Calculate the average inter-core communication rate based on the set of inter-core communication rates of any two cores in the fully connected system ;

[0116]

[0117] Where m represents the number of cores integrated in the processor;

[0118] S17. Get each pair of associated tasks T k →T i The amount of data transmitted , calculate the associated task T k →T i The average communication cost between ;

[0119]

[0120] in, Indicates the average static delay time of each core starting the communication component;

[0121] For example, a fully connected system model was established for a weather simulation task. The fully connected system has four cores (P1, P2, P3, and P4), which are directly connected to each other, with high communication rates and low transmission latency. Through testing and analysis, the static time delay was calculated to be 0.5ms, and the communication link transmission rate was 10GB / s. This leads to an average communication overhead of 1ms between related tasks. For example, the data transmission volume between Task A (simulating atmospheric flow) and Task B (simulating temperature changes) is 10MB, and the average communication overhead is 1ms (0.5ms delay + the time it takes to transmit 10MB of data at 10GB / s).

[0122] S2. Identify application scenarios;

[0123] When it is a real-time scheduling application scenario, go to step S3;

[0124] When it is a performance scheduling application scenario, go to step S7;

[0125] S3. Introduce the task process deadline as a constraint, calculate the latest possible start time for each task, define it as the task ALAP value, and then construct a task scheduling list based on the task ALAP values ​​in ascending order. The specific steps of step S3 are as follows:

[0126] S31. Get the completion time of the entire task process, recorded as the deadline DT;

[0127] S32. Based on the deadline DT, the average communication overhead between associated tasks, and the relationship between associated tasks in the task flow, the latest possible start time of each task is calculated backwards from the last task as the exit task, and is defined as the ALAP value of the task;

[0128]

[0129] in, Represents the associated task T i →T j The average communication cost between Indicates a task The execution time, Represents task T i The set of successor tasks, among the tasks with dependency relationships, the dependent ones are predecessor tasks, and the ones that depend on other tasks are successor tasks;

[0130] S33. Build a task scheduling list and sort the tasks in ascending order based on their ALAP values;

[0131] For example, let's take a weather simulation task flow with a deadline of 100ms. For Task B, its successor is Task C (simulating humidity changes). The ALAP value of Task B is calculated backwards from the ALAP value of Task C. Assuming Task B's execution time is 20ms, the average communication overhead for linking Tasks B to C is 1ms, and the ALAP value of Task C is 75ms, then the ALAP value of Task B = 75ms - 20ms - 1ms = 54ms.

[0132] S4. Calculate the total execution time of each task on each core, find the core with the shortest total execution time as the optimal core, denoted as Pmin, and determine whether the total execution time is greater than the deadline of the task flow;

[0133] If yes, go to step S5;

[0134] If not, assign all tasks to the best kernel Pmin for execution according to the order of the task scheduling list, and end;

[0135] For example, the total execution time of each task on each core is calculated. For example, if the execution time of task A is 10ms, task B is 20ms, and task C is 15ms, if all tasks are assigned to P1, the total execution time is 45ms, which is less than the deadline of 100ms. At this time, P1 is the optimal core Pmin. The total execution time meets the conditions, and all tasks can be assigned to P1 for execution according to the order of the task scheduling list.

[0136] S5. Calculate the relative deadline PDT and the earliest completion time EFT of the best kernel Pmin according to the task scheduling list, and assign the current task to the best kernel Pmin when EFT≤PDT, and when EFT>PDT, proceed to step S6;

[0137] In step S5, the relative deadline PDT of each task in the task scheduling list on the best core is based on the task T i The execution time of the optimal kernel Pmin and task T i Calculation of ALAP value:

[0138]

[0139] in, Represents task T i At the execution time of the optimal kernel Pmin, Represents task T i ALAP value, i.e. the latest possible start time;

[0140] In step S5, the earliest possible completion time EFT of each task in the task scheduling list on the optimal kernel Pmin is calculated as follows:

[0141] Computational task T i The earliest completion time of the predecessor task is:

[0142]

[0143] in, Represents the predecessor task T k Task T i Communication events; represents the physical link connecting kernel Py and the optimal kernel Pmin; the predecessor task T k In kernel Py execution, task T i Execute on the optimal kernel Pmin; Represents the predecessor task T k To Task T i Communication events in the link The earliest completion time on

[0144] It should be noted that the maximum value is taken because task T i There may be more than one predecessor task, and the maximum value of multiple predecessor tasks is taken as the earliest completion time;

[0145] Based on the task i The earliest completion time calculation task T of the predecessor task i Earliest start time at the optimal kernel Pmin:

[0146]

[0147] in, is the current available time of the optimal kernel Pmin, that is, the idle time after the optimal kernel Pmin completes all previously assigned tasks;

[0148] Based on the task i Calculate the earliest finishable time at the best kernel's earliest start time:

[0149]

[0150] in, Represents task T i Execution time at the optimal kernel Pmin;

[0151] For example, taking Task A → Task B → Task C as an example, calculate the relative deadline time PDT and earliest finish time EFT of each task on the best core P1 according to the task scheduling list. For Task A, which has no predecessor tasks, if its earliest start time is 0, its execution time is 10ms, its earliest finish time EFT = 10ms, and its ALAP value is 35ms, then EFT = 10ms ≤ PDT = 35ms, and Task A is assigned to P1.

[0152] S6. Calculate the relative deadline PDT, the earliest possible completion time EFT, the correlation R representing the reduction in communication overhead, and the decision function F that maximizes the correlation R and minimizes the EFT for the current task for each non-optimal core. Select the core that maximizes the correlation R and satisfies the conditions for EFT ≤ PDT for the current task assignment. If no core meets these conditions, select the core that maximizes the decision function F for the current task assignment.

[0153] Repeat steps S5-S6 until all tasks in the task scheduling list are assigned;

[0154] The calculation method of the relative deadline time PDT and the earliest possible completion time EFT of the current task for each non-optimal core in step S6 is the same as the calculation method of the relative deadline time PDT and the earliest possible completion time EFT of the optimal core Pmin in step S5;

[0155] Task T i The relative deadline PDT of kernel Px is based on the task T i The execution time of the optimal kernel Px and task T i Calculation of ALAP value:

[0156]

[0157] in, Represents task T i At the execution time of kernel Px, Represents task T i ALAP value, i.e. the latest possible start time;

[0158] Computational task T i The earliest completion time of the predecessor task is:

[0159]

[0160] in, Represents the predecessor task T k With Task T i Communication events; Represents the physical link connecting kernel Py and kernel Px; the predecessor task T k In kernel Py execution, task T i Executed in kernel Px; Represents the predecessor task T k To Task T i Communication events in the link The earliest completion time on

[0161] It should be noted that the maximum value is taken because task T i There may be more than one predecessor task, and the maximum value of multiple predecessor tasks is taken as the earliest completion time;

[0162] Based on the task i The earliest completion time calculation task T of the predecessor task i Earliest start time of kernel Px:

[0163]

[0164] in, is the current available time of kernel Px, that is, the idle time after kernel Px completes all previously assigned tasks;

[0165] Based on the task i Calculate the earliest finishable time at the earliest start time of the kernel:

[0166]

[0167] in, Represents task T i Execution time of kernel Px;

[0168] In step S6, the correlation R representing the reduction in communication overhead is calculated as follows:

[0169]

[0170] in, It represents the predecessor task Tk With Task T i Communication events,

[0171] The decision function F that represents the maximum relevance R and the minimum EFT is calculated as follows:

[0172] Represents task T k It is task T i Precursor tasks;

[0173] Is an indicator function, if the predecessor task T k If it has been executed on kernel Px, the indicator function takes 1, if it has not been executed, it takes 0;

[0174] In step S6, the decision function F representing the maximum relevance R and the minimum EFT is calculated by the difference between the relevance R and the earliest completion time EFT:

[0175]

[0176] It should be noted that the decision function is used to balance communication optimization and execution efficiency. It reduces inter-core communication by maximizing the correlation R, that is, optimizing power consumption, and shortens task completion time by minimizing EFT, that is, optimizing performance. The overall effect of the decision function F is to prioritize the core with the lowest communication overhead and the fastest execution while ensuring time constraints.

[0177] For example, if the EFT of a subsequent task on the optimal core P1 exceeds the PDT, and if task D, with an execution time of 30ms and an ALAP value of 60ms, is assigned to P1, its earliest completion time on P1 is calculated to be EFT = 45ms (predecessor task completion time) + 30ms = 75ms > PDT = 60ms. Then, the relative deadline PDT, earliest completion time EFT, relevance R, and decision function F of task D for each non-optimal core are calculated. Suppose that on P2, task D has PDT = 60ms, EFT = 65ms, relevance R = 0.8, and decision function F = 0.8-65 = -64.2; on P3, PDT = 60ms, EFT = 70ms, relevance R = 0.6, and decision function F = 0.6-70 = -69.4. P2, which has the largest relevance R and smallest EFT, is selected for task D assignment.

[0178] S7. Based on the average communication overhead between the associated tasks, calculate the longest path time from each task in the task scheduling list to the exit task and define it as the task uplink value. Then, construct the task scheduling list based on the task uplink value in descending order. In step S7, the task uplink value is calculated as follows:

[0179] Based on the average communication overhead between associated tasks and the relationship between associated tasks in the task flow, the longest path time from each task to the exit task is calculated and defined as the uplink value of the task;

[0180]

[0181] in, Indicates a task Execution time; Represents task T i The set of successor tasks of

[0182] In step S8, the earliest possible completion time EFT and the correlation R of each task in the task scheduling list are calculated in the same manner as in step S6;

[0183] For example, in a performance scheduling scenario, taking Task E as the egress task, the longest path time from each task in the task scheduling list to the egress task is calculated as the task's uplink value. If the paths from Task A to Task E are A→B→E (total execution time 40ms) and A→C→E (total execution time 35ms), then Task A's uplink value is 40ms. The task scheduling list is constructed by sorting the uplink values ​​in descending order. If Task B's uplink value is 30ms and Task C's uplink value is 35ms, then the list order is Task A→Task C→Task B.

[0184] S8. For each task in the task scheduling list, calculate the earliest possible completion time (EFT) and the relevance (R) of each core, which indicates the reduction in communication overhead. The core that minimizes the EFT is selected for task assignment. If multiple cores meet the requirements, the core with the largest relevance (R) is selected for task assignment.

[0185] For example, the earliest completion time EFT and correlation R of the tasks in the task scheduling list are calculated on each core in turn; taking task C as an example, EFT = 40ms on P1, correlation R = 0.7; EFT = 45ms on P2, correlation R = 0.8; P1 with the smallest EFT is selected to assign task C; if the EFT of multiple cores is the same, the core with the largest correlation R is preferred.

[0186] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.

[0187] like Figure 2As shown, the following is an embodiment of the multi-core task scheduling device under the fully connected architecture provided by the embodiment of the present disclosure. The system and the multi-core task scheduling method under the fully connected architecture of the above-mentioned embodiments belong to the same inventive concept. For details not fully described in the embodiment of the multi-core task scheduling device under the fully connected architecture, please refer to the embodiment of the multi-core task scheduling method under the fully connected architecture.

[0188] The device includes:

[0189] A model building module is used to build a system model for a fully connected system characterized by all processor cores and inter-core communication rates, and calculate the average communication overhead between associated tasks in a task flow based on static time delay and communication link transmission rate;

[0190] The scheduling strategy selection module is used to select the corresponding scheduling process according to the application scenario of real-time scheduling or performance scheduling;

[0191] The real-time scheduling control module includes:

[0192] The ALAP value calculation and task sorting unit is used in real-time scheduling applications to introduce the task process deadline as a constraint, calculate the latest possible start time of each task, define it as the task ALAP value, and then construct a task scheduling list based on the task ALAP value in ascending order.

[0193] The global allocation evaluation unit is used to calculate the total execution time of each task on each core and find the core with the minimum total execution time as the optimal core, which is recorded as Pmin;

[0194] The dynamic allocation unit is used to allocate all tasks to the optimal core Pmin for execution according to the order of the task scheduling list when the total execution time is greater than or equal to the deadline of the task flow;

[0195] When the total execution time is less than the deadline of the task flow, the relative deadline PDT and the earliest completion time EFT of the tasks in the task scheduling list are calculated in sequence on the best core Pmin, and when EFT ≤ PDT, the current task is assigned to the best core Pmin;

[0196] When EFT>PDT, calculate the relative deadline PDT of the current task for each non-optimal core, the earliest completion time EFT, the correlation R that represents the reduction of communication overhead, and the decision function F that represents the maximum correlation R and the minimum EFT. Select the core that makes EFT≤PDT and has the largest correlation R to assign the current task. If no core meets the conditions, select the core that makes the decision function F the largest to assign the current task; until all tasks in the task scheduling list are assigned.

[0197] This embodiment ensures that tasks are completed on time by building a task scheduling list and assigning tasks through the interactive collaboration of the model construction module, the scheduling strategy selection module, and the real-time scheduling control module; meets time constraints in real-time scheduling by optimizing the performance of the fully connected system; and reduces power consumption and inter-core communication overhead.

[0198] The multi-core task scheduling method under the fully connected architecture provided in the embodiment of the present application can be applied to electronic devices. Those skilled in the art will understand that the electronic device structure involved in the embodiment of the present invention does not constitute a limitation on the electronic device, and the electronic device may include more or fewer components than shown in the figure, or combine certain components, or arrange components differently. In the embodiment of the present invention, the electronic device includes but is not limited to a laptop computer, a desktop computer, a workbench, a personal digital assistant, a server, a blade server, a mainframe computer, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the embodiments of the present application described and / or required herein.

[0199] The electronic device may include a processor, an external memory interface, an internal memory, a universal serial bus (USB) interface, a charging management module, a power management module, a battery, a wireless communication module, an audio module, a speaker, a microphone, a sensor module, a button, a camera, a display, and a SIM card interface, etc.

[0200] It is understood that the structures illustrated in the embodiments of the present application do not constitute specific limitations on the electronic device. In other embodiments of the present application, the electronic device may include more or fewer components than shown, or combine or separate certain components, or arrange the components differently. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0201] A processor may include one or more processing units, such as a central processing unit (CPU), an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU). Different processing units may be independent devices or integrated into one or more processors.

[0202] The processor can be the nerve center and command center of the electronic device. The controller can generate operation control signals based on the instruction opcode and timing signal to complete the control of instruction fetching and execution.

[0203] The processor may also include a memory for storing instructions and data. In some embodiments, the memory in the processor is a cache memory. This memory can store instructions or data that the processor has just used or is reusing. If the processor needs to use the instruction or data again, it can directly call it from the memory. This avoids repeated accesses, reduces processor latency, and thus improves system efficiency.

[0204] The above electronic device implements the multi-core task scheduling method under the fully connected architecture of the present application, which establishes a system model for the fully connected system characterized by the communication rate between all processor cores and cores, and calculates the average communication overhead between related tasks in the task flow based on the static time delay and the communication link transmission rate; identifies the application scenario; when it is a real-time scheduling application scenario, introduces the deadline of the task flow as a constraint, calculates the latest start time of each task, defined as the task ALAP value, and then constructs a task scheduling list based on the task ALAP value in ascending order; calculates the total execution time of each task on each core, finds the core with the smallest total execution time as the best core, recorded as Pmin, and determines whether the total execution time is greater than the deadline of the task flow; if so, calculates the relative deadline PDT and the earliest completion time EFT of the tasks in the task scheduling list in the best core Pmin, and When EFT≤PDT, the current task is assigned to the optimal core Pmin. When EFT>PDT, the relative deadline PDT of the current task to each non-optimal core, the earliest completion time EFT, the correlation R that characterizes the reduction of communication overhead, and the decision function F that characterizes the maximum correlation R and the minimum EFT are calculated. The core that makes EFT≤PDT and the correlation R the largest is selected for current task assignment. If there is no core that meets the conditions, the core that makes the decision function F the largest is selected for current task assignment, and this technical solution is continued until all tasks in the task scheduling list are assigned. If not, all tasks are assigned to the optimal core Pmin in the order of the task scheduling list for execution, so as to achieve the beneficial effects of ensuring that tasks are completed on time by constructing a task scheduling list and assigning tasks; meeting time constraints in real-time scheduling by optimizing the performance of the fully connected system; reducing power consumption and reducing inter-core communication overhead.

[0205] The storage medium provided in this application stores a program product that can implement a multi-core task scheduling method under a fully connected architecture.

[0206] The multi-core task scheduling method under the fully connected architecture includes: establishing a system model for the fully connected system characterized by the communication rate of all processor cores and cores, calculating the average communication overhead between related tasks in the task flow based on the static time delay and the transmission rate of the communication link; identifying the application scenario; when it is a real-time scheduling application scenario, introducing the deadline of the task flow as a constraint, calculating the latest start time of each task, defined as the task ALAP value, and then constructing a task scheduling list based on the task ALAP value in ascending order; calculating the total execution time of each task on each core, finding the core with the smallest total execution time as the best core, denoted as Pmin, and judging whether the total execution time is greater than the deadline of the task flow; if so, calculating the task in the task scheduling list in turn. The relative deadline PDT and the earliest completion time EFT of the best kernel Pmin are calculated, and when EFT≤PDT, the current task is assigned to the best kernel Pmin. When EFT>PDT, the relative deadline PDT, the earliest completion time EFT, the correlation R that characterizes the reduction of communication overhead, and the decision function F that characterizes the maximum correlation R and the minimum EFT of the current task for each non-best kernel are calculated. The kernel that makes EFT≤PDT and the correlation R the largest is selected for current task assignment. If no kernel meets the conditions, the kernel that makes the decision function F the largest is selected for current task assignment, and the technical solution is continued until all tasks in the task scheduling list are assigned. If not, all tasks are assigned to the best kernel Pmin for execution in the order of the task scheduling list.

[0207] In some possible implementations, the multi-core task scheduling method under the fully connected architecture of the present disclosure can be implemented in the form of a program product, which includes program code. When the program product is run on a terminal device, the program code is used to enable the terminal device to execute the steps described in the above "Exemplary Method" section of this specification according to various exemplary implementations of the present disclosure.

[0208] The storage medium of the present disclosure can adopt any combination of one or more readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium can be, for example, but not limited to, a system, device or component of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination thereof. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof.

[0209] The above description of the disclosed embodiments is intended to enable one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be readily apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention is not limited to the embodiments shown herein but is intended to conform to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A multi-core task scheduling method under a fully connected architecture, characterized in that: The steps include: S1. Build a system model for the fully connected system characterized by all processor cores and inter-core communication rates. Calculate the average communication overhead between associated tasks in the task flow based on static time delay and communication link transmission rate. S2. Identify application scenarios; When it is a real-time scheduling application scenario, go to step S3; S3. Introduce the task process deadline as a constraint, calculate the latest possible start time for each task, define it as the task ALAP value, and then construct a task scheduling list based on the task ALAP values ​​in ascending order. S4. Calculate the total execution time of each task on each core, find the core with the shortest total execution time as the optimal core, denoted as Pmin, and determine whether the total execution time is greater than the deadline of the task flow; If yes, go to step S5; If not, assign all tasks to the best kernel Pmin for execution according to the order of the task scheduling list, and end; S5. Calculate the relative deadline PDT and the earliest completion time EFT of the best kernel Pmin according to the task scheduling list, and assign the current task to the best kernel Pmin when EFT≤PDT, and when EFT>PDT, proceed to step S6; S6. Calculate the relative deadline PDT, the earliest possible completion time EFT, the correlation R representing the reduction in communication overhead, and the decision function F that maximizes the correlation R and minimizes the EFT for the current task for each non-optimal core. Select the core that maximizes the correlation R and satisfies the conditions for EFT ≤ PDT for the current task assignment. If no core meets these conditions, select the core that maximizes the decision function F for the current task assignment. Repeat steps S5-S6 until all tasks in the task scheduling list are assigned.

2. The multi-core task scheduling method under the fully connected architecture according to claim 1, characterized in that: If the application scenario in step S2 is performance scheduling, proceed to step S7; S7. Based on the average communication overhead between the associated tasks, calculate the longest path time from each task in the task scheduling list to the exit task and define it as the task uplink value. Then, construct the task scheduling list based on the task uplink value in descending order. S8. Calculate the earliest possible completion time EFT of each task in the task scheduling list and the correlation R, which represents the reduction in communication overhead, on each core in turn, and select the core that minimizes the EFT for task allocation. If there are multiple cores that meet the conditions, preferably select the core with the largest correlation R for task allocation.

3. The multi-core task scheduling method under the fully connected architecture according to claim 2, characterized in that: The specific steps of step S1 are as follows: S11. Build a collection of processor cores for a fully connected system: P={P1,P2...P x ,...P m } Among them, P x represents the xth core of the processor, and m represents the number of cores integrated in the processor; S12. Construct a set of communication rates between any two cores for a fully connected system: rate={rate(P1,P2),...rate(P x ,P y ),...,rate(P m-1 ,P m )} Among them, P x Indicates the xth core of the processor, P y represents the yth core of the processor, and m represents the number of cores integrated in the processor; S13. Integrate the processor core set P and the communication rate set rate between any two cores into a fully connected system model SM = {P, rate}; S14. Count the tasks T that have data dependencies in the task flow k and T i , Task T i The output of task T i Input; S15. Task T k and Task T i As a pair of associated tasks T k →T i ; S16. Calculate the average inter-core communication rate based on the set of inter-core communication rates of any two cores in the fully connected system ; Where m represents the number of cores integrated in the processor; S17. Get each pair of associated tasks T k →T i The amount of data transmitted , calculate the associated task T k →T i The average communication cost between ; in, Indicates the average static delay time of each core startup communication component.

4. The multi-core task scheduling method under the fully connected architecture according to claim 3, characterized in that: The specific steps of step S3 are as follows: S31. Get the completion time of the entire task process, recorded as the deadline DT; S32. Based on the deadline DT, the average communication overhead between associated tasks, and the relationship between associated tasks in the task flow, the latest possible start time of each task is calculated backwards from the last task as the exit task, and is defined as the ALAP value of the task; in, Represents the associated task T i →T j The average communication cost between Indicates a task The execution time, Represents task T i The set of successor tasks, among the tasks with dependency relationships, the dependent ones are predecessor tasks, and the ones that depend on other tasks are successor tasks; S33. Build a task scheduling list and sort the tasks in ascending order based on their ALAP values.

5. The multi-core task scheduling method under the fully connected architecture according to claim 4, characterized in that: In step S5, the relative deadline PDT of each task in the task scheduling list on the best core is based on the task T i The execution time of the optimal kernel Pmin and task T i Calculation of ALAP value: in, Represents task T i At the execution time of the optimal kernel Pmin, Represents task T i ALAP value, i.e. the latest possible start time; In step S5, the earliest possible completion time EFT of each task in the task scheduling list on the optimal kernel Pmin is calculated as follows: Computational task T i The earliest completion time of the predecessor task is: in, Represents the predecessor task T k Task T i Communication events; represents the physical link connecting kernel Py and the optimal kernel Pmin; the predecessor task T k In kernel Py execution, task T i Execute on the optimal kernel Pmin; Represents the predecessor task T k To Task T i Communication events in the link The earliest completion time on Based on the task i The earliest completion time calculation task T of the predecessor task i Earliest start time at the optimal kernel Pmin: in, is the current available time of the optimal kernel Pmin, that is, the idle time after the optimal kernel Pmin completes all previously assigned tasks; Based on the task i Calculate the earliest finishable time at the best kernel's earliest start time: in, Represents task T i Execution time at the optimal kernel Pmin.

6. The multi-core task scheduling method under the fully connected architecture according to claim 5, characterized in that: The calculation method of the relative deadline time PDT and the earliest possible completion time EFT of the current task for each non-optimal core in step S6 is the same as the calculation method of the relative deadline time PDT and the earliest possible completion time EFT of the optimal core Pmin in step S5; In step S6, the correlation R representing the reduction in communication overhead is calculated as follows: in, It represents the predecessor task T k With Task T i Communication events, The decision function F that represents the maximum relevance R and the minimum EFT is calculated as follows: Represents task T k It is task T i Precursor tasks; Is an indicator function, if the predecessor task T k If it has been executed on kernel Px, the indicator function takes 1, if it has not been executed, it takes 0; In step S6, the decision function F representing the maximum relevance R and the minimum EFT is calculated by the difference between the relevance R and the earliest completion time EFT: 。 7. The multi-core task scheduling method under the fully connected architecture according to claim 6, characterized in that: The task uplink value in step S7 is calculated as follows: Based on the average communication overhead between associated tasks and the relationship between associated tasks in the task flow, the longest path time from each task to the exit task is calculated and defined as the uplink value of the task; in, Indicates a task Execution time; Represents task T i The set of successor tasks of In step S8, the earliest possible completion time EFT and the correlation R of each task in the task scheduling list are calculated on each core in the same manner as in step S6.

8. A multi-core task scheduling device under a fully connected architecture, characterized in that: include: A model building module is used to build a system model for a fully connected system characterized by all processor cores and inter-core communication rates, and calculate the average communication overhead between associated tasks in a task flow based on static time delay and communication link transmission rate; The scheduling strategy selection module is used to select the corresponding scheduling process according to the application scenario of real-time scheduling or performance scheduling; The real-time scheduling control module includes: The ALAP value calculation and task sorting unit is used in real-time scheduling applications to introduce the task process deadline as a constraint, calculate the latest possible start time of each task, define it as the task ALAP value, and then construct a task scheduling list based on the task ALAP value in ascending order. The global allocation evaluation unit is used to calculate the total execution time of each task on each core and find the core with the minimum total execution time as the optimal core, which is recorded as Pmin; The dynamic allocation unit is used to allocate all tasks to the optimal core Pmin for execution according to the order of the task scheduling list when the total execution time is greater than or equal to the deadline of the task flow; When the total execution time is less than the deadline of the task flow, the relative deadline PDT and the earliest completion time EFT of the tasks in the task scheduling list are calculated in sequence on the best core Pmin, and when EFT ≤ PDT, the current task is assigned to the best core Pmin; When EFT>PDT, calculate the relative deadline PDT of the current task for each non-optimal core, the earliest completion time EFT, the correlation R that represents the reduction of communication overhead, and the decision function F that represents the maximum correlation R and the minimum EFT. Select the core that makes EFT≤PDT and has the largest correlation R to assign the current task. If no core meets the conditions, select the core that makes the decision function F the largest to assign the current task; until all tasks in the task scheduling list are assigned.

9. An electronic device, characterized in that: It includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps of the multi-core task scheduling method under the fully connected architecture as claimed in any one of claims 1 to 7 are implemented.

10. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the multi-core task scheduling method under the fully connected architecture according to any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Dependent task scheduling method of heterogeneous multi-core processor

    CN103473134A

  • Task scheduling with precedence relationships in multicore systems

    US20140282572A1