A method, apparatus and system for upgrading electricity meters

By sending the upgrade package in chunks to the electricity meter for backup and erasing of the original data, the problems of high hardware costs and long time consumption during the electricity meter upgrade process are solved, and efficient electricity meter upgrades are achieved.

CN119473365BActive Publication Date: 2025-10-31ZHEJIANG CHINT INSTR & METER
View PDF 2 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

In the existing technology, upgrading electricity meters requires adding extra backup memory or storage space, which increases hardware costs and takes a long time.

Method used

The upgrade package is sent to the electricity meter in blocks. After receiving each block of data frame, the electricity meter backs up the data and erases the original data, and then writes the block data until all block data is written. This avoids additional backup storage space, reduces hardware costs, and shortens upgrade time.

Benefits of technology

This eliminates the need for additional backup storage space during the electricity meter upgrade process, reducing hardware costs, shortening upgrade time, and improving upgrade efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119473365B_ABST
    Figure CN119473365B_ABST
Patent Text Reader

Abstract

This invention relates to the field of smart meter technology, specifically to a method, apparatus, and system for upgrading electricity meters. The method includes: receiving a block data frame containing block data of an upgrade package sent by an upgrade server; extracting backup data of a corresponding size according to the size of the block data in the block data frame; erasing the original backup data and writing the received block data into the erased area; loading the backed-up data into a successful write response frame and sending it to the upgrade server; repeatedly receiving block data frames, backing up data, erasing, and writing block data until all block data in the upgrade package has been written. In this upgrade method, the backup data can be directly sent to the upgrade server for storage along with the response frame, requiring less time, and eliminating the need for additional backup storage space or backup memory, thus reducing hardware costs.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of smart meter technology, and specifically to a method, apparatus, and system for upgrading electricity meters. Background Technology

[0002] An electricity meter is an energy metering device installed by the electricity seller at the electricity demander. The seller charges accordingly based on the meter readings. Smart meters, due to their complexity, may require upgrades for functional iteration and bug fixes if already installed. The internal program of a smart meter consists of two parts: a bootloader and an application program. The bootloader is used for starting the meter and performing upgrades, while the application program is used for actual business operations (this is the part of the program that is modified during upgrades).

[0003] The upgrade process for electricity meters involves transmitting upgrade packages from a host computer or master station system to the meter. The entire upgrade process is highly unreliable, due to factors such as communication interference, internal self-programming interference within the meter, and data anomalies. For these reasons, electricity meters typically have an internal backup storage device or additional storage space to back up the old application program and critical operational data before the upgrade. If the upgrade fails, the meter can recall the old application program and data from the backup storage to restore it to its original state, preventing the meter from malfunctioning due to upgrade failure.

[0004] However, the aforementioned upgrade process requires additional backup storage or space, increasing hardware costs. Furthermore, before the upgrade, the old applications and important data need to be backed up to the backup storage, which takes a considerable amount of time due to the large volume of data. For a large number of installed electricity meters, this time consumption during batch upgrades represents a significant workload. Summary of the Invention

[0005] In view of this, the present invention provides a method, apparatus and system for upgrading electricity meters, so as to solve the problem that the upgrading method of electricity meters in the prior art requires additional backup memory or storage space, which increases hardware costs.

[0006] In a first aspect, the present invention provides a method for upgrading an electricity meter, applied to an electricity meter, the method comprising: receiving a block data frame containing block data of an upgrade package sent by an upgrade server; extracting backup data of a corresponding size according to the size of the block data in the block data frame and backing it up; erasing the original backup data and writing the received block data into the erasure area; loading the backed-up data into a write success reply frame and sending it to the upgrade server; repeatedly receiving block data frames, backing up data, erasing, and writing block data until all block data in the upgrade package has been written.

[0007] In this invention, during the upgrade of the electricity meter, the upgrade package is sent to the electricity meter in blocks. After receiving each block data frame, the electricity meter backs up the corresponding size of the data to be backed up, erases the original data, and writes the received block data into the corresponding position of the original data. Then, the backup data is loaded into a successful write response frame and sent together to the upgrade server. In this upgrade method, the data to be backed up can be directly sent to the upgrade server for storage along with the response frame, which requires less time and eliminates the need for additional backup storage space or backup memory, thus reducing hardware costs.

[0008] In one optional implementation, receiving a segmented 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 segmented data frame containing segmented upgrade package data sent by the upgrade server according to the upgrade consent frame.

[0009] In this invention, before sending the segmented data frame, an upgrade request frame is first sent to inquire whether the energy meter needs to be upgraded. The segmented data frame is then sent after the upgrade is confirmed, in order to avoid unnecessary data transmission and reduce unnecessary resource waste.

[0010] In one optional implementation, the method further includes: receiving an upgrade check frame sent by the upgrade server; generating a response frame indicating successful upgrade or a response frame indicating upgrade failure based on the upgrade check frame and sending it to the upgrade server.

[0011] In an optional implementation, the method further includes: receiving backup data sent by the upgrade server via a private protocol, wherein the backup data is data sent by the upgrade server after receiving an upgrade failure response frame or sending an upgrade check frame within a preset time period without receiving a response; and rewriting the received backup data.

[0012] In this invention, after the block data is written, an upgrade check frame sent by the upgrade server is received. If the upgrade fails, the upgrade server can send the previously saved backup data to the electricity meter so that the electricity meter can be restored to its original state when the upgrade fails, thus not affecting the normal operation of the electricity meter.

[0013] Secondly, the present invention provides a method for upgrading an electricity meter, applied to an upgrade server. The method includes: sending a block data frame containing block data of an upgrade package to the electricity meter; receiving a reply frame from the electricity meter indicating successful write, wherein the reply frame is generated by the electricity meter after backing up the data to be backed up to a corresponding size, erasing it, and writing the block data frame into the erased area; the reply frame contains backup data; storing the backup data in the reply frame; and repeating the steps of sending block data frames to the electricity meter, receiving reply frames, and storing the backup data in the reply frames until all block data in the upgrade package has been sent.

[0014] In one optional implementation, sending a block data frame containing upgrade package block data to the electricity meter includes: sending an upgrade request frame to the electricity meter; receiving an upgrade agreement frame sent by the electricity meter based on the upgrade request frame; and sending a block data frame containing upgrade package block data to the electricity meter based on the upgrade agreement frame.

[0015] In an optional implementation, the method further includes: sending an upgrade check frame to the electricity meter; and when a reply frame indicating upgrade failure is received from the electricity meter based on the upgrade check frame within a preset time, or when no reply frame is received from the electricity meter within a preset time, sending the stored backup data to the electricity meter via a private protocol.

[0016] Thirdly, the present invention provides an energy meter upgrade device, applied to an energy meter, the device comprising: a data frame receiving module, used to receive block data frames containing upgrade package block data sent by an upgrade server; a backup module, used to extract backup data of a corresponding size according to the size of the block data in the block data frame; an erase and write module, used to erase the original backup data and write the received block data into the erase area; a reply module, used to load the backup data into a write success reply frame and send it to the upgrade server; and an upgrade module, used to repeatedly receive block data frames, application backup, erase, and write block data until all block data in the upgrade package has been written.

[0017] Fourthly, the present invention provides an energy meter upgrade device applied to an upgrade server. The device includes: a data frame sending module for sending block data frames containing upgrade package block data to the energy meter; a response receiving module for receiving a response frame from the energy meter indicating successful write, wherein the response frame is generated after the energy meter backs up the data to be backed up to a corresponding size, erases it, and writes block data frames into the erased area; the response frame contains the backup data; a storage module for storing the backup data in the response frame; and a send-receive repeat module for repeatedly sending block data frames to the energy meter, receiving response frames, and storing the backup data in the response frames until all block data frames in the upgrade package have been sent.

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

[0019] In a sixth aspect, the present invention provides a computer device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the computer instructions to perform the electricity meter upgrade method of the first aspect or any corresponding embodiment described above, or to perform the electricity meter upgrade method of the second aspect or any corresponding embodiment described above.

[0020] In a seventh aspect, the present invention provides a computer-readable storage medium storing computer instructions, the computer instructions being configured to cause a computer to execute the electricity meter upgrade method of the first aspect or any corresponding embodiment thereof, or to execute the electricity meter upgrade method of the second aspect or any corresponding embodiment thereof.

[0021] Eighthly, the present invention provides a computer program product, including computer instructions, which are used to cause a computer to execute the electricity meter upgrade method of the first aspect or any corresponding embodiment thereof, or to execute the electricity meter upgrade method of the second aspect or any corresponding embodiment thereof. Attached Figure Description

[0022] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0023] Figure 1 This is a flowchart illustrating an energy meter upgrade method according to an embodiment of the present invention;

[0024] Figure 2 This is a flowchart illustrating another method for upgrading an electricity meter according to an embodiment of the present invention;

[0025] Figure 3 This is a structural block diagram of an energy meter upgrade device according to an embodiment of the present invention;

[0026] Figure 4 This is a structural block diagram of another energy meter upgrade device according to an embodiment of the present invention;

[0027] Figure 5 This is a structural block diagram of an energy meter upgrade system according to an embodiment of the present invention;

[0028] Figure 6 This is a schematic diagram of the working principle of an energy meter upgrade system according to an embodiment of the present invention;

[0029] Figure 7 This is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. Detailed Implementation

[0030] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0031] According to an embodiment of the present invention, an embodiment of an electricity meter upgrade method is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.

[0032] This embodiment provides a method for upgrading an electricity meter, used in electricity meters. Figure 1 This is a flowchart of an energy meter upgrade method according to an embodiment of the present invention, such as... Figure 1 As shown, the process includes the following steps:

[0033] Step S101: Receive a block data frame containing upgrade package block data sent by the upgrade server. Specifically, when the electricity meter needs an application upgrade, the upgrade server sends an upgrade package to the electricity meter. Since the upgrade package contains a large amount of data, 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, each transmission sends a block data frame containing one block of data. The size of each block of data can be determined according to the actual situation; for example, each block of data can be tens of KB or several MB. The upgrade server can be a device that stores the upgrade package, such as a host computer or a master station system.

[0034] Step S102: Extract backup data of a corresponding size based on the size of the block data in the segmented data frame. Specifically, when the energy meter receives a segmented data frame, it extracts a block of code of a corresponding size from the application or important operating data within the segmented data frame as backup data, based on the size of the block data. The size of the extracted backup data can be the same as the size of the received segmented data, so that the received segmented data can be written. The extracted backup data can be backed up in the RAM (Random Access Memory). This extraction and backup process can be understood as copying a portion of data from the application or important operating data running before the energy meter upgrade and storing it in RAM. Whether important operating data needs to be backed up can be preset or determined by the user according to the actual situation.

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

[0036] Step S103: Erase the original data to be backed up and write the received block data into the erase area. Specifically, after backing up the corresponding application or important running data (i.e., the data to be backed up), this part of the data can be erased from the original application or important running data, and then the received block data can be written into the erase area, thus realizing the update and replacement of the application.

[0037] Step S104: Load the backup data into a successful write response frame and send it to the upgrade server. Specifically, after the block data is successfully written, a successful write response frame is generated, and the backup data stored in the running memory is loaded into the response frame. Then, the response frame is sent to the upgrade server.

[0038] Step S105 involves repeatedly receiving segmented data frames, backing up data, erasing data, and writing segmented data until all segmented data in the upgrade package has been written. Specifically, steps S101 to S104 described above implement the writing of one segmented data. Since the upgrade package includes multiple segmented data, other segmented data can also be written using the same process as steps S101 to S104. That is, multiple segmented data frames can be sent sequentially to the energy meter, and the energy meter will sequentially execute steps S101 to S104, repeatedly receiving, backing up, erasing, and writing segmented data for each segmented data frame until all segmented data in the upgrade package has been written. This completes the energy meter upgrade process.

[0039] The electricity meter upgrade method provided in this invention involves sending the upgrade package in blocks to the electricity meter during the upgrade process. Upon receiving each block data frame, the electricity meter backs up the corresponding size of the data to be backed up, erases the original data, and writes the received block data into the corresponding location of the original data. Then, the backup data is loaded into a successful write response frame and sent together with the backup data to the upgrade server. In this upgrade method, the data to be backed up can be directly sent to the upgrade server for storage along with the response frame, requiring less time and eliminating the need for additional backup storage space or backup memory, thus reducing hardware costs.

[0040] This embodiment provides a method for upgrading an electricity meter. The method is applied to an electricity meter and includes the following steps:

[0041] Step S201: Receive a block data frame containing block data of the upgrade package sent by the upgrade server.

[0042] Specifically, step S201 includes:

[0043] Step S2011: Receive an upgrade request frame sent by the upgrade server; specifically, after relevant personnel update the functions of the application in the electricity meter or generate an upgrade package to fix bugs, the upgrade server can send an upgrade request frame to the electricity meter, that is, ask whether the electricity meter needs to be upgraded.

[0044] Step S2012: Send an upgrade consent frame to the upgrade server according to the upgrade request frame; specifically, after the energy meter receives the upgrade request frame, if it agrees to the upgrade, it can reply to the upgrade server with an upgrade consent frame; if it does not agree to the upgrade, it can reply to the upgrade server with a non-upgrade data frame.

[0045] Step S2013: Receive a block data frame containing upgrade package block data sent by the upgrade server according to the upgrade agreement frame. Specifically, when the upgrade server receives the upgrade agreement frame, it can divide the upgrade package into multiple block data and then send the block data to the electricity meter. If a non-upgrade data frame is received, the upgrade can be cancelled, and subsequent processes will not be executed.

[0046] It should be noted that the upgrade server can send upgrade request frames to multiple electricity meters simultaneously. Each electricity meter, upon receiving an upgrade request frame, can send an upgrade agreement frame to the upgrade server if it agrees to the upgrade. Once an electricity meter receives an upgrade agreement frame from any other electricity meter, it can send a block data frame to that meter. For electricity meters that have not sent an upgrade agreement frame, no further block data frames will be sent to them.

[0047] Step S202: Extract the corresponding size of the data to be backed up based on the size of the data blocks in the segmented data frame, and back it up. For details, please refer to [link to relevant documentation]. Figure 1 Step S102 of the illustrated embodiment will not be described again here.

[0048] Step S203: Erase the existing data to be backed up and write the received block data into the erase area; for details, please refer to [link to relevant documentation]. Figure 1 Step S103 of the illustrated embodiment will not be described again here.

[0049] Step S204: Load the backup data into a successful write response frame and send it to the upgrade server. For details, please refer to [link to details]. Figure 1 Step S104 of the illustrated embodiment will not be described again here.

[0050] Step S205: Receive the upgrade check frame sent by the upgrade server; generate a successful upgrade response frame or a failed upgrade response frame based on the upgrade check frame and send it to the upgrade server.

[0051] Specifically, after the upgrade server has sent all the segmented data frames in the upgrade package, it can continue to send upgrade check frames to the electricity meter. Once the electricity meter has written all the segmented data, it can perform the upgrade based on the written data and determine whether the upgrade was successful. When the electricity meter receives the upgrade check frame from the upgrade server, it replies to the upgrade server based on the upgrade success result. For example, if the upgrade is successful, it replies to the upgrade server with an upgrade success reply frame; if the upgrade fails, it replies to the upgrade server with an upgrade failure reply frame.

[0052] Step S206: Receive backup data sent by the upgrade server via a private protocol. The backup data is data sent by the upgrade server after receiving a reply frame indicating upgrade failure or sending an upgrade check frame within a preset time period without receiving a reply. Rewrite the received backup data.

[0053] Specifically, when the upgrade server receives a reply frame indicating upgrade failure from the electricity meter within a preset time, or fails to receive a reply frame within a certain time after sending the upgrade check frame, it determines that the electricity meter upgrade has failed. The server then sends the saved backup data to the electricity meter via a private protocol. Upon receiving the backup data, the electricity meter can erase the already written data blocks and rewrite the received backup data, thus restoring the electricity meter to its original state. The electricity meter includes a bootloader and an application program. This upgrade process targets the application program, while the private protocol runs within the bootloader. Even if the application upgrade fails, the private protocol remains unaffected by the application, meaning data transmission can still be performed via the private protocol.

[0054] This embodiment provides a method for upgrading electricity meters, applied to an upgrade server, such as... Figure 2 As shown, the method includes the following steps:

[0055] Step S301: Send a block data frame containing upgrade package block data to the electricity meter.

[0056] Step S302: Receive a reply frame from the electricity meter indicating successful write. The reply frame is generated after the electricity meter backs up the data to be backed up to the corresponding size, erases it, and writes block data frames into the erased area. The reply frame contains the backup data.

[0057] Step S303: Store the backup data from the reply frame.

[0058] Step S304: Repeat the steps of sending block data frames to the electricity meter, receiving reply frames, and storing backup data in the reply frames until all block data in the upgrade package has been sent.

[0059] The further functional descriptions of each of the above steps are the same as those in the corresponding embodiments of steps S101 to S104, and will not be repeated here.

[0060] This embodiment provides a method for upgrading an electricity meter, applied to an upgrade server. The method includes the following steps:

[0061] Step S401: Send a block data frame containing upgrade package block data to the electricity meter.

[0062] Specifically, step S401 includes:

[0063] Step S4011: Send an upgrade request frame to the electricity meter.

[0064] Step S4012: Receive the upgrade agreement frame sent by the electricity meter based on the upgrade request frame.

[0065] Step S4013: Based on the upgrade agreement frame, send a block data frame containing upgrade package block data to the energy meter.

[0066] Step S402: Receive a reply frame from the electricity meter indicating successful write. The reply frame is generated after the electricity meter backs up the data to be backed up to the corresponding size, erases it, and writes block data frames into the erased area. The reply frame contains the backup data.

[0067] Step S403: Store the backup data from the reply frame.

[0068] Step S404: Repeat the steps of sending block data frames to the energy meter, receiving reply frames, and storing backup data in the reply frames until all block data frames in the upgrade package have been sent.

[0069] Step S405: Send an upgrade check frame to the electricity meter; when a reply frame indicating upgrade failure is received from the electricity meter based on the upgrade check frame within a preset time, or when no reply frame is received from the electricity meter within a preset time, send the saved backup data to the electricity meter through a private protocol.

[0070] The further functional descriptions of each of the above steps are the same as those in the corresponding embodiments of steps S201 to S206, and will not be repeated here.

[0071] This embodiment also provides an energy meter upgrade device for implementing the above embodiments and preferred embodiments; details already described will not be repeated. As used below, the term "module" can refer to a combination of software and / or hardware that performs a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.

[0072] This embodiment provides an energy meter upgrade device, applied to energy meters, such as... Figure 3 As shown, it includes:

[0073] The data frame receiving module 31 is used to receive block data frames containing block data of the upgrade package sent by the upgrade server.

[0074] Backup module 32 is used to extract data of a corresponding size to be backed up based on the size of the block data in the block data frame and perform backup.

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

[0076] The reply module 34 is used to load the backup data into a reply frame indicating successful write and send it to the upgrade server.

[0077] Upgrade module 35 is used to repeatedly receive block data frames, application backups, erases, and write block data until all block data in the upgrade package has been written.

[0078] In one optional implementation, the data frame receiving module is specifically configured to: receive an upgrade request frame sent by the upgrade server; send an upgrade consent frame to the upgrade server according to the upgrade request frame; and receive a block data frame containing upgrade package block data sent by the upgrade server according to the upgrade consent frame.

[0079] In one optional implementation, the apparatus further includes: a first checking module, specifically configured to receive an upgrade checking frame sent by the upgrade server; and generate a successful upgrade response frame or a failed upgrade response frame based on the upgrade checking frame and send it to the upgrade server.

[0080] In one optional implementation, the apparatus further includes: a backup writing module, specifically configured to receive backup data sent by the upgrade server via a private protocol, wherein the backup data is data sent by the upgrade server after receiving an upgrade failure response frame or sending an upgrade check frame within a preset time period; and to rewrite the received backup data.

[0081] Further functional descriptions of the above modules are the same as those in the corresponding embodiments described above, and will not be repeated here.

[0082] This embodiment provides an energy meter upgrade device, applied to upgrading servers, such as... Figure 4 As shown, the device includes:

[0083] The data frame sending module 41 is used to send block data frames containing upgrade package block data to the energy meter.

[0084] The reply receiving module 42 is used to receive a reply frame sent by the energy meter indicating successful write. The reply frame is generated after the energy meter backs up the data to be backed up to the corresponding size, erases it, and writes block data frames into the erased area. The reply frame contains the backup data.

[0085] Storage module 43 is used to store backup data from the reply frame.

[0086] The transmit / receive repeat module 44 is used to repeatedly send block data frames to the energy meter, receive reply frames, and store backup data in the reply frames until all block data frames in the upgrade package have been sent.

[0087] In one optional implementation, the data frame sending module is specifically configured to: send an upgrade request frame to the electricity meter; receive an upgrade agreement frame sent by the electricity meter based on the upgrade request frame; and send a block data frame containing upgrade package block data to the electricity meter based on the upgrade agreement frame.

[0088] In one optional implementation, the device further includes: a second checking module, specifically configured to send an upgrade checking frame to the energy meter; when a reply frame indicating upgrade failure is received from the energy meter based on the upgrade checking frame within a preset time, or when no reply frame is received from the energy meter within a preset time, the module sends the stored backup data to the energy meter via a private protocol.

[0089] Further functional descriptions of the above modules are the same as those in the corresponding embodiments described above, and will not be repeated here.

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

[0091] As a specific application embodiment of the present invention, such as Figure 6As shown, the electricity meter upgrade system can operate according to the following process:

[0092] (1) The host computer or master station system sends an upgrade request frame to one or more electricity meters.

[0093] (2) After receiving the upgrade request frame, the electricity meter agrees to the upgrade and replies with an upgrade agreement frame.

[0094] (3) After the host computer or the main station system receives the upgrade agreement frame sent by the energy meter, it sends the block data frame of the new upgrade package (e.g., 200 bytes) to the corresponding energy meter.

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

[0096] (5) The electricity 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.

[0097] (6) Once the data writing is complete, the backed-up data block in RAM is loaded into the reply frame and sent back to the host computer or master station system. The host computer and master station system save this data.

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

[0099] (8) The host computer or the main station system initiates an upgrade check frame.

[0100] (9) If the electricity meter responds successfully to the upgrade, the upgrade is complete. If the electricity meter fails to respond or does not respond, the upgrade fails.

[0101] (10) If the upgrade fails, the host computer and the master station system will send the backed-up data directly to the electricity 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.

[0102] This invention also provides a computer device having the above-described features. Figure 3 The electricity meter upgrade device shown or Figure 4 The electricity meter upgrade device shown.

[0103] Please see Figure 7 , Figure 7 This is a schematic diagram of the structure of a computer device provided in an optional embodiment of the present invention, such as... Figure 7As shown, the computer device includes one or more processors 10, memory 20, and interfaces for connecting the components, including high-speed interfaces and low-speed interfaces. The components communicate with each other via different buses and can be mounted on a common motherboard or otherwise installed as needed. The processors can process instructions executed within the computer device, including instructions stored in or on memory to display graphical information of a GUI on external input / output devices (such as display devices coupled to the interfaces). In some alternative implementations, multiple processors and / or multiple buses can be used with multiple memories and multiple memory modules, if desired. Similarly, multiple computer devices can be connected, each providing some of the necessary operations (e.g., as a server array, a group of blade servers, or a multiprocessor system). Figure 7 Take a processor 10 as an example.

[0104] Processor 10 may be a central processing unit, a network processor, or a combination thereof. Processor 10 may further include a hardware chip. The hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or a combination thereof. The programmable logic device may be a complex programmable logic device (CAMP), a field-programmable gate array (FPGA), a general-purpose array logic (GDA), or any combination thereof.

[0105] The memory 20 stores instructions executable by at least one processor 10 to cause at least one processor 10 to perform the method shown in the above embodiments.

[0106] The memory 20 may include a program storage area and a data storage area. The program storage area may store the operating system and applications required for at least one function; the data storage area may store data created based on the use of the computer device as shown by a landing page for an app. Furthermore, the memory 20 may include high-speed random access memory and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some alternative embodiments, the memory 20 may optionally include memory remotely located relative to the processor 10, which can be connected to the computer device via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.

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

[0108] The computer device also includes a communication interface 30 for communicating with other devices or communication networks.

[0109] This invention also provides a computer-readable storage medium. The methods described above according to embodiments of the invention can be implemented in hardware or firmware, or implemented as computer code that can be recorded on a storage medium, or implemented as computer code downloaded via a network and originally stored on a remote storage medium or a non-transitory machine-readable storage medium and then stored on a local storage medium. Thus, the methods described herein can be processed by software stored on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. The storage medium can be a magnetic disk, optical disk, read-only memory, random access memory, flash memory, hard disk, or solid-state drive, etc.; further, the storage medium can also include combinations of the above types of memory. It is understood that computers, processors, microprocessor controllers, or programmable hardware include storage components capable of storing or receiving software or computer code, which, when accessed and executed by the computer, processor, or hardware, implements the methods shown in the above embodiments.

[0110] A portion of this invention can be applied as a computer program product, such as computer program instructions, which, when executed by a computer, can invoke or provide the methods and / or technical solutions according to the invention through the operation of the computer. Those skilled in the art will understand that the forms in which computer program instructions exist in a computer-readable medium include, but are not limited to, source files, executable files, installation package files, etc. Correspondingly, the ways in which computer program instructions are executed by a computer include, but are not limited to: the computer directly executing the instructions, or the computer compiling the instructions and then executing the corresponding compiled program, or the computer reading and executing the instructions, or the computer reading and installing the instructions and then executing the corresponding installed program. Here, the computer-readable medium can be any available computer-readable storage medium or communication medium accessible to a computer.

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

Claims

1. A method for upgrading an electricity meter, characterized in that, Applied to electricity meters, the method includes: Receive block data frames containing upgrade package block data sent by the upgrade server; Based on the size of the block data in the block data frame, extract the corresponding size of the data to be backed up and back it up. The data to be backed up is stored in the running memory. Erase the existing data to be backed up and write the received block data into the erase area; The backed-up data is loaded into a successful write response frame and sent to the upgrade server; Repeatedly receive block data frames, back up data, erase data, and write block data until all block data in the upgrade package has been written. Receive the upgrade check frame sent by the upgrade server; Based on the upgrade check frame, generate a response frame indicating successful upgrade or failure of upgrade and send it to the upgrade server; The system receives backup data sent by the upgrade server via a private protocol. The backup data is data sent by the upgrade server after it has not received a reply frame for upgrade failure or after sending an upgrade check frame within a preset time. The received backup data is rewritten.

2. The method according to claim 1, characterized in that, Receive the segmented data frames of the upgrade package sent by the upgrade server, including: Receive upgrade request frames sent by the upgrade server; An upgrade consent frame is sent to the upgrade server according to the upgrade request frame; Receive the block data frame containing upgrade package block data sent by the upgrade server according to the upgrade agreement frame.

3. A method for upgrading an electricity meter, characterized in that, Applied to an upgrade server, the method includes: Send a block data frame containing block data of the upgrade package to the electricity meter; The system receives a successful write response frame from the electricity meter. The response frame is generated after the electricity meter backs up the data to be backed up to the corresponding size, erases it, and writes block data frames into the erased area. The response frame contains the backup data, which is backed up in the running memory. Store the backup data in the response frame; Repeat the steps of sending block data frames to the energy meter, receiving reply frames, and storing backup data in the reply frames until all block data in the upgrade package has been sent. Send an upgrade check frame to the energy meter; When a response frame indicating upgrade failure is received from the energy meter within a preset time, or when no response frame is received from the energy meter within a preset time, the stored backup data is sent to the energy meter via a private protocol.

4. The method according to claim 3, characterized in that, Send a segmented data frame containing segmented upgrade package data to the electricity meter, including: Send an upgrade request frame to the electricity meter; Receive the upgrade agreement frame sent by the energy meter based on the upgrade request frame; Based on the upgrade agreement frame, a block data frame containing upgrade package block data is sent to the electricity meter.

5. An energy meter upgrade device, characterized in that, Applied to electricity meters, the device includes: The data frame receiving module is used to receive block data frames containing block data of the upgrade package sent by the upgrade server; The backup module is used to extract data of a corresponding size to be backed up based on the size of the block data in the block data frame, and the data to be backed up is backed up in the running memory; The erase and write module is used to erase the original data to be backed up and write the received block data into the erase area; The response module is used to load backup data into a successful write response frame and send it to the upgrade server; The upgrade module is used to repeatedly receive block data frames, application backups, erases, and write block data until all block data in the upgrade package has been written. The first upgrade check module is used to receive an upgrade check frame sent by the upgrade server; generate a successful upgrade response frame or a failed upgrade response frame based on the upgrade check frame and send it to the upgrade server; receive backup data sent by the upgrade server through a private protocol, wherein the backup data is sent by the upgrade server after receiving the failed upgrade response frame or sending the upgrade check frame within a preset time; and rewrite the received backup data.

6. An energy meter upgrade device, characterized in that, The device, used for upgrading servers, includes: The data frame sending module is used to send block data frames containing upgrade package block data to the energy meter; The response receiving module is used to receive a response frame sent by the energy meter indicating successful write. The response frame is generated after the energy meter backs up the data to be backed up to the corresponding size, erases it, and writes block data frames into the erased area. The response frame is loaded with backup data, which is backed up in the running memory. The storage module is used to store backup data from the response frame; The transmit and receive repeat module is used to repeatedly send block data frames to the energy meter, receive reply frames, and store backup data in the reply frames until all block data frames in the upgrade package have been sent. The second upgrade check module is used to send an upgrade check frame to the energy meter; when it receives a reply frame from the energy meter indicating upgrade failure based on the upgrade check frame within a preset time, or when it does not receive a reply frame from the energy meter within a preset time, it sends the saved backup data to the energy meter through a private protocol.

7. An electricity meter upgrade system, characterized in that, The system includes: an upgrade server and an electricity meter; The upgrade server is used to send block data frames of the upgrade package to the electricity meter; The electricity meter is used to extract the corresponding size of backup data according to the size of the block data in the received block data frame; erase the original backup data and write the received block data into the erase area; load the backup data into the write success reply frame and send it to the upgrade server; the backup data is backed up in the running memory. The upgrade server is also used to receive a write success reply frame sent by the energy meter, store the backup data in the reply frame, and continue to send block data frames to the energy meter based on the received reply frame until all block data in the upgrade package has been sent. The electricity meter is also used to receive the block data frames that the upgrade server continues to send, and repeat the steps of extracting the data to be backed up, backing up, erasing, writing block data, and sending reply frames until all block data in the upgrade package has been written. The upgrade server is also used to send upgrade check frames to the electricity meter; The electricity meter is also used to generate a successful upgrade response frame or a failed upgrade response frame based on the upgrade check frame and send it to the upgrade server; The upgrade server is also used to send the saved backup data to the energy meter through a private protocol when it receives a reply frame indicating upgrade failure from the energy meter based on the upgrade check frame within a preset time or when it does not receive a reply frame from the energy meter within a preset time. The electricity meter is also used to rewrite the received backup data.

Citation Information

Patent Citations

  • Method and apparatus for recovering terminal equipment software upgrade

    CN101377744A

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

    CN107945858A