Industrial computing device abnormal power-on and power-off self-recovery switching control method and device

CN122733601APending Publication Date: 2026-09-11HANGZHOU YIFEI ROBOT INTELLIGENT MFG CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610744543.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-05-27
Publication Date
2026-09-11

AI Technical Summary

Technical Problem

然而,工业现场环境复杂多变,电网波动、接触不良或人为误操作常导致设备频繁发生非正常的“异常上下电”现象

Benefits of technology

[0004] To address at least one of the technical problems existing in the background art, this application provides a method for automatic recovery of industrial computing equipment power-on and power-off control under abnormal power-on and power-off conditions. Through a scheduling mechanism based on power events and equipment operating status, the method realizes automatic state recovery and safe start-up and shutdown of industrial computing equipment under abnormal and frequent power-on and power-off conditions, ensuring system stability and data integrity.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122733601A_ABST
    Figure CN122733601A_ABST
Patent Text Reader

Abstract

This application provides a method and apparatus for automatic power-on / off control of industrial computing devices under abnormal power-on / off conditions, belonging to the field of industrial computing device control technology. It includes: generating a power-down event when a change from a powered-on state to a powered-off state is detected; generating a power-on event when a change from a powered-off state to a powered-on state is detected; acquiring the current operating state of the industrial computing device; and scheduling the execution of the power-down or power-on event according to the current operating state. Through a scheduling mechanism based on power events and device operating state, automatic state recovery and safe start-up / stop of the industrial computing device are achieved under abnormally frequent power-on / off environments, ensuring system stability and data integrity.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of industrial computing equipment control technology, specifically relating to a method and device for controlling the automatic recovery of power-on / off switching of industrial computing equipment in case of abnormal power-on / off. Background Technology

[0002] In the current field of industrial automation and edge computing, industrial computing devices (such as industrial PCs and embedded controllers) serve as the core hubs for data processing and logic control, and their operational stability directly affects the reliability of the entire production system. However, the industrial environment is complex and variable, and power grid fluctuations, poor connections, or human error often lead to frequent abnormal power-on and power-off phenomena in equipment.

[0003] Traditional commercial computing devices typically assume a stable power environment and lack effective mechanisms to cope with sudden power outages. When a device experiences a sudden power outage or instantaneous power-on during startup, operation, or shutdown, it is highly susceptible to system file corruption, data loss, or even failure to automatically resume normal operation after power restoration due to being in a "half-on, half-off" intermediate state. Summary of the Invention

[0004] To address at least one of the technical problems existing in the background art, this application provides a method for automatic recovery of industrial computing equipment power-on and power-off control under abnormal power-on and power-off conditions. Through a scheduling mechanism based on power events and equipment operating status, the method realizes automatic state recovery and safe start-up and shutdown of industrial computing equipment under abnormal and frequent power-on and power-off conditions, ensuring system stability and data integrity.

[0005] The technical solution adopted in this application is as follows: The first aspect of this application provides a method for controlling the automatic recovery of power-on / off switching of an industrial computing device in case of abnormal power-on / off, including: A power-down event is generated when the input power supply changes from a powered-on state to a powered-off state; a power-on event is generated when the input power supply changes from a powered-off state to a powered-on state. Obtain the current operating status of the industrial computing device, including the current operating status as powered off, powered on, running, and in the process of powering off; The power failure event or power-on event is scheduled and executed according to the current operating status; If a power failure event is received while the device is powered on, the power-off request is recorded, and the power-off process is executed after the device has finished powering on. When a power-on event is received while the device is in the power-off process, the startup request is recorded, and the startup process is executed after the device has finished shutting down. If a power failure event is received while the device is in operation, a safe shutdown procedure is executed.

[0006] The industrial computing device abnormal power-on / off self-recovery power-on / off control method provided in the first aspect of this application effectively solves the problem of system crashes and data corruption caused by unstable power supply in industrial settings by constructing a dynamic scheduling mechanism based on power events and device operating status. This method first monitors changes in the input power state in real time and generates corresponding power-on or power-off events. Simultaneously, it accurately obtains the current state of the device, such as shutdown, power-on, running, or shutdown processing. Then, it performs intelligent scheduling based on the combination logic of state and events: when the device encounters a power failure during power-on, the system records a shutdown request and prioritizes completing the startup process before shutting down after power is restored, avoiding the device from failing to work normally due to a "half-start" state; when the device is unexpectedly powered on during shutdown, a startup request is recorded to ensure that the complete shutdown process is completed before restarting, preventing system file write conflicts; when the device suddenly loses power during normal operation, a safe shutdown process is immediately triggered, utilizing the backup power provided by the energy storage module to save critical data and orderly shut down the system. This series of collaborative control strategies not only enables automatic state recovery and logical closed-loop operation of equipment under frequent abnormal power-on and power-off environments, but also significantly improves the reliability and data security of industrial computing equipment, avoiding system crashes, repeated restarts or hardware damage caused by power fluctuations. It is particularly suitable for industrial automation scenarios with complex power grid environments.

[0007] According to one embodiment of this application, when the input power supply is detected to change from a powered state to a powered-off state, a power-down event is generated; when the input power supply is detected to change from a powered-off state to a powered-on state, a power-on event is generated, specifically as follows: The real-time voltage value of the input power supply is obtained through a voltage sampling circuit; The real-time voltage value is compared with a preset voltage threshold. If the real-time voltage value is lower than the preset voltage threshold and the duration reaches the first preset duration, it is determined that the input power supply changes from the power supply state to the power off state, and a power failure event is generated. If the real-time voltage value is higher than the preset voltage threshold and the duration reaches the second preset duration, it is determined that the input power supply has changed from a power-off state to a power-on state, and a power-on event is generated.

[0008] According to one embodiment of this application, the step of scheduling the execution of the power failure event or power-on event based on the current operating state specifically includes: Write the power failure event or power-on event into the event cache queue; Events are retrieved from the event cache queue and executed according to the first-in-first-out (FIFO) principle or the event priority principle.

[0009] According to one embodiment of this application, when a power failure event is received while the device is in the power-on state, a power-off request is recorded, and a power-off process is executed after the device has completed power-on, specifically as follows: If a power failure is detected during device startup, a power failure interrupt signal is generated. Based on the power failure interruption signal, mark the current device status as "pending shutdown"; When the input power is restored, the control device continues to complete the current startup process; After the operating system and applications are fully loaded and running, the shutdown process is triggered.

[0010] According to one embodiment of this application, when a power-on event is received while the device is in a power-off processing state, a startup request is recorded, and a startup process is executed after the device completes power-off, specifically as follows: If the input power is detected to be restored during the device shutdown process, a power-on interrupt signal is generated; Based on the power-on interruption signal, mark the current device status as "pending startup"; The control device continues to complete the current safe shutdown procedure; After the device is completely powered off and the system state is saved, the startup process is automatically triggered.

[0011] According to one embodiment of this application, when a power failure event is received while the device is in operation, a safe shutdown procedure is executed, specifically as follows: Determine whether an energy storage power supply module is configured; If so, then the backup power provided by the energy storage power supply module is used to send a shutdown command to the operating system; Monitor the shutdown progress of the operating system, maintain power supply to core components before the backup power is exhausted, and receive feedback that the shutdown is complete.

[0012] According to one embodiment of this application, the method further includes: Establish an abnormal power-on / off log to record the occurrence time, event type, and current operating status of the equipment for the power-off or power-on event; Store the abnormal power-on / off logs and output alarm information or status reports when the device is started up again.

[0013] According to one embodiment of this application, the method further includes: Count the number of power outage or power-on events generated within a preset time window; If the number of occurrences exceeds a preset safety threshold, the power supply environment is determined to be abnormal. Generate a delay protection command. After receiving a new power-on event, the control device delays the preset protection time before executing the startup process, or suspends the response to the new power-on event until the power supply status is continuously stable for the preset time.

[0014] A second aspect of this application provides an industrial computing device with an automatic power-on / off control device for abnormal power-on / off cycles, comprising: The power detection module is adapted to generate a power-down event when it detects that the input power supply has changed from a powered state to a powered-off state; and to generate a power-on event when it detects that the input power supply has changed from a powered-off state to a powered state. The status acquisition module is suitable for acquiring the current operating status of industrial computing devices, including power-off status, power-on status, running status, and power-off processing status. The event scheduling module is adapted to schedule the execution of the power failure event or power-on event according to the current operating state; The first execution module is adapted to record the shutdown request when a power failure event is received while the device is in the power-on state, and to execute the shutdown process after the device has completed power-on. The second execution module is adapted to receive a power-on event when the device is in the power-off process, record the startup request, and execute the startup process after the device has finished powering off. The third execution module is adapted to execute a safe shutdown procedure when a power failure event is received while the device is in operation.

[0015] This application also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, it implements the industrial computing device abnormal power-on / off self-recovery power-on / off control method described in any of the first aspects of the embodiment above. Attached Figure Description

[0016] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings: Figure 1 A hardware structure block diagram corresponding to the industrial computing device abnormal power-on / off self-recovery power-on / off control method provided in the embodiments of this application; Figure 2 This application provides a flowchart of the power supply restoration control process during power outages and shutdowns of the device. Figure 3 This application provides a flowchart for controlling delayed shutdown during device startup in an embodiment of the present application. Figure 4 This is a schematic diagram of the device operation state transition provided in the embodiments of this application. Detailed Implementation

[0017] To more clearly illustrate the overall concept of this application, a detailed explanation is provided below with reference to the accompanying drawings.

[0018] Many specific details are set forth in the following description to provide a thorough understanding of this application. However, this application may also be implemented in other ways different from those described herein. Therefore, the scope of protection of this application is not limited to the specific embodiments disclosed below. It should be noted that, unless otherwise specified, the embodiments of this application and the features thereof can be combined with each other.

[0019] In this application, unless otherwise expressly specified and limited, the "above" or "below" of the second feature can mean that the first and second features are in direct contact, or that the first and second features are in indirect contact through an intermediate medium. In the description of this specification, references to terms such as "an embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described can be combined in any suitable manner in one or more embodiments or examples.

[0020] like Figures 1 to 4 As shown, the first aspect of this application provides a method for controlling the automatic recovery of power-on / off switching of an industrial computing device in case of abnormal power-on / off, including: A power-down event is generated when the input power supply changes from a powered-on state to a powered-off state; a power-on event is generated when the input power supply changes from a powered-off state to a powered-on state. Obtain the current operating status of industrial computing devices, including power-off status, power-on status, running status, and power-off processing status. Schedule and execute power failure or power-on events based on the current operating status; If a power failure event is received while the device is powered on, the power-off request is recorded, and the power-off process is executed after the device has finished powering on. When a power-on event is received while the device is in the power-off process, the startup request is recorded, and the startup process is executed after the device has finished shutting down. If a power failure event is received while the device is in operation, a safe shutdown procedure is executed.

[0021] 1. Power status monitoring and event generation This step is the fundamental sensing element of the entire control method. The system accurately captures power state transitions by monitoring the voltage signal of the external input power source (such as mains power or industrial DC power) in real time. When a change from powered to de-powered (from power supply to power failure) is detected, the system immediately generates a "power-down event"; conversely, when a change from de-powered to powered (from power failure to power supply) is detected, a "power-on event" is generated. This step transforms physical voltage fluctuations into logical signals that the system can recognize, providing a trigger source for subsequent scheduling decisions.

[0022] 2. Obtain the current operating status of the device. Upon receiving a power event, the control logic needs to simultaneously acquire the real-time operating status of the industrial computing device. The device's status is further subdivided into "power off" (completely powered off or in standby), "power on" (performing BIOS self-test or system boot), "running" (operating system and applications have been loaded and are working normally), and "power off in progress" (executing operating system shutdown commands or saving data). This fine-grained state classification allows the system to distinguish whether the device is in an intermediate state of "cold start," "warm run," or "state transition," thus avoiding misjudgments caused by a single logic logic.

[0023] 3. State-based power event scheduling execution This is the core decision-making step of this method. The system no longer blindly executes simple "power on" or "power off" operations, but instead cross-matches and schedules "power events" with "device operating status." By introducing state machine logic, the system can determine the appropriate response strategy (such as immediate execution, delayed execution, or recording the request for later execution) to the current power-off or power-on event based on what the device is currently doing (e.g., powering on or powering off), thus ensuring a logical closed loop in the device's state transition.

[0024] 4. Handling power failures during startup (delayed shutdown) This step specifically addresses the abnormal scenario of a power outage during the device's startup phase. When the device is in a "power-on state" (e.g., loading the operating system), if a power outage event is suddenly received, the system will not forcibly interrupt the startup process (which often leads to system file corruption). Instead, it first records a "shutdown request" in non-volatile storage. When power is restored, the system will prioritize completing the previously incomplete startup process, ensuring the operating system is fully loaded and enters a stable state before automatically reading and executing the previously recorded shutdown request. This "complete startup first, then perform shutdown" strategy effectively avoids the device falling into a "half-boot" frozen state.

[0025] 5. Power-on processing during shutdown (anti-conflict startup) This step addresses situations where the device receives an unexpected power supply during shutdown. When the device is in a "shutdown process" state (e.g., saving cached data or stopping background services), if a "power-on event" is received, the system first generates a "pending startup request" and suspends it. At this time, the control logic forces the device to continue completing the current safe shutdown process, ensuring all data is written to the disk and the system is completely shut down. Only after the device has completely completed the shutdown process will the system respond to the previously recorded "pending startup request" and re-execute the startup process. This mechanism effectively prevents shutdown interruptions or system file read / write conflicts caused by power fluctuations.

[0026] 6. Safe shutdown during operation This step ensures data security during normal operation. When the device is in a stable "operating state," upon receiving a "power failure event," the system immediately identifies it as a risk of abnormal power outage and directly triggers the "safe shutdown procedure." Typically combined with energy storage modules such as supercapacitors or backup batteries, the system sends a standard shutdown command to the operating system within a short window before the backup power is exhausted, orderly stopping applications, saving critical data, and disconnecting the main power supply. This ensures that even in the event of an unexpected power outage, industrial computing devices can protect data integrity as if they were shut down normally, avoiding system crashes or hardware damage caused by sudden power failures.

[0027] The industrial computing device abnormal power-on / off self-recovery power-on / off control method provided in the first aspect of this application effectively solves the problem of system crashes and data corruption caused by unstable power supply in industrial settings by constructing a dynamic scheduling mechanism based on power events and device operating status. This method first monitors changes in the input power state in real time and generates corresponding power-on or power-off events. Simultaneously, it accurately obtains the current state of the device, such as shutdown, power-on, running, or shutdown processing. Then, it performs intelligent scheduling based on the combination logic of state and events: when the device encounters a power failure during power-on, the system records a shutdown request and prioritizes completing the startup process before shutting down after power is restored, avoiding the device from failing to work normally due to a "half-start" state; when the device is unexpectedly powered on during shutdown, a startup request is recorded to ensure that the complete shutdown process is completed before restarting, preventing system file write conflicts; when the device suddenly loses power during normal operation, a safe shutdown process is immediately triggered, utilizing the backup power provided by the energy storage module to save critical data and orderly shut down the system. This series of collaborative control strategies not only enables automatic state recovery and logical closed-loop operation of equipment under frequent abnormal power-on and power-off environments, but also significantly improves the reliability and data security of industrial computing equipment, avoiding system crashes, repeated restarts or hardware damage caused by power fluctuations. It is particularly suitable for industrial automation scenarios with complex power grid environments.

[0028] In some embodiments of this application, a power-down event is generated when the input power supply is detected to change from a powered-on state to a powered-off state; a power-on event is generated when the input power supply is detected to change from a powered-off state to a powered-on state, specifically as follows: The real-time voltage value of the input power supply is obtained through a voltage sampling circuit; The real-time voltage value is compared with a preset voltage threshold. If the real-time voltage value is lower than the preset voltage threshold and the duration reaches the first preset duration, it is determined that the input power supply changes from the power supply state to the power off state, and a power failure event is generated. If the real-time voltage value is higher than the preset voltage threshold and the duration reaches the second preset duration, it is determined that the input power supply has changed from a power-off state to a power-on state, and a power-on event is generated.

[0029] First, the system uses a voltage sampling circuit (such as a voltage divider resistor combined with ADC sampling) to acquire the input power supply voltage value in real time. Then, the acquired real-time voltage value is compared with a preset voltage threshold. To prevent misjudgments caused by power grid fluctuations or electromagnetic interference, a time-dimensional filtering mechanism is introduced in this step: Power failure determination: When the real-time voltage value is lower than the preset voltage threshold (undervoltage threshold), and this low voltage state lasts for a first preset duration (e.g., 100ms), the system finally determines that the input power supply has changed from a power supply state to a power failure state, thereby generating a power failure event.

[0030] Power-on determination: When the real-time voltage value is higher than the preset voltage threshold (overvoltage threshold), and this high voltage state lasts for a second preset duration (e.g., 200ms), the system determines that the input power supply has changed from a power-off state to a power-on state, thereby generating a power-on event.

[0031] By introducing a dual verification mechanism of "voltage threshold comparison" and "duration determination," the accuracy and anti-interference capability of power status detection in industrial computing devices are significantly improved. Industrial environments are complex, and power lines are often accompanied by instantaneous voltage spikes or drops (glitches). By setting a first preset duration and a second preset duration, the system can effectively filter out these extremely short-lived voltage fluctuations, preventing erroneous power-down or power-up processes due to momentary interference. The introduction of time windows ensures the stability of power state switching, preventing repeated jumps near critical voltage points, thereby protecting hardware circuits and reducing the risk of file system corruption caused by frequent abnormal power-on and power-off cycles.

[0032] In some embodiments of this application, the execution of power failure or power-on events is scheduled according to the current operating state, specifically as follows: Write the power failure event or power-on event to the event cache queue; Events are retrieved from the event cache queue and executed according to the first-in-first-out (FIFO) principle or the event priority principle.

[0033] When the system detects a change in power status and generates a corresponding power-down or power-on event, it does not immediately interrupt the device's current operating logic. Instead, it first writes these events as instruction objects into a dedicated event cache queue for temporary storage. Subsequently, the system's event scheduler continuously monitors this queue and extracts events to be processed according to preset rules: Under normal circumstances, the system follows the "first-in, first-out" (FIFO) principle to ensure that events are processed sequentially according to the order in which they occur; however, in specific emergency scenarios, the system can switch to the "event priority" principle, prioritizing the extraction and execution of events with higher criticality (e.g., power-down protection events have a higher priority than regular power-on events).

[0034] By introducing event caching queues and flexible scheduling strategies, the logical robustness and operational stability of industrial computing devices in complex power environments are significantly improved. In industrial settings, power supplies may experience extremely high-frequency continuous fluctuations (such as multiple instantaneous on / off cycles due to poor contact). The queuing mechanism effectively buffers these sudden and dense events, preventing later events from overwriting or interrupting preceding events being processed, thereby avoiding system crashes or state corruption due to logical conflicts. By supporting the "event priority" principle, the system can break the conventional time sequence and prioritize and execute safe shutdown procedures when facing the risk of catastrophic power failures, maximizing the security of core data and the reliability of device hardware.

[0035] In some embodiments of this application, when a power failure event is received while the device is powered on, a power-off request is recorded, and a power-off process is executed after the device has finished powering on, specifically as follows: If a power failure is detected during device startup, a power failure interrupt signal is generated. Based on the power failure interruption signal, mark the current device status as "pending shutdown"; When the input power is restored, the control device continues to complete the current startup process; After the operating system and applications are fully loaded and running, the shutdown process is triggered.

[0036] When the system detects a sudden interruption of input power during device startup (such as during BIOS self-test or system boot), it immediately generates a power failure interrupt signal and marks the device's current state as "pending shutdown" based on this signal, while suspending the current startup process. When input power is restored, the system does not immediately shut down but prioritizes controlling the device to complete the previously incomplete startup process. Only after the operating system and core applications are fully loaded and the device has successfully entered a stable operating state will the system automatically read the "pending shutdown" flag and trigger the standard shutdown procedure.

[0037] By employing a delayed startup strategy—"complete startup first, then perform shutdown"—this solution effectively resolves the system logic deadlock problem caused by power outages during the startup process of industrial computing devices. If startup is forcibly interrupted due to a power failure, the device is highly susceptible to entering a vicious cycle of incomplete system file loading or repeated restarts upon power-up. This solution ensures that the operating system is loaded completely and orderly into a stable state. Executing the standard software shutdown command only after the system is fully operational ensures that cached data in memory is safely written to the disk and the file system is properly unloaded. This minimizes the risk of system file corruption or data loss due to abnormal power outages, significantly improving the device's self-healing capabilities and long-term operational reliability.

[0038] In some embodiments of this application, when a power-on event is received while the device is in a power-off processing state, a startup request is recorded, and a startup process is executed after the device completes power-off, specifically as follows: If the input power is detected to be restored during the device shutdown process, a power-on interrupt signal is generated; Based on the power-on interrupt signal, mark the current device status as "pending startup"; The control device continues to complete the current safe shutdown procedure; After the device is completely powered off and the system state is saved, the startup process is automatically triggered.

[0039] When the system detects that power is suddenly restored to the device while it is performing a shutdown process (such as the operating system stopping background services, saving data, or uninstalling drivers), it immediately generates a power-on interrupt signal and marks the device's current state as "pending startup" based on this signal, while suspending the upcoming startup process. At this time, the control logic forces the device to ignore the fact that power has been restored and continue to complete the currently incomplete safe shutdown process. Only after the device has completely completed the shutdown process and all system states and critical data have been safely saved will the system automatically read the "pending startup" flag and trigger the execution of the standard startup process.

[0040] By employing a conflict prevention strategy of "completing shutdown first, then executing startup," this solution effectively resolves the file system corruption and logical conflicts caused by power fluctuations during the shutdown process of industrial computing equipment. During shutdown, the system often performs numerous disk read / write operations. If a forced shutdown and immediate restart are interrupted due to an unexpected power surge, file system corruption or loss of critical data is highly likely. This solution ensures the integrity of the current shutdown process and guarantees the safe storage of data on disk. By suspending startup requests and waiting for the system to completely shut down, it avoids driver loading failures or system crashes that might occur if the device is forcibly started in a "partially shut-down" state. This ensures a logical closed loop in the device's state transition and significantly improves the self-healing capability and operational stability of industrial field equipment under harsh power conditions.

[0041] In some embodiments of this application, when a power failure event is received while the device is in operation, a safe shutdown procedure is executed, specifically as follows: Determine whether an energy storage power supply module is configured; If so, then use the backup power provided by the energy storage power supply module to send a shutdown command to the operating system; Monitor the shutdown progress of the operating system, maintain power supply to core components before the backup power is exhausted, and receive feedback that the shutdown is complete.

[0042] When the system is running and receives a power failure event, it first checks whether the device is equipped with an energy storage module (such as a supercapacitor, backup battery, or UPS). If the module is confirmed to be present, the system immediately switches to backup power mode, using the temporary backup power provided by the energy storage module to send a standard shutdown command to the operating system. During this process, the control logic monitors the shutdown progress of the operating system in real time and intelligently allocates power, prioritizing power supply to core components such as the CPU, memory, and storage until the backup power is exhausted, until a shutdown completion signal is received from the operating system, ultimately achieving an orderly system shutdown.

[0043] By introducing an energy storage power supply module and a shutdown progress monitoring mechanism, a critical "data protection window" is provided for industrial computing equipment in the event of unexpected power outages. In extreme cases of sudden external power interruption, backup power can support the system in completing the final cached data writing and file system unloading operations, effectively preventing system file corruption, database crashes, or loss of important business data due to sudden power outages. By monitoring the shutdown progress in real time and maintaining power supply to core components, the system can maximize the use of limited backup energy, ensuring a smooth and safe shutdown process before the power is completely exhausted, significantly improving the reliability and data security of industrial equipment in harsh power supply environments.

[0044] In some embodiments of this application, the method further includes: Establish an abnormal power-on / off log to record the occurrence time, event type, and current operating status of the equipment for each power-off or power-on event. Store abnormal power-on / off logs and output alarm information or status reports when the device is started up again.

[0045] The system internally maintains a dedicated log for abnormal power-on and power-off events. Whenever a power-off or power-on event is triggered, it captures and records in real-time the precise timestamp of the event, the event type (e.g., power-on, power-off), and the device's current operating status (e.g., power-on, running, power-off). This log data is persistently stored in the device's non-volatile storage media (e.g., Flash, EEPROM, or SD card) to ensure data integrity even in the event of a complete power outage. When the device successfully boots up again, the system automatically reads and parses these historical logs and outputs corresponding alarm information or detailed status reports to maintenance personnel via indicator lights, screen display, serial port printing, or reporting to a host computer.

[0046] By fully recording the time of abnormal power-on and power-off events and the equipment status, maintenance personnel can clearly review the equipment's historical operating trajectory and quickly locate the power supply issues that caused the abnormal restarts or shutdowns. This effectively solves the pain point of difficulty in reproducing and troubleshooting intermittent faults in industrial settings. After restarting, the equipment proactively outputs alarms or status reports, allowing maintenance personnel to immediately know that the equipment has experienced an abnormal power outage. This enables them to promptly check the external power supply environment or the health of the equipment hardware, transforming reactive maintenance into proactive preventative maintenance and significantly reducing the risk of unexpected equipment downtime.

[0047] In some embodiments of this application, the method further includes: Count the number of power outage or power-on events generated within a preset time window; If the number of occurrences exceeds the preset safety threshold, the power supply environment is determined to be abnormal. Generate a delay protection command. After receiving a new power-on event, the control device delays the preset protection time before executing the startup process, or suspends the response to the new power-on event until the power supply status is continuously stable for the preset time.

[0048] The system will continuously count the cumulative number of power outage or power-on events generated within a preset time window (e.g., within 1 minute). When the number of events exceeds a preset safety threshold, the system will determine that there is a serious anomaly in the current external power supply environment (such as poor power contact or severe grid fluctuations). At this time, the system will automatically generate a delay protection command and adjust the device's response strategy accordingly: when the device receives a new power-on event, it will no longer immediately execute the startup process, but will forcibly delay the preset protection duration (e.g., wait 30 seconds or 1 minute); or it will directly suspend the response to new power-on events until the external power supply status is continuously and stably maintained for the preset duration before unlocking and allowing the device to start normally.

[0049] By introducing event frequency statistics and intelligent delay protection mechanisms, a "fuse protection" defense line is built for industrial computing equipment to cope with extremely harsh power supply environments. In highly unstable power supply environments, if equipment repeatedly restarts due to power supply fluctuations, it can easily damage hardware such as power modules and hard drives due to instantaneous current surges. The delay protection mechanism effectively avoids the periods of most severe power fluctuations, allowing the equipment to restart only after power supply has stabilized, significantly extending the lifespan of the hardware. By setting safety thresholds and stable waiting times, the system can identify and block invalid, frequent power-on triggers, preventing the logical dead loop where the equipment repeatedly attempts to start near voltage critical points but fails to enter normal operation, thus ensuring the equipment's normal self-healing and stable operation after the power supply environment is restored.

[0050] A second aspect of this application provides an industrial computing device with an automatic power-on / off control device for abnormal power-on / off cycles, comprising: The power detection module is adapted to generate a power-down event when it detects that the input power supply has changed from a powered state to a powered-off state; and to generate a power-on event when it detects that the input power supply has changed from a powered-off state to a powered state. The status acquisition module is suitable for acquiring the current operating status of industrial computing devices, including the current operating status, power-on status, running status, and power-off processing status. The event scheduling module is suitable for scheduling and executing power failure or power-on events based on the current operating status; The first execution module is adapted to record the shutdown request when a power failure event is received while the device is in the power-on state, and to execute the shutdown process after the device has completed power-on. The second execution module is adapted to receive a power-on event when the device is in the power-off process, record the startup request, and execute the startup process after the device has finished powering off. The third execution module is adapted to execute a safe shutdown procedure when a power failure event is received while the device is in operation.

[0051] The industrial computing device power-on / off self-recovery control device provided in the second aspect of this application can realize the industrial computing device power-on / off self-recovery control method in any of the first aspects above. Therefore, it can achieve any of the technical effects in the above industrial computing device power-on / off self-recovery control method, which will not be elaborated here.

[0052] A third aspect of this application provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, it implements the industrial computing device abnormal power-on / off self-recovery power-on / off control method described in any of the first aspects above.

[0053] For any parts not mentioned in this application, existing technologies may be used or referenced.

[0054] The various embodiments in this specification are described in a progressive manner. The same or similar parts between the various embodiments can be referred to each other. Each embodiment focuses on describing the differences from other embodiments.

[0055] The above description is merely an embodiment of this application and is not intended to limit this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.

Claims

1. A method for self-recovering power-on / off control of an industrial computing device in case of abnormal power-on / off, characterized in that, include: A power-down event is generated when the input power supply changes from a powered-on state to a powered-off state; a power-on event is generated when the input power supply changes from a powered-off state to a powered-on state. Obtain the current operating status of the industrial computing device, including the current operating status as powered off, powered on, running, and in the process of powering off; The power failure event or power-on event is scheduled and executed according to the current operating status; If a power failure event is received while the device is powered on, the power-off request is recorded, and the power-off process is executed after the device has finished powering on. When a power-on event is received while the device is in the power-off process, the startup request is recorded, and the startup process is executed after the device has finished shutting down. If a power failure event is received while the device is in operation, a safe shutdown procedure is executed.

2. The industrial computing equipment abnormal power-on / off self-recovery power-on / off control method according to claim 1, characterized in that, When the input power supply is detected to change from a powered state to a powered-off state, a power-down event is generated; when the input power supply is detected to change from a powered-off state to a powered-on state, a power-on event is generated, specifically as follows: The real-time voltage value of the input power supply is obtained through a voltage sampling circuit; The real-time voltage value is compared with a preset voltage threshold. If the real-time voltage value is lower than the preset voltage threshold and the duration reaches the first preset duration, it is determined that the input power supply changes from the power supply state to the power off state, and a power failure event is generated. If the real-time voltage value is higher than the preset voltage threshold and the duration reaches the second preset duration, it is determined that the input power supply has changed from a power-off state to a power-on state, and a power-on event is generated.

3. The industrial computing equipment abnormal power-on / off self-recovery power-on / off control method according to claim 1, characterized in that, The specific steps for scheduling and executing the power failure or power-on event based on the current operating state are as follows: Write the power failure event or power-on event into the event cache queue; Events are retrieved from the event cache queue and executed according to the first-in-first-out (FIFO) principle or the event priority principle.

4. The industrial computing equipment abnormal power-on / off self-recovery power-on / off control method according to claim 1, characterized in that, When a power failure event is received while the device is powered on, a shutdown request is recorded, and the shutdown process is executed after the device has finished powering on, specifically as follows: If a power failure is detected during device startup, a power failure interrupt signal is generated. Based on the power failure interruption signal, the current device status is marked as "pending shutdown"; When the input power is restored, the control device continues to complete the current startup process; After the operating system and applications are fully loaded and running, the shutdown process is triggered.

5. The industrial computing equipment abnormal power-on / off self-recovery power-on / off control method according to claim 1, characterized in that, When a power-on event is received while the device is in a shutdown process, a startup request is recorded, and the startup process is executed after the device has finished shutting down. Specifically: If the input power is detected to be restored during the device shutdown process, a power-on interrupt signal is generated; Based on the power-on interruption signal, the current device status is marked as "pending startup"; The control device continues to complete the current safe shutdown procedure; After the device is completely powered off and the system state is saved, the startup process is automatically triggered.

6. The industrial computing equipment abnormal power-on / off self-recovery power-on / off control method according to claim 1, characterized in that, When a power failure event is received while the device is in operation, a safe shutdown procedure is executed, specifically as follows: Determine whether an energy storage power supply module is configured; If so, then the backup power provided by the energy storage power supply module is used to send a shutdown command to the operating system; Monitor the shutdown progress of the operating system, maintain power supply to core components before the backup power is exhausted, and receive feedback that the shutdown is complete.

7. The industrial computing device abnormal power-on / off self-recovery power-on / off control method according to any one of claims 1 to 6, characterized in that, The method also includes: Establish an abnormal power-on / off log to record the occurrence time, event type, and current operating status of the equipment for the power-off or power-on event; Store the abnormal power-on / off logs and output alarm information or status reports when the device is started up again.

8. The industrial computing device abnormal power-on / off self-recovery power-on / off control method according to any one of claims 1 to 6, characterized in that, The method also includes: Count the number of power outage or power-on events generated within a preset time window; If the number of occurrences exceeds a preset safety threshold, the power supply environment is determined to be abnormal. Generate a delay protection command. After receiving a new power-on event, the control device delays the preset protection time before executing the startup process, or suspends the response to the new power-on event until the power supply status is continuously stable for the preset time.

9. A self-recovery power-on / off control device for abnormal power-on / off of industrial computing equipment, characterized in that, include: The power detection module is suitable for generating a power failure event when it detects that the input power supply has changed from a powered state to a powered-off state; When the input power supply is detected to change from a power-off state to a power-on state, a power-on event is generated; The status acquisition module is suitable for acquiring the current operating status of industrial computing devices, including power-off status, power-on status, running status, and power-off processing status. The event scheduling module is adapted to schedule the execution of the power failure event or power-on event according to the current operating state; The first execution module is adapted to record the shutdown request when a power failure event is received while the device is in the power-on state, and to execute the shutdown process after the device has completed power-on. The second execution module is adapted to receive a power-on event when the device is in the power-off process, record the startup request, and execute the startup process after the device has finished powering off. The third execution module is adapted to execute a safe shutdown procedure when a power failure event is received while the device is in operation.

10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the industrial computing device abnormal power-on / off self-recovery power-on / off control method as described in any one of claims 1 to 8.