Electric energy meter batch upgrading method and device
By generating random numbers and delay times during the batch upgrade of the power meter, ensuring that each power meter has a unique temporary ID, the problem of escalation conflicts and interference is solved, and efficient batch upgrades are achieved.
Patent Information
- Application Number
- CN202411779134.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-05
- Publication Date
- 2025-03-28
AI Technical Summary
During the batch upgrade of electricity meter, there are problems of upgrade conflicts and interference, resulting in inefficient upgrades.
By generating random numbers and delay times between the upper computer and the power meter, forming temporary communication addresses and upgrade parameters, ensuring that each power meter has a unique temporary ID, avoid conflicts, and identifying its own upgraded data frames through split frames and temporary IDs.
The synchronous upgrade of batch power meters has been achieved, the upgrade efficiency has been improved, and conflicts and interferences in the upgrade process have been effectively avoided.
Smart Images

Figure CN119728749A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of electric energy meter testing, and in particular to a method and device for batch upgrading electric energy meters. Background Art
[0002] In the current process of upgrading electric energy meters, the traditional upgrade method is usually carried out within the factory. This method mainly relies on using an offline program burning box to perform a separate upgrade operation on each electric energy meter. Since each upgrade can only be performed on one electric energy meter, the upgrade speed is relatively slow. Especially when the number of electric energy meters that need to be upgraded is large, the time required for the entire upgrade process will increase significantly, resulting in low efficiency.
[0003] In order to solve these problems existing in the traditional upgrade method, the relevant technical field has proposed a solution to upgrade the electric energy meter by remote communication. This solution can greatly reduce the need for manual operation of each electric energy meter, thereby improving the upgrade efficiency. However, in actual applications, due to the differences in the processing process of each electric energy meter and the transmission speed between the computer, it is difficult to achieve the simultaneous upgrade of a batch of electric energy meters. In addition, this remote upgrade method may also face conflicts and interference with other possible electric energy meter upgrade processes. Summary of the invention
[0004] The embodiments of the present application provide a method and device for batch upgrading of electric energy meters to solve the problem of upgrade conflicts and interferences between electric energy meters when upgrading a batch of meters.
[0005] In a first aspect, an embodiment of the present application provides a method for batch upgrading electric energy meters, which is applied to a host computer and includes:
[0006] Generate a start frame according to the first random number, and broadcast the start frame to each electric energy meter to be upgraded;
[0007] Receive upgrade parameters fed back by each electric energy meter to be upgraded, generate corresponding temporary communication addresses according to the upgrade parameters fed back by each electric energy meter to be upgraded, and send command data frames according to the temporary communication addresses; wherein the upgrade parameters include: a second random number and a delay time;
[0008] When a confirmation frame is received, the target temporary communication address corresponding to the confirmation frame is parsed, and upgrade data is sent to the electric energy meter to be upgraded corresponding to the target temporary communication address; wherein the upgrade data includes: an electric energy meter temporary ID, a segmentation frame and an upgrade data frame; the electric energy meter temporary ID corresponds to the temporary communication address one by one.
[0009] In this embodiment, first, the host computer generates a start frame based on the first random number to avoid conflicts during multiple batch upgrades. Then, the start frame is broadcast to all electric energy meters to be upgraded to notify them that the host computer is currently in an idle state. Subsequently, the host computer receives upgrade parameter feedback from each electric energy meter to be upgraded, and generates a corresponding temporary communication address accordingly. These upgrade parameters include a second random number and a delay time, the purpose of which is to ensure that an independent communication connection can be established between the host computer and the electric energy meter. The command data frame is sent through the temporary communication address, and once the confirmation frame is received, it can be confirmed that the upgrade communication connection between the host computer and the electric energy meter has been successfully established. Then, the target temporary communication address in the confirmation frame is parsed, and the upgrade data is sent to the electric energy meter to be upgraded corresponding to the address. The upgrade data includes a temporary ID of the electric energy meter, a segmentation frame, and an upgrade data frame, wherein the temporary ID of the electric energy meter corresponds to the temporary communication address one by one. This method not only realizes the synchronous upgrade of batch electric energy meters and improves the upgrade efficiency, but also effectively avoids upgrade conflicts and interference between electric energy meters by assigning a unique temporary ID to each electric energy meter to be upgraded.
[0010] In a second aspect, an embodiment of the present application provides a method for batch upgrading electric energy meters, which is applied to electric energy meters and includes:
[0011] Generate pseudo-random numbers;
[0012] After receiving the start frame sent by the host computer, generate a second random number and a delay time according to the start frame and the pseudo-random number, and combine them into an upgrade parameter;
[0013] Sending the upgrade parameters to the host computer, and upon receiving the command data frame sent by the host computer, sending a confirmation frame to the host computer; wherein the command data frame includes a temporary communication address corresponding to the electric energy meter;
[0014] Receive the upgrade data sent by the host computer in response to the determination frame; wherein the upgrade data includes: a temporary ID of the electric energy meter, a segmentation frame and an upgrade data frame; the temporary ID of the electric energy meter corresponds to a temporary communication address one by one;
[0015] The corresponding data frame is extracted according to the corresponding temporary ID of the electric energy meter for upgrading.
[0016] In this embodiment, after receiving the start frame sent by the host computer, the electric energy meter will generate a second random number and a corresponding delay time based on a pseudo-random number. Subsequently, it combines this information into upgrade parameters and sends it back to the host computer to ensure that the communication with other electric energy meters is random, thereby avoiding communication conflicts. When the electric energy meter receives a command data frame containing a temporary communication address sent by the host computer, it will send a confirmation frame to the host computer to establish an upgrade communication connection based on the temporary communication address. Then, the electric energy meter receives the response of the host computer to the confirmation frame, that is, the upgrade data, and extracts the corresponding data frame for upgrading according to its temporary ID. The upgrade data includes the temporary ID of the electric energy meter, the segmentation frame and the upgrade data frame, wherein the temporary ID corresponds to the temporary communication address. This method enables the electric energy meter to identify its own upgrade data frame range based on the temporary ID and the segmentation frame, and ignore the upgrade data of other electric energy meters, thereby achieving differentiated management. In this way, not only can the synchronous upgrade of batches of electricity meters be achieved, thus improving the upgrade efficiency, but also conflicts and interferences in the upgrade process can be effectively avoided by assigning a unique temporary ID to each electricity meter to be upgraded.
[0017] In a third aspect, an embodiment of the present application provides a device for batch upgrading electric energy meters, which is applied to a host computer and includes:
[0018] A first generating module, used for generating a start frame according to a first random number;
[0019] A first sending module, used for broadcasting the start frame to each electric energy meter to be upgraded;
[0020] A first receiving module is used to receive the upgrade parameters fed back by each electric energy meter to be upgraded;
[0021] The first generating module is further used to generate a corresponding temporary communication address according to the upgrade parameters fed back by each electric meter to be upgraded;
[0022] The first sending module is also used to send a command data frame according to the temporary communication address; when receiving a confirmation frame, it parses the target temporary communication address corresponding to the confirmation frame, and sends upgrade data to the electric energy meter to be upgraded corresponding to the target temporary communication address; wherein the upgrade parameters include: a second random number and a delay time; the upgrade data includes: an electric energy meter temporary ID, a segmentation frame and an upgrade data frame; the electric energy meter temporary ID corresponds one to one to the temporary communication address.
[0023] In this embodiment, first, the host computer generates a start frame based on the first random number to avoid conflicts during multiple batch upgrades. Then, the start frame is broadcast to all electric energy meters to be upgraded to notify them that the host computer is currently in an idle state. Subsequently, the host computer receives upgrade parameter feedback from each electric energy meter to be upgraded, and generates a corresponding temporary communication address accordingly. These upgrade parameters include a second random number and a delay time, the purpose of which is to ensure that an independent communication connection can be established between the host computer and the electric energy meter. The command data frame is sent through the temporary communication address, and once the confirmation frame is received, it can be confirmed that the upgrade communication connection between the host computer and the electric energy meter has been successfully established. Then, the target temporary communication address in the confirmation frame is parsed, and the upgrade data is sent to the electric energy meter to be upgraded corresponding to the address. The upgrade data includes a temporary ID of the electric energy meter, a segmentation frame, and an upgrade data frame, wherein the temporary ID of the electric energy meter corresponds to the temporary communication address one by one. This method not only realizes the synchronous upgrade of batch electric energy meters and improves the upgrade efficiency, but also effectively avoids upgrade conflicts and interference between electric energy meters by assigning a unique temporary ID to each electric energy meter to be upgraded.
[0024] In a fourth aspect, an embodiment of the present application provides a batch upgrade device for electric energy meters, which is applied to electric energy meters and includes:
[0025] The second generating module is used to generate a pseudo-random number, and upon receiving a start frame sent by the host computer, generates a second random number and a delay time according to the start frame and the pseudo-random number, and combines them into an upgrade parameter;
[0026] A second sending module is used to send the upgrade parameters to the host computer, and when receiving the command data frame sent by the host computer, send a confirmation frame to the host computer; wherein the command data frame includes a temporary communication address corresponding to the electric energy meter;
[0027] The second receiving module is used to receive the upgrade data sent by the host computer in response to the determination frame; wherein the upgrade data includes: a temporary ID of the electric energy meter, a segmentation frame and an upgrade data frame; the temporary ID of the electric energy meter corresponds to a temporary communication address one by one;
[0028] The upgrade module is used to extract the corresponding data frame for upgrading according to the corresponding temporary ID of the electric energy meter.
[0029] In this embodiment, after receiving the start frame sent by the host computer, the electric energy meter will generate a second random number and a corresponding delay time based on a pseudo-random number. Subsequently, it combines this information into upgrade parameters and sends it back to the host computer to ensure that the communication with other electric energy meters is random, thereby avoiding communication conflicts. When the electric energy meter receives a command data frame containing a temporary communication address sent by the host computer, it will send a confirmation frame to the host computer to establish an upgrade communication connection based on the temporary communication address. Then, the electric energy meter receives the response of the host computer to the confirmation frame, that is, the upgrade data, and extracts the corresponding data frame for upgrading according to its temporary ID. The upgrade data includes the temporary ID of the electric energy meter, the segmentation frame and the upgrade data frame, wherein the temporary ID corresponds to the temporary communication address. This method enables the electric energy meter to identify its own upgrade data frame range based on the temporary ID and the segmentation frame, and ignore the upgrade data of other electric energy meters, thereby achieving differentiated management. In this way, not only can the synchronous upgrade of batches of electricity meters be achieved, thus improving the upgrade efficiency, but also conflicts and interferences in the upgrade process can be effectively avoided by assigning a unique temporary ID to each electricity meter to be upgraded. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0031] Figure 1 It is a data transmission diagram of the traditional electric energy meter upgrade method;
[0032] Figure 2 This is a data transmission diagram of the method for batch upgrading of electric energy meters provided in an embodiment of the present application;
[0033] Figure 3 This is a flowchart of a method for batch upgrading electric energy meters provided in an embodiment of the present application;
[0034] Figure 4 is a flowchart of a method for batch upgrading electric energy meters provided in another embodiment of the present application;
[0035] Figure 5 is a flowchart of a method for batch upgrading electric energy meters provided in another embodiment of the present application;
[0036] Figure 6 is a flowchart of a method for batch upgrading electric energy meters provided in another embodiment of the present application;
[0037] Figure 7It is a schematic diagram of the interactive process of the method for batch upgrading of electric energy meters provided in an embodiment of the present application;
[0038] Figure 8-Figure 13 is a schematic diagram of the upgrade time of the electric energy meter in different embodiments;
[0039] Fig.14 It is a structural schematic diagram of a batch upgrade device for electric energy meters provided in one embodiment of the present application;
[0040] Fig.15 It is a structural schematic diagram of an electric energy meter batch upgrade device provided in another embodiment of the present application. DETAILED DESCRIPTION
[0041] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.
[0042] The terms "first", "second", etc. in the specification and claims of the embodiments of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the numbers used in this way can be interchanged where appropriate, so that the embodiments of the embodiments of the present application described here. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions.
[0043] Unless otherwise stated, the term "plurality" means two or more.
[0044] In the embodiment of the present application, the character " / " indicates that the preceding and following objects are in an "or" relationship. For example, A / B means: A or B.
[0045] The term "and / or" is a description of the association relationship between objects, indicating that three relationships can exist. For example, A and / or B means: A or B, or, A and B.
[0046] The words used in this application are only used to describe the embodiments and are not used to limit the claims. As used in the description of the embodiments and claims, unless the context clearly indicates, the singular forms of "a", "an" and "the" are intended to include the plural forms as well. Similarly, the term "and / or" as used in this application refers to any and all possible combinations of one or more associated listings. In addition, when used in this application, the term "comprise" and its variants "comprises" and / or including (comprising) refer to the existence of stated features, wholes, steps, operations, elements, and / or components, but do not exclude the existence or addition of one or more other features, wholes, steps, operations, elements, components and / or these groups. In the absence of more restrictions, the elements defined by the statement "including one..." do not exclude the existence of other identical elements in the process, method or device including the elements. In this application, each embodiment may focus on the differences from other embodiments, and the same and similar parts between the embodiments may refer to each other. For the methods, products, etc. disclosed in the embodiments, if they correspond to the method part disclosed in the embodiments, then the relevant parts can be found in the description of the method part.
[0047] In order to make the purpose, technical solutions and advantages of the present application clearer, specific embodiments will be described below in conjunction with the accompanying drawings.
[0048] Figure 1 This is a schematic diagram of data transmission for traditional energy meter upgrade methods. Figure 1 As shown, by transmitting the upgrade data once, only one electric energy meter can be upgraded.
[0049] Figure 2 Schematic diagram of data transmission of the method for batch upgrading of electric energy meters provided in the embodiment of the present application. Figure 2 As shown, by transmitting the upgrade data once, multiple electric energy meters can be upgraded.
[0050] Figure 3 This is a flowchart of a method for batch upgrading electric energy meters provided in an embodiment of the present application, which is applied to a host computer. The method includes the following steps:
[0051] S301, generating a start frame according to a first random number, and broadcasting the start frame to each electric energy meter to be upgraded.
[0052] In the actual implementation process, the host computer is also called the master station or the host. In order to facilitate the clear understanding of the solution, this application takes the host computer as an example for explanation.
[0053] The host computer generates a random number, and the number does not change for the communication of the current batch of electric energy meters to be upgraded. The next time this function is run, a random number A is regenerated, which is 8 digits long and can be between 00,000,000 and 99,999,999.
[0054] The host computer uses broadcasting to send a start frame to all electric energy meters, sends the idle state of the master station to the outside, and allows data transmission.
[0055] S302, receiving upgrade parameters fed back by each electric energy meter to be upgraded, generating a corresponding temporary communication address according to the upgrade parameters fed back by each electric energy meter to be upgraded, and sending a command data frame according to the temporary communication address; wherein the upgrade parameters include: a second random number and a delay time.
[0056] Among them, each electric energy meter to be upgraded feeds back the upgrade parameters so that the host computer can judge whether there will be conflicts based on the upgrade parameters. When there will be no conflicts, the corresponding temporary communication addresses are generated according to the upgrade parameters fed back by each electric energy meter to ensure that each electric energy meter can be accurately identified and located. Subsequently, these temporary communication addresses are used to send command data frames to each electric energy meter to perform the upgrade confirmation operation.
[0057] In the specific implementation process, the host machine will receive F within a certain time range. 0 ~F n ~F m The host computer receives the data corresponding to the upgrade parameters, and determines the total number of currently connected electric energy meters m according to the total number of received data information, where n≤m and n≥0. Each time the host computer receives a data frame, it specifies the temporary address of the meter.
[0058] S303, when receiving the confirmation frame, parse the target temporary communication address corresponding to the confirmation frame, and send upgrade data to the electric energy meter to be upgraded corresponding to the target temporary communication address; wherein the upgrade data includes: electric energy meter temporary ID, segmentation frame and upgrade data frame; the electric energy meter temporary ID corresponds to the temporary communication address one by one.
[0059] When a confirmation frame fed back by a certain electric energy meter is received, it is determined that the electric energy meter has entered a state to be upgraded, and upgrade data is sent to the electric energy meter.
[0060] In the specific implementation process, the complete data frame of the upgrade data includes the start data frame and the upgrade data frames of different electric energy meters. In order to facilitate the electric energy meter to identify its own upgrade data from the complete data frame, the electric energy meter temporary ID and the segmentation frame are set in the complete data frame. Through the electric energy meter temporary ID and the segmentation frame, the electric energy meter can determine the range of its own upgrade data frame in the complete data frame and ignore the upgrade data of other electric energy meters, thereby realizing differentiated management of the electric energy meter program upgrade.
[0061] In this embodiment, first, the host computer generates a start frame based on the first random number to avoid conflicts during multiple batch upgrades. Then, the start frame is broadcast to all electric energy meters to be upgraded to notify them that the host computer is currently in an idle state. Subsequently, the host computer receives upgrade parameter feedback from each electric energy meter to be upgraded, and generates a corresponding temporary communication address accordingly. These upgrade parameters include a second random number and a delay time, the purpose of which is to ensure that an independent communication connection can be established between the host computer and the electric energy meter. The command data frame is sent through the temporary communication address, and once the confirmation frame is received, it can be confirmed that the upgrade communication connection between the host computer and the electric energy meter has been successfully established. Then, the target temporary communication address in the confirmation frame is parsed, and the upgrade data is sent to the electric energy meter to be upgraded corresponding to the address. The upgrade data includes a temporary ID of the electric energy meter, a segmentation frame, and an upgrade data frame, wherein the temporary ID of the electric energy meter corresponds to the temporary communication address one by one. This method not only realizes the synchronous upgrade of batch electric energy meters and improves the upgrade efficiency, but also effectively avoids upgrade conflicts and interference between electric energy meters by assigning a unique temporary ID to each electric energy meter to be upgraded.
[0062] To better understand the above-mentioned batch upgrade process of electric energy meters, Figure 4 A schematic diagram of the process is shown, such as Figure 4 As shown, the host computer broadcasts a start frame, and when receiving a reply frame from the electric energy meter, it sends a command data frame to the electric energy meter to allocate a temporary communication address. When a reply frame is obtained after sending the command data frame, it is determined that the electric energy meter is ready for upgrade. The upgrade process is started, and upgrade data is sent to the electric energy meter in a loop. When it is determined that the upgrade sub-frame corresponding to the electric energy meter is empty, the upgrade data transmission is completed, and the upgrade task of the electric energy meter is completed.
[0063] In a possible implementation, after receiving the upgrade parameters fed back by each electric energy meter to be upgraded, the method further includes:
[0064] Delay times corresponding to the electric energy meters to be upgraded are determined, and when there is a conflict in the delay times, a start frame is rebroadcast to the electric energy meters to be upgraded.
[0065] In this embodiment, when there is a conflict between the delay times corresponding to the energy meters to be upgraded, that is, the delay times of multiple energy meters overlap, the upgrade operation cannot be carried out smoothly. In response to this situation, the host computer takes the measure of rebroadcasting the start frame and sends the start frame to all energy meters to be upgraded to re-coordinate the upgrade time of each energy meter to ensure that each energy meter can be upgraded without conflict. In this way, the system can effectively solve the problem of delay time conflict and ensure the smooth progress of the energy meter upgrade process.
[0066] In a possible implementation manner, the types of electric energy meters to be upgraded include one or more types.
[0067] Different types of electric energy meters to be upgraded may require different upgrade programs. Based on the electric energy meter batch upgrade method provided by the present application solution, even if the upgrade programs of each meter are different, synchronous upgrades can be achieved.
[0068] In a possible implementation, sending the upgrade data to the electric energy meter to be upgraded corresponding to the target temporary communication address includes:
[0069] cyclically sending upgrade data to the electric energy meter to be upgraded corresponding to the target temporary communication address, wherein the upgrade data includes data frames corresponding to each electric energy meter to be upgraded; the data frames are partial upgrade data frames of the electric energy meter to be upgraded; the frame numbers of upgrade data frames of different types of electric energy meters are the same or different;
[0070] When the data frames corresponding to the temporary IDs of all electric energy meters in the upgrade data are empty, it is determined that the batch upgrade of the electric energy meters is completed.
[0071] In the specific implementation process, the complete upgrade data frame is firstly processed by framing, and the upgrade data of each electric energy meter is divided into several data frames. Then, these data frames are sent to the corresponding electric energy meters to be upgraded in turn by cyclic sending. Due to the limitation of the frame structure, each time the upgrade data is sent, the bytes of the data frame corresponding to each electric energy meter to be upgraded are limited. Therefore, the host computer needs to perform multiple transmissions to send the complete upgrade data frame to the electric energy meter.
[0072] It is worth noting that the frame numbers of the upgrade data frames of different types of electric energy meters can be the same or different. During the transmission process, monitor the sending status of the upgrade data. When the data sub-frames corresponding to the temporary IDs of all electric energy meters are empty, it can be determined that the batch upgrade of the electric energy meters has been completed. This means that all the electric energy meters to be upgraded have successfully received and applied the complete upgrade data frame, completing the upgrade process.
[0073] In this embodiment, by framing the upgrade data and sending the framed data in a loop, the possibility of frame loss caused by sending a large amount of upgrade data at one time can be effectively avoided, ensuring that each electric energy meter can successfully complete the upgrade process. This not only improves the stability and performance of the system, but also ensures the efficiency and reliability of the upgrade process. In addition, through framing and cyclic sending, the system can respond to various network conditions more flexibly, further improving the overall upgrade efficiency and success rate.
[0074] Figure 5 : is a flowchart of a method for batch upgrading electric energy meters provided in an embodiment of the present application, which is applied to electric energy meters. The method comprises the following steps:
[0075] S501, generate a pseudo-random number.
[0076] Among them, the electric energy meter generates pseudo-random numbers to achieve randomness with other electric energy meters and avoid communication conflicts.
[0077] S502, after receiving the start frame sent by the host computer, generate a second random number and a delay time according to the start frame and the pseudo-random number, and combine them into an upgrade parameter.
[0078] The energy meter generates a second random number so that the host computer can assign a unique ID based on this number. The second random number is combined with the delay time to form an upgrade parameter, which makes it easier for the host computer to send data to each energy meter in a time-sharing manner according to the delay time, thereby avoiding congestion or data transmission conflicts caused by large data transmission volume.
[0079] In a possible implementation, generating a second random number and a delay time according to a start frame and a pseudo-random number includes:
[0080] Generate a second random number according to the pseudo-random number, the current time and the first random number corresponding to the start frame;
[0081] A random delay time is generated according to the second random number.
[0082] In a possible implementation, the delay time is based on the communication rate, rate: n, using 612366707÷n×communication interval time (eg, 5ms).
[0083] In different embodiments, the electric energy meter generates the second random number in different ways.
[0084] In a possible implementation, the second random number is generated by processing a pseudo-random number + time + program systick number.
[0085] Example: Pseudo-random number: 23574078 (0x0167 B63E), November 5, 2024 10:03:59 (timestamp: 0x17 3077 2239), program systick: 200 (0xC8)
[0086] The current combination is: 0x0167 B63E 0017 3077 2239 0xC8, and the final result is an eight-digit number.
[0087] In this embodiment, the second random number is determined by using a pseudo-random number, time and program systick number, which is simple to implement and relies on less hardware resources.
[0088] In another possible implementation, the second random number is generated by processing a pseudo-random number + time + chip temperature value + program systick number.
[0089] Example: Pseudo-random number: 23574078 (0x0167 B63E), November 5, 2024 10:03:59 (timestamp: 0x17 3077 2239), chip temperature: 26.0 (0x12BE), program systick: 200 (0xC8)
[0090] The current combination is: 0x0167 B63E 0017 3077 2239 12BE 00C8. Since only 8 digits are needed as a whole, for example, simply perform the following operations, add the last 3 hexadecimal digits to the first 3 hexadecimal digits to get 4 hexadecimal digits, and then add the last 2 hexadecimal digits to the first 2 hexadecimal digits to get a 2-digit hexadecimal digit.
[0091] 0x0167 B63E 0017 3077 2239 12BE 00C8+0x2239 12BE 00C8 0000 000000000000=0x23A0 C8FC 00DF 3077
[0092] 0x23A0 C8FC+0x00DF 3077=0x247F F973
[0093] The random number is considered to be 247F F973 (corresponding to the decimal number: 612,366,707).
[0094] In the embodiment of the present application, the second random number adopts a pseudo-random number, time, chip temperature value and program systick number, wherein the addition of the chip temperature value further increases the unpredictability of the random number. Since the chip temperature is affected by multiple factors such as ambient temperature and chip workload, the generated random number is more difficult to predict and copy.
[0095] S503, sending the upgrade parameters to the host computer, and sending a confirmation frame to the host computer when receiving the command data frame sent by the host computer; wherein the command data frame includes a temporary communication address corresponding to the electric energy meter.
[0096] The electric energy meter sends the upgrade parameters to the host computer, so that the host computer can compare and analyze multiple electric energy meters to be upgraded to ensure accurate data transmission. When receiving the command data frame sent by the host computer, it confirms that the idle state of the host computer meets the upgrade requirements and sends a confirmation frame to the host computer to feedback that the host computer is ready to start the upgrade.
[0097] In addition, since the upgrade of the electric energy meter is a relatively short process, the host computer starts the upgrade process of the next batch after completing the upgrade of the current batch of electric energy meters. Therefore, the command data frame includes the temporary communication address corresponding to the electric energy meter to ensure that the current batch of electric energy meters can accurately receive the upgrade data sent by the host computer and successfully complete the upgrade.
[0098] The energy meter uploads the upgrade parameters to the host computer so that the host computer can compare and analyze multiple energy meters to be upgraded to ensure the accuracy of data transmission. After receiving the command data frame sent by the host computer, the energy meter will confirm whether the idle state of the host computer meets the upgrade conditions, and then send a confirmation frame back to the host computer to indicate that the energy meter itself is ready to start the upgrade.
[0099] In addition, since the upgrade process of the electric energy meter is relatively short, the host computer will immediately start the upgrade process of the next batch after completing the upgrade of the current batch of electric energy meters. Therefore, the command data frame contains the temporary communication address of the corresponding electric energy meter to ensure that the current batch of electric energy meters can accurately receive the upgrade data from the host computer and successfully complete the upgrade process.
[0100] S504, receiving the upgrade data sent by the upper computer in response to the determination frame; wherein the upgrade data includes: the temporary ID of the electric energy meter, the segmentation frame and the upgrade data frame; the temporary ID of the electric energy meter corresponds to the temporary communication address one by one.
[0101] Among them, the temporary ID of the electricity meter is the only identifier in the current batch. It corresponds one-to-one with the temporary communication address of each electricity meter, ensuring the accuracy and security of data transmission.
[0102] S505, extracting the corresponding data frame according to the corresponding temporary ID of the electric energy meter for upgrading.
[0103] In a possible implementation, extracting a corresponding data frame for upgrading according to a corresponding temporary ID of an electric energy meter includes:
[0104] Extract corresponding data sub-frames from the upgraded data according to the temporary communication address and the segmented frames, and write the data sub-frames into the electric energy meter;
[0105] When the corresponding data frame in the upgrade data is determined to be empty according to the temporary communication address and the split frame, the upgrade is completed;
[0106] The upgrade data includes data frames corresponding to each electric energy meter to be upgraded; the data frames are partial upgrade data frames of the electric energy meter to be upgraded.
[0107] In the specific implementation process, the complete data frame of the upgrade data includes the start data frame and the upgrade data frames of different electric energy meters. In order to facilitate the electric energy meter to identify its own upgrade data from the complete data frame, the electric energy meter temporary ID and the segmentation frame are set in the complete data frame. Through the electric energy meter temporary ID and the segmentation frame, the electric energy meter can determine the range of its own upgrade data frame in the complete data frame and ignore the upgrade data of other electric energy meters, thereby realizing differentiated management of the electric energy meter program upgrade.
[0108] In this embodiment, after receiving the start frame sent by the host computer, the electric energy meter will generate a second random number and a corresponding delay time based on a pseudo-random number. Subsequently, it combines this information into upgrade parameters and sends it back to the host computer to ensure that the communication with other electric energy meters is random, thereby avoiding communication conflicts. When the electric energy meter receives a command data frame containing a temporary communication address sent by the host computer, it will send a confirmation frame to the host computer to establish an upgrade communication connection based on the temporary communication address. Then, the electric energy meter receives the response of the host computer to the confirmation frame, that is, the upgrade data, and extracts the corresponding data frame for upgrading according to its temporary ID. The upgrade data includes the temporary ID of the electric energy meter, the segmentation frame and the upgrade data frame, wherein the temporary ID corresponds to the temporary communication address. This method enables the electric energy meter to identify its own upgrade data frame range based on the temporary ID and the segmentation frame, and ignore the upgrade data of other electric energy meters, thereby achieving differentiated management. In this way, not only can the synchronous upgrade of batches of electricity meters be achieved, thus improving the upgrade efficiency, but also conflicts and interferences in the upgrade process can be effectively avoided by assigning a unique temporary ID to each electricity meter to be upgraded.
[0109] To better understand the above-mentioned batch upgrade process of electric energy meters, Figure 6 A schematic diagram of the process is shown, such as Figure 6 As shown, the electric energy meter initializes the communication and generates the pseudo-random number required for communication. When receiving the start frame broadcast by the host computer, the second random number calculated based on the pseudo-random number and the delay time are sent to the host computer to facilitate the host computer to assign a temporary communication address. When receiving the command data frame containing the temporary communication address, the temporary communication address assigned by the host computer is parsed and determined, and the confirmation frame is fed back to facilitate the host computer to determine that the electric energy meter is ready for upgrade. Receive the upgrade data sent by the host computer cyclically, and end the upgrade task when it is determined that the upgrade sub-frame corresponding to this electric energy meter is empty.
[0110] In a possible implementation, after sending the upgrade parameters to the host computer, the following steps are further included:
[0111] When receiving the start frame sent by the host computer, the pseudo-random number is updated.
[0112] In the specific implementation process, it is inevitable that the random delay time generated by the two energy meters will conflict. After receiving the upgrade parameters sent by each energy meter, the host computer compares the delay time of each energy meter. If there is the same delay time, the start frame is resent to instruct each energy meter to redetermine the delay time.
[0113] Figure 7 is a schematic diagram of the interactive process of the method for batch upgrading of electric energy meters provided in the embodiment of the present application, such as Figure 7 As shown, the method comprises the following steps:
[0114] The host computer initializes and generates a first random number S, and the electric energy meter initializes and generates a pseudo-random number Mn;
[0115] The host computer broadcasts a start frame determined according to the first random number S. When the electric energy meter receives the start frame, it calculates the second random number and the delay time, combines them into an upgrade parameter Cn, and transmits the upgrade parameter Cn to the host computer.
[0116] The host computer parses the upgrade parameter Cn uploaded by the electric energy meter, allocates a temporary communication address An corresponding to the electric energy meter, and sends the temporary communication address frame Zn to the electric energy meter.
[0117] The electric energy meter parses the communication address frame Zn to obtain the temporary communication address An, and feeds back a confirmation frame to the host computer to establish a communication connection for the upgrade process.
[0118] To facilitate the understanding of the data frame structure such as the start frame and the upgrade parameters, a specific embodiment is used for description. It should be noted that the following description does not limit the batch upgrade solution of electric energy meters provided in this application.
[0119] The host computer sends the start frame:
[0120] A:4,754,862,459(Hex:34 37 35 34 38 36 32 34 35 39)
[0121] Preambler FE Start bit 68 Random Number A 34 37 35 34 38 36 32 34 35 39 Check digit 43 Start command AA
[0122] Electricity meter n sends data (n=0)
[0123] Example: Electricity meter n randomly generates number B and random delay n, for example B = 5,834,269,625 (Hex 35 2c 3833 342c 32 36 39 2c 36 32 35), n is 0ms, and it is sent immediately.
[0124]
[0125] The host computer receives the data: 30 6e 4d 32 69 76 44 47 50 71 78 52 44 6d 7a 44 54 57314d 57 2f 44 6c 71 64 39 6f 4d 45 6c 67 56 59 33 70 4c 44 75 35 38 30 35 2b77 3761 30 70 35 58 6c 41 32 73 6a 68 62 47 4e 5a 4a 74 31, and reversely parses the data to get 35 2c 38 33 34 2c 32 36 39 2c 36 32 35, this data is the identification number of the sending electric energy meter, and the upper computer determines that the electric energy meter number is 0;
[0126] The host computer sends data:
[0127]
[0128] Electricity meter n sends data (n=1)
[0129] Random delay n = 10ms, example B 1 =1,358,259,345 (Hex 31 2c 33 35 38 2c 32 35 39 2c33 3435); when the time arrives and AA is received as the last frame (not 55), it starts sending, which is consistent with the frame sent by the energy meter 0.
[0130]
[0131] After receiving the data, the energy meter 0 parses 6b 4d 70 65 57 79 33 73 44 44 74 2f 6b 77 62 4a5264 42 67 43 51 3d 3d and obtains its own energy meter number as 0. It then records the first 16 after each frame sent by the FE host computer as its own data, and waits for the next time the host computer sends data 68 20, and then returns 99 for confirmation.
[0132] The host computer receives the data: 52 77 4b 61 64 53 68 47 47 4a 4f 43 6c 2f 6e 75 56 7169 376d 4e 70 49 54 4f 78 4c 62 78 6f 61 4f 4c 42 6e 56 69 39 5a 53 41 44 5638 46 64 386c 41 41 4c 32 5a 47 58 76 67 38 36 4a 5a 68 54, and reversely parses the data to get 31 2c 3335 38 2c 32 35 39 2c 33 34 35, this data is the identification number of the sending electric energy meter, and the upper computer determines that the electric energy meter number is 1;
[0133] The host computer sends the data after receiving it (for example, command frame 68 19 is sending, and 68 20 is receiving).
[0134]
[0135] After receiving the data, energy meter 1 parses 54 4a 76 70 66 55 6a 38 61 57 4e 39 6d 35 50 377061 6a 4a 6a 51 3d 3d and obtains its own energy meter number as 1. It then records each time the FE host computer sends a frame, the ID frame is parsed as its own temporary energy meter number, and waits for the next time the host computer sends data 68 20, and returns 99 for confirmation.
[0136] The communication method for adding new energy meters is the same as before. When all energy meters are authenticated successfully, different data values can be sent in different areas. For example, if there are 10 energy meters, the subsequent normal communication frame should be:
[0137]
[0138]
[0139] The above data are all example frames and data, and do not represent the actual data and actual number of the energy meter. When the energy meter n is transmitted, the data frame 0x16-0x16 corresponding to the energy meter n is empty, waiting for the subsequent addition of new energy meters, and the transmission can be increased.
[0140] When the electric energy meter receives the data, it determines its own data based on the ID frame of the electric energy meter at the appropriate location and discards the rest of the data.
[0141] According to the above method, the original one-to-one communication method can be changed to one-to-many communication to increase efficiency. The data of more energy meters can be transmitted simultaneously in the communication, and each energy meter only needs to receive its own data. The overall efficiency can be improved.
[0142] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0143] In order to more intuitively determine that the batch upgrade method of electric energy meters provided in the embodiment of the present application can improve the upgrade efficiency and avoid upgrade conflicts. Figures 8 to 13 A schematic diagram of communication duration is shown according to different embodiments.
[0144] like Figure 8 As shown, the efficiency of a single host computer communicating with a single table is calculated as 1. The current communication usage rate is as follows: the communication is 2ms, the table receives and processes 5ms, the frame is returned 2ms, and the master station processes 2ms. The total duration is 33ms, the table 1 is processed in total 15ms, and the host computer is 6ms. The utilization rate is: [33-(15+6)]÷33≈36.4%.
[0145] like Fig. 9 As shown, a single host computer communicates with two meters, one sending and one receiving.
[0146] Total duration: 66ms, communication idle: Table 1 is processed for a total of 15ms, Table 2 is processed for a total of 15ms, and the host computer is 12ms. The utilization rate is: [66-(15+15+12)]÷66≈36.4%.
[0147] Ideally, the communication situation without conflict is as follows Fig.10 As shown, the total duration is: 48ms, the idle time is: 24ms, and the utilization rate is 24÷48=50%.
[0148] like Fig.11 As shown, a single host computer communicates with three meters for a total of 99ms, with an idle time of 63ms, and a utilization rate of 36÷99≈36.4%.
[0149] The communication is performed in the manner provided in the embodiment of the present application, such as Fig.12 As shown in the figure, the communication time between two meters by a single host computer is 49ms in total, the idle time is 21ms, and the utilization rate is 28÷49≈57.1%. Compared with the traditional 66ms communication time, it is shortened by 17ms, and the communication utilization rate is increased from 36.4% to 57.1%.
[0150] like Fig.13As shown, under ideal conditions, a single host computer communicates with three meters for a total of 42ms, with an idle time of 4ms and a utilization rate of 38÷42≈90.5%.
[0151] The following is an embodiment of the device of the present application. For details not described in detail, please refer to the corresponding method embodiment described above.
[0152] Fig.14 Schematic diagram of the structure of a batch upgrade device for electric energy meters provided in an embodiment of the present application, which is applied to a host computer, such as Fig.14 As shown, the device comprises:
[0153] A first generating module 1401, configured to generate a start frame according to a first random number;
[0154] The first sending module 1402 is used to broadcast a start frame to each electric energy meter to be upgraded;
[0155] The first receiving module 1403 is used to receive the upgrade parameters fed back by each electric energy meter to be upgraded;
[0156] The first generating module 1401 is further used to generate a corresponding temporary communication address according to the upgrade parameters fed back by each electric meter to be upgraded;
[0157] The first sending module 1402 is also used to send a command data frame according to the temporary communication address; when receiving a confirmation frame, it parses the target temporary communication address corresponding to the confirmation frame, and sends upgrade data to the electric energy meter to be upgraded corresponding to the target temporary communication address; wherein the upgrade parameters include: a second random number and a delay time; the upgrade data includes: a temporary ID of the electric energy meter, a segmentation frame and an upgrade data frame; the temporary ID of the electric energy meter corresponds one to one to the temporary communication address.
[0158] In this embodiment, first, the host computer generates a start frame based on the first random number to avoid conflicts during multiple batch upgrades. Then, the start frame is broadcast to all electric energy meters to be upgraded to notify them that the host computer is currently in an idle state. Subsequently, the host computer receives upgrade parameter feedback from each electric energy meter to be upgraded, and generates a corresponding temporary communication address accordingly. These upgrade parameters include a second random number and a delay time, the purpose of which is to ensure that an independent communication connection can be established between the host computer and the electric energy meter. The command data frame is sent through the temporary communication address, and once the confirmation frame is received, it can be confirmed that the upgrade communication connection between the host computer and the electric energy meter has been successfully established. Then, the target temporary communication address in the confirmation frame is parsed, and the upgrade data is sent to the electric energy meter to be upgraded corresponding to the address. The upgrade data includes a temporary ID of the electric energy meter, a segmentation frame, and an upgrade data frame, wherein the temporary ID of the electric energy meter corresponds to the temporary communication address one by one. This method not only realizes the synchronous upgrade of batch electric energy meters and improves the upgrade efficiency, but also effectively avoids upgrade conflicts and interference between electric energy meters by assigning a unique temporary ID to each electric energy meter to be upgraded.
[0159] Fig.15 Schematic diagram of the structure of a batch upgrade device for electric energy meters provided in an embodiment of the present application, which is applied to electric energy meters, such as Fig.15 As shown, the device comprises:
[0160] The second generating module 1501 is used to generate a pseudo-random number. After receiving the start frame sent by the host computer, the second random number and delay time are generated according to the start frame and the pseudo-random number, and the second random number and delay time are combined into the upgrade parameters.
[0161] The second sending module 1502 is used to send the upgrade parameters to the host computer, and when receiving the command data frame sent by the host computer, send a confirmation frame to the host computer; wherein the command data frame includes a temporary communication address corresponding to the electric energy meter;
[0162] The second receiving module 1503 is used to receive the upgrade data sent by the host computer in response to the determination frame; wherein the upgrade data includes: the temporary ID of the electric energy meter, the segmentation frame and the upgrade data frame; the temporary ID of the electric energy meter corresponds to the temporary communication address one by one;
[0163] The upgrade module 1504 is used to extract the corresponding data frame for upgrading according to the corresponding temporary ID of the electric energy meter.
[0164] In this embodiment, after receiving the start frame sent by the host computer, the electric energy meter will generate a second random number and a corresponding delay time based on a pseudo-random number. Subsequently, it combines this information into upgrade parameters and sends it back to the host computer to ensure that the communication with other electric energy meters is random, thereby avoiding communication conflicts. When the electric energy meter receives a command data frame containing a temporary communication address sent by the host computer, it will send a confirmation frame to the host computer to establish an upgrade communication connection based on the temporary communication address. Then, the electric energy meter receives the response of the host computer to the confirmation frame, that is, the upgrade data, and extracts the corresponding data frame for upgrading according to its temporary ID. The upgrade data includes the temporary ID of the electric energy meter, the segmentation frame and the upgrade data frame, wherein the temporary ID corresponds to the temporary communication address. This method enables the electric energy meter to identify its own upgrade data frame range based on the temporary ID and the segmentation frame, and ignore the upgrade data of other electric energy meters, thereby achieving differentiated management. In this way, not only can the synchronous upgrade of batches of electricity meters be achieved, thus improving the upgrade efficiency, but also conflicts and interferences in the upgrade process can be effectively avoided by assigning a unique temporary ID to each electricity meter to be upgraded.
[0165] In the embodiments provided in the present application, it should be understood that the disclosed devices / electronic devices and methods can be implemented in other ways. For example, the device / electronic device embodiments described above are merely schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0166] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0167] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0168] If the integrated module / unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by the processor, the steps of the above-mentioned various electric energy meter batch upgrade method embodiments can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device that can carry the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium.
[0169] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.
Claims
1. A method for batch upgrading of electric energy meters, characterized in that: Applied to the host computer, including: Generate a start frame according to the first random number, and broadcast the start frame to each electric energy meter to be upgraded; Receive upgrade parameters fed back by each electric energy meter to be upgraded, generate corresponding temporary communication addresses according to the upgrade parameters fed back by each electric energy meter to be upgraded, and send command data frames according to the temporary communication addresses; wherein the upgrade parameters include: a second random number and a delay time; When a confirmation frame is received, the target temporary communication address corresponding to the confirmation frame is parsed, and upgrade data is sent to the electric energy meter to be upgraded corresponding to the target temporary communication address; wherein the upgrade data includes: an electric energy meter temporary ID, a segmentation frame and an upgrade data frame; the electric energy meter temporary ID corresponds to the temporary communication address one by one.
2. The method for batch upgrading electric energy meters according to claim 1, characterized in that: After receiving the upgrade parameters fed back by each electric energy meter to be upgraded, the method further includes: Delay times corresponding to the electric energy meters to be upgraded are determined, and when there is a conflict in the delay times, the start frame is rebroadcast to the electric energy meters to be upgraded.
3. The method for batch upgrading electric energy meters according to claim 1, characterized in that: The types of electric energy meters to be upgraded include one or more types.
4. The method for batch upgrading electric energy meters according to claim 1, characterized in that: The sending of upgrade data to the electric energy meter to be upgraded corresponding to the target temporary communication address includes: cyclically sending upgrade data to the electric energy meter to be upgraded corresponding to the target temporary communication address, wherein the upgrade data includes data frames corresponding to each electric energy meter to be upgraded; the data frames are partial upgrade data frames of the electric energy meter to be upgraded; the frame numbers of upgrade data frames of different types of electric energy meters are the same or different; When the data frames corresponding to the temporary IDs of all electric energy meters in the upgrade data are empty, it is determined that the batch upgrade of the electric energy meters is completed.
5. A method for batch upgrading of electric energy meters, characterized in that: Applied to electric energy meters, including: Generate pseudo-random numbers; After receiving the start frame sent by the host computer, generate a second random number and a delay time according to the start frame and the pseudo-random number, and combine them into an upgrade parameter; Sending the upgrade parameters to the host computer, and upon receiving the command data frame sent by the host computer, sending a confirmation frame to the host computer; wherein the command data frame includes a temporary communication address corresponding to the electric energy meter; Receive the upgrade data sent by the host computer in response to the determination frame; wherein the upgrade data includes: a temporary ID of the electric energy meter, a segmentation frame and an upgrade data frame; the temporary ID of the electric energy meter corresponds to a temporary communication address one by one; The corresponding data frame is extracted according to the corresponding temporary ID of the electric energy meter for upgrading.
6. The method for upgrading electric energy meters in batches according to claim 5, characterized in that: The step of generating a second random number and a delay time according to the start frame and the pseudo-random number comprises: Generate a second random number according to the pseudo-random number, the current time and the first random number corresponding to the start frame; A random delay time is generated according to the second random number.
7. The method for batch upgrading electric energy meters according to claim 5, characterized in that: After sending the upgrade parameters to the host computer, the method further includes: When the start frame sent by the host computer is received, the pseudo-random number is updated.
8. The method for batch upgrading electric energy meters according to claim 5, characterized in that: The step of extracting the corresponding data frame according to the corresponding temporary ID of the electric energy meter for upgrading includes: Extracting corresponding data sub-frames from the upgrade data according to the temporary communication address and the segmented frames, and writing the data sub-frames into the electric energy meter; When it is determined according to the temporary communication address and the segmented frame that the corresponding data subframe in the upgrade data is empty, the upgrade is completed; The upgrade data includes data frames corresponding to each electric energy meter to be upgraded; the data frames are partial upgrade data frames of the electric energy meter to be upgraded.
9. A batch upgrade device for electric energy meters, characterized in that: Applied to the host computer, including: A first generating module, used for generating a start frame according to a first random number; A first sending module, used for broadcasting the start frame to each electric energy meter to be upgraded; A first receiving module is used to receive the upgrade parameters fed back by each electric energy meter to be upgraded; The first generating module is further used to generate a corresponding temporary communication address according to the upgrade parameters fed back by each electric meter to be upgraded; The first sending module is also used to send a command data frame according to the temporary communication address; when receiving a confirmation frame, it parses the target temporary communication address corresponding to the confirmation frame, and sends upgrade data to the electric energy meter to be upgraded corresponding to the target temporary communication address; wherein the upgrade parameters include: a second random number and a delay time; the upgrade data includes: an electric energy meter temporary ID, a segmentation frame and an upgrade data frame; the electric energy meter temporary ID corresponds one to one to the temporary communication address.
10. A batch upgrade device for electric energy meters, characterized in that: Applied to electric energy meters, including: The second generating module is used to generate a pseudo-random number, and upon receiving a start frame sent by the host computer, generates a second random number and a delay time according to the start frame and the pseudo-random number, and combines them into an upgrade parameter; A second sending module is used to send the upgrade parameters to the host computer, and when receiving the command data frame sent by the host computer, send a confirmation frame to the host computer; wherein the command data frame includes a temporary communication address corresponding to the electric energy meter; The second receiving module is used to receive the upgrade data sent by the host computer in response to the determination frame; wherein the upgrade data includes: a temporary ID of the electric energy meter, a segmentation frame and an upgrade data frame; the temporary ID of the electric energy meter corresponds to a temporary communication address one by one; The upgrade module is used to extract the corresponding data frame for upgrading according to the corresponding temporary ID of the electric energy meter.