Multiprocessor platform hybrid criticality system task scheduling method
By employing a fixed-priority preemption threshold scheduling and task partitioning method on a multiprocessor platform, the issues of schedulability and stack space usage in mixed-criticality systems are resolved, achieving efficient task allocation and low-cost system optimization.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- NANJING UNIV OF SCI & TECH
- Filing Date
- 2021-02-22
- Publication Date
- 2026-07-24
AI Technical Summary
Existing multiprocessor hybrid criticality system scheduling algorithms have shortcomings in terms of system schedulability and stack space usage, especially poor schedulability when the task set utilization is low, and they fail to effectively optimize system stack space consumption.
A fixed-priority preemption threshold scheduling method is adopted to divide mixed-criticality tasks into light tasks and heavy tasks, and allocate them according to the differences in processor utilization. Combined with a greedy full search method, the task allocation is optimized to reduce the number of task preemptions and stack space usage.
It improves system schedulability, reduces stack space usage, lowers hardware costs, and optimizes task allocation efficiency.
Smart Images

Figure CN114968538B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of multi-core technology of cyber-physical systems, and in particular, a task scheduling method for a hybrid criticality system on a multi-processor platform. Background Technology
[0002] In modern embedded systems, due to space, power, and cost constraints, system size and complexity are increasing, and the number of integrated processors is also growing. To integrate the certification requirements of various programs and effectively manage applications, Vestall et al. pioneered the concept of hybrid criticality systems, which integrate multiple applications with different security levels onto the same processor. Traditional sporadic real-time task systems must meet the worst-case resource requirements of all tasks, while the successful execution of a hybrid criticality task is determined by its own criticality level and the system's operating mode. The hybrid criticality model requires the system to have more than one criticality level, where a task at the k-th criticality level has k different worst-case execution requirements. Moreover, the execution requirements of a task at level (k-1) are no higher than those at level k. As multiprocessor platforms have gradually become powerful computing engines for modern systems, hybrid criticality systems have been gradually deployed on multiprocessor platforms, and their task allocation and scheduling algorithms under partitioned scheduling have regained interest.
[0003] Existing research on scheduling in multiprocessor hybrid criticality systems focuses on dual-criticality systems (with only two criticality levels). The latest task scheduling algorithms for partitioned dual-criticality systems employ a task allocation method based on Utilization Difference Partition (UDP), prioritizing high-criticality tasks for processors with smaller differences in processor utilization across different criticality modes. Furthermore, CA-UDP (Criticism Aware Utilization Decreasing Partition) and CU-UDP (Criticism Unaware Utilization Decreasing Partition) algorithms have been proposed, depending on whether task criticality levels are differentiated. The CA-UDP algorithm allocates high-criticality tasks first, followed by low-criticality tasks; while the CU-UDP algorithm does not consider the criticality level of tasks, but rather sorts all tasks in descending order of their required processor utilization and allocates them accordingly. Both algorithms improve upon the low schedulability of traditional task allocation algorithms in hybrid criticality systems. However, when the task set utilization is low, the schedulability of the CA-UDP algorithm is much lower than that of the CU-UDP algorithm. Conversely, when the task set utilization is high, the schedulability of the CA-UDP algorithm is higher than that of the CU-UDP algorithm. In addition, this allocation method exhibits poor performance when the number of tasks is large, and since it only considers the optimization of system schedulability, it still consumes a lot of system stack space.
[0004] Most existing task scheduling algorithms for hybrid criticality systems are extended from single-processor platforms to multi-processor platforms. While they inherit the high schedulability of single-processor systems, their allocation algorithms for distributing tasks across multi-core processors under different scheduling policies are not perfect, and they only consider system schedulability when optimizing task allocation. Furthermore, existing partitioning scheduling algorithms for dual-criticality systems typically only consider fully preemptible hybrid criticality task models. These methods lead to a higher number of preemption attempts and context switching overhead, and they do not consider optimizing the system's stack memory space.
[0005] For traditional operating system task scheduling, preemption threshold-based scheduling algorithms can be used to optimize system stack space usage. Some researchers have proposed task allocation methods based on preemption threshold scheduling for traditional tasks, which can reduce stack space usage by nearly half. However, when these task allocation methods are directly applied to hybrid criticality systems, while they can significantly reduce system stack space usage, the lack of consideration for task criticality levels leads to a substantial decrease in system schedulability. Furthermore, due to the complexity of hybrid criticality systems, their computational requirements are relatively high. When using traditional allocation algorithms directly, the runtime is on average more than twice as long as that of traditional tasks with the same number of tasks, and this time difference increases significantly with the number of tasks.
[0006] In summary, the problems with existing technologies are: low system schedulability and large stack space usage. Summary of the Invention
[0007] The purpose of this invention is to provide a task scheduling method for a multiprocessor platform hybrid criticality system, which has high system schedulability and low stack space usage.
[0008] The technical solution to achieve the purpose of this invention is as follows:
[0009] A task scheduling method for a multiprocessor platform hybrid criticality system includes the following steps:
[0010] (10) Single processor hybrid criticality task scheduling: Each hybrid criticality task on the same processor is assigned a priority and a preemption threshold as scheduling parameters. The task is scheduled according to the scheduling parameters. Each hybrid criticality task runs on the assigned processor.
[0011] (20) Task pre-allocation to processor: Based on the processor utilization required by the task, the mixed criticality system tasks are divided into light tasks and heavy tasks. Heavy tasks are allocated first and then light tasks are allocated. The allocation method based on the difference in utilization is adopted to allocate the task to a processor on a multiprocessor platform.
[0012] (30) Task allocation optimization: Optimize and adjust the pre-allocation results of tasks to processors.
[0013] Compared with the prior art, the significant advantages of this invention are:
[0014] 1. High System Schedulerability: In the pre-allocation phase, this invention rationally divides mixed-criticality system tasks and sequentially allocates each divided task set to a multi-processor platform using a utilization-based partitioning method. Furthermore, on a single processor, a fixed-priority preemption threshold scheduling method is employed, reducing the number of times tasks are preempted after execution begins. By dividing tasks and setting preemption thresholds, the schedulerability of a single processor's task set is significantly improved, thereby enhancing the overall system schedulerability.
[0015] 2. Low stack space usage: In the allocation optimization phase, this invention aims to minimize stack space usage. Some tasks with high utilization are allocated to pre-allocated processors, while other tasks are reallocated to processors using a greedy full search method. A scheduling method with a fixed priority preemption threshold is used to limit the number of task preemptions, thereby greatly reducing the use of system stack space.
[0016] 3. Low hardware cost: Compared with the previous hybrid criticality task scheduling method based on full preemption, the fixed priority preemption threshold scheduling method can reduce the number of preemptions between tasks, thereby reducing context switching overhead. While improving the schedulability of the system, it greatly reduces the use of system stack space, thus significantly reducing the hardware cost of the system.
[0017] The present invention will now be described in further detail with reference to the accompanying drawings and specific embodiments. Attached Figure Description
[0018] Figure 1 This is the main flowchart of the task scheduling method for a multiprocessor platform hybrid criticality system according to the present invention.
[0019] Figure 2 yes Figure 1 A schematic diagram of the principle of hybrid criticality task scheduling and stack space calculation in a single processor.
[0020] Figure 3 yes Figure 1 A flowchart of the task pre-assignment steps.
[0021] Figure 4 This is a schematic diagram based on the utilization difference allocation method.
[0022] Figure 5 yes Figure 1 A flowchart of the task allocation optimization steps.
[0023] Figure 6 yes Figure 5 The flowchart of the greedy full search method used in the algorithm. Detailed Implementation
[0024] like Figure 1As shown, the task scheduling method for a hybrid criticality system on a multiprocessor platform according to the present invention includes the following steps:
[0025] (10) Single processor hybrid criticality task scheduling: Each hybrid criticality task on the same processor is assigned a priority and a preemption threshold as scheduling parameters. The task is scheduled according to the scheduling parameters. Each hybrid criticality task runs on the assigned processor.
[0026] The multiprocessor hybrid criticality system employs a fixed priority preemptive threshold scheduling (FP-PTS) method. Hybrid criticality tasks in the system have five important attributes—criticality level L. i Task execution time vectors under different criticality modes of the system Task release cycle T i The deadline for the task is D. i The minimum stack space required by the processor to complete the task. i ,Right now:
[0027]
[0028] Where L i ∈{LO,HI} represents task τ i Criticality level; C i (HI) represents task τ i Worst execution time under different criticality modes; T i For task τ i Release cycle; D i For task τ i The deadline is set, and tasks must be completed before the deadline; otherwise, they are considered unschedulable. i The minimum stack space that the processor needs to provide for this task is only related to the task itself.
[0029] like Figure 2 As shown, the (10) single-processor hybrid criticality task scheduling step includes:
[0030] (11) Prepayment priority: Before a task is executed, all tasks are assigned a fixed priority and a preemption threshold.
[0031] Each task has a fixed priority (pri) and preemption threshold (pt), for example Figure 2 The priority of task τ3 is 2, and the preemption threshold is 3.
[0032] (12) Priority change: When a task starts execution, the priority of the task is changed to the preemption threshold. At this time, only tasks with a priority greater than the preemption threshold can complete the preemption.
[0033] For example Figure 2 Task τ3, after being released, has a priority of 2 on the processor. Once task τ3 starts executing, its priority will change to 3. At this point, only tasks with a priority greater than 3 can preempt the processor.
[0034] (13) Task scheduling: Each mixed-criticality task is assigned to one processor on the multiprocessor platform and scheduled according to the assigned fixed priority and preemption threshold. The task runs on the assigned processor.
[0035] Tasks run exclusively on their assigned processors and will not migrate to other processors during execution. When a task is published, it preempts processors based on its priority (pri). Once execution begins, only tasks with a priority higher than the preemption threshold can preempt the processor. For example... Figure 2 As shown, tasks τ3 and τ4 have a priority of 3 after execution begins, at which point only task τ1 can preempt them; task τ2 has a priority of 4 after execution begins, and no task can preempt it. Based on the preemption relationship, the processor may simultaneously provide the stack space required for the execution of {τ1, τ3}, {τ1, τ4}, or {τ2}. Therefore, the stack space required by processor k is st. k (φ k ) = max((st1+st3),(st1+st4),st2), where φ k The set of tasks assigned to processor k.
[0036] (20) Task pre-allocation to processor: Based on the processor utilization required by the task, the mixed criticality system tasks are divided into light tasks and heavy tasks. Heavy tasks are allocated first and then light tasks are allocated. The allocation method based on the difference in utilization is adopted to allocate the task to a processor on a multiprocessor platform.
[0037] like Figure 3 As shown, the (20) task pre-allocation step includes:
[0038] (21) Classification of heavy and light tasks: Mixed criticality tasks with a utilization rate greater than the threshold of light tasks under the criticality mode of the task are classified as heavy tasks, and the rest are classified as light tasks.
[0039] First, calculate the utilization rate of the task under its own criticality mode. If the utilization rate is greater than or equal to the light task threshold u T ,Right now Classify the task as a heavy task, otherwise classify it as a light task. For a mixed criticality system with only two criticality levels, u T =0.2. Among them, task utilization rate This refers to task τ i Task utilization at system criticality level j represents the share of processor time used when executing the task. Let C represent this, where C i (j) represents task τ i Worst execution time when the system criticality level is j.
[0040] (22) Heavy task allocation: Sort all heavy tasks in descending order of utilization rate under their respective criticality modes, and allocate heavy tasks in sequence.
[0041] In the heavy task allocation step (22), the heavy tasks are allocated sequentially as follows:
[0042] For high-criticality tasks, an allocation method based on utilization differences is adopted, assigning them to the processor with the smallest difference between processor utilization in high-criticality mode and processor utilization in low-criticality mode.
[0043] The utilization-based allocation method is a significant improvement in task schedulability. It sorts all tasks in descending order of utilization under their respective criticality modes and allocates them accordingly. For high-criticality tasks, it calculates the utilization difference Δu between each processor in high-criticality and low-criticality modes. k Assign the task to Δu k On the smallest processor, among which φ k This refers to the set of tasks already allocated to processor k. For example... Figure 4 As shown, for a mixed-criticality system with four processors, different colors represent the utilization of the processors in different criticality modes. For processor 1, the system utilization is 0.4 in low-criticality mode (excluding low-criticality tasks) and 0.6 in high-criticality mode. When the next task to be assigned is a high-criticality task, the Δu of each processor is calculated as follows: Figure 4 As shown, the next task will be preferentially assigned to processor number 1, which has a utilization difference of 0.2.
[0044] For low-criticality tasks, they are assigned to the first schedulable processor according to the processor index order.
[0045] (23) Light task allocation: Light tasks are divided into high-criticality light tasks and low-criticality light tasks according to their criticality. High-criticality light tasks are allocated first, and then low-criticality light tasks are allocated.
[0046] In the light task allocation step (23), the light tasks are allocated sequentially as follows:
[0047] For high-criticality light tasks, tasks are sorted in descending order of utilization in high-criticality mode and allocated sequentially. An allocation method based on utilization difference is used to allocate the task to the processor with the smallest difference between processor utilization in high-criticality mode and processor utilization in low-criticality mode.
[0048] For low-criticality light tasks, they are sorted in descending order of utilization under low-criticality mode and allocated sequentially to the first schedulable processor.
[0049] (30) Task allocation optimization: Optimize and adjust the pre-allocation results of tasks to processors.
[0050] like Figure 5 As shown, the (30) task allocation optimization step includes:
[0051] (31) Classification of fixed tasks and redistributed tasks: The tasks of the hybrid criticality system are classified according to the criticality level of the task; for each task, if the utilization rate of the task in its criticality mode is more than three times the average utilization rate of all tasks in the criticality mode, the task is set as a fixed task, and the remaining tasks are set as redistributed tasks.
[0052] For each criticality level, first calculate the average utilization rate of all tasks. Then compare the utilization rate of each task. If the maximum utilization rate of a task is more than three times the average utilization rate under that criticality mode, that is... Then set the task as a fixed task; otherwise, set it as a reassigned task.
[0053] (32) Fixed task optimization: Directly assign fixed tasks to the processors allocated in the pre-allocation phase;
[0054] (33) Task reassignment optimization: The greedy full search method is used to reassign tasks.
[0055] like Figure 6 As shown, the (33) task reallocation optimization step includes:
[0056] (331) Reassignment task sorting: All reassignment tasks are sorted in descending order of utilization rate according to their respective criticality modes;
[0057] (332) Processor sorting: Try to assign each redistribution task to all processors in turn, calculate the increase in stack space for each processor, and sort the processors in ascending order.
[0058] First, try to make the first task τ i The computation task τ is allocated to each processor. iAfter being allocated to the processor, the processor's stack space increases by Δst. k (τ i ), Δst k (τ i )=st k (φ k ∪τ i )-st k (φ k ), and will schedule the available processors according to Δst k (τ i Sort in ascending order;
[0059] (333) Task allocation: Select the processor with the smallest increase in system stack space for task allocation;
[0060] (334) Optimization complete: If the remaining tasks cannot be successfully allocated according to the above method, the backtracking method is used to allocate the current task to the next system stack space with the second smallest processor core, and then jump to step (332) until all tasks are successfully allocated to the processor.
Claims
1. A task scheduling method for a multiprocessor platform hybrid criticality system, characterized in that, The steps include the following: (10) Single processor hybrid criticality task scheduling: Each hybrid criticality task on the same processor is assigned a priority and a preemption threshold as scheduling parameters. The task is scheduled according to the scheduling parameters. Each hybrid criticality task runs on the assigned processor. (20) Task pre-allocation to processor: Based on the processor utilization required by the task, the mixed criticality system tasks are divided into light tasks and heavy tasks. Heavy tasks are allocated first and then light tasks are allocated. The allocation method based on the difference in utilization is adopted to allocate the task to a processor on the multiprocessor platform. (21) Classification of heavy and light tasks: Mixed criticality tasks whose utilization rate is greater than the threshold of light tasks under the criticality mode of the task are classified as heavy tasks, and the rest are classified as light tasks. (22) Heavy task allocation: Sort all heavy tasks in descending order of utilization rate according to their criticality mode, and allocate heavy tasks in turn; For high-criticality tasks, an allocation method based on utilization differences is adopted, assigning them to the processor with the smallest difference between processor utilization in high-criticality mode and processor utilization in low-criticality mode. For low-criticality tasks, they are assigned to the first schedulable processor according to the processor index order; (23) Light task allocation: Light tasks are divided into high-criticality light tasks and low-criticality light tasks according to their criticality. High-criticality light tasks are allocated first, and then low-criticality light tasks are allocated. (30) Task allocation optimization: Optimize and adjust the pre-allocation results of tasks to processors.
2. The task scheduling method according to claim 1, characterized in that, The (10) single-processor hybrid criticality task scheduling step includes: (11) Prepayment Priority: Before a task is executed, all tasks are assigned a fixed priority and a preemption threshold. (12) Priority change: When a task starts execution, the priority of the task is changed to the preemption threshold. At this time, only tasks with a priority greater than the preemption threshold can complete the preemption. (13) Task scheduling: Each mixed-criticality task is assigned to one processor on the multiprocessor platform and scheduled according to the assigned fixed priority and preemption threshold. The task runs on the assigned processor.
3. The task scheduling method according to claim 1, characterized in that, In the light task allocation step (23), the light tasks are allocated sequentially as follows: For high-criticality light tasks, tasks are sorted in descending order of utilization in high-criticality mode and allocated sequentially. An allocation method based on utilization difference is used to allocate the task to the processor with the smallest difference between processor utilization in high-criticality mode and processor utilization in low-criticality mode. For low-criticality, lightweight tasks, they are sorted in descending order of utilization under the low-criticality mode and allocated sequentially to the first schedulable processor.
4. The task scheduling method according to claim 1, characterized in that, The task allocation optimization steps (30) include: (31) Classification of fixed tasks and redistributed tasks: The tasks of the hybrid criticality system are classified according to the criticality level of the task; for each task, if the utilization rate of the task in the criticality mode is more than three times the average utilization rate of all tasks in the criticality mode, the task is set as a fixed task, and the remaining tasks are set as redistributed tasks. (32) Fixed task optimization: Fixed tasks are directly assigned to the processors allocated in the pre-allocation phase; (33) Task redistribution optimization: The greedy full search method is used to redistribute the redistribution tasks.
5. The task scheduling method according to claim 4, characterized in that, The (33) task redistribution optimization steps include: (331) Reassignment task sorting: All reassignment tasks are sorted in descending order of utilization rate according to their respective criticality modes; (332) Processor sorting: Try to assign each redistribution task to all processors in turn, calculate the increase in stack space for each processor, and sort the processors in ascending order; (333) Task allocation: Select the processor with the smallest increase in system stack space for task allocation; (334) Optimization complete: If the remaining tasks cannot be successfully allocated according to step (333), a backtracking method is used to allocate the current task to the next system stack space with the second smallest processor core, and then jump to step (332) until all tasks are successfully allocated to the processor.