CN102043667A - Task scheduling method for embedded operating system - Google Patents

Task scheduling method for embedded operating system Download PDF

Info

Publication number
CN102043667A
CN102043667A CN2010105652592A CN201010565259A CN102043667A CN 102043667 A CN102043667 A CN 102043667A CN 2010105652592 A CN2010105652592 A CN 2010105652592A CN 201010565259 A CN201010565259 A CN 201010565259A CN 102043667 A CN102043667 A CN 102043667A
Authority
CN
China
Prior art keywords
task
scheduling
ready
time
semaphore
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.)
Pending
Application number
CN2010105652592A
Other languages
Chinese (zh)
Inventor
杨进
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Clou Electronics Co Ltd
Original Assignee
Shenzhen Clou Electronics Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Shenzhen Clou Electronics Co Ltd filed Critical Shenzhen Clou Electronics Co Ltd
Priority to CN2010105652592A priority Critical patent/CN102043667A/en
Publication of CN102043667A publication Critical patent/CN102043667A/en
Pending legal-status Critical Current

Links

Abstract

The invention discloses a task scheduling method for an embedded operating system. The method comprises the following steps of: (1) allocating a time slice, namely recording the time of a task in a ready state by using the time slice; (2) scheduling tasks which can be seized in real time, namely when a system scheduling timer is interrupted, traversing a ready task queue to find out whether a ready state task which has priority higher than that of the current task exists or not, if so, switching to task changing operation, setting the current task in a ready state and hanging up; (3) scheduling tasks of a class time slice wheel, namely scanning the ready task queue, adding 1 to a ready state counting of the current ready task, finding a task which has the longest ready time for executing and clearing the ready counting when a task is ready and a task which needs seizing and operating in real time does not exist currently after the scheduling timer is interrupted every time; and (4) triggering scheduling when semaphore is overtime, namely immediately triggering a task which waits for the semaphore to operate when the time is up or the semaphore is overtime. All tasks can be scheduled on the premise of ensuring real-time properties.

Description

A kind of method for scheduling task of embedded OS
Technical field
The present invention relates to embedded system task scheduling field, particularly relate to a kind of method based on class timeslice wheel scheduling in the real-time preemptible embedded OS.
Background technology
The function of embedded device becomes from strength to strength now, and function is also more and more abundanter.Along with the function of embedded device becomes increasingly complex, in order to simplify the design of complicated day by day function, it is more and more indispensable that embedded OS just becomes.
In existing embedded OS field, the scheduling mode of now main operating system generally is to adopt the dispatching algorithm of taking turns based on timeslice based on the preemptible dispatching algorithm or the employing of priority.
The scheduling method deprived based on priority is meant that CPU always allows and is in task run ready attitude, that priority is the highest; The task of limit priority is in a single day ready, can obtain the right to use of CPU, when a running task made a task higher than its priority enter ready attitude, the CPU right to use of current task had just been deprived, and the task of higher priority has obtained the right to use of CPU at once.Unless the task of limit priority is initiatively abandoned the right to use of CPU, otherwise the task of low priority is to have no chance that to obtain CPU usufructuary.
Dispatching algorithm based on round-robin is meant that system by the principle of serving algorithm first earlier, lines up a formation with all ready processes, and when dispatching, system distributes to the first process of formation to processor, and allows it carry out a timeslice at every turn.When the timeslice of carrying out uses up, send the clock interrupt request by a timer, scheduler program stops the operation of this process according to this request, and it is delivered to the end of ready queue, again processor is given head of the queue process new in the ready queue, allow it also carry out a timeslice simultaneously.Can guarantee that like this each task all has enough chances to obtain CPU, just can not guarantee that for the such dispatching algorithm of the task of needing real-time response CPU can in time respond.
And the task in present a lot of complex embedded system had both needed can seize in real time, guaranteed that again all tasks all have enough chances of calling simultaneously.
Summary of the invention
Technical matters to be solved by this invention provides a kind of method for scheduling task of embedded OS, can guarantee that again each task all has enough chances that is scheduled under the prerequisite of assurance real-time.
For solving the problems of the technologies described above, technical scheme of the present invention is: a kind of method for scheduling task of embedded OS may further comprise the steps:
(1) distribution of timeslice utilizes the timeslice logger task to be in the time of ready state;
(2) real-time preemptible task scheduling, have no progeny in the system call timer, the ready state task that whether has than current task change priority is found out in the formation of traversal ready task, switch to the operation of being engaged in of changing to if having then move, hanging up after the ready attitude of current task set;
(3) task scheduling of class timeslice wheel, the scheduling timer is had no progeny in each when task is ready, current when not having to seize the task of operation in real time, the formation of scanning ready task, current ready task ready state counting is added 1, find out the longest task of ready time simultaneously and carry out, remove its ready counting simultaneously;
(4) the overtime triggering scheduling of semaphore when semaphore arrives or be overtime, triggers the task run of waiting for this semaphore immediately.
As improvement, the progress information of the process control block (PCB) of system comprises: task type is used to identify real-time task and un-real time job; Field data is used for preserving the various field datas of scheduling process; Control information is used for the scheduling and the management of process.
As improvement, described field data comprises content, the content of control register, user stack pointer, the system stack pointer of general-purpose register.
As improvement, described control information comprises the relevant information of process scheduling, as state, waiting event or wait reason, priority etc.; The relevant information of interprocess communication is as message queue pointer, semaphore; The use information of resource.
The beneficial effect that the present invention is compared with prior art brought is:
The invention provides a kind of dispatching method of realizing class timeslice wheel on the operating system of preemption scheduling, this method comprises that distribution, ready state judgement, task scheduling, the recovery of timeslice, the semaphore of timeslice trigger the step of dispatching.The present invention can guarantee that again each task all has enough chances that is scheduled under the prerequisite that guarantees real-time.
Description of drawings
Fig. 1 is a process flow diagram of the present invention.
Embodiment
The invention will be further described below in conjunction with Figure of description.
As shown in Figure 1, a kind of method for scheduling task of embedded OS may further comprise the steps:
(1) a kind of dispatching method of similar timeslice wheel is taked in the distribution of timeslice, and the method for timeslice of similar timeslice wheel scheduling of being used for here is the time (ready state counting) that logger task is in ready state;
(2) real-time preemptible task scheduling, have no progeny in the system call timer, the ready state task that whether has than current task change priority is found out in traversal ready task formation earlier, switch to the operation of being engaged in of changing to if having then move, hanging up after the ready attitude of current task set.Otherwise execution idle task;
The real-time task of creating in the native system is based on priority, and the task of high priority in a single day ready always can seize low priority or based on the task of timeslice wheel.The task of needing real time execution is as long as its priority is set to enough height and can guarantees can occupy cpu resource when it need move, thereby guarantees its real-time;
(3) task scheduling of class timeslice wheel, the scheduling timer is had no progeny in each when task is ready, current when not having to seize the task of operation in real time, the formation of scanning ready task, current ready task ready state counting is added 1, find out the longest task of ready time simultaneously and carry out, remove its ready counting simultaneously, thereby the scheduling that realizes similar timeslice unrest also can both there be enough chances to obtain the cpu resource execution to guarantee non real-time task.
(4) the overtime triggering scheduling of semaphore (message mail) when semaphore (message mail) arrives or be overtime, triggers the task run of waiting for this semaphore (message mail) immediately, thus the real-time that message is transmitted in the assurance system.
The progress information of the process control block (PCB) of system comprises: task type is used to identify real-time task and un-real time job; Field data is used for preserving the various field datas of scheduling process, and described field data comprises content, the content of control register, user stack pointer, the system stack pointer of general-purpose register; Control information is used for the scheduling and the management of process, and described control information comprises the relevant information of process scheduling, as state, waiting event or wait reason, priority etc.; The relevant information of interprocess communication is as message queue pointer, semaphore; The use information of resource.
The invention provides a kind of dispatching method of realizing class timeslice wheel on the operating system of preemption scheduling, this method comprises that distribution, ready state judgement, task scheduling, the recovery of timeslice, the semaphore of timeslice trigger the step of dispatching.The present invention can guarantee that again each task all has enough chances that is scheduled under the prerequisite that guarantees real-time.

Claims (4)

1. the method for scheduling task of an embedded OS is characterized in that, may further comprise the steps:
(1) distribution of timeslice utilizes the timeslice logger task to be in the time of ready state;
(2) real-time preemptible task scheduling, have no progeny in the system call timer, the ready state task that whether has than current task change priority is found out in the formation of traversal ready task, switch to the operation of being engaged in of changing to if having then move, hanging up after the ready attitude of current task set;
(3) task scheduling of class timeslice wheel, the scheduling timer is had no progeny in each when task is ready, current when not having to seize the task of operation in real time, the formation of scanning ready task, current ready task ready state counting is added 1, find out the longest task of ready time simultaneously and carry out, remove its ready counting simultaneously;
(4) the overtime triggering scheduling of semaphore when semaphore arrives or be overtime, triggers the task run of waiting for this semaphore immediately.
2. the method for scheduling task of a kind of embedded OS according to claim 1, it is characterized in that: the progress information of the process control block (PCB) of system comprises:
Task type is used to identify real-time task and un-real time job;
Field data is used for preserving the various field datas of scheduling process;
Control information is used for the scheduling and the management of process.
3. the method for scheduling task of a kind of embedded OS according to claim 2, it is characterized in that: described field data comprises content, the content of control register, user stack pointer, the system stack pointer of general-purpose register.
4. the method for scheduling task of a kind of embedded OS according to claim 2, it is characterized in that: described control information comprises the relevant information of process scheduling, the relevant information of interprocess communication, the use information of resource.
CN2010105652592A 2010-11-25 2010-11-25 Task scheduling method for embedded operating system Pending CN102043667A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2010105652592A CN102043667A (en) 2010-11-25 2010-11-25 Task scheduling method for embedded operating system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2010105652592A CN102043667A (en) 2010-11-25 2010-11-25 Task scheduling method for embedded operating system

Publications (1)

Publication Number Publication Date
CN102043667A true CN102043667A (en) 2011-05-04

Family

ID=43909822

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2010105652592A Pending CN102043667A (en) 2010-11-25 2010-11-25 Task scheduling method for embedded operating system

Country Status (1)

Country Link
CN (1) CN102043667A (en)

Cited By (18)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102647344A (en) * 2012-03-30 2012-08-22 迈普通信技术股份有限公司 Message sending method in embedded and distributed system
CN102662744A (en) * 2012-04-19 2012-09-12 上海大学 FPGA task scheduling method based on condition preemption
CN102760187A (en) * 2012-06-19 2012-10-31 上海大学 Time factor and space factor synthesized FPGA (Field Programmable Gate Array) task placement method
CN102929714A (en) * 2012-10-19 2013-02-13 国电南京自动化股份有限公司 uC/OS-II-based hardware task manager
CN103257864A (en) * 2013-05-09 2013-08-21 南京航空航天大学 Task scheduling method of embedded software
CN103309734A (en) * 2013-06-24 2013-09-18 哈尔滨工业大学 Embedded task scheduling method based on priority grouping
CN103455310A (en) * 2012-05-29 2013-12-18 中兴通讯股份有限公司 Timing method and device for semaphore pend interface
CN103995742A (en) * 2014-05-20 2014-08-20 万向钱潮股份有限公司 Embedded type real-time scheduling control device and method based on MCU
CN104536345A (en) * 2014-12-17 2015-04-22 万向钱潮股份有限公司 Multitask control method based on vehicle electrical control system
CN104572281A (en) * 2014-12-29 2015-04-29 联合汽车电子有限公司 Clock interrupt periodical task occupation achieving method and embedded system
CN104915256A (en) * 2015-06-05 2015-09-16 惠州Tcl移动通信有限公司 Method and system for realizing real-time scheduling of task
CN105117321A (en) * 2015-06-30 2015-12-02 浪潮(北京)电子信息产业有限公司 Process management method and process management terminal
CN105204938A (en) * 2015-11-02 2015-12-30 重庆大学 Data-intensive process scheduling method of memory access
CN106155806A (en) * 2015-04-14 2016-11-23 腾讯科技(深圳)有限公司 A kind of multi-task scheduling method and server
CN106354557A (en) * 2016-08-29 2017-01-25 佛山市美的清湖净水设备有限公司 Household appliances based on time slice task scheduling system, control method and controller
CN107273141A (en) * 2017-07-10 2017-10-20 无锡走向智能科技有限公司 Embedded real-time operating system
CN108859759A (en) * 2018-06-25 2018-11-23 武汉科技大学 Electric vehicle instrument system and its dispatching method
WO2021139560A1 (en) * 2020-01-07 2021-07-15 苏州大学 Task scheduling processing system and method for embedded real-time operating system

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2000172514A (en) * 1998-12-07 2000-06-23 Nec Ic Microcomput Syst Ltd Task management device and task scheduling method
CN1409209A (en) * 2001-09-24 2003-04-09 深圳市中兴通讯股份有限公司上海第二研究所 Realizing method for multiple task real-time operation system

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2000172514A (en) * 1998-12-07 2000-06-23 Nec Ic Microcomput Syst Ltd Task management device and task scheduling method
CN1409209A (en) * 2001-09-24 2003-04-09 深圳市中兴通讯股份有限公司上海第二研究所 Realizing method for multiple task real-time operation system

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
连为民: "《计算机操作系统》", 31 August 2007, 西北大学出版社 *

Cited By (27)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102647344A (en) * 2012-03-30 2012-08-22 迈普通信技术股份有限公司 Message sending method in embedded and distributed system
CN102647344B (en) * 2012-03-30 2014-12-10 迈普通信技术股份有限公司 Message sending method in embedded and distributed system
CN102662744B (en) * 2012-04-19 2014-06-11 上海大学 FPGA task scheduling method based on condition preemption
CN102662744A (en) * 2012-04-19 2012-09-12 上海大学 FPGA task scheduling method based on condition preemption
CN103455310B (en) * 2012-05-29 2017-02-08 中兴通讯股份有限公司 Timing method and device for semaphore pend interface
CN103455310A (en) * 2012-05-29 2013-12-18 中兴通讯股份有限公司 Timing method and device for semaphore pend interface
CN102760187A (en) * 2012-06-19 2012-10-31 上海大学 Time factor and space factor synthesized FPGA (Field Programmable Gate Array) task placement method
CN102760187B (en) * 2012-06-19 2015-05-27 上海大学 Time factor and space factor synthesized FPGA (Field Programmable Gate Array) task placement method
CN102929714A (en) * 2012-10-19 2013-02-13 国电南京自动化股份有限公司 uC/OS-II-based hardware task manager
CN102929714B (en) * 2012-10-19 2015-05-13 国电南京自动化股份有限公司 uC/OS-II-based hardware task manager
CN103257864A (en) * 2013-05-09 2013-08-21 南京航空航天大学 Task scheduling method of embedded software
CN103309734A (en) * 2013-06-24 2013-09-18 哈尔滨工业大学 Embedded task scheduling method based on priority grouping
CN103995742A (en) * 2014-05-20 2014-08-20 万向钱潮股份有限公司 Embedded type real-time scheduling control device and method based on MCU
CN103995742B (en) * 2014-05-20 2017-02-22 万向钱潮股份有限公司 Embedded type real-time scheduling control device and method based on MCU
CN104536345A (en) * 2014-12-17 2015-04-22 万向钱潮股份有限公司 Multitask control method based on vehicle electrical control system
CN104572281A (en) * 2014-12-29 2015-04-29 联合汽车电子有限公司 Clock interrupt periodical task occupation achieving method and embedded system
CN106155806B (en) * 2015-04-14 2020-08-11 腾讯科技(深圳)有限公司 Multitask scheduling method and server
CN106155806A (en) * 2015-04-14 2016-11-23 腾讯科技(深圳)有限公司 A kind of multi-task scheduling method and server
CN104915256A (en) * 2015-06-05 2015-09-16 惠州Tcl移动通信有限公司 Method and system for realizing real-time scheduling of task
CN105117321A (en) * 2015-06-30 2015-12-02 浪潮(北京)电子信息产业有限公司 Process management method and process management terminal
CN105204938A (en) * 2015-11-02 2015-12-30 重庆大学 Data-intensive process scheduling method of memory access
CN105204938B (en) * 2015-11-02 2019-01-11 重庆大学 A kind of data-intensive process scheduling method of internal storage access
CN106354557A (en) * 2016-08-29 2017-01-25 佛山市美的清湖净水设备有限公司 Household appliances based on time slice task scheduling system, control method and controller
CN107273141A (en) * 2017-07-10 2017-10-20 无锡走向智能科技有限公司 Embedded real-time operating system
CN108859759A (en) * 2018-06-25 2018-11-23 武汉科技大学 Electric vehicle instrument system and its dispatching method
CN108859759B (en) * 2018-06-25 2021-02-09 武汉科技大学 Electric automobile instrument system and dispatching method thereof
WO2021139560A1 (en) * 2020-01-07 2021-07-15 苏州大学 Task scheduling processing system and method for embedded real-time operating system

Similar Documents

Publication Publication Date Title
CN102043667A (en) Task scheduling method for embedded operating system
EP2701074B1 (en) Method, device, and system for performing scheduling in multi-processor core system
US7493436B2 (en) Interrupt handling using simultaneous multi-threading
US8612986B2 (en) Computer program product for scheduling ready threads in a multiprocessor computer based on an interrupt mask flag value associated with a thread and a current processor priority register value
CN101751289B (en) Mixed scheduling method of embedded real-time operating system
US20050246461A1 (en) Scheduling threads in a multi-processor computer
CN101339521B (en) Tasks priority dynamic dispatching algorithm
CN104536827B (en) A kind of data dispatching method and device
CN105117284B (en) Method for scheduling work threads based on priority proportion queue
CN102523153B (en) Load balancing method under virtual environment
CN102855156B (en) Interrupt controller and interrupt controlling method
CN105320571A (en) Process scheduling method
CN105373425A (en) Method and device for performance optimization of embedded Linux system
CN104199730A (en) Single-thread multi-task processing method based on synchronous I/O multiplexing mechanism
CN102323895A (en) Real-time scheduling method of embedded operating system based on STB (Set Top Box)
CN103346902A (en) Method and system for data collection and scheduling
WO2015052501A1 (en) Scheduling function calls
CN107800546B (en) Management method and device for broadcast messages
KR20000060827A (en) method for implementation of transferring event in real-time operating system kernel
CN100383743C (en) Real-time task scheduling method in Java operating system
CN101349975B (en) Method for implementing interrupt bottom semi-section mechanism in embedded operation system
CN109684060A (en) A kind of mixed scheduling method of polymorphic type time-critical task
CN107203428B (en) Xen-based VCPU multi-core real-time scheduling algorithm
CN103389913B (en) A kind of Real-time Interrupt Processing method for linux system
CN106897147A (en) A kind of application container engine container resource regulating method and device

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C12 Rejection of a patent application after its publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20110504