CN104899110A - Setting and feeding method for watchdog - Google Patents

Setting and feeding method for watchdog Download PDF

Info

Publication number
CN104899110A
CN104899110A CN201510300162.1A CN201510300162A CN104899110A CN 104899110 A CN104899110 A CN 104899110A CN 201510300162 A CN201510300162 A CN 201510300162A CN 104899110 A CN104899110 A CN 104899110A
Authority
CN
China
Prior art keywords
dog
feeding
setting
routine
watchdog
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
CN201510300162.1A
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.)
Ningbo Sanxing Medical and Electric Co Ltd
Original Assignee
Ningbo Sanxing Smart Electric 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 Ningbo Sanxing Smart Electric Co Ltd filed Critical Ningbo Sanxing Smart Electric Co Ltd
Priority to CN201510300162.1A priority Critical patent/CN104899110A/en
Publication of CN104899110A publication Critical patent/CN104899110A/en
Pending legal-status Critical Current

Links

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

The invention discloses a setting and feeding method for a watchdog. A watchdog and k interrupt programs are included. The setting and feeding method for the watchdog further comprises the following steps: (1) putting the watchdog in a main program and putting data n1, n2, n3 to nk in each interrupt program at the same time; (2) subtracting 1 by n1, subtracting 1 by n2, subtracting 1 by n3 ... subtracting 1 by nk, and if (n1-1) is not equal to 0, (n2-1) is not equal to 0, (n2-1) is not equal to 0 ... and (nk-1) is not equal to 0, sending a dog-feeding signal once by the main program and returning back to the step (1); otherwise, executing the step (3); (3) if any one or more of (n1-1), (n2-1), (n3-1) ... and (nk-1) is equal to 0, judging that monitoring is interrupted, and not sending the dog-feeding signal by the main program; and (4) rebooting the main program. The dog-feeding effect of the method is good.

Description

The setting of house dog and dog-feeding method
Technical field
The present invention relates to a kind of house dog program used in electric energy meter, is specifically setting and the dog-feeding method of a kind of house dog.
Background technology
The watchdog control method of prior art is generally all place a house dog in a master routine and multiple interrupt routine.When feeding dog, master routine and interrupt routine are all at transmission feeding-dog signal, but owing to cannot judge it is whom sends feeding-dog signal by, therefore still can produce master routine or interrupt routine runs the problem flown, thus make hello the dog effect of the setting of prior art house dog and dog-feeding method poor.And if only in master routine or each interrupt routine place a house dog, also cannot play the effect of monitoring, there will be the problem of program fleet equally.Therefore, for these reasons, a kind of setting and dog-feeding method of feeding the effective house dog of dog is urgently needed, to solve the problem.
Summary of the invention
The technical problem to be solved in the present invention is, provides a kind of setting and dog-feeding method of feeding the effective house dog of dog.
Technical scheme of the present invention is, provides setting and the dog-feeding method of a kind of house dog, comprises a house dog and k interrupt routine; Setting and the dog-feeding method of described house dog are further comprising the steps of:
(1), in master routine place a house dog, place in each interrupt routine simultaneously data n1, a n2, n3 ..., nk;
(2), by n1-1, n2-1, n3-1 ..., nk-1, if (n1-1) ≠ 0, (n2-1) ≠ 0, (n3-1) ≠ 0 ..., (nk-1) ≠ 0, then master routine sends a feeding-dog signal, returns step (1); Otherwise, perform step (3);
(3) if (n1-1), (n2-1), (n3-1) ..., any one or more equal zero in (nk-1), then judge that monitoring is interrupted, master routine does not send feeding-dog signal;
(4), master routine is restarted.
After adopting above method, the present invention compared with prior art, has the following advantages:
The setting of house dog of the present invention and dog-feeding method by placing a house dog in master routine, and data are placed in each interrupt routine, first the control to master routine is achieved, then by doing subtraction to realize to data for multiple interrupt routine, if namely interrupt routine runs and flies, then be certain to occur null situation, thus judge that interrupt routine race flies.Therefore, the setting of house dog of the present invention and dog-feeding method achieve and realize monitoring in real time to master routine and multiple interrupt routine, and its effect of feeding dog is better.
Accompanying drawing explanation
Fig. 1 is the setting of house dog of the present invention and the process flow diagram of dog-feeding method.
Embodiment
Below in conjunction with the drawings and specific embodiments, the invention will be further described.
As shown in Figure 1, the setting of a kind of house dog of the present invention and dog-feeding method, comprise a house dog and k interrupt routine; Setting and the dog-feeding method of described house dog are further comprising the steps of:
(1), in master routine place a house dog, place in each interrupt routine simultaneously data n1, a n2, n3 ..., nk, if there are 3 interrupt routines, then respectively in each interrupt routine place data, n1, n2, n3;
(2), by n1-1, n2-1, n3-1 ..., nk-1, if (n1-1) ≠ 0, (n2-1) ≠ 0, (n3-1) ≠ 0 ..., (nk-1) ≠ 0, then master routine sends a feeding-dog signal, returns step (1); Otherwise, perform step (3); In the present embodiment, judge (n1-1) ≠ 0, (n2-1) ≠ 0, (n3-1) ≠ 0, then illustrate that each interrupt routine is in operation, returns step (1) and re-executes; General n=100 or n=1000.
(3) if (n1-1), (n2-1), (n3-1) ..., any one or more equal zero in (nk-1), then judge that monitoring is interrupted, master routine does not send feeding-dog signal; In the present embodiment, judge (n1-1)=0, (n2-1)=0, (n3-1)=0, then interruption 1 is described, interrupt 2 programs and run and fly, it in placement data, does not interrupt 3 normal program operation; Then illustrate that interrupt routine has run to fly, it in placement data, does not perform step (4);
(4), restart master routine, return step (1).
Below only just most preferred embodiment of the present invention is described, but can not be interpreted as it is limitations on claims.The present invention is not limited only to above embodiment, and its concrete structure allows to change.In every case the various change done in the protection domain of independent claims of the present invention is all in protection scope of the present invention.

Claims (1)

1. the setting of house dog and a dog-feeding method, is characterized in that: comprise a house dog and k interrupt routine; Setting and the dog-feeding method of described house dog are further comprising the steps of:
(1), in master routine place a house dog, place in each interrupt routine simultaneously data n1, a n2, n3 ..., nk;
(2), by n1-1, n2-1, n3-1 ..., nk-1, if (n1-1) ≠ 0, (n2-1) ≠ 0, (n3-1) ≠ 0 ..., (nk-1) ≠ 0, then master routine sends a feeding-dog signal, returns step (1); Otherwise, perform step (3);
(3) if (n1-1), (n2-1), (n3-1) ..., any one or more equal zero in (nk-1), then judge that monitoring is interrupted, master routine does not send feeding-dog signal;
(4), master routine is restarted.
CN201510300162.1A 2015-06-05 2015-06-05 Setting and feeding method for watchdog Pending CN104899110A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510300162.1A CN104899110A (en) 2015-06-05 2015-06-05 Setting and feeding method for watchdog

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510300162.1A CN104899110A (en) 2015-06-05 2015-06-05 Setting and feeding method for watchdog

Publications (1)

Publication Number Publication Date
CN104899110A true CN104899110A (en) 2015-09-09

Family

ID=54031787

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510300162.1A Pending CN104899110A (en) 2015-06-05 2015-06-05 Setting and feeding method for watchdog

Country Status (1)

Country Link
CN (1) CN104899110A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110162421A (en) * 2019-04-28 2019-08-23 北京航空航天大学 A kind of embedded software house dog test method and device containing interrupt function

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101271414A (en) * 2008-05-06 2008-09-24 江苏东大金智建筑智能化系统工程有限公司 Full-range dog-feeding method of embedded system
CN101957790A (en) * 2009-11-26 2011-01-26 上海大学 Implementation method of multi-source watchdog of microcontroller
WO2013152584A1 (en) * 2012-04-13 2013-10-17 华为技术有限公司 Method, device and single board for feeding dog in embedded system
CN104199746A (en) * 2014-09-01 2014-12-10 中国东方电气集团有限公司 Multitask software watchdog acquiring method
CN104636212A (en) * 2014-12-29 2015-05-20 漳州科能电器有限公司 Embedded operating system watchdog realizing method

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101271414A (en) * 2008-05-06 2008-09-24 江苏东大金智建筑智能化系统工程有限公司 Full-range dog-feeding method of embedded system
CN101957790A (en) * 2009-11-26 2011-01-26 上海大学 Implementation method of multi-source watchdog of microcontroller
WO2013152584A1 (en) * 2012-04-13 2013-10-17 华为技术有限公司 Method, device and single board for feeding dog in embedded system
CN104199746A (en) * 2014-09-01 2014-12-10 中国东方电气集团有限公司 Multitask software watchdog acquiring method
CN104636212A (en) * 2014-12-29 2015-05-20 漳州科能电器有限公司 Embedded operating system watchdog realizing method

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110162421A (en) * 2019-04-28 2019-08-23 北京航空航天大学 A kind of embedded software house dog test method and device containing interrupt function

Similar Documents

Publication Publication Date Title
AU2018206837A1 (en) Techniques for behavioral pairing in a contact center system
MY187393A (en) Method and system for realizing data tracking by means of software development kit
MX2016016598A (en) Diagnosing and supplementing vehicle sensor data.
WO2020040943A3 (en) Using divergence to conduct log-based simulations
MX2020007855A (en) Website creation system for creating websites having at least one series of directional webpages and related methods.
PH12021550712A1 (en) Apparatus, method, and computer program for connection management
SG11201907942QA (en) Blockchain cluster processing system and method, computer device and storage medium
MX369969B (en) System and methods for improved demand response management system (drms).
CN104657228B (en) A kind of system exception processing method and processing device of mobile terminal
WO2012019075A3 (en) Systems and methods to rank and select triggers for real-time offers
JP2016517638A5 (en)
PH12020551322A1 (en) Methods, network nodes, wireless device and computer program product for resuming a connection with full configuration
WO2012054161A3 (en) Microgrid control system
WO2016011373A8 (en) Enhanced operations between service layer and management layer in an m2m system by allowing the execution of a plurality of commands on a plurality of devices
WO2014002094A3 (en) System and method for datacenters disaster recovery
PH12016000046A1 (en) End-to-end project management
PH12017502186A1 (en) Method for interaction between terminal and network device, and terminal
WO2014190337A3 (en) Requesting proximate resources by learning devices
WO2014076447A3 (en) Monitoring and control of computer apparatus and virtual machine via a network
MX2019001283A (en) Method, device and computer program for primary cell change.
MA40216A (en) Method for joining a cluster of electronic devices communicating via a wireless network, associated electronic device implementing said method and system
GB2542964A (en) Resuming session states
MX2016005295A (en) Flight notification method and setting method and device for flight.
WO2011094006A3 (en) Providing sensory information based on intercepted events
MY193270A (en) Method, system, and device for process triggering

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C41 Transfer of patent application or patent right or utility model
TA01 Transfer of patent application right

Effective date of registration: 20160206

Address after: 315191 Yinzhou Industrial Park, Zhejiang, Ningbo, Yinzhou District, Ningbo

Applicant after: NINGBO SANXING MEDICAL ELECTRIC CO., LTD.

Address before: 315034 Ningbo, Jiangbei District, Zhejiang City, the town of Maple Bay Road, No. 26

Applicant before: Ningbo Samsung intelligent electric company limited

RJ01 Rejection of invention patent application after publication

Application publication date: 20150909

RJ01 Rejection of invention patent application after publication