Abnormal power-off processing method and system and industrial controller

By monitoring the main power supply status in real time and sending abnormal power failure messages through an uninterruptible power supply, the emergency response module of the industrial controller is controlled to stop data writing and perform a safe shutdown, thus solving the problem of data corruption caused by abnormal power failure of the industrial controller and achieving data integrity and system stability.

CN121635013APending Publication Date: 2026-03-10CARD CONTROL TECHNOLOGY (SHANGHAI) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-04
Publication Date
2026-03-10

AI Technical Summary

Technical Problem

When an industrial controller experiences an abnormal power outage, existing technologies are insufficient to effectively protect data integrity, leading to data corruption and system instability.

Method used

By monitoring the main power supply status in real time through an uninterruptible power supply, an abnormal power failure message is sent to the emergency response module in the industrial controller, controlling the non-volatile memory module to stop reading and writing, and performing a safe shutdown operation to ensure data integrity and system stability.

Benefits of technology

It significantly shortens the power outage response time, prevents data write corruption, ensures data atomicity and system-wide protection, avoids data races and corruption, and completes necessary persistence operations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121635013A_ABST
    Figure CN121635013A_ABST
Patent Text Reader

Abstract

The invention provides an abnormal power-off processing method and system and an industrial controller, and is applied to the abnormal power-off processing system, the system comprises a main power supply, an uninterruptible power supply and the industrial controller, the uninterruptible power supply is connected with the main power supply and the industrial controller, and the industrial controller comprises a processor. An emergency response module and various application services run in the processor. The method comprises the steps that the uninterruptible power supply detects the working state of the main power supply in real time; if the working state of the main power supply is an abnormal state, the uninterruptible power supply sends abnormal power failure message information to an emergency response module in the industrial controller; and the emergency response module controls a nonvolatile storage module in the industrial controller to stop reading and writing according to the message information of the abnormal power failure, controls each application service to enter a safe state, and executes safe shutdown operation. And the problem of data damage caused by abnormal power failure is fundamentally solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of power supply technology, and more specifically, to an abnormal power failure handling method, system, and industrial controller. Background Technology

[0002] In modern industrial automation systems, industrial controllers, as core control devices, undertake the critical tasks of real-time monitoring, data acquisition, and logical operations of production processes. During their operation, they continuously generate and process large amounts of critical data, the integrity of which directly affects the safety, continuity, and traceability of the production process. However, in complex industrial environments, abnormal power outages are a common and difficult-to-avoid risk factor. Since industrial controllers typically rely on external power supplies for normal operation, an unexpected power failure will prevent the system from performing resource release and data persistence operations according to the normal shutdown procedure, leading to a series of data integrity issues.

[0003] Several solutions have been proposed in existing technologies. For example, using backup batteries or supercapacitors to provide short-term power endurance for the controller to support safe shutdown and data preservation after a power outage; using storage modules with power failure detection circuits to trigger emergency data dumping before the voltage drops to a threshold; introducing journal-based file systems or copy-on-write mechanisms to improve the file system's resilience to power failures; and enhancing data reliability through dual redundant storage or off-site synchronization. However, these solutions generally suffer from high costs, large response latency, low storage efficiency, or limited applicability. Summary of the Invention

[0004] The purpose of this application is to address the shortcomings of the prior art by providing an abnormal power outage handling method, system, and industrial controller, fundamentally solving the problem of data corruption caused by abnormal power outages.

[0005] To achieve the above objectives, the technical solutions adopted in the embodiments of this application are as follows: In a first aspect, embodiments of this application provide an abnormal power outage handling method applied to an abnormal power outage handling system. The system includes: a main power supply, an uninterruptible power supply (UPS), and an industrial controller. The UPS is connected to both the main power supply and the industrial controller. The industrial controller includes a processor running an emergency response module and various application services. The method includes: The uninterruptible power supply monitors the working status of the main power supply in real time. If the main power supply is in an abnormal operating state, the uninterruptible power supply sends an abnormal power outage message to the emergency response module in the industrial controller. The emergency response module, based on the abnormal power outage message, controls the non-volatile storage module in the industrial controller to stop reading and writing, controls each application service to enter a safe state, and performs a safe shutdown operation.

[0006] Optionally, the uninterruptible power supply (UPS) monitors the operating status of the main power supply in real time, including: If the main power supply supplies power to the uninterruptible power supply normally, then the working state of the main power supply is determined to be normal. If the main power supply fails to supply power to the uninterruptible power supply, then the operating state of the main power supply is determined to be abnormal.

[0007] Optionally, the system further includes a safety signal board, through which the uninterruptible power supply is connected to the industrial controller; The uninterruptible power supply sends an abnormal power failure message to the emergency response module in the industrial controller, including: The uninterruptible power supply sends an abnormal electrical signal to the safety signal board; The safety signal board converts the abnormal electrical signal into a message indicating an abnormal power failure, and sends the message to the emergency response module through the communication interface between the safety signal board and the industrial controller.

[0008] Optionally, controlling the non-volatile memory module in the industrial controller to stop reading and writing includes: Obtain the remaining execution time of the read / write operation being performed by the non-volatile storage module; Based on the remaining execution time and the preset time, determine whether to interrupt the ongoing read / write operation; If so, then control the non-volatile storage module to stop reading and writing.

[0009] Optionally, determining whether to interrupt the ongoing read / write operation based on the remaining execution time and a preset time includes: If the remaining execution time is greater than the preset time, then the ongoing read / write operation is determined to be interrupted. If the remaining execution time is less than or equal to the preset time, then it is determined that the ongoing read / write operation will not be interrupted.

[0010] Optionally, controlling each of the application services to enter a secure state includes: The emergency response module sends abnormal power outage information to each of the application services; Each application service performs a state switch based on the received abnormal power outage information to enter a safe state.

[0011] Optionally, performing the safe shutdown operation includes: Send an abnormal shutdown request to the processor; The processor executes disk write, unmount, and shutdown operations sequentially based on the abnormal shutdown request.

[0012] Optionally, the processor also includes a logging module, and the method further includes: The emergency response module sends a log generation request to the log module based on the abnormal power outage message information, and the log generation request includes abnormal shutdown information; The logging module generates an abnormal shutdown log based on the log request.

[0013] Secondly, embodiments of this application also provide an industrial controller, wherein the industrial processor includes a processor for executing the abnormal power failure handling method steps performed by the emergency response module in the first aspect.

[0014] Thirdly, this application embodiment also provides an abnormal power outage handling system, the system including: a main power supply, an uninterruptible power supply, and an industrial controller, the uninterruptible power supply being connected to the main power supply and the industrial controller respectively, the industrial controller including a processor, the processor running an emergency response module and various application services; The abnormal power failure handling system is used to execute the abnormal power failure handling method steps described in the first aspect.

[0015] The beneficial effects of this application are: This application provides an abnormal power failure handling method, system, and industrial controller. The uninterruptible power supply (UPS) monitors the operating status of the main power supply in real time. If the main power supply is in an abnormal state, the UPS sends an abnormal power failure message to the emergency response module in the industrial controller. Based on the abnormal power failure message, the emergency response module controls the non-volatile memory module in the industrial controller to stop reading and writing, controls each application service to enter a safe state, and performs a safe shutdown operation. By using the uninterruptible power supply (UPS) as the main control unit for power outage detection, real-time monitoring of the main power supply is achieved. This enables timely detection of abnormal power outage events, transforming the previous passive waiting for feedback into proactive monitoring, significantly shortening the power outage response time. When an abnormal state of the main power supply is detected, a power outage anomaly message is sent to the emergency response module in the industrial controller. This overcomes the limitation of traditional UPS systems that only provide power and do not transmit information. After receiving the abnormal power outage message, the emergency response module in the industrial controller stops reading and writing to the non-volatile storage module, solving the problem of user data atomicity and directly stopping the possibility of data writing within the dangerous time window, ensuring that no file is in a corrupted state while being written. At the same time, it controls all application services to enter a safe state, ensuring the global and thoroughness of the protection scope, preventing any write operations that may occur in the subsequent time, and avoiding data competition and corruption caused by poor coordination between services. Finally, a safe shutdown operation is performed, ensuring that necessary persistent operations are completed before the power outage. Attached Figure Description

[0016] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0017] Figure 1 This is a schematic diagram of the architecture of an abnormal power outage handling system provided in an embodiment of this application; Figure 2 A schematic diagram of a hardware and software architecture provided for an embodiment of this application; Figure 3 A flowchart illustrating an abnormal power outage handling method provided in an embodiment of this application; Figure 4 This is a schematic diagram of another abnormal power failure handling system provided in an embodiment of this application; Figure 5 A flowchart illustrating another abnormal power outage handling method provided in an embodiment of this application; Figure 6This is a flowchart illustrating another abnormal power outage handling method provided in an embodiment of this application. Detailed Implementation

[0018] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. It should be understood that the accompanying drawings in this application are for illustrative and descriptive purposes only and are not intended to limit the scope of protection of this application. Furthermore, it should be understood that the schematic drawings are not drawn to scale. The flowcharts used in this application illustrate operations implemented according to some embodiments of this application. It should be understood that the operations in the flowcharts may not be implemented in sequence, and steps without logical contextual relationships may be reversed or implemented simultaneously. In addition, those skilled in the art, guided by the content of this application, may add one or more other operations to the flowcharts, or remove one or more operations from the flowcharts.

[0019] Furthermore, the described embodiments are merely some, not all, of the embodiments of this application. The components of the embodiments of this application described and illustrated herein can typically be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but merely to illustrate selected embodiments of the application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without inventive effort are within the scope of protection of this application.

[0020] It should be noted that the term "comprising" will be used in the embodiments of this application to indicate the presence of the features declared thereafter, but does not exclude the addition of other features.

[0021] Figure 1 This is a schematic diagram of the architecture of an abnormal power outage handling system provided in an embodiment of this application, as shown below. Figure 1 As shown, the abnormal power outage handling system may include a main power supply 101, an uninterruptible power supply 102 (UPS), and an industrial controller 103. The UPS 102 is connected to both the main power supply 101 and the industrial controller 103. The industrial controller 103 may also include a processor, which runs an emergency response module and various application services.

[0022] The uninterruptible power supply 102 can be used to receive and store power when the main power supply 101 is supplying power normally, and switch to backup power mode when the main power supply 101 is detected to be abnormal, so as to continuously provide stable power output to the industrial controller 103, so as to ensure that it still has enough running time to complete critical operations during power outages.

[0023] The industrial controller 103, as the core control unit in an industrial automation system, is typically deployed in devices such as programmable logic controllers, distributed control systems, or edge computing gateways to perform functions such as real-time data acquisition, process control, logical operations, and communication scheduling. The industrial controller 103 integrates a processor, which can be a single-core or multi-core central processing unit, or an embedded microprocessor, supporting concurrent execution of multiple tasks.

[0024] The processor runs an emergency response module and various application services. The emergency response module can be a lightweight, high-priority system-level daemon or firmware module with interrupt response capabilities, capable of immediately initiating an exception handling process upon receiving an external trigger signal. The various application services refer to the actual business function modules carried by the industrial controller 103, such as I / O driver services, network communication services, control algorithm engines, and human-machine interface services. These services run continuously under normal operating conditions and generate critical data that requires persistent storage.

[0025] Figure 2 A schematic diagram of a hardware and software architecture provided for an embodiment of this application, such as... Figure 2 As shown, the hardware layer comprises an external power supply environment consisting of a main power supply and an uninterruptible power supply (UPS). Under normal conditions, the main power supply powers the system and also powers the UPS 102. When the main power supply fails, the UPS 102 seamlessly switches over to provide backup power, offering a crucial buffer time for the safe shutdown process. The hardware layer also includes an SCB safety signal board, through which the UPS connects to the industrial controller. The industrial controller includes core computing and communication units such as the main CPU and CAN communication interface, serving as the runtime environment for the software layer. The memory uses non-volatile storage media to store system and application data.

[0026] The software layer, serving as the system's control center, runs on top of the industrial controller and mainly includes emergency response modules and various application services.

[0027] Figure 3 This is a flowchart illustrating an abnormal power outage handling method provided in an embodiment of this application. The execution entity of this method is as described in the aforementioned abnormal power outage handling system. Figure 3 As shown, the method includes: S201. The uninterruptible power supply (UPS) monitors the operating status of the main power supply in real time.

[0028] The operating state of the main power supply 101 can include normal state and abnormal state.

[0029] Optionally, the uninterruptible power supply 102 can realize real-time detection of the main power supply's operating status through its internally integrated power monitoring circuit. This monitoring circuit may include a voltage sampling unit, a current sampling unit, and a signal conditioning and comparison module, capable of periodically acquiring input voltage and current parameters from the main power supply, thereby analyzing the acquired input voltage and current parameters to determine the operating status of the main power supply 101.

[0030] Optionally, to enhance the stability and anti-interference capability of the uninterruptible power supply 102 during the detection process, the uninterruptible power supply 102 may also be equipped with a filter circuit and a noise suppression module to prevent false judgments caused by brief electromagnetic pulses or power grid fluctuations. It can also support users in setting sensitivity levels or enabling hysteresis judgment mechanisms through a configuration interface to avoid frequent state switching under critical conditions.

[0031] S202. Determine whether the main power supply is in an abnormal state.

[0032] Specifically, if the uninterruptible power supply 102 determines that the main power supply 101 is in an abnormal state, then step S203 is executed; if it determines that the main power supply 101 is not in an abnormal state, that is, the main power supply 101 is in a normal state, then it returns to S201 to continue monitoring the main power supply's operating state.

[0033] For example, the uninterruptible power supply 102 can sample power parameters at a frequency of not less than 1 kHz and determine whether the main power supply 101 is in an abnormal state based on the sampled power parameters.

[0034] S203, The uninterruptible power supply sends an abnormal power failure message to the emergency response module in the industrial controller.

[0035] Optionally, when the uninterruptible power supply 102 determines through its internal monitoring circuit that the main power supply 101 is in an abnormal state, it immediately sends an abnormal power outage message to the emergency response module in the industrial controller 103. This message serves as the start signal for the entire abnormal power outage handling process, and features high priority, low latency, and strong reliability. It is the core communication event for realizing hardware and software linkage protection.

[0036] Optionally, the abnormal power outage message can be a structured data packet, which may include: an event type identifier, a timestamp, a power status code, and a checksum. The event type identifier can be used to indicate whether the message is an abnormal power outage warning or a main power failure; the timestamp can record the time when the abnormality was detected, which can support post-fault tracing; the power status code refers to the type of abnormality, such as complete power failure, voltage drop, and frequency offset; the checksum can use Cyclic Redundancy Check (CRC) or other checksum algorithms to ensure the integrity of the transmission.

[0037] Optionally, the uninterruptible power supply 102 may be pre-configured with a communication protocol stack, and complete message encapsulation and start transmission within a preset time after detecting an abnormality in the main power supply 101, ensuring that the message information is transmitted in the shortest possible time.

[0038] S204. Based on the abnormal power failure message, the emergency response module controls the non-volatile memory module in the industrial controller to stop reading and writing, controls each application service to enter a safe state, and performs a safe shutdown operation.

[0039] The emergency response module can be implemented as an independent process running on the processor, an operating system kernel module, or a low-level service program integrated into the firmware. It has interrupt response capabilities and resource access permissions, and can complete critical operations without external intervention. As the central command unit of the entire abnormal power failure protection mechanism, the emergency response module is responsible for coordinating hardware resources, scheduling software services, and executing orderly shutdown actions, thereby ensuring the integrity of critical data and the stability of the system in the industrial controller.

[0040] Optionally, after receiving an abnormal power failure message from the uninterruptible power supply 102, the emergency response module in the industrial controller 103 controls the non-volatile storage module in the industrial controller to stop reading and writing, controls each application service to enter a safe state, and performs a safe shutdown operation.

[0041] Optionally, to prevent file system corruption, metadata errors, or physical damage to flash memory cells caused by read / write operations on the storage medium during periods of voltage instability, the emergency response module can control the non-volatile storage module within the industrial controller to stop read / write operations. Simultaneously, it can control each application service to enter a safe state, ensuring that each service can complete its state transition quickly, preventing data loss or state inconsistencies due to sudden power outages. After stopping read / write operations on the non-volatile storage module and controlling each application service to enter a safe state, the industrial controller performs a safe shutdown operation, thereby reducing the risk of file system corruption caused by power outages.

[0042] In this embodiment, the uninterruptible power supply (UPS) monitors the operating status of the main power supply in real time. If the main power supply is in an abnormal state, the UPS sends an abnormal power failure message to the emergency response module in the industrial controller. Based on the abnormal power failure message, the emergency response module controls the non-volatile memory module in the industrial controller to stop reading and writing, controls each application service to enter a safe state, and performs a safe shutdown operation. By using the uninterruptible power supply (UPS) as the main control unit for power outage detection, real-time monitoring of the main power supply is achieved. This enables timely detection of abnormal power outage events, transforming the previous passive waiting for feedback into proactive monitoring, significantly shortening the power outage response time. When an abnormal state of the main power supply is detected, a power outage anomaly message is sent to the emergency response module in the industrial controller. This overcomes the limitation of traditional UPS systems that only provide power and do not transmit information. After receiving the abnormal power outage message, the emergency response module in the industrial controller stops reading and writing to the non-volatile storage module, solving the problem of user data atomicity and directly stopping the possibility of data writing within the dangerous time window, ensuring that no file is in a corrupted state while being written. At the same time, it controls all application services to enter a safe state, ensuring the global and thoroughness of the protection scope, preventing any write operations that may occur in the subsequent time, and avoiding data competition and corruption caused by poor coordination between services. Finally, a safe shutdown operation is performed, ensuring that necessary persistent operations are completed before the power outage.

[0043] Optionally, the real-time detection of the main power supply's operating status by the uninterruptible power supply in S201 above may include: Specifically, if the main power supply 101 supplies power to the uninterruptible power supply normally, then the operating state of the main power supply 101 is determined to be normal. For example, when the main power supply supplies power to the uninterruptible power supply normally, and the input voltage is maintained within the preset voltage range and the frequency is within the preset frequency range, and there is no instantaneous drop or surge, the uninterruptible power supply 102 can determine that the main power supply is in a normal state.

[0044] If the main power supply 101 fails to supply power to the uninterruptible power supply (UPS), then the operating state of the main power supply 101 is determined to be abnormal. If the UPS 102 detects that the main power supply has stopped supplying power, the input voltage is continuously lower than the preset voltage threshold, a phase loss occurs, severe distortion occurs, or complete power failure occurs, then the main power supply is determined to be in an abnormal state.

[0045] In this embodiment, the uninterruptible power supply (UPS) directly senses changes in the main power supply, eliminating the impact of software latency and system load. Compared to the traditional methods that rely on operating system polling or controller feedback, this approach can proactively detect abnormal power outages and respond immediately upon power failure. This is significantly earlier than in existing technologies where industrial controllers experience operational anomalies due to voltage drops. Through real-time and accurate detection of the main power supply's operating status by the UPS, a highly reliable abnormal power outage signal source is constructed. This provides a solid foundation for subsequently sending message information to the industrial controller and initiating emergency response procedures, significantly improving the data integrity assurance capability of the industrial control system in the event of a sudden power outage.

[0046] Figure 4 A schematic diagram of another abnormal power failure handling system provided in this application embodiment is shown below. Figure 4 As shown, the system may also include a safety signal board 104, through which the uninterruptible power supply 102 can be connected to the industrial controller 103.

[0047] Figure 5 A flowchart illustrating another abnormal power outage handling method provided in this application embodiment is shown below. Figure 5 As shown, the message information about abnormal power failure sent by the uninterruptible power supply to the emergency response module in the industrial controller in S203 above may include: S301, The uninterruptible power supply sends an abnormal electrical signal to the safety signal board.

[0048] Optionally, when the uninterruptible power supply 102 confirms an abnormal power supply from the main power supply 101, in addition to switching to battery power mode, it immediately sends an abnormal electrical signal to the safety signal board 104 through its preset output port. This abnormal electrical signal can be an analog or digital electrical signal with a clear level characteristic, used to characterize the specific event of a main power supply failure.

[0049] Among these, priority is given to those with fast response speed, strong anti-interference ability, and low hardware cost for abnormal electrical signals.

[0050] S302, the safety signal board converts abnormal electrical signals into abnormal power failure message information, and sends the abnormal power failure message information to the emergency response module through the communication interface between the safety signal board and the industrial controller.

[0051] Optionally, abnormal electrical signals from the uninterruptible power supply 102 can be monitored in real time through the input port of the safety signal board 104. Once the abnormal electrical signal is detected, it is determined that the main power supply has experienced an abnormal power failure. At this time, the abnormal electrical signal is immediately converted into an abnormal power failure message. For example, the abnormal electrical signal can be mapped into a structured abnormal power failure message. Then, the message is sent to the emergency response module through the Controller Area Network (CAN) communication interface.

[0052] In this embodiment, not only is reliable transmission of abnormal power failure information achieved, but a cross-hardware platform, highly robust signal bridging mechanism is also constructed. This is an important feature of this embodiment in ensuring data security in complex industrial environments, and embodies the system design concept of software and hardware collaboration and layered decoupling.

[0053] Figure 6 A flowchart illustrating another abnormal power outage handling method provided in this application embodiment is shown below. Figure 6 As shown, the process of controlling the non-volatile memory module in the industrial controller to stop reading and writing in S204 above may include: S401. Obtain the remaining execution time of the read / write operation being performed by the non-volatile storage module.

[0054] Optionally, after the emergency response module initiates the abnormal power failure response process, it first sends a status query request to the non-volatile storage module in the industrial controller to obtain whether there is currently an ongoing read / write operation and the remaining execution time of the ongoing read / write operation.

[0055] The remaining execution time refers to the estimated time required from the moment the ongoing read / write operation is acquired until it is fully completed. For example, if the total execution time of the ongoing read / write operation is 20ms, and 12ms has already elapsed since the operation was acquired, then the remaining execution time is 8ms. The method for acquiring this remaining time may vary depending on the storage device type and interface protocol.

[0056] S402. Based on the remaining execution time and the preset time, determine whether to interrupt the ongoing read / write operation.

[0057] The preset duration may refer to the power supply duration provided by the uninterruptible power supply to complete a safe shutdown.

[0058] Optionally, after obtaining the remaining execution time, the emergency response module compares the remaining execution time with a pre-set preset time threshold to make a decision on whether to interrupt the ongoing read / write operation.

[0059] In this embodiment, by comparing the remaining execution time with the preset time to determine whether to interrupt the ongoing read / write operation, the completion of short-term read / write operations can be allowed, avoiding unnecessary data truncation. This not only prevents long-term writing from hindering the shutdown process, but also preserves writable data.

[0060] Optionally, determining whether to interrupt the ongoing read / write operation based on the remaining execution time and the preset time in S402 above may include: Specifically, if the remaining execution time is greater than the preset time, the ongoing read / write operation will be interrupted. If the remaining execution time is less than or equal to the preset time, the ongoing read / write operation will not be interrupted and will continue to be executed.

[0061] For example, if the preset duration is 10ms and the remaining execution time is 8ms, then the currently executing read / write operation will continue.

[0062] Optionally, controlling each application service to enter a secure state in S204 above may include: Specifically, the emergency response module can send abnormal power outage information to each application service. Each application service then switches states based on the received information, entering a safe state—either read-only mode or a stopped state. Abnormal power outage information can be notified to all application services via global broadcast. This ensures that the entire industrial controller acts in a coordinated manner during power outage warnings, avoiding conflicts caused by partial writes and achieving global data consistency.

[0063] Optionally, performing the safe shutdown operation in S204 above may include: Specifically, an abnormal shutdown request is sent to the processor. Based on the abnormal shutdown request, the processor sequentially performs disk write, unmount, and shutdown operations. After confirming the five-way write operation, the abnormal shutdown process is executed.

[0064] In this embodiment, the operating system's safe shutdown process was fully executed during the power supply time provided by the uninterruptible power supply, thus maximizing the integrity of the file system.

[0065] Optionally, the processor described above also includes a logging module, and the method may further include: Optionally, the emergency response module can send a log generation request to the log module based on the abnormal power outage message information. This log generation request may include abnormal shutdown information, and the log module can then generate an abnormal shutdown log based on the log request. The generated abnormal shutdown log may include: an abnormal shutdown identifier, the time information of the power outage, and key fault features extracted from the message information, etc.

[0066] Optionally, upon receiving the log generation request, the logging module creates a new abnormal shutdown log entry in non-volatile memory according to a preset log format template and a secure write mechanism. This log entry can be read by the diagnostic system during subsequent startup to analyze system stability, locate hardware defects, or optimize power management strategies.

[0067] This application also provides an industrial controller, which may further include a processor that can execute the abnormal power failure handling method steps performed by the emergency response module in the foregoing embodiments.

[0068] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems and devices described above can be referred to the corresponding processes in the method embodiments, and will not be repeated here. In the several embodiments provided in this application, it should be understood that the disclosed systems, devices, and methods can be implemented in other ways. The device embodiments described above are merely illustrative. For example, the division of modules is only a logical functional division, and in actual implementation, there may be other division methods. Furthermore, multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed mutual coupling or direct coupling or communication connection can be through some communication interfaces; the indirect coupling or communication connection of devices or modules can be electrical, mechanical, or other forms.

[0069] Furthermore, the functional units in the various embodiments of this application 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. If the functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes: USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, optical disks, and other media capable of storing program code.

[0070] The above are merely specific embodiments of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application.

Claims

1. An abnormal power-off processing method characterized by comprising: The application is applied to an abnormal power-off processing system, the system comprises a main power supply, an uninterruptible power supply, an industrial controller, the uninterruptible power supply is connected with the main power supply and the industrial controller respectively, the industrial controller comprises a processor, the processor runs an emergency response module and various application services, the method comprises: The uninterruptible power supply detects the working state of the main power supply in real time; If the working state of the main power supply is an abnormal state, the uninterruptible power supply sends abnormal power-off message information to the emergency response module in the industrial controller; The emergency response module controls the non-volatile storage module in the industrial controller to stop reading and writing according to the abnormal power-off message information, controls each application service to enter a safe state, and executes a safe shutdown operation.

2. The abnormal power-off processing method according to claim 1, characterized by, The uninterruptible power supply detects the working state of the main power supply in real time, which comprises: If the main power supply normally supplies power to the uninterruptible power supply, it is determined that the working state of the main power supply is a normal state; If the main power supply does not supply power to the uninterruptible power supply, it is determined that the working state of the main power supply is an abnormal state.

3. The abnormal power-off processing method according to claim 1, characterized by, The system further comprises a safety signal board, and the uninterruptible power supply is connected with the industrial controller through the safety signal board; The uninterruptible power supply sends abnormal power-off message information to the emergency response module in the industrial controller, which comprises: The uninterruptible power supply sends an abnormal electric signal to the safety signal board; The safety signal board converts the abnormal electric signal into the abnormal power-off message information, and sends the abnormal power-off message information to the emergency response module through a communication interface between the safety signal board and the industrial controller.

4. The abnormal power-off processing method according to claim 1, characterized by, The control of the non-volatile storage module in the industrial controller to stop reading and writing comprises: Obtaining the remaining execution time length of the reading and writing operation being executed by the non-volatile storage module; According to the remaining execution time length and a preset time length, it is determined whether to interrupt the reading and writing operation being executed; If yes, the non-volatile storage module is controlled to stop reading and writing.

5. The abnormal power-off processing method according to claim 4, wherein According to the remaining execution time length and a preset time length, it is determined whether to interrupt the reading and writing operation being executed, which comprises: If the remaining execution time length is greater than the preset time length, it is determined to interrupt the reading and writing operation being executed; If the remaining execution time length is less than or equal to the preset time length, it is determined not to interrupt the reading and writing operation being executed.

6. The abnormal power-off processing method according to claim 1, wherein The control of each application service to enter a safe state comprises: The emergency response module sends abnormal power-off information to each application service; Each application service executes state switching according to the received abnormal power-off information to enter a safe state.

7. The abnormal power-off processing method according to claim 1, wherein The execution of a safe shutdown operation comprises: Sending an abnormal shutdown request to the processor; The processor executes disk dumping, unmounting and shutdown operations in sequence according to the abnormal shutdown request.

8. The abnormal power-off processing method according to claim 1, characterized by, The processor further runs a log module, and the method further comprises: The emergency response module sends a log generation request to the log module according to the abnormal power-off message information, and the log generation request comprises abnormal shutdown information; The log module generates an abnormal shutdown log according to the log request.

9. An industrial controller, characterized by The industrial controller comprises a processor configured to perform the abnormal power-off processing method steps performed by the emergency response module in claims 1-8.

10. An abnormal power-off processing system characterized by comprising: The system comprises a main power supply, an uninterruptible power supply, and an industrial controller, the uninterruptible power supply is connected with the main power supply and the industrial controller respectively, the industrial controller comprises a processor, the processor runs an emergency response module and a plurality of application services. The abnormal power-off processing system is configured to perform the abnormal power-off processing method steps in any one of claims 1-8.