CN101216798A - Periodic task reliability control method based on watchdog and timer - Google Patents
Periodic task reliability control method based on watchdog and timer Download PDFInfo
- Publication number
- CN101216798A CN101216798A CNA2008100591472A CN200810059147A CN101216798A CN 101216798 A CN101216798 A CN 101216798A CN A2008100591472 A CNA2008100591472 A CN A2008100591472A CN 200810059147 A CN200810059147 A CN 200810059147A CN 101216798 A CN101216798 A CN 101216798A
- Authority
- CN
- China
- Prior art keywords
- periodic duty
- periodic
- task
- house dog
- normal
- 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
Links
Images
Landscapes
- Debugging And Monitoring (AREA)
Abstract
The invention discloses a monitoring method for periodic task reliability based on a watchdog and a timer. The invention adopts a task multi-mode management method which allows the task to have temporary state and a task report mechanism; in addition, the invention increases the execution time of the periodic task measured by using the timer, and enhances the running reliability monitoring to the periodic task, through combining with the recovery system function completed by overtime restarting of the watchdog and the timing function of the timer. Based on the automatic restart function of the watchdog, the invention ensures that the system can recover automatically under an abnormal condition at the same time; whether the running time of the periodic task corresponds to the requirements is monitored; the number of periodic task reports of the configuration is allowed to have difference; the accessorial temporary state greatly decreases the abnormity misjudgment in the periodic task, thereby reducing the wrong restart of the system.
Description
Technical field
The present invention relates to computer realm, particularly a kind of reliability monitoring method of the periodic duty based on house dog and timer.
Background technology
Embedded real-time operating system generally by task scheduling management, time management, tasks synchronization and communicate by letter, several parts such as memory management form.Periodic task occurs through regular meeting again in the real time operating system, need effectively monitor for the reliability of periodic task, promptly whether whether monitor task normally meet the requirements the working time of operation and task.Whether normally house dog is through being commonly used to the supervisory system important hardware device of operation in the embedded system.House dog is the auto-counter of a system, when house dog counting arrives its highest count value, can restart total system.The method of general use house dog is in the task of system's operation, and zero clearing house dog counter claims " feeding dog " at set intervals, and proof system normally moves; If do not go for a long time to watchdog zero clearing, when house dog has exceeded its highest count value, think that system makes mistakes, system will restart.
From generally using the method for watch dog monitoring periodic task reliability at present, can see, these methods are used the fairly simple and deficient in stability of method of house dog: the time requirement of watchdog zero clearing is too harsh, therefore the situation that mistake is restarted system may occur; In addition tradition use house dog method not to the monitoring of the time-constrain of periodic duty.
Summary of the invention
When only using the watch dog monitoring periodic duty in order to solve, owing to the problem that small variation causes system mistake to be restarted has taken place the working time of periodic duty, and can effective monitoring working time of periodic duty whether meet the requirements, the object of the present invention is to provide a kind of method for supervising of the periodic task reliability based on house dog and timer.
The technical solution adopted for the present invention to solve the technical problems is that the step of this method is as follows:
1) sets a normal report variable (aliveCounter) for each periodic duty earlier, be whether periodic duty need normal to System Reports self in each pre-set time interval, and be expected in the monitoring period, the normal reporting quantities (expectedAlive) of expection and the error (tolerance) that allows, when periodic duty moves, every report once, normal report variable (aliveCounter) increases by 1, system need set monitoring period, system will check when each monitoring period arrives, whether the normal report variable of periodic duty satisfies re-set target, satisfying re-set target is meant, the value scope of normal report variable will normally be reported the variable zero clearing simultaneously at [expectedAlive-tolerance, expectedAlive+tolerance];
2) periodic duty allows and repeatedly proves self normal chance of moving, periodic duty has the conversion of a state, the original state of periodic duty is " normally ", when periodic duty when monitoring period arrives, normal reporting quantities (aliveCounter) does not reach the re-set target in the error range, periodic duty will enter the state of " temporarily ", at this moment, periodic duty will be allowed to continue to carry out a plurality of monitoring periods, if in these monitoring periods, as long as once the normal reporting quantities of periodic duty has reached the normal reporting quantities of expection, periodic duty will be considered to normal operation so, get back to " normally " state once more; Otherwise in these monitoring periods, periodic duty does not all reach the set goal, and periodic duty will be considered to operation " unusually " so;
3) the house dog counter of hardware will be timed device with the fixing cycle always, be cleared before arriving its house dog counter peak value; But when when periodic duty is considered to misoperation, promptly entering " unusually " state, the house dog counter of hardware will no longer be cleared so, and promptly system can restart after house dog counter peak value arrives.
Because the task of monitoring is a periodic task, report once when therefore being chosen in the periodic duty each run, or select report repeatedly, decide according to duty cycle length.
The 2nd) in the step, periodic duty enters after " temporarily " state, will be allowed to continue to carry out a plurality of monitoring periods, and the number of monitoring period can dispose.
The 3rd)) in the step, the cycle that the house dog counter is cleared is less than the cycle of house dog counter to peaking, and the assurance system can not restart when normal operation automatically; And when finding to have periodic duty unusual, the house dog counter will can not be cleared, and assurance this moment system can restart.
The beneficial effect that the present invention has is:
Patent of the present invention combines house dog overtimely restarts the function of recovery system and the clocking capability of timer, increases and uses timer to weigh the execution time of periodic duty, has strengthened the monitoring to the operational reliability of periodic duty; Simultaneously, the function that resets automatically based on house dog has guaranteed the automatic recovery of system under abnormal conditions; Can also whether meet the requirements the monitoring periods task run time; And allow configuration cycle debriefing quantity that error is arranged, and " the interim state " that increase reduced the erroneous judgement to periodic duty " unusually " greatly, thereby can reduce the restarting of mistake of system.
Description of drawings
Fig. 1 is the monitored periodic duty state transition graph in the inventive method.
Fig. 2 is the sequence chart that hardware watchdog counter of the present invention is cleared.
Fig. 3 is the variable in each task and status switch Fig. 1 in the example of the present invention.
Fig. 4 is the variable in each task and status switch Fig. 2 in the example of the present invention.
Fig. 5 is the zero clearing sequential chart of house dog counter in the example of the present invention.
Embodiment
Below in conjunction with accompanying drawing and example the method based on house dog and timer monitoring period task of the present invention is further introduced.
Here the periodic task reliability method for supervising that refers to has mainly used hardware resource in 2: house dog and timer.Wherein timer is used for the working time of task measuring period, and whether monitor task normally moves in certain measuring period; And house dog is only used the function of its system that resets automatically, and promptly works as and finds that the periodic duty irregular operating is arranged, or do not meet when requiring expeced time, restarts total system.
1. set a normal report variable (aliveCounter) for each periodic duty earlier, be whether periodic duty need normal to System Reports self in each pre-set time interval, and be expected in the monitoring period the normal reporting quantities (expectedAlive) of expection and the error (tolerance) that allows.When periodic duty moved, every report once reported that normally variable (aliveCounter) increases by 1.System need set monitoring period, system will check when each monitoring period arrives, whether the normal report variable of periodic duty satisfies re-set target, satisfying re-set target is meant, the value scope of normal report variable is at [expectedAlive-tolerance, expectedAlive+tolerance].Simultaneously with the aliveCounter zero clearing.
2. as shown in Figure 1, periodic duty allows repeatedly proves self normal chance of moving, and periodic duty has the conversion of a state.The original state of periodic duty is " normally ", when periodic duty when monitoring period arrives, normal reporting quantities (aliveCounter) does not reach the re-set target in the error range, periodic duty will enter the state of " temporarily ".At this moment, periodic duty will be allowed to continue to carry out a plurality of monitoring periods, if in these monitoring periods, as long as once the normal reporting quantities of periodic duty has reached the normal reporting quantities of expection, periodic duty will be considered to normal operation so, get back to " normally " state once more; Otherwise in these monitoring periods, periodic duty does not all reach the set goal, and periodic duty will be considered to operation " unusually " so.
3. as shown in Figure 2, the house dog counter of hardware will be timed device with the fixing cycle always, be cleared before arriving its counter peak value.But when when periodic duty is considered to misoperation, promptly entering " unusually " state, the house dog counter of hardware will no longer be cleared so, and promptly system can restart after the house dog count value arrives.
Following table has shown in the MC9S12DP256 development board, has 4 monitored periodic duties in certain system, its duty cycle, and the error of expecting normal reporting quantities and permission, the monitoring period of system is 250 times of day.Therefore, we can know that in the monitoring period of 250 times of day, the span of the value of the normal reporting quantities (aliveCounter) of each periodic duty is at last row of table.
Task names | Monitoring period (time of day) | Duty cycle (time of day) | Expect normal reporting quantities (inferior) | Permissible error (inferior) | Allow span (inferior) |
Task A | 250 | 30 | 8 | 1 | 7~9 |
Task |
30 | 8 | 2 | 6~10 | |
Task |
40 | 6 | 1 | 5~7 | |
|
60 | 4 | 1 | 3~5 |
As Fig. 3, shown in Figure 4, shown 4 periodic duties in this system, moving running status at some crucial moments.The aliveCounter of each periodic duty is initialized to 0 when system brings into operation, the every operation of periodic duty once just adds 1 with aliveCounter, proves that periodic duty is in normal operation.Task A and task B are the moment 30, and the value of aliveCounter has all become 1 by 0 of 0 moment, and task C and task D have become 1 when system time is 40 and 60, by that analogy.When arriving the monitoring period of system, promptly 250, whether the value of the aliveCounter of each periodic duty of systems inspection is within the scope of expection.
At this moment, task A and task C be not within scope: the aliveCounter value of task A is 6, not between 7~9; The value of task C is 4, not between 5~7.And the aliveCounter of task B and task D is within the span that allows.Therefore, task B and task D operation are thought normally by system, and it is undesired that the operation of task A and task C has occurred.But do not judge task A and task C " unusually " operation, system gives task A and task C proof own normal chance again, and task A and task C are put into " temporarily " state.System allows once more in a monitoring period monitor task A and task C whether can reach the span of permission.
As shown in Figure 4, task A is when system time 500, and aliveCounter is 7, and in 7~9 span, so system judges that task A moves normally at this moment, enters " normally " state once more; And task C arrives at second monitoring period, and promptly during system time 500, aliveCounter is 3, still not in 5~7 permission span, therefore judges task C misoperation.
On the other hand, as shown in Figure 5, the house dog counter to the cycle to peaking be 100 times of day, the zero clearing cycle of the house dog of system is 50 times of day, therefore under the situation of all tasks " normally " and " temporarily ", house dog can not restart system in zero clearing before peaking.
Therefore, above-mentioned at 500 o'clock constantly, when the task of discovery C has " unusually ", system will be a watchdog zero clearing no longer this moment, but let alone after 100 times of day arrive, and system resets automatically.Do like this, guaranteed after the system reset, can continue operation.
Also have, " unusually " system that makes need restart to have occurred in the above-mentioned example that periodic duty is arranged, and resumes operation guaranteeing.And when never occurring periodic duty " unusually " in the system, system will be considered to always in normal operation, and can not stop the zero clearing to the house dog counter.
In sum, the method that the present invention adopts based on house dog counter and timer monitoring period mission reliability, greatly reduce the whether normal False Rate of periodic duty, saved the number of times of system restart, normal, the reliability service of system have been guaranteed, and maintenance, method of operating are simple, realize easily.
At last, it is also to be noted that what more than enumerate only is specific embodiments of the invention.Obviously, the invention is not restricted to above examples of implementation, many distortion can also be arranged.All distortion that those of ordinary skill in the art can directly derive or associate from content disclosed by the invention all should be thought protection scope of the present invention.
Claims (4)
1. method for supervising based on the periodic task reliability of house dog and timer is characterized in that the step of this method is as follows:
1) sets a normal report variable aliveCounter for each periodic duty earlier, be whether periodic duty need normal to System Reports self in each pre-set time interval, and be expected in the monitoring period, the normal reporting quantities expectedAlive of expection and the error tolerance of permission, when periodic duty moves, every report once, normal report variable increases by 1, system need set monitoring period, system will check when each monitoring period arrives, whether the normal report variable of periodic duty satisfies re-set target, satisfying re-set target is meant, the value scope of normal report variable will normally be reported the variable zero clearing simultaneously at [expectedAlive-tolerance, expectedAlive+tolerance];
2) periodic duty allows and repeatedly proves self normal chance of moving, periodic duty has the conversion of a state, the original state of periodic duty is " normally ", when periodic duty when monitoring period arrives, normal reporting quantities does not reach the re-set target in the error range, periodic duty will enter the state of " temporarily ", at this moment, periodic duty will be allowed to continue to carry out a plurality of monitoring periods, if in these monitoring periods, as long as once the normal reporting quantities of periodic duty has reached the normal reporting quantities of expection, periodic duty will be considered to normal operation so, get back to " normally " state once more; Otherwise in these monitoring periods, periodic duty does not all reach the set goal, and periodic duty will be considered to operation " unusually " so;
3) the house dog counter of hardware will be timed device with the fixing cycle always, be cleared before arriving its house dog counter peak value; But when when periodic duty is considered to misoperation, promptly entering " unusually " state, the house dog counter of hardware will no longer be cleared so, and promptly system can restart after house dog counter peak value arrives.
2. the method for supervising of a kind of periodic task reliability based on house dog and timer according to claim 1, it is characterized in that because the task of monitoring is a periodic task, report once when therefore being chosen in the periodic duty each run, or select report repeatedly, decide according to duty cycle length.
3. the method for supervising of a kind of periodic task reliability based on house dog and timer according to claim 1, it is characterized in that: the 2nd) in the step, periodic duty enters after " temporarily " state, will be allowed to continue to carry out a plurality of monitoring periods, and the number of monitoring period can dispose.
4. the method for supervising of a kind of periodic task reliability based on house dog and timer according to claim 1, it is characterized in that: the 3rd)) in the step, the cycle that the house dog counter is cleared is less than the cycle of house dog counter to peaking, the assurance system can not restart when normal operation automatically; And when finding to have periodic duty unusual, the house dog counter will can not be cleared, and assurance this moment system can restart.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN200810059147A CN100593776C (en) | 2008-01-14 | 2008-01-14 | Periodic task reliability control method based on watchdog and timer |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN200810059147A CN100593776C (en) | 2008-01-14 | 2008-01-14 | Periodic task reliability control method based on watchdog and timer |
Publications (2)
Publication Number | Publication Date |
---|---|
CN101216798A true CN101216798A (en) | 2008-07-09 |
CN100593776C CN100593776C (en) | 2010-03-10 |
Family
ID=39623234
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN200810059147A Expired - Fee Related CN100593776C (en) | 2008-01-14 | 2008-01-14 | Periodic task reliability control method based on watchdog and timer |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN100593776C (en) |
Cited By (17)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101860624A (en) * | 2010-06-21 | 2010-10-13 | 中兴通讯股份有限公司 | Crash auto-restart method and mobile phone |
CN101937371A (en) * | 2010-08-27 | 2011-01-05 | 北京星网锐捷网络技术有限公司 | Method and device for monitoring task execution state in embedded system |
CN101944056A (en) * | 2010-09-21 | 2011-01-12 | 深圳市华力特电气股份有限公司 | Method and device for monitoring multitask system |
CN102193839A (en) * | 2010-03-12 | 2011-09-21 | 鸿富锦精密工业(深圳)有限公司 | Electronic device and startup method thereof |
CN102413496A (en) * | 2011-11-29 | 2012-04-11 | 大唐移动通信设备有限公司 | Restarting method and equipment of automatic drive test terminal equipment |
CN103019908A (en) * | 2012-12-07 | 2013-04-03 | 陕西千山航空电子有限责任公司 | Vxworks multi-task monitoring technological method based on multiple buses |
CN103246551A (en) * | 2012-02-07 | 2013-08-14 | 北京糯米网科技发展有限公司 | Device and method for management of background timed task |
CN103389934A (en) * | 2012-05-08 | 2013-11-13 | 上海富欣智能交通控制有限公司 | Hardware two-channel-based system for monitoring operation |
CN103533297A (en) * | 2012-07-05 | 2014-01-22 | 英飞凌科技股份有限公司 | Monitoring circuit with a signature watchdog |
CN103645980A (en) * | 2013-12-19 | 2014-03-19 | 安徽师范大学 | Monitoring method for embedded system timer |
CN106445772A (en) * | 2015-08-13 | 2017-02-22 | 北京恒安永通科技有限公司 | Multi-data associative analysis method and system |
CN106502178A (en) * | 2016-11-02 | 2017-03-15 | 王开晶 | Computer multiple solutions production control system cruising inspection system and its method |
CN106776202A (en) * | 2016-11-25 | 2017-05-31 | 广州日滨科技发展有限公司 | The monitoring method and system of embedded OS task |
CN107526658A (en) * | 2016-06-21 | 2017-12-29 | 泰勒斯公司 | Ensure the method that common signal receives in the avionics system including multiple electronic computers |
CN107851050A (en) * | 2015-07-08 | 2018-03-27 | 微软技术许可有限责任公司 | The WatchDog Timer of high availability and energy efficient |
CN111522713A (en) * | 2020-04-20 | 2020-08-11 | 浙江大学 | Intelligent robot software state monitoring system and method based on ROS development |
CN113296997A (en) * | 2021-06-16 | 2021-08-24 | 度普(苏州)新能源科技有限公司 | Task monitoring method and device based on watchdog |
-
2008
- 2008-01-14 CN CN200810059147A patent/CN100593776C/en not_active Expired - Fee Related
Cited By (25)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102193839A (en) * | 2010-03-12 | 2011-09-21 | 鸿富锦精密工业(深圳)有限公司 | Electronic device and startup method thereof |
CN101860624A (en) * | 2010-06-21 | 2010-10-13 | 中兴通讯股份有限公司 | Crash auto-restart method and mobile phone |
CN101937371A (en) * | 2010-08-27 | 2011-01-05 | 北京星网锐捷网络技术有限公司 | Method and device for monitoring task execution state in embedded system |
CN101944056B (en) * | 2010-09-21 | 2013-05-08 | 深圳市华力特电气股份有限公司 | Method and device for monitoring multitask system |
CN101944056A (en) * | 2010-09-21 | 2011-01-12 | 深圳市华力特电气股份有限公司 | Method and device for monitoring multitask system |
CN102413496A (en) * | 2011-11-29 | 2012-04-11 | 大唐移动通信设备有限公司 | Restarting method and equipment of automatic drive test terminal equipment |
CN103246551A (en) * | 2012-02-07 | 2013-08-14 | 北京糯米网科技发展有限公司 | Device and method for management of background timed task |
CN103389934A (en) * | 2012-05-08 | 2013-11-13 | 上海富欣智能交通控制有限公司 | Hardware two-channel-based system for monitoring operation |
CN103389934B (en) * | 2012-05-08 | 2016-01-13 | 上海富欣智能交通控制有限公司 | The system of operation monitoring is realized based on hardware binary channels |
CN103533297A (en) * | 2012-07-05 | 2014-01-22 | 英飞凌科技股份有限公司 | Monitoring circuit with a signature watchdog |
US10838795B2 (en) | 2012-07-05 | 2020-11-17 | Infineon Technologies Ag | Monitoring circuit with a signature watchdog |
CN103019908A (en) * | 2012-12-07 | 2013-04-03 | 陕西千山航空电子有限责任公司 | Vxworks multi-task monitoring technological method based on multiple buses |
CN103645980A (en) * | 2013-12-19 | 2014-03-19 | 安徽师范大学 | Monitoring method for embedded system timer |
CN107851050A (en) * | 2015-07-08 | 2018-03-27 | 微软技术许可有限责任公司 | The WatchDog Timer of high availability and energy efficient |
CN107851050B (en) * | 2015-07-08 | 2021-04-09 | 微软技术许可有限责任公司 | Device with watchdog timer and method for operating watchdog timer |
CN106445772A (en) * | 2015-08-13 | 2017-02-22 | 北京恒安永通科技有限公司 | Multi-data associative analysis method and system |
CN106445772B (en) * | 2015-08-13 | 2020-04-24 | 北京恒安永通科技有限公司 | Multi-data association analysis method and system |
CN107526658A (en) * | 2016-06-21 | 2017-12-29 | 泰勒斯公司 | Ensure the method that common signal receives in the avionics system including multiple electronic computers |
CN107526658B (en) * | 2016-06-21 | 2022-05-27 | 泰勒斯公司 | Method for ensuring reception of a common signal in an avionics system comprising a plurality of electronic computers |
CN106502178B (en) * | 2016-11-02 | 2019-01-25 | 王开晶 | The cruising inspection system and its method of computer multiple solutions production control system |
CN106502178A (en) * | 2016-11-02 | 2017-03-15 | 王开晶 | Computer multiple solutions production control system cruising inspection system and its method |
CN106776202B (en) * | 2016-11-25 | 2020-06-26 | 日立楼宇技术(广州)有限公司 | Method and system for monitoring tasks of embedded operating system |
CN106776202A (en) * | 2016-11-25 | 2017-05-31 | 广州日滨科技发展有限公司 | The monitoring method and system of embedded OS task |
CN111522713A (en) * | 2020-04-20 | 2020-08-11 | 浙江大学 | Intelligent robot software state monitoring system and method based on ROS development |
CN113296997A (en) * | 2021-06-16 | 2021-08-24 | 度普(苏州)新能源科技有限公司 | Task monitoring method and device based on watchdog |
Also Published As
Publication number | Publication date |
---|---|
CN100593776C (en) | 2010-03-10 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN100593776C (en) | Periodic task reliability control method based on watchdog and timer | |
CN100405307C (en) | Watchdog control method | |
CN100359481C (en) | Abnormal monitoring equipment and method for multi-task system | |
KR100982034B1 (en) | Monitoring method and system for database performance | |
CN101387971A (en) | Task regulation method and apparatus for embedded software | |
CN103246589A (en) | Multithread monitoring method and device | |
CN105677497A (en) | High availability watchdog circuit | |
CN103853625A (en) | Realizing device and method for multi-task watchdog | |
CN1728044A (en) | Automatic power down rebooting device | |
CN105204952A (en) | Fault tolerance management method of multi-core operation system | |
CN102372222A (en) | Reverse, over-speed and stall protection safety circuit of escalator and moving walkway | |
CN100395722C (en) | Method for preserving abnormal state information of control system | |
CN103679275A (en) | Processing method aiming at overtime unconfirmed warning information of automatic scheduling system | |
CN101853191A (en) | Method for detecting task endless loop in operating system and operating system | |
CN103605602A (en) | Method for filtering out malfunctions of distributed computer system | |
CN101221518B (en) | Method, device and system for preventing timing device overflow of hardware watchdog | |
JPWO2016021395A1 (en) | Device monitoring system, device monitoring program, and device monitoring method | |
CN101458640B (en) | System capable of monitoring multithread state and monitoring method thereof | |
WO2014136182A1 (en) | Management device and method for air conditioner | |
CN110968448B (en) | Method for monitoring multi-task running state | |
CN112734175A (en) | Comprehensive energy management and control system for industrial enterprise | |
CN111736579B (en) | Industrial control equipment safety detection method based on log inquiry and retention | |
CN202153352U (en) | Watchdog device capable of preventing computer control system from failure | |
CN101334749A (en) | Embedded system interruption control method and apparatus | |
CN100557576C (en) | The method and apparatus that operating system failure detects |
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: 20100310 Termination date: 20180114 |
|
CF01 | Termination of patent right due to non-payment of annual fee |