Multi-processor system-oriented multi-mode security sensing real-time task scheduling method and electronic equipment

Through multi-mode security awareness scheduling method and hybrid trust task division, the problem of improving AEW and untrusted execution time in multi-processor real-time systems is solved, and the system's security protection capability and defense success rate are improved.

CN119088526APending Publication Date: 2024-12-06DALIAN UNIV OF TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411229848.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-03
Publication Date
2024-12-06

AI Technical Summary

Technical Problem

When facing scheduling-based attacks, existing multi-processor real-time systems fail to fully utilize the parallelism of multi-core processors, and cannot effectively reduce the cumulative attack effective window (AEW) and untrusted tasks of attacked tasks. Causes insufficient safety performance.

Method used

A multi-mode security-aware real-time task scheduling method is proposed. By minimizing the proportion of AEW and the proportion of untrusted execution time within AEW, using the worst-to-adapt hybrid trust adaptation descending heuristic strategy to balance the workload of tasks between different processors, combined with the protection window Thresholds and priorities reversal budgets, scheduling trusted and untrusted tasks to reduce systemic risks.

Benefits of technology

It improves the security protection capability of multi-processor systems, reduces the proportion of AEW and the proportion of untrusted tasks within AEW, enhances the defense success rate, and avoids the overall system protection performance decline caused by excessive blockage.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119088526A_ABST
    Figure CN119088526A_ABST
Patent Text Reader

Abstract

The invention discloses a multi-processor system-oriented multi-mode security sensing real-time task scheduling method and electronic equipment, which are used for enhancing the security protection capability of a multi-processor real-time system. Setting the untrusted task with the highest priority on any processor as a to-be-executed task on the processor where the task is located, and scheduling the to-be-executed task; otherwise, setting the multiprocessor system to be in a second mode; if any processor in the multiprocessor system has the attacked task to be executed, setting the attacked task with the highest priority on any processor as to be executed and scheduled on the processor where the task is located; otherwise, the multiprocessor system is set to be in a third mode; if the duration time of the third mode does not exceed the protection window threshold value of the system, setting the trusted task with the highest priority on any processor in the multiprocessor system to be executed and scheduled on the processor of the task; otherwise, the multiprocessor system is set to be in the first mode.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of embedded real-time system security, and in particular relates to a security-aware task scheduling method for a multi-processor real-time system, which is used to optimize the protection capability of the system under the constraints of system schedulability. Background Art

[0002] Embedded real-time systems are widely used in safety-critical applications such as automotive, aviation, and industrial robotics. These systems usually execute in a predictable and deterministic manner, delivering critical functions within strict time constraints. However, this predictable execution mode is vulnerable to scheduling-based attacks. For example, attackers can exploit the deterministic execution mode to infer sensitive scheduling information through timing side channels. Using the system internal knowledge gleaned from such attacks, malicious attackers can craft more effective customized attacks, such as compromising system stability by injecting inaccurate data and affecting vehicle operation by blocking control system signals. At the same time, real-time systems tend to be connected to networks, which enable remote monitoring of the system. These systems exposed to external interactions increase the likelihood of being attacked. In addition, the continuous demand for computing power has driven embedded real-time systems to develop towards multi-processor architectures. Therefore, it is very important to provide effective security strategies for multi-processor real-time systems to defend against scheduling-based attacks without compromising real-time performance constraints.

[0003] The success rate of scheduling-based attacks usually depends on whether the attacker's task is executed within the attack effective window (AEW) related to the execution state of the attacked task. There are many studies on security-aware scheduling methods to defend against scheduling-based attacks. Traditionally, research in this field has focused on single-processor systems, but now it is increasingly moving towards multi-processor systems. For multi-core processor platforms with multiple attacked tasks, Chen et al. proposed a security-aware scheduling method called SchedGuard++. This method provides best-effort protection for multi-processor systems by preventing untrusted tasks from executing within the AEW of the attacked task. However, this method fails to fully utilize the parallelism of multi-core processor systems and cannot effectively reduce the cumulative AEW of the attacked task and the execution time of the untrusted task in the AEW to optimize security performance under schedulability constraints. Summary of the invention

[0004] In view of the problems existing in the prior art, the present invention proposes a multi-mode security-aware real-time task scheduling method for multi-processor systems, which enhances the security protection capability of multi-processor real-time systems when facing scheduling-based side-channel attacks by minimizing the AEW ratio and the untrusted execution time ratio within AEW.

[0005] In a first aspect, according to some embodiments of the present application, a multi-mode safety-aware real-time task scheduling method for a multi-processor system includes:

[0006] placing the multiprocessor system in a first mode;

[0007] If any processor of the multi-processor system has an untrusted task, setting the untrusted task with the highest priority on any processor to be executed on the processor where the task is located and scheduling it; otherwise, setting the multi-processor system to the second mode;

[0008] If any processor in the multi-processor system has an attacked task to be executed, the attacked task with the highest priority on any processor is set to be executed and scheduled on the processor where the task is located; otherwise, the multi-processor system is set to the third mode;

[0009] If the duration of the third mode does not exceed the protection window threshold of the system, the trusted task with the highest priority on any processor in the multi-processor system is set to be executed and scheduled on the processor described in the task; otherwise, the multi-processor system is set to the first mode.

[0010] According to the multi-mode security-aware real-time task scheduling method for a multi-processor system in some embodiments of the present application, it also includes:

[0011] In the first mode, and the attacked task must be executed to ensure schedulability, setting the multiprocessor system to a second mode;

[0012] In the second mode, and the duration of the second mode exceeds the shortest period of the untrusted task, setting the multi-processor system to a third mode;

[0013] In the third mode, and the attacked task must be executed to ensure schedulability, the multiprocessor system is set to the first mode.

[0014] According to the multi-mode security-aware real-time task scheduling method for a multi-processor system in some embodiments of the present application, the protection window threshold is calculated based on the following method:

[0015] Assigning attacked tasks in the data set to processors in a multi-processor system;

[0016] Then, the trusted tasks in the data set are assigned to processors in the multi-processor system;

[0017] Then, the untrusted tasks in the data set are assigned to processors in the multi-processor system;

[0018] If it is determined that any processor in the multi-processor system has an attacked task, calculating a protection window threshold of the attacked task of any processor;

[0019] Calculating a processor protection window threshold of any processor according to the protection window threshold of the attacked task of any processor;

[0020] A protection window threshold of the system is calculated according to the processor protection window thresholds of all the processors.

[0021] According to a multi-mode security-aware real-time task scheduling method for a multi-processor system in some embodiments of the present application, the attacked tasks in a data set are assigned to processors in the multi-processor system, including:

[0022] sorting the attacked tasks in the data set in descending order according to task utilization;

[0023] sorting the processors in ascending order according to processor utilization;

[0024] If the attacked task with the highest current task utilization rate in the data set is schedulable;

[0025] Assigning the attacked task with the highest current task utilization in the data set to the processor with the lowest current processor utilization in the multi-processor system until the attacked task in the data set is empty;

[0026] The trusted tasks in the data set are then assigned to processors in the multi-processor system, including

[0027] sorting the attacked tasks in the data set in descending order according to task utilization;

[0028] sorting the processors in ascending order according to processor utilization;

[0029] If the trusted task with the highest current task utilization rate in the data set is schedulable;

[0030] Assigning the trusted task with the highest current task utilization in the data set to the processor with the lowest current processor utilization in the multi-processor system until the trusted task in the data set is empty;

[0031] Among them, the untrusted tasks in the data set are then assigned to processors in the multi-processor system, including

[0032] sorting the attacked tasks in the data set in descending order according to task utilization;

[0033] sorting the processors in ascending order according to processor utilization;

[0034] If the untrusted task with the highest current task utilization in the data set is schedulable;

[0035] The untrusted task with the highest current task utilization in the data set is assigned to the processor with the lowest current processor utilization in the multi-processor system until the untrusted tasks in the data set are empty.

[0036] According to the multi-mode safety-aware real-time task scheduling method for a multi-processor system in some embodiments of the present application, the current task is schedulable means that the current task is schedulable based on the RM policy.

[0037] According to a multi-mode security-aware real-time task scheduling method for a multi-processor system in some embodiments of the present application, wherein the execution time of the task to be executed is a first time, the task is set to be executed and scheduled, including

[0038] If the task to be executed is in the processor where the task to be executed is a task with the highest priority among the tasks of the same type as the task to be executed in the ready queue of the processor, the processor executes the task to be executed at the first time;

[0039] Otherwise, calculating the maximum priority inversion budget of all tasks in the ready queue of the processor that are of the same type as the task to be executed and have a higher priority than the task to be executed;

[0040] According to the maximum priority inversion budget, determining whether the scheduling is completed, and if the scheduling is not completed, calculating the execution time of the task to be executed;

[0041] According to the execution time of the task to be executed, the processor executes the execution time of the task to be executed.

[0042] Wherein, judging whether the scheduling is finished according to the maximum priority inversion budget, and if the scheduling is not finished, calculating the execution time of the task to be executed, including

[0043] If at least one of the maximum priority inversion budgets is less than 0, the scheduling of the task to be executed is terminated;

[0044] If the maximum priority inversion budgets are not less than 0, the execution time of the task to be executed is calculated, and the processor executes the execution time on the task to be executed;

[0045] The execution time is the smallest one of the first time of the task to be executed and the maximum priority inversion budget of all tasks having a higher priority than the task to be executed.

[0046] The maximum priority inversion budget of all tasks in the ready queue of the processor that are of the same type as the task to be executed and have a higher priority than the task to be executed is calculated, including:

[0047] If the task to be executed is in the ready queue of the processor at the current moment, the maximum priority inversion budget of all tasks having a higher priority than the task to be executed is calculated using the first method;

[0048] If the task to be executed is currently in the ready queue of the processor, the maximum priority inversion budget of all tasks having a higher priority than the task to be executed is calculated using the second method.

[0049] According to the multi-mode security-aware real-time task scheduling method for a multi-processor system in some embodiments of the present application, within a supercycle of the multi-processor system, if it is determined that any processor in the multi-processor system has an attacked task, the protection window threshold of the attacked task of any processor is calculated, which is expressed by the following formula:

[0050]

[0051] In the formula, represents the protection window threshold of the attacked task, represents the attacked task period, Γ u (π k ) represents processor π k The set of untrusted tasks, τ j represents the task, U j represents the task utilization rate, Indicates the utilization rate of the attacked task;

[0052] According to the protection window threshold of the attacked task of any processor, the processor protection window threshold of any processor is calculated, which is represented by the following formula:

[0053]

[0054] In the formula, S max (π k ) represents the processor protection window threshold, represents the attacked task, Γ v (π k ) represents processor π k The attacked task set;

[0055] According to the processor protection window threshold of any of the processors, the protection window threshold of the system is calculated, which is represented by the following formula:

[0056]

[0057] In the formula, represents the protection window threshold of the system, π k represents the kth processor, and Π represents the processor set.

[0058] According to a multi-mode security-aware real-time task scheduling method for a multi-processor system in some embodiments of the present application, if the task to be executed is in the ready queue of the processor at the current moment, the maximum priority inversion budget of all tasks with a priority higher than the task to be executed is calculated using a first method; if the task to be executed is in the ready queue of the processor at the current moment, the maximum priority inversion budget of all tasks with a priority higher than the task to be executed is calculated using a second method, which is expressed by the following formula:

[0059] Maximum priority inversion budget is the task to be executed h Before time t, all low priority tasks lp(τ h )The maximum execution time, ensuring τ h Worst-case schedulability, The lower bound of It is expressed as:

[0060]

[0061] In the formula, is the job to be executed at time t (Tasks to be executedτ h The absolute deadline of the job to be executed Represents the task to be executed τ h The truth, For jobs to be executed The worst case remaining execution time, is the ratio of the tasks to be executed h The high priority task hp(τ h ) in the time interval The worst-case workload within is calculated as:

[0062]

[0063] In the formula, τ j Indicates that all tasks with higher priority than the tasks to be executed h High task hp(τ h ), represents the smallest non-negative integer greater than or equal to x, For the task τ j The worst remaining execution time at time t, For the task τ j The release time of the first job released after time t, T j Represents the cycle of a single task, C j represents the worst-case execution time of a single task;

[0064] In the formula, is in the task τ h When released, at hp(τ h ) when there is no delayed task, the number of pending tasks τ h The maximum amount of extra time a person can have to meet their deadline, It is expressed as:

[0065]

[0066] Where D h is the relative deadline of task τh, W h (δ) is the time from the critical moment to the completion of the response of the request corresponding to the task τh to be executed under the additional execution time δ;

[0067] Among them, The initial value is C h +δ, pending tasksτ h C h represents the worst case execution time, W h (δ) is obtained by solving the following iterative formula:

[0068]

[0069] In the formula, W represents the end of the iteration h (δ), n represents the number of iterations.

[0070] According to a multi-mode security-aware real-time task scheduling method for a multi-processor system in some embodiments of the present application, if at least one of the maximum priority inversion budgets is less than 0, the scheduling of the task to be executed is terminated; if the maximum priority inversion budgets are not less than 0, the execution time of the task to be executed is calculated, and the processor executes the execution time for the task to be executed; wherein the execution time is the minimum of the first time of the task to be executed and the maximum priority inversion budgets of all tasks with a priority higher than the task to be executed, which is expressed as follows:

[0071] set up Represents the task to be executed τ h The maximum feasible execution time at time t, The initial value is By calculating each task τj ∈hp(τ h ) to check the lower bound of the maximum priority inversion budget of the job to be executed at time t The feasibility of j ∈hp(τ h ), task τ j of If it is not greater than 0, the job will be executed at time t. is not feasible; otherwise, it is feasible and the job is executed Executed at time t, and the maximum feasible execution time for

[0072] In a second aspect, an electronic device comprises: one or more processors, a memory, and one or more programs; wherein the one or more programs are stored in the memory, and the one or more programs comprise instructions, which, when executed by the electronic device, enable the electronic device to perform any one of the methods.

[0073] Beneficial effects:

[0074] On the first aspect, the present invention introduces a security-aware task-to-processor partitioning method, and utilizes a hybrid trust worst-fit descending order heuristic strategy to balance the workload of hybrid trust tasks between different processors, so that untrusted tasks, attacked tasks, and trusted tasks are evenly divided among different processors based on utilization, thereby improving the parallel execution rate of attacked tasks during the operation cycle, and making the attack effective window AEW related to the execution status of the attacked tasks of each processor of the multi-processing system of the present invention highly uniform and overlapping. Compared with the phenomenon of relatively dispersed AEW caused by random execution of attacked tasks without the above-mentioned division, the present invention can reduce the AEW proportion of the multi-processor system and improve the protection capability of the multi-processor system.

[0075] On the second aspect, the present invention proposes to schedule hybrid trusted tasks based on the system model in a security-aware mode according to the operating state of the system, and introduce multiple attacked task protection windows to characterize the system protection capability limitations under schedulability constraints, wherein the attack effective window AEW refers to the time range in which the attacker can use the scheduling of his task to interfere with or affect the execution of other tasks. The attack effective window AEW usually appears after the attacked task is scheduled and executed, and executing untrusted tasks within the AEW will increase the system risk. The security-aware mode scheduling scheme of the present invention, on the one hand, sets the AEW to schedule the execution of trusted tasks in the protection mode, and on the other hand, uses the system's protection window threshold to ensure that the system within the AEW can only be in the protection mode, reducing the proportion of untrusted tasks within the AEW, which can greatly reduce system risks, alleviate scheduling-based attacks, and avoid the degradation of the overall system protection performance due to excessive blocking of untrusted tasks.

[0076] On the third side, based on the high uniformity and overlap of the attack effective window AEW related to the execution state of the attacked tasks of each processor of the multi-processing system of the present invention in the first aspect, the AEW ratio of the multi-processor system is reduced. On this basis, the hybrid trusted tasks are scheduled based on the system model in the collaborative security perception mode to reduce the proportion of untrusted tasks in AEW. It can be understood that the division in the first aspect is an important basis for realizing the establishment of the security perception mode in the second aspect. It is the division in the first aspect that makes the uniformity and overlap of AEW high. The security perception mode can be implemented on this basis and significantly reduce the AEW ratio and the proportion of untrusted tasks in AEW within the execution time interval, thereby improving the success rate of defense. BRIEF DESCRIPTION OF THE DRAWINGS

[0077] Figure 1 It is a flow chart of the present invention, wherein a is the upper half of the flow chart and b is the lower half of the flow chart.

[0078] Figure 2 is a comparison diagram of this scheduling example, wherein a is a scheduling diagram of a scheduling example of the prior art, and b is a scheduling diagram of a scheduling example of the algorithm of the embodiment of the present invention

[0079] Figure 3 Comparison diagram of the relationship between the AEW ratio of each algorithm within the super period and the utilization of the system with different AEW sizes, a is AEW = 10, b is AEW = 30, and c is AEW = 50.

[0080] Figure 4 Comparison diagram of the relationship between the AEW untrusted execution time ratio of each algorithm within the super period and the utilization of the system with different AEW sizes, a is AEW = 10, b is AEW = 30, and c is AEW = 50.

[0081] Figure 5 The following is a comparison chart of the relationship between the defense success rate of each scheduling algorithm against ScheduLeak and the utilization rate of the task set.

[0082] Figure 6 It is a comparison chart of the relationship between the average scheduling time of each algorithm within 10 super cycles and the system utilization. DETAILED DESCRIPTION

[0083] In order to better illustrate the purpose and advantages of the present invention, the invention is further described below with reference to the accompanying drawings and examples. It should be pointed out that the implementation of the present invention is not limited to the following embodiments, and any form of modification or change made to the present invention will fall within the scope of protection of the present invention. The present application provides a method, an electronic device, and a computer-readable storage medium. Among them, the method, the device, and the computer-readable storage medium are based on the same technical concept. Since the principles of solving problems by the method, the device, and the computer-readable storage medium are similar, the implementation of the device and the method can refer to each other, and the repeated parts will not be repeated.

[0084] like Figure 1 As shown, a multi-mode security-aware real-time task scheduling method for a multi-processor system, the steps are as follows:

[0085] Step 1: Hybrid trusted task division, including

[0086] A set of hybrid trusted real-time tasks Γ is efficiently allocated to P homogeneous processor cores. Under the premise of ensuring the overall schedulability of the system, the balanced distribution of the hybrid trusted task load on each core is achieved, thereby maximizing the security protection capability of the system under the condition of satisfying the schedulability constraints.

[0087] Among them, in the process of task division, the task sets of all cores are first set to empty. Then, the attacked tasks, trusted tasks and untrusted tasks are assigned in turn. For each type of task, they are traversed in the order of their non-increasing utilization. In the allocation process, try to assign each task to the cores in the processor core set Π in turn, and these cores are sorted in non-decreasing order according to utilization. If a task cannot find a feasible allocation scheme based on the monotonic rate (Rate Monotonic, referred to as RM) scheduling strategy on any core, it will terminate and report failure, which means that under the current task division and processor core utilization, the system cannot meet the scheduling requirements of the task.

[0088] If all tasks are successfully assigned to the corresponding cores, success will be reported, which indicates that a task allocation scheme that meets the system schedulability constraints has been successfully found, while achieving a balanced distribution of mixed trusted task loads on the cores, thereby maximizing the system's security protection capabilities.

[0089] Step 2: Calculate the protection window threshold, including

[0090] In a super cycle of the system, calculate the protection window threshold of the attacked task on each processor:

[0091]

[0092] In the formula, represents the protection window threshold of the attacked task, represents the attacked task period, Γ u (π k ) represents processor π k The set of untrusted tasks, τ j represents the task, U j represents the task utilization rate, Indicates the utilization rate of the attacked task;

[0093] Calculate the protection window threshold of each processor from the above results:

[0094]

[0095] In the formula, S max (π k ) represents the processor protection window threshold, represents the attacked task, Γ v (π k ) represents processor π k The attacked task set;

[0096] Finally, the protection window threshold of the system is calculated:

[0097]

[0098] In the formula, represents the protection window threshold of the system, π k represents the kth processor, and Π represents the processor set.

[0099] Step 3: Security-aware mode scheduling

[0100] Before scheduling starts, the system monitors whether there are any messages in the task queue. If there are, the security-aware scheduling algorithm is started. If not, the system is shut down and scheduling ends.

[0101] Step 3.1: Mode conversion, including

[0102] The system defines three modes: normal mode, denoted as M N ; Attack mode, denoted as M V ; Protection mode, denoted as M P .

[0103] When the system is in mode M s Runs under and receives and outgoing conversion (M s ,M t ) associated with the MCR, it immediately switches to the new mode M t And enforce. s Indicates the current system mode, (M s ,M t ) indicates that M s Convert to M t Mode instruction.

[0104] The present invention considers four mode conversions:

[0105] M N →M V : This transition is triggered when there are no untrusted tasks to be executed on any core, or when the attacked task must be executed to ensure schedulability.

[0106] M V →M P : This transition is triggered when there is no attacked task to be executed on any core, or the attack mode lasts longer than the minimum period of untrusted tasks.

[0107] M P →M N : This transition is triggered when the protection mode duration exceeds the system protection window threshold.

[0108] M P →M V : This transition is triggered when the attacked task must be executed to ensure schedulability.

[0109] Step 3.2: Security-aware mode scheduling, including

[0110] Candidate tasks are selected based on the current system mode. The system is initially set to normal mode. When the system is in normal mode, the execution feasibility of the highest priority ready untrusted task is checked. When the system is in attacked mode, the execution feasibility of the highest priority ready attacked task is checked. When the system is in protected mode, if there is a trusted task in the ready queue, the execution feasibility of the highest priority ready trusted task is checked; otherwise, the execution feasibility of the idle task is checked. The initial value of the execution feasibility flag of the candidate task is True.

[0111] Step 3.3: Perform feasibility test: During the security-aware scheduling process of each system mode, some high-priority tasks will be blocked by low-priority tasks. In order to ensure the schedulability of the system when the priority is reversed, it is necessary to perform feasibility test on the candidate task J. test Perform feasibility test. Note that if J testis the ready queue Q t If J is the highest priority job among all the jobs, it is always possible to execute this task because no priority inversion will occur during its execution. test Not the ready queue Q t The highest priority job in J test Perform online feasibility testing.

[0112] Among them, step 3.3: perform feasibility testing, including

[0113] Step 3.3.1: Calculate the maximum priority inversion budget.

[0114] Step 3.3.2: Determine the feasibility of execution and calculate the maximum executable time.

[0115] Among them, step 3.3.1: calculate the maximum priority inversion budget, including

[0116] Maximum priority inversion budget is the task to be executed h Before time t, all low priority tasks lp(τ h )The maximum execution time, ensuring τ h Worst-case schedulability, The lower bound of It is expressed as:

[0117]

[0118] In the formula, is the job to be executed at time t (Tasks to be executedτ h The absolute deadline of the job to be executed Represents the task to be executed τ h The truth, For jobs to be executed The worst case remaining execution time, is the ratio of the tasks to be executed h The high priority task hp(τ h ) in the time interval The worst-case workload within is calculated as:

[0119]

[0120] In the formula, τ j Indicates that all tasks with higher priority than the tasks to be executed h High task hp(τ h ), represents the smallest non-negative integer greater than or equal to x, For the task τj The worst remaining execution time at time t, For the task τ j The release time of the first job released after time t, T j Represents the cycle of a single task, C j represents the worst-case execution time of a single task;

[0121] In the formula, is in the task τ h When released, at hp(τ h ) when there is no delayed task, the number of pending tasks τ h The maximum amount of extra time a person can have to meet their deadline, It is expressed as:

[0122]

[0123] Where D h is the relative deadline of task τh, W h (δ) is the time from the critical moment to the completion of the response of the request corresponding to the task τh to be executed under the additional execution time δ;

[0124] Among them, The initial value is C h +δ, pending tasksπ h C h represents the worst case execution time, W h (δ) is obtained by solving the following iterative formula:

[0125]

[0126] In the formula, W represents the end of the iteration h (δ), n represents the number of iterations.

[0127] Among them, step 3.3.2: judging the feasibility of execution and calculating the maximum executable time includes

[0128] set up Represents the task to be executed π h The maximum feasible execution time at time t, The initial value is By calculating each task π j ∈hp(τ h ) to check the lower bound of the maximum priority inversion budget of the job to be executed at time t The feasibility of j ∈hp(τ h ), task π j of If it is not greater than 0, the job will be executed at time t. is not feasible; otherwise, it is feasible and the job is executed Executed at time t, and the maximum feasible execution time for

[0129] In a specific example, for example, there is a task set Γ including mixed trusted tasks: τ1, τ2, τ3 and τ4.

[0130] Tasks τ1 and τ2 are attacked tasks. The period is T v =10, the worst execution time C v =1, the deadline is D v =10. Attacked Mission The period is T v =20, the worst execution time C v =2, deadline is D v =20.

[0131] Four trusted tasks, trusted tasks and Parameters are the same as the attacked task and Attacked Mission and The parameters are the same, and the period is T t =20, the worst execution time C t =4, deadline is D t =20.

[0132] Four untrusted tasks, untrusted tasks The period is T u =10, the worst execution time C u =4, deadline is D u = 10. Untrusted Task The period is T u =10, the worst execution time C u =4, deadline is D u = 10. Untrusted Task The period is T u =20, the worst execution time C u =5, deadline is D u =20. Untrustworthy Task The period is T u =20, the worst execution time C u =5, deadline is D u =20.

[0133] The above task set is schedulable based on the RM strategy.

[0134] The core of the present invention is to reduce the AEW ratio and the proportion of untrusted tasks in the AEW within the execution time interval under the condition that all tasks can be scheduled, thereby improving the success rate of defense. When the job of the selected task is not the highest priority in the ready queue, and the priority inversion budget will affect the schedulability of the system, the execution of the job is canceled. Otherwise, the execution is allowed. Figure 1 The flowchart shown shows a specific implementation of the present invention.

[0135] Step 1: Hybrid Trusted Task Division

[0136] First, the attacked task and Divide into cores, because there are no tasks on the initial four cores and the attacked tasks and The utilization is the same, so the order is divided into processors π1 and π2. Then divide the trust tasks, four trust tasks The utilization rate is the lowest. The other three are the same, so the trusted task with low utilization rate is Divide it into processor π1 with small capacity, and put the trusted tasks with high utilization rate Divided to the processor π3 with large capacity. Because the trusted task and The utilization is always the same, so the order can be swapped arbitrarily. Here, the trusted task Assign it to processor π4 and transfer the trusted task Assign to processor π2. Finally, divide the untrusted tasks because By remaining capacity So untrusted tasks Assigned to processor π1, untrusted task It is assigned to untrusted task π3, untrusted task It is assigned to the untrusted task π2. Assigned to untrusted task π4.

[0137] Step 2: Calculate the protection window threshold

[0138] For processor π1, because:

[0139]

[0140] so:

[0141]

[0142] For processor π2, because:

[0143]

[0144] so:

[0145]

[0146] Because there are no attacked tasks on processors π3 and π4, so:

[0147] S max (π3)=∞

[0148] S max (π4)=∞

[0149] Finally, the protection window threshold of all attacked tasks (system protection window threshold) is calculated:

[0150]

[0151] Therefore, the system protection window threshold within a super cycle is 5.

[0152] Step 3: Security-aware mode scheduling

[0153] Step 3.1: Mode conversion

[0154] As attached Figure 2 As shown, the example process includes M N →M V 、M V →M P and M P →M N Three modes conversion. P →M N The condition for mode switching is that the system reaches the protection window threshold 5.

[0155] Step 3.2: Security-aware mode scheduling

[0156] The system is initially in normal mode. For processor π1, only It is an untrusted task, so choose Execute. After the mode is switched, the attacked task in the ready queue will be selected. and trusted tasks implement.

[0157] Step 3.3: Perform feasibility testing

[0158] For this example, no matter which core, there is only one task of each type in the core. For example, π1, the untrusted task has only Trusted tasks only The only attacked mission And the task cycles are the same, so according to the RM principle, they are assigned the same priority. Therefore, the test task selected for execution each time always has the highest priority in a specific mode, so priority inversion will not occur.

[0159] Step 3.3.1: Calculate the maximum priority inversion budget

[0160] Step 3.3.2: Determine execution feasibility and calculate maximum execution time

[0161] Each time the test task is selected for execution, it always has the highest priority in a specific mode, so the execution time of the task is

[0162] from Figure 2 It can be seen from the scheduling simulation of the task set in (b) that all tasks are schedulable, and all untrusted jobs are executed outside the AEW of all attacked tasks to protect all attacked jobs from being attacked by untrusted tasks. It can also be observed that in the time interval [0,20], the AEW ratio is Λ(Γ,P,[0,20])=(7+1) / 20=0.4, and in the time interval [0,20], the untrusted execution time ratio in AEW is Θ(Γ,P,[0,20])=0 / 20=0. Therefore, the MM-SARTS scheduling scheme of this patent can effectively reduce the AEW ratio and the untrusted execution time ratio in AEW, and can provide better protection. Therefore, under the condition of satisfying the schedulability of the multi-processor system, the present invention significantly reduces the AEW ratio and the proportion of untrusted tasks in AEW in the execution time interval, thereby improving the success rate of defense.

[0163] Experimental verification:

[0164] To verify the effectiveness of the present invention, the algorithm proposed in the present invention is referred to as MM-SARTS, and the existing coverage-oriented scheduling strategy and fixed priority scheduling strategy: RM and SchedGuard++ scheduling are selected as comparison algorithms.

[0165] In the comparative test, the present invention generates a task set based on the semi-harmonic period of a specific car to evaluate the performance of different scheduling methods. The periods of all tasks are randomly selected from the set {1, 2, 5, 10, 20, 50, 100, 200, 1000}. The task set is generated using the Automotive Benchmark and UUniFast methods, and the normalized utilization is used to guide the UUnifast algorithm to generate tasks. Define the deployment on a multi-processor platform Π={π1,…,π P The normalized utilization U of the task set Γ on nor (Γ) is: Among them U Γis the total utilization of the task set Γ, and P = 4 is the number of processors. Based on the above parameters, this experiment generates tasks one by one until the system utilization meets the following conditions:

[0166]

[0167] in The range is from 0.05 to 0.95, with a step size of 0.05. The experiment generates 1,000 task sets based on the value of . This experiment randomly selects 40% of the tasks in the task set as trusted tasks. Next, 50% of the trusted tasks are randomly selected as attacked tasks. Finally, the size of AEW is expressed as the percentage of the attacked task cycle, selected from {10, 30, 50}.

[0168] The evaluation of the present invention has three main indicators: (1) AEW ratio and AEW untrusted execution time ratio; (2) comparing the defense performance of the present invention's method with other scheduling methods; and (3) measuring the CPU time consumption of the scheduler to evaluate the overhead of different scheduling methods.

[0169] Figure 3 The relationship between the AEW ratio within the super cycle and utilization of different algorithms in systems with different AEW sizes is shown. It can be observed that MM-SARTS consistently outperforms all existing scheduling algorithms. As the utilization decreases, the performance gap tends to widen; this is because, as the utilization decreases, MM-SARTS has more opportunities to increase AEW overlap by using safety-aware task-processor encapsulation and multi-mode safety-aware scheduling, thereby reducing the AEW ratio. Specifically, for a system with an AEW size of 10%, when the system utilization is 0.60, MM-SARTS improves by about 18.8% over SchedGuard++ and by about 13.2% over the best non-safety-aware RM scheduling method RM-WF (AEW=10). From Figure 3 The present invention can also find that when the system utilization is 0.95, the improvement of MM-SARTS on AEW ratio reaches the lowest point. Even in this case, MM-SARTS still improves by 11.8% over SchedGuard++ and 7.5% over RM-WF scheduling method.

[0170] Figure 4The AEW untrusted execution time ratio of different algorithms in one hypercycle in the system with different AEW sizes is shown versus utilization. It can be observed that the AEW untrusted execution time ratio of all algorithms increases with the increase of AEW size and system utilization. This is because the AEW ratio and untrusted task workload tend to increase with the increase of AEW scale and system utilization. Note that when the system utilization is 0.05, the AEW untrusted execution time ratio of all methods tends to zero for all AEW settings, although there is still a part of the task set with a ratio greater than zero. It can also be observed that MM-SARTS consistently performs better than SchedGuard++ in all scenarios, which is not surprising. This is mainly due to the fact that MM-SARTS effectively reduces the AEW untrusted execution time ratio in multi-processor real-time systems with multiple attacked tasks by evenly distributing the mixed trust task workload on different processors and strategically scheduling the mixed trust tasks on each processor according to the system mode. In addition, for all warning sizes, the enhancement of the warning untrusted execution time ratio of MM-SARTS increases with the increase of system utilization. Specifically, in a system with an AEW size of 10%, when the system utilization is 0.6, MM-SARTS improves by 62.8% compared with SchedGuard++ and by 86.8% compared with the RM-WF scheduling method.

[0171] Figure 5 The comparison of the relationship between the defense success rate and task set utilization of different algorithms for ScheduLeak is shown. Here, the defense success rate is calculated as the failure rate of ScheduLeak, thereby inferring the accurate parameters of the attacked task. It can be seen in the present invention that compared with the RM-WF scheduling method that is not security-aware, both SchedGuard++ and MM-SARTS show excellent defense capabilities against attacks. This advantage is attributed to the ability of SchedGuard++ and MM-SARTS to prevent the attacker's task from running after the attacked task is completed, thereby giving the attacker a wrong impression of the execution time of the attacked task. Therefore, the attacker will be misled and launch an attack at the wrong time based on inaccurate timing information. In addition, it can be seen that MM-SARTS enhances the defense effect through the allocation of security-aware tasks to processors based on online feasibility tests and multi-mode security-aware scheduling, and is always better than SchedGuard++. Specifically, when the system utilization is 0.6, MM-SARTS is 16.3% higher than SchedGuard++.

[0172] Figure 6A comparison of the average online scheduling time over 10 supercycles versus system utilization for various algorithms is shown. Obviously, the non-safety-aware RM scheduling methods have the smallest scheduler overhead because they do not require online feasibility tests for priority inversions. The results also show that MM-SARTS has a slightly higher scheduler overhead than SchedGuard++. The main reason is that MMSARTS explores more priority inversion opportunities to improve protection performance, thereby including more online feasibility tests.

[0173] Based on the above embodiments, an embodiment of the present application further provides an electronic device, and when the computer program is run on the electronic device, the electronic device executes the method provided in the above embodiments.

[0174] Based on the above embodiments, the embodiments of the present application further provide a computer storage medium, in which a computer program is stored. When the computer program is executed by a computer, the computer executes the method provided in the above embodiments.

[0175] The storage medium may be any available medium that can be accessed by a computer. For example, but not limited to, a computer-readable medium may include RAM, ROM, EEPROM, CD-ROM or other optical disk storage, magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer.

[0176] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.

[0177] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0178] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0179] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0180] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.

Claims

1. A multi-mode security-aware real-time task scheduling method for multi-processor systems, It is characterized in that include placing the multiprocessor system into a first mode; If any processor of the multi-processor system has an untrusted task, setting the untrusted task with the highest priority on any processor to be executed on the processor where the task is located and scheduling it; otherwise, setting the multiprocessor system to a second mode; If any processor in the multi-processor system has an attacked task to be executed, the attacked task with the highest priority on any processor is set to be executed and scheduled on the processor where the task is located; otherwise, the multi-processor system is set to the third mode; If the duration of the third mode does not exceed the protection window threshold of the system, the trusted task with the highest priority on any processor in the multi-processor system is set to be executed and scheduled on the processor described by the task; otherwise, the multi-processor system is set to the first mode.

2. The multi-mode security-aware real-time task scheduling method for a multi-processor system according to claim 1, It is characterized in that in, Also includes In the first mode, and the attacked task must be executed to ensure schedulability, setting the multiprocessor system to a second mode; In the second mode, and the duration of the second mode exceeds the shortest period of the untrusted task, setting the multi-processor system to a third mode; In the third mode, and the attacked task must be executed to ensure schedulability, the multiprocessor system is set to the first mode.

3. The multi-mode security-aware real-time task scheduling method for a multi-processor system according to claim 1 or 2, It is characterized in that in, The protection window threshold is calculated based on the following method: Assigning attacked tasks in the data set to processors in a multi-processor system; Then, the trusted tasks in the data set are assigned to processors in the multi-processor system; Then, the untrusted tasks in the data set are assigned to processors in the multi-processor system; If it is determined that any processor in the multi-processor system has an attacked task, calculating a protection window threshold of the attacked task of any processor; Calculating a processor protection window threshold of any processor according to the protection window threshold of the attacked task of any processor; A protection window threshold of the system is calculated according to the processor protection window thresholds of all the processors.

4. The multi-mode security-aware real-time task scheduling method for a multi-processor system according to claim 3, It is characterized in that in, Assign the attacked tasks in the dataset to the processors in the multi-processor system, including sorting the attacked tasks in the data set in descending order according to task utilization; sorting the processors in ascending order according to processor utilization; If the attacked task with the highest current task utilization rate in the data set is schedulable; Assigning the attacked task with the highest current task utilization in the data set to the processor with the lowest current processor utilization in the multi-processor system until the attacked task in the data set is empty; The trusted tasks in the data set are then assigned to processors in the multi-processor system, including sorting the attacked tasks in the data set in descending order according to task utilization; sorting the processors in ascending order according to processor utilization; If the trusted task with the highest current task utilization rate in the data set is schedulable; Assigning the trusted task with the highest current task utilization in the data set to the processor with the lowest current processor utilization in the multi-processor system until the trusted task in the data set is empty; Among them, the untrusted tasks in the data set are then assigned to processors in the multi-processor system, including sorting the attacked tasks in the data set in descending order according to task utilization; sorting the processors in ascending order according to processor utilization; If the untrusted task with the highest current task utilization in the data set is schedulable; The untrusted task with the highest current task utilization in the data set is assigned to the processor with the lowest current processor utilization in the multi-processor system until the untrusted tasks in the data set are empty.

5. The multi-mode security-aware real-time task scheduling method for a multi-processor system according to claim 4, It is characterized in that in, The current task is schedulable if the current task is schedulable based on the RM strategy.

6. The multi-mode security-aware real-time task scheduling method for a multi-processor system according to claim 1, It is characterized in that in, The execution time of the pending task is the first time, the task is set to be executed and scheduled, including If the task to be executed is in the processor where the task to be executed is a task with the highest priority among the tasks of the same type as the task to be executed in the ready queue of the processor, the processor executes the task to be executed at the first time; Otherwise, calculating the maximum priority inversion budget of all tasks in the ready queue of the processor that are of the same type as the task to be executed and have a higher priority than the task to be executed; According to the maximum priority inversion budget, determining whether the scheduling is completed, and if the scheduling is not completed, calculating the execution time of the task to be executed; According to the execution time of the task to be executed, the processor executes the execution time of the task to be executed. Wherein, judging whether the scheduling is finished according to the maximum priority inversion budget, and if the scheduling is not finished, calculating the execution time of the task to be executed, including If at least one of the maximum priority inversion budgets is less than 0, the scheduling of the task to be executed is terminated; If the maximum priority inversion budgets are not less than 0, the execution time of the task to be executed is calculated, and the processor executes the execution time on the task to be executed; The execution time is the minimum of the first time of the task to be executed and the maximum priority inversion budget of all tasks having a higher priority than the task to be executed; The maximum priority inversion budget of all tasks in the ready queue of the processor that are of the same type as the task to be executed and have a higher priority than the task to be executed is calculated, including: If the task to be executed is in the ready queue of the processor at the current moment, the maximum priority inversion budget of all tasks having a higher priority than the task to be executed is calculated using the first method; If the task to be executed is currently in the ready queue of the processor, the maximum priority inversion budget of all tasks having a higher priority than the task to be executed is calculated using the second method.

7. The multi-mode security-aware real-time task scheduling method for a multi-processor system according to claim 3, It is characterized in that In a super cycle of a multi-processor system, if it is determined that any processor in the multi-processor system has an attacked task, a protection window threshold of the attacked task of any processor is calculated, which is expressed by the following formula: In the formula, represents the protection window threshold of the attacked task, represents the attacked task period, Γ u (π k ) represents processor π k The set of untrusted tasks, τ j represents the task, U j represents the task utilization rate, Indicates the utilization rate of the attacked task; According to the protection window threshold of the attacked task of any processor, the processor protection window threshold of any processor is calculated, which is represented by the following formula: In the formula, S max (π k ) represents the processor protection window threshold, represents the attacked task, Γ v (π k ) represents processor π k The attacked task set; According to the processor protection window threshold of any of the processors, the protection window threshold of the system is calculated, which is represented by the following formula: In the formula, represents the protection window threshold of the system, π k represents the kth processor, and Π represents the processor set.

8. The multi-mode security-aware real-time task scheduling method for a multi-processor system according to claim 6, It is characterized in that in, If the task to be executed is in the ready queue of the processor at the current moment, the maximum priority inversion budget of all tasks with a higher priority than the task to be executed is calculated using the first method; if the task to be executed is in the ready queue of the processor at the current moment, the maximum priority inversion budget of all tasks with a higher priority than the task to be executed is calculated using the second method, which is expressed by the following formula: Maximum priority inversion budget is the task to be executed h Before time t, all low priority tasks lp(τ h )The maximum execution time, ensuring τ h Worst-case schedulability, The lower bound of It is expressed as: In the formula, is the job to be executed at time t (Tasks to be executedτ h The absolute deadline of the job to be executed Represents the task to be executed τ h The truth, For jobs to be executed The worst case remaining execution time, is the ratio of the tasks to be executed h The high priority task hp(τ h ) in the time interval The worst-case workload within is calculated as: In the formula, τ j Indicates that all tasks with higher priority than the tasks to be executed h High task hp(τ h ), represents the smallest non-negative integer greater than or equal to x, For the task τ j The worst remaining execution time at time t, For the task τ j The release time of the first job released after time t, T j Represents the cycle of a single task, C j represents the worst-case execution time of a single task; In the formula, is in the task τ h When released, at hp(τ h ) when there is no delayed task, the number of pending tasks τ h The maximum amount of extra time a person can have to meet their deadline, It is expressed as: Where D h is the relative deadline of task τh, W h (δ) is the time from the critical moment to the completion of the response of the request corresponding to the task τh to be executed under the additional execution time δ; Among them, The initial value is C h +δ, pending tasksτ h C h represents the worst case execution time, W h (δ) is obtained by solving the following iterative formula: In the formula, W represents the end of the iteration h (δ), n represents the number of iterations.

9. The multi-mode security-aware real-time task scheduling method for a multi-processor system according to claim 6, It is characterized in that in, If at least one of the maximum priority inversion budgets is less than 0, the scheduling of the task to be executed is terminated; if the maximum priority inversion budgets are not less than 0, the execution time of the task to be executed is calculated, and the processor executes the execution time on the task to be executed; wherein the execution time is the minimum of the first time of the task to be executed and the maximum priority inversion budgets of all tasks with a priority higher than the task to be executed, which is expressed as follows: set up Represents the task to be executed τ h The maximum feasible execution time at time t, The initial value is By calculating each task τ j ∈hp(τ h ) to check the lower bound of the maximum priority inversion budget of the job to be executed at time t The feasibility of j ∈hp(τ h ), task τ j of If it is not greater than 0, the job will be executed at time t. is not feasible; otherwise, it is feasible and the job is executed Executed at time t, and the maximum feasible execution time for 10. An electronic device, wherein the electronic device include: One or more processors, a memory, and one or more programs; wherein the one or more programs are stored in the memory, and the one or more programs include instructions, which, when executed by the electronic device, enable the electronic device to perform any one of the methods described in claims 1-8.