Uninterruptible power supply system with automatic recovery function
By introducing watchdog mechanism and cyclic redundancy verification functions in the uninterruptible power system, the boot program or application software is automatically switched, and the system's operating errors and upgrade failures are solved in extreme environments, realizing automatic recovery of the system and early warning of potential problems.
Patent Information
- Application Number
- CN202311069535.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-23
- Publication Date
- 2025-02-25
AI Technical Summary
The existing uninterruptible power system may cause the FLASH bit of the firmware to be reversed in extremely harsh environments, which will cause program operation errors; at the same time, for maintenance, the firmware needs to be upgraded, but it is prone to failure during the upgrade process or system vulnerabilities, which are difficult to automatically recover.
An uninterruptible power system with automatic recovery function is designed to monitor the timeout through the watchdog mechanism of the boot program and the application software. When the timeout exceeds the preset value, it automatically switches to another boot program or application software, and discovers and warns of potential problems in advance through the cyclic redundancy verification function.
在引导程序或应用软件超时次数超过预设值的情况下,自动切换以恢复系统正常运行,确保不间断电源系统在异常情况下能够自动恢复,并通过提前检测和预警机制预防潜在问题。
Smart Images

Figure CN119519088A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the field of electronic information technology, and in particular to an uninterruptible power supply system. Background Art
[0002] Uninterruptible power supplies can provide stable and uninterrupted protection for important high-end equipment, precision instruments, computer network systems, etc. Therefore, it is necessary to ensure that the uninterruptible power supply can operate safely, stably and continuously. However, in actual work, on the one hand, due to the potential extremely harsh working environment, the FLASH bit of the uninterruptible power supply firmware may be reversed, which may lead to program operation errors; on the other hand, in order for the uninterruptible power supply to work better, it is inevitable to upgrade and maintain the programs and application software installed in the firmware. During the upgrade process, it is inevitable to encounter upgrade failures or loopholes in the upgraded program system. Therefore, it is necessary to detect abnormalities when the program system runs incorrectly, fails to upgrade, or has loopholes after the upgrade, and automatically restore the program system to normal working state. Summary of the invention
[0003] Therefore, the object of the present invention is to overcome the defects of the prior art and provide an uninterruptible power supply system with automatic recovery function, comprising:
[0004] one or more processors;
[0005] a memory coupled to the one or more processors; and
[0006] One or more machine-readable storage media, including a plurality of instructions stored thereon, the plurality of instructions, in response to being executed, causing the uninterruptible power supply system to:
[0007] If the running boot program times out, switch to another boot program; and if the running application software times out, switch to another application software.
[0008] According to the uninterruptible power supply system of the present invention, preferably, when the timeout number of the boot program is greater than a first preset value, switching to another boot program is performed.
[0009] According to the uninterruptible power supply system of the present invention, preferably, when the timeout number of the application software is greater than a second preset value, switching to another application software is performed.
[0010] The uninterruptible power supply system according to the present invention is preferably characterized in that the boot program watchdog monitors the timeout of the running boot program and resets the system when a timeout is detected.
[0011] According to the uninterruptible power supply system of the present invention, preferably, the application software watchdog monitors the timeout of the running application software, and resets the system when a timeout is detected.
[0012] According to the uninterruptible power supply system of the present invention, preferably, when the boot program watchdog times out, the boot program watchdog counter is incremented by one to count the number of boot program timeouts.
[0013] According to the uninterruptible power supply system of the present invention, preferably, when the application software watchdog times out, the application software watchdog counter is incremented by one to count the number of application software timeouts.
[0014] According to the uninterruptible power supply system of the present invention, preferably, both application software have a cyclic redundancy check function, and the running application software periodically performs a cyclic redundancy check on the two boot programs and another application software, and issues an early warning when an abnormality occurs.
[0015] According to the uninterruptible power supply system of the present invention, preferably, the two application software and the two boot programs can be updated.
[0016] According to the uninterruptible power supply system of the present invention, preferably, the processor is further configured to automatically overwrite and refresh another boot program or application software when the updated boot program or application software runs stably within a preset period of time.
[0017] The uninterruptible power supply system with automatic recovery function of the present invention can automatically switch to another boot program or application software to restore the system to normal under the abnormal condition that the timeout times of the currently running boot program or application software exceed the preset value. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] The embodiments of the present invention are further described below with reference to the accompanying drawings, in which:
[0019] Figure 1 A schematic diagram of the mapping of the program software of the uninterruptible power supply system according to the present invention in the non-volatile memory and the working process;
[0020] Figure 2 is a mark of the program software of the uninterruptible power supply system according to embodiment 1 of the present invention in the non-volatile memory;
[0021] Figure 3 is a mark of the program software of the uninterruptible power supply system according to embodiment 1 of the present invention in the volatile memory;
[0022] Figure 4 The program software working phase conversion conditions of the uninterruptible power supply system according to the first embodiment of the present invention are described;
[0023] Figure 5 This is a schematic diagram of the workflow of the program software pre-boot phase of the uninterruptible power supply system according to Embodiment 1 of the present invention;
[0024] Figure 6 A schematic diagram of a workflow of a program software booting phase of an uninterruptible power supply system according to Embodiment 1 of the present invention; and
[0025] Figure 7 1 is a schematic diagram of the workflow of the program software application software loading phase of the uninterruptible power supply system according to Embodiment 1 of the present invention. DETAILED DESCRIPTION
[0026] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below through specific embodiments in conjunction with the accompanying drawings. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.
[0027] The protection provided by the uninterruptible power supply is not limited to providing power during power outages, but also has functions such as stabilizing voltage and frequency. Therefore, it is particularly important that the uninterruptible power supply can work continuously and stably and automatically recover when abnormalities occur during operation. To this end, the present invention proposes a technical solution for an uninterruptible power supply system with an automatic recovery function.
[0028] Example 1
[0029] like Figure 1 As shown, the present invention is provided in the non-volatile memory with: a pre-boot area for storing a pre-boot program Pre-Boot; two boot areas for storing a first boot program Boot0 and a second boot program Boot1 respectively; and two application software areas for storing a first application software APP0 and a second application software APP1 respectively.
[0030] Set in non-volatile memory such as Figure 2The flags shown are respectively the first boot program valid flag Boot0_Valid, which indicates that the first boot program Boot0 is valid when it is 1; the second boot program valid flag Boot1_Valid, which indicates that the second boot program Boot1 is valid when it is 1; the first application software valid flag APP0_Valid, which indicates that the first application software APP0 is valid when it is 1; the second application software valid flag APP1_Valid, which indicates that the second application software APP1 is valid when it is 1; the current boot program indicator CurrentBootldx, which indicates that the currently running boot program is the second boot program Boot1 when it is 1, and indicates that the currently running boot program is the first boot program when it is 0. Boot program Boot0; current application software indicator CurrentAPPldx, when it is 1, it means that the second application software APP1 is currently loaded, and when it is 0, it means that the first application software APP0 is currently loaded; first boot program version number Boot0Version, stores the version number of the current first boot program Boot0; second boot program version number Boot1Version, stores the version number of the current second boot program Boot1; first application software version number APP0Version, stores the current version number of the first application software APP0; second application software version number APP1Version, stores the current version number of the second application software APP1.
[0031] Set in volatile memory such as Figure 3 The flags shown are respectively the boot mode request indicator BootModeRequest, the boot program watchdog counter BootWatchDogCnt, and the application software watchdog counter APPWatchDogCnt. When the boot mode request indicator BootModeRequest is 1, it indicates that the application software issues a reset boot request. The boot program watchdog counter BootWatchDogCnt counts the boot program running timeouts. It accumulates by one when a watchdog WatchDog (called the boot program watchdog) in the micro-control unit MCU generates an interrupt. When it is greater than a configurable first preset value (for example, 2), it is confirmed that the current boot program is abnormal and switches to another boot program. The application software watchdog counter APPWatchDogCnt counts the number of application software running timeouts. It accumulates by one when another hardware watchdog WatchDog (called the application software watchdog) in the micro-control unit generates an interrupt. When it is greater than a second preset value (for example, 1), it is confirmed that the current application software loading is abnormal and switches to another application software.
[0032] Figure 1 The various stages of the program system workflow are shown in Figure 4The conversion occurs under the given conditions, wherein: when the first boot program valid flag indicates that the first boot program is valid and the current boot program is the first boot program, that is, Boot0_Valid=1 and CurrentBootldx=0, the pre-boot stage is transferred to the first boot program boot stage; when the second boot program valid flag indicates that the second boot program is valid and the current boot program is the second boot program, that is, Boot1_Valid=1 and CurrentBootldx=1, the pre-boot stage is transferred to the second boot program boot stage; when the first application software valid flag indicates that the first application software is valid and the current application software is the first application software, that is, APP0_Valid=1 and CurrentAPPldx=0, the boot stage is transferred to the first application software loading stage; when the second application software valid flag indicates that the second application software is valid and the current application software is the second application software, that is, APP1_Valid=1 and CurrentAPPldx=1, the boot stage is transferred to the second application software loading stage; when the application software issues a valid reset request, the boot mode request indicator is set to 1, that is, BootModeRequest=1, and the system is reset.
[0033] The pre-boot phase workflow is as follows: Figure 5 As shown. After power-on or reset, the micro-control unit initializes the parameters required for this stage of work. If the boot program watchdog counter BootWatchDogCnt is not greater than 3 (the first preset value), it indicates that there is no need to switch the boot program at present. According to the value of the current boot program indicator CurrentBootldx and the first boot program valid flag Boot0_Valid, and the second boot program valid flag Boot1_Valid, enter the corresponding boot program. If the boot program watchdog counter BootWatchDogCnt is greater than 3 (the first preset value), it means that the currently executed boot program is abnormal for many times. According to the value of the current boot program indicator CurrentBootldx and the first boot program valid flag Boot0_Valid, and the second boot program valid flag Boot1_Valid, determine which boot program is abnormal, change the value of the current boot program indicator CurrentBootldx, change the boot program, and enter the normal boot stage.
[0034] The workflow of the boot phase is as follows Figure 6As shown. After the pre-boot is successful, the micro-control unit initializes the parameters required for the boot phase. If the value of the boot mode request indicator BootModeRequest is 1, it indicates that the reset boot request is initiated by the application software, and the update command is waited for at this time. If the value of the boot mode request indicator BootModeRequest is not 1, the value of the application software watchdog counter BootWatchDogCnt is to be determined. If its value is not greater than 3 (the second preset value), it indicates that there is no need to switch the application software. The current application software is loaded according to the current application software indicator CurrentAPPldx and the first application software valid identifier APP0_Valid, as well as the value of the second application software valid identifier APP1_Valid. If the value of the application software watchdog counter APPWatchDogCnt is greater than 3 (the second preset value), it indicates that the currently loaded application software is abnormal for many times. According to the current application software indicator CurrentAPPldx and the first application software valid identifier APP0_Valid, as well as the value of the second application software valid identifier APP1_Valid, it is determined which application software is abnormal, the value of the current application software indicator CurrentAPPldx is changed, the loading application software is switched, and the normal loading phase is entered. During the boot phase, the boot program watchdog monitors the boot work. If it times out, an interrupt is generated. After the boot program watchdog counter BootWatchDogCnt is incremented by one, the system is reset.
[0035] The workflow of the application software loading phase is as follows Figure 7 As shown. After the boot is successful, the microcontroller initializes the parameters required for this stage of work. The application software performs daily tasks, and the application software watchdog monitors the work of the application software. If it times out, an interrupt is generated, and the application software watchdog counter APPWatchDogCnt is incremented by one, and the system is reset. If the application software receives an update command, the value of the boot mode request indicator BootModeRequest is set to 1, and a request is issued. The system is reset to the pre-boot stage and ready for update.
[0036] In various embodiments of the present invention, the non-volatile memory may be EEPROM, EAROM, PROM, EPROM, NAND flash memory, NOR flash memory, etc., which can retain stored data in the absence of applied power. The volatile memory may be DRAM, SRAM, etc., which may lose stored data in the absence of applied power.
[0037] Example 2
[0038] The solution of the watchdog monitoring boot program boot and application software loading to see if it times out and then triggers a system reset for recovery can only be discovered when the program system runs overtime. At this time, the boot program and application software may have substantial problems and need to be reset immediately to solve them. The solution of this embodiment is: the two application software add a cyclic redundancy check CRC function as a supplement to the watchdog monitoring, which can detect problems in advance and prevent them from happening.
[0039] The currently executed application software periodically checks and detects the boot program and backup application software through cyclic redundancy check. When the cyclic redundancy check detects an abnormality, an error warning is sent to alert maintenance personnel. On the one hand, it can avoid the hidden dangers caused by immediate resetting when an abnormality is found. For example, if the equipment is in a critical operation stage and needs to maintain the current working state, resetting it immediately will interrupt the currently executed task. On the other hand, when an error is found in the boot program or backup application software, it means that the current application software is at risk of error. After the maintenance personnel repair the problematic boot program or application software at an appropriate time, they will test the current application software to detect the problem in advance and deal with it in time. Furthermore, if resources permit, the error checking and correction technology ECC can be configured to automatically correct the error when only one bit is wrong.
[0040] It can be seen from the above two embodiments that the present invention can detect anomalies in the process of booting the boot program and loading the application software, and automatically process and restore the system to a normal operating state. The method adopted by the recovery function is to automatically reset the corresponding number of times according to the value of the first preset value or the second preset value, so as to restore the boot program or application software running before the reset to normal by resetting. If the value given by the first preset value or the second preset value is exceeded, it is switched to another boot program or application software that was not running before the reset. When an abnormality is encountered during the upgrade process or there is a problem with the upgraded program, switching to another unused boot program or application software is to fall back to the unupgraded boot program or application software. Sometimes, even if there is no problem with the upgraded program, due to usage habits or the upgraded function is not needed, the user may not want to use the upgraded version. Therefore, a fallback option is set to allow the user to choose to keep the current upgraded version or fall back to the unupgraded version. In addition, if there is no problem with the program after the upgrade, and the user also wants to continue to use the upgraded version, then the current upgraded boot program or application software can be used to overwrite another boot program or application software, that is, the old boot program or application software is also updated to the latest one as a backup. This overwrite refresh action can be automatic or user-selectable, which can be achieved by configuring the option of whether to use this function. Usually, after waiting for a period of time (the length of the waiting time can be manually set), the program is not detected to be abnormal, and no rollback is manually performed, then the overwrite refresh can be performed. Of course, the user can be provided with the function of manually selecting the overwrite refresh.
[0041] The present invention is not limited to configuring two boot programs and two application software, and can be expanded to more when necessary.
[0042] Through the above-mentioned specific embodiments of the present invention, the uninterruptible power supply can automatically reset and switch to other boot programs or application software when a problem occurs in the running boot program or application software, so that the system can return to normal working state; and can periodically detect the boot program and application software that is not currently in use, discover problems and issue warnings, so that maintenance personnel can deal with risks in advance and ensure that the uninterruptible power supply is in normal operating state for a long time.
[0043] Although the present invention has been described through preferred embodiments, the present invention is not limited to the embodiments described herein but includes various changes and modifications that may be made without departing from the scope of the present invention.
Claims
1. An uninterruptible power supply system with automatic recovery function, characterized in that: include: one or more processors; a memory coupled to the one or more processors; as well as One or more machine-readable storage media, including a plurality of instructions stored thereon, the plurality of instructions, in response to being executed, causing the uninterruptible power supply system to: If the currently running boot program times out, switch to another boot program; and if the currently loaded application software times out, switch to another application software.
2. The uninterruptible power supply system according to claim 1, characterized in that: When the timeout times of the boot program are greater than a first preset value, switching to another boot program is performed.
3. The uninterruptible power supply system according to claim 1, characterized in that: When the timeout times of the application software are greater than a second preset value, switch to another application software.
4. The uninterruptible power supply system according to claim 2, characterized in that: The bootloader watchdog monitors the timeout of the running bootloader and resets the system when a timeout is detected.
5. The uninterruptible power supply system according to claim 3, characterized in that: The application software watchdog monitors the timeout of the running application software and resets the system when a timeout is detected.
6. The uninterruptible power supply system according to claim 4, characterized in that: When a bootloader watchdog timeout interrupt occurs, the bootloader watchdog counter is incremented by one to count the number of bootloader timeouts.
7. The uninterruptible power supply system according to claim 5, characterized in that: When the application software watchdog times out, the application software watchdog counter is incremented by one to count the number of application software timeouts.
8. The uninterruptible power supply system according to any one of claims 1 to 7, characterized in that: Both application software have a cyclic redundancy check function. The running application software periodically performs a cyclic redundancy check on the two boot programs and another application software, and issues an early warning when an abnormality occurs.
9. The uninterruptible power supply system according to claim 8, characterized in that: The two application software and the two boot programs can be updated.
10. The uninterruptible power supply system according to claim 9, characterized in that: The processor is further configured to automatically overwrite and refresh another boot program or application software when the updated boot program or application software runs stably within a preset period of time.