Power-down protection method, device and equipment for intelligent storage high-computing-power industrial control chip

By monitoring the power voltage of the industrial control chip in real time and starting the ping-pong power-down protection mechanism, the problem of data loss during power-down by industrial control chips is solved, efficient data management and protection is achieved, the system continuity and stability are ensured, and the system is stable and improved. Overall performance of industrial control systems.

CN119311480APending Publication Date: 2025-01-14SHENZHEN MICRO INNOVATION IND CO LTD

Patent Information

Application Number
CN202411867736.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-18
Publication Date
2025-01-14

AI Technical Summary

Technical Problem

Existing industrial control chips are prone to loss or damage when powered down, which affects the reliability and stability of the system and fails to effectively handle data storage and synchronization requirements in high computing tasks.

Method used

By monitoring the power voltage of the industrial control chip in real time, generating a power-down signal, starting a ping-pong power-down protection mechanism, storing the task-processed data in segments to the main and backup data storage area, and data is performed based on the data verification code and non-volatile memory. Synchronize to ensure that data can be restored and restarted the calculation tasks after power is restored.

Benefits of technology

Effectively avoid data loss caused by sudden power failure, ensure data integrity and consistency, improve system reliability and stability, and ensure data security and continuity of high computing power industrial control chips in complex computing tasks. .

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119311480A_ABST
    Figure CN119311480A_ABST
Patent Text Reader

Abstract

The invention relates to a power-down protection method, device and equipment for an intelligent storage high-computing-power industrial control chip, and the method comprises the steps: monitoring the power supply voltage of the industrial control chip in real time, generating a power-down signal when the power supply voltage is lower than a preset voltage threshold range, reading the task processing data of a current computing task, and pausing the current computing task; starting a ping-pong power failure protection mechanism according to the power failure signal, storing task processing data in a preset main and standby data storage area in a segmented manner, and generating a data check code; performing data synchronization on the main and standby data storage areas and a preset nonvolatile memory based on the data check code to obtain backup data, and generating a synchronous check code; when the power supply voltage recovers to accord with the voltage threshold range, performing data reading on the nonvolatile memory according to the synchronous check code to obtain backup data; and performing data recovery on the backup data according to the data check code, and restarting the current calculation task. According to the invention, chip data loss caused by sudden power failure can be avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of power-off protection, and in particular to a power-off protection method, device and equipment for an intelligent storage high-computing power industrial control chip. Background Art

[0002] As a core component of modern industrial automation and control systems, intelligent storage high-computing power industrial control chips are widely used in various industrial applications due to their high performance and reliability. As the industrial field's requirements for data processing capabilities and system stability continue to increase, how to ensure data integrity and task continuity when industrial control chips encounter power failures has become one of the research focuses. Existing power-off protection methods usually rely on a single storage mechanism or simplified voltage monitoring methods, ignoring the high requirements of high-computing power industrial control chips for data storage and synchronization when processing complex computing tasks. This simplified approach may cause data loss or damage in the event of a power failure, thereby affecting the reliability and stability of the entire industrial control system. Summary of the invention

[0003] The main purpose of the present invention is to provide a power-off protection method, device and equipment for an intelligent storage high-computing power industrial control chip, which can avoid data loss caused by sudden power failure.

[0004] To achieve the above object, the present invention provides a power-off protection method for an intelligent storage high-computing power industrial control chip, comprising: Real-time monitoring of the power supply voltage of the industrial control chip, when the power supply voltage is lower than a preset voltage threshold range, a power-off signal is generated, task processing data of the current computing task is read, and the current computing task is suspended; Starting a ping-pong power-off protection mechanism according to the power-off signal, storing the task processing data in segments into a preset primary and backup data storage area, and generating a data check code; Based on the data check code, the primary and backup data storage areas are synchronized with a preset non-volatile memory to obtain backup data, and a synchronization check code is generated; When the power supply voltage is restored to meet the voltage threshold range, data is read from the non-volatile memory according to the synchronization check code to obtain the backup data; The backup data is restored according to the data verification code, and the current computing task is restarted.

[0005] Furthermore, the real-time monitoring of the power supply voltage of the industrial control chip, when the power supply voltage is lower than a preset voltage threshold range, generates a power-off signal, reads the task processing data of the current computing task, and suspends the current computing task, including: Sampling the power supply voltage of the industrial control chip to obtain a real-time voltage value; Determine whether the real-time voltage value meets the voltage threshold range, and when the real-time voltage value meets the voltage threshold range, generate a protection comparison result, and continue to execute the current computing task according to the protection comparison result; When the real-time voltage value does not meet the voltage threshold range, a power-off signal is generated; Extracting the current computing task from the target data storage area of ​​the industrial control chip according to the power-off signal, and performing task reading to obtain task status data and the task processing data; Performing work status analysis based on the task status data to obtain a corresponding pause instruction; The current computing task is suspended according to the suspension instruction.

[0006] Further, the ping-pong power-off protection mechanism is started according to the power-off signal, the task processing data is stored in segments in a preset primary and backup data storage area, and a data check code is generated, including: Analyze and process the power-off signal to obtain corresponding power-off trigger information, start the ping-pong power-off protection mechanism according to the power-off trigger information, and segment the task processing data to obtain multiple task data segments; Performing encoding processing on each of the plurality of task data segments, and generating a corresponding allocation check code; Dividing the primary and backup data storage areas according to the power-off signal to obtain a primary data storage area and a backup data storage area; Performing storage allocation on the primary data storage area and the backup data storage area according to the allocation check code to obtain a corresponding primary allocation check code and a backup allocation check code; Performing master data storage processing on the plurality of task data segments according to the master allocation check code, and storing the plurality of task data segments in the master data storage area in a preset order; According to the backup check code, storing the plurality of task data segments in the backup data storage area in the preset order; The main allocation check code and the backup allocation check code are integrated to obtain the data check code.

[0007] Further, the step of synchronizing the primary and backup data storage areas with a preset non-volatile memory based on the data check code to obtain backup data and generate a synchronization check code includes: Synchronously read data from the primary and backup data storage areas to obtain a target synchronous data set; Calculating a check code on the target synchronization data set to obtain a first target check code; Storing the target synchronization data set in the non-volatile memory to obtain a stored data set; Performing check code calculation on the stored data set to obtain a second target check code; Verifying the first target verification code and the second target verification code, and when the first target verification code and the second target verification code are inconsistent, re-storing the target synchronization data set into the non-volatile memory; When the first target verification code is consistent with the second target verification code, the stored data set is marked as the backup data, and the synchronization verification code is generated.

[0008] Further, when the power supply voltage is restored to meet the voltage threshold range, reading the backup data from the non-volatile memory according to the synchronization check code includes: When it is monitored that the power supply voltage is restored to meet the voltage threshold range, data matching and extraction are performed with the non-volatile memory according to the synchronization check code to obtain corresponding matching backup data; Verify the matching backup data according to the synchronization verification code, and initialize the verification variable to 0xFFFF; The matching backup data is processed byte by byte, and the processing steps for each byte include: Perform XOR operation on the current byte and the lower 8 bits of the check variable, and assign the result to the lower 8 bits of the check variable; Perform shift and polynomial operations on check variables, including: Shift the check variable right by one bit and fill the highest bit with 0; Check the least significant bit of the check variable after right shift: When the lowest bit is 1, the check variable is XORed with the predefined polynomial 0xA001; When the lowest bit is 0, no XOR operation is performed; Repeat the above shifting and checking steps 8 times in total; After processing all bytes, the current calculated checksum is obtained; The synchronization check code is matched and compared with the current calculation check code, and when the synchronization check code is consistent with the current calculation check code, the matching backup data is set as the backup data.

[0009] Further, the performing data recovery on the backup data according to the data verification code and restarting the current computing task includes: Performing integrity check on the backup data according to the data check code to obtain a check result; Decoding the backup data according to the data verification code and the verification result to obtain the task processing data; Performing state recovery analysis on the current computing task according to the task processing data to obtain a corresponding recovery instruction; Restart the current computing task according to the recovery instruction.

[0010] The present invention also provides a power-off protection device for an intelligent storage high-computing power industrial control chip, which is applied to any one of the above-mentioned power-off protection methods for an intelligent storage high-computing power industrial control chip, comprising: An acquisition module, the acquisition module is used to monitor the power supply voltage of the industrial control chip in real time, and when the power supply voltage is lower than a preset voltage threshold range, a power-off signal is generated, task processing data of the current computing task is read, and the current computing task is suspended; An analysis module, the analysis module is used to start a ping-pong power-off protection mechanism according to the power-off signal, store the task processing data in segments into a preset primary and backup data storage area, and generate a data check code; An association module, the association module is used to synchronize the data between the primary and backup data storage areas and a preset non-volatile memory based on the data verification code to obtain backup data and generate a synchronization verification code; A processing module, wherein the processing module is used to read data from the non-volatile memory according to the synchronization check code to obtain the backup data when the power supply voltage is restored to meet the voltage threshold range; A control module, wherein the control module is used to restore the backup data according to the data verification code and restart the current computing task.

[0011] The present invention also provides a power-off protection device for an intelligent storage high-computing power industrial control chip, comprising: Memory, used to store programs; The processor is used to execute the program to implement each step of the power-off protection method for an intelligent storage high-computing power industrial control chip described in any one of the above items.

[0012] The present invention provides a power-off protection method, device and equipment for an intelligent storage high-computing power industrial control chip, which has the following beneficial effects: By monitoring the power supply voltage of the industrial control chip in real time and generating a power-off signal when the voltage is lower than the preset threshold, the task processing data of the current computing task can be read in time and the task operation can be suspended, thereby avoiding data loss caused by sudden power failure. By starting the ping-pong power-off protection mechanism, the task processing data is segmented and stored in the main and standby data storage areas, and a data check code is generated, so that efficient data management and protection are achieved. Data synchronization is performed with the non-volatile memory based on the data check code to ensure the integrity and consistency of the data in the case of power failure. After the power supply voltage is restored, data is read and restored based on the synchronization check code to ensure that the computing task can be accurately restarted to maintain the continuity and stability of the system. This power-off protection method can effectively solve the problem of data loss or damage in the case of power failure in the prior art, and significantly improves the reliability and stability of the system. Through the refined data storage and synchronization mechanism, the data security and continuity of high-computing power industrial control chips in complex computing tasks are ensured, which helps to improve the overall performance of industrial control systems. By comprehensively utilizing real-time monitoring and data verification technology, an efficient power-off protection and data recovery mechanism is realized, so that the system can maintain efficient and stable operation in a variety of application scenarios, thereby meeting the requirements of modern industrial automation for high reliability and high stability. BRIEF DESCRIPTION OF THE DRAWINGS

[0013] Figure 1 This is a flow chart of a power-off protection method for an intelligent storage high-computing power industrial control chip provided by the present invention; Figure 2 This is a structural diagram of a power-off protection device for an intelligent storage high-computing power industrial control chip provided by the present invention; Figure 3 This is a structural diagram of a power-off protection device for an intelligent storage high-computing power industrial control chip provided by the present invention.

[0014] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0015] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.

[0016] The present invention is further described below in conjunction with the accompanying drawings and specific implementation methods.

[0017] Reference Figure 1 As shown, the present invention provides 1. a power-off protection method for an intelligent storage high-computing power industrial control chip, comprising: Step S1: monitor the power supply voltage of the industrial control chip in real time. When the power supply voltage is lower than a preset voltage threshold range, generate a power-off signal, read the task processing data of the current computing task, and suspend the current computing task; Step S2: starting a ping-pong power-off protection mechanism according to the power-off signal, storing the task processing data in segments into a preset primary and backup data storage area, and generating a data check code; Step S3: Based on the data check code, the primary and backup data storage areas are synchronized with the preset non-volatile memory to obtain backup data and generate a synchronization check code; Step S4: when the power supply voltage is restored to meet the voltage threshold range, data is read from the non-volatile memory according to the synchronization check code to obtain backup data; Step S5: restore the backup data according to the data verification code and restart the current computing task.

[0018] Based on the above steps, the detailed process is as follows: Step S1: Real-time monitoring of the power supply voltage of the industrial control chip. The preset voltage threshold range refers to the minimum and maximum voltage values ​​at which the industrial control chip can work stably. When the power supply voltage is lower than this range, the computing task will be interrupted or data will be lost.

[0019] When the power supply voltage is detected to be lower than the preset threshold, a power-off signal is immediately generated, which notifies the system to perform subsequent operations through hardware interrupt or software interrupt.

[0020] After the power-off signal is generated, the current computing task is interrupted, and the task processing data of the current computing task is read and saved. The task processing data includes key information such as register content, memory data, and task status. While reading the data, the current computing task is paused to prevent further changes in the data.

[0021] Step S2: Start the ping-pong power-off protection mechanism, which refers to using two alternating storage areas to store data to improve the reliability of data storage. When a power-off signal is received, the mechanism is automatically enabled to ensure that data can be safely stored at the moment of power off.

[0022] Task processing data may be large, so it is segmented and stored in the primary and backup data storage areas. Segmented storage helps to increase data writing speed and save as much data as possible during power failure.

[0023] Two storage areas are pre-divided: the primary data storage area and the backup data storage area. The primary and backup data storage areas can be allocated on RAM or other fast storage media.

[0024] After each data storage operation is completed, a corresponding data verification code is generated. The data verification code is used for subsequent data verification.

[0025] Step S3: Before synchronizing the data from the primary and backup data storage areas to the non-volatile memory, verify the data check code to ensure that the data in the primary and backup data storage areas are correct and undamaged.

[0026] Based on the data check code, the data in the primary and backup data storage areas are synchronized to the non-volatile memory. The non-volatile memory can be a type of memory such as EEPROM, NVRAM, Flash, etc., which can keep the data from being lost after power failure.

[0027] After synchronization is completed, a synchronization check code is generated for the backup data in the non-volatile memory. The synchronization check code is used for subsequent data recovery to ensure the consistency and integrity of the backup data.

[0028] Step S4: When the power supply voltage of the industrial control chip returns to within the preset voltage threshold range, the voltage status is detected in real time through the voltage monitoring module. When the voltage returns to a safe range, it is confirmed that the current power status supports data recovery operations to avoid unnecessary operations when the power is unstable.

[0029] Before data restoration, the synchronization check code is read from the non-volatile memory to verify the integrity and consistency of the backup data.

[0030] The read backup data is compared with the synchronization check code. If the check codes match, it proves that the data is intact and complete.

[0031] If the checksums do not match, it may indicate that the data was corrupted during storage, and take alternative recovery measures (such as reinitializing the task).

[0032] After verification, the backup data is read from the non-volatile memory. The backup data usually includes key information such as the task status, register content, and memory data of the computing task, ensuring that the restored computing task can continue the original state.

[0033] Step S5: After reading the backup data, the data is verified again according to the data verification code to ensure that the data is not damaged during the reading process from the non-volatile memory.

[0034] After the data verification is passed, the backup data is written back to the corresponding task processing area, including registers, memory, etc. These backup data can restore the intermediate state of the computing task, so that the task can continue to execute from the state where it was last interrupted.

[0035] After the data is restored, the previously paused computing task is restarted. The computing task will continue to execute in the original state during the recovery process, ensuring that the impact of power failure recovery on the task is minimized.

[0036] After restarting the task, the status is monitored for a period of time to ensure that the power supply voltage is stable and the task has returned to normal. If the voltage abnormality is detected again during the recovery process, the power-off protection mechanism is re-entered to prevent data loss again.

[0037] The present invention provides a power-off protection method for an intelligent storage high-computing power industrial control chip. By real-time monitoring of the power supply voltage of the industrial control chip and generating a power-off signal when the voltage is lower than a preset threshold, the task processing data of the current computing task can be read in time, and the task operation can be suspended, thereby avoiding data loss caused by sudden power failure. By starting a ping-pong power-off protection mechanism, the task processing data is segmented and stored in the main and standby data storage areas, and a data check code is generated, thereby realizing efficient management and protection of the data. Data synchronization is performed with a non-volatile memory based on the data check code, thereby ensuring the integrity and consistency of the data in the case of power failure. After the power supply voltage is restored, data is read and restored based on the synchronization check code, ensuring that the computing task can be accurately restarted, and maintaining the continuity and stability of the system. This power-off protection method can effectively solve the problem of data being easily lost or damaged in the case of power failure in the prior art, and significantly improves the reliability and stability of the system. Through a refined data storage and synchronization mechanism, the data security and continuity of the high-computing power industrial control chip in complex computing tasks are ensured, which helps to improve the overall performance of the industrial control system. By comprehensively utilizing real-time monitoring and data verification technologies, an efficient power-off protection and data recovery mechanism is implemented, enabling the system to maintain efficient and stable operation in a variety of application scenarios, thus meeting the needs of modern industrial automation for high reliability and high stability.

[0038] In one embodiment, the power supply voltage of the industrial control chip is monitored in real time. When the power supply voltage is lower than a preset voltage threshold range, a power-off signal is generated, task processing data of the current computing task is read, and the current computing task is suspended, including: Monitor the power supply voltage of the industrial control chip in real time. The power supply voltage is sampled through the built-in voltage sampling module to obtain the current real-time voltage value. The monitoring process will compare the real-time voltage value with the preset voltage threshold range to determine whether the current voltage is within the safe range.

[0039] When the real-time voltage value meets the preset voltage threshold range, a protection comparison result is generated, indicating that the voltage is in a normal state. In this case, the industrial control chip continues to perform the current computing task without any interruption.

[0040] However, if the real-time voltage value exceeds the preset voltage threshold range, for example, when the voltage value is detected to be lower than 4.75V or higher than 5.25V, A power-off signal is immediately generated. This power-off signal triggers the subsequent protection action. According to the power-off signal, the information of the current computing task is extracted from the target data storage area of ​​the industrial control chip, including task status data and task processing data.

[0041] The task status data reflects the execution status of the current computing task, while the task processing data contains the intermediate results and necessary processing information generated during the task. Based on the task status data, the working status analysis is performed to determine whether the current computing task needs to be paused, and the specific operation steps to be performed when pausing.

[0042] After completing the work status analysis, a corresponding pause instruction is generated. According to the pause instruction, the industrial control chip pauses the current computing task. The pause instruction ensures that the industrial control chip will not continue high-computing power calculations before the power supply voltage returns to a safe range, preventing data loss or calculation errors under unstable voltage conditions.

[0043] This embodiment implements a power-off protection method in an intelligent storage high-computing power industrial control chip, which can effectively monitor the power supply voltage and generate a power-off signal when the voltage is lower than a preset threshold range, thereby timely protecting the data integrity and system stability of the current computing task. This method ensures that in the case of abnormal voltage, task status data and processing data can be quickly extracted, and a pause instruction can be triggered to prevent data loss or calculation errors through real-time voltage monitoring and comparison. This greatly improves the reliability and adaptability of industrial control chips in practical applications.

[0044] In one embodiment, a ping-pong power-off protection mechanism is activated according to a power-off signal, the task processing data is segmented and stored in a preset primary and backup data storage area, and a data check code is generated, including: After receiving the power-off trigger information, the ping-pong power-off protection mechanism is activated. The core of this mechanism is to process the task processing data in segments. After each task data segment is independently encoded, the corresponding distribution check code is generated. This process is crucial in the fusion solution because it provides an independent check mechanism for each data segment to ensure the integrity of the data during storage and recovery.

[0045] For example, suppose that an industrial control chip is processing an important task, such as real-time monitoring data processing on an industrial production line. When a power-off signal is detected, a power-off trigger message is generated, which is like an alarm, notifying the chip to enter an emergency state. The amount of data currently being processed may be very large, such as 1GB of data, which will be divided into multiple small segments, each of which may be 1MB or other suitable sizes. Each task data segment carries independent checksum information after independent processing. For example, the distribution checksum generated by the task data segment "Data Segment A" after encoding processing may be "Checksum_A".

[0046] The power-off signal is used to dynamically divide the storage area, dividing the storage space into the primary data storage area and the backup data storage area. This dynamic division enables redundant data storage without increasing hardware complexity. For example, assuming that the capacity of the primary data storage area is 1GB and the capacity of the backup data storage area is also 1GB, the storage capacity of the two areas is guaranteed to be the same. In the primary data storage area and the backup data storage area, the fusion solution stores the task data segments in a preset order. The preset order can be optimized according to the priority or data type of the task data so that critical data can be processed first during recovery.

[0047] During the storage process, the main allocation checksum is responsible for specifying the storage location of the task data segment in the main data storage area, while the backup allocation checksum is responsible for the storage location of the backup data storage area. This dual checksum storage mechanism ensures that even if the data in one storage area is damaged, the data in the other area can still be used for recovery. For example, the main allocation checksum corresponding to the storage location of the task data segment "Data Segment A" in the main data storage area may be "Main_Checksum_A", while the backup allocation checksum corresponding to the storage location in the backup data storage area may be "Backup_Checksum_A".

[0048] The checksums between the main data storage and the backup data storage are integrated. By integrating the main distribution checksum and the backup distribution checksum to generate the final data checksum, the integrity of the data can be verified after power failure recovery. This integration not only provides double protection for data, but also simplifies the process of data verification and recovery. Assuming that the main distribution checksum is "Main_Checksum_1, Main_Checksum_2, …, Main_Checksum_N" and the backup distribution checksum is "Backup_Checksum_1, Backup_Checksum_2, …, Backup_Checksum_N", the integrated data checksum may be a combination or encrypted form of these checksums.

[0049] By using the generated data checksum, data can be quickly verified and reconstructed. For example, if an industrial control chip is performing high-precision processing tasks, real-time monitoring data needs to be continuously processed and stored. When an unexpected power outage occurs, the power-off signal is first detected and the power-off trigger information is parsed. The ping-pong power-off protection mechanism is activated, and the 1GB data being processed is quickly divided into 1000 1MB data segments. Each data segment is independently encoded to generate an assigned checksum, such as "Checksum_1, Checksum_2, ..., Checksum_1000". The power-off signal also triggers the dynamic division of the storage area, with 1GB for the main data storage area and 1GB for the backup data storage area.

[0050] The data segments are stored in the main data storage area and the backup data storage area in a preset order. The storage position of each area is specified by the corresponding main allocation check code and backup allocation check code. Assume that the position of the data segment "Data Segment 1" in the main data storage area is "Main_Pos_1", and the corresponding main allocation check code is "Main_Checksum_1"; the position of the data segment "Data Segment 1" in the backup data storage area is "Backup_Pos_1", and the corresponding backup allocation check code is "Backup_Checksum_1".

[0051] By integrating the main distribution check code and the backup distribution check code, the final data check code "Final_Checksum" is generated, which will be used to verify the integrity of the data after power is restored. When power is restored, the chip uses "Final_Checksum" to quickly verify and rebuild the data, ensuring that the production line can quickly resume normal operation.

[0052] This embodiment can respond quickly to power failures through efficient power failure signal detection and analysis, immediately start the protection mechanism, and effectively reduce the risk of data loss. Secondly, the ping-pong power failure protection mechanism ensures the integrity and recoverability of each data segment through segmented processing and independent encoding of task data, thereby improving the reliability of data storage. In addition, the dynamic division of storage areas into primary and backup data storage areas realizes redundant storage of data. Even if the data in one storage area is damaged, the data in another area can still be used for recovery, enhancing the robustness of data protection. The integrated checksum generation and processing simplifies the data verification and recovery process, ensuring that data can be quickly verified and rebuilt after power is restored, reducing system recovery time.

[0053] In one embodiment, data synchronization is performed between a primary and backup data storage area and a preset non-volatile memory based on a data verification code to obtain backup data and generate a synchronization verification code, including: Synchronous data reading is performed on the primary and backup data storage areas to obtain the target synchronized data set. The operation of synchronous data reading is implemented through the control logic inside the chip, and the purpose is to obtain all the data that currently needs to be backed up. During the reading process, the industrial control chip automatically verifies to ensure that the data is accurate. For example, in an industrial control scenario, the industrial control chip may be recording the measurement data of key sensors in real time. This data must be retained after power failure, so it is stored in the primary and backup data storage areas.

[0054] The checksum is calculated for the target synchronization data set to obtain the first target checksum. The checksum calculation can be completed by CRC (cyclic redundancy check) and MD5 algorithm. The calculated first target checksum is used in the subsequent verification steps to ensure that the data has not changed during the storage process.

[0055] The target synchronization data set is stored in a non-volatile memory to obtain a storage data set. Non-volatile memory keeps data from being lost in the event of a power failure. Common non-volatile memories include EEPROM, flash memory, etc. The storage operation is performed by the storage control module inside the chip to ensure that the data is written completely.

[0056] The checksum is calculated for the stored data set to obtain the second target checksum. The purpose of calculating the checksum again is to verify whether the data has been changed or damaged during the storage process. The calculation method of the second target checksum is the same as that of the first target checksum to ensure the comparability of the checksum results.

[0057] The first target check code is verified with the second target check code. When the first target check code is inconsistent with the second target check code, it means that the data may be erroneous or damaged during the storage process. At this time, the target synchronization data set needs to be re-stored in the non-volatile memory, and the above storage and verification steps are repeated until the check codes are consistent.

[0058] When the first target check code is consistent with the second target check code, it means that the data remains intact and unchanged during the storage process. At this time, the stored data set is marked as backup data and a synchronization check code is generated. The synchronization check code is used for subsequent data verification and recovery operations to ensure that the backup data remains consistent and reliable during the power-off protection process.

[0059] For example, suppose that in an industrial automation production line, a certain sensor records the temperature data of "25.6°C" in real time. These data are first temporarily stored in the main and backup data storage area of ​​the industrial control chip. After the power-off protection mechanism is activated, these data are read to obtain the target synchronization data set, such as "25.6°C". Then, the chip calculates the checksum for it, assuming that the first target checksum generated is "ABC123". Next, "25.6°C" is stored in the non-volatile memory, a storage data set is generated, and the checksum is calculated again, assuming that the second target checksum is also "ABC123". Since the two are consistent, the system will mark this data as backup data and generate a synchronization checksum to complete the backup. If the two checksums are different, for example, the first target checksum is "ABC123" and the second target checksum is "DEF456", it indicates that an error occurred during the data synchronization process, and the data will be stored again and the checksum will be repeated until the results are consistent.

[0060] This embodiment uses data verification codes to achieve data synchronization between the main and backup data storage areas and the non-volatile memory, ensuring that the data is not damaged or lost during storage and transmission, thereby improving the reliability and stability of the system. At the same time, the power-off protection method uses an automatic verification and re-storage mechanism to timely detect and correct data errors in storage, further enhancing data integrity. In addition, by generating a synchronization verification code, the consistency and reliability of the backup data in subsequent operations are ensured, providing a stable power-off protection solution. This method is widely used in industrial control systems that require high-reliability data protection, especially in the fields of intelligent manufacturing and industrial Internet of Things, providing a solid guarantee for the security of critical data. With its efficient data processing capabilities and stability, industrial control chips can operate reliably for a long time in industrial environments, thereby effectively supporting the development of industrial automation.

[0061] In one embodiment, when the power supply voltage is restored to meet the voltage threshold range, the backup data is read from the non-volatile memory according to the synchronization check code, including: When the power supply voltage returns to the preset voltage threshold range, a data recovery operation is triggered. At this time, data matching and extraction are performed based on the synchronization check code stored in the non-volatile memory. The specific operation is to match the synchronization check code with the data in the non-volatile memory and extract the corresponding matching backup data.

[0062] After the data matching and extraction is completed, the extracted matching backup data is verified according to the synchronization check code to ensure the integrity and accuracy of the data. The first step of the verification is to initialize a verification variable, which is set to 0xFFFF for the standard verification algorithm.

[0063] The matching backup data is processed byte by byte. The first step of processing each byte is to perform an XOR operation on the current byte and the lower 8 bits of the check variable, and reassign the result to the lower 8 bits of the check variable. The purpose of this step is to introduce the influence of the data byte so that the check variable reflects the change of the data.

[0064] After the XOR operation is completed, the check variable needs to be shifted and polynomialized. The specific operation includes shifting the check variable right by one bit and filling the highest bit with 0. This right shift operation is to prepare for the subsequent lowest bit check, which exposes the lowest bit of the check variable for inspection.

[0065] Check the lowest bit of the check variable after right shift. If the lowest bit is 1, perform an XOR operation on the check variable, using the predefined polynomial 0xA001. The purpose of this step is to use polynomial operations to further confuse and expand the impact of the data, making the check code more unique and difficult to forge. If the lowest bit is 0, no XOR operation is performed, and the next shift operation is directly entered.

[0066] The above shift and check steps need to be repeated 8 times in total, because each byte has 8 bits, and each shift processes one bit. Through 8 cycles, it is ensured that all bits of each byte participate in the calculation of the check code.

[0067] After all bytes are processed, the currently calculated checksum is obtained. This checksum is calculated based on the matching backup data. In theory, it should be consistent with the stored synchronization checksum. The synchronization checksum is matched and compared with the currently calculated checksum. If the two checksums are consistent, it means that there is no error in the data transmission and storage process, and the matching backup data is considered valid.

[0068] When the synchronization checksum is consistent with the current calculated checksum, the matching backup data is set as valid backup data for subsequent use. This means that the data recovery operation is successfully completed and you can continue to operate normally and use the restored backup data for various operations.

[0069] When the synchronization check code is inconsistent with the current calculated check code, the matching backup data is marked as invalid, and further operations are performed according to the preset logic. Usually the following steps are included: Try to re-extract the data: Rescan the non-volatile memory to see if there are other possible matching backup data. If new backup data is found, re-verify it to determine its validity.

[0070] Trigger alarm mechanism: If no other backup data is found or multiple verifications fail, an alarm signal will be triggered, indicating that the current data recovery operation has failed.

[0071] Restore Default Settings: In case the backup data is not available, it may be possible to restore to the factory defaults or the preset initial state.

[0072] Record error information: The verification failure event will be recorded in the log for subsequent analysis of the cause of the problem. This record usually includes the time of verification failure, the address of the memory, and related voltage fluctuation information.

[0073] Entering protection mode: In some cases, the system will enter protection mode when valid data cannot be recovered, restricting the use of functions until new data is written to the memory or the problem is solved.

[0074] This embodiment introduces a synchronous verification mechanism, which can automatically verify data integrity after power is restored, thereby ensuring the reliability of backup data and improving stability and data security. Even in the event of power fluctuations or unexpected power outages, the correctness of the data can be quickly verified through the verification code to avoid the use of erroneous data. This mechanism can not only automatically trigger exception handling processes such as alarms, re-extracting data, or restoring default settings when data verification fails, but also record error information for subsequent analysis. This design reduces the need for human intervention and improves the automation and accuracy of the data recovery process. In addition, through multiple protection strategies, such as entering protection mode, it can continue to operate safely when data is unavailable, thereby providing an efficient and reliable solution to ensure functional stability and data integrity in various working environments.

[0075] In one embodiment, the backup data is restored according to the data verification code, and the current computing task is restarted, including: Perform integrity check on the backup data based on the stored data verification code. Data verification codes are often used to verify the correctness and integrity of data, and are usually generated using a checksum or hash algorithm. The key to this step is to ensure that the backup data is not damaged or tampered with during power failure, thereby ensuring data reliability.

[0076] When checking the integrity of the backup data based on the data verification code, the current verification code of the backup data is compared with the verification code stored before the power failure to determine whether the data is complete and correct. If the verification codes are consistent, it means that the data is not damaged and the verification result is passed; otherwise, the verification result is failed. If the verification fails, it is necessary to use other redundant backup data for recovery, or prompt fault information for manual intervention. Assuming the verification passes, it will enter the next stage.

[0077] On the premise that the verification result passes, the backup data is decoded according to the data verification code and the verification result. The data decoding process usually involves restoring the encoded data to the original data. In this process, the decoding algorithm will parse the structure of the data packet and restore the task processing data according to the guidance of the data verification code. Task processing data is all the information required for the intelligent storage high-computing power industrial control chip to perform a specific computing task, including but not limited to the execution status, intermediate calculation results, input and output data, etc.

[0078] When the task processing data is successfully restored, the current computing task is analyzed for state recovery based on this data. The purpose of state recovery analysis is to restore the execution state of the task before power failure, ensuring that the computing task can continue from the interruption point instead of starting over. This process usually involves analyzing the execution state information in the task processing data, such as the currently executed steps, completed subtasks, and unprocessed data. By analyzing this information, the corresponding recovery instructions are obtained.

[0079] The recovery instruction is a specific operation instruction used to guide the restart of the computing task. Restart the current computing task according to the recovery instruction. This process needs to strictly follow the guidance of the recovery instruction and gradually restore the execution status of the task. For example, if the task processing data shows that the current task is in a certain intermediate step of data processing, it is necessary to load the corresponding data and status to continue data processing; if the task is in a state of waiting for input, it is necessary to restore the input interface and wait for new input data. In this way, it is ensured that the computing task before power failure can be seamlessly connected and continued.

[0080] This embodiment performs integrity verification through data verification codes, which can effectively prevent data from being damaged or tampered with during power failure, thereby improving data reliability. Through data decoding and state recovery analysis, the execution state of the task before power failure can be accurately restored to ensure that the computing task continues from the interruption point rather than restarting, which greatly improves the efficiency of task processing. By accurately executing the recovery instruction, seamless connection of computing tasks can be achieved, thereby reducing interruption time and improving stability and operating efficiency. This method as a whole not only ensures data security, but also significantly enhances the system's resilience in the event of power fluctuations, ensuring the stable operation of the industrial control system.

[0081] Reference Figure 2 As shown, the present invention provides a power-off protection device for an intelligent storage high-computing power industrial control chip, which is applied to any one of the above-mentioned power-off protection methods for an intelligent storage high-computing power industrial control chip, comprising: The acquisition module is used to monitor the power supply voltage of the industrial control chip in real time. When the power supply voltage is lower than the preset voltage threshold range, a power-off signal is generated, the task processing data of the current computing task is read, and the current computing task is suspended; An analysis module, the analysis module is used to start a ping-pong power-off protection mechanism according to a power-off signal, store the task processing data in segments into a preset primary and backup data storage area, and generate a data check code; An association module, the association module is used to synchronize the data between the primary and backup data storage areas and the preset non-volatile memory based on the data verification code, obtain the backup data, and generate a synchronization verification code; A processing module, the processing module is used to read data from the non-volatile memory according to the synchronization check code to obtain backup data when the power supply voltage is restored to meet the voltage threshold range; The control module is used to restore the backup data according to the data verification code and restart the current computing task.

[0082] The present invention provides a power-off protection method, device and equipment for an intelligent storage high-computing power industrial control chip, which has the following beneficial effects: By monitoring the power supply voltage of the industrial control chip in real time and generating a power-off signal when the voltage is lower than the preset threshold, the task processing data of the current computing task can be read in time and the task operation can be suspended, thereby avoiding data loss caused by sudden power failure. By starting the ping-pong power-off protection mechanism, the task processing data is segmented and stored in the main and standby data storage areas, and a data check code is generated, so that efficient data management and protection are achieved. Data synchronization is performed with the non-volatile memory based on the data check code to ensure the integrity and consistency of the data in the case of power failure. After the power supply voltage is restored, data is read and restored based on the synchronization check code to ensure that the computing task can be accurately restarted to maintain the continuity and stability of the system. This power-off protection method can effectively solve the problem of data loss or damage in the case of power failure in the prior art, and significantly improves the reliability and stability of the system. Through the refined data storage and synchronization mechanism, the data security and continuity of high-computing power industrial control chips in complex computing tasks are ensured, which helps to improve the overall performance of industrial control systems. By comprehensively utilizing real-time monitoring and data verification technology, an efficient power-off protection and data recovery mechanism is realized, so that the system can maintain efficient and stable operation in a variety of application scenarios, thereby meeting the requirements of modern industrial automation for high reliability and high stability.

[0083] Reference Figure 3 As shown, the present invention provides a power-off protection device for an intelligent storage high-computing power industrial control chip, comprising: Memory, used to store programs; The processor is used to execute a program to implement each step of the power-off protection method of any one of the above-mentioned intelligent storage high-computing power industrial control chips.

[0084] In this embodiment, the processor and the memory may be connected via a bus or other means. The memory may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a read-only memory, a flash memory, a hard disk, or a solid-state drive. The processor may be a general-purpose processor, such as a central processing unit, a digital signal processor, an application-specific integrated circuit, or one or more integrated circuits configured to implement the embodiments of the present invention.

[0085] It should be noted that technicians in the relevant technical field can clearly understand that for the convenience and conciseness of description, the specific working process of the system and each module described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.

[0086] The above description is only a preferred embodiment of the present invention, and does not limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made by using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. A power-off protection method for an intelligent storage high-computing power industrial control chip, characterized in that: include: Real-time monitoring of the power supply voltage of the industrial control chip, when the power supply voltage is lower than a preset voltage threshold range, a power-off signal is generated, task processing data of the current computing task is read, and the current computing task is suspended; Starting a ping-pong power-off protection mechanism according to the power-off signal, storing the task processing data in segments into a preset primary and backup data storage area, and generating a data check code; Based on the data check code, the primary and backup data storage areas are synchronized with a preset non-volatile memory to obtain backup data, and a synchronization check code is generated; When the power supply voltage is restored to meet the voltage threshold range, data is read from the non-volatile memory according to the synchronization check code to obtain the backup data; The backup data is restored according to the data verification code, and the current computing task is restarted.

2. The power-off protection method for the intelligent storage high-computing power industrial control chip according to claim 1 is characterized in that: The real-time monitoring of the power supply voltage of the industrial control chip, when the power supply voltage is lower than a preset voltage threshold range, generating a power-off signal, reading the task processing data of the current computing task, and suspending the current computing task, includes: Sampling the power supply voltage of the industrial control chip to obtain a real-time voltage value; Determine whether the real-time voltage value meets the voltage threshold range, and when the real-time voltage value meets the voltage threshold range, generate a protection comparison result, and continue to execute the current computing task according to the protection comparison result; When the real-time voltage value does not meet the voltage threshold range, a power-off signal is generated; Extracting the current computing task from the target data storage area of ​​the industrial control chip according to the power-off signal, and performing task reading to obtain task status data and the task processing data; Performing work status analysis based on the task status data to obtain a corresponding pause instruction; The current computing task is suspended according to the suspension instruction.

3. The power-off protection method for the intelligent storage high-computing power industrial control chip according to claim 1 is characterized in that: The method starts a ping-pong power-off protection mechanism according to the power-off signal, stores the task processing data in segments into a preset primary and backup data storage area, and generates a data check code, including: Analyze and process the power-off signal to obtain corresponding power-off trigger information, start the ping-pong power-off protection mechanism according to the power-off trigger information, and segment the task processing data to obtain multiple task data segments; Performing encoding processing on each of the plurality of task data segments, and generating a corresponding allocation check code; Dividing the primary and backup data storage areas according to the power-off signal to obtain a primary data storage area and a backup data storage area; Performing storage allocation on the primary data storage area and the backup data storage area according to the allocation check code to obtain a corresponding primary allocation check code and a backup allocation check code; Performing master data storage processing on the plurality of task data segments according to the master allocation check code, and storing the plurality of task data segments in the master data storage area in a preset order; According to the backup check code, storing the plurality of task data segments in the backup data storage area in the preset order; The main allocation check code and the backup allocation check code are integrated to obtain the data check code.

4. The power-off protection method for the intelligent storage high-computing power industrial control chip according to claim 1 is characterized in that: The step of synchronizing the primary and backup data storage areas with a preset non-volatile memory based on the data check code to obtain backup data and generate a synchronization check code includes: Synchronously read data from the primary and backup data storage areas to obtain a target synchronous data set; Calculating a check code on the target synchronization data set to obtain a first target check code; Storing the target synchronization data set in the non-volatile memory to obtain a stored data set; Performing check code calculation on the stored data set to obtain a second target check code; Verifying the first target verification code and the second target verification code, and when the first target verification code and the second target verification code are inconsistent, re-storing the target synchronization data set into the non-volatile memory; When the first target verification code is consistent with the second target verification code, the stored data set is marked as the backup data, and the synchronization verification code is generated.

5. The power-off protection method for the intelligent storage high-computing power industrial control chip according to claim 1 is characterized in that: When the power supply voltage is restored to meet the voltage threshold range, reading the backup data from the non-volatile memory according to the synchronization check code comprises: When it is monitored that the power supply voltage is restored to meet the voltage threshold range, data matching and extraction are performed with the non-volatile memory according to the synchronization check code to obtain corresponding matching backup data; Verify the matching backup data according to the synchronization verification code, and initialize the verification variable to 0xFFFF; The matching backup data is processed byte by byte, and the processing steps for each byte include: Perform XOR operation on the current byte and the lower 8 bits of the check variable, and assign the result to the lower 8 bits of the check variable; Perform shift and polynomial operations on check variables, including: Shift the check variable right by one bit and fill the highest bit with 0; Check the least significant bit of the check variable after right shift: When the lowest bit is 1, the check variable is XORed with the predefined polynomial 0xA001; When the lowest bit is 0, no XOR operation is performed; Repeat the above shifting and checking steps 8 times in total; After processing all bytes, the current calculated checksum is obtained; The synchronization check code is matched and compared with the current calculation check code, and when the synchronization check code is consistent with the current calculation check code, the matching backup data is set as the backup data.

6. The power-off protection method for the intelligent storage high-computing power industrial control chip according to claim 1 is characterized in that: The performing data recovery on the backup data according to the data verification code and restarting the current computing task includes: Performing integrity check on the backup data according to the data check code to obtain a check result; Decoding the backup data according to the data verification code and the verification result to obtain the task processing data; Performing state recovery analysis on the current computing task according to the task processing data to obtain a corresponding recovery instruction; Restart the current computing task according to the recovery instruction.

7. A power-off protection device for an intelligent storage high-computing power industrial control chip, characterized in that: The power-off protection method for the intelligent storage high-computing power industrial control chip applied to any one of claims 1 to 6 above comprises: An acquisition module, the acquisition module is used to monitor the power supply voltage of the industrial control chip in real time, and when the power supply voltage is lower than a preset voltage threshold range, a power-off signal is generated, task processing data of the current computing task is read, and the current computing task is suspended; An analysis module, the analysis module is used to start a ping-pong power-off protection mechanism according to the power-off signal, store the task processing data in segments into a preset primary and backup data storage area, and generate a data check code; An association module, the association module is used to synchronize the data between the primary and backup data storage areas and a preset non-volatile memory based on the data verification code to obtain backup data and generate a synchronization verification code; A processing module, wherein the processing module is used to read data from the non-volatile memory according to the synchronization check code to obtain the backup data when the power supply voltage is restored to meet the voltage threshold range; A control module, wherein the control module is used to restore the backup data according to the data verification code and restart the current computing task.

8. A power-off protection device for intelligent storage high-computing power industrial control chips, characterized in that: include: Memory, used to store programs; The processor is used to execute the program to implement the various steps of the power-off protection method for an intelligent storage high-computing power industrial control chip as described in any one of claims 1-6.

Citation Information

Patent Citations

  • Electric energy meter power down protection data storing method

    CN106648982A

  • Database management method, device and system and storage medium and device

    CN107247643A

Cited By

  • Data protection circuit, integrated circuit, and electronic device

    CN120872257A

  • Circuit breaker protection detection module fault detection method and system

    CN121114599A