Electric energy meter upgrading method, device and system

Upgrading electricity meters by using segmented data transmission solves the problems of high hardware costs and long upgrade times in existing technologies, and achieves an efficient and low-cost electricity meter upgrade process.

CN119473365AActive Publication Date: 2025-02-18ZHEJIANG CHINT INSTR & METER
View PDF 16 Cites 0 Cited by

Patent Information

Application Number
CN202510053692.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-14
Publication Date
2025-02-18
Estimated Expiration
2045-01-14

AI Technical Summary

Technical Problem

Existing methods for upgrading electricity meters require additional backup memory or storage space, which increases hardware costs and makes the upgrade process time-consuming.

Method used

The upgrade package is divided into multiple data blocks and sent to the electricity meter using a segmented data transmission method. After receiving each segmented data frame, the electricity meter backs up the data and erases the original data. Then, it writes the new data and loads the backup data into a reply frame and sends it to the upgrade server until all data blocks have been written.

Benefits of technology

This reduces the need for additional backup storage space, lowers hardware costs, shortens upgrade time, and improves the efficiency and reliability of the upgrade process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119473365A_ABST
    Figure CN119473365A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of intelligent electric meters, in particular to an electric energy meter upgrading method, device and system. The method comprises the following steps: receiving a block data frame which is sent by an upgrade server and contains upgrade package block data; extracting to-be-backed-up data with the corresponding size according to the size of the block data in the block data frame, and backing up the to-be-backed-up data; erasing original data to be backed up, and writing the received block data into an erasing area; loading the backup data into a successfully written reply frame, and sending the reply frame to the upgrade server; and repeatedly receiving the block data frame, backing up the data, erasing the data and writing the block data until all the block data in the upgrade package are written. In the upgrading method, the data to be backed up can be directly sent to the upgrading server with the reply frame to be stored, the required time is short, meanwhile, additional backup storage space or backup storage does not need to be arranged, and the hardware cost is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of smart electric meters, and in particular to an electric energy meter upgrading method, device and system. Background Art

[0002] The electric energy meter is an electric energy metering device installed by the electric energy seller at the electric energy demand side. The electric energy seller charges the corresponding fee by referring to the measurement value in the electric energy meter. As the functions of smart electric energy meters are relatively complex, the electric energy meters that have been installed on site may need to be upgraded to perform functional iterations and fix bugs. The internal program of the smart electric energy meter consists of two parts: the boot program and the application program. The boot program is used to start and upgrade the electric energy meter, and the application program is used to execute the actual business (it is this part of the program that is changed during the upgrade).

[0003] The upgrade process of the energy meter is to transmit the upgrade package to the energy meter through the host computer or the master station system. The entire energy meter upgrade process is quite unreliable, and the unreliable factors include communication interference, internal self-programming interference of the energy meter, data jump, etc. For these reasons, the energy meter will place a backup memory or additional storage space inside to back up the old application and important operating data before the upgrade. If the upgrade fails, the energy meter can call back the old application and data in the backup memory to restore them to the original state to prevent the energy meter from failing to upgrade and failing to operate normally.

[0004] However, the above upgrade process requires the addition of additional backup memory or storage space, which increases the hardware cost. At the same time, the old application and important data need to be backed up to the backup memory before the upgrade. Since the amount of data is very large, it takes a long time to copy. For a large number of installed electric energy meters, this time consumption will be a huge workload when upgrading in batches. Summary of the invention

[0005] In view of this, the present invention provides an electric energy meter upgrade method, device and system to solve the problem that the electric energy meter upgrade method in the prior art needs to add additional backup memory or storage space, which increases hardware costs.

[0006] In a first aspect, the present invention provides an electric energy meter upgrade method, which is applied to the electric energy meter, and the method comprises: receiving a block data frame containing block data of an upgrade package sent by an upgrade server; extracting data to be backed up of corresponding size according to the size of the block data in the block data frame for backing up; erasing the original data to be backed up, and writing the received block data into an erase area; loading the backed-up data into a reply frame of successful writing and sending it to the upgrade server; repeatedly receiving the block data frame, backing up the data, erasing and writing the block data until all the block data in the upgrade package are written.

[0007] In the present invention, when the electric energy meter is upgraded, the upgrade package is sent to the electric energy meter in blocks. After receiving each block data frame, the electric energy meter backs up the corresponding size of the data to be backed up, erases the original data, writes the received block data to the corresponding position of the original data, and then loads the backup data into the reply frame of successful writing and sends them to the upgrade server. In this upgrade method, the data to be backed up can be directly sent to the upgrade server for storage with the reply frame, which takes a short time, and there is no need to set up additional backup storage space or backup memory, which reduces the hardware cost.

[0008] In an optional embodiment, receiving a block data frame of an upgrade package sent by an upgrade server includes: receiving an upgrade request frame sent by the upgrade server; sending an upgrade consent frame to the upgrade server according to the upgrade request frame; and receiving a block data frame containing upgrade package block data sent by the upgrade server according to the upgrade consent frame.

[0009] In the present invention, before sending the block data frame, an upgrade request frame is first sent to inquire whether the electric energy meter is upgraded, and the block data frame is sent after confirming the upgrade, so as to avoid unnecessary data transmission and reduce unnecessary waste of resources.

[0010] In an optional implementation, the method further includes: receiving an upgrade check frame sent by the upgrade server; generating an upgrade success reply frame or an upgrade failure reply frame according to the upgrade check frame and sending it to the upgrade server.

[0011] In an optional embodiment, the method also includes: receiving backup data sent by the upgrade server through a private protocol, the backup data being sent by the upgrade server when no reply is received within a preset time after receiving a reply frame of upgrade failure or sending an upgrade check frame; and rewriting the received backup data.

[0012] In the present invention, after the block data is written, an upgrade check frame sent by the upgrade server is received. When the upgrade fails, the upgrade server can resend the previously saved backup data to the electric energy meter so that the electric energy meter can be restored to its original state when the upgrade fails, thereby not affecting the normal operation of the electric energy meter.

[0013] In a second aspect, the present invention provides a method for upgrading an electric energy meter, which is applied to an upgrade server, and the method comprises: sending a block data frame containing block data of an upgrade package to the electric energy meter; receiving a reply frame indicating successful writing sent by the electric energy meter, wherein the reply frame is generated after the electric energy meter backs up the corresponding size of data to be backed up and then erases it, and writes the block data frame in the erase area; the reply frame is loaded with backup data; the backup data in the reply frame is stored; and the steps of sending the block data frame to the electric energy meter, receiving the reply frame, and storing the backup data in the reply frame are repeated until all the block data in the upgrade package are sent.

[0014] In an optional embodiment, sending a block data frame containing block data of an upgrade package to an electric energy meter includes: sending an upgrade request frame to the electric energy meter; receiving an upgrade consent frame sent by the electric energy meter based on the upgrade request frame; and sending a block data frame containing block data of the upgrade package to the electric energy meter based on the upgrade consent frame.

[0015] In an optional embodiment, the method also includes: sending an upgrade check frame to the electric energy meter; when a reply frame indicating an upgrade failure sent by the electric energy meter based on the upgrade check frame is received within a preset time or a reply frame from the electric energy meter is not received within the preset time, sending the saved backup data to the electric energy meter through a private protocol.

[0016] In a third aspect, the present invention provides an electric energy meter upgrade device, which is applied to the electric energy meter, and the device includes: a data frame receiving module, which is used to receive a block data frame containing block data of an upgrade package sent by an upgrade server; a backup module, which is used to extract the corresponding size of the data to be backed up for backup according to the size of the block data in the block data frame; an erase and write module, which is used to erase the original data to be backed up, and write the received block data into an erase area; a reply module, which is used to load the backup data into a reply frame of successful writing and send it to the upgrade server; an upgrade module, which is used to repeatedly receive the block data frame, backup the application, erase and write the block data until all the block data in the upgrade package are written.

[0017] In a fourth aspect, the present invention provides an electric energy meter upgrade device, which is applied to an upgrade server, and the device includes: a data frame sending module, which is used to send a block data frame containing block data of an upgrade package to the electric energy meter; a reply receiving module, which is used to receive a reply frame of successful writing sent by the electric energy meter, and the reply frame is generated after the electric energy meter backs up the corresponding size of the data to be backed up and then erases it, and writes the block data frame in the erase area; the reply frame is loaded with backup data; a storage module, which is used to store the backup data in the reply frame; a sending and receiving repetition module, which is used to repeat the steps of sending the block data frame to the electric energy meter, receiving the reply frame, and storing the backup data in the reply frame until all the block data frames in the upgrade package are sent.

[0018] In a fifth aspect, the present invention provides an electric energy meter upgrade system, the system comprising: an upgrade server and an electric energy meter; the upgrade server is used to send block data frames of an upgrade package to the electric energy meter; the electric energy meter is used to extract the corresponding size of the data to be backed up for backup according to the size of the block data in the received block data frame; erase the original data to be backed up, and write the received block data into the erase area; load the backup data into a reply frame of successful writing and send it to the upgrade server; the upgrade server is also used to receive the reply frame of successful writing sent by the electric energy meter, store the backup data in the reply frame; and continue to send the block data frame to the electric energy meter based on the received reply frame until all the block data in the upgrade package are sent; the electric energy meter is also used to receive the block data frames continued to be sent by the upgrade server, repeat the steps of extracting the data to be backed up, erasing, writing the block data, and sending the reply frame until all the block data in the upgrade package are written.

[0019] In a sixth aspect, the present invention provides a computer device, comprising: a memory and a processor, the memory and the processor are communicatively connected to each other, computer instructions are stored in the memory, and the processor executes the electric energy meter upgrade method of the above-mentioned first aspect or any corresponding embodiment thereof, or executes the electric energy meter upgrade method of the above-mentioned second aspect or any corresponding embodiment thereof by executing the computer instructions.

[0020] In the seventh aspect, the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the electric energy meter upgrade method of the above-mentioned first aspect or any corresponding embodiment thereof, or to execute the electric energy meter upgrade method of the above-mentioned second aspect or any corresponding embodiment thereof.

[0021] In an eighth aspect, the present invention provides a computer program product, comprising computer instructions, the computer instructions being used to enable a computer to execute the electric energy meter upgrade method of the above-mentioned first aspect or any corresponding embodiment thereof, or to execute the electric energy meter upgrade method of the above-mentioned second aspect or any corresponding embodiment thereof. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0023] Figure 1 is a flow chart of an electric energy meter upgrading method according to an embodiment of the present invention; Figure 2 is a flow chart of another method for upgrading an electric energy meter according to an embodiment of the present invention; Figure 3 is a structural block diagram of an electric energy meter upgrading device according to an embodiment of the present invention; Figure 4 is a structural block diagram of another electric energy meter upgrading device according to an embodiment of the present invention; Figure 5 is a structural block diagram of an electric energy meter upgrading system according to an embodiment of the present invention; Figure 6 is a working principle diagram of an electric energy meter upgrading system according to an embodiment of the present invention; Figure 7 It is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0024] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.

[0025] According to an embodiment of the present invention, an embodiment of an electric energy meter upgrading method is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0026] In this embodiment, a method for upgrading an electric energy meter is provided, which is used for the electric energy meter. Figure 1 is a flow chart of a method for upgrading an electric energy meter according to an embodiment of the present invention. Figure 1 As shown, the process includes the following steps: Step S101, receiving a block data frame containing block data of an upgrade package sent by an upgrade server. Specifically, when the electric energy meter needs to upgrade the application program, the upgrade server sends the upgrade package to the electric energy meter. At the same time, since the upgrade package contains a large amount of data, in order to improve transmission efficiency, enhance reliability and compatibility, and adapt to different network conditions, the upgrade package is divided into multiple data blocks during transmission, that is, a block data frame containing one block data is sent each time. The size of each block data can be determined according to actual conditions, for example, each block data can be tens of KB or several MB. Among them, the upgrade server can be a device that stores the upgrade package, for example, it can be a host computer or a master station system.

[0027] Step S102, extracting the corresponding size of the data to be backed up for backup according to the size of the block data in the block data frame. Specifically, after the electric energy meter receives a block data frame, a block of code of the corresponding size is extracted from the internal application or important operation data thereof as the data to be backed up according to the size of the block elements in the block data frame. The size of the extracted data to be backed up can be the same as the size of the received block data, so that the received block data can be written. The extracted data to be backed up can be backed up in the running memory RAM (Random Access Memory). The extraction and backup process can be understood as copying part of the data from the application or important operation data running before the electric energy meter is upgraded, and saving it in the running memory. Among them, whether the important operation data needs to be backed up can be preset or determined by the user according to the actual situation.

[0028] It should be noted that since the block data is obtained by dividing the upgrade package into blocks, that is, each block data is usually not very large, the data to be backed up extracted based on the size of the block data will not be very large either. Therefore, there is no need to set up additional backup memory or storage space in the electric energy meter, and the extracted data to be backed up can be directly stored in the running memory.

[0029] Step S103, the original data to be backed up is erased, and the received block data is written into the erase area. Specifically, after the corresponding application or important operation data, i.e., the data to be backed up, is backed up, this part of data can be erased from the original application or important operation data, and then the received block data is written into the erase area, so as to realize the update and replacement of the application.

[0030] Step S104, load the backup data into a successful write reply frame and send it to the upgrade server. Specifically, when the block data is written successfully, a successful write reply frame is generated, and the backup data stored in the running memory is loaded into the reply frame, and then the reply frame is sent to the upgrade server.

[0031] Step S105, repeatedly receiving block data frames, data backup, erasing and writing of block data, until all block data in the upgrade package are written. Specifically, the writing of one block data is realized through the above steps S101 to S104. The upgrade package includes multiple block data, so other block data can also be written with reference to the above steps S101 to S104, that is, multiple block data frames can be sent to the electric energy meter in sequence, and the electric energy meter executes the above steps S101 to S104 in sequence, and repeatedly receives, backs up, erases and writes block data for each block data frame, until all block data in the upgrade package are written. Thereby completing the upgrade process of the electric energy meter.

[0032] The electric energy meter upgrade method provided by the embodiment of the present invention, when the electric energy meter is upgraded, the upgrade package is sent to the electric energy meter in blocks. After the electric energy meter receives each block data frame, the corresponding size of the data to be backed up is backed up, the original data is erased, and the received block data is written to the corresponding position of the original data, and then the backup data is loaded into the reply frame of successful writing and sent to the upgrade server together. In this upgrade method, the data to be backed up can be directly sent to the upgrade server for storage with the reply frame, which takes a short time, and there is no need to set up additional backup storage space or backup memory, which reduces the hardware cost.

[0033] In this embodiment, a method for upgrading an electric energy meter is provided. The method is applied to an electric energy meter and comprises the following steps: Step S201: receiving a block data frame containing block data of an upgrade package sent by an upgrade server.

[0034] Specifically, the above step S201 includes: Step S2011, receiving an upgrade request frame sent by the upgrade server; specifically, after relevant personnel update the function of the application in the electric energy meter or generate an upgrade package for bug fixes, the upgrade server can send an upgrade request frame to the electric energy meter, that is, asking the electric energy meter whether to upgrade.

[0035] Step S2012, sending an upgrade consent frame to the upgrade server according to the upgrade request frame; specifically, after the electric energy meter receives the upgrade request frame, if the upgrade is agreed, the upgrade consent frame can be replied to the upgrade server; if the upgrade is not agreed, the data frame of not upgrading can be replied to the upgrade server.

[0036] Step S2013, receiving a block data frame containing block data of the upgrade package sent by the upgrade server according to the upgrade consent frame. Specifically, when the upgrade server receives the upgrade consent frame, it can divide the upgrade package into multiple block data, and then send the block data to the electric energy meter. If a data frame not to upgrade is received, the upgrade can be canceled and the subsequent process will not be executed.

[0037] It should be noted that the upgrade server can send upgrade request frames to multiple electric energy meters at the same time. After each electric energy meter receives the upgrade request frame, if it agrees to upgrade, it can send an upgrade consent frame to the upgrade server. After the electric energy meter receives the upgrade consent frame sent by any electric energy meter, it can send a block data frame to it. For the electric energy meter that has not sent the upgrade consent frame, the block data frame will no longer be sent to it.

[0038] Step S202: extract the corresponding size of the to-be-backed data according to the size of the block data in the block data frame for backup. Figure 1 Step S102 of the illustrated embodiment will not be described in detail here.

[0039] Step S203, the original data to be backed up is erased, and the received block data is written into the erase area; Figure 1 Step S103 of the illustrated embodiment will not be described in detail here.

[0040] Step S204: Load the backup data into a write-success reply frame and send it to the upgrade server. Figure 1 Step S104 of the illustrated embodiment will not be described in detail here.

[0041] Step S205, receiving an upgrade check frame sent by the upgrade server; generating an upgrade success reply frame or an upgrade failure reply frame according to the upgrade check frame and sending it to the upgrade server.

[0042] Specifically, after the upgrade server has sent all the block data frames in the upgrade package, it can continue to send upgrade check frames to the electric energy meter. After all the block data are written, the electric energy meter can be upgraded based on the written block data and determine whether the upgrade is successful. After the electric energy meter receives the upgrade check frame sent by the upgrade server, it replies to the generation server according to the result of whether the upgrade is successful. For example, if the upgrade is successful, a reply frame of upgrade success is sent to the upgrade server, and if the upgrade fails, a reply frame of upgrade failure is sent to the upgrade server.

[0043] Step S206, receiving backup data sent by the upgrade server through a private protocol, wherein the backup data is sent by the upgrade server when no reply is received within a preset time after receiving a reply frame of upgrade failure or sending an upgrade check frame; and rewriting the received backup data.

[0044] Specifically, when the upgrade server receives a reply frame indicating an upgrade failure sent by the electric energy meter within a preset time or does not receive a reply frame within a certain period of time after sending an upgrade check frame, it is determined that the electric energy meter upgrade has failed, and the saved backup data is sent to the electric energy meter through a private protocol. After receiving the backup data, the electric energy meter can erase the written block data and rewrite the received backup data, thereby restoring the electric energy meter to its original state. The electric energy meter includes a boot program and an application program. The upgrade process is for upgrading the application program, and the private protocol runs in the reference program. Even if the application program fails to upgrade, the operation of the private protocol is not affected by the application, that is, data transmission can also be performed through the private protocol.

[0045] In this embodiment, a method for upgrading an electric energy meter is provided, which is applied to upgrading a server, such as Figure 2 As shown, the method comprises the following steps: Step S301: sending a block data frame containing block data of an upgrade package to an electric energy meter.

[0046] Step S302, receiving a reply frame indicating successful writing sent by the electric energy meter, wherein the reply frame is generated after the electric energy meter erases the corresponding size of the data to be backed up and writes the block data frame in the erase area; the reply frame is loaded with the backup data.

[0047] Step S303: store the backup data in the reply frame.

[0048] Step S304, repeating the steps of sending the block data frame to the electric energy meter, receiving the reply frame, and storing the backup data in the reply frame until all the block data in the upgrade package are sent.

[0049] The further functional description of each of the above steps is the same as that of the corresponding embodiments of the above steps S101 to S104, and will not be repeated here.

[0050] In this embodiment, a method for upgrading an electric energy meter is provided, which is applied to an upgrading server. The method comprises the following steps: Step S401: sending a block data frame containing block data of an upgrade package to an electric energy meter.

[0051] Specifically, the above step S401 includes: Step S4011, sending an upgrade request frame to the electric energy meter.

[0052] Step S4012: receiving an upgrade approval frame sent by the electric energy meter based on the upgrade request frame.

[0053] Step S4013: sending a block data frame containing block data of the upgrade package to the electric energy meter based on the upgrade consent frame.

[0054] Step S402, receiving a write success reply frame sent by the electric energy meter, wherein the reply frame is generated after the electric energy meter erases the corresponding size of the backed-up data and writes the block data frame in the erase area; the reply frame is loaded with the backup data.

[0055] Step S403: store the backup data in the reply frame.

[0056] Step S404, repeating the steps of sending the block data frame to the electric energy meter, receiving the reply frame, and storing the backup data in the reply frame until all the block data frames in the upgrade package are sent.

[0057] Step S405, sending an upgrade check frame to the electric energy meter; when a reply frame indicating an upgrade failure sent by the electric energy meter based on the upgrade check frame is received within a preset time or a reply frame from the electric energy meter is not received within the preset time, sending the saved backup data to the electric energy meter through a private protocol.

[0058] The further functional description of each of the above steps is the same as that of the corresponding embodiments of the above steps S201 to S206, and will not be repeated here.

[0059] In this embodiment, an electric energy meter upgrade device is also provided, which is used to implement the above embodiments and preferred implementations, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware for a predetermined function. Although the device described in the following embodiments is preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.

[0060] This embodiment provides an electric energy meter upgrading device, which is applied to an electric energy meter, such as Figure 3 As shown, including: The data frame receiving module 31 is used to receive a block data frame containing block data of an upgrade package sent by an upgrade server.

[0061] The backup module 32 is used to extract the to-be-backed-up data of corresponding size according to the size of the block data in the block data frame for backup.

[0062] The erasing and writing module 33 is used to erase the original data to be backed up and write the received block data into the erasing area.

[0063] The reply module 34 is used to load the backup data into a write-success reply frame and send it to the upgrade server.

[0064] The upgrade module 35 is used to repeatedly receive the block data frame, backup and erase the application program, and write the block data until all the block data in the upgrade package are written.

[0065] In an optional embodiment, the data frame receiving module is specifically used to: receive an upgrade request frame sent by an upgrade server; send an upgrade consent frame to the upgrade server based on the upgrade request frame; and receive a block data frame containing upgrade package block data sent by the upgrade server based on the upgrade consent frame.

[0066] In an optional implementation, the device further includes: a first inspection module, specifically configured to receive an upgrade inspection frame sent by the upgrade server; generate an upgrade success reply frame or an upgrade failure reply frame according to the upgrade inspection frame and send it to the upgrade server.

[0067] In an optional embodiment, the device also includes: a backup writing module, which is specifically used to receive backup data sent by the upgrade server through a private protocol, and the backup data is sent by the upgrade server when no reply is received within a preset time after receiving a reply frame of upgrade failure or sending an upgrade check frame; and rewriting the received backup data.

[0068] The further functional description of each of the above modules is the same as that of the above corresponding embodiments and will not be repeated here.

[0069] This embodiment provides an electric energy meter upgrade device, which is applied to upgrade a server, such as Figure 4 As shown, the device comprises: The data frame sending module 41 is used to send a block data frame containing block data of the upgrade package to the electric energy meter.

[0070] The reply receiving module 42 is used to receive a reply frame of successful writing sent by the electric energy meter, which is generated after the electric energy meter backs up the corresponding size of the data to be backed up and erases it, and writes the block data frame in the erase area; the reply frame is loaded with backup data.

[0071] The storage module 43 is used to store the backup data in the reply frame.

[0072] The sending and receiving repeating module 44 is used to repeat the steps of sending the block data frame to the electric energy meter, receiving the reply frame and storing the backup data in the reply frame until all the block data frames in the upgrade package are sent.

[0073] In an optional implementation, the data frame sending module is specifically used to: send an upgrade request frame to the electric energy meter; receive an upgrade consent frame sent by the electric energy meter based on the upgrade request frame; and send a block data frame containing upgrade package block data to the electric energy meter based on the upgrade consent frame.

[0074] In an optional embodiment, the device also includes: a second inspection module, specifically used to send an upgrade inspection frame to the electric energy meter; when a reply frame of upgrade failure sent by the electric energy meter based on the upgrade inspection frame is received within a preset time or a reply frame from the electric energy meter is not received within the preset time, the saved backup data is sent to the electric energy meter through a private protocol.

[0075] The further functional description of each of the above modules is the same as that of the above corresponding embodiments and will not be repeated here.

[0076] This embodiment provides an electric energy meter upgrade system, such as Figure 5 As shown, the system includes: an upgrade server and an electric energy meter; the upgrade server is used to send block data frames of an upgrade package to the electric energy meter; the electric energy meter is used to extract the corresponding size of the data to be backed up for backup according to the size of the block data in the received block data frame; erase the original data to be backed up, and write the received block data into the erase area; load the backup data into a reply frame of successful writing and send it to the upgrade server; the upgrade server is also used to receive the reply frame of successful writing sent by the electric energy meter, store the backup data in the reply frame; and continue to send the block data frame to the electric energy meter based on the received reply frame until all the block data in the upgrade package are sent; the electric energy meter is also used to receive the block data frames that the upgrade server continues to send, and repeats the steps of extracting the data to be backed up, erasing, writing the block data, and sending the reply frame until all the block data in the upgrade package are written.

[0077] As a specific application example of the embodiment of the present invention, Figure 6 As shown, the electric energy meter upgrade system can work according to the following process: (1) The host computer or master station system sends an upgrade request frame to one or more electricity meters.

[0078] (2) After receiving the upgrade request frame, if the electric energy meter agrees to upgrade, it replies with an upgrade consent frame.

[0079] (3) After the host computer or the master station system receives the upgrade consent frame sent by the electric energy meter, it sends a block data frame (for example, 200 bytes) of the new upgrade package to the corresponding electric energy meter.

[0080] (4) After receiving the block data frame, the electric energy meter first extracts a block of code (200 bytes) of the old application, temporarily backs it up in the running memory RAM, and then erases this part of the code of the old application.

[0081] (5) The electric energy meter writes the block data in the block data frame received in step "(3)" into the erase area in step "(4)", that is, replaces it with the new application.

[0082] (6) After data writing is completed, the data block backed up in the RAM is loaded into the reply frame and replied to the host computer or the master station system. The host computer and the master station system save this data.

[0083] (7) Continue with steps (3)(4)(5)(6) until the upgrade package is sent.

[0084] (8) The host computer or master station system initiates an upgrade check frame.

[0085] (9) If the meter replies that the upgrade is successful, the upgrade is complete. If the meter fails to reply or does not respond, the upgrade fails.

[0086] (10) If the upgrade fails, the host computer and the master station system directly send the backup data to the energy meter through a private protocol to restore it to its original state. The private protocol only runs in the boot program and is not affected by the upgrade failure.

[0087] The embodiment of the present invention also provides a computer device having the above Figure 3 The energy meter upgrade device shown or Figure 4 The energy meter upgrade device shown.

[0088] See also Figure 7 , Figure 7 is a schematic diagram of the structure of a computer device provided by an optional embodiment of the present invention, such as Figure 7 As shown, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process the instructions executed in the computer device, including instructions stored in or on the memory to display the graphical information of the GUI on an external input / output device (such as, a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 7A processor 10 is taken as an example.

[0089] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.

[0090] The memory 20 stores instructions executable by at least one processor 10, so that at least one processor 10 executes the method shown in the above embodiment.

[0091] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created by the use of a computer device based on the presentation of a small program landing page, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0092] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.

[0093] The computer device further comprises a communication interface 30 for the computer device to communicate with other devices or a communication network.

[0094] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.

[0095] A part of the present invention may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present invention through the operation of the computer. Those skilled in the art should understand that the existence of the computer program instruction in a computer-readable medium includes, but is not limited to, a source file, an executable file, an installation package file, etc., and accordingly, the way in which the computer program instruction is executed by the computer includes, but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium may be any available computer-readable storage medium or communication medium accessible to the computer.

[0096] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.

Claims

1. A method for upgrading an electric energy meter, characterized in that: Applied to an electric energy meter, the method comprises: Receive a block data frame containing block data of an upgrade package sent by an upgrade server; Extracting the to-be-backed up data of corresponding size according to the size of the block data in the block data frame for backing up; Erasing the original data to be backed up, and writing the received block data into the erasure area; Load the backed-up data into a write-success reply frame and send it to the upgrade server; Repeat receiving the block data frame, data backup, erasing and writing of the block data until all the block data in the upgrade package are written.

2. The method according to claim 1, characterized in that Receive the block data frame of the upgrade package sent by the upgrade server, including: Receive an upgrade request frame sent by an upgrade server; Sending an upgrade approval frame to the upgrade server according to the upgrade request frame; Receive a block data frame containing upgrade package block data sent by the upgrade server according to the upgrade consent frame.

3. The method according to claim 1, characterized in that The method further comprises: Receiving an upgrade check frame sent by the upgrade server; A reply frame indicating success of upgrading or a reply frame indicating failure of upgrading is generated according to the upgrade check frame and sent to the upgrade server.

4. The method according to claim 3, characterized in that The method further comprises: Receiving backup data sent by the upgrade server through a private protocol, the backup data being sent by the upgrade server when no reply is received within a preset time after receiving a reply frame indicating an upgrade failure or sending an upgrade check frame; The received backup data is rewritten.

5. A method for upgrading an electric energy meter, characterized in that: Applied to upgrading a server, the method comprises: Sending a block data frame containing block data of the upgrade package to the electric energy meter; receiving a reply frame of successful writing sent by the electric energy meter, wherein the reply frame is generated after the electric energy meter backs up the corresponding size of the data to be backed up and then erases it, and writes the block data frame in the erase area; the reply frame is loaded with the backup data; Store the backup data in the reply frame; The steps of sending the block data frame to the electric energy meter, receiving the reply frame, and storing the backup data in the reply frame are repeated until all the block data in the upgrade package are sent.

6. The method according to claim 5, characterized in that Sending a block data frame containing block data of the upgrade package to the electric energy meter includes: Sending an upgrade request frame to the electric energy meter; receiving an upgrade consent frame sent by the electric energy meter based on the upgrade request frame; Based on the upgrade consent frame, a block data frame containing the block data of the upgrade package is sent to the electric energy meter.

7. The method according to claim 5, characterized in that The method further comprises: Sending an upgrade check frame to the electric energy meter; When a reply frame indicating an upgrade failure sent by the electric energy meter based on the upgrade check frame is received within a preset time or a reply frame from the electric energy meter is not received within a preset time, the saved backup data is sent to the electric energy meter through a private protocol.

8. An electric energy meter upgrading device, characterized in that: Applied to an electric energy meter, the device comprises: A data frame receiving module, used for receiving a block data frame containing block data of an upgrade package sent by an upgrade server; A backup module, used for extracting the to-be-backed up data of corresponding size according to the size of the block data in the block data frame for backup; An erase and write module, used for erasing the original data to be backed up and writing the received block data into the erase area; A reply module, used for loading the backup data into a reply frame of successful writing and sending it to the upgrade server; The upgrade module is used to repeatedly receive block data frames, backup and erase application programs, and write block data until all block data in the upgrade package are written.

9. An electric energy meter upgrading device, characterized in that: Applied to upgrading a server, the device comprises: A data frame sending module, used for sending a block data frame containing block data of an upgrade package to the electric energy meter; A reply receiving module is used to receive a reply frame of successful writing sent by the electric energy meter, wherein the reply frame is generated after the electric energy meter backs up the corresponding size of the data to be backed up and then erases it, and writes the block data frame in the erase area; the reply frame is loaded with the backup data; A storage module, used for storing the backup data in the reply frame; The sending and receiving repeating module is used to repeat the steps of sending the block data frame to the electric energy meter, receiving the reply frame and storing the backup data in the reply frame until all the block data frames in the upgrade package are sent.

10. An electric energy meter upgrading system, characterized in that: The system comprises: an upgrade server and an electric energy meter; The upgrade server is used to send block data frames of the upgrade package to the electric energy meter; The electric energy meter is used to extract the corresponding size of the data to be backed up according to the size of the block data in the received block data frame for backup; erase the original data to be backed up, and write the received block data into the erase area; load the backup data into the reply frame of successful writing and send it to the upgrade server; The upgrade server is also used to receive a reply frame sent by the electric energy meter indicating a successful write, and store the backup data in the reply frame; and continue to send block data frames to the electric energy meter based on the received reply frame until all block data in the upgrade package are sent; The electric energy meter is also used to receive the block data frames continuously sent by the upgrade server, and repeat the steps of extracting the data to be backed up, erasing, writing the block data, and sending a reply frame until all the block data in the upgrade package are written.

Citation Information

Patent Citations

  • Method and apparatus for recovering terminal equipment software upgrade

    CN101377744A

  • Basic input output system (BIOS) updating system and method

    CN103853566A

  • Remote upgrading method of STS prepayment meter

    CN106325955A

  • Program upgrading method and terminal device

    CN106708548A

  • Upgrading and backing-up method, device and system of ultrasonic diagnostic apparatus

    CN107945858A