CN110109743B - Real-time process scheduling method - Google Patents
Real-time process scheduling method Download PDFInfo
- Publication number
- CN110109743B CN110109743B CN201910386941.6A CN201910386941A CN110109743B CN 110109743 B CN110109743 B CN 110109743B CN 201910386941 A CN201910386941 A CN 201910386941A CN 110109743 B CN110109743 B CN 110109743B
- Authority
- CN
- China
- Prior art keywords
- time
- real
- scheduling
- task
- schedule
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/48—Program initiating; Program switching, e.g. by interrupt
- G06F9/4806—Task transfer initiation or dispatching
- G06F9/4843—Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
- G06F9/4881—Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2209/00—Indexing scheme relating to G06F9/00
- G06F2209/48—Indexing scheme relating to G06F9/48
- G06F2209/484—Precedence
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
Abstract
The application provides a real-time process scheduling method, which comprises the following steps: a time schedule is pre-configured, wherein the time schedule comprises a switching mode, a scheduling sequence and an attribute of whether the kernel task is allowed to participate in scheduling; carrying out time-sharing scheduling on the real-time process according to the time schedule; and switching the time schedule according to the time schedule switching mode.
Description
Technical Field
The invention belongs to the technical field of computer system software professions, and particularly provides a real-time process scheduling method based on a time table.
Background
Real-time process scheduling in embedded systems typically employs a preemption policy based on priority, supporting a time slice rotation policy of the same priority. Although the real-time process scheduling has predictability under the scheduling strategy, the time certainty of scheduling the real-time process cannot be guaranteed, and for a key system with higher safety requirements, the execution time of the real-time process is strictly controlled, so that the real-time process scheduling strategy with definite time is needed, the control requirement of the execution time of the real-time process in the key system is met, and the predictability of the running time of the system is improved.
Disclosure of Invention
The purpose is as follows: a real-time process scheduling method for time determination is realized.
In a first aspect, the present application provides a real-time process scheduling method, where the method includes:
a time schedule is pre-configured, wherein the time schedule comprises a switching mode, a scheduling sequence and an attribute of whether the kernel task is allowed to participate in scheduling;
carrying out time-sharing scheduling on the real-time process according to the time schedule;
and switching the time schedule according to the time schedule switching mode.
Optionally, a main time frame of the time schedule includes at least two time windows;
the time window comprises a foreground real-time process group and a background real-time process group.
Optionally, the time schedule switching mode includes:
switching after a clock time;
switching after n clocks TICK, wherein n is more than or equal to 2;
switching when the current time window is over;
the next main time frame starts switching.
Optionally, the scheduling sequence specifically includes:
if the foreground real-time process group comprises a real-time process, determining a task of the real-time process in the foreground real-time process group in the time window, and scheduling the task;
if the foreground real-time process group is empty and the background real-time process group contains real-time processes, determining tasks of the real-time processes in the background real-time process group in the time window, and scheduling the tasks;
if the foreground real-time process group is empty and the background real-time process group is empty, determining tasks in the kernel in the time window, and scheduling the tasks.
Optionally, the scheduling configuration of the time schedule specifically includes:
configuring the time length of each time window;
calculating the time length of the main time frame according to the time length of each window;
whether the kernel task is allowed to participate in the attribute of the schedule is configured.
Optionally, the attribute that whether the configuration allows the kernel task to participate in the scheduling specifically includes:
if the attribute allowing the kernel task to participate in the scheduling is configured in the foreground real-time process group, selecting the highest priority task of the real-time process in the foreground real-time process group and the highest priority task in the kernel; scheduling by comparing higher priority tasks;
if the attribute allowing the kernel task to participate in the scheduling is configured in the background real-time process group, if the foreground real-time process group is empty, selecting the highest priority task of the real-time process in the background real-time process group and the highest priority task in the kernel; scheduling is performed by comparing higher priority tasks.
Optionally, if the highest priority task in the kernel is consistent with the priority of the highest priority task in the real-time process, selecting the highest priority task in the kernel for scheduling.
Optionally, the switching the time schedule according to the time schedule switching mode specifically includes:
and switching the time schedule at a preset time point according to the time schedule identification to be switched and the switching time, and executing a new time schedule.
In summary, the invention supports the real-time process to schedule according to the given time schedule, so that the real-time process can execute the determined time schedule according to the allocated time, and the predictability of the system behavior is improved.
Drawings
FIG. 1 is a schematic diagram of a schedule real-time process scheduling framework provided by an embodiment of the present application;
fig. 2 is a flowchart of scheduling execution of a schedule real-time process according to an embodiment of the present application.
Detailed Description
A real-time process scheduling method for time determination is realized. A schematic of the scheduling method framework is shown in fig. 1.
Example 1
The real-time process scheduling method based on the time table provided by the application is as follows:
1) Key data of the time schedule: a time schedule comprises at least two time windows, each time window comprises a foreground real-time process group, a background real-time process group, a real-time process is contained in the real-time process group, the time length of each window, and the attribute of whether the kernel task is allowed to participate in scheduling in the time window.
2) A time schedule switching mode is defined, the following switching modes are respectively:
a) Switching after a clock time;
and after the application software requests the time schedule switching and a clock TICK passes, executing the time schedule switching request of the application software.
b) Switching after n clocks TICK, wherein n is more than or equal to 2;
and after the application software requests the time schedule switching and n clocks TICK pass, executing the time schedule switching request of the application software.
c) Switching when the current time window is over;
and after the application software requests the time schedule to be switched and the time window time corresponding to the time schedule which is being scheduled by the operating system is finished, executing the time schedule switching request of the application software.
d) The next main time frame starts switching.
After the application software requests the time schedule to be switched, and the operating system really executes the time schedule switching request of the application software when the execution of the current main time frame (one cycle of the time schedule) corresponding to the scheduled time schedule is ended and the next main time frame starts.
3) The scheduling sequence of the real-time process under the schedule scheduling framework is defined, and the scheduling principle is determined by the scheduler of the kernel of the operating system because the real-time process does not participate in scheduling, the scheduled entity is the task in the real-time process, and the task is globally scheduled in the system. The scheduling order is as follows:
a) If the foreground real-time process group comprises the real-time process, determining the task of the real-time process in the foreground real-time process group in the time window, and scheduling the task.
b) If the foreground real-time process group is empty and the background real-time process group contains real-time processes, determining tasks of the real-time processes in the background real-time process group in the time window, and scheduling the tasks.
c) If the foreground real-time process group is empty and the background real-time process group is empty, determining tasks in the kernel in the time window, and scheduling the tasks.
4) Scheduling configuration:
a) Configuring the time length of each time window;
b) Calculating the time length of the main time frame according to the time length of each window;
c) Whether the kernel task is allowed to participate in the attribute of the schedule is configured,
if the attribute allowing the kernel task to participate in the scheduling is configured in the foreground real-time process group, selecting the highest priority task of the real-time process in the foreground real-time process group and the highest priority task in the kernel; scheduling by comparing higher priority tasks;
if the attribute allowing the kernel task to participate in the scheduling is configured in the background real-time process group, if the foreground real-time process group is empty, selecting the highest priority task of the real-time process in the background real-time process group and the highest priority task in the kernel; scheduling is performed by comparing higher priority tasks.
And if the priority of the highest priority task in the kernel is consistent with the priority of the highest priority task in the real-time process, selecting the highest priority task in the kernel for scheduling.
5) Time schedule switching
And switching the time schedule at a preset time point according to the time schedule identification to be switched and the switching time, and executing a new time schedule.
6) Run phase scheduling flow (shown in fig. 2):
step 1: if the current time window is finished, the window needs to be switched, and the step 11 is skipped, otherwise, the step 2 is continued.
Step 2: if the foreground real-time process group contains the real-time process, continuing to step 3, otherwise, jumping to step 6.
Step 3: if the attribute allowing the kernel task to participate in the scheduling is configured in the foreground real-time process group, continuing to step 4, otherwise, jumping to step 5.
Step 4: determining a task with the highest priority from real-time processes in a foreground real-time process group, determining a task with the highest priority in kernel tasks, determining the kernel tasks and dispatching the tasks if the task with the highest priority in the kernel tasks with the highest priority is higher than or equal to the task with the highest priority in the real-time processes, otherwise determining the tasks of the real-time processes and dispatching the tasks until the time window is over, and jumping to the step 1.
Step 5: and (3) determining the tasks of the real-time processes in the foreground real-time process group from the real-time processes in the foreground real-time process group, scheduling the tasks until the time window is over, and jumping to the step (1).
Step 6: if the background real-time process group contains real-time processes, continuing to step 7, otherwise, jumping to step 10.
Step 7: if the attribute allowing the kernel task to participate in the scheduling is configured in the background real-time process group, continuing to step 8, otherwise, jumping to step 9.
Step 8: determining a task with the highest priority from real-time processes in a background real-time process group, determining a task with the highest priority in a kernel task, determining the kernel task and dispatching the task if the task with the highest priority in the kernel task with the highest priority is higher than or equal to the task with the highest priority in the real-time process, otherwise determining the task of the real-time process and dispatching the task until the time window is over, and jumping to the step 1.
Step 9: and (3) determining the tasks of the real-time processes in the background real-time process group from the real-time processes in the background real-time process group, scheduling the tasks until the time window is over, and jumping to the step (1).
Step 10: and determining the kernel task with the highest priority to schedule until the time window is ended, and jumping to the step 1.
Step 11: and (3) switching the time schedule at a preset time point according to the time schedule identification to be switched and the switching time, executing a new time schedule, and jumping to the step (2), if the time schedule needs to be switched, otherwise, continuing executing the current time schedule.
In summary, the real-time process is supported to schedule according to the given time schedule, so that the real-time process can execute the determined time schedule according to the allocated time, and the predictability of the system behavior is improved.
Example two
The specific working steps of the real-time process scheduling method based on the time table are as follows:
1) The user creates a time schedule stage, and the formed time schedule configuration data is as follows:
2) After the time schedule is created, the system time schedule data is formed as follows:
3) The schedule scheduling is initiated, here contracted load schedule 1, since the operating system only allows loading one schedule execution. The real-time process starts to schedule according to a strategy preset by a time schedule. Schedule 1, schedule 2 scheduling behavior is described as follows:
for time schedule 1:
a) The window 1 foreground real-time process group and the background real-time process group all comprise real-time processes, and the kernel task is allowed to participate in the scheduling attribute of the foreground real-time process group, and according to the scheduling principle, only the real-time process 1 of the foreground real-time process group and the task scheduling of the real-time process 2 are selected, and the kernel task is allowed to participate in the scheduling. The highest priority tasks of the real-time process 1, the real-time process 2 and the kernel are determined to be executed.
b) The window 2 only contains the real-time process in the foreground real-time process group, and allows the kernel task to participate in the scheduling attribute of the foreground real-time process group, and according to the scheduling principle, only selects the task scheduling of the real-time process 1 of the foreground real-time process group, and allows the kernel task to participate in the scheduling. And selecting the real-time process 1 and the task with the highest priority of the kernel to execute.
c) Only the background real-time process group of the window 3 contains real-time processes, and allows the kernel task to participate in the scheduling attribute of the background real-time process group, and only the task scheduling of the real-time process 2 of the background real-time process group is selected according to the scheduling principle, and allows the kernel task to participate in the scheduling. The real-time process 2 and the highest priority task of the kernel are selected for execution.
For time schedule 2:
a) And the window 1 only comprises a foreground real-time process group, the task scheduling of the real-time process 1 of the foreground real-time process group is only selected according to the scheduling principle, and the task with the highest priority of the real-time process 1 is selected for execution.
b) The window 2 only comprises real-time processes of the background real-time process group, only selects the real-time process 2 of the background real-time process group according to a scheduling principle, and the task scheduling of the real-time process 3 selects the real-time process 2 and the task with the highest priority of the real-time process 3 to execute.
c) The window 3 foreground real-time process group does not contain real-time processes, so the window real-time processes do not participate in scheduling.
4) Switching of the time schedule.
The application requests the time schedule switching, the operating system firstly checks whether the currently running time schedule is the time schedule to be switched, if so, the switching is invalid, otherwise, the time schedule identification of the request switching and the currently valid time schedule switching mode are set and recorded.
Meanwhile, according to the current effective time schedule switching mode, the arrival of switching time is monitored, if the switching time does not arrive, the current time schedule is continuously executed, if the switching time arrives, the time schedule is switched, and the execution of a new time schedule is started.
In summary, the invention belongs to the technical field of computer system software profession, and relates to a real-time process scheduling method based on a time table, which is used for solving the problem of time certainty of real-time process scheduling. The real-time process scheduling method based on the time table comprises 4 key aspects: 1. attributes of the time schedule window are defined: the method comprises the following steps of including a foreground real-time process group, a background real-time process group, whether scheduling of kernel tasks and the like are enabled or not; 2. supporting switching modes of switching a time schedule after one clock TICK is passed, switching n clocks TICK is passed, wherein n is more than or equal to 2, switching is performed when a current time window is finished, starting of a next main time frame and the like; 3. performing a schedule switching action: execution begins according to the new schedule. 4. The real-time process is scheduled according to a time schedule, and in a time window, the scheduler selects the sequence of the real-time process: a foreground real-time process group, a background real-time process group and a kernel; the foreground/background real-time process group can be configured to enable the dispatching of kernel tasks, and the kernel tasks and the tasks of the real-time processes can simultaneously participate in competing CPU.
Claims (3)
1. A method for scheduling a process in real time, the method comprising:
a time schedule is pre-configured, wherein the time schedule comprises a switching mode, a scheduling sequence and an attribute of whether the kernel task is allowed to participate in scheduling; at least two time windows are contained in one main time frame of the time schedule; the time window comprises a foreground real-time process group and a background real-time process group;
the time schedule switching mode includes: switching after a clock time; switching after n clocks TICK, wherein n is more than or equal to 2; switching when the current time window is over; switching when the next main time frame starts;
the scheduling sequence is specifically as follows: if the foreground real-time process group comprises a real-time process, determining a task of the real-time process in the foreground real-time process group in the time window, and scheduling the task; if the foreground real-time process group is empty and the background real-time process group contains real-time processes, determining tasks of the real-time processes in the background real-time process group in the time window, and scheduling the tasks; if the foreground real-time process group is empty and the background real-time process group is empty, determining tasks in the kernel in the time window, and scheduling the tasks;
the scheduling configuration of the time schedule specifically comprises: configuring the time length of each time window; calculating the time length of the main time frame according to the time length of each time window; configuring an attribute of whether the kernel task is allowed to participate in scheduling;
carrying out time-sharing scheduling on the real-time process according to the time schedule;
switching the time schedule according to the time schedule switching mode;
the attribute of whether the configuration allows the kernel task to participate in the scheduling specifically comprises:
if the attribute allowing the kernel task to participate in the scheduling is configured in the foreground real-time process group, selecting the highest priority task of the real-time process in the foreground real-time process group and the highest priority task in the kernel; scheduling by comparing higher priority tasks;
if the attribute allowing the kernel task to participate in the scheduling is configured in the background real-time process group, if the foreground real-time process group is empty, selecting the highest priority task of the real-time process in the background real-time process group and the highest priority task in the kernel; scheduling is performed by comparing higher priority tasks.
2. The method according to claim 1, characterized in that: and if the priority of the highest priority task in the kernel is consistent with the priority of the highest priority task in the real-time process, selecting the highest priority task in the kernel for scheduling.
3. The method according to claim 1, characterized in that: the switching the time schedule according to the time schedule switching mode specifically includes:
and switching the time schedule at a preset time point according to the time schedule identification to be switched and the switching time, and executing a new time schedule.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910386941.6A CN110109743B (en) | 2019-05-09 | 2019-05-09 | Real-time process scheduling method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910386941.6A CN110109743B (en) | 2019-05-09 | 2019-05-09 | Real-time process scheduling method |
Publications (2)
Publication Number | Publication Date |
---|---|
CN110109743A CN110109743A (en) | 2019-08-09 |
CN110109743B true CN110109743B (en) | 2023-07-21 |
Family
ID=67489178
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910386941.6A Active CN110109743B (en) | 2019-05-09 | 2019-05-09 | Real-time process scheduling method |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110109743B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115470097A (en) * | 2021-06-11 | 2022-12-13 | 华为技术有限公司 | An error detection method and related device |
Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP0441798A1 (en) * | 1988-09-13 | 1990-03-22 | Digital Equipment Corporation | Entity management system for a distributed computer system |
CA2200929A1 (en) * | 1996-03-28 | 1997-09-28 | Tadashi Takeuchi | Periodic process scheduling method |
CN103885826A (en) * | 2014-03-11 | 2014-06-25 | 武汉科技大学 | Real-time task scheduling implementation method of multi-core embedded system |
CN103984596A (en) * | 2014-05-19 | 2014-08-13 | 上海微小卫星工程中心 | Dispatching method and device of satellite borne software |
CN104375893A (en) * | 2014-11-29 | 2015-02-25 | 中国航空工业集团公司第六三一研究所 | Partition scheduling method based on two-stage operating system structure |
CN105045666A (en) * | 2015-07-09 | 2015-11-11 | 西北工业大学 | Method for partition scheduling in Windows operating system environment |
CN105629873A (en) * | 2014-11-07 | 2016-06-01 | 中国科学院沈阳计算技术研究所有限公司 | Hybrid task scheduling method suitable for numerical control system |
KR101733534B1 (en) * | 2016-03-04 | 2017-05-24 | 국방과학연구소 | Schedulability analysys method and system for task group of hard real-time |
CN109634589A (en) * | 2018-12-07 | 2019-04-16 | 上海上实龙创智慧能源科技股份有限公司 | A kind of processing method for the automatic Realtime Alerts task of sewage treatment process |
Family Cites Families (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7725897B2 (en) * | 2004-11-24 | 2010-05-25 | Kabushiki Kaisha Toshiba | Systems and methods for performing real-time processing using multiple processors |
CN103064727B (en) * | 2012-12-07 | 2015-07-22 | 中国航空工业集团公司第六三一研究所 | Hard real-time hybrid task dispatching method |
CN105550027A (en) * | 2015-12-09 | 2016-05-04 | 中国航空工业集团公司西安航空计算技术研究所 | Switching method for multiple time scheduling tables based on partition operation system |
CN106293919B (en) * | 2016-08-12 | 2019-06-11 | 中国航空工业集团公司西安飞行自动控制研究所 | A kind of the built-in tasks dispatching device and method of time trigger |
-
2019
- 2019-05-09 CN CN201910386941.6A patent/CN110109743B/en active Active
Patent Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP0441798A1 (en) * | 1988-09-13 | 1990-03-22 | Digital Equipment Corporation | Entity management system for a distributed computer system |
CA2200929A1 (en) * | 1996-03-28 | 1997-09-28 | Tadashi Takeuchi | Periodic process scheduling method |
CN103885826A (en) * | 2014-03-11 | 2014-06-25 | 武汉科技大学 | Real-time task scheduling implementation method of multi-core embedded system |
CN103984596A (en) * | 2014-05-19 | 2014-08-13 | 上海微小卫星工程中心 | Dispatching method and device of satellite borne software |
CN105629873A (en) * | 2014-11-07 | 2016-06-01 | 中国科学院沈阳计算技术研究所有限公司 | Hybrid task scheduling method suitable for numerical control system |
CN104375893A (en) * | 2014-11-29 | 2015-02-25 | 中国航空工业集团公司第六三一研究所 | Partition scheduling method based on two-stage operating system structure |
CN105045666A (en) * | 2015-07-09 | 2015-11-11 | 西北工业大学 | Method for partition scheduling in Windows operating system environment |
KR101733534B1 (en) * | 2016-03-04 | 2017-05-24 | 국방과학연구소 | Schedulability analysys method and system for task group of hard real-time |
CN109634589A (en) * | 2018-12-07 | 2019-04-16 | 上海上实龙创智慧能源科技股份有限公司 | A kind of processing method for the automatic Realtime Alerts task of sewage treatment process |
Non-Patent Citations (1)
Title |
---|
基于VxWorks653分区操作系统的IMA设计与实现;张明 等;火力与指挥控制;第145-148页 * |
Also Published As
Publication number | Publication date |
---|---|
CN110109743A (en) | 2019-08-09 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108984267B (en) | Micro-kernel architecture control system of industrial server and industrial server | |
US9990229B2 (en) | Scheduling method and apparatus for applying laxity correction based on task completion proportion and preset time | |
CN101894047B (en) | Kernel virtual machine scheduling policy-based implementation method | |
US8161491B2 (en) | Soft real-time load balancer | |
US9582325B2 (en) | Method for scheduling with deadline constraints, in particular in Linux, carried out in user space | |
US9104491B2 (en) | Batch scheduler management of speculative and non-speculative tasks based on conditions of tasks and compute resources | |
US9189293B2 (en) | Computer, virtualization mechanism, and scheduling method | |
JP2009294712A (en) | Priority controller and priority control method | |
CN113032152B (en) | Scheduling method, scheduling apparatus, electronic device, storage medium, and program product for deep learning framework | |
JPWO2005106623A1 (en) | CPU clock control device, CPU clock control method, CPU clock control program, recording medium, and transmission medium | |
US20160249354A1 (en) | Scheduling function calls | |
CN111158875B (en) | Multi-module-based multi-task processing method, device and system | |
CN110109743B (en) | Real-time process scheduling method | |
CN111597044A (en) | Task scheduling method and device, storage medium and electronic equipment | |
US9170839B2 (en) | Method for job scheduling with prediction of upcoming job combinations | |
KR20130051076A (en) | Method and apparatus for scheduling application program | |
KR20130048504A (en) | Apparatus and method for scheduling partition based criticality | |
US20140282533A1 (en) | Virtual computer system | |
CN114035926A (en) | Application thread scheduling method and device, storage medium and electronic equipment | |
JP2002099435A (en) | Control method of multi-task and information processor | |
CN115328629A (en) | Method for performing real-time embedded management by expanding UEFI (unified extensible firmware interface) firmware on bare metal | |
CN109445847B (en) | Industrial server microkernel architecture implementation method | |
US12242888B2 (en) | GPU and GPU method | |
CN116893893B (en) | Virtual machine scheduling method and device, electronic equipment and storage medium | |
Li et al. | H-pfsp: Efficient hybrid parallel pfsp protected scheduling for mapreduce system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |