Watchdog implementation method and device of high-reliability system

By defining and verifying process phase monitoring elements of the program for the processor in a high-reliability system, the problem of detecting unexpected branches and illegal peripheral operations of the program is solved, and multi-dimensional verification of the program and high reliability of the watchdog are achieved. monitor.

CN118672816APending Publication Date: 2024-09-20XIAN KEYWAY TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410663306.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-27
Publication Date
2024-09-20

AI Technical Summary

Technical Problem

The existing technology cannot effectively detect whether the program enters an unexpected branch or illegally operates peripherals in a high-reliability system, affecting the monitoring effect of the watchdog.

Method used

By setting the program on the processor side into several predictable process stages, defining monitoring elements such as execution sequence number, ID, execution time and legal access peripheral set, establishing a list and synchronously outputting it when the program is running, the watchdog side Verify the program's time window, execution sequence and peripheral access, and perform a reset if it exceeds the preset range.

Benefits of technology

It realizes multi-dimensional verification of the program running status, can detect whether the program enters unexpected branches and illegally operates peripherals, and improves the detection capability and reliability of the watchdog.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118672816A
    Figure CN118672816A
Patent Text Reader

Abstract

A watchdog implementation method and device for a high-reliability system belong to the technical field of software watchdogs, and are characterized in that a program at a processor end is set as a plurality of predictable process stages, and monitoring elements including an execution sequence number, an ID, execution time and a legal access peripheral set are defined for each process stage; establishing a list according to the monitoring elements defined in each process stage; sequentially executing the program according to the list after the program runs, and synchronously outputting a corresponding ID to the watchdog in each process stage; whether a program running state is abnormal or not is verified by adopting three dimensions of program execution time window verification, program process sequence verification and program access peripheral permission verification, and the problem of judging whether a program enters an unexpected branch or not is solved through program process sequence verification. The problem of judging whether the program illegally operates the peripheral or not is solved through program access peripheral permission verification, the detection that the program enters the unexpected branch and the detection that the program illegally operates the peripheral can be completed, and the operation is simple and reliable.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of software watchdog, and in particular relates to a watchdog implementation method and device for a high-reliability system. Background Art

[0002] In high-reliability system applications, programs are required to have very good reliability and no unexpected states are allowed to occur. Currently, common watchdog monitoring methods for program operation abnormalities in this field include timeout reset, time window reset, response timeout or error reset, etc. However, these traditional solutions have some defects in high-reliability system applications, such as being unable to detect whether the program enters an unexpected branch or whether the program illegally operates peripherals, which affects the application of watchdogs in high-reliability systems. Summary of the invention

[0003] The present invention aims to solve the above problems and provides a method and device for implementing a watchdog in a high-reliability system.

[0004] In a first aspect, the present invention discloses a watchdog implementation method for a high-reliability system, which sets a program on a processor end into several predictable process stages, and defines monitoring elements for each process stage: execution sequence number, ID, execution time, and a set of legally accessible peripherals; Create a list based on the monitoring elements defined in each process stage; execute the program in sequence according to the list after it is run, and output the corresponding ID to the watchdog synchronously at each process stage; The watchdog end retrieves the aforementioned monitoring elements to determine whether the program running on the processor end is within a preset time window, whether it is in a preset execution order, and whether an illegal peripheral is accessed.

[0005] Furthermore, the watchdog implementation method of the high-reliability system of the present invention determines whether the program running on the processor side is within a preset time window, including: obtaining the shortest and longest running time of each process stage of the program on the processor side by calculating and testing in advance, which is defined as the execution time in the aforementioned monitoring element; The watchdog determines whether the duration of the process stage is within the execution time window by detecting the duration of the ID. If it exceeds the window, it is determined that the program execution time window verification has failed and the watchdog performs a reset action.

[0006] Furthermore, the watchdog implementation method of the high-reliability system described in the present invention determines whether the program running on the processor side is in a preset execution order, including: the watchdog determines the program execution order based on the execution sequence number and ID in the acquired monitoring element, and if the order is wrong, it is determined that the program flow sequence verification has failed, and the watchdog performs a reset action.

[0007] Furthermore, the watchdog implementation method of the high-reliability system described in the present invention determines whether the program running on the processor side has accessed illegal peripherals, including: the watchdog determines the peripherals accessed by the ID based on the set of legally accessed peripherals in the acquired monitoring element; if it is detected that the ID has accessed an illegal peripheral, it is determined that the program access peripheral permission verification has failed, and the watchdog performs a reset action.

[0008] In a second aspect, the present invention discloses a watchdog implementation device for a high-reliability system, comprising a memory, a processor and a programmable circuit; the memory is used to store a computer program; the processor and the programmable circuit are used to implement the watchdog implementation method for the high-reliability system as described in the first aspect above when executing the computer program.

[0009] A watchdog implementation method and device for a high-reliability system can meet the needs of a high-reliability system, and uses three dimensions: program execution time window verification, program flow sequence verification, and program access peripheral authority verification to verify whether the program running status is abnormal. The program flow sequence verification is used to solve the problem of determining whether the program enters an unexpected branch, and the program access peripheral authority verification is used to solve the problem of determining whether the program illegally operates peripherals. The method and device can complete the detection of the program entering an unexpected branch and the detection of the program illegally operating peripherals, and the operation is simple and reliable. BRIEF DESCRIPTION OF THE DRAWINGS

[0010] Figure 1 This is a schematic diagram of the implementation principle of the watchdog according to an embodiment of the present invention; Figure 2 This is a schematic diagram of the execution time window verification process according to an embodiment of the present invention; Figure 3 A schematic diagram of a process sequence verification process according to an embodiment of the present invention; Figure 4 The figure is a schematic diagram of the illegal access to peripheral device verification process according to an embodiment of the present invention. DETAILED DESCRIPTION

[0011] The following is a detailed description of the watchdog implementation method and device of the high-reliability system of the present invention in conjunction with the accompanying drawings and embodiments.

[0012] Embodiment 1 This embodiment discloses a watchdog implementation method for a high-reliability system. Figure 1The watchdog implementation structure shown uses an external programmable circuit to monitor the status of the monitored processor program, and resets the monitored processor if an abnormality is detected. The external programmable circuit and the monitored processor are interconnected by a signal line, so that the external programmable circuit can obtain the current process ID of the monitored processor and the peripheral access signal that needs to be monitored. The watchdog function described in this embodiment is implemented with the cooperation of the external programmable circuit program and the program for monitoring the monitored processor, including: setting the program on the processor end to several predictable process stages, defining monitoring elements for each process stage: execution sequence number, ID, execution time and legal access peripheral set; establishing a list according to the monitoring elements defined in each process stage; after the program is run, it is executed sequentially according to the list, and each process stage synchronously outputs the corresponding ID to the watchdog; the watchdog end calls the aforementioned monitoring elements to judge whether the program running on the processor end is within the preset time window, whether it is the preset execution order, and whether illegal peripherals are accessed.

[0013] In the embodiment of the present disclosure, judging whether the program running on the processor side is within the preset time window includes: obtaining the shortest time and the longest time of running by calculating and testing each process stage of the program on the processor side in advance, which is defined as the execution time in the aforementioned monitoring element; The watchdog detects the duration of the ID to determine whether the time taken by the process stage is within the execution time window. If it exceeds the window, the program execution time window verification fails and the watchdog performs a reset action. Figure 2 As shown, Figure 2 As shown in (a), the time when process ID2 switches to process ID3 is within the time range of window 2MIN and window 2MAX, which is consistent with the program execution time; Figure 2 As shown in (b), the time it takes for process ID2 to switch to process ID3 exceeds the maximum execution time window 2MAX, resulting in an abnormal switch and triggering the watchdog to perform a reset action.

[0014] In the disclosed embodiment, judging whether the program running on the processor side is in the preset execution order includes: the watchdog judges the execution order of the program according to the execution sequence number and ID in the acquired monitoring element, and if the order is wrong, it is judged that the program flow sequence verification fails, and the watchdog performs a reset action. Figure 3 As shown, Figure 3 (a) The program shown is executed in the order of process ID0-process ID4, and the ID is sent to the watchdog in the execution order, which complies with the execution order rule; Figure 3 The program shown in (b) sends ID4 to the watchdog when process ID1 switches to ID2. That is, the watchdog receives the switch from process ID1 to ID4, which does not conform to the execution order, thus triggering the watchdog to perform a reset action.

[0015] At the same time, in the disclosed embodiment, judging whether the program running on the processor has accessed an illegal peripheral includes: the watchdog judges the peripheral accessed by the ID according to the legal access peripheral set in the acquired monitoring element, and if it is detected that the ID has accessed an illegal peripheral, it is determined that the program access to the peripheral permission verification has failed, and the watchdog performs a reset action. Figure 4 As shown, the access peripherals corresponding to program flow ID0-flow ID4 are set as peripheral 0-peripheral 4; Figure 4 (a) As shown, processes ID0 to ID4 perform compliant access to the peripherals according to the preset access rules; Figure 4 As shown in (b), process ID2 corresponds to peripheral 2. The process ID2 that gives feedback to the watchdog accesses peripheral 4, which does not comply with the legal set of accessed peripherals, triggering the watchdog to perform a reset action.

[0016] The watchdog implementation method of the high-reliability system described in this embodiment can complete the detection of the program entering an unexpected branch and the detection of the program illegally operating a peripheral device by improving the detection function of the watchdog.

[0017] Embodiment 2 The present embodiment discloses a watchdog implementation device for a high-reliability system, including a memory, a processor, and a programmable circuit; the memory is used to store a computer program; the processor and the programmable circuit are used to implement the watchdog implementation method for the high-reliability system as described in the above-mentioned embodiment 1 when executing the computer program. The specific implementation method is the same as that in the above-mentioned embodiment 1 and will not be repeated here.

[0018] In the above embodiments, all or part of the embodiments may be implemented by software, hardware, firmware, or any combination thereof. When implemented by software, all or part of the embodiments may be implemented in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of the present application are generated.

Claims

1. A watchdog implementation method for a high-reliability system. Features: The program on the processor side is set into several predictable process stages, and monitoring elements are defined for each process stage: execution sequence number, ID, execution time and legal access peripheral set; Create a list based on the monitoring elements defined in each process stage; execute the program in sequence according to the list after it is run, and output the corresponding ID to the watchdog synchronously at each process stage; The watchdog end retrieves the aforementioned monitoring elements to determine whether the program running on the processor end is within a preset time window, whether it is in a preset execution order, and whether an illegal peripheral is accessed.

2. The watchdog implementation method of the high reliability system according to claim 1, It is characterized in that The judgment of whether the program running on the processor side is within the preset time window includes: obtaining the shortest and longest running time of each process stage of the program on the processor side by calculating and testing in advance, which is defined as the execution time in the aforementioned monitoring element; The watchdog determines whether the duration of the process stage is within the execution time window by detecting the duration of the ID. If it exceeds the window, it is determined that the program execution time window verification has failed and the watchdog performs a reset action.

3. The watchdog implementation method of the high reliability system according to claim 1, It is characterized in that Judging whether the program running on the processor side is in the preset execution order includes: the watchdog judges the program execution order according to the execution sequence number and ID in the acquired monitoring element. If the order is wrong, it is determined that the program flow sequence verification fails, and the watchdog performs a reset action.

4. The watchdog implementation method of the high reliability system according to claim 1, It is characterized in that Judging whether the program running on the processor end has accessed illegal peripherals includes: the watchdog judges the peripherals accessed by the ID based on the legal access peripheral set in the acquired monitoring element. If it is detected that the ID has accessed an illegal peripheral, it is determined that the program access peripheral permission verification has failed, and the watchdog performs a reset action.

5. A watchdog implementation device for a high-reliability system, It is characterized in that It comprises a memory, a processor and a programmable circuit; the memory is used to store a computer program; the processor and the programmable circuit are used to implement the watchdog implementation method of the high-reliability system as described in any one of claims 1-4 when executing the computer program.