External watchdog circuit of single-chip microcomputer and use method

By designing the external watchdog circuit of the microcontroller in the edge computing box, using heartbeat detection and power control, the problem that the edge computing box cannot automatically restart when voltage abnormality in harsh environments is solved, and the stability and reliability of the system are improved.

CN120011116APending Publication Date: 2025-05-16SHANGHAI DIANZE INTELLIGENT TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411980917.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-31
Publication Date
2025-05-16

AI Technical Summary

Technical Problem

When the voltage of the edge computing box is abnormal in harsh environments, the built-in watchdog cannot be reset, causing the operating system to fail to start normally.

Method used

Design a single-chip external watchdog circuit, including a normally closed relay, a single-chip and a temperature sensor, connected to the edge computing box through the RS232 serial port, to realize heartbeat detection and power control, ensuring that the system can be automatically restarted when voltage is abnormal.

Benefits of technology

Improve the stability and reliability of edge computing boxes in harsh environments, ensure that the system can automatically recover under abnormal voltage conditions, and avoid equipment crashes caused by abnormal voltages.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120011116A_ABST
    Figure CN120011116A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of edge computing box watchdogs, and discloses an external watchdog circuit based on a single chip microcomputer. Comprising a hardware watchdog circuit, a first power supply, a second power supply and an edge calculation box, the hardware watchdog circuit comprises a normally-closed relay, a single-chip microcomputer and a temperature sensor, the normally-closed relay and the temperature sensor are electrically connected with the single-chip microcomputer at the same time, and the first power supply supplies power to the edge calculation box through the normally-closed relay; the second power supply is used for supplying power to the single-chip microcomputer, and the edge calculation unit is electrically connected with the single-chip microcomputer through an RS232 serial port; the circuit has the advantages of simple and stable circuit structure and high safety coefficient.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of edge computing box systems, and in particular to an external watchdog circuit for a single-chip microcomputer and a method for using the same. Background Art

[0002] With the development of information technology, commercial computer equipment has gradually been divided into two categories: central servers and edge computing boxes. Edge computing boxes are popular in the market for their low cost, small size, low power consumption, and ease of distributed deployment.

[0003] Compared with central servers, edge computing boxes are usually deployed in non-professional computer room environments, including outdoor information boxes, industrial production sites, and even mobile deployments, powered by batteries and solar cells. Non-professional computer rooms also have poor heat dissipation, which can lead to hardware crashes. Such environments pose a significant impact and challenge to the stable operation of edge computing box systems.

[0004] In order to ensure the stable operation of the edge computing box system, newer or high-end chipsets on the market provide built-in hardware watchdog solutions. When the watchdog stops feeding, the operating system will be automatically restarted.

[0005] The current mainstream chipset has a built-in watchdog, which has no voltage detection function. If the voltage is abnormal, it cannot be reset, such as when the device suddenly loses power to 2V and then recovers to 3.3V. In this case, the watchdog does not work, and the operating system cannot start normally after the power is turned off.

[0006] If the production environment is harsh, the current and voltage are unstable, or if batteries and solar energy are used for outdoor power supply, voltage abnormalities may occur. At this time, the edge computing box cannot work properly.

[0007] Therefore, an external watchdog circuit for a single-chip microcomputer and a method for using the same are provided to solve the above problems. Summary of the invention

[0008] The main purpose of the present invention is to solve the problem in the prior art that the mainstream chipsets of edge computing boxes generally do not have a built-in watchdog. Even if a watchdog is built-in, due to the lack of voltage detection function, if the voltage is abnormal and cannot be reset, the watchdog still does not work, and the operating system cannot start normally after power failure. In addition, the production environment is relatively harsh, the current and voltage are unstable, or batteries + solar energy are used for power supply outdoors, which will encounter voltage abnormalities and the edge computing boxes cannot work normally.

[0009] A first aspect of the present invention provides an external watchdog circuit of a single-chip microcomputer, the external watchdog circuit of the single-chip microcomputer comprising: A hardware watchdog circuit, a first power supply, a second power supply and an edge computing box. The hardware watchdog circuit includes a normally closed relay, a single-chip microcomputer and a temperature sensor. The normally closed relay and the temperature sensor are electrically connected to the single-chip microcomputer at the same time. The first power supply supplies power to the edge computing box through the normally closed relay; the second power supply is used to power the single-chip microcomputer. The edge computing is electrically connected to the single-chip microcomputer through the RS232 serial port.

[0010] Optionally, the single-chip microcomputer is MS-8051, and the single-chip microcomputer is used to obtain temperature value information collected by the temperature sensor, and the single-chip microcomputer is used to send heartbeat information to the edge computing box.

[0011] Optionally, the relay is SRD-05VDC-SL-C.

[0012] Optionally, the first power supply is 12V and the second power supply is 5V.

[0013] Optionally, the normally closed relay, the single chip microcomputer and the temperature sensor are all fixedly arranged on a PCB circuit board and are electrically connected through a circuit on the PCB circuit board.

[0014] Optionally, the temperature sensor is DS18B20.

[0015] A second aspect of the present invention provides a method for using an external watchdog circuit based on a single chip microcomputer, comprising: The temperature sensor obtains temperature value information, and the temperature sensor sends the temperature value information to the single chip microcomputer; The MCU receives the temperature value information sent by the temperature sensor. The MCU generates heartbeat information every 60 seconds based on the temperature value information. The MCU sends the heartbeat information to the edge computing box through the RS232 serial port. The MCU determines whether the response information sent by the edge computing box is received. If so, it returns to the previous step. If not, it determines whether the response information sent by the edge computing box is not received for more than 180 seconds after the heartbeat information is sent. If so, the MCU generates a disconnection command and sends it to the normally closed relay. The normally closed relay receives the disconnection instruction and executes the disconnection instruction; The microcontroller generates an open command three seconds after sending the open command, and sends the open command to the normally closed relay; The normally closed relay receives an open command and executes the open command.

[0016] Optionally, also include: If the single-chip computer determines that it has not received a response message from the edge computing box for more than 180 seconds after sending the heartbeat message, the single-chip computer returns to the step of determining whether the response message sent by the edge computing box is received.

[0017] Optionally, before the microcontroller sends a disconnection instruction to the normally closed relay, the following steps are also included: The single-chip microcomputer determines whether it is the first time to send a disconnection command within 24 hours. If so, it continues to send a disconnection command to the normally closed relay. If not, the single-chip microcomputer sends a disconnection command to the normally closed relay. The single-chip microcomputer generates an error command and sends the error command to the edge computing box.

[0018] Optionally, the five heartbeat messages after the single chip microcomputer sends the disconnection instruction all include the power-off execution information.

[0019] In the technical solution of the present invention, a watchdog scheme is implemented using a single-chip microcomputer, with a simple circuit structure, sophisticated program design, and high overall reliability; a temperature sensor is integrated to improve the reliability of the user's program, enabling it to actively avoid risks in high temperature scenarios; when transmitting data, a two-module redundancy scheme is adopted to further improve the reliability of the watchdog; the traditional watchdog scheme is that the user first initializes the system instructions and initiates the dog feeding operation, while this scheme does the opposite, with the watchdog first initiating an operation instruction and using the received reply as the dog feeding operation, thereby avoiding the situation where the edge computing box cannot be started due to voltage abnormalities, and the scheme can recover automatically. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] Figure 1 It is a structural diagram of the present invention; Figure 2 It is a flow chart of the present invention. DETAILED DESCRIPTION

[0021] An embodiment of the present invention provides an external watchdog circuit based on a single-chip microcomputer, including a hardware watchdog circuit, a first power supply, a second power supply and an edge computing box. The hardware watchdog circuit includes a normally closed relay, a single-chip microcomputer and a temperature sensor. The normally closed relay and the temperature sensor are electrically connected to the single-chip microcomputer at the same time. The first power supply supplies power to the edge computing box through the normally closed relay; the second power supply is used to power the single-chip microcomputer, and the edge computing is electrically connected to the single-chip microcomputer through an RS232 serial port. The present invention solves the problem in the prior art that questions still need to be manually created when creating exams every day. This method greatly wastes the working time of operators, and each setting of exam questions requires a lot of energy and is extremely inefficient.

[0022] The terms "first", "second", "third", "fourth", etc. (if any) in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "including" or "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0023] For ease of understanding, the specific process of the embodiment of the present invention is described below. Figure 1 and 2 In the embodiment of the present invention, the first embodiment of the external watchdog circuit based on the single chip microcomputer includes: Obtain the topic creation information, and save the topic to the pending review list or the reviewed list according to the topic creation information; specifically including: The hardware watchdog circuit, the first power supply, the second power supply and the edge computing box, the hardware watchdog circuit includes a normally closed relay, a single-chip microcomputer and a temperature sensor, the normally closed relay and the temperature sensor are electrically connected to the single-chip microcomputer at the same time, the first power supply supplies power to the edge computing box through the normally closed relay; the second power supply is used to supply power to the single-chip microcomputer, and the edge computing is electrically connected to the single-chip microcomputer through the RS232 serial port. The watchdog solution is implemented using a single-chip microcomputer, the circuit structure is simple, and the overall reliability is high.

[0024] The single-chip microcomputer is MS-8051, and the single-chip microcomputer is used to obtain the temperature value information collected by the temperature sensor, and the single-chip microcomputer is used to send heartbeat information to the edge computing box.

[0025] The relay is SRD-05VDC-SL-C.

[0026] The first power supply is 12V, and the second power supply is 5V.

[0027] The normally closed relay, the single chip microcomputer and the temperature sensor are all fixedly arranged on a PCB circuit board and are electrically connected through a circuit on the PCB circuit board.

[0028] The temperature sensor is DS18B20.

[0029] See also Figure 1 and 2The second embodiment of the external watchdog circuit and the use method of the single chip microcomputer in the embodiment of the present invention includes: The hardware watchdog circuit, the first power supply, the second power supply and the edge computing box, the hardware watchdog circuit includes a normally closed relay, a single-chip microcomputer and a temperature sensor, the normally closed relay and the temperature sensor are electrically connected to the single-chip microcomputer at the same time, the first power supply supplies power to the edge computing box through the normally closed relay; the second power supply is used to supply power to the single-chip microcomputer, and the edge computing is electrically connected to the single-chip microcomputer through the RS232 serial port. The watchdog solution is implemented using a single-chip microcomputer, the circuit structure is simple, and the overall reliability is high The single-chip microcomputer is MS-8051, and the single-chip microcomputer is used to obtain the temperature value information collected by the temperature sensor, and the single-chip microcomputer is used to send heartbeat information to the edge computing box.

[0030] The relay is SRD-05VDC-SL-C.

[0031] The first power supply is 12V, and the second power supply is 5V.

[0032] The normally closed relay, the single chip microcomputer and the temperature sensor are all fixedly arranged on a PCB circuit board and are electrically connected through a circuit on the PCB circuit board.

[0033] The temperature sensor is DS18B20. The integrated temperature sensor improves the reliability of the user's program and enables it to actively avoid risks in high temperature scenarios.

[0034] A method for using an external watchdog circuit based on a single-chip microcomputer, which is used for the external watchdog circuit based on a single-chip microcomputer as described above, comprises: The temperature sensor obtains temperature value information, and the temperature sensor sends the temperature value information to the single chip microcomputer; The MCU receives the temperature value information sent by the temperature sensor. The MCU generates heartbeat information every 60 seconds based on the temperature value information. The MCU sends the heartbeat information to the edge computing box through the RS232 serial port. The MCU determines whether the response information sent by the edge computing box is received. If so, it returns to the previous step. If not, it determines whether the response information sent by the edge computing box is not received for more than 180 seconds after the heartbeat information is sent. If so, the MCU generates a disconnection command and sends it to the normally closed relay. The normally closed relay receives the disconnection instruction and executes the disconnection instruction; The microcontroller generates an open command three seconds after sending the open command, and sends the open command to the normally closed relay; The normally closed relay receives an open command and executes the open command.

[0035] Also includes: If the single-chip computer determines that it has not received a response message from the edge computing box for more than 180 seconds after sending the heartbeat message, the single-chip computer returns to the step of determining whether the response message sent by the edge computing box is received.

[0036] Before the microcontroller sends a disconnect command to the normally closed relay, it also includes: The single-chip microcomputer determines whether it is the first time to send a disconnection command within 24 hours. If so, it continues to send a disconnection command to the normally closed relay. If not, the single-chip microcomputer sends a disconnection command to the normally closed relay. The single-chip microcomputer generates an error command and sends the error command to the edge computing box.

[0037] The five heartbeat messages after the microcontroller sends the disconnection command all include the execution power-off information.

[0038] Implementation principle: Use a single-chip microcomputer (such as MS-8051) to read the temperature value of the temperature sensor (such as DS18B20), and send an 8-bit heartbeat message to the edge computing box through the RS232 serial port every 60 seconds. The heartbeat message contains the temperature, and a reply can be received after the heartbeat message is sent. If there is no response for more than 180 seconds, the normally closed relay (such as SRD-05VDC-SL-C) is disconnected, and the relay is opened after 3 seconds.

[0039] The first power supply (12V) supplies power to the edge computing box, and the second power supply (5V) supplies power to the microcontroller.

[0040] To avoid frequent power outages and damage to hardware, only one disconnection operation is allowed within 24 hours.

[0041] After the disconnection operation is executed, the heartbeat information will contain the "power off" information for five consecutive times, which is convenient for the edge computing box to collect the reason for the system restart.

[0042] Electronic components themselves may also fail to transmit data. To ensure the reliability of the overall solution, a two-module redundancy solution is adopted each time a heartbeat message is sent to the edge computing box. That is, when the edge computing box does not respond, the message is immediately resent to improve the reliability of data transmission.

[0043] Instruction Definition The 8th bit indicates whether the temperature is positive or negative, the 1st bit indicates whether a power-off operation has been performed, and the 2nd to 6th bits indicate the temperature value.

[0044] After receiving the temperature information through the RS232 interface, the edge computing box can set the upper temperature threshold according to its own electrical performance. When the threshold is exceeded, the task will be suspended to reduce the system load and temperature to protect the hardware. When the ambient temperature returns to the operating temperature range, the task will be restarted.

[0045] The edge computing box equipped with an external watchdog must support the RS232 interface.

[0046] As described above, the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features thereof may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. An external watchdog circuit based on a single chip microcomputer, characterized in that: The external watchdog circuit based on the single chip microcomputer comprises: A hardware watchdog circuit, a first power supply, a second power supply and an edge computing box. The hardware watchdog circuit includes a normally closed relay, a single-chip microcomputer and a temperature sensor. The normally closed relay and the temperature sensor are electrically connected to the single-chip microcomputer at the same time. The first power supply supplies power to the edge computing box through the normally closed relay; the second power supply is used to power the single-chip microcomputer. The edge computing is electrically connected to the single-chip microcomputer through the RS232 serial port.

2. The external watchdog circuit based on a single chip microcomputer according to claim 1, characterized in that: The single-chip microcomputer is MS-8051, and the single-chip microcomputer is used to obtain the temperature value information collected by the temperature sensor, and the single-chip microcomputer is used to send heartbeat information to the edge computing box.

3. The external watchdog circuit based on a single chip microcomputer according to claim 1, characterized in that: The relay is SRD-05VDC-SL-C.

4. The external watchdog circuit based on a single chip microcomputer according to claim 1, characterized in that: The first power supply is 12V, and the second power supply is 5V.

5. The external watchdog circuit based on a single chip microcomputer according to claim 1, characterized in that: The normally closed relay, the single chip microcomputer and the temperature sensor are all fixedly arranged on a PCB circuit board and are electrically connected through a circuit on the PCB circuit board.

6. The external watchdog circuit based on a single chip microcomputer according to claim 1, characterized in that: The temperature sensor is DS18B20.

7. A method for using an external watchdog circuit based on a single-chip microcomputer, used for the external watchdog circuit based on a single-chip microcomputer as claimed in any one of claims 1 to 5, characterized in that: include: The temperature sensor obtains temperature value information, and the temperature sensor sends the temperature value information to the single chip microcomputer; The MCU receives the temperature value information sent by the temperature sensor. The MCU generates heartbeat information every 60 seconds based on the temperature value information. The MCU sends the heartbeat information to the edge computing box through the RS232 serial port. The MCU determines whether the response information sent by the edge computing box is received. If so, it returns to the previous step. If not, it determines whether the response information sent by the edge computing box is not received for more than 180 seconds after the heartbeat information is sent. If so, the MCU generates a disconnection command and sends it to the normally closed relay. The normally closed relay receives the disconnection instruction and executes the disconnection instruction; The microcontroller generates an open command three seconds after sending the open command, and sends the open command to the normally closed relay; The normally closed relay receives an open command and executes the open command.

8. The method for using the external watchdog circuit of a single chip microcomputer according to claim 7, characterized in that: Also includes: If the single-chip computer determines that it has not received a response message from the edge computing box for more than 180 seconds after sending the heartbeat message, the single-chip computer returns to the step of determining whether the response message sent by the edge computing box is received.

9. The method for using the external watchdog circuit of a single chip microcomputer according to claim 7, characterized in that: Before the microcontroller sends a disconnect command to the normally closed relay, it also includes: The single-chip microcomputer determines whether it is the first time to send a disconnection command within 24 hours. If so, it continues to send a disconnection command to the normally closed relay. If not, the single-chip microcomputer sends a disconnection command to the normally closed relay. The single-chip microcomputer generates an error command and sends the error command to the edge computing box.

10. The method for using the external watchdog circuit of a single chip microcomputer according to claim 7, characterized in that: The five heartbeat messages after the microcontroller sends the disconnection command all include the execution power-off information.