CN114461441A - Power-down retention data loading method and related equipment - Google Patents
Power-down retention data loading method and related equipment Download PDFInfo
- Publication number
- CN114461441A CN114461441A CN202210111351.4A CN202210111351A CN114461441A CN 114461441 A CN114461441 A CN 114461441A CN 202210111351 A CN202210111351 A CN 202210111351A CN 114461441 A CN114461441 A CN 114461441A
- Authority
- CN
- China
- Prior art keywords
- data
- power
- storage area
- control system
- industrial control
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/07—Responding to the occurrence of a fault, e.g. fault tolerance
- G06F11/08—Error detection or correction by redundancy in data representation, e.g. by using checking codes
- G06F11/10—Adding special bits or symbols to the coded information, e.g. parity check, casting out 9's or 11's
- G06F11/1004—Adding special bits or symbols to the coded information, e.g. parity check, casting out 9's or 11's to protect a block of data words, e.g. CRC or checksum
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/07—Responding to the occurrence of a fault, e.g. fault tolerance
- G06F11/14—Error detection or correction of the data by redundancy in operation
- G06F11/1402—Saving, restoring, recovering or retrying
- G06F11/1415—Saving, restoring, recovering or retrying at system level
- G06F11/1438—Restarting or rejuvenating
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/07—Responding to the occurrence of a fault, e.g. fault tolerance
- G06F11/14—Error detection or correction of the data by redundancy in operation
- G06F11/1402—Saving, restoring, recovering or retrying
- G06F11/1415—Saving, restoring, recovering or retrying at system level
- G06F11/1441—Resetting or repowering
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F13/00—Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
- G06F13/14—Handling requests for interconnection or transfer
- G06F13/20—Handling requests for interconnection or transfer for access to input/output bus
- G06F13/28—Handling requests for interconnection or transfer for access to input/output bus using burst mode transfer, e.g. direct memory access DMA, cycle steal
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Quality & Reliability (AREA)
- Computer Security & Cryptography (AREA)
- Power Sources (AREA)
Abstract
According to the power-down retention data loading method and the related equipment, the power-down retention data of the industrial control system and the data configuration information corresponding to the power-down retention data can be obtained; writing the power-down retention data and the data configuration information into a data storage area in a preset memory according to ping-pong operation, wherein the preset memory is divided into a first number of data storage areas in advance; after the industrial control system is restarted, data verification is carried out by respectively utilizing the data configuration information stored in each data storage area, and a data verification result corresponding to the data storage area is obtained; determining a data area to be loaded in each data storage area with the data verification result of passing; and loading the power-down maintaining data stored in the data area to be loaded into the industrial control system. According to the method and the device, data storage is carried out according to ping-pong operation, the power-down retention data which pass through data verification are loaded, effective loading of the power-down retention data is realized, and correct output of the industrial control system after restart is ensured.
Description
Technical Field
The disclosure relates to the technical field of industrial control, in particular to a power-down retention data loading method and related equipment.
Background
In an industrial control system related to safety and reliability, a power failure protection function is required. The power failure protection function can recover data before power failure after the industrial control system is restarted after power failure, and data loss is avoided.
However, the conventional power-down protection function does not consider the secure storage design of data, which may cause that the data cannot be effectively loaded after the industrial control system is restarted, and cause unexpected output after the industrial control system is restarted, thereby causing irretrievable loss.
Disclosure of Invention
In view of the foregoing, the present disclosure provides a method and related device for loading power-down retention data, which overcome or at least partially solve the foregoing problems, and the technical solutions are as follows:
a power-down retention data loading method comprises the following steps:
obtaining power failure maintaining data of an industrial control system and data configuration information corresponding to the power failure maintaining data;
writing the power-down maintaining data and the data configuration information into a data storage area in a preset memory according to ping-pong operation, wherein the preset memory is divided into a first number of the data storage areas in advance;
after the industrial control system is restarted, data verification is carried out by respectively utilizing the data configuration information stored in the data storage areas, and data verification results corresponding to the data storage areas are obtained;
determining a data area to be loaded in each data storage area which passes the data verification result;
and loading the power-down maintaining data stored in the data area to be loaded into the industrial control system.
Optionally, the data storage area includes a data information storage area and a data content storage area, where the data information storage area is used to store the data configuration information corresponding to the power-down retention data, and the data content storage area is used to store the power-down retention data.
Optionally, the data configuration information includes a configuration version identifier, a data configuration identifier, a data length, a first power down data CRC checksum, a Tick value, and a first information data CRC checksum.
Optionally, the performing data verification by respectively using the data configuration information stored in each data storage area to obtain a data verification result corresponding to the data storage area includes:
calculating a second information data CRC checksum corresponding to the data content storage area of the data storage area;
checking whether the second information data CRC checksum is consistent with the first information data CRC checksum or not, and if so, calculating a second power failure data CRC checksum by using the data length;
and checking whether the second power-down data CRC checksum is consistent with the first power-down data CRC checksum, if so, checking whether the data length, the configuration version identifier and the data configuration identifier in the data configuration information are matched with the power-down maintenance configuration of the industrial control system, and if so, determining that the data verification result corresponding to the data storage area is passed.
Optionally, the determining, in each data storage area where the data verification result passes, a data area to be loaded includes:
and comparing the Tick values in the data configuration information stored in the data content storage areas of the data storage areas in each data storage area with the data verification result of passing, and determining a data area to be loaded according to the comparison result of the Tick values.
Optionally, the loading the power-down maintaining data stored in the data area to be loaded into the industrial control system includes:
and loading the power-down maintaining data stored in the data content storage area of the data area to be loaded into the industrial control system.
Optionally, the industrial control system includes a distributed control system or a programmable logic controller, the preset memory includes a nonvolatile static random access memory, and the industrial control system and the preset memory transmit the power-down retention data through a DMA transmission mechanism.
A power down retention data loading apparatus comprising: a first obtaining unit, a first writing unit, a second obtaining unit, a first determining unit, and a first loading unit,
the first obtaining unit is used for obtaining power failure holding data of an industrial control system and data configuration information corresponding to the power failure holding data;
the first writing unit is configured to write the power-down retention data and the data configuration information into a data storage area in a preset memory according to a ping-pong operation, where the preset memory is pre-divided into a first number of the data storage areas;
the second obtaining unit is configured to perform data verification by using the data configuration information stored in each data storage area respectively after the industrial control system is restarted, and obtain a data verification result corresponding to the data storage area;
the first determining unit is configured to determine a data area to be loaded in each data storage area that passes the data verification result;
the first loading unit is used for loading the power-down maintaining data stored in the data area to be loaded into the industrial control system.
A computer readable storage medium having stored thereon a program which, when executed by a processor, implements the power down retention data loading method of any of the above.
An electronic device comprising at least one processor, and at least one memory connected to the processor, a bus; the processor and the memory complete mutual communication through the bus; the processor is configured to call program instructions in the memory to perform any of the above-described power-down retention data loading methods.
By means of the technical scheme, the power-down retention data loading method and the related equipment can obtain the power-down retention data of the industrial control system and the data configuration information corresponding to the power-down retention data; writing the power-down retention data and the data configuration information into a data storage area in a preset memory according to ping-pong operation, wherein the preset memory is divided into a first number of data storage areas in advance; after the industrial control system is restarted, data verification is carried out by respectively utilizing the data configuration information stored in each data storage area, and a data verification result corresponding to the data storage area is obtained; determining a data area to be loaded in each data storage area with the data verification result of passing; and loading the power-down maintaining data stored in the data area to be loaded into the industrial control system. According to the method and the device, data storage is carried out according to ping-pong operation, the power-down retention data which pass through data verification are loaded, effective loading of the power-down retention data is realized, and correct output of the industrial control system after restart is ensured.
The foregoing description is only an overview of the technical solutions of the present disclosure, and the embodiments of the present disclosure are described below in order to make the technical means of the present disclosure more clearly understood and to make the above and other objects, features, and advantages of the present disclosure more clearly understandable.
Drawings
Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are only for purposes of illustrating the preferred embodiments and are not to be construed as limiting the disclosure. Also, like reference numerals are used to refer to like parts throughout the drawings. In the drawings:
fig. 1 illustrates a flowchart of an implementation manner of a power down retention data loading method according to an embodiment of the present disclosure;
FIG. 2 shows an illustrative schematic of a data storage area provided by an embodiment of the disclosure;
fig. 3 is a flowchart illustrating an implementation manner of step S300 in a power down retention data loading method according to an embodiment of the present disclosure;
fig. 4 shows a schematic structural diagram of a power down holding data loading apparatus provided in an embodiment of the present disclosure.
Detailed Description
Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
As shown in fig. 1, a schematic flow diagram of an implementation manner of a method for loading power-down retention data provided by an embodiment of the present disclosure may include:
s100, obtaining power-down maintaining data of the industrial control system and data configuration information corresponding to the power-down maintaining data.
Alternatively, the industrial Control System may include a Distributed Control System (DCS) or a Programmable Logic Controller (PLC).
The power-down maintaining data comprises relevant parameter setting of the industrial control system before power-down. For example: signal strength and parameter assignments. The embodiment of the disclosure can obtain the power-down holding data through the predetermined power-down holding configuration. The power-down maintaining configuration is preset with power-down maintaining data and related data configuration information which need to be stored. The embodiment of the disclosure can determine the specific power-down holding configuration according to the actual requirement. The power failure maintaining data can ensure the output safety of the industrial control system after the industrial control system is restarted after power failure, and avoid accidental disturbance of external output.
The data configuration information may be configuration information corresponding to or associated with the power-down holding data. Optionally, the data configuration information may include a configuration version identifier, a data configuration identifier, a data length, a first power down data CRC checksum, a Tick value, and a first information data CRC checksum.
The embodiment of the disclosure can maintain the configuration through power failure to obtain the configuration version identifier, the data configuration identifier, the data length and the Tick value. Wherein, the configuration version identification is the unique identification of the power-down maintaining configuration. The data configuration identification is the unique identification of the power-down maintaining data. The data length is length information corresponding to the power-down holding data. The Tick value may be located as 4 bytes, starting with a value of 1, increasing by 1 on a previous basis every 1 time it is stored, and when increasing to 0xFFFFFFFF, the Tick value is set to 0. The first power down data CRC checksum is a 32-bit CRC checksum calculated over the power down hold data. The first information data CRC checksum is a 32-bit CRC checksum calculated over the other information in the data configuration information than the first information data CRC checksum.
It can be understood that the power-down maintaining data of the industrial control system and the data configuration information corresponding to the power-down maintaining data can be sequentially obtained according to the preset period in the embodiment of the disclosure.
S200, writing the power-down maintaining data and the data configuration information into a data storage area in a preset memory according to ping-pong operation, wherein the preset memory is divided into a first number of data storage areas in advance.
Optionally, the default Memory includes a Non-volatile Static Random-Access Memory (NVSRAM). The power-failure maintaining data are stored through the NVSRAM, the bus is simple to read, write and design, the industrial anti-seismic requirement can be met, the data capacity is large, and the reading and writing speed is high. Alternatively, the size of the NVSRAM may be 2 MB.
Optionally, the industrial control system and the preset memory may communicate through an ifc (integrated Flash controller) interface.
Optionally, the industrial control system and the preset Memory may transmit the power-down holding data through a Direct Memory Access (DMA) transmission mechanism.
Specifically, the embodiment of the present disclosure may write the power-down retention data and the data configuration information into the data storage area in the preset memory according to a ping-pong operation through a DMA transfer mechanism. According to the embodiment of the disclosure, the power-down retention data and the data configuration information are written into the preset memory through the DMA transmission mechanism, so that the storage and writing time of the power-down retention data and the data configuration information can be shortened, the CPU load is reduced, and the data volume capable of being stored is larger.
Optionally, the data storage area may include a data information storage area and a data content storage area, where the data information storage area is used to store data configuration information corresponding to the power-down retention data, and the data content storage area is used to store the power-down retention data.
The embodiment of the disclosure may pre-divide the storage space in the preset memory into a first number of data storage areas, and respectively divide each data storage area into a data information storage area and a data content storage area. The first number may be set according to actual requirements. In general, the greater the first number, the higher the memory hit rate and the higher the complexity. Preferably, the first number may be an integer of not less than 2.
For ease of understanding, the data storage area is described herein in connection with FIG. 2: assuming that the storage space of the preset memory is divided into a data storage area a and a data storage area B, the data storage area a includes a data information storage area 1 and a data content storage area 2, and the data storage area B includes a data information storage area 3 and a data content storage area 4.
The embodiment of the disclosure can write the data configuration information into the data information storage area for storage after obtaining the power-down retention data and the data configuration information corresponding to the power-down retention data, and write the power-down retention data into the data content storage area for storage.
The embodiment of the disclosure writes the power-down maintaining data and the data configuration information obtained twice in the adjacent times into different data storage areas through ping-pong operation.
Under the condition that the storage space of the preset memory is divided into a data storage area A and a data storage area B, the embodiment of the disclosure can write the power-down retention data and the data configuration information obtained for the first time into the data storage area A, write the power-down retention data and the data configuration information obtained for the second time into the data storage area B, write the power-down retention data and the data configuration information obtained for the third time into the data storage area A, and so on.
Under the condition that 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 embodiment of the present disclosure may separately write the power-down retention data and the data configuration information obtained for the first time into the data storage area C and the data storage area D, separately write the power-down retention data and the data configuration information obtained for the second time into the data storage area E and the data storage area F, separately write the power-down retention data and the data configuration information obtained for the third time into the data storage area C and the data storage area D, and so on.
Optionally, the data configuration information may further include an area identifier of a data storage area where the power-down retention data is stored.
According to the embodiment of the disclosure, the storage space of the preset memory is divided into the plurality of data storage areas, and the power failure retention data is subjected to redundant backup storage, so that the industrial control system can be ensured to be loaded with correct power failure retention data after power failure restart, the working state before power failure restart can be rapidly recovered, and the continuous operation of related control equipment can be ensured.
And S300, after the industrial control system is restarted, respectively utilizing the data configuration information stored in each data storage area to carry out data verification, and obtaining a data verification result corresponding to the data storage area.
The data configuration information stored in the data content storage area of each data storage area can be used for data verification respectively, and the data verification result corresponding to the data storage area is obtained.
Optionally, based on the method shown in fig. 1, as shown in fig. 3, the step S300 may include:
s310, calculating a second information data CRC checksum corresponding to the data content storage area of the data storage area.
The embodiment of the present disclosure may determine a 32-bit CRC checksum calculated for information other than the first information data CRC checksum in the data configuration information stored in the data content storage area as the second information data CRC checksum.
S320, checking whether the second information data CRC checksum is consistent with the first information data CRC checksum, and if so, executing step S330.
The embodiment of the disclosure may perform 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 content storage area, and if the second information data CRC checksum and the first information data CRC checksum are not consistent, determine that the data check result is not passed.
And S330, calculating the CRC checksum of the second power failure data by using the data length.
The embodiment of the disclosure may calculate the second power down data CRC checksum by using the data length in the data configuration information stored in the data content storage area.
And S340, checking whether the second power down data CRC checksum is consistent with the first power down data CRC checksum or not, and if so, executing the step S350.
The embodiment of the disclosure may perform consistency check on the second power down data CRC checksum and a power down data CRC checksum in the data configuration information stored in the data content storage area, and if the second power down data CRC checksum and the data configuration information are not consistent, determine that the data check result does not pass.
S350, verifying whether the data length, the configuration version identification and the data configuration identification in the data configuration information are matched with the power failure maintenance configuration of the industrial control system, and if so, executing the step S360.
The embodiment of the disclosure can verify the data length, the configuration version identifier and the data configuration identifier in the data configuration information, and whether the data length, the configuration version identifier and the data configuration identifier recorded in the configuration information are correspondingly matched with the power failure of the industrial control system, and under the condition that any information is not matched, the data verification result is determined to be not passed.
And S360, determining that the data verification result corresponding to the data storage area is passed.
According to the embodiment of the disclosure, the data configuration information stored in the data storage region is verified to be matched with the power-down maintenance configuration through data verification, so that the correctness of the power-down maintenance data stored in the data storage region is ensured, and abnormal output after the power-down maintenance data is loaded by an industrial control system is avoided.
S400, determining a data area to be loaded in each data storage area with the data verification result of passing.
Optionally, if only one data storage area passes the data verification result, the data storage area is determined as the data area to be loaded.
It can be understood that, with the operation of the industrial control system, specific parameters of the power-down retention data in each operation stage or operation period may be different, so that the power-down retention data successfully stored last time before the power-down of the industrial control system may be selected for loading in the embodiments of the present disclosure.
Optionally, in each data storage area where the data verification result is passed, the embodiment of the present disclosure may compare Tick values in the data configuration information stored in the data content storage area of each data storage area, and determine the data area to be loaded according to the comparison result of the Tick values.
Optionally, if the Tick value in the data configuration information stored in any data storage area is 0 xffffffffe, another data storage area in which the Tick value in the stored data configuration information is smaller than 0 xffffffe is determined as the data area to be loaded.
Optionally, in the embodiment of the present disclosure, the data storage area with the largest Tick value in the data configuration information may be determined as the data area to be loaded.
And S500, loading the power-down maintaining data stored in the data area to be loaded into the industrial control system.
The embodiment of the disclosure can load the power-down retention data stored in the data content storage area of the data area to be loaded into the industrial control system.
Specifically, the embodiment of the present disclosure may load the power-down 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. The embodiment of the disclosure loads the power-down retention data into the industrial control system through the DMA transmission mechanism, so that the loading and reading time of the power-down retention data can be shortened, the CPU load is reduced, the industrial control system can quickly recover the power-down retention data and correctly output the power-down retention data after the power-down restart, and the operation continuity of the control equipment is ensured.
Because the read-write access speed in the existing power-down protection design is low, the amount of data which can be stored is small, and the time of occupying a CPU is long, the embodiment of the disclosure adopts a DMA transmission mechanism to read and write the power-down retention data, can effectively improve the storage write-in speed and the loading read speed of the power-down retention data, simultaneously reduces the load of the CPU, supports the storage of larger data amount, and meets the engineering application requirements under actual multiple scenes.
After the industrial control system is restarted, the embodiment of the disclosure can call a data loading algorithm to load the power-down retention data stored in the data content storage area of the data area to be loaded in a warm-start manner, so that the power-down retention data is covered with the data corresponding to the industrial control system before the industrial control system is operated for the first time after being restarted, thereby ensuring that the industrial control system can output correctly and ensuring the continuity of operation of the control device.
According to the power-down retention data loading method, power-down retention data of an industrial control system and data configuration information corresponding to the power-down retention data can be obtained; writing the power-down retention data and the data configuration information into a data storage area in a preset memory according to ping-pong operation, wherein the preset memory is divided into a first number of data storage areas in advance; after the industrial control system is restarted, data verification is carried out by respectively utilizing the data configuration information stored in each data storage area, and a data verification result corresponding to the data storage area is obtained; determining a data area to be loaded in each data storage area with the data verification result of passing; and loading the power-down maintaining data stored in the data area to be loaded into the industrial control system. According to the method and the device, data storage is carried out according to ping-pong operation, the power-down retention data which pass through data verification are loaded, effective loading of the power-down retention data is realized, and correct output of the industrial control system after restart is ensured.
Although the operations are depicted in a particular order, this should not be understood as requiring that such operations be performed in the particular order shown or in sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous.
It should be understood that the various steps recited in the method embodiments of the present disclosure may be performed in a different order, and/or performed in parallel. Moreover, method embodiments may include additional steps and/or omit performing the illustrated steps. The scope of the present disclosure is not limited in this respect.
Corresponding to the foregoing method embodiment, an embodiment of the present disclosure further provides a power down retention data loading apparatus, which has a structure as shown in fig. 4, 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.
The first obtaining unit 100 is configured to obtain power-down maintaining data of the industrial control system and data configuration information corresponding to the power-down maintaining data.
The first writing unit 200 is configured to write the power-down retention data and the data configuration information into a data storage area in a preset memory according to a ping-pong operation, where the preset memory is pre-divided into a first number of data storage areas.
And a second obtaining unit 300, configured to perform data verification by using the data configuration information stored in each data storage area after the industrial control system is restarted, and obtain a data verification result corresponding to the data storage area.
A first determining unit 400, configured to determine a data area to be loaded in each data storage area that passes the data verification result.
The first loading unit 500 is configured to load the power-down retention data stored in the data area to be loaded into the industrial control system.
Optionally, the data storage area includes a data information storage area and a data content storage area, the data information storage area is used for storing data configuration information corresponding to the power-down retention data, and the data content storage area is used for storing the power-down retention data.
Optionally, the data configuration information includes a configuration version identifier, a data configuration identifier, a data length, a first power down data CRC checksum, a Tick value, and a first information data CRC checksum.
Optionally, the second obtaining unit 300 is specifically configured to calculate a second information data CRC checksum corresponding to a data content storage area of the data storage area; checking whether the second information data CRC checksum is consistent with the first information data CRC checksum or not, and if so, calculating a second power failure data CRC checksum by using the data length; and checking whether the second power-down data CRC checksum is consistent with the first power-down data CRC checksum or not, if so, checking whether the data length, the configuration version identifier and the data configuration identifier in the data configuration information are matched with the power-down maintenance configuration of the industrial control system or not, and if so, determining that the data check result corresponding to the data storage area is passed.
Optionally, the first determining unit 400 is specifically configured to, in each data storage area where the data verification result is that the data storage area passes, compare Tick values in the data configuration information stored in the data content storage area of each data storage area, and determine the data area to be loaded according to a comparison result of the Tick values.
Optionally, the first loading unit 500 is specifically configured to load the power-down maintaining data stored in the data content storage area of the data area to be loaded into the industrial control system.
Optionally, the industrial control system includes a distributed control system or a programmable logic controller, the preset memory includes a nonvolatile static random access memory, and the industrial control system and the preset memory transmit the power-down retention data through a DMA transmission mechanism.
The power-down retention data loading device can obtain power-down retention data of an industrial control system and data configuration information corresponding to the power-down retention data; writing the power-down retention data and the data configuration information into a data storage area in a preset memory according to ping-pong operation, wherein the preset memory is divided into a first number of data storage areas in advance; after the industrial control system is restarted, data verification is carried out by respectively utilizing the data configuration information stored in each data storage area, and a data verification result corresponding to the data storage area is obtained; determining a data area to be loaded in each data storage area with the data verification result of passing; and loading the power-down maintaining data stored in the data area to be loaded into the industrial control system. According to the method and the device, data storage is carried out according to ping-pong operation, the power-down retention data which pass through data verification are loaded, effective loading of the power-down retention data is realized, and correct output of the industrial control system after restart is ensured.
With regard to the apparatus in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
The device for loading the power-down maintaining data comprises a processor and a memory, wherein the first obtaining unit 100, the first writing unit 200, the second obtaining unit 300, the first determining unit 400, the first loading unit 500 and the like are stored in the memory as program units, and the processor executes the program units stored in the memory to realize corresponding functions.
The processor comprises a kernel, and the kernel calls the corresponding program unit from the memory. The kernel can be set to be one or more, data storage is carried out according to ping-pong operation by adjusting kernel parameters, the power-down retention data passing through data verification are loaded, effective loading of the power-down retention data is realized, and correct output of the industrial control system after restart is ensured.
The disclosed embodiments provide a computer-readable storage medium having stored thereon a program that, when executed by a processor, implements the power-down retention data loading method.
The embodiment of the disclosure provides a processor, wherein the processor is used for running a program, and the power-down retention data loading method is executed when the program runs.
The embodiment of the disclosure provides an electronic device, which comprises at least one processor, at least one memory connected with the processor, and a bus; the processor and the memory complete mutual communication through a bus; the processor is used for calling program instructions in the memory to execute the power-down holding data loading method. The electronic device herein may be a server, a PC, a PAD, a mobile phone, etc.
The present disclosure also provides a computer program product adapted to perform a program of initializing power down retention data loading method steps when executed on an electronic device.
The present disclosure is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus, electronic devices (systems), and computer program products according to embodiments of the disclosure. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In a typical configuration, an electronic device includes one or more processors (CPUs), memory, and a bus. The electronic device may also include input/output interfaces, network interfaces, and the like.
The memory may include volatile memory in a computer readable medium, Random Access Memory (RAM) and/or nonvolatile memory such as Read Only Memory (ROM) or flash memory (flash RAM), and the memory includes at least one memory chip. The memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, 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 technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission 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 a transitory computer readable medium such as a modulated data signal and a carrier wave.
In the description of the present disclosure, it is to be understood that the directions or positional relationships indicated as referring to the terms "upper", "lower", "front", "rear", "left" and "right", etc., are based on the directions or positional relationships shown in the drawings, and are only for convenience of describing the present invention and simplifying the description, but do not indicate or imply that the positions or elements referred to must have specific directions, be constituted and operated in specific directions, and thus, are not to be construed as limitations of the present disclosure.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in the process, method, article, or apparatus that comprises the element.
As will be appreciated by one skilled in the art, embodiments of the present disclosure may be provided as a method, system, or computer program product. Accordingly, the present disclosure may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present disclosure may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and so forth) having computer-usable program code embodied therein.
The above are merely examples of the present disclosure, and are not intended to limit the present disclosure. Various modifications and variations of this disclosure will be apparent to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present disclosure should be included in the scope of the claims of the present disclosure.
Claims (10)
1. A method for loading power-down retention data is characterized by comprising the following steps:
obtaining power failure maintaining data of an industrial control system and data configuration information corresponding to the power failure maintaining data;
writing the power-down retention data and the data configuration information into a data storage area in a preset memory according to a ping-pong operation, wherein the preset memory is divided into a first number of data storage areas in advance;
after the industrial control system is restarted, data verification is carried out by respectively utilizing the data configuration information stored in the data storage areas, and data verification results corresponding to the data storage areas are obtained;
determining a data area to be loaded in each data storage area which passes the data verification result;
and loading the power-down maintaining data stored in the data area to be loaded into the industrial control system.
2. The method according to claim 1, wherein the data storage area comprises a data information storage area and a data content storage area, the data information storage area is used for storing the data configuration information corresponding to the power-down retention data, and the data content storage area is used for storing the power-down retention data.
3. The method of claim 2, wherein the data configuration information comprises a configuration version identifier, a data configuration identifier, a data length, a first power down data CRC checksum, a Tick value, and a first information data CRC checksum.
4. The method according to claim 3, wherein the performing data verification by using the data configuration information stored in each data storage area respectively to obtain a data verification result corresponding to the data storage area comprises:
calculating a second information data CRC checksum corresponding to the data content storage area of the data storage area;
checking whether the second information data CRC checksum is consistent with the first information data CRC checksum or not, and if so, calculating a second power failure data CRC checksum by using the data length;
and checking whether the second power-down data CRC checksum is consistent with the first power-down data CRC checksum, if so, checking whether the data length, the configuration version identifier and the data configuration identifier in the data configuration information are matched with the power-down maintenance configuration of the industrial control system, and if so, determining that the data verification result corresponding to the data storage area is passed.
5. The method according to claim 3, wherein the determining, in each of the data storage areas where the data verification result is passed, a data area to be loaded comprises:
and comparing the Tick values in the data configuration information stored in the data content storage areas of the data storage areas in each data storage area with the data verification result of passing, and determining a data area to be loaded according to the comparison result of the Tick values.
6. The method of claim 2, wherein loading the power-down retention data stored in the data to load area into the industrial control system comprises:
and loading the power-down maintaining data stored in the data content storage area of the data area to be loaded into the industrial control system.
7. The method of claim 1, wherein the industrial control system comprises a distributed control system or a programmable logic controller, wherein the default memory comprises a non-volatile static random access memory, and wherein the industrial control system and the default memory transfer the power-down hold data via a DMA transfer mechanism.
8. A power down retention data loading apparatus, comprising: a first obtaining unit, a first writing unit, a second obtaining unit, a first determining unit, and a first loading unit,
the first obtaining unit is used for obtaining power-down maintaining data of an industrial control system and data configuration information corresponding to the power-down maintaining data;
the first writing unit is configured to write the power-down retention data and the data configuration information into a data storage area in a preset memory according to a ping-pong operation, where the preset memory is pre-partitioned into a first number of the data storage areas;
the second obtaining unit is configured to perform data verification by using the data configuration information stored in each data storage area respectively after the industrial control system is restarted, and obtain a data verification result corresponding to the data storage area;
the first determining unit is configured to determine a data area to be loaded in each data storage area that passes the data verification result;
the first loading unit is used for loading the power-down maintaining data stored in the data area to be loaded into the industrial control system.
9. A computer-readable storage medium having a program stored thereon, wherein the program, when executed by a processor, implements the power down retention data loading method of any of claims 1 to 7.
10. An electronic device comprising at least one processor, and at least one memory connected to the processor, a bus; the processor and the memory are communicated with each other through the bus; the processor is configured to call program instructions in the memory to perform the power down retention data loading method of any of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210111351.4A CN114461441A (en) | 2022-01-29 | 2022-01-29 | Power-down retention data loading method and related equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210111351.4A CN114461441A (en) | 2022-01-29 | 2022-01-29 | Power-down retention data loading method and related equipment |
Publications (1)
Publication Number | Publication Date |
---|---|
CN114461441A true CN114461441A (en) | 2022-05-10 |
Family
ID=81411089
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210111351.4A Pending CN114461441A (en) | 2022-01-29 | 2022-01-29 | Power-down retention data loading method and related equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114461441A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2023226107A1 (en) * | 2022-05-24 | 2023-11-30 | 上海江波龙数字技术有限公司 | Storage apparatus data backup method, system, electronic device, and medium |
-
2022
- 2022-01-29 CN CN202210111351.4A patent/CN114461441A/en active Pending
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2023226107A1 (en) * | 2022-05-24 | 2023-11-30 | 上海江波龙数字技术有限公司 | Storage apparatus data backup method, system, electronic device, and medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN102385535B (en) | Handling errors during device bootup from a non-volatile memory | |
CN103513937A (en) | Storage device capable of increasing its life cycle and operating method thereof | |
CN104461641A (en) | Data burning and writing method, system and equipment and target equipment | |
CN107943605B (en) | Memory card processing method and device | |
CN114461441A (en) | Power-down retention data loading method and related equipment | |
CN115756984A (en) | Memory test method, device, equipment and storage medium | |
CN112860516A (en) | Log saving method, communication device, chip and module equipment | |
CN108345430B (en) | Nand flash element and operation control method and device thereof | |
CN110993014B (en) | Behavior test method and device of SSD in idle state, computer equipment and storage medium | |
CN111367710B (en) | eMMC problem reduction method and device | |
CN108345429B (en) | Nand flash element | |
CN116244127A (en) | Hard disk detection method, device, equipment and storage medium | |
CN105354107A (en) | Data transmission method and system for NOR Flash | |
CN101533372B (en) | Data accessing system | |
CN108874318A (en) | The data reconstruction method and solid state hard disk of solid state hard disk | |
CN113778485A (en) | System operation method and device of electronic chip, electronic chip and storage medium | |
CN108255540B (en) | Nand flash element and loading control method and device thereof | |
CN114047880B (en) | NAND write power consumption optimization method and device for multi-Pass programming and computer equipment | |
US20230070503A1 (en) | Data protection method for memories and memory device thereof | |
CN111176572B (en) | Method, device, equipment and medium for protecting stored data | |
CN117215966B (en) | Test method and test device for chip SDK interface and electronic equipment | |
CN113094294B (en) | SSD abnormal power failure processing method, SSD abnormal power failure processing device, computer equipment and storage medium | |
US12032860B2 (en) | Data protection method for memory and storage device thereof | |
CN112905112B (en) | Data processing method and system of embedded equipment | |
CN114637626B (en) | Method, device and equipment for reducing read-write errors of EEPROM (electrically erasable programmable read-only memory) data and readable storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |