CN114528154A - Electric energy meter data recovery method, device, equipment and computer storage medium - Google Patents

Electric energy meter data recovery method, device, equipment and computer storage medium Download PDF

Info

Publication number
CN114528154A
CN114528154A CN202210094609.4A CN202210094609A CN114528154A CN 114528154 A CN114528154 A CN 114528154A CN 202210094609 A CN202210094609 A CN 202210094609A CN 114528154 A CN114528154 A CN 114528154A
Authority
CN
China
Prior art keywords
electric energy
energy meter
data
backup
object data
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
Application number
CN202210094609.4A
Other languages
Chinese (zh)
Inventor
甘建平
张宇
吕新伟
贺助理
刘维
宋慧娜
扶忠权
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Wasion Group Co Ltd
Original Assignee
Wasion Group Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Wasion Group Co Ltd filed Critical Wasion Group Co Ltd
Priority to CN202210094609.4A priority Critical patent/CN114528154A/en
Publication of CN114528154A publication Critical patent/CN114528154A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1446Point-in-time backing up or restoration of persistent data
    • G06F11/1448Management of the data involved in backup or backup restore
    • G06F11/1451Management of the data involved in backup or backup restore by selection of backup contents
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/08Error detection or correction by redundancy in data representation, e.g. by using checking codes
    • G06F11/10Adding special bits or symbols to the coded information, e.g. parity check, casting out 9's or 11's
    • G06F11/1004Adding 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1446Point-in-time backing up or restoration of persistent data
    • G06F11/1458Management of the backup or restore process
    • G06F11/1469Backup restoration techniques
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management

Abstract

The application discloses a method, a device, equipment and a computer readable storage medium for recovering electric energy meter data, wherein the method comprises the following steps: establishing mapping information of a storage address of electric energy meter data and the electric energy meter data; if an upgrading instruction of the electric energy meter is received, generating an electric energy meter backup file according to the mapping information and the electric energy meter data, and backing up the electric energy meter backup file to an external storage space; and if the upgrading completion instruction of the electric energy meter is received, restoring the electric energy meter data to the electric energy meter according to the electric energy meter backup file of the external storage space and the mapping information. By the method and the device, the situation that the electric energy meter cannot normally operate due to the fact that the data of the electric energy meter are disordered after the electric energy meter firmware is upgraded can be avoided.

Description

Electric energy meter data recovery method, device, equipment and computer storage medium
Technical Field
The application relates to the technical field of electric energy meters, in particular to a method, a device, equipment and a computer readable storage medium for recovering electric energy meter data.
Background
With the development of economic technology, electric energy becomes essential secondary energy in production and life of people, and endless convenience is brought to production and life of people. At present, intelligent electric energy meters are widely applied to power systems. However, as the demand of users and metering systems for smart electric energy meters is upgraded, the upgrading of electric energy meter software is more and more common.
However, when the software of the electric energy meter is upgraded from one version to another version, the data position of the electric energy meter is changed due to the increase and decrease of the data of the electric energy meter or the structural adjustment of the data of the electric energy meter, and if the data is not processed from the software, the data of the electric energy meter after the program is upgraded is disordered, and the electric energy meter cannot normally operate.
Disclosure of Invention
The application provides a method, a device and equipment for recovering data of an electric energy meter and a computer readable storage medium, and aims to solve the technical problem that the electric energy meter cannot normally operate due to the fact that the data of the electric energy meter is disordered after firmware of the electric energy meter is upgraded.
In order to achieve the above object, the present application provides a method for recovering data of an electric energy meter, including the following steps:
establishing a storage address of electric energy meter data and mapping information of the electric energy meter data;
if an upgrading instruction of the electric energy meter is received, generating an electric energy meter backup file according to the mapping information and the electric energy meter data, and backing up the electric energy meter backup file to an external storage space;
and if the upgrading completion instruction of the electric energy meter is received, restoring the electric energy meter data to the electric energy meter according to the electric energy meter backup file of the external storage space and the mapping information.
Optionally, sequentially acquiring object data according to the object identifier;
converting the electric energy meter data into backup object data according to a preset message format;
and writing the backup object data into a preset file to generate the electric energy meter backup file.
Optionally, analyzing the electric energy meter backup file to obtain backup object data, and sequentially checking the validity of the backup object data;
and if the backup object data is legal, writing the backup object data into the electric energy meter according to the mapping information.
Optionally, if the backup object data is illegal, setting a storage address corresponding to the backup object data as a default value.
Optionally, checking whether the data length of the backup object data is greater than a preset maximum length value;
and if the data length is larger than the preset maximum length value, judging that the backup object data is illegal.
Optionally, if the data length is less than or equal to the maximum length value, determining whether a symbol at a position where the backup object data is shifted by a first preset length is a preset symbol;
and if the symbol at the position of the backup object data after the backup object data is deviated by the first preset length is not the preset symbol, judging that the backup object data is illegal.
Optionally, if a position of the backup object data after offsetting by a first preset length is a preset symbol, calculating a cyclic redundancy value of the backup object data, and determining whether the cyclic redundancy value is equal to a pre-stored historical cyclic redundancy value;
if the cyclic redundancy value is equal to the historical cyclic redundancy value, judging that the backup object data is legal;
and if the cyclic redundancy value is not equal to the historical cyclic redundancy value, judging that the backup object data is illegal.
In order to achieve the above object, the present application further provides a device for recovering data of an electric energy meter, where the device for recovering data of an electric energy meter includes a mapping information establishing module, a data backup module, and a data recovery module, and the mapping information establishing module is configured to establish a storage address of data of the electric energy meter and mapping information of the data of the electric energy meter; the data backup module is used for generating an electric energy meter backup file according to the mapping information and the electric energy meter data and backing up the electric energy meter backup file to an external storage space if receiving an upgrading instruction of the electric energy meter; and the data recovery module is used for recovering the electric energy meter data to the electric energy meter according to the electric energy meter backup file of the external storage space and the mapping information if receiving the upgrade completion instruction of the electric energy meter.
In order to achieve the above object, the present application further provides a device for recovering data of an electric energy meter, where the device for recovering data of an electric energy meter includes a memory, a processor, and a recovery program of data of an electric energy meter stored in the memory and operable on the processor, and the recovery program of data of an electric energy meter is executed by the processor to implement a method for recovering data of an electric energy meter.
In order to achieve the above object, the present application also provides a computer-readable storage medium having a recovery program of electric energy meter data stored thereon, where the recovery program of electric energy meter data is executed by a processor to implement the recovery method of electric energy meter data.
In the application, the electric energy meter has the advantages that the mapping information of the data of the electric energy meter and the storage address of the data of the electric energy meter is added in the original electric energy meter design, the electric energy meter has the backup processing function and the recovery processing function based on the mapping information, other electric energy meter designs can keep the original design scheme unchanged, compared with the prior art, the application of the method which is simple and convenient avoids the data disorder after the firmware of the electric energy meter is upgraded and influences the normal operation of the electric energy meter, and the software development and maintenance efficiency is improved.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the structures shown in the drawings without creative efforts.
Fig. 1 is a schematic block diagram of a method for recovering data of an electric energy meter according to an embodiment of the present application;
FIG. 2 is a flowchart illustrating a method for recovering data of an electric energy meter according to an embodiment of the present disclosure;
fig. 3 is a block diagram of a method for recovering data of an electric energy meter according to another embodiment of the present application.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
Referring to fig. 1, fig. 1 is a schematic diagram of a hardware structure of a device for recovering electric energy meter data provided in various embodiments of the present application. The recovery device of the electric energy meter data comprises an execution module 01, a memory 02, a processor 03, a battery system and the like. Those skilled in the art will appreciate that the apparatus shown in fig. 1 may also include more or fewer components than those shown, or combine certain components, or a different arrangement of components. The processor 03 is connected to the memory 02 and the execution module 01, respectively, the memory 02 stores a recovery program of the electric energy meter data, and the recovery program of the electric energy meter data is executed by the processor 03 at the same time.
The execution module 01 can establish a storage address of the electric energy meter data and mapping information of the electric energy meter data; if the upgrading instruction of the electric energy meter is received, generating an electric energy meter backup file according to the mapping information and the electric energy meter data; and if the upgrading completion instruction of the electric energy meter is received, restoring the electric energy meter data to the electric energy meter according to the electric energy meter backup file of the external storage space and the mapping information. And simultaneously feeds back the above information to the processor 03.
The memory 02 may be used to store software programs and various data. The memory 02 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for a plurality of functions, and the like; the storage data area may store data or information created according to the use of the internet of things terminal, or the like. Further, the memory 02 may include high speed random access memory, and may also include non-volatile memory, such as a plurality of magnetic disk storage devices, flash memory devices, or other volatile solid state storage devices.
The processor 03 is a control center of the processing platform, is connected with each part of the whole internet of things terminal by using various interfaces and lines, and executes various functions and processing data of the internet of things terminal by running or executing software programs and/or modules stored in the memory 02 and calling the data stored in the memory 02, so as to perform overall monitoring on the recovery device of the electric energy meter data. Processor 03 may include one or more processing units; preferably, the processor 03 may integrate an application processor, which mainly handles operating systems, user interfaces, application programs, etc., and a modem processor, which mainly handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 03.
Those skilled in the art will appreciate that the configuration of the recovery device for power meter data shown in fig. 1 does not constitute a limitation of the device and may include more or fewer components than shown, or some components in combination, or a different arrangement of components.
According to the hardware structure, various embodiments of the method are provided.
With the development of economic technology, electric energy becomes essential secondary energy in production and life of people, and endless convenience is brought to production and life of people. At present, intelligent electric energy meters are widely applied to electric power systems. However, as the demand of users and metering systems for smart electric energy meters is upgraded, the upgrading of electric energy meter software is more and more common.
However, when the software of the electric energy meter is upgraded from one version to another version, the data position of the electric energy meter is changed due to the increase and decrease of the data of the electric energy meter or the structural adjustment of the data of the electric energy meter, and if the data is not processed from the software, the data of the electric energy meter after the program is upgraded is disordered, and the electric energy meter cannot normally operate. The processing scheme of the existing platform is to reserve space in each electric energy meter data structure body so as to carry out the data expansion of the electric energy meter subsequently. However, this solution has a large limitation, and can only be applied to the case where the structural adjustment is not large. And because the space reservation is needed, space fragments exist, and certain storage space is wasted.
In order to solve the problems, the primary design scheme is that mapping information of the electric energy meter data and the storage positions of the electric energy meter data is lacked, and if the storage positions of the electric energy meter data are changed after the firmware is upgraded, the original electric energy meter data cannot be readjusted through a mapping relation, so that the backup and the recovery of the electric energy meter data are realized, the upgraded electric energy meter data are disordered, and the normal operation of the electric energy meter is influenced. And the mode pair through space reservation has the limitations of difficult development and maintenance, serious fragmentation, incapability of meeting the application scene of large data adjustment of the electric energy meter and the like. In order to solve the above problem, the present application further provides a method for recovering data of an electric energy meter, and referring to fig. 2, in a first embodiment of the method for recovering data of an electric energy meter of the present application, the method for recovering data of an electric energy meter includes:
step S100, establishing a storage address of electric energy meter data and mapping information of the electric energy meter data;
in this embodiment, in order to avoid situations such as firmware upgrade performed on the electric energy meter, after the storage location of the data of the electric energy meter is changed, the original data of the electric energy meter cannot be readjusted, so that backup and recovery of the data of the electric energy meter are realized, and thus, the data of the electric energy meter is disordered and normal operation of the electric energy meter is affected. The method and the device establish mapping information of the data of the electric energy meter and the storage address of the data of the electric energy meter. In an embodiment, the mapping information of the electric energy meter data and the storage address may be a mapping table, and the mapping table may be a data object attribute list created by performing objectification design on the electric energy meter data in the electric energy meter. The mapping information at least comprises an object identifier, a data storage format, a data length, data content, a historical cyclic redundancy value and an object separator; the data object attribute list includes at least a data storage format, a data storage address, and a backup data frame format definition. The definition of the frame format of the backup data at least comprises an object identifier, a data storage format, a data length, a data value, a Cyclic Redundancy Check (CRC), and an object delimiter. In some embodiments, the object identifier is an identifier defined by the electric energy meter for the electric energy meter data object, and the identifier has uniqueness, that is, each electric energy meter data has a uniquely determined object identifier; the data storage format is a type index of a custom format in the electric energy meter; the data length is the length N in the corresponding data content; the CRC value is obtained by performing CRC operation on the object identifier, the data format, the data length and the data content; the object separator is fixed to 0 xAA.
After the mapping information of the electric energy meter data and the storage address is established, if the electric energy meter data needs to be stored in an external storage space, the electric energy meter data can be recovered based on the mapping information of the electric energy meter data and the storage address.
Step S200, if an upgrading instruction of the electric energy meter is received, generating an electric energy meter backup file according to the mapping information and the electric energy meter data, and backing up the electric energy meter backup file to an external storage space;
in this embodiment, in order to meet the increasing demands of users and metering systems on the functions of the electric energy meter, or optimize the existing functions of the electric energy meter, the electric energy meter is often subjected to various software upgrades. After the electric energy meter software is upgraded from one version to another version, the position of the electric energy meter data stored in the electric energy meter is changed due to the increase and decrease of the electric energy meter data or the structural adjustment of the electric energy meter data, so that the electric energy meter data is disordered after the program is upgraded, and the electric energy meter cannot normally run. According to the method and the device, based on the mapping information of the storage address and the electric energy meter data which are established in advance, after the upgrading instruction of the electric energy meter is received, the electric energy meter data which are stored in the electric energy meter before being upgraded are backed up to the external storage space. Specifically, if an upgrade instruction of the electric energy meter is received, an electric energy meter backup file is generated according to the mapping information and the electric energy meter data, and the electric energy meter backup file is backed up to an external storage space.
Specifically, the electric energy meter data can be sequentially acquired from the data center of the electric energy meter according to the object identifier, the sequentially acquired electric energy meter data is converted into backup object data according to a preset fixed format, the backup object data and the object identifier corresponding to the backup object data are written into the electric energy meter backup file together, and the electric energy meter backup file is backed up to the external storage space after the object identifier and the backup object data corresponding to all the electric energy meter data are written into the electric energy meter backup file.
And step S300, if an upgrading completion instruction of the electric energy meter is received, restoring the electric energy meter data to the electric energy meter according to the electric energy meter backup file of the external storage space and the mapping information.
In this embodiment, after the electric energy meter is upgraded, that is, after an upgrade completion instruction of the electric energy meter is received, the electric energy meter backup file backed up in advance may be acquired from the external storage space, and the electric energy meter data may be restored to the electric energy meter according to the electric energy meter backup file and the mapping information stored in the electric energy meter. Therefore, the data consistency of the electric energy meter software before and after upgrading is ensured. In some embodiments, after the firmware of the electric energy meter is upgraded, the data structure of the data of the electric energy meter may be changed, so as to avoid the data disorder of the electric energy meter, at this time, the function of recovering the data of the electric energy meter needs to be started. Specifically, the function of the electric energy meter data recovery is to acquire an electric energy meter backup file backed up in an external storage space, then analyze the electric energy meter backup file to acquire backup object data written in the electric energy meter backup file, and sequentially check the validity of each backup object data, if the backup object data is valid, recover the backup object data to a corresponding storage address in the electric energy meter according to mapping information, and if the backup object data is not valid, initialize a value of the storage address corresponding to the backup object data in the electric energy meter to a default value.
Compared with the prior art, the method has the advantages that the electric energy meter has the backup processing function and the recovery processing function by adding the mapping information of the electric energy meter data and the storage address of the electric energy meter data in the original electric energy meter design and enabling the electric energy meter to have the backup processing function and the recovery processing function based on the mapping information, and other electric energy meter designs can keep the original design scheme unchanged, so that the method which is simple and convenient to apply avoids data disorder after the electric energy meter firmware is upgraded and influences the normal operation of the electric energy meter, and the software development and maintenance efficiency is improved.
In an embodiment, the step of generating the electric energy meter backup file according to the mapping information and the electric energy meter data includes:
sequentially acquiring electric energy meter data according to the object identification;
converting the electric energy meter data into backup object data according to a preset message format;
and writing the backup object data into a preset file to generate the electric energy meter backup file.
In this embodiment, as described above, the object identifier is an identifier defined by the electric energy meter for the electric energy meter data object, and the identifier has uniqueness, that is, each electric energy meter data has a uniquely determined object identifier. And the electric energy meter is provided with a data center, and the data center is an area for storing the data of the electric energy meter in the electric energy meter. Therefore, if an upgrading instruction of the electric energy meter is received, electric energy meter data can be sequentially obtained from the data center according to the object identification, after the electric energy meter data are successfully obtained each time, the electric energy meter data are converted into backup object data according to a preset message format, the backup object data are written into the specified offset position of the electric energy meter backup file, the steps are repeated until all the electric energy meter data are converted, and the preset file is written to generate the electric energy meter backup file. The preset file and the preset message format are both set in advance by the technical personnel in the field and can be adjusted in real time according to the actual situation. Through the steps, all the electric energy meter data stored in the electric energy meter can be stored in the external storage space to be used as data backup, so that when the electric energy meter data in the electric energy meter is lost, the electric energy meter data in the electric energy meter can be recovered. In some embodiments, the mapping information is a data object list, the electric energy meter data and the data storage format are acquired from the data center one by one, then data framing is performed according to a preset message format to obtain backup object data, and then the well-grouped backup object data are sequentially stored in a data backup file.
In an embodiment, the step of restoring the electric energy meter data to the electric energy meter according to the electric energy meter backup file of the external storage space and the mapping information includes:
analyzing the electric energy meter backup file to obtain backup object data, and sequentially checking the validity of the backup object data;
and if the backup object data is legal, writing the backup object data into the electric energy meter according to the mapping information.
In this embodiment, after the electric energy meter backup file is generated and the electric energy meter completes firmware upgrade, if the firmware of the electric energy meter is upgraded and the data structure is changed, the electric energy meter data needs to be restored to the electric energy meter according to the electric energy meter backup file and the mapping information. Specifically, firstly, initializing all electric energy meter data in the electric energy meter to a default value, then analyzing an electric energy meter backup file which is backed up in an external storage space in advance to obtain backup object data stored in the electric energy meter backup file, after the backup object data is obtained through analysis, sequentially checking the legality of the backup object data, and if the backup object data is legal, indicating that the backup object data is available, namely writing the backup object data into a data center in the electric energy meter according to mapping information, writing a storage address in the electric energy meter corresponding to the backup object data, and overwriting the initialized default value, wherein the default value is set in advance by technicians in the field and can be adjusted in real time. By the method, all legal backup object data can be recovered to the electric energy meter, namely, the electric energy meter data after the firmware is upgraded can not be disordered, so that the normal operation of the electric energy meter is ensured.
In an embodiment, the step of attempting to check the validity of the backup object data in sequence further includes:
and if the backup object data is illegal, setting the storage address corresponding to the backup object data as a default value.
In this embodiment, if the backup object data is illegal, which means that the backup object data is not available, the storage address corresponding to the backup object data may be set as a default value. Specifically, after the firmware of the electric energy meter is upgraded and the data structure is changed, firstly, all electric energy meter data in the electric energy meter is initialized to a default value, if illegal backup object data exists in an electric energy meter backup file, the storage address corresponding to the illegal backup object data does not need to be covered with the illegal backup object data, but the storage address corresponding to the illegal backup object data is directly set to the default value. By the method, the illegal backup object data in the electric energy meter backup file can be screened out, and the illegal backup object data can be screened out, so that the backup object data stored in the electric energy meter are both legal values, and the normal operation of the electric energy meter can be ensured.
Furthermore, the validity judgment of all backup object data in the application is independent, that is, the validity judgment of data in the whole electric energy meter backup file is not influenced by the fact that one or more backup object data are illegal. Therefore, when it is detected that a certain backup object data is illegal, only the backup object data is not applied to data recovery.
In addition, in some embodiments, the electric energy meter backup file generated according to the mapping information and the electric energy meter data may be dual backed up in the external storage space, that is, the electric energy meter backup file is backed up in both the master backup area and the slave backup area. When the recovery of the electric energy meter data from the main backup area fails, the recovery processing of the slave backup area is continued, when the recovery of the data of the slave backup area also fails, the electric energy meter data which fails in the recovery is set as a default value, the correctness of the electric energy meter data can be ensured to the maximum extent through double backup and respective recovery, and the electric energy meter can still normally operate after the firmware is upgraded.
In an embodiment, the step of sequentially checking the validity of the backup object data includes:
checking whether the data length of the backup object data is larger than a preset maximum length value;
and if the data length is larger than the preset maximum length value, judging that the backup object data is illegal.
In this embodiment, the validity of the backup object data is checked, that is, whether the backup object data satisfies three validity conditions, where the three validity conditions are to check whether the data length of the backup object data is smaller than or equal to a preset maximum length value; whether the position of the backup object data after the backup object data is deviated by the first preset length is a preset symbol or not; whether the cyclic redundancy value of the backup object data is equal to a pre-stored historical cyclic redundancy value. If all three validity conditions are met, judging that the backup object data is legal; if any of the validity conditions is not satisfied, it is determined that the backup object data is invalid. Specifically, firstly, sequentially checking whether the data length of the backup object data is greater than a preset maximum length value; and if the data length is larger than the preset maximum length value, judging that the backup object data is illegal. Wherein, the preset maximum length value is set in advance by the technicians in the field and can be adjusted in real time. In one embodiment, the predetermined maximum length value is the maximum length value DATA _ MAX _ LEN of a single DATA object.
In an embodiment, the step of checking whether the data length of the backup object data is greater than a preset maximum length value includes:
if the data length is smaller than or equal to the maximum length value, judging whether a symbol at a position of the backup object data after the backup object data is shifted by a first preset length is a preset symbol or not;
and if the symbol at the position of the backup object data after the backup object data is deviated by the first preset length is not the preset symbol, judging that the backup object data is illegal.
In this embodiment, if the data length is less than or equal to the maximum length value, it is further determined whether a position of the backup object data after being offset by the first preset length is a preset symbol, and if the position of the backup object data after being offset by the first preset length is not the preset symbol, it is determined that the backup object data is illegal. The first preset length is set in advance by a person skilled in the art and can be adjusted in real time, for example, the first preset length is N + 3; the preset symbol is also set in advance by those skilled in the art and can be adjusted in real time, and preferably, the preset symbol is an object spacer "0 xAA".
In an embodiment, the step of determining whether the symbol at the position where the backup object data is shifted by the first preset length is a preset symbol further includes:
if the position of the backup object data after the backup object data is deviated by the first preset length is a preset symbol, calculating a cyclic redundancy value of the backup object data, and judging whether the cyclic redundancy value is equal to a pre-stored historical cyclic redundancy value or not;
if the cyclic redundancy value is equal to the historical cyclic redundancy value, judging that the backup object data is legal;
and if the cyclic redundancy value is not equal to the historical cyclic redundancy value, judging that the backup object data is illegal.
In this embodiment, the cyclic redundancy value is a value calculated by CRC calculation according to an object identifier, a data storage format, a data length, and data content corresponding to the backup object data when the validity of the backup object data is checked, and the historical cyclic redundancy value is a cyclic redundancy value calculated by the same method when the backup object data is written into the electric energy meter backup file.
The application still provides a recovery unit of electric energy meter data, and the recovery unit of electric energy meter data includes:
the mapping information establishing module A10 is used for establishing a storage address of the electric energy meter data and mapping information of the electric energy meter data;
the data backup module A20 is configured to generate an electric energy meter backup file according to the mapping information and the electric energy meter data and backup the electric energy meter backup file to an external storage space if receiving an upgrade instruction of the electric energy meter;
and the data recovery module A30 is configured to, if the upgrade completion instruction of the electric energy meter is received, recover the electric energy meter data to the electric energy meter according to the electric energy meter backup file of the external storage space and the mapping information.
The recovery device of the electric energy meter data is used for executing the method in each embodiment of the recovery method of the electric energy meter data, and details are not repeated here.
The application also provides a recovery device of the electric energy meter data, which comprises a memory, a processor and a recovery program of the electric energy meter data, wherein the recovery program of the electric energy meter data is stored on the memory and can be operated on the processor, and the recovery program of the electric energy meter data is used for executing the method in the various embodiments of the application.
The present application also proposes a computer-readable storage medium having stored thereon a recovery program for electric energy meter data. The computer-readable storage medium includes a computer-readable storage medium, which may be the Memory in fig. 1, and may also be at least one of a ROM (Read-Only Memory)/RAM (Random Access Memory), a magnetic disk, and an optical disk, and the computer-readable storage medium includes several instructions for causing a piece of terminal equipment of internet of things (which may be a mobile phone, a computer, a server, a terminal of internet of things, or a network device) having a processor to execute the method described in the embodiments of the present application.
In this application, the terms "first", "second", "third", "fourth" and "fifth" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance, and the specific meanings of the above terms in this application will be understood to those of ordinary skill in the art according to the specific circumstances.
In the description herein, references to the description of the term "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., mean that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in multiple embodiments or examples of the application. In this specification, the schematic representations of the terms used above are not necessarily intended to refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, various embodiments or examples and features of different embodiments or examples described in this specification can be combined and combined by one skilled in the art without contradiction.
Although the embodiments of the present application have been shown and described, the scope of protection of the present application is not limited thereto, it should be understood that the above-described embodiments are illustrative and not to be construed as limiting the present application, and that those skilled in the art can make changes, modifications and substitutions to the above-described embodiments within the scope of the present application, and that such changes, modifications and substitutions are intended to be included within the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (10)

1. The method for recovering the data of the electric energy meter is characterized by comprising the following steps of:
establishing a storage address of electric energy meter data and mapping information of the electric energy meter data;
if an upgrading instruction of the electric energy meter is received, generating an electric energy meter backup file according to the mapping information and the electric energy meter data, and backing up the electric energy meter backup file to an external storage space;
and if the upgrading completion instruction of the electric energy meter is received, restoring the electric energy meter data to the electric energy meter according to the electric energy meter backup file of the external storage space and the mapping information.
2. The method for recovering power meter data according to claim 1, wherein the mapping information includes at least an object identifier; the step of generating the electric energy meter backup file according to the mapping information and the electric energy meter data comprises the following steps:
sequentially acquiring object data according to the object identification;
converting the electric energy meter data into backup object data according to a preset message format;
and writing the backup object data into a preset file to generate the electric energy meter backup file.
3. The method for recovering electric energy meter data according to claim 1, wherein the step of recovering the electric energy meter data to the electric energy meter according to the electric energy meter backup file of the external storage space and the mapping information comprises:
analyzing the electric energy meter backup file to obtain backup object data, and sequentially checking the validity of the backup object data;
and if the backup object data is legal, writing the backup object data into the electric energy meter according to the mapping information.
4. The method for recovering electric energy meter data according to claim 3, wherein the step of sequentially checking the validity of the backup object data further comprises:
and if the backup object data is illegal, setting the storage address corresponding to the backup object data as a default value.
5. The method for recovering electric energy meter data according to claim 3, wherein the step of sequentially checking the validity of the backup object data comprises:
checking whether the data length of the backup object data is larger than a preset maximum length value;
and if the data length is larger than the preset maximum length value, judging that the backup object data is illegal.
6. The method for recovering electric energy meter data according to claim 5, wherein the step of checking whether the data length of the backup object data is greater than a preset maximum length value is followed by:
if the data length is smaller than or equal to the maximum length value, judging whether a symbol at a position of the backup object data after the backup object data is shifted by a first preset length is a preset symbol or not;
and if the symbol at the position of the backup object data after the backup object data is deviated by the first preset length is not the preset symbol, judging that the backup object data is illegal.
7. The apparatus for recovering power meter data according to claim 6, wherein the step of determining whether the symbol at the position where the backup object data is shifted by the first preset length is a preset symbol further comprises:
if the position of the backup object data after the backup object data is deviated by the first preset length is a preset symbol, calculating a cyclic redundancy value of the backup object data, and judging whether the cyclic redundancy value is equal to a pre-stored historical cyclic redundancy value or not;
if the cyclic redundancy value is equal to the historical cyclic redundancy value, judging that the backup object data is legal;
and if the cyclic redundancy value is not equal to the historical cyclic redundancy value, judging that the backup object data is illegal.
8. A device for recovering data of an electric energy meter is characterized by comprising:
the mapping information establishing module is used for establishing a storage address of the electric energy meter data and mapping information of the electric energy meter data;
the data backup module is used for generating an electric energy meter backup file according to the mapping information and the electric energy meter data and backing up the electric energy meter backup file to an external storage space if an upgrading instruction of the electric energy meter is received;
and the data recovery module is used for recovering the electric energy meter data to the electric energy meter according to the electric energy meter backup file of the external storage space and the mapping information if receiving the upgrade completion instruction of the electric energy meter.
9. An electric energy meter data recovery device, comprising a memory, a processor, and an electric energy meter data recovery program stored on the memory and executable on the processor, wherein the electric energy meter data recovery program, when executed by the processor, implements the steps of the electric energy meter data recovery method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that the computer-readable storage medium has stored thereon a recovery program of electric energy meter data, which when executed by a processor implements the steps of the recovery method of electric energy meter data according to any one of claims 1 to 7.
CN202210094609.4A 2022-01-26 2022-01-26 Electric energy meter data recovery method, device, equipment and computer storage medium Pending CN114528154A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210094609.4A CN114528154A (en) 2022-01-26 2022-01-26 Electric energy meter data recovery method, device, equipment and computer storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210094609.4A CN114528154A (en) 2022-01-26 2022-01-26 Electric energy meter data recovery method, device, equipment and computer storage medium

Publications (1)

Publication Number Publication Date
CN114528154A true CN114528154A (en) 2022-05-24

Family

ID=81622094

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210094609.4A Pending CN114528154A (en) 2022-01-26 2022-01-26 Electric energy meter data recovery method, device, equipment and computer storage medium

Country Status (1)

Country Link
CN (1) CN114528154A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116108022A (en) * 2023-04-12 2023-05-12 石家庄科林电气股份有限公司 Electric energy meter data storage method, device, terminal and storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116108022A (en) * 2023-04-12 2023-05-12 石家庄科林电气股份有限公司 Electric energy meter data storage method, device, terminal and storage medium
CN116108022B (en) * 2023-04-12 2023-06-13 石家庄科林电气股份有限公司 Electric energy meter data storage method, device, terminal and storage medium

Similar Documents

Publication Publication Date Title
US11614926B2 (en) Consensus mechanism deployment method and apparatus
CN110690974B (en) Block chain based data verification method, device, equipment and readable storage medium
CN110888662A (en) Vehicle remote silent upgrading method and device, vehicle and storage medium
CN112650520B (en) Ammeter upgrading method and system, intelligent ammeter and storage medium
CN110647490B (en) Data transmission method, device, equipment and computer storage medium
CN111209343B (en) Node data synchronization method, device, equipment and storage medium
CN111767144B (en) Transaction route determination method, device, equipment and system for transaction data
CN111369237B (en) Data processing method and device and computer storage medium
CN105589699A (en) Serial number information update method, device and terminal
CN112631633A (en) Function module upgrading method and device based on double-core intelligent electric meter
CN114528154A (en) Electric energy meter data recovery method, device, equipment and computer storage medium
CN112286565B (en) Embedded system differential upgrading method based on storage container
CN113178842A (en) Relay protection setting value monitoring method and device, relay protection equipment and storage medium
CN111367761B (en) Information management method, system and related components of universal server
CN112395339A (en) Method and device for checking data access between systems, computer equipment and storage medium
CN112667272A (en) Ammeter upgrading method and system, intelligent ammeter and storage medium
CN110730242B (en) File transmission method, device and equipment
CN116610336A (en) Firmware upgrading method, system, device and readable storage medium
CN110990360A (en) File synchronization method based on network storage device and related components
CN114553859A (en) BMC configuration management method and device, electronic equipment and storage medium
CN115510366A (en) Business message pushing method and device, computer equipment and storage medium
CN114091909A (en) Collaborative development method, system, device and electronic equipment
CN110213396B (en) Dynamic decision method and system for automatically allocating addresses to node equipment of Internet of things of airport
CN112968933B (en) Data transmission method, device, server and storage medium
CN113064658A (en) Method, device and equipment for copying configuration data and computer 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