Power failure keeping method and system for control system

By monitoring the power supply status of the control system and using supercapacitors to provide temporary power supply, the problems of high-cost and high-capacity storage in the existing technology are solved, and efficient data backup and system reliability are achieved.

CN119165939APending Publication Date: 2024-12-20HANGZHOU HOLLYSYS AUTOMATION
View PDF 0 Cites 2 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

The power-down retention method of existing control systems relies on high-cost, high-capacity non-volatile memory, and cannot meet the data volume and cost requirements of modern control systems.

Method used

By monitoring the power supply status of the control system, when the voltage is lower than the preset threshold, a power-down event signal is generated, switched to the power-down protection circuit, providing temporary power supply using supercapacitors, and data is stored in non-volatile memory during this time. middle.

Benefits of technology

It improves the storage capacity of data that is kept under power, reduces costs, meets the manufacturing requirements of the control system, and ensures secure data backup and system reliability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119165939A_ABST
    Figure CN119165939A_ABST
Patent Text Reader

Abstract

The invention provides a power failure keeping method and system for a control system. The method comprises the steps that the power supply state of the control system is monitored, and when the voltage of a power supply of the control system is lower than a preset voltage threshold value, a power failure event signal is generated; in response to the power failure event signal, switching a power supply of the control system into a power failure protection circuit, and temporarily supplying power to the control system by using a super capacitor in the power failure protection circuit; and in the power-down protection time of the temporary power supply, storing the power-down retention data and the running log file of the control system into the nonvolatile memory. According to the invention, the storage capacity of the power-down holding data is improved, the cost of power-down holding is reduced, and the manufacturing requirements of a control system can be greatly met.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of control systems, and in particular to a power-off retention method and system for control systems. Background Art

[0002] In the field of control systems, power-off retention is an important mechanism to ensure that key system data is preserved after an unexpected power outage and can be restored when power is restored. Power-off retention is not only related to the continuity of system operation and the integrity of data, but also has important value for development and maintenance personnel to analyze and locate problems afterwards. However, existing technologies face significant challenges in achieving power-off retention.

[0003] Traditional power-off retention methods rely on periodically backing up data to non-volatile memory during system operation. Although such memories, such as ferroelectric random access memory (FRAM) or magnetoresistive random access memory (MRAM), provide fast read and write speeds and long service life, they also come with two major disadvantages: one is the small capacity, which limits the amount of data that can be saved; the other is the relatively high cost, which is particularly prominent in the cost-sensitive control system manufacturing field. With the increase in data volume and the need for cost control, the existing power-off retention methods no longer meet the needs of modern control systems. Summary of the invention

[0004] In view of this, an embodiment of the present application provides a power-off retention method and system for a control system to solve the problems of the prior art of limiting the amount of data to be saved, high cost, and failure to meet the manufacturing requirements of the control system.

[0005] According to a first aspect of an embodiment of the present application, a power-off retention method for a control system is provided, comprising: monitoring the power supply status of the control system, and generating a power-off event signal when the voltage of the power supply of the control system is lower than a preset voltage threshold; in response to the power-off event signal, switching the power supply of the control system to a power-off protection circuit, and temporarily powering the control system using a supercapacitor in the power-off protection circuit; and storing the power-off retention data and operation log file of the control system in a non-volatile memory during the power-off protection time of the temporary power supply.

[0006] According to a second aspect of an embodiment of the present application, a power-off retention system for a control system is provided, comprising: a power-off detection module for monitoring the power supply status of the control system, and generating a power-off event signal when the voltage of the power supply of the control system is lower than a preset voltage threshold; a power-off protection circuit for responding to the power-off event signal to temporarily power the control system using a supercapacitor; and a power-off retention processing module for storing the power-off retention data and operation log file of the control system in a non-volatile memory within the power-off protection time of the temporary power supply.

[0007] At least one of the above technical solutions adopted in the embodiments of the present application can achieve the following beneficial effects:

[0008] By monitoring the power supply status of the control system, when the voltage of the power supply of the control system is lower than the preset voltage threshold, a power failure event signal is generated; in response to the power failure event signal, the power supply of the control system is switched to a power failure protection circuit, and the control system is temporarily powered by a supercapacitor in the power failure protection circuit; during the power failure protection time of the temporary power supply, the power failure retention data and operation log files of the control system are stored in a non-volatile memory. The present application improves the storage capacity of power failure retention data, reduces the cost of power failure retention, and can greatly meet the manufacturing requirements of the control system. BRIEF DESCRIPTION OF THE DRAWINGS

[0009] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0010] Figure 1 It is a flowchart of a power-off retention method for controlling a system provided by an embodiment of the present application;

[0011] Figure 2 is a schematic diagram of a power-off detection circuit provided in an embodiment of the present application;

[0012] Figure 3 is a schematic diagram of a power-off protection circuit provided in an embodiment of the present application;

[0013] Figure 4 It is a structural schematic diagram of a power-off retention system for controlling a system provided in an embodiment of the present application;

[0014] Figure 5 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0015] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.

[0016] Power-off retention is a method that can store relevant data to keep the original value after the control system loses power. When the system is powered on again, the complete data before the power failure can still be obtained, which can ensure the certainty of the system operation status and the integrity of important data. At the same time, the saved log-related data can provide data support for system development and maintenance personnel to analyze problems.

[0017] At present, the power-off retention of control systems generally adopts the following method: periodically backing up the power-off retention data to non-volatile memory during the power-on operation of the control system; however, this method requires the non-volatile memory to be a memory with fast read and write speed and long life, such as FRAM and MRAM. However, the disadvantages of these memories are small capacity and high cost, which cannot meet the manufacturing requirements of the control system.

[0018] In view of the problems existing in the prior art, this application aims to reduce costs while increasing the capacity of data retention, and provides an economical and effective power-off retention solution. By selecting large-capacity and low-cost Flash as a non-volatile memory, and innovatively combining a power-off detection module, a power-off protection circuit, and an efficient data processing flow, this application can not only respond quickly when a power-off event occurs and ensure the safe backup of data, but also greatly reduce the overall cost of the system and meet the needs of large-capacity data storage.

[0019] A power-off retention method and system for a control system provided by the present application are described in detail below in conjunction with the accompanying drawings and specific embodiments.

[0020] Figure 1 It is a flow chart of a power-off retention method for controlling a system provided in an embodiment of the present application. Figure 1 The power-off retention method for controlling the system can be executed by a software program. Figure 1 As shown, the power-off holding method for controlling the system may specifically include:

[0021] S101, monitoring the power supply status of the control system, and generating a power failure event signal when the voltage of the power supply of the control system is lower than a preset voltage threshold;

[0022] S102, in response to the power failure event signal, switching the power supply of the control system to the power failure protection circuit, and using the supercapacitor in the power failure protection circuit to temporarily power the control system;

[0023] S103, storing the power-off retention data and the operation log file of the control system in a non-volatile memory during the power-off protection time of the temporary power supply.

[0024] It should be noted that the "control system" in the embodiments of the present application generally refers to a device or a group of devices used to manage, command, and regulate other systems or subsystems. These systems can control and adjust the output according to the input information, in accordance with a predetermined procedure and method, to achieve specific functions and goals. Control systems are widely used in all walks of life, and their forms and complexities vary, ranging from simple household devices to complex industrial control systems. For example, in a manufacturing plant, the control system of an automated production line can control robots and various sensors to ensure the efficiency and quality of the production process. In the case of an automobile assembly line, the control system will guide the robot to perform welding, assembly and other operations according to a predetermined procedure.

[0025] The "power-off retention data" mentioned in the following embodiments of the present application refers to the key data that needs to be saved when the control system loses power unexpectedly. This type of data is usually used to restore the system to the state or a state close to the state before the power failure after the system is powered on again, to ensure the continuity of the system and the integrity of the data. The power-off retention data can be some variables set by the user in the control system. The embodiments of the present application do not limit the specific content of the power-off retention data.

[0026] In some embodiments, the power supply status of the control system is monitored, and when the voltage of the power supply of the control system is lower than a preset voltage threshold, a power-off event signal is generated, including: using a power-off detection module to monitor the power supply status of the control system, when the voltage of the power supply is lower than the voltage threshold, the voltage in the power-off detection module through resistance division is reduced, the output signal of the comparator is pulled down to a low level state, and the interrupt control logic detects that the output signal drops, thereby triggering an external interrupt of the power-off detection, and generating a power-off event signal.

[0027] Specifically, a power failure detection circuit is designed in the power failure detection module, which continuously monitors the power supply status of the control system. When the voltage of the power supply of the control system is lower than the preset voltage threshold, a power failure event signal is automatically generated. The composition structure and principle of the power failure detection circuit are described in detail below in conjunction with the accompanying drawings and specific embodiments. Figure 2 Schematic diagram of a power failure detection circuit provided in an embodiment of the present application. Figure 2 As shown, the power-off detection circuit may specifically include the following contents:

[0028] The purpose of the brownout detection circuit is to monitor the 24V supply voltage of the system and send a signal when the voltage drops below a preset voltage threshold. The following are the components and working principle of the brownout detection circuit:

[0029] D+24V_SYS: This is the 24V power input for the system.

[0030] D+3.3V_EXT: This is a 3.3V external power input that can be used to provide a reference voltage for other parts of the circuit.

[0031] D6 (BAV99): This is a diode used to protect the circuit from reverse voltage.

[0032] R41, R156: These resistors form a voltage divider to reduce the 24V supply voltage to the operating level of the voltage comparator U31.

[0033] U31 (SGM8743Y5NG / TR): This is a voltage comparator that compares the output of the voltage divider with a preset reference voltage.

[0034] C137, C136: These capacitors provide decoupling and filtering functions to stabilize the voltage signal.

[0035] 24V_DETECT#: This is the power-off detection signal generated by the circuit. When the 24V power supply voltage drops below 18.3V, this signal will be pulled low, indicating a power-off event.

[0036] When the control system is operating normally, the 24V power supply is provided to the non-inverting input terminal (IN+) of the voltage comparator U31 through resistors R41 and R156. At the same time, another resistor R157 and capacitor C137 can be used to set the reference voltage of the comparator. When the 24V power supply voltage of the system is normal, the output of the comparator (24V_DETECT#) remains in a high level state. If the power supply voltage drops below 18.3V, the voltage divided by the resistors will also decrease, causing the output signal of the comparator to be pulled down to a low level state. This falling edge can be detected by the interrupt control logic of the system, triggering the external interrupt of the power-off detection, generating a power-off event signal, thereby triggering the backup process of the power-off data.

[0037] It can be seen that the above power failure detection circuit can monitor the power supply voltage of the system in real time and send a signal when it detects that the voltage is lower than the set voltage threshold, so that the system can respond to the power failure event in time. This is a key part to ensure data integrity and system reliability.

[0038] In some embodiments, a supercapacitor in a power-off protection circuit is used to temporarily power a control system, including: when the control system loses power, using the supercapacitor to provide power supply current to the control system so that the control system continues to operate within the power-off protection time; when the power supply supplies power to the control system, using a diode to control the power supply to charge the supercapacitor at the same time; and using a resistor in the power-off protection circuit to control the size of the charging current when the power supply charges the supercapacitor.

[0039] Specifically, a super capacitor of 0.2F / 13.5V is provided in the power-off protection circuit. A large-capacity super capacitor is used. The delayed discharge characteristics of the super capacitor are utilized. When the system loses power, the power supply is switched to the super capacitor to maintain the power supply current. The duration can be up to several seconds, which can ensure the complete execution of the subsequent power-off maintenance processing module. The composition structure and principle of the power-off protection circuit are described in detail below in conjunction with the accompanying drawings and specific embodiments. Figure 3 Schematic diagram of a power-off protection circuit provided in an embodiment of the present application. Figure 3 As shown, the power-off protection circuit may specifically include the following contents:

[0040] In the power-off protection circuit diagram, D+12V_SYS represents the normal working voltage of the control system, and D+12V is the direct power input. The main components of the power-off protection circuit are as follows:

[0041] D8 (SS56L): This is a diode that can be used to prevent reverse current flow, ensuring that current can only flow from the system power supply to charge the supercapacitor (C2), but not the other way around.

[0042] D4 (SS56L): This is another diode that serves the same purpose, ensuring the correct direction of current flow.

[0043] R138, R146, R85: These are resistors. Their functions include limiting the current during charging and discharging, protecting circuit components, and can also be used as part of the voltage detection circuit.

[0044] C22: This is a supercapacitor marked with 0.2F / 13.5V, which is the core of the power-off protection circuit. The supercapacitor has a very large capacity and can provide the energy required to keep the system running when the power is off. 13.5V indicates its upper limit of operating voltage, and 0.2F (farad) indicates its charge storage capacity.

[0045] L28: This is an inductor that can be used to suppress high frequency noise or as part of a filter.

[0046] C124: This is a filter capacitor, usually used to smooth the power supply voltage and reduce noise and voltage fluctuations.

[0047] Furthermore, the working principle of the above power-off protection circuit is:

[0048] Under normal operating conditions, the system is powered by D+12V_SYS. When a power-off event occurs (i.e., the D+12V_SYS voltage drops), the supercapacitor C22 will serve as the power source because it is fully charged. Since the supercapacitor has a relatively long discharge time, it can maintain the circuit power supply for several seconds, which is enough time for the power-off retention processing module to perform necessary data preservation operations, such as transferring data from volatile memory to non-volatile memory.

[0049] In addition, diodes D8 and D4 ensure that when the power supply is supplying power to the control system, supercapacitor C22 can be charged and will not flow back into the control system when the power is off, thereby protecting the components of the control system. Resistors R138, R146 and R85 are used to control the size of the charging current to ensure that supercapacitor C22 is not charged too quickly to prevent damage. Inductor L28 and capacitor C124 work together in the circuit to provide the necessary power supply filtering to ensure power quality.

[0050] In some embodiments, after the power supply of the control system is switched to a power-off protection circuit, the method further includes: using a power-off retention processing module to set the priority of a power-off retention data processing thread to the highest priority thread, and suspending other threads in the control system except the power-off retention data processing thread.

[0051] Specifically, the control system includes multiple running threads, including at least one power-off retention data processing thread. The system design includes a power-off protection circuit, which is composed of a supercapacitor and can provide short-term power when the main power supply of the system fails. In addition, the system also includes a power-off detection module for monitoring the power supply status of the system and generating an external interrupt signal when a power-off event is detected.

[0052] Furthermore, when the power failure detection module detects that the system power supply voltage drops below a predetermined threshold, it identifies the occurrence of a power failure event and immediately sends an external interrupt signal to the power failure retention processing module. After receiving the external interrupt signal, the power failure retention processing module immediately raises the priority of the power failure retention data processing thread to the highest priority in the system. At the same time, the module suspends all other threads in the system except the power failure retention data processing thread. This can prevent other processes from occupying processor resources during the power failure process, ensure that the power failure retention data processing thread can run without interference, and thus ensure that all system resources are concentrated on completing the work of saving key data.

[0053] Furthermore, the power-off data processing thread will perform data backup operations to save critical runtime data such as system status, user settings, and operation logs to non-volatile storage media. After the data is saved, if the system is still in a power-off state, the power-off data processing thread will enter a standby state and wait for the system power to be restored.

[0054] Through the method of the present embodiment, the design of the power-off retention processing module ensures that the system can respond quickly and take measures to protect key data in the initial stage of a power-off event. The key to the success of this process lies in the efficient cooperation between the power-off protection circuit and the power-off detection module, as well as the rapid response of the power-off retention processing module to external interrupts and the high-priority processing of data processing threads.

[0055] In some embodiments, storing the power-off retention data and operation log files of the control system in a non-volatile memory includes: using a power-off retention processing module to back up the power-off retention data and operation log files of the control system from the volatile memory to the non-volatile memory.

[0056] Specifically, once the power failure detection module triggers a power failure event signal, the power failure retention processing module responds immediately. The module prioritizes processing of predetermined key data sets and quickly transfers data from the volatile memory to the non-volatile memory within the limited power supply time provided by the power failure protection circuit.

[0057] Furthermore, the power-off retention processing module adjusts the priority of the power-off retention data processing thread to the highest level to ensure the immediate execution of the data backup operation, and suspends all other non-critical threads to avoid resource competition during the critical backup process.

[0058] Furthermore, the power-off data processing thread performs data backup, copying the key data and operation log files in the volatile memory to the non-volatile memory. This process involves file system operations, data verification and error detection mechanisms to ensure the accuracy and integrity of the data backup.

[0059] In one example, after the data backup is completed, the power-off retention processing module performs a series of verification operations to confirm whether the data is successfully written to the non-volatile memory. If necessary, a data recovery protocol is implemented to ensure data integrity. After the critical data backup is completed, the system may be in a power-off state. In this case, the system will enter a safe standby mode or shut down safely as designed to protect the system hardware and unbacked up data.

[0060] In some embodiments, the method further includes: using a predetermined power-off log file to record each stage of the power-off retention processing performed by the power-off retention processing module, and the power-off log file is used to locate the scope of problems generated during the power-off retention processing; wherein, the stages of the power-off retention processing process include the stage of not entering the external interrupt entry, the stage of entering the external interrupt entry execution, the stage of entering the log task to start storing the log file, and the stage of completing the log file storage.

[0061] Specifically, the control system has designed a special power-off log file, which will be used to record each stage of the power-off retention process. The structure and format design of the power-off log file can capture key time points and system behaviors, which is convenient for subsequent problem analysis and location.

[0062] In one example, during system operation, the power-off retention processing module is responsible for real-time monitoring of the system status. Once the power-off detection module detects a power-off event, the power-off retention processing module will record information according to the following stages:

[0063] Before entering the external interrupt entry stage: the last state of the system before the power failure event is detected is recorded, including running tasks, system settings, and active user operations.

[0064] Entering the external interrupt entry execution phase: After the system receives the power-off interrupt signal, the power-off retention processing module responds to the interrupt activity, such as suspending non-critical threads and adjusting thread priorities.

[0065] Enter the log task and start storing log files: record the time point and initial operation when the power-off retention processing module starts the log file storage task, to ensure that the start of data backup is accurately recorded.

[0066] Log file storage completion stage: After the power-off data backup is completed, a clear completion mark is recorded to verify the success of the data backup.

[0067] Furthermore, after the system is powered on again, maintenance personnel can quickly locate the scope of the problem during the power-off retention process by analyzing the power-off log file, for example, confirming whether the data is fully backed up and whether any abnormalities occurred during the power-off retention process. The power-off log file provides key information for system recovery. The system can use the data recorded in the log file to restore the status, or determine the abnormal situation during the power-off period based on log analysis.

[0068] Through the above method of this embodiment, by implementing a detailed power-off retention processing and log recording method, not only the resilience of the control system in the face of sudden power-off events is enhanced, but also the fault diagnosis and system recovery process are greatly simplified. This method is particularly suitable for control systems that have extremely high requirements for operation continuity and data integrity, such as industrial automation systems.

[0069] In some embodiments, the method further includes: when the power supply of the control system resumes normal power supply, loading the power-off retention data and the operation log file stored in the non-volatile memory.

[0070] Specifically, the control system is equipped with a non-volatile memory for maintaining the storage of key data and operation logs in the event of a power failure. When a power failure event is detected, the power failure retention processing module quickly migrates the power failure retention data and operation logs from the volatile memory to the non-volatile memory to ensure that these data will not be lost even in the power failure state.

[0071] Furthermore, when the power supply of the control system returns to normal, the system will automatically or through user instructions trigger an initialization process, which first checks the data integrity in the non-volatile memory and starts loading the stored power-off retention data and operation log.

[0072] Furthermore, by loading data in the non-volatile memory, the control system can reconstruct the state before power failure, for example, restore to the last known good configuration, user settings, real-time task status and operation log.

[0073] In one example, the loading process may include a series of data integrity verification steps to ensure that the data recovered from the non-volatile memory is accurate. Any inconsistencies or errors detected during the data recovery process will be logged and reported for further analysis.

[0074] According to the technical solution provided by the embodiment of the present application, the embodiment of the present application replaces the traditional high-cost storage solution with a large-capacity, low-cost non-volatile memory. This solution greatly reduces the economic cost of data retention and expands the capacity of data retention, providing users with an economical and efficient solution. By implementing priority management and thread suspension mechanisms, this solution can quickly back up critical data to non-volatile memory when a power failure occurs. This process reduces the risk of data loss and enhances data integrity and system reliability. After power is restored, the fast loading function of power-off retention data enables the system to quickly restore to the state before power failure, reducing the time of business interruption and the impact on users. By recording each stage of the power failure process in detail, the technical solution provides detailed log information that helps fault diagnosis and problem tracking, thereby facilitating system optimization and maintenance. The automated power failure retention process reduces the need for user intervention and improves the convenience of operation, especially in emergency situations. The implementation of this solution improves the resilience and resilience of the system in the face of unexpected power failures by providing a powerful data protection mechanism. By suspending non-critical threads when power is lost, this solution ensures that limited power can be allocated to critical data retention tasks first, thereby optimizing the use of resources.

[0075] Based on the power-off retention method for a control system provided in the above embodiment, the present application also provides a power-off retention system for a control system. The structure and principle of the power-off retention system for a control system are described in detail below in conjunction with the accompanying drawings and specific embodiments.

[0076] Figure 4 It is a structural diagram of a power-off retention system for controlling a system provided in an embodiment of the present application.

[0077] like Figure 4 As shown, the power-off holding system for controlling the system includes:

[0078] A power failure detection module 401 is used to monitor the power supply status of the control system and generate a power failure event signal when the voltage of the power supply of the control system is lower than a preset voltage threshold;

[0079] A power-off protection circuit 402 is used to temporarily power the control system using a supercapacitor in response to a power-off event signal;

[0080] The power-off retention processing module 403 is used to store the power-off retention data and the operation log file of the control system in the non-volatile memory during the power-off protection time of the temporary power supply.

[0081] like Figure 4As shown in the figure, the power-off retention system includes a power-off detection module, a power-off protection circuit, a power-off retention processing module and a power supply; among them, the design of the power-off protection circuit uses a large-capacity supercapacitor. Supercapacitors are selected as temporary energy sources when power is off because they can charge and discharge quickly in a short time and can maintain charge for a long time without an external power supply. By selecting the appropriate capacitance, this circuit can ensure that even if the system loses power, it can still provide enough energy to support the system to run for a period of time, which is significantly longer than the time required for the system to complete data preservation. The function of the power-off detection module is to monitor the power supply status of the system in real time. Once the power supply voltage is detected to drop below a certain threshold, it is considered that the system may have a power-off event, and the module will generate a power-off event signal.

[0082] After receiving the power-off event signal, the power-off retention processing module will immediately start the backup process of the power-off retention data. The backup process stores the power-off retention data in a non-volatile memory, such as a Flash memory. This step ensures that critical data is safely saved before the system completely loses power.

[0083] According to the functions of the above-mentioned power-off retention system, it can be seen that the purpose of the technical solution of the present application is that when a power-off event occurs, the power-off detection module can detect the power-off event in time and generate a power-off event signal. Through the temporary power provided by the power-off protection circuit, the power-off event signal triggers the data backup process of the power-off retention processing module, and safely transfers the critical data (i.e., the power-off retention data and the operation log file) to the non-volatile memory so that these data can be restored when the system is powered on again.

[0084] In some embodiments, the power failure detection module includes:

[0085] A monitoring unit, used for monitoring the power supply status of the control system;

[0086] A voltage divider, used for pulling down the output signal of the comparator to a low level state by reducing the voltage through the resistor divider when the voltage of the power supply is lower than the voltage threshold;

[0087] The signal generating unit is used to generate a power-off event signal when the interrupt control logic detects that the output signal drops, thereby triggering an external interrupt of power-off detection.

[0088] It should be noted that the function and principle of the power-off detection module are exactly the same as those of the power-off detection circuit in the aforementioned method embodiment. For details, please refer to the description of the power-off detection circuit in the aforementioned method embodiment. Figure 2 The description of the power-off detection circuit shown is not repeated here.

[0089] In some embodiments, the power-off protection circuit includes:

[0090] Supercapacitors are used to provide power supply current to the control system when the control system loses power, so that the control system can continue to operate within the power-off protection time;

[0091] The diode is used to enable the power supply to charge the super capacitor simultaneously when the power supply supplies power to the control system;

[0092] The resistor is used to control the charging current when the power supply charges the supercapacitor.

[0093] It should be noted that the function and principle of the power-off protection circuit are exactly the same as those of the power-off protection circuit in the aforementioned method embodiment. For details, please refer to the description of the power-off protection circuit in the aforementioned method embodiment. Figure 3 The description of the power-off protection circuit shown is not repeated here.

[0094] For details not disclosed in the system embodiments of the present application, please refer to the method embodiments of the present application.

[0095] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0096] Figure 5 Schematic diagram of an electronic device 5 provided in an embodiment of the present application. Figure 5 As shown, the electronic device 5 of this embodiment includes: a processor 501, a memory 502, and a computer program 505 stored in the memory 502 and executable on the processor 501. When the processor 501 executes the computer program 505, the steps in the above-mentioned method embodiments are implemented. Alternatively, when the processor 501 executes the computer program 505, the functions of the modules / units in the above-mentioned device embodiments are implemented.

[0097] The electronic device 5 may be a desktop computer, a notebook, a PDA, a cloud server, or other electronic device. The electronic device 5 may include, but is not limited to, a processor 501 and a memory 502. Those skilled in the art will appreciate that Figure 5 The electronic device 5 is merely an example and does not limit the electronic device 5 , and may include more or less components than those shown in the figure, or different components.

[0098] The processor 501 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.

[0099] The memory 502 may be an internal storage unit of the electronic device 5, for example, a hard disk or memory of the electronic device 5. The memory 502 may also be an external storage device of the electronic device 5, for example, a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the electronic device 5. The memory 502 may also include both an internal storage unit of the electronic device 5 and an external storage device. The memory 502 is used to store computer programs and other programs and data required by the electronic device.

[0100] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units.

[0101] If the integrated module / unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium (e.g., a computer-readable storage medium). Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. The computer program may include computer program code, which may be in source code form, object code form, executable file or some intermediate form. Computer-readable storage media may include: any entity or device capable of carrying computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium, etc.

[0102] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. 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 application, and should all be included in the protection scope of the present application.

Claims

1. A power-off retention method for a control system, It is characterized in that include: Monitoring the power supply status of the control system, and generating a power failure event signal when the voltage of the power supply of the control system is lower than a preset voltage threshold; In response to the power failure event signal, the power supply of the control system is switched to a power failure protection circuit, and the control system is temporarily powered by a super capacitor in the power failure protection circuit; During the power-off protection time of the temporary power supply, the power-off retention data and the operation log file of the control system are stored in a non-volatile memory.

2. The method according to claim 1, It is characterized in that The monitoring of the power supply status of the control system and generating a power failure event signal when the voltage of the power supply of the control system is lower than a preset voltage threshold comprises: The power supply status of the control system is monitored by a power-off detection module. When the voltage of the power supply is lower than the voltage threshold, the voltage in the power-off detection module through resistor voltage division is reduced, and the output signal of the comparator is pulled down to a low level state. The interrupt control logic detects the drop in the output signal, thereby triggering an external interrupt of the power-off detection and generating the power-off event signal.

3. The method according to claim 1, It is characterized in that The method of temporarily supplying power to the control system by using the supercapacitor in the power-off protection circuit includes: When the control system loses power, the super capacitor is used to provide a power supply current to the control system, so that the control system continues to operate within the power-off protection time; When the power supply supplies power to the control system, the power supply is controlled by a diode to charge the super capacitor at the same time; The resistor in the power-off protection circuit is used to control the magnitude of the charging current when the power supply is used to charge the supercapacitor.

4. The method according to claim 1, It is characterized in that After switching the power supply of the control system to the power-off protection circuit, the method further includes: The power-off retention processing module is used to set the priority of the power-off retention data processing thread as the highest priority thread, and other threads in the control system except the power-off retention data processing thread are suspended.

5. The method according to claim 4, It is characterized in that The step of storing the power-off retention data and the operation log file of the control system in a non-volatile memory comprises: The power-off retention processing module is used to back up the power-off retention data and the operation log file of the control system from the volatile memory to the non-volatile memory.

6. The method according to claim 4, It is characterized in that The method further comprises: Using a predetermined power-off log file to record each stage of the power-off retention processing module executing the power-off retention processing, the power-off log file is used to locate the scope of problems generated in the power-off retention processing; The stages of the power-off retention process include a stage before entering the external interrupt entry, a stage of entering the external interrupt entry execution, a stage of entering the log task to start storing the log file, and a stage of completing the log file storage.

7. The method according to claim 1, It is characterized in that The method further comprises: When the power supply of the control system is restored to normal power supply, the power-off retention data and the operation log file stored in the non-volatile memory are loaded.

8. A power-off retention system for a control system, It is characterized in that include: A power failure detection module is used to monitor the power supply status of the control system and generate a power failure event signal when the voltage of the power supply of the control system is lower than a preset voltage threshold; A power-off protection circuit, used for responding to the power-off event signal and temporarily supplying power to the control system using a supercapacitor; The power-off retention processing module is used to store the power-off retention data and operation log file of the control system in a non-volatile memory within the power-off protection time of the temporary power supply.

9. The system according to claim 8, It is characterized in that The power-off detection module comprises: A monitoring unit, used to monitor the power supply status of the control system; A voltage divider, used for pulling down the output signal of the comparator to a low level state by reducing the voltage through resistor voltage division when the voltage of the power supply is lower than the voltage threshold; The signal generating unit is used to generate the power-off event signal when the interrupt control logic detects that the output signal drops, thereby triggering an external interrupt of power-off detection.

10. The system according to claim 8, It is characterized in that The power-off protection circuit comprises: A super capacitor, used for providing a power supply current to the control system when the control system loses power, so that the control system continues to operate within the power-off protection time; a diode, used to enable the power supply to charge the supercapacitor simultaneously when the power supply supplies power to the control system; The resistor is used to control the magnitude of the charging current when the power supply charges the supercapacitor.

Citation Information

Cited By

  • Power failure protection method and device, electronic equipment and storage medium

    CN119690872A

  • Direct current charging pile, control mainboard thereof, power failure protection method and storage medium

    CN122379355A