CN117093249A - Watchdog feeding method, device, equipment and medium - Google Patents

Watchdog feeding method, device, equipment and medium Download PDF

Info

Publication number
CN117093249A
CN117093249A CN202310927097.XA CN202310927097A CN117093249A CN 117093249 A CN117093249 A CN 117093249A CN 202310927097 A CN202310927097 A CN 202310927097A CN 117093249 A CN117093249 A CN 117093249A
Authority
CN
China
Prior art keywords
watchdog
feeding
present application
interrupt function
target program
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
CN202310927097.XA
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.)
Beijing Jingwei Hirain Tech Co Ltd
Original Assignee
Beijing Jingwei Hirain Tech 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 Beijing Jingwei Hirain Tech Co Ltd filed Critical Beijing Jingwei Hirain Tech Co Ltd
Priority to CN202310927097.XA priority Critical patent/CN117093249A/en
Publication of CN117093249A publication Critical patent/CN117093249A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/0703Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
    • G06F11/0751Error or fault detection not based on redundancy
    • G06F11/0754Error or fault detection not based on redundancy by exceeding limits
    • G06F11/0757Error or fault detection not based on redundancy by exceeding limits by exceeding a time limit, i.e. time-out, e.g. watchdogs
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements 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/44Arrangements for executing specific programs
    • G06F9/448Execution paradigms, e.g. implementations of programming paradigms
    • G06F9/4488Object-oriented
    • G06F9/449Object-oriented method invocation or resolution

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Quality & Reliability (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The application discloses a method, a device, equipment and a medium for feeding a watchdog, and relates to the technical field of computers. The method for feeding the watchdog comprises the following steps: acquiring the timing time length of a watchdog timer; determining a watchdog feeding period according to the timing duration; when the watchdog feeding period expires during the execution of the target program, an interrupt function is called to execute the feeding operation on the watchdog. According to the embodiment of the application, the code maintenance efficiency can be improved.

Description

Watchdog feeding method, device, equipment and medium
Technical Field
The application belongs to the technical field of computers, and particularly relates to a method, a device, equipment and a medium for feeding dogs.
Background
Watchdog (watch) is a mechanism for ensuring normal operation of a system or exiting from abnormal states such as dead cycles, deadlocks and the like, and is mainly used for monitoring the operation state of the system and solving faults caused by programs. If the watchdog does not receive the feeding signal within a certain period, the watchdog timer overflows to generate a reset signal which is sent to the system to reset the system.
In the related art, the method mainly adopts the addition of the dog feeding code in the program code, and when the dog feeding code is executed, the dog feeding is carried out on the watchdog. However, adding the dog feeding code to the program code may cause a degree of code confusion, which is unfavorable for code maintenance and has low code maintenance efficiency.
Disclosure of Invention
The embodiment of the application provides a method, a device, equipment and a medium for feeding a watchdog, which can solve the problem of low code maintenance efficiency.
In a first aspect, an embodiment of the present application provides a method for feeding a watchdog, including:
acquiring the timing time length of a watchdog timer;
determining a watchdog feeding period according to the timing time length of the watchdog timer;
when the watchdog feeding period expires during the execution of the target program, an interrupt function is called to execute the feeding operation on the watchdog.
In a second aspect, an embodiment of the present application provides a watchdog feeding device, comprising:
the acquisition module is used for acquiring the timing time length of the watchdog timer;
the determining module is used for determining the watchdog feeding period according to the timing time length of the watchdog timer;
and the first dog feeding module is used for calling an interrupt function to execute dog feeding operation on the watchdog when the dog feeding period expires in the process of executing the target program.
In a third aspect, an embodiment of the present application provides an electronic device, including: a processor and a memory storing computer program instructions; the method for feeding the watchdog according to the first aspect of the embodiment of the present application is implemented when the processor executes the computer program instructions.
In a fourth aspect, an embodiment of the present application provides a computer readable storage medium, where computer program instructions are stored, where the computer program instructions, when executed by a processor, implement the method for feeding a watchdog according to the first aspect of the present application.
In a fifth aspect, an embodiment of the present application provides a computer program product, where instructions in the computer program product, when executed by a processor of an electronic device, cause the electronic device to perform the watchdog feeding method provided in the first aspect of the embodiment of the present application.
In the embodiment of the application, the timing duration of the watchdog timer is acquired; determining a watchdog feeding period according to the timing time length of the watchdog timer; when the watchdog feeding period expires during the execution of the target program, an interrupt function is called to execute the feeding operation on the watchdog. Therefore, the watchdog can be fed, the feeding code is not added in the program code, the code maintenance is convenient, and the code maintenance efficiency can be improved.
Drawings
In order to more clearly illustrate the technical solution of the embodiments of the present application, the drawings that are needed to be used in the embodiments of the present application will be briefly described, and it is possible for a person skilled in the art to obtain other drawings according to these drawings without inventive effort.
FIG. 1 is a schematic flow chart of a method for feeding a watchdog according to an embodiment of the present application;
FIG. 2 is a schematic diagram of a process for feeding a watchdog according to an embodiment of the present application;
FIG. 3 is a schematic diagram of a dog feeding process during Flash operation according to an embodiment of the present application;
fig. 4 is a schematic structural view of a watchdog feeding device according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
Features and exemplary embodiments of various aspects of the present application will be described in detail below, and in order to make the objects, technical solutions and advantages of the present application more apparent, the present application will be described in further detail below with reference to the accompanying drawings and the detailed embodiments. It should be understood that the particular embodiments described herein are meant to be illustrative of the application only and not limiting. It will be apparent to one skilled in the art that the present application may be practiced without some of these specific details. The following description of the embodiments is merely intended to provide a better understanding of the application by showing examples of the application.
It is noted that relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising … …" does not exclude the presence of other like elements in a process, method, article or apparatus that comprises the element.
The method, the device, the equipment and the medium for feeding the watchdog provided by the embodiment of the application are described in detail through specific embodiments and application scenes thereof by combining the attached drawings.
Fig. 1 is a schematic flow chart of a method for feeding a watchdog according to an embodiment of the present application. As shown in fig. 1, the watchdog feeding method may include:
step 101: the timing duration of the watchdog timer is acquired.
In some possible implementations of the embodiments of the present application, the timing duration of the watchdog timer may be set according to the time required for the program monitored by the watchdog to complete normal operation.
In some possible implementations of the embodiments of the present application, the timing duration of the watchdog timer may be slightly longer than the time required for the normal running of the program monitored by the watchdog timer to complete, that is, the difference between the timing duration of the watchdog timer and the time required for the normal running of the program monitored by the watchdog timer to complete is less than or equal to the first threshold. The first threshold is less and can be set according to actual requirements.
Illustratively, the time required for the watchdog to monitor the normal operation of the program is 10 milliseconds (ms), and the first threshold is 0.05ms. The timing duration of the watchdog timer may be any value less than or equal to 10.05ms but greater than 10ms, e.g., 10.01ms, 10.03, 10.045ms, etc.
Step 102: and determining the watchdog feeding period according to the timing duration of the watchdog timer.
In some possible implementations of embodiments of the application, any duration less than the timing duration of the watchdog timer may be considered a watchdog feeding period. The timing duration of the watchdog timer determines that the watchdog feeding period does not exceed the timing duration of the watchdog timer.
Step 103: when the watchdog feeding period expires during the execution of the target program, an interrupt function is called to execute the feeding operation on the watchdog.
In some possible implementations of the embodiments of the present application, the target program in the embodiments of the present application is a program monitored by a watchdog.
In some possible implementations of embodiments of the application, a watchdog may be used to monitor one or more programs. The program for watchdog monitoring can be set according to actual needs.
In some possible implementations of embodiments of the present application, the interrupt function in embodiments of the present application may be a function for performing a feeding operation on a watchdog, which may include feeding logic.
Illustratively, assuming that the watchdog monitor x is preset, the feeding period of the watchdog a, which is determined from the timing duration of the watchdog a, is 5ms.
In the course of executing the program x, the feeding operation is performed on the watchdog a every 5ms.
In the embodiment of the application, the timing duration of the watchdog timer is acquired; determining a watchdog feeding period according to the timing time length of the watchdog timer; when the watchdog feeding period expires during the execution of the target program, an interrupt function is called to execute the feeding operation on the watchdog. Therefore, the watchdog can be fed, the feeding code is not added in the program code, the code maintenance is convenient, and the code maintenance efficiency can be improved.
In some possible implementations of the embodiment of the present application, before step 103, the method for feeding a watchdog according to the embodiment of the present application may further include: interrupting the target program; accordingly, after step 103, the method for feeding a watchdog according to the embodiment of the present application may further include: the target program continues to be executed.
In the embodiment of the application, the target program is interrupted, so that the target program is not influenced when the watchdog is operated, and the smooth running of the target program is ensured.
In some possible implementations of the embodiments of the present application, the method for feeding a watchdog according to the embodiments of the present application may further include: and stopping performing the feeding operation on the watchdog when the number of times of performing the feeding operation on the watchdog reaches a preset number of times.
It will be appreciated that the preset number of times in the embodiments of the present application is the maximum number of feeding dogs for limiting feeding operations.
In some possible implementations of the embodiments of the present application, the preset number of times may be set according to actual requirements.
In some possible implementations of the embodiments of the present application, the preset number of times may also be determined based on the time required for the normal operation of the target program to complete and the watchdog feeding period.
In some possible implementations of the embodiments of the present application, the quotient of the time required for the normal operation of the target program to complete and the watchdog feeding period may be taken as the preset number of times.
Illustratively, assuming that the time required for the target program to complete normally is 50ms and the watchdog feeding period is 10ms, the preset number of times=50 ms/10 ms=5 times.
In the embodiment of the application, the situation that the watchdog cannot be reset due to the fact that the watchdog is fed after the program enters the dead loop, the deadlock or runs can be prevented.
In some possible implementations of the embodiments of the present application, the target program in the embodiments of the present application may be a BootLoader (BootLoader).
In some possible implementations of the embodiments of the present application, the method for feeding a watchdog according to the embodiments of the present application may further include: when updating the application program in the flash memory, the control interrupt function is not enabled; when the watchdog feeding period expires, a feeding operation is performed on the watchdog.
In some possible implementations of the embodiments of the present application, the control interrupt function is not enabled, i.e., the interrupt function is masked, and then the Flash Driver is entered. Although the interrupt function cannot be processed in the Flash Driver, the timer corresponding to the watchdog feeding period is still timing, and whether the timer reaches the watchdog feeding period can be judged by reading the value in the overflow flag register of the timer. When the value in the overflow flag register indicates overflow of the timer, the timer reaches a watchdog feeding period, at which time a feeding operation is performed on the watchdog, and then the overflow flag register is cleared for reset.
In the embodiment of the application, the influence of the interrupt function on Flash erasing or writing can be prevented, and the update of the application program in the Flash memory is ensured.
In some possible implementations of the embodiments of the present application, the method for feeding a watchdog according to the embodiments of the present application may further include: after updating the application program in the flash memory, the interrupt function is controlled to be enabled to perform a feeding operation on the watchdog through the interrupt function.
In some possible implementations of the embodiments of the present application, after the application program in the Flash memory is updated and exits the Flash Driver, the interrupt function is controlled to enable, and when the watchdog feeding period expires, the interrupt function is called to execute the feeding operation on the watchdog.
The following describes the watchdog feeding process in connection with the update brush process of the application program by BootLoader. As shown in fig. 2, fig. 2 is a schematic diagram of a process for feeding a watchdog according to an embodiment of the present application. The process of feeding the watchdog comprises the following steps:
step 201: chip power on/reset.
Step 202: initializing a BootLoader and setting a limit number of times for feeding dogs.
The BootLoader initialization includes pre-initialization and post-initialization, where the pre-initialization is responsible for initializing some hardware resources, such as clock resources, terminal resources, controller area network (Controller Area Network, CAN) communication resources, memory resources, and the like; the post-initialization is mainly used for initializing resources required by BootLoader writing.
Step 203: whether the reprogramming flag bit is true is determined, if yes, step 204 is executed, and if no, step 208 is executed.
Step 204: a programming session mode is entered.
In the programming session mode, the application program CAN be written through CAN communication.
Step 205: a determination is made as to whether the application needs to be updated, if so, step 206 is performed, and if not, step 207 is performed.
Step 206: and executing a brushing flow, and updating the application program in the Flash.
When the brushing flow is executed, after the interrupt function is shielded, the Flash Driver is entered, and the watchdog is executed with the watchdog feeding operation through the value in the overflow flag register of the timer corresponding to the watchdog feeding period.
Step 207: a determination is made as to whether a diagnostic service request has been received, and if so, step 201 is performed, and if not, step 205 is performed.
The diagnostic service request is used to trigger a chip power-on/reset. When the watchdog timer times to the watchdog feeding period, the watchdog feeding operation is not executed at the moment, the watchdog timer overflows overtime, and a reset signal is generated by the watchdog timer and sent to the chip to reset the chip.
Wherein, in the course of the loop of step 205 to step 207, when the watchdog timer reaches the watchdog feeding period, the feeding operation is executed; when the number of times of executing the feeding operation on the watchdog reaches the limit number of times of feeding the watchdog, the watchdog timer overflows overtime, and generates a reset signal to be sent to the chip, so that the chip is reset.
Step 208: a default session mode is entered.
Step 209: a determination is made as to whether an indication to enter a programming session mode has been received, if so, step 204 is performed, and if not, step 210 is performed.
Step 210: whether the application flag is true is determined, if yes, step 211 is executed, and if no, step 208 is executed.
Step 211: entering into application program operation.
Fig. 3 is a schematic diagram of a dog feeding process during Flash operation according to an embodiment of the present application. The process of feeding dogs during Flash operation comprises the following steps:
step 301: shielding interruption and entering a Flash Driver;
in some possible implementations of the embodiments of the present application, although interrupts are masked and interrupt functions cannot be handled in Flash drivers, the timer used to trigger interrupts is still running.
Step 302: feeding dogs through an overflow mark of a timer for triggering interruption, and resetting the overflow mark after the dogs are fed successfully.
In some possible implementations of the embodiments of the present application, in step 302, it may be determined whether the timer reaches the set time by reading an overflow flag register of the timer, when the timer generates the overflow flag, the timer indicates that the set time is reached, and feeding the dog at this time, and clears the overflow flag, so that feeding the dog is also performed when the set time is reached again. Moreover, the same timer is used for feeding dogs inside and outside the Flash Driver, so that the situation that the dogs are fed inside and outside the Flash Driver is not confused can be ensured.
Step 303: and exiting the Flash Driver, and enabling the interrupt.
In some possible implementations of the embodiments of the present application, after exiting Flash Driver, it is necessary to immediately interrupt so that the external dog feeding function can operate normally.
The embodiment of the application also provides a watchdog feeding device, as shown in fig. 4. Fig. 4 is a schematic structural diagram of a watchdog feeding device according to an embodiment of the present application, where the watchdog feeding device 400 may include:
an obtaining module 401, configured to obtain a timing duration of the watchdog timer;
a determining module 402, configured to determine a watchdog feeding period according to a timing duration of a watchdog timer;
the first watchdog feeding module 403 is configured to call an interrupt function to perform a watchdog feeding operation on a watchdog when a watchdog feeding period expires during execution of the target program.
In the embodiment of the application, the timing duration of the watchdog timer is acquired; determining a watchdog feeding period according to the timing time length of the watchdog timer; when the watchdog feeding period expires during the execution of the target program, an interrupt function is called to execute the feeding operation on the watchdog. Therefore, the watchdog can be fed, the feeding code is not added in the program code, the code maintenance is convenient, and the code maintenance efficiency can be improved.
In some possible implementations of the embodiments of the present application, the watchdog feeding device 400 provided by the embodiments of the present application may further include:
the interrupt module is used for interrupting the target program before calling the interrupt function to execute the feeding operation on the watchdog;
and the execution module is used for continuing to execute the target program after calling the interrupt function to execute the feeding operation on the watchdog.
In the embodiment of the application, the target program is interrupted, so that the target program is not influenced when the watchdog is operated, and the smooth running of the target program is ensured.
In some possible implementations of the embodiments of the present application, the watchdog feeding device 400 provided by the embodiments of the present application may further include:
and the stopping module is used for stopping the dog feeding operation on the watchdog when the number of times of the dog feeding operation on the watchdog reaches the preset number of times.
In the embodiment of the application, the situation that the watchdog cannot be reset due to the fact that the watchdog is fed after the program enters the dead loop, the deadlock or runs can be prevented.
In some possible implementations of the embodiments of the present application, the preset number of times is determined based on the time required for the target program to complete its normal operation and the watchdog feeding period.
In some possible implementations of embodiments of the application, the target program includes:
the loader is booted.
In some possible implementations of the embodiments of the present application, the watchdog feeding device 400 provided by the embodiments of the present application may further include:
the control module is used for controlling the interrupt function not to be enabled when the application program in the flash memory is updated;
and the second dog feeding module is used for executing a dog feeding operation on the watchdog when the dog feeding period expires.
In the embodiment of the application, the influence of the interrupt function on Flash erasing or writing can be prevented, and the update of the application program in the Flash memory is ensured.
In some possible implementations of embodiments of the application, the control module may also be configured to:
after updating the application program in the flash memory, the interrupt function is controlled to be enabled to perform a feeding operation on the watchdog through the interrupt function.
Fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
The electronic device may include a processor 501 and a memory 502 storing computer program instructions.
In particular, the processor 501 may include a central processing unit (Central Processing Unit, CPU), or an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), or may be configured as one or more integrated circuits implementing embodiments of the present application.
Memory 502 may include mass storage for data or instructions. By way of example, and not limitation, memory 502 may comprise a Hard Disk Drive (HDD), floppy Disk Drive, flash memory, optical Disk, magneto-optical Disk, magnetic tape, or universal serial bus (Universal Serial Bus, USB) Drive, or a combination of two or more of the foregoing. Memory 502 may include removable or non-removable (or fixed) media, where appropriate. Memory 502 may be internal or external to the electronic device, where appropriate. In some particular embodiments, the memory 502 is a non-volatile solid-state memory.
In some particular embodiments, the Memory may include Read-Only Memory (ROM), random access Memory (Random Access Memory, RAM), magnetic disk storage media devices, optical storage media devices, flash Memory devices, electrical, optical, or other physical/tangible Memory storage devices. Thus, in general, the memory comprises one or more tangible (non-transitory) computer-readable storage media (e.g., memory devices) encoded with software comprising computer-executable instructions and when the software is executed (e.g., by one or more processors) it is operable to perform the operations described with reference to the watchdog feeding method according to the present application.
The processor 501 reads and executes the computer program instructions stored in the memory 502 to implement the watchdog feeding method provided by the embodiment of the present application.
In one example, the electronic device may also include a communication interface 503 and a bus 510. As shown in fig. 5, the processor 501, the memory 502, and the communication interface 503 are connected to each other by a bus 510 and perform communication with each other.
The communication interface 503 is mainly used to implement communication between each module, apparatus, unit and/or device in the embodiments of the present application.
Bus 510 includes hardware, software, or both that couple components of the electronic device to one another. By way of example, and not limitation, the buses may include an accelerated graphics port (Accelerated Graphics Port, AGP) or other graphics Bus, an enhanced industry standard architecture (Extended Industry Standard Architecture, EISA) Bus, a Front Side Bus (FSB), a HyperTransport (HT) interconnect, an industry standard architecture (Industry Standard Architecture, ISA) Bus, an Infiniband interconnect, a Low Pin Count (LPC) Bus, a memory Bus, a micro channel architecture (Micro channel architecture, MCa) Bus, a peripheral component interconnect (Peripheral Component Interconnect, PCI) Bus, a PCI-Express (PCI-X) Bus, a serial advanced technology attachment (Serial Advanced Technology Attachment, SATA) Bus, a video electronics standards association local (Video electronics standards association Local Bus, VLB) Bus, or other suitable Bus, or a combination of two or more of these. Bus 510 may include one or more buses, where appropriate. Although embodiments of the application have been described and illustrated with respect to a particular bus, the application contemplates any suitable bus or interconnect.
The electronic equipment can execute the watchdog feeding method provided by the embodiment of the application, so that the corresponding technical effects of the watchdog feeding method provided by the embodiment of the application are realized.
In addition, in combination with the watchdog feeding method in the above embodiment, the embodiment of the application further provides a computer readable storage medium for realizing. The computer readable storage medium has stored thereon computer program instructions; the computer program instructions, when executed by the processor, implement the watchdog feeding method provided by the embodiments of the present application. Examples of computer readable storage media include non-transitory computer readable media such as ROM, RAM, magnetic or optical disks, and the like.
The embodiment of the application provides a computer program product, and when instructions in the computer program product are executed by a processor of an electronic device, the electronic device is caused to execute the watchdog feeding method provided by the embodiment of the application, and the same technical effects can be achieved, so that repetition is avoided, and the description is omitted here.
It should be understood that the application is not limited to the particular arrangements and instrumentality described above and shown in the drawings. For the sake of brevity, a detailed description of known methods is omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method processes of the present application are not limited to the specific steps described and shown, and those skilled in the art can make various changes, modifications and additions, or change the order between steps, after appreciating the spirit of the present application.
The functional blocks shown in the above-described structural block diagrams may be implemented in hardware, software, firmware, or a combination thereof. When implemented in hardware, it may be, for example, an electronic circuit, an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), suitable firmware, a plug-in, a function card, or the like. When implemented in software, the elements of the application are the programs or code segments used to perform the required tasks. The program or code segments may be stored in a machine readable medium or transmitted over transmission media or communication links by a data signal carried in a carrier wave. A "machine-readable medium" may include any medium that can store or transfer information. Examples of machine-readable media include electronic circuitry, semiconductor Memory devices, ROM, flash Memory, erasable programmable read-Only Memory (Erasable Read Only Memory, EROM), floppy disks, compact discs (Compact Disc Read-Only Memory, CD-ROM), optical disks, hard disks, fiber optic media, radio Frequency (RF) links, and the like. The code segments may be downloaded via computer networks such as the internet, intranets, etc.
It should also be noted that the exemplary embodiments mentioned in this disclosure describe some methods or systems based on a series of steps or devices. However, the present application is not limited to the order of the above-described steps, that is, the steps may be performed in the order mentioned in the embodiments, or may be performed in a different order from the order in the embodiments, or several steps may be performed simultaneously.
Aspects of the present disclosure are described above with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the disclosure. It will be understood that each block of the flowchart illustrations and/or block diagrams, and combinations of blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, enable the implementation of the functions/acts specified in the flowchart and/or block diagram block or blocks. Such a processor may be, but is not limited to being, a general purpose processor, a special purpose processor, an application specific processor, or a field programmable logic circuit. It will also be understood that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware which performs the specified functions or acts, or combinations of special purpose hardware and computer instructions.
In the foregoing, only the specific embodiments of the present application are described, and it will be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working processes of the systems, modules and units described above may refer to the corresponding processes in the foregoing method embodiments, which are not repeated herein. It should be understood that the scope of the present application is not limited thereto, and any equivalent modifications or substitutions can be easily made by those skilled in the art within the technical scope of the present application, and they should be included in the scope of the present application.

Claims (10)

1. A method of feeding a watchdog, the method comprising:
acquiring the timing time length of a watchdog timer;
determining a watchdog feeding period according to the timing duration;
and calling an interrupt function to execute a feeding operation on the watchdog when the feeding period of the watchdog expires in the process of executing the target program.
2. The method of claim 1, wherein before the invoking the interrupt function performs a feeding operation on the watchdog, the method further comprises:
interrupting the target program;
after the calling interrupt function performs a feeding operation on the watchdog, the method further includes:
and continuing to execute the target program.
3. The method according to claim 1, wherein the method further comprises:
and stopping executing the feeding operation on the watchdog when the number of times of executing the feeding operation on the watchdog reaches a preset number of times.
4. A method according to claim 3, wherein the predetermined number of times is determined based on the time required for the normal operation of the target program to be completed and the watchdog feeding period.
5. The method of claim 1, wherein the target program comprises:
the loader is booted.
6. The method of claim 5, wherein the method further comprises:
when updating the application program in the flash memory, controlling the interrupt function not to be enabled;
and when the watchdog feeding period expires, performing a feeding operation on the watchdog.
7. The method of claim 6, wherein the method further comprises:
and after updating the application program in the flash memory, controlling the interrupt function to be enabled so as to execute the feeding operation on the watchdog through the interrupt function.
8. A watchdog feeding device, the device comprising:
the acquisition module is used for acquiring the timing time length of the watchdog timer;
the determining module is used for determining the watchdog feeding period according to the timing duration;
and the first dog feeding module is used for calling an interrupt function to execute a dog feeding operation on the watchdog when the dog feeding period expires in the process of executing the target program.
9. An electronic device, the electronic device comprising: a processor and a memory storing computer program instructions;
the processor reads and executes the computer program instructions to implement the watchdog feeding method of any of the claims 1-7.
10. A computer readable storage medium having stored thereon computer program instructions which when executed by a processor implement the watchdog feeding method of any of claims 1-7.
CN202310927097.XA 2023-07-26 2023-07-26 Watchdog feeding method, device, equipment and medium Pending CN117093249A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310927097.XA CN117093249A (en) 2023-07-26 2023-07-26 Watchdog feeding method, device, equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310927097.XA CN117093249A (en) 2023-07-26 2023-07-26 Watchdog feeding method, device, equipment and medium

Publications (1)

Publication Number Publication Date
CN117093249A true CN117093249A (en) 2023-11-21

Family

ID=88774341

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310927097.XA Pending CN117093249A (en) 2023-07-26 2023-07-26 Watchdog feeding method, device, equipment and medium

Country Status (1)

Country Link
CN (1) CN117093249A (en)

Similar Documents

Publication Publication Date Title
US4405982A (en) Arrangement for monitoring the function of a programmable electronic switching circuit
US4752930A (en) Watch dog timer
US8291205B2 (en) Method for managing the reset of a data processor
KR100405843B1 (en) Method and apparatus for selectively controlling interrupt latency in a data processing system
CN106776054A (en) A kind of deadlock detection method, device and circuit
US20200311000A1 (en) Processor and interrupt controller
CN110262920B (en) Linux system external watchdog indirect feeding method, watchdog feeding agent driving module and watchdog system
CN104391754A (en) Method and device for processing task exception
CN117093249A (en) Watchdog feeding method, device, equipment and medium
CN109960599B (en) Chip system, watchdog self-checking method thereof and electrical equipment
CN116450306B (en) Task scheduling method, device, equipment, storage medium and product
CN112947841A (en) Method, device, equipment and storage medium for reading embedded flash memory data
CN110858178A (en) Memory recovery method, device, equipment and medium
US7172129B2 (en) Integrated circuit card capable of automatically transmitting NULL byte information without intervention by CPU
CN118733233A (en) Thread management method, device, equipment, readable storage medium and vehicle
US20150220465A1 (en) Speculative interrupt signalling
CN116820893A (en) Time protection method and device
CN116755853A (en) System timer interrupt processing method, device, equipment and medium
CN118295769A (en) Kubernetes-based task flow execution method, kubernetes-based task flow execution device, kubernetes-based task flow execution apparatus, kubernetes-based task flow execution device, kubernetes-based task flow execution medium, kubernetes-based task flow execution program product
US20210303379A1 (en) Device and method for monitoring functional saffety in integrated circuits (ics)
CN117149544A (en) Microprocessor debugging method, device, equipment and medium
CN118152157A (en) Deadlock processing method, device, equipment, medium and vehicle of I2C bus
US20240007486A1 (en) Signal detection apparatus, vehicle, and method
CN1328635C (en) Data processing apparatus
JP2944543B2 (en) Interrupt control device

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