A power-down data retention and loading method and related devices

The method uses NVSRAM and a 'ping-pong' operation to ensure reliable data loading in industrial control systems post-power outage, addressing data loss issues and maintaining system stability.

CN114461441BActive Publication Date: 2025-07-15CHINA TECHENERGY
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210111351.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-01-29
Publication Date
2025-07-15
Estimated Expiration
2042-01-29

AI Technical Summary

Technical Problem

The existing industrial control system cannot effectively load data after power failure, resulting in unexpected output and losses.

Method used

Through ping-pong operation, the power-down holding data and data configuration information of the industrial control system are written to the data storage area of the preset memory, and after restarting, the data is checked to determine the data area to be loaded, and finally load the data that has passed the verification into the system.

Benefits of technology

It realizes the effective loading of data of the industrial control system after power failure and restart, ensuring the correctness and sustainability of system output, and avoiding unexpected equipment disturbances.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114461441B_ABST
    Figure CN114461441B_ABST
Patent Text Reader

Abstract

A power-down retention data loading method and related devices provided by the present disclosure can obtain the power-down retention data of an industrial control system and the data configuration information corresponding to the power-down retention data; write the power-down retention data and the data configuration information into the data storage area of a preset memory according to ping-pong operation, and the preset memory is pre-divided into a first number of data storage areas; after the industrial control system is restarted, use the data configuration information stored in each data storage area to perform data verification respectively to obtain the data verification result corresponding to the data storage area; in the data storage areas where the data verification result is passed, determine the data area to be loaded; load the power-down retention data stored in the data area to be loaded into the industrial control system. The present disclosure stores data according to ping-pong operation, loads the power-down retention data that passes data verification, realizes the effective loading of the power-down retention data, and ensures the correct output after the industrial control system is restarted.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of industrial control technologies, and in particular, to a power-off retention data loading method and related devices. Background Art

[0002] In industrial control systems involving safety and reliability, a power-off protection function is required. After the industrial control system is powered off and restarted, the power-off protection function can restore the data before power-off to avoid data loss.

[0003] However, the existing power-off protection function does not consider the secure storage design of data, which may cause the industrial control system to be unable to effectively load data after restart, resulting in unexpected output of the industrial control system after restart and causing irreparable losses. Summary of the Invention

[0004] In view of the above problems, the present disclosure provides a power-off retention data loading method and related devices that overcome the above problems or at least partially solve the above problems. The technical solutions are as follows:

[0005] A power-off retention data loading method includes:

[0006] Obtaining the power-off retention data of an industrial control system and data configuration information corresponding to the power-off retention data;

[0007] Writing the power-off retention data and the data configuration information into a data storage area in a preset memory according to ping-pong operation, where the preset memory is pre-divided into a first number of the data storage areas;

[0008] After the industrial control system is restarted, respectively performing data verification using the data configuration information stored in each data storage area to obtain a data verification result corresponding to the data storage area;

[0009] Determining a data area to be loaded in each data storage area where the data verification result is passed;

[0010] Loading the power-off retention data stored in the data area to be loaded into the industrial control system.

[0011] Optionally, the data storage area includes a data information storage area and a data content storage area. The data information storage area is used to store the data configuration information corresponding to the power-off retention data, and the data content storage area is used to store the power-off retention data.

[0012] Optionally, the data configuration information includes a configuration version identifier, a data configuration identifier, a data length, a first power-off data CRC checksum, a Tick value, and a first information data CRC checksum.

[0013] Optionally, the step of respectively performing data verification by using the data configuration information stored in each of the data storage areas to obtain a data verification result corresponding to the data storage area includes:

[0014] Calculating a second information data CRC checksum corresponding to the data information storage area of the data storage area;

[0015] Verifying whether the second information data CRC checksum is consistent with the first information data CRC checksum. If they are consistent, then using the data length to calculate a second power-off data CRC checksum;

[0016] Verifying whether the second power-off data CRC checksum is consistent with the first power-off data CRC checksum. If they are consistent, then verifying whether the data length, the configuration version identifier, and the data configuration identifier in the data configuration information match the power-off retention configuration of the industrial control system. If all match, then determining that the data verification result corresponding to the data storage area passes.

[0017] Optionally, the step of determining a data area to be loaded in each of the data storage areas where the data verification result passes includes:

[0018] In each of the data storage areas where the data verification result passes, comparing the Tick values in the data configuration information stored in the data information storage areas of the data storage areas, and determining the data area to be loaded according to the comparison result of the Tick values.

[0019] Optionally, the step of loading the power-off retention data stored in the data area to be loaded into the industrial control system includes:

[0020] Loading the power-off retention data stored in the data content storage area of the data area to be loaded into the industrial control system.

[0021] Optionally, the industrial control system includes a distributed control system or a programmable logic controller, the preset memory includes a non-volatile static random access memory, and the industrial control system and the preset memory transmit the power-off retention data through a DMA transmission mechanism.

[0022] A power-off retention data loading device includes: a first obtaining unit, a first writing unit, a second obtaining unit, a first determining unit, and a first loading unit.

[0023] The first acquisition unit is configured to acquire the power failure retention data of the industrial control system and the data configuration information corresponding to the power failure retention data;

[0024] The first writing unit is configured to write the power failure retention data and the data configuration information into the data storage area in a preset memory according to ping-pong operation, wherein the preset memory is pre-divided into a first number of the data storage areas;

[0025] The second acquisition unit is configured to, after the industrial control system restarts, respectively perform data verification by using the data configuration information stored in each of the data storage areas, and acquire a data verification result corresponding to the data storage area;

[0026] The first determination unit is configured to determine a data area to be loaded in each of the data storage areas where the data verification result is passed;

[0027] The first loading unit is configured to load the power failure retention data stored in the data area to be loaded into the industrial control system.

[0028] A computer-readable storage medium, on which a program is stored, and when the program is executed by a processor, the power failure retention data loading method described in any one of the above is implemented.

[0029] An electronic device, the electronic device includes at least one processor, at least one memory connected to the processor, and a bus; wherein, the processor and the memory complete communication with each other through the bus; the processor is configured to call program instructions in the memory to execute the power failure retention data loading method described in any one of the above.

[0030] By means of the above technical solution, a power failure retention data loading method and related devices provided by the present disclosure can acquire the power failure retention data of the industrial control system and the data configuration information corresponding to the power failure retention data; write the power failure retention data and the data configuration information into the data storage area in a preset memory according to ping-pong operation, the preset memory is pre-divided into a first number of the data storage areas; after the industrial control system restarts, respectively perform data verification by using the data configuration information stored in each of the data storage areas, and acquire a data verification result corresponding to the data storage area; determine a data area to be loaded in each of the data storage areas where the data verification result is passed; load the power failure retention data stored in the data area to be loaded into the industrial control system. The present disclosure stores data according to ping-pong operation, loads the power failure retention data that passes data verification, realizes the effective loading of the power failure retention data, and ensures the correct output after the industrial control system restarts.

[0031] The above description is only an overview of the technical solution of the present disclosure. In order to understand the technical means of the present disclosure more clearly, it can be implemented according to the content of the specification. And in order to make the above and other purposes, features and advantages of the present disclosure more obvious and understandable, the following specifically illustrates the specific implementation manners of the present disclosure. Description of the Drawings

[0032] By reading the following detailed description of the preferred embodiments, various other advantages and benefits will become clear to those of ordinary skill in the art. The drawings are only for the purpose of showing the preferred embodiments and are not considered to be a limitation of the present disclosure. Moreover, throughout the drawings, the same reference numerals are used to represent the same components. In the drawings:

[0033] Figure 1 A flowchart showing an implementation manner of the power-off retention data loading method provided by an embodiment of the present disclosure is shown;

[0034] Figure 2 An explanatory diagram showing the data storage area provided by an embodiment of the present disclosure is shown;

[0035] Figure 3 A flowchart showing an implementation manner of step S300 in the power-off retention data loading method provided by an embodiment of the present disclosure is shown;

[0036] Figure 4 A structural diagram showing the power-off retention data loading device provided by an embodiment of the present disclosure is shown. Detailed Embodiments

[0037] The exemplary embodiments of the present disclosure will be described in more detail below with reference to the drawings. Although the exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided so that the present disclosure can be more thoroughly understood and the scope of the present disclosure can be fully conveyed to those skilled in the art.

[0038] As Figure 1 shown, a flowchart showing an implementation manner of the power-off retention data loading method provided by an embodiment of the present disclosure, the method may include:

[0039] S100. Obtain the power-off retention data of the industrial control system and the data configuration information corresponding to the power-off retention data.

[0040] Optionally, the industrial control system may include a distributed control system (DCS) or a programmable logic controller (PLC).

[0041] Among them, the power-off retention data includes the relevant parameter settings of the industrial control system before power-off. For example: signal strength and parameter assignment. In the embodiments of the present disclosure, the power-off retention data can be obtained through a pre-determined power-off retention configuration. The power-off retention configuration pre-sets the power-off retention data to be stored and the relevant data configuration information. In the embodiments of the present disclosure, the specific power-off retention configuration can be determined according to actual needs. The power-off retention data can ensure the output safety of the industrial control system after the industrial control system is powered off and restarted, and avoid unexpected disturbances in the external output.

[0042] Among them, the data configuration information can be configuration information corresponding to or associated with the power-off retention data. Optionally, the data configuration information may include a configuration version identifier, a data configuration identifier, a data length, a first power-off data CRC checksum, a Tick value, and a first information data CRC checksum.

[0043] In the embodiments of the present disclosure, the configuration version identifier, the data configuration identifier, the data length, and the Tick value can be obtained through the power-off retention configuration. Among them, the configuration version identifier is the unique identifier of the power-off retention configuration. The data configuration identifier is the unique identifier of the power-off retention data. The data length is the length information corresponding to the power-off retention data. The Tick value can be positioned as 4 bytes, starting from 1, and increasing by 1 each time it is stored. When it increases to 0xFFFFFFFF, the tick value is set to 0. The first power-off data CRC checksum is a 32-bit CRC checksum calculated for the power-off retention data. The first information data CRC checksum is a 32-bit CRC checksum calculated for other information in the data configuration information except this first information data CRC checksum.

[0044] It can be understood that in the embodiments of the present disclosure, the power-off retention data of the industrial control system and the data configuration information corresponding to the power-off retention data can be obtained in sequence according to a preset period.

[0045] S200. Write the power-off retention data and the data configuration information into the data storage area in the preset memory according to ping-pong operation, where the preset memory is pre-divided into a first number of data storage areas.

[0046] Optionally, the preset memory includes a non-volatile static random access memory (Non-volatile Static Random-Access Memory, NVSRAM). In the embodiments of the present disclosure, the NVSRAM is used to store the power-off retention data. The bus read and write and the design are simple, which can meet the industrial seismic resistance requirements, and has a large data capacity and a fast read and write speed. Optionally, the size of the NVSRAM can be 2MB.

[0047] Optionally, the industrial control system and the preset memory can communicate through an IFC (Integrated Flash Controller) interface.

[0048] Optionally, the industrial control system and the preset memory can transmit the power-off retention data through a DMA (Direct Memory Access) transfer mechanism.

[0049] Specifically, in the embodiments of the present disclosure, the power-off retention data and the data configuration information can be written into the data storage area in the preset memory according to ping-pong operation through the DMA transfer mechanism. By writing the power-off retention data and the data configuration information into the preset memory through the DMA transfer mechanism, the storage write time of the power-off retention data and the data configuration information can be shortened, the CPU load can be reduced, and a larger amount of data can be stored.

[0050] Optionally, the data storage area can include a data information storage area and a data content storage area. The data information storage area is used to store the data configuration information corresponding to the power-off retention data, and the data content storage area is used to store the power-off retention data.

[0051] In the embodiments of the present disclosure, the storage space in the preset memory can be pre-divided into a first number of data storage areas, and a data information storage area and a data content storage area can be divided for each data storage area. The first number can be set according to actual needs. Generally, the larger the first number, the higher the storage hit rate and the higher the complexity. Preferably, the first number can be an integer not less than 2.

[0052] For ease of understanding, here in combination with Figure 2 the data storage area is described as follows: Assume that the storage space of the preset memory is divided into data storage area A and data storage area B. Then, data information storage area 1 and data content storage area 2 are included in data storage area A, and data information storage area 3 and data content storage area 4 are included in data storage area B.

[0053] In the embodiments of the present disclosure, after obtaining the power-off retention data and the data configuration information corresponding to the power-off retention data, the data configuration information can be written into the data information storage area for storage, and the power-off retention data can be written into the data content storage area for storage.

[0054] In the embodiments of the present disclosure, through ping-pong operation, the power-off retention data and the data configuration information obtained in two adjacent times are written into different data storage areas.

[0055] In the case where the storage space of the preset memory is divided into a data storage area A and a data storage area B, the embodiments of the present disclosure may write the power-off retention data and data configuration information obtained for the first time into the data storage area A, write the power-off retention data and data configuration information obtained for the second time into the data storage area B, write the power-off retention data and data configuration information obtained for the third time into the data storage area A, and so on.

[0056] In the case where the storage space of the preset memory is divided into a data storage area C, a data storage area D, a data storage area E, and a data storage area F, the embodiments of the present disclosure may separately write the power-off retention data and data configuration information obtained for the first time into the data storage area C and the data storage area D, separately write the power-off retention data and data configuration information obtained for the second time into the data storage area E and the data storage area F, separately write the power-off retention data and data configuration information obtained for the third time into the data storage area C and the data storage area D, and so on.

[0057] Optionally, the data configuration information may further include a region identifier of the data storage region where the power-off retention data is stored.

[0058] By dividing the storage space of the preset memory into multiple data storage areas and performing redundant backup storage on the power-off retention data, the embodiments of the present disclosure can ensure that the industrial control system can load the correct power-off retention data after a power-off restart, so as to quickly restore the working state before the power-off restart and ensure the continuous operation of related control devices.

[0059] S300. After the industrial control system restarts, respectively use the data configuration information stored in each data storage area to perform data verification to obtain a data verification result corresponding to the data storage area.

[0060] The embodiments of the present disclosure may respectively use the data configuration information stored in the data information storage areas of each data storage area to perform data verification to obtain a data verification result corresponding to the data storage area.

[0061] Optionally, based on Figure 1 the method shown, as Figure 3 shown, a flowchart of an implementation manner of step S300 in the power-off retention data loading method provided by the embodiments of the present disclosure, step S300 may include:

[0062] S310. Calculate the second information data CRC checksum corresponding to the data information storage area of the data storage area.

[0063] The embodiments of the present disclosure may determine the 32-bit CRC checksum calculated from other information in the data configuration information stored in the data information storage area except for the first information data CRC checksum as the second information data CRC checksum.

[0064] S320. Check whether the second information data CRC checksum is consistent with the first information data CRC checksum. If they are consistent, execute step S330.

[0065] The embodiments of the present disclosure may perform a consistency check on the second information data CRC checksum and the first information data CRC checksum in the data configuration information stored in the data information storage area. If they are inconsistent, determine that the data check result fails.

[0066] S330. Calculate the second power-off data CRC checksum using the data length.

[0067] The embodiments of the present disclosure may calculate the second power-off data CRC checksum using the data length in the data configuration information stored in the data information storage area.

[0068] S340. Check whether the second power-off data CRC checksum is consistent with the first power-off data CRC checksum. If they are consistent, execute step S350.

[0069] The embodiments of the present disclosure may perform a consistency check on the second power-off data CRC checksum and the first power-off data CRC checksum in the data configuration information stored in the data information storage area. If they are inconsistent, determine that the data check result fails.

[0070] S350. Check whether the data length, configuration version identifier, and data configuration identifier in the data configuration information match the power-off retention configuration of the industrial control system. If they all match, execute step S360.

[0071] The embodiments of the present disclosure may check whether the data length, configuration version identifier, and data configuration identifier in the data configuration information correspond and match the data length, configuration version identifier, and data configuration identifier recorded in the power-off retention configuration of the industrial control system. In the case where any information does not match, determine that the data check result fails.

[0072] S360. Determine that the data check result corresponding to the data storage area passes.

[0073] The embodiments of the present disclosure perform data verification to verify the matching of the data configuration information stored in the data storage area and the power-off retention configuration, thereby ensuring the correctness of the power-off retention data stored in the data storage area and avoiding abnormal output after the industrial control system loads the power-off retention data.

[0074] S400. Among the data storage areas where the data verification result is passed, determine the data area to be loaded.

[0075] Optionally, if there is only one data storage area where the data verification result is passed, determine this data storage area as the data area to be loaded.

[0076] It can be understood that as the industrial control system runs, the specific parameters of the power-off retention data in each operation stage or operation period may be different. Therefore, the embodiments of the present disclosure can select the power-off retention data successfully stored most recently before the industrial control system powers off for loading.

[0077] Optionally, in the embodiments of the present disclosure, in the data storage areas where the data verification result is passed, compare the Tick values in the data configuration information stored in the data information storage areas of each data storage area, and determine the data area to be loaded according to the comparison result of the Tick values.

[0078] Optionally, if the Tick value in the data configuration information stored in any data storage area is 0xFFFFFFFE, determine another data storage area where the Tick value in the stored data configuration information is less than 0xFFFFFFFE as the data area to be loaded.

[0079] Optionally, the embodiments of the present disclosure can determine the data storage area with the largest Tick value in the data configuration information as the data area to be loaded.

[0080] S500. Load the power-off retention data stored in the data area to be loaded into the industrial control system.

[0081] The embodiments of the present disclosure can load the power-off retention data stored in the data content storage area of the data area to be loaded into the industrial control system.

[0082] Specifically, the embodiments of the present disclosure can load the power-off retention data stored in the data content storage area of the data area to be loaded into the industrial control system through the DMA transfer mechanism. By loading the power-off retention data into the industrial control system through the DMA transfer mechanism, the embodiments of the present disclosure can shorten the loading and reading time of the power-off retention data, reduce the CPU load, enable the industrial control system to quickly restore the power-off retention data and output correctly after power-off restart, and ensure the continuity of the operation of the control device.

[0083] Since the read / write access speed in the existing power-off protection design is slow, the amount of data that can be supported for storage is small, and the CPU time occupied is long, the embodiments of the present disclosure adopt a DMA transmission mechanism to read and write power-off retention data, which can effectively improve the storage write speed and loading read speed of the power-off retention data, while reducing the CPU load, supporting the storage of a larger amount of data, and meeting the engineering application requirements in actual multi-scenarios.

[0084] After the industrial control system is restarted, the embodiments of the present disclosure can call a data loading algorithm to load the power-off retention data stored in the data content storage area of the data area to be loaded in a warm start manner, so as to overwrite the corresponding data of the industrial control system with the power-off retention data before the industrial control system runs for the first time after restart, ensuring that the industrial control system can perform correct output and guaranteeing the continuity of the operation of the control device.

[0085] A method for loading power-off retention data provided by the present disclosure can obtain the power-off retention data of the industrial control system and the data configuration information corresponding to the power-off retention data; write the power-off retention data and the data configuration information into the data storage area in the preset memory according to ping-pong operation, and the preset memory is pre-divided into a first number of data storage areas; after the industrial control system is restarted, use the data configuration information stored in each data storage area to perform data verification respectively to obtain a data verification result corresponding to the data storage area; in each data storage area where the data verification result passes, determine the data area to be loaded; load the power-off retention data stored in the data area to be loaded into the industrial control system. The present disclosure stores data according to ping-pong operation and loads the power-off retention data that passes data verification, realizing the effective loading of the power-off retention data and ensuring the correct output after the industrial control system is restarted.

[0086] Although the operations are depicted in a particular order, this should not be construed as requiring that the operations be performed in the particular order shown or in sequential order. In certain circumstances, multitasking and parallel processing may be advantageous.

[0087] It should be understood that the various steps recited in the method embodiments of the present disclosure can be executed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this regard.

[0088] Corresponding to the above method embodiments, the embodiments of the present disclosure also provide a device for loading power-off retention data, the structure of which is as Figure 4 shown, and may include: a first obtaining unit 100, a first writing unit 200, a second obtaining unit 300, a first determining unit 400, and a first loading unit 500.

[0089] The first acquisition unit 100 is configured to acquire the power-off retention data of the industrial control system and the data configuration information corresponding to the power-off retention data.

[0090] The first writing unit 200 is configured to write the power-off retention data and the data configuration information into the data storage area in the preset memory according to the ping-pong operation, wherein the preset memory is pre-divided into a first number of data storage areas.

[0091] The second acquisition unit 300 is configured to, after the industrial control system restarts, respectively perform data verification by using the data configuration information stored in each data storage area, and obtain the data verification result corresponding to the data storage area.

[0092] The first determination unit 400 is configured to determine the data area to be loaded in the data storage areas where the data verification result is passed.

[0093] The first loading unit 500 is configured to load the power-off retention data stored in the data area to be loaded into the industrial control system.

[0094] Optionally, the data storage area includes a data information storage area and a data content storage area. The data information storage area is used to store the data configuration information corresponding to the power-off retention data, and the data content storage area is used to store the power-off retention data.

[0095] Optionally, the data configuration information includes a configuration version identifier, a data configuration identifier, a data length, a first power-off data CRC checksum, a Tick value, and a first information data CRC checksum.

[0096] Optionally, the second acquisition unit 300 is specifically configured to calculate a second information data CRC checksum corresponding to the data information storage area of the data storage area; check whether the second information data CRC checksum is consistent with the first information data CRC checksum. If they are consistent, calculate a second power-off data CRC checksum by using the data length; check whether the second power-off data CRC checksum is consistent with the first power-off data CRC checksum. If they are consistent, check whether the data length, the configuration version identifier, and the data configuration identifier in the data configuration information match the power-off retention configuration of the industrial control system. If all match, determine that the data verification result corresponding to the data storage area is passed.

[0097] Optionally, the first determination unit 400 is specifically configured to, in the data storage areas where the data verification result is passed, compare the Tick values in the data configuration information stored in the data information storage areas of the data storage areas, and determine the data area to be loaded according to the comparison result of the Tick values.

[0098] Optionally, the first loading unit 500 is specifically configured to load the power-off retention data stored in the data content storage area of the data area to be loaded into the industrial control system.

[0099] Optionally, the industrial control system includes a distributed control system or a programmable logic controller, the preset memory includes a non-volatile static random access memory, and the industrial control system and the preset memory transmit the power-off retention data through a DMA transmission mechanism.

[0100] A power-off retention data loading device provided by the present disclosure can obtain the power-off retention data of the industrial control system and the data configuration information corresponding to the power-off retention data; write the power-off retention data and the data configuration information into the data storage area in the preset memory according to ping-pong operation, and the preset memory is pre-divided into a first number of data storage areas; after the industrial control system restarts, use the data configuration information stored in each data storage area to perform data verification respectively, and obtain the data verification result corresponding to the data storage area; in the data storage areas where the data verification result is passed, determine the data area to be loaded; load the power-off retention data stored in the data area to be loaded into the industrial control system. The present disclosure stores data according to ping-pong operation, loads the power-off retention data that passes data verification, realizes the effective loading of the power-off retention data, and ensures the correct output after the industrial control system restarts.

[0101] Regarding the device in the above embodiments, the specific manner in which each module performs operations has been described in detail in the embodiments related to the method, and will not be elaborated here.

[0102] The power-off retention data loading device includes a processor and a memory. The above first obtaining unit 100, first writing unit 200, second obtaining unit 300, first determining unit 400, and first loading unit 500, etc. are all stored in the memory as program units, and the processor executes the above program units stored in the memory to implement corresponding functions.

[0103] The processor includes a kernel, and the kernel retrieves the corresponding program units from the memory. One or more kernels can be set, and by adjusting the kernel parameters, data storage is performed according to ping-pong operation, the power-off retention data that passes data verification is loaded, the effective loading of the power-off retention data is realized, and the correct output after the industrial control system restarts is ensured.

[0104] The embodiment of the present disclosure provides a computer-readable storage medium, on which a program is stored, and when the program is executed by a processor, the power-off retention data loading method is implemented.

[0105] Embodiments of the present disclosure provide a processor for running a program, wherein the program executes the power-off retention data loading method when running.

[0106] Embodiments of the present disclosure provide an electronic device, which includes at least one processor, at least one memory connected to the processor, and a bus; wherein the processor and the memory complete communication with each other through the bus; the processor is used to call program instructions in the memory to execute the above-mentioned power-off retention data loading method. The electronic device herein may be a server, a PC, a PAD, a mobile phone, etc.

[0107] The present disclosure also provides a computer program product, which is adapted to execute a program initialized with the steps of the power-off retention data loading method when executed on an electronic device.

[0108] The present disclosure is described with reference to the flowcharts and / or block diagrams of methods, apparatuses, electronic devices (systems), and computer program products according to embodiments of the present disclosure. It should be understood that each process and / or block in the flowchart and / or block diagram, and the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable devices to generate a machine, so that the instructions executed by the processor of the computer or other programmable devices generate a device for realizing the functions specified in one process Figure 1 one process or multiple processes and / or blocks Figure 1 or multiple blocks.

[0109] In a typical configuration, an electronic device includes one or more processors (CPUs), a memory, and a bus. The electronic device may also include an input / output interface, a network interface, etc.

[0110] The memory may include non-permanent memory in a computer-readable medium, in the form of random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash memory (flash RAM), and the memory includes at least one storage chip. The memory is an example of a computer-readable medium.

[0111] A computer-readable medium includes permanent and non-permanent, removable and non-removable media and can implement information storage by any method or technology. The information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassette tapes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transitory medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer-readable medium does not include transitory computer-readable media, such as modulated data signals and carrier waves.

[0112] In the description of the present disclosure, it should be understood that if terms such as "upper", "lower", "front", "rear", "left", and "right" are used to indicate the orientation or positional relationship, they are based on the orientation or positional relationship shown in the drawings. This is only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the indicated position or element must have a specific orientation, be constructed and operated in a specific orientation, and thus should not be construed as a limitation of the present disclosure.

[0113] It should be noted that in this article, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. It should also be noted that the term "comprising", "including", or any other variant thereof is intended to cover non-exclusive inclusion, such that a process, method, commodity, or device comprising a series of elements not only includes those elements, but also includes other elements not explicitly listed, or further includes elements inherent to such process, method, commodity, or device. Without further limitation, an element defined by the statement "comprising one..." does not exclude the existence of additional identical elements in the process, method, commodity, or device comprising the element.

[0114] Those skilled in the art should understand that the embodiments of the present disclosure can be provided as methods, systems, or computer program products. Therefore, the present disclosure can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present disclosure can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0115] The above are only embodiments of the present disclosure and are not intended to limit the present disclosure. For those skilled in the art, various changes and modifications can be made to the present disclosure. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present disclosure shall be included within the scope of the present disclosure.

Claims

1. A power-down data retention and loading method, characterized in that, Including: Obtain the power-off retention data of the industrial control system and the data configuration information corresponding to the power-off retention data, where the data configuration information includes a configuration version identifier, a data configuration identifier, a data length, a first power-off data CRC checksum, and a first information data CRC checksum; Write the power-off retention data and the data configuration information into a data storage area in a preset memory according to ping-pong operation, where the preset memory is pre-divided into a first number of the data storage areas, the data storage area includes a data information storage area and a data content storage area, the data information storage area is used to store the data configuration information corresponding to the power-off retention data, and the data content storage area is used to store the power-off retention data; Calculate a second information data CRC checksum corresponding to the data information storage area of the data storage area; Verify whether the second information data CRC checksum is consistent with the first information data CRC checksum. If they are consistent, calculate a second power-off data CRC checksum using the data length; Verify whether the second power-off data CRC checksum is consistent with the first power-off data CRC checksum. If they are consistent, verify whether the data length, the configuration version identifier, and the data configuration identifier in the data configuration information correspond and match the data length, the configuration version identifier, and the data configuration identifier recorded in the power-off retention configuration of the industrial control system. If all match, determine that the data check result corresponding to the data storage area passes; In each of the data storage areas where the data check result passes, determine a data area to be loaded; Load the power-off retention data stored in the data area to be loaded into the industrial control system.

2. The method according to claim 1, wherein The data configuration information further includes a Tick value.

3. The method according to claim 2, wherein The determining, in each of the data storage areas where the data check result passes, a data area to be loaded includes: In each of the data storage areas where the data check result passes, compare the Tick values in the data configuration information stored in the data information storage area of each data storage area, and determine the data area to be loaded according to the comparison result of the Tick values.

4. The method according to claim 1, characterized in that, The loading the power-off retention data stored in the data area to be loaded into the industrial control system includes: Loading the power-off retention data stored in the data content storage area of the data area to be loaded into the industrial control system.

5. The method according to claim 1, wherein The industrial control system includes a distributed control system or a programmable logic controller, the preset memory includes a non-volatile static random access memory, and the industrial control system and the preset memory transmit the power-off retention data through a DMA transmission mechanism.

6. A power-down data retention loading device, characterized in that, Including: A first obtaining unit, a first writing unit, a second obtaining unit, a first determining unit, and a first loading unit The first acquisition unit is configured to acquire the power-off retention data of the industrial control system and the data configuration information corresponding to the power-off retention data, where the data configuration information includes a configuration version identifier, a data configuration identifier, a data length, a first power-off data CRC checksum, and a first information data CRC checksum; The first writing unit is configured to write the power-off retention data and the data configuration information into a data storage area in a preset memory according to ping-pong operation, where the preset memory is pre-divided into a first number of the data storage areas, the data storage area includes a data information storage area and a data content storage area, the data information storage area is configured to store the data configuration information corresponding to the power-off retention data, and the data content storage area is configured to store the power-off retention data; The second acquisition unit is configured to calculate a second information data CRC checksum corresponding to the data information storage area of the data storage area; check whether the second information data CRC checksum is consistent with the first information data CRC checksum, if consistent, calculate a second power-off data CRC checksum by using the data length; check whether the second power-off data CRC checksum is consistent with the first power-off data CRC checksum, if consistent, check whether the data length, the configuration version identifier, and the data configuration identifier in the data configuration information correspond to and match the data length, the configuration version identifier, and the data configuration identifier recorded in the power-off retention configuration of the industrial control system, if all match, determine that the data check result corresponding to the data storage area passes; The first determination unit is configured to determine a data area to be loaded in the data storage areas where the data check result passes; The first loading unit is configured to load the power-off retention data stored in the data area to be loaded into the industrial control system.

7. A computer-readable storage medium having a program stored thereon, characterized in that, When the program is executed by a processor, it implements the power-off retention data loading method according to any one of claims 1 to 5.

8. An electronic device, the electronic device includes at least one processor, and at least one memory and a bus connected to the processor; wherein, The processor and the memory complete communication with each other through the bus; The processor is configured to call program instructions in the memory to execute the power-off retention data loading method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Specific DMA data sending method, receiving method, system and medium

    CN109815176A

  • Embedded system, power-down protection method, electronic equipment and storage medium

    CN111209132A