CN101178667A - Method of invalid time over message under system process scheduling - Google Patents

Method of invalid time over message under system process scheduling Download PDF

Info

Publication number
CN101178667A
CN101178667A CNA200710124849XA CN200710124849A CN101178667A CN 101178667 A CN101178667 A CN 101178667A CN A200710124849X A CNA200710124849X A CN A200710124849XA CN 200710124849 A CN200710124849 A CN 200710124849A CN 101178667 A CN101178667 A CN 101178667A
Authority
CN
China
Prior art keywords
message
timer
overtime
task
steps
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.)
Granted
Application number
CNA200710124849XA
Other languages
Chinese (zh)
Other versions
CN100535864C (en
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.)
ZTE Corp
Original Assignee
ZTE Corp
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 ZTE Corp filed Critical ZTE Corp
Priority to CNB200710124849XA priority Critical patent/CN100535864C/en
Publication of CN101178667A publication Critical patent/CN101178667A/en
Application granted granted Critical
Publication of CN100535864C publication Critical patent/CN100535864C/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Debugging And Monitoring (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The invention discloses a method of inefficiency overtime information under the system course attemper and the sending method of information, which is used for a timer module of an embed-type operation system. Firstly, the timer control structure is added with a pointer variable, then when the system timer module sends timer overtime information to the course, the pointer variable points to the timer overtime information. The timer module of the invention can provide the function of killing the timer overtime information, which plays important role to the stability of the system and the correctness of the course. The method of killing the timer overtime information under an embed-type operation system course attemper provided by the invention can kill the timer overtime information which is sent out, but dose not receive the task treatment, thereby preventing the abnormal flow.

Description

A kind of system process scheduling is the method and the message method of invalid time exceeded message down
Technical field
The present invention relates to adopt the development field of the embedded real time system of priority scheduling, in the secondary process scheduling environment that is specifically related on embedded multitask environment, realize, the method for invalid time exceeded message and time exceeded message sending method.
Background technology
Real-time system is meant response external random occurrence in time, and finishes respective handling with enough fast speed, otherwise the system that can lead to grave consequences, it is widely used in fields such as communication facilities, military affairs, Aero-Space.
A lot of companies have realized several partial functions such as secondary process scheduling management, time management, telecommunication management, memory management on the embedded real-time multitask system.
Second-level dispatching, promptly on the task basis that embedded real-time operating system provides, carry a plurality of processes, each process has independently storehouse, task is equivalent to an operating system nucleus, and be one based on preemptive type message-driven, non-, simple kernels undefined priority, no round-robin, the scheduling of process is called second-level dispatching.Timer module provides timing function for the task in the operating system and process, and for real time operating system, timer module just seems particularly important as the core of operating system time management.
Because the unpredictability of embedded multitask environment, in actual motion, usually there is situation about being seized in task executions because of the difference of high low priority, thereby is blocked by other high-priority task.Being seized of task just might in time be removed the timer that self is provided with, and cause the timer expiry that some should be not overtime, even can in message queue, pile up a large amount of time exceeded messages and pending message, it comprises that timer arrives message, and the message that the front quilt overstocks is in treatment scheme, has the operation of timer extremely, this operation normally can only operate in the timer in the timer management formation, and can not remove the overtime message that has entered the task message formation, so cause system to enter a lot of unusual flow processs.For example, process A and process B belong to two tasks respectively, process A is to process B send a request message (REQ), start a timer simultaneously, if before this timer expiry, receive the response message (ACK) of process B, then remove timer, carry out respective handling, if this timer expiry then carry out reset operation.Imagine following situation, process B has sent ACK message to process A, but process A place task is blocked by other high-priority task, can't obtain cpu resource and handle ACK message, can't remove timer, so process A can receive the overtime message that timer module is sent again, thereby overstock a lot of pending message.When process A place task acquisition cpu resource began to carry out, process A first aftertreatment ACK message of meeting and time exceeded message just may cause abnormality processing.
Therefore, there is certain problem in the prior art, needs further to improve.
Summary of the invention
The method and the message method that the purpose of this invention is to provide invalid time exceeded message under a kind of embedded type operating system process scheduling, it has solved some unnecessary overtime message that produce because of multitask environment, avoids exception throw to handle.Method of the present invention realizes simple, and highly versatile is applicable to most of timer module.
In order to achieve the above object, the present invention adopts following technical scheme.
The sending method of overtime message in the embedded OS of the present invention, it is applied on the timer module of embedded OS, and described method is carried out according to following steps: a, add a pointer variable in advance in the timer control structure; B, when system timer module during to process transmission timer time exceeded message, described pointer variable is pointed to overtime message.Among the described step b, described pointer variable is pointed to the first address of overtime message in the formation of task message sink.
Based on above-mentioned thought, the present invention also provides a kind of system process scheduling method of invalid time exceeded message down, and it is applied on the timer module of embedded OS, and described method is carried out according to following steps:
The task at A, system process place is obtained cpu resource, and processing messages receives the message in the formation;
B, system timer module judge whether the timer of current process correspondence is overtime; If this timer is overtime, execution in step D then, otherwise execution in step C;
The timer of C, removing current process correspondence;
D, described timer module are utilized a pointer variable of pointing to overtime message, search this overtime message in the formation of task message sink, and the sign of this overtime message is changed to invalid.
Wherein, further comprising the steps of after the described step D: E, in the task at current process place during to subordinate's process dispatch messages, the message flag of deletion message body is invalid message, the effective message of next bar is obtained in circulation.
Wherein, further comprising the steps of before the described steps A: A01, system process send a request message to another process, and start a timer timing; A02, described another process are to system's current process feeding back response information, and the message sink formation that response message is placed current process place task.
Wherein, described steps A may further comprise the steps: A1, judge whether current process place task obtains cpu resource; If, execution in step A2 then; A2, current process are handled described response message, and execution in step B.
Wherein, described steps A 01 is further comprising the steps of: A011, timer module timing scan timer queue; A012, when timer module detects the timer expiry of setting, then, simultaneously a pointer variable is pointed to this overtime message to the process transmission timer time exceeded message that timer is set.In the described steps A 012, described pointer variable is pointed to the first address of overtime message in the formation of task message sink.
The invention effect: timer module of the present invention can provide the function of chase overtime message, be about to be in the function that overtime message in the message sink formation is set to disarmed state, it has played crucial effects to the stability of system and the correctness of flow process.The method of chase overtime message under the embedded type operating system process scheduling provided by the invention, can chase have sent but also be not accepted the overtime message that task is handled, prevent the appearance of unusual flow process.
Description of drawings
Fig. 1 is that process A receives that the task message of response message receives the formation synoptic diagram;
Fig. 2 is that process A receives that the task message of overtime message receives the formation synoptic diagram;
Fig. 3 is that process A handles response message, puts time exceeded message is that task message invalid, the deletion timer receives the formation synoptic diagram;
Fig. 4 is the process flow diagram of the inventive method.
Embodiment
Be described in further detail below in conjunction with the enforcement of accompanying drawing technical scheme.
At first, the present invention adds the pointer variable of the message body of recording timing device time exceeded message in the organization definition of timer control structure, and carry out the transmission of time exceeded message according to following process: to detect the timing that process is provided with during at the timing scan timer queue overtime when the system timer module, then timer module is to the process transmission timer time exceeded message that timer is set, simultaneously with this overtime message of pointed in this timer control structure.When system initialization, this pointer variable in whole timer control structures is changed to sky.Here, described pointer variable is preferably pointed to the first address of overtime message in the formation of task message sink, is convenient to like this search.
Then, the present invention utilizes the time exceeded message of the pointer variable of above-mentioned interpolation according to following process null system process: the task at the first step, system process place need be obtained resource from CPU, and processing messages receives the message in the formation; Second step, system timer module judge whether the timer of current process correspondence is overtime earlier; If this timer is overtime, then timer module is utilized the pointer variable of above-mentioned sensing overtime message, searches this overtime message in the formation of task message sink, and the sign of this overtime message is changed to invalid.If it is overtime that above-mentioned timer does not have, then can directly remove the timer of process correspondence, carry out subsequent treatment.After finishing above-mentioned steps, in the scheduler task at system current process place when the cancellation breath is distributed to subordinate's process in self message queue, the message flag of deletion message body is invalid message, circulation is obtained the effective message distribution of next bar and is handled to process, thereby thoroughly eliminated issued but the overtime message handled of also not having enough time, avoid system to enter the abnormity processing flow process, reduce the wasting of resources of system.
Illustrate the specific implementation process of said method below in conjunction with Fig. 4, wherein, process A and process B belong to two tasks respectively.
Step 200, process A sends a request message (REQ) to process B, and process A starts a timer 1 simultaneously.After this process, need timer module timing scan timer queue, when timer module detects the timer expiry of setting, then to the process transmission timer time exceeded message that timer is set, simultaneously a pointer variable is pointed to the message body first address of this overtime message, as shown in Figure 2.
Step 205, process B sends response message (ACK) to process A after receiving the request message of process A, and response message is put into the message queue of process A place task, as shown in Figure 1.
Step 210 judges whether task A obtains cpu resource; If then execution in step 215; Then continue if not to wait for, return step 210, up to obtaining cpu resource.
Step 215, task A should be distributed to response message process A, and the process of activation A operation, the response message of process A treatment progress B.
Step 220 judges whether timer 1 is overtime, if overtime then execution in step 225; Overtime as if not having, then execution in step 230.
Step 225, this moment, timer was overtime, represent that promptly overtime message has sent to process A place task message and received in the formation, but also do not become the current processing messages of process A, then search out this overtime message with regard to the pointer variable that needs the timer module utilization to point to overtime message message body this moment, and this time exceeded message is changed to disarmed state, as shown in Figure 3, execution in step 235 subsequently.
Step 230 is removed timer 1.
Step 235 when process A place task is cancelled breath from message queue, detects one and is labeled as invalid message, then abandons this invalid message, and circulation is got next effectively message distribution and handled for process A.So just realized the function of chase overtime message of the present invention.
In said process, if before timer 1 is overtime, process A has received the response message (ACK) of process B loopback, then directly removes timer 1, carries out subsequent treatment.If timer 1 is overtime, still do not receive the response message of process B, then process A carries out reset operation.
From the description of above-mentioned detailed process as can be seen, under normal conditions, after task A obtains cpu resource, will be distributed to process A from the response message of process B, and the process of activation A operation, the response message of process A treatment progress B, and remove timer 1 simultaneously.But, if process A place task is blocked by other high-priority task, then can't obtain the response message that cpu resource treatment progress B sends, also just can't remove timer 1 according to the normal handling flow process, in this case, the present invention is by before removing timer 1, increase the step of the overtime judgement of carrying out timer 1, the time exceeded message of correspondence is placed disarmed state, thoroughly closed down and entered the message sink formation and not processed time exceeded message, just avoid system on unnecessary messages, to waste resource and time, avoided the appearance of abnormality processing flow process.
In sum, the present invention does not have influence substantially to system performance, and change is very little, realizes simply highly versatile.
Illustrating of above-mentioned each concrete steps is comparatively concrete, can not therefore think the restriction to scope of patent protection of the present invention, and scope of patent protection of the present invention should be as the criterion with claims.

Claims (8)

1. a system process is dispatched the sending method of time exceeded message down, and it is applied on the timer module of embedded OS, it is characterized in that, described method is carried out according to following steps:
A, in the timer control structure, add a pointer variable in advance;
B, when system timer module during to process transmission timer time exceeded message, described pointer variable is pointed to overtime message.
2. method according to claim 1 is characterized in that, among the described step b, described pointer variable is pointed to the first address of overtime message in the formation of task message sink.
3. a system process is dispatched the method for invalid time exceeded message down, and it is applied on the timer module of embedded OS, it is characterized in that, described method is carried out according to following steps:
The task at A, system process place is obtained cpu resource, and processing messages receives the message in the formation;
B, system timer module judge whether the timer of current process correspondence is overtime; If this timer is overtime, execution in step D then, otherwise execution in step C;
The timer of C, removing current process correspondence;
D, described timer module utilize a pointer variable of pointing to overtime message to search this overtime message in the formation of task message sink, and the sign of this overtime message is changed to invalid.
4. method according to claim 3 is characterized in that, and is further comprising the steps of after the described step D:
E, in the task at current process place during to subordinate's process dispatch messages, the message flag of deletion message body is invalid message, the effective message of next bar is obtained in circulation.
5. method according to claim 3 is characterized in that, and is further comprising the steps of before the described steps A:
A01, system process send a request message to another process, and start a timer timing;
A02, described another process are to system's current process feeding back response information, and the message sink formation that response message is placed current process place task.
6. method according to claim 5 is characterized in that, described steps A may further comprise the steps:
A1, judge whether current process place task obtains cpu resource; If, execution in step A2 then;
A2, current process are handled described response message, and execution in step B.
7. method according to claim 5 is characterized in that, described steps A 01 is further comprising the steps of:
A011, timer module timing scan timer queue;
A012, when timer module detects the timer expiry of setting, then, simultaneously this pointer variable is pointed to this overtime message to the process transmission timer time exceeded message that timer is set.
8. method according to claim 7 is characterized in that, in the described steps A 012, described pointer variable is pointed to the first address of overtime message in the formation of task message sink.
CNB200710124849XA 2007-12-03 2007-12-03 Method of invalid time over message under system process scheduling Expired - Fee Related CN100535864C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CNB200710124849XA CN100535864C (en) 2007-12-03 2007-12-03 Method of invalid time over message under system process scheduling

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNB200710124849XA CN100535864C (en) 2007-12-03 2007-12-03 Method of invalid time over message under system process scheduling

Publications (2)

Publication Number Publication Date
CN101178667A true CN101178667A (en) 2008-05-14
CN100535864C CN100535864C (en) 2009-09-02

Family

ID=39404929

Family Applications (1)

Application Number Title Priority Date Filing Date
CNB200710124849XA Expired - Fee Related CN100535864C (en) 2007-12-03 2007-12-03 Method of invalid time over message under system process scheduling

Country Status (1)

Country Link
CN (1) CN100535864C (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101754114B (en) * 2008-12-12 2012-09-26 中兴通讯股份有限公司 Method for realizing state consistency of multimedia message and system thereof
CN106293884A (en) * 2015-05-20 2017-01-04 苏州简约纳电子有限公司 The detection method of invalid time exceeded message in a kind of message-driven system
CN106462474A (en) * 2014-05-08 2017-02-22 谷歌公司 Network timeouts using intentionally delayed transmissions
CN108009022A (en) * 2017-11-06 2018-05-08 联动优势科技有限公司 A kind of message treatment method and server
CN109617648A (en) * 2018-10-29 2019-04-12 青岛民航凯亚系统集成有限公司 A kind of variable time sliding window calculation method

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101754114B (en) * 2008-12-12 2012-09-26 中兴通讯股份有限公司 Method for realizing state consistency of multimedia message and system thereof
CN106462474A (en) * 2014-05-08 2017-02-22 谷歌公司 Network timeouts using intentionally delayed transmissions
CN106462474B (en) * 2014-05-08 2020-03-31 谷歌有限责任公司 Network timeout using deliberately delayed transmission
CN106293884A (en) * 2015-05-20 2017-01-04 苏州简约纳电子有限公司 The detection method of invalid time exceeded message in a kind of message-driven system
CN106293884B (en) * 2015-05-20 2019-06-07 苏州简约纳电子有限公司 The detection method of invalid time exceeded message in a kind of message-driven system
CN108009022A (en) * 2017-11-06 2018-05-08 联动优势科技有限公司 A kind of message treatment method and server
CN109617648A (en) * 2018-10-29 2019-04-12 青岛民航凯亚系统集成有限公司 A kind of variable time sliding window calculation method

Also Published As

Publication number Publication date
CN100535864C (en) 2009-09-02

Similar Documents

Publication Publication Date Title
EP2701074B1 (en) Method, device, and system for performing scheduling in multi-processor core system
US7191444B2 (en) Stream management in a multithreaded environment
WO2015096656A1 (en) Thread creation method, service request processing method and related device
US5875329A (en) Intelligent batching of distributed messages
CN100535864C (en) Method of invalid time over message under system process scheduling
CN100430898C (en) Application system for high grade multiple line distance management
CN106293919A (en) The built-in tasks dispatching device of a kind of Time Triggered and method
CN103092682A (en) Asynchronous network application program processing method
CN101464810A (en) Service program processing method and server
CN103500119B (en) A kind of method for allocating tasks based on pre-scheduling
CN104102548A (en) Task resource scheduling processing method and task resource scheduling processing system
CN109684060A (en) A kind of mixed scheduling method of polymorphic type time-critical task
CN107256180A (en) Data processing method, device and terminal
CN107479981B (en) Processing method and device for realizing synchronous call based on asynchronous call
CN100593146C (en) Method for preventing industrial automation system from snowslip
CN113535362A (en) Distributed scheduling system architecture and micro-service workflow scheduling method
CN108875381A (en) A kind of design scheme for the messaging service module for supporting kernel module to be isolated
KR20000060827A (en) method for implementation of transferring event in real-time operating system kernel
Fohry et al. Fault tolerance for lifeline-based global load balancing
WO2012065432A1 (en) Method for implementing timer in multi-core system and multi-core system
CN116302420A (en) Concurrent scheduling method, concurrent scheduling device, computer equipment and computer readable storage medium
Roy et al. A high-throughput network processor architecture for latency-critical applications
CN111414244A (en) Method for efficiently calling cipher machine
CN111427673A (en) Load balancing method, device and equipment
CN104360913A (en) Monitoring module for computer operation system

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20090902

Termination date: 20141203

EXPY Termination of patent right or utility model