A Multicore Real-Time Task Scheduling Analysis and Simulation System and Method
Through the multi-verifiable real-time task scheduling analysis and simulation system, DAG and Conditional DAG task models are supported, custom modeling, scheduability analysis and performance evaluation of multi-verifiable real-time tasks are realized, solving the problem of single functions of the existing system and improving the design and optimization efficiency of scheduling strategies.
Patent Information
- Application Number
- CN202111650333.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-30
- Publication Date
- 2025-07-08
- Estimated Expiration
- 2041-12-30
AI Technical Summary
The existing multi-credit real-time task scheduling simulation system has a single function, cannot support task model customization, ignore hardware environment modeling, and lack the comprehensive scheduling algorithm performance evaluation function.
It provides a multi-credit real-time task scheduling analysis and simulation system, including task modeling module, scheduling analysis module, scheduling simulation module and performance analysis module, supports DAG and Conditional DAG task models, supports multiple scheduling algorithms and preemption strategies, visualizes scheduling behavior through Gantt charts, and performs performance analysis.
It realizes custom modeling, scheduling ability analysis and performance evaluation of multi-verification real-time tasks, supports the simulation and visualization of multiple scheduling algorithms, and improves the design and optimization efficiency of scheduling strategies.
Smart Images

Figure CN114327829B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of computer real-time operating systems, and particularly relates to a multi-core real-time task scheduling analysis and simulation system and method. Background Art
[0002] With the continuous improvement of the demand for high performance and low power consumption in embedded real-time systems, multi-core architectures have begun to be applied to embedded real-time systems. A real-time system generally refers to a computing system that must respond within a strict time range after an external request is issued. The correctness of the execution result of this system depends not only on the logical correctness of the calculation, but also on the real-time nature of the result. The schedulability analysis of tasks on a multi-core processor is more difficult than that on a single-core processor. Therefore, a multi-core simulation analysis tool that supports various real-time task modeling can assist engineers in analyzing and optimizing scheduling strategies.
[0003] In order to meet the analysis of multi-core real-time tasks, the academic community has successively proposed various models that can abstractly describe and analyze real-time tasks. The description capabilities of classic serial task models (Liu&Layland, Sporadic, Multiframe) are limited. Although different tasks are allowed to execute concurrently, the subtasks within each task can only be executed serially. The parallel task model can further describe the constraint relationships and parallel behaviors of all subtasks within a task, making it more suitable for exploring the parallel computing capabilities of multi-core systems. For example, DAG (Directed Acyclic Graph) is a very general parallel task model with strong expression capabilities and high analysis efficiency. A DAG task contains multiple nodes, each node representing a piece of serially executed program code, and the directed edge between two nodes represents the precedence and successor constraint relationship between the nodes.
[0004] The research on scheduling algorithms by real-time researchers mainly focuses on theoretical proofs, and secondly, the schedulability of the scheduling algorithm on a given task set is tested through simulation experiments. The generality of the simulation experiment code is poor because the experimental code only targets the performance of specific task models and scheduling algorithms, rather than an experimental platform that can support various task models and various scheduling strategies. In the field of real-time systems, the research rarely discloses the source code of experimental programs, and there is no standard program module for basic scheduling algorithms. Researchers need to repeatedly develop many basic program modules, which seriously reduces the implementation efficiency. According to the author's research, there are not many scheduling analysis tools in the field of real-time systems, and the existing tools lack continuous maintenance. With the update of the hardware architecture and the increasing complexity of application requirements, classic task models are difficult to fully describe complex task attributes.
[0005] The existing technical status mainly focuses on multi-core scheduling algorithms invented for specific system requirements. The Chinese patent "Scheduling Method and Device for Multi-core Processors" (Publication No. CN102831015A) discloses a multi-core processor scheduling method and device to reduce overhead, simplify multi-core deployment, and improve CPU resource utilization during multi-core scheduling. Regarding the Chinese patent "Single-task Multi-core Scheduling Method Based on Critical Path and Task Replication" (Publication No. CN103034614A), existing multi-core real-time scheduling simulation analysis platforms have paid too much attention to the performance verification of scheduling algorithms, proposed a scheduling strategy for multi-core processors, which is only for specific task models, and conducted schedulability analysis on the proposed scheduling strategy.
[0006] In the latest relevant literature, STORM is a multi-core real-time scheduling algorithm simulation tool. STORM can simulate multi-processor architectures, support data exchange between periodic tasks, and the model is described using XML files. However, compared with DAGSim, the task model supported by this simulator is a serial task model and does not support intra-task parallelism. In addition, STORM only supports the GEDF scheduling strategy and does not support partition scheduling and other scheduling algorithms.
[0007] Simso is an intermediate multi-core real-time scheduling simulation tool that can model hardware to study multi-core real-time scheduling algorithms in a way that is as close to reality as possible. Simso can model some behaviors of the cache memory and conduct scheduling simulations based on this. Simso only supports scheduling simulations, does not support performance analysis and schedulability analysis of scheduling algorithms, and cannot compare schedulability analysis results and simulation results.
[0008] APP4MC provides excellent software and hardware modeling, model visualization, and simulation, and provides a common data model compliant with AUTOSAR. The software and hardware descriptions created using APP4MC can exchange data between different tools. Its powerful hardware modeling ability supports detailed descriptions of hardware structures such as electronic control units, microprocessors, systems on a chip, and processor clusters. However, currently, APP4MC only provides runtime simulations and outputs visual information on time and scheduling, and does not provide schedulability analysis and performance analysis.
[0009] The main goals of the functions of existing multi-core processor scheduling simulation systems are to solve specific real-time task scheduling problems, have a single real-time task model, do not support custom task models, and cannot model increasingly complex real-time task models. In addition, the current latest technologies only focus on the scheduling algorithms themselves and ignore the modeling of the hardware environment. The current model tools have single functions and only support some functions in the following modules, such as simulation of scheduling algorithms, performance analysis of scheduling algorithms, and schedulability analysis of a given task set and other functional modules. Summary of the Invention
[0010] Based on the above problems, the present invention provides a multi-core real-time task scheduling analysis and simulation system, including: a task modeling module, a schedulability analysis module, a scheduling simulation module, and a performance analysis module;
[0011] The task modeling module is used for users to configure the parameters of the multi-core processor, select a scheduling algorithm and a preemption strategy, and generate a task set according to the task model;
[0012] The schedulability analysis module is used to determine whether a task is schedulable. If multiple scheduling algorithms report schedulability, the algorithm with the shortest average delay time of the task set is selected as the candidate algorithm;
[0013] The scheduling simulation module is used to simulate the scheduling behavior of tasks on the multi-core processor, and visually analyze the execution situation of tasks on the multi-core processor through a Gantt chart;
[0014] The performance analysis module is used to analyze the acceptance rate of the scheduling algorithm on a randomly generated task set.
[0015] The parameters of the multi-core processor include the number of cores of the multi-processor and the global or partition usage identifier; the scheduling algorithms include global fixed priority, global earliest deadline first, and partition fixed priority; the preemption strategies include complete preemption strategy and restrictive preemption strategy, and the task models include DAG model and Conditional DAG model;
[0016] A simulation method using the multi-core real-time task scheduling analysis and simulation system includes:
[0017] Step 1: The user configures the parameters of the multi-core processor according to the task model to be created, selects a scheduling algorithm and a preemption strategy, and generates a task set according to the task model;
[0018] Step 2: Perform schedulability analysis on each task in the task set to determine the candidate algorithm for the task set;
[0019] Step 3: Simulate the scheduling behavior of tasks on the processor through the candidate algorithm, and visually display the Gantt chart;
[0020] Step 4: Analyze the performance of the candidate scheduling algorithm according to the random task set, and count the situation where the task set is scheduled on the processor core, and generate a curve and a simulation statistical table about the acceptance rate.
[0021] The said Step 2 includes:
[0022] Step 2.1: Calculate the worst-case response time WCRT of each task in the task set;
[0023] Step 2.2: Compare the relationship between the WCRT and the response deadline of each task. If the WCRT of a task is greater than the response deadline, the task is considered non-schedulable; otherwise, the task is considered schedulable.
[0024] Step 2.3: Traverse all built-in scheduling algorithms and use the algorithm with the shortest average latency of the task set as the candidate algorithm.
[0025] The said Step 3 includes:
[0026] Step 3.1: Initialize the simulation time t, check the directed acyclic graph DAG released at time t, and put the DAG into the ready queue.
[0027] Step 3.2: Sort the jobs in the ready queue according to the priorities generated by the candidate algorithm.
[0028] Step 3.3: Take out the job with the highest priority in the ready queue as the head job of the queue, and allocate the job to an idle processor core.
[0029] Step 3.4: Check if there is a job that has completed execution. If so, remove the job from the processor.
[0030] Step 3.5: Check if there is a job that has exceeded the deadline. If so, remove the job from the processor and mark that the job has timed out.
[0031] Step 3.6: Determine whether the simulation time t is less than the preset simulation time. If it is less, return to execute Step 3.1; otherwise, end the execution and report the task scheduling situation of this simulation.
[0032] The said Step 4 includes:
[0033] Step 4.1: Generate a certain number of DAG random tasks for each utilization rate.
[0034] Step 4.2: Configure the parameters of the processor. The parameters include: the number of processor cores, the inter-core migration overhead, whether preemptive is supported, global or local task allocation.
[0035] Step 4.3: Use the generated DAG random tasks to test the candidate algorithm and generate the acceptance rate α of the scheduling algorithm under different utilization rates i ;
[0036] Step 4.4: Generate a line chart of utilization rate - acceptance rate based on the acceptance rate α i and the utilization rate.
[0037] The said Step 3.3 includes:
[0038] Step 3.3.1: If none of the processor cores is idle, then determine the priorities of the jobs being executed in the processor and the job to be processed.
[0039] Step 3.3.2: If the priority of the job to be allocated is higher than that of the jobs in the processor, then task preemption occurs, i.e., the job to be allocated occupies the processor, and the jobs in the processor record the execution time and the preemption moment and then return to the ready queue; otherwise, no preemption occurs, the job to be allocated remains in the waiting state, and the jobs in the processor continue to execute; and the running time is incremented by one time unit.
[0040] The beneficial effects of the present invention are as follows:
[0041] The present invention provides a multi-core real-time task scheduling analysis and simulation system and method, including a task modeling module, a schedulability analysis module, a scheduling simulation module, and a performance analysis module; by extending the classic directed acyclic graph (DAG) model and adding If and Join nodes to the Conditional DAG model, the dynamic load changes caused by the if-then-else branch control structure in the program can be described. The multi-core simulation tool developed by the present invention supports task scheduling simulation and performance analysis of both the classic DAG model and the Conditional DAG model. Description of the Drawings
[0042] Figure 1 It is a block diagram of the multi-core real-time task scheduling analysis and simulation system in the present invention;
[0043] Figure 2 It is an architecture diagram of the multi-core real-time task scheduling analysis and simulation system in the present invention;
[0044] Figure 3 It is a flowchart of the simulation method using the multi-core real-time task scheduling analysis and simulation system in the present invention;
[0045] Figure 4 It is a flowchart of the task scheduling simulation in the present invention;
[0046] Figure 5 It is a flowchart of the performance analysis of the scheduling strategy in the present invention;
[0047] Figure 6 It is the task graph constructed in the present invention; among them, (a) is graphical modeling; (b) is the dependency relationship between subtasks;
[0048] Figure 7 It is the task model constructed in the present invention; among them, (a) is the DAG model; (b) is the CDAG model (Conditional DAG, abbreviated as CDAG);
[0049] Figure 8 This is the schedulability analysis result graph in the present invention. Among them, (a) is the schedulability analysis result graph under the global fixed priority (abbreviation: GFP) policy; (b) is the schedulability analysis result graph under the global earliest deadline first (abbreviation: GEDF) policy.
[0050] Figure 9 This is the simulation result graph in the present invention.
[0051] Figure 10 This is the simulation information statistical graph in the present invention. Detailed implementation manners
[0052] The present invention will be further described below in conjunction with the accompanying drawings and specific implementation examples.
[0053] The present invention is implemented based on C++ programming and adopts a modular design method. Figure 2 The overall architecture of the system is shown. The system supports functions such as user-defined DAG and CDAG task modeling, multi-core platform configuration, scheduling algorithm configuration, schedulability analysis, system simulation, random task generation, and performance analysis, which can greatly facilitate engineers or researchers to design, model, verify, and analyze parallel real-time tasks for multi-core embedded systems. The scheduling algorithms supported by this tool include Global Fixed Priority (GFP), Global Earliest-Deadline-First (GEDF), Partition Fixed Priority (PFP), Partition Earliest-Deadline-First (PEDF), etc., and support full or restricted preemption strategies.
[0054] The system provides a visual user-defined system modeling function, including multi-core processor modeling, task modeling, and scheduling algorithm selection. The schedulability analysis module calculates the worst-case response time (WCRT) of each task in the task set according to the input system model, and then compares it with the deadline of the task to determine whether there is a task timeout (that is, the task set is not schedulable) or all tasks meet the deadline (that is, the task set is schedulable).
[0055] As Figure 1 shown, a multi-core real-time task scheduling analysis and simulation system includes: a task modeling module, a schedulability analysis module, a scheduling simulation module, and a performance analysis module.
[0056] The task modeling module is used for users to configure the parameters of the multi-core processor, select the scheduling algorithm and preemption strategy, and generate a task set according to the task model; this task modeling allows users to establish a custom system model. For the multi-core processor, users can configure the number of cores and the global or partition usage identifier; for the task model, users can intuitively and conveniently edit multiple DAG or Conditional DAG task models in a graphical way to form a task set, and configure parameters such as the name, period, deadline, priority, name of subtasks, WCET, and processor number during partition scheduling for each task. For the scheduling strategy, users can select the scheduling algorithm and preemption strategy.
[0057] The schedulability analysis module is used to determine whether the tasks are schedulable. If multiple scheduling algorithms report schedulability, the algorithm with the shortest average latency of the task set is selected as the candidate algorithm; the currently supported scheduling algorithms include: fully preemptive GFP and GEDF, and restricted preemptive GFP (i.e., G-LP-FP). In G-LP-FP, the high-priority subtask v h cannot preempt the currently executing low-priority subtask v l and must wait for v l to finish execution, which can theoretically reduce the number of preemption times. Based on the schedulability analysis, the system also provides a scheduling algorithm recommendation function. The principle is to traverse all built-in scheduling algorithms and run schedulability analysis based on the task model and processor model given by the user. If multiple scheduling algorithms report schedulability, the one with the lowest average latency is selected as the best recommended algorithm.
[0058] The described scheduling simulation module is used to simulate the scheduling behavior of tasks on a multi-core processor and visually analyze the execution of tasks on the multi-core processor through a Gantt chart. Scheduling simulation essentially involves the scheduling algorithm allocating time slices for the jobs of each parallel (sub) task on the cores of the multi-core processor. To simplify the analysis, it can be considered that each job may be in one of three states (ready, executing, waiting) and can migrate between different states. Without considering external events such as I / O and communication during job execution, the migration from the execution state to the waiting state can be ignored. The scheduling algorithms supported by the shown system include: fully preemptive GFP / GEDF / PFP / PEDF (i.e., Global Fixed Priority / Global Earliest Deadline First / Partition Fixed Priority / Partition Fixed Priority), and restricted preemptive GFP / GEDF (i.e., G-LP-FP and G-LP-EDF). The simulation results are presented in the form of a Gantt chart, from which users can intuitively view the execution of job tasks at different times and also view the execution of jobs on any core. If a job cannot be scheduled, it will be marked. In addition, the performance statistical information during the simulation process will also be presented in tabular form, such as the number of timeouts, latency time, number of preemptions, number of migrations, number of priority inversions, etc.
[0059] The described performance analysis module is used to analyze the acceptance rate of the scheduling algorithm on a randomly generated task set. The task modeling module can quantitatively generate a DAG task set that meets a certain normalized utilization rate layer by layer as the input of the performance analysis module according to parameters such as the configured number of cores, maximum period, maximum number of nodes, maximum number of layers, and branch probability. For example, the change range of the normalized utilization rate is 10% - 100%, and a total of 10 utilization rates are set with an increment step of 10%. Usually, the same number of task sets are generated for each utilization rate. For example, this number is set to N = 200.
[0060] For a given algorithm, the performance analysis module supports two performance analysis methods: S1, acceptance rate test based on schedulability analysis; S2, acceptance rate test based on simulation. Method S1 calls the schedulability analysis algorithm in the performance analysis module to calculate the acceptance rate acc i corresponding to each utilization rate u i = A i / N, where A iis the number of task sets determined to be schedulable. Method S2 checks if there is a timeout task instance in a certain task set during the given simulation time, and if so, deems the task set non - schedulable. The method for calculating the acceptance rate is the same as that of Method S1. The results of performance analysis are presented as an acceptance rate - normalized utilization curve. Due to the pessimism of schedulability analysis, the acceptance rate calculated by Method S1 is lower than that of Method S2. However, the simulation method is equivalent to testing and cannot be used as a necessary condition for evaluating schedulability, but it can measure the pessimism degree of the schedulability analysis algorithm. Finally, multithreading technology is used in random task generation and performance analysis, making full use of the performance of multi - core CPUs and greatly improving the calculation speed.
[0061] The parameters of the multi - core processor include the number of cores of the multi - processor and the global or partition - use identifier; the scheduling algorithms include global fixed - priority, global earliest - deadline - first, and partition fixed - priority; the preemption strategies include complete preemption strategy and restricted preemption strategy, and the task models include DAG model and Conditional DAG model.
[0062] The scheduling simulation module conducts the simulation of task sets according to the input system model and simulation time, generates a Gantt chart, and reports performance statistics. The schedulability analysis module is responsible for generating a large number of task sets that meet a certain resource utilization rate for the performance analysis of scheduling algorithms. The performance analysis module conducts an acceptance rate test on a large number of random task sets and supports two analysis methods: acceptance rate test based on schedulability analysis and acceptance rate test based on simulation. Finally, it draws an acceptance rate curve.
[0063] The system provided by the present invention supports the visualization modeling of various tasks in a multi - core processor system, supports a variety of more fine - grained model descriptions, and the task models include: DAG model and Conditional DAG model. DAG tasks can model parallel real - time tasks in a fine - grained manner; it integrates various real - time system function analyses, synchronously supports the scheduling simulation and schedulability analysis and verification of real - time tasks; it has good scalability, supports hardware environment modeling, modeling of various scheduling algorithms, memory and preemption overheads during scheduling, etc.; it has a comprehensive algorithm performance evaluation function method, supports users to customize task models personalizedly and automatically generate task set models for testing the performance of scheduling algorithms in the set hardware environment, provides diverse information on the scheduling process of real - time systems, and is convenient for developers to improve and optimize scheduling strategies efficiently.
[0064] As Figure 3 shown, a simulation method using the multi - core real - time task scheduling analysis and simulation system described above includes:
[0065] Step 1: The user configures the parameters of the multi-core processor according to the task model to be created, selects the scheduling algorithm and preemption strategy, and generates a task set based on the task model; the construction of the task graph is as Figure 6 shown;
[0066] Step 2: Perform schedulability analysis on each task in the task set to determine the candidate algorithm for this task set; including:
[0067] Step 2.1: Calculate the worst-case response time WCRT of each task in the task set;
[0068] Step 2.2: Compare the relationship between the WCRT of each task and the response deadline. If the WCRT of a task is greater than the response deadline, it is considered that the task is not schedulable, otherwise it is considered that the task is schedulable;
[0069] Step 2.3: Traverse all built-in scheduling algorithms, and take the algorithm with the shortest average delay time of the task set as the candidate algorithm;
[0070] Step 3: Simulate the scheduling behavior of tasks on the processor through the candidate algorithm, as Figure 4 shown, and visualize the Gantt chart; including:
[0071] Step 3.1: Initialize the simulation time t (i.e., t = 0), check the directed acyclic graph DAG released at time t, and put the DAG into the ready queue;
[0072] Step 3.2: Sort the jobs in the ready queue according to the priorities generated by the candidate algorithm;
[0073] Step 3.3: Take out the job with the highest priority in the ready queue as the head job of the queue, and allocate the job to an idle processor core; including:
[0074] Step 3.3.1: If there is no idle processor core, judge the priorities of the jobs executed in the processor and the job to be processed;
[0075] Step 3.3.2: If the priority of the job to be allocated is higher than that of the job in the processor, task preemption occurs, that is, let the job to be allocated occupy the processor, and the job in the processor records the execution time and preemption moment and returns to the ready queue; otherwise, no preemption occurs, the job to be allocated is in a waiting state, and the job in the processor continues to execute; and accumulate the running time by one time unit;
[0076] Step 3.4: Check if there is any job that has completed execution. If so, remove the job from the processor;
[0077] Step 3.5: Check whether there are tasks that exceed the deadline. If so, remove the tasks from the processor and mark that the tasks have timed out.
[0078] Step 3.6: Determine whether the simulation time t is less than the preset simulation time. If it is less, return to execute Step 3.1; otherwise, end the execution and report the task scheduling situation of this simulation.
[0079] Step 4: Analyze the performance of the candidate scheduling algorithm according to the random task set, and count the situation where the task set is scheduled on the processor core, and generate an acceptance rate curve and a simulation statistical table, as Figure 5 shown; including:
[0080] Step 4.1: Generate a certain number of DAG random tasks for each utilization rate.
[0081] Step 4.2: Configure the parameters of the processor, and the parameters include: the number of processor cores, the inter-core migration overhead, whether preemptive is supported, global or local task allocation.
[0082] First, obtain the selected scheduling algorithm and the configuration parameters of the processor, and generate a large number of DAG random tasks. It can be selected whether to verify the performance of the scheduling algorithm on the task set based on the task simulation method or the schedulability analysis method.
[0083] Step 4.3: Use the generated DAG random tasks to test the candidate algorithm and generate the acceptance rate α of the scheduling algorithm under different utilization rates i ;
[0084] Step 4.4: Generate a line chart of utilization rate - acceptance rate according to the acceptance rate α i and the utilization rate; including:
[0085] 1) Determine the normalized resource utilization rate vector, as
[0086] 2) For each resource utilization rate u in i generate a set {J1, J2,..., J N} containing N (for example, N = 1000) random task sets, and the sum of the resource utilization rates of each task set J i is equal to m × u i ; and the parameter generation rule for each random task τ i in J k is: Assume that max(T k ) = 200, then T k is selected in the range of [2, 200], D i = T i , where max(Tk ) It means that for any value of k, T k has a maximum value of 200. T k represents the execution period of the k-th task, m represents the number of processors, and u i represents the utilization rate of the i-th task;
[0087] 3) According to the given scheduling algorithm, for each task set J i in the task set collection of u i perform schedulability analysis, and count the number A of task sets determined to be schedulable. Then the acceptance rate under u i is
[0088] 4) Repeat steps 2) to 3) until obtaining the acceptance rates corresponding to all resource utilization rates in
[0089] In order to verify the effectiveness of the present invention, the task model adopts Figure 7 the task set composed of the four DAG tasks shown in Figure 8 , and the processor model adopts a processor with 4 cores. The scheduling algorithms selected are the GFP algorithm and the GEDF algorithm. Perform schedulability analysis on the two scheduling algorithms respectively, and the results are as Figure 8 shown, where Figure 8 (a) shows that under the global fixed priority policy for the current task set, the response times of the four DAG tasks are 32, 117, 58, and 42 time units respectively, all of which are less than their deadlines, and all DAG tasks are schedulable. Therefore, this task set is schedulable. Figure 8 (b) shows that under the global earliest deadline first policy for the current task set, the response times of the four DAG tasks are 55, 128, 81, and 81 time units respectively. Among them, DAG0 and CDAG2 are not schedulable because their response times exceed the deadlines, resulting in this task set not being schedulable.
[0090] The simulation results of the current task set under the GFP algorithm scheduling are as Figure 9 shown, where the set simulation time is 2000 time units, Figure 9 and the first 200 time units are intercepted. In the Gantt chart, the color of the task instance represents the DAG to which it belongs. By hovering the mouse over any task instance, the detailed scheduling information of the current task can be displayed. For example, Figure 9 when hovering the mouse as shown in
[0091] In addition to the display of the Gantt chart of the simulation results, there is a more intuitive simulation result statistics function. After the simulation ends, the statistical information during the simulation process can be viewed through the statistics function, including the number of instances, the number of instances exceeding the deadline, the average migration overhead, the average preemption overhead, etc., as Figure 10 shown. The statistical information can assist users in quantitatively evaluating the performance of the designed scheduling strategy on the generated task set, facilitating problem analysis and algorithm improvement.
Claims
1. A simulation method using a multi-core real-time task scheduling analysis and simulation system, where the multi-core real-time task scheduling analysis and simulation system includes: Task modeling module, schedulability analysis module, scheduling simulation module, performance analysis module; The task modeling module is used for users to configure the parameters of the multi-core processor, select the scheduling algorithm and preemption strategy, and generate a task set according to the task model; The schedulability analysis module is used to determine whether the task is schedulable. If multiple scheduling algorithms report schedulability, the algorithm with the shortest average latency time of the task set is selected as the candidate algorithm; The scheduling simulation module is used to simulate the scheduling behavior of tasks on the multi-core processor, and visually analyze the execution situation of tasks on the multi-core processor through a Gantt chart; The performance analysis module is used to analyze the acceptance rate of the scheduling algorithm on a randomly generated task set; It is characterized in that the simulation method includes: Step 1: The user configures the parameters of the multi-core processor according to the task model to be created, selects the scheduling algorithm and preemption strategy, and generates a task set according to the task model; Step 2: Perform schedulability analysis on each task in the task set to determine the candidate algorithm for this task set; Step 3: Simulate the scheduling behavior of tasks on the processor through the candidate algorithm, and visually display the Gantt chart, including: Step 3.1: Initialize the simulation time t, check the directed acyclic graph DAG released at time t, and put the DAG into the ready queue; Step 3.2: Sort the jobs in the ready queue according to the priority generated by the candidate algorithm; Step 3.3: Take out the job with the highest priority in the ready queue as the job at the head of the queue, and allocate the job to an idle processor core; Step 3.4: Check whether there is a job that has completed execution. If so, remove the job from the processor; Step 3.5: Check whether there is a job that has exceeded the deadline. If so, remove the job from the processor and mark that the job has timed out; Step 3.6: Determine whether the simulation time t is less than the preset simulation time. If it is less, return to execute Step 3.
1. Otherwise, end the execution and report the task scheduling situation of this simulation; Step 4: Analyze the performance of the candidate scheduling algorithm according to the random task set, and count the scheduling situation of the task set on the processor core, and generate a curve and a simulation statistical table regarding the acceptance rate.
2. The simulation method of a multi-core real-time task scheduling analysis and simulation system according to claim 1, wherein The parameters of the multi-core processor include the number of cores of the multi-processor, the global or partition usage identifier; the scheduling algorithms include global fixed priority, global earliest deadline first, partition fixed priority; the preemption strategies include complete preemption strategy and restrictive preemption strategy, and the task models include DAG model, Conditional DAG model.
3. The simulation method of a multi-core real-time task scheduling analysis and simulation system according to claim 1, characterized in that, The said Step 2 includes: Step 2.1: Calculate the worst-case response time WCRT of each task in the task set; Step 2.2: Compare the relationship between the WCRT of each task and the response deadline. If the WCRT of the task is greater than the response deadline, it is considered that the task is not schedulable. Otherwise, it is considered that the task is schedulable; Step 2.3: Traverse all built-in scheduling algorithms, and take the algorithm with the shortest average latency time of the task set as the candidate algorithm.
4. The simulation method of a multi-core real-time task scheduling analysis and simulation system according to claim 1, wherein The said Step 4 includes: Step 4.1: Generate a certain number of DAG random tasks for each utilization rate for different utilization rates; Step 4.2: Configure the parameters of the processor, where the parameters include: the number of processor cores, the inter-core migration overhead, whether preemptibility is supported, global or local task allocation; Step 4.3: Use the generated DAG random tasks to test the candidate algorithms, and generate the acceptance rate α of the scheduling algorithm under different utilization rates i ; Step 4.4: Generate a line chart of utilization rate - acceptance rate based on the acceptance rate α i and the utilization rate.
5. The simulation method of a multi-core real-time task scheduling analysis and simulation system according to claim 1, characterized in that, The said step 3.3 includes: Step 3.3.1: If none of the processor cores are idle, then judge the priorities of the jobs being executed in the processor and the job to be processed; Step 3.3.2: If the priority of the job to be allocated is higher than that of the jobs in the processor, then task preemption occurs, that is, let the job to be allocated occupy the processor, and the jobs in the processor record the execution time and the preemption moment and return to the ready queue; otherwise, no preemption occurs, the job to be allocated is in a waiting state, and the jobs in the processor continue to execute; and accumulate the running time by one time unit.
Citation Information
Patent Citations
Method and equipment for scheduling multi-core processor
CN102831015A
Single-task and multi-core scheduling method based on critical path and task duplication
CN103034614A
Multiprocessor system schedulability verification method
CN105022661A
Division scheduling-based heuristic processor division method and system for DAG task and storage medium
CN112463346A
Task schedulability verification method for distributed system
CN113806924A