Intelligent electric meter and communication method thereof

By generating dynamic verification codes and communication keys using a key hash chain and real-time operating data of smart meters, the problem of easily cracked smart meter data encryption is solved, achieving a highly secure dynamic encryption and decryption process and enhancing the protection of power system and user privacy.

CN121508809APending Publication Date: 2026-02-10JIANGSU TENGWU INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511664656.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-13
Publication Date
2026-02-10

AI Technical Summary

Technical Problem

The existing data encryption technology of smart meters is at risk of being cracked, resulting in insufficient data security, affecting the stable operation of the power system and the leakage of user privacy information.

Method used

An initial session key is generated using a key hash chain, and a dynamic verification code and communication key are generated by combining the real-time operating data of the smart meter. The dynamic encryption and decryption process is achieved by verifying the historical operating data of the upper-level management device.

Benefits of technology

It improves the security of data transmission, resists attacks from counterfeit devices, ensures the security of authentication, and generates multiple secure initial session keys through negotiation of the key hash chain, reducing communication overhead.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121508809A_ABST
    Figure CN121508809A_ABST
Patent Text Reader

Abstract

The invention discloses an intelligent electric meter and a communication method thereof. Comprising the following steps: an ammeter determines an initial session key according to a key hash chain generated by negotiating with superior management equipment in advance, acquires current running data of the ammeter, and generates a dynamic check code and a dynamic communication key based on the initial session key, the current running data and an identification code of the ammeter; generating an encrypted data packet based on the dynamic communication key, the dynamic check code and data needing to be sent, and sending the encrypted data packet to the equipment; the device extracts operation data of the ammeter in a preset time period from a historical operation database, checks a dynamic check code in the encrypted data packet based on the extracted operation data, determines an initial session key based on a stored key hash chain when the check is passed, and sends the initial session key to the ammeter; and determining a restored dynamic communication key based on the initial session key and the identification code of the ammeter, and decrypting the encrypted data packet by using the restored dynamic communication key. According to the invention, the data transmission security of the intelligent electric meter is greatly improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of smart meter technology, specifically relating to a smart meter and its communication method. Background Technology

[0002] With the rapid development of smart grids, smart meters, as an indispensable key device in the power system, are being widely used in various fields. Smart meters not only enable accurate metering of electricity but also possess multiple functions such as data transmission and remote control, providing strong support for the intelligent management and operation of the power system. Among the many functions of smart meters, data security is particularly important. The data transmitted by smart meters, such as user electricity consumption data and grid operation status data, not only affects the accuracy of power company billing and the stable operation of the grid but also involves users' privacy information. If this data is tampered with, it may lead to incorrect electricity bill calculations, harming the interests of users and power companies; affecting grid dispatching and management, causing power system failures; and leaking users' privacy information, causing unnecessary trouble for users.

[0003] Currently, data security measures for smart meters mainly include technologies such as data encryption. However, these technologies still have some shortcomings in practical applications. Regarding data encryption, although existing encryption algorithms can provide a certain degree of protection, with the continuous development of computing technology, some encryption algorithms may face the risk of being cracked, potentially leading to data tampering, loss, or leakage, seriously affecting the data security of smart meters. As a core device in the power Internet of Things (IoT), the communication data (such as electricity consumption, user information, and billing data) of smart meters involves user privacy and the security of electricity transactions. Therefore, further improving the security of data transmission in smart meters is an urgent problem to be solved. Summary of the Invention To address the aforementioned problems in the prior art, this invention provides a smart meter and its communication method.

[0004] The technical problem to be solved by this invention is achieved through the following technical solution: This invention provides a smart meter communication method, comprising: When a smart meter needs to communicate with an upper-level management device, the smart meter determines the initial session key based on the key hash chain pre-negotiated and generated with the upper-level management device stored in its own memory; The smart meter collects its current operating data and generates a dynamic verification code and a dynamic communication key based on the initial session key, its current operating data, and its own identification code. The smart meter generates an encrypted data packet based on the dynamic communication key, the dynamic verification code, and the data to be sent, and sends it to the upper-level management device. After receiving the encrypted data packet, the upper-level management device extracts the operating data of the smart meter for a preset time period from the historical operating database, and verifies the dynamic verification code in the encrypted data packet based on the operating data for the preset time period. When the verification is successful, the upper-level management device determines the initial session key based on the key hash chain it stores, determines the restored dynamic communication key based on the initial session key and the smart meter's identification code, and uses the restored dynamic communication key to decrypt the encrypted data packet.

[0005] The present invention also provides a smart meter, including a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus; The memory is used to store computer programs; When the processor executes the program stored in the memory, it implements the steps performed by the smart meter in the above-described smart meter communication method.

[0006] Compared with the prior art, the beneficial effects of the present invention are as follows: 1) This invention uses real-time operating data of the electricity meter (e.g., real-time current value, voltage fluctuation coefficient, electricity meter temperature, etc.) as dynamic feature factors during encryption to generate a dynamic communication key, which can realize "one key at one time". Even for the same electricity meter, the communication key changes in real time under different operating states, making it difficult to be cracked and greatly improving security.

[0007] 2) The verification code generated by this invention is also dynamically changing, and therefore it is not easy to crack. It can resist attacks that use static verification codes in counterfeit devices, greatly improving the security of identity verification.

[0008] 3) In this invention, since the key hash chain includes multiple keys and the key hash chain is generated by the meter in advance through negotiation with the upper-level management device, multiple secure initial session keys can be obtained through one negotiation, and the initial session keys can be changed as needed, which not only saves communication overhead, but also greatly improves security.

[0009] The present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. Attached Figure Description

[0010] Figure 1 This is a flowchart illustrating the smart meter communication method provided in an embodiment of the present invention; Figure 2 This is a schematic diagram of the key tree provided in an embodiment of the present invention. Detailed Implementation

[0011] The present invention will be further described in detail below with reference to specific embodiments, but the implementation of the present invention is not limited thereto.

[0012] Figure 1 This is a flowchart illustrating a smart meter communication method provided in an embodiment of the present invention, as shown below. Figure 1 As shown, the method includes: S101. When a smart meter needs to communicate with an upper-level management device, the smart meter determines the initial session key based on the key hash chain pre-negotiated and generated with the upper-level management device stored in its own memory.

[0013] Here, the key hash chain includes multiple hash values, and each hash value is used as a session key.

[0014] Specifically, the smart meter retrieves the last used session key from its own session key usage record and determines whether the lifecycle of the last used session key has ended. If so, the first key in the key hash chain following the last used session key is used as the initial session key, and a lifecycle is assigned to the initial session key. If not, the last used session key is used as the initial session key. It should be noted that the lifecycle of the initial session key can be a specific time, such as one day, three days, etc., or it can be a number of uses, such as two or three times, etc. This invention does not limit this.

[0015] S102. The smart meter collects its current operating data and generates a dynamic verification code and a dynamic communication key based on the initial session key, its current operating data, and its own identification code.

[0016] In this invention, the current operating data of the smart meter includes: current current value, current voltage fluctuation coefficient, current internal temperature of the meter, and current communication signal strength. The current voltage fluctuation coefficient refers to the difference between the current voltage value and the average voltage value over the past n seconds (i.e., current voltage value - average voltage value over the past n seconds), where n can be 5, 10, etc. It should be noted that the unit of current value is ampere (A), and the acquisition accuracy can be accurate to 0.1A; the unit of temperature is °C, and the acquisition accuracy can be accurate to 0.1 °C; the unit of voltage fluctuation coefficient is volt (V), and the acquisition accuracy can be accurate to 0.1V; the unit of communication signal strength is dBm, and the acquisition accuracy can be accurate to 1 dBm.

[0017] S103: The smart meter generates an encrypted data packet based on the dynamic communication key, dynamic verification code, and the data to be sent, and sends it to the upper-level management device.

[0018] S104. After receiving the encrypted data packet, the superior management device extracts the operating data of the smart meter for a preset time period from the historical operation database, and verifies the dynamic check code in the encrypted data packet based on the operating data of the preset time period.

[0019] S105. When the verification is successful, the superior management device determines the initial session key based on its own stored key hash chain, determines the restored dynamic communication key based on the initial session key and the smart meter's identification code, and uses the restored dynamic communication key to decrypt the encrypted data packet.

[0020] In some embodiments, the above-mentioned S102 is implemented through the following steps: S1021. After preprocessing each type of current running data, multiple preprocessed data are obtained. The features of the multiple preprocessed data are fused to obtain an M / 8-bit dynamic string, and the dynamic string is used as a dynamic check code.

[0021] In this invention, M can be 256.

[0022] Specifically, the smart meter converts the current current value, current voltage fluctuation coefficient, current internal temperature of the meter, and current communication signal strength into integers from 0 to 256, resulting in four 4-bit integers; the four 4-bit integers are then concatenated in order to obtain an M / 8-bit dynamic string.

[0023] Specifically, for current values, since there are no negative numbers, there is no need to consider the sign conversion. For example, when the current value is 10.5A, amplifying it by 10 times results in 105, which is a 4-bit integer 0105.

[0024] Specifically, for the voltage fluctuation coefficient, since negative values ​​may exist, the sign conversion needs to be considered. Therefore, for the voltage fluctuation coefficient, the data needs to be offset first to eliminate the sign. Then, the offset data is amplified, and finally, the amplified data is converted into an integer. For example, the voltage fluctuation coefficient can be offset by "1V". For instance, when the voltage fluctuation coefficient is -0.3V, by adding 1V to -0.3V, we can get the offset data 0.7V. Then, amplify it by 10 times to get 70, which is a 4-digit integer 0070.

[0025] Specifically, for temperature, since negative numbers may exist, the sign conversion also needs to be considered. Therefore, for temperature, the data needs to be offset first to eliminate the sign. Then, the offset data is amplified, and then the amplified data is converted into an integer. For example, the temperature can be offset by "20℃". For example, when the temperature is -10℃, by adding 20℃ to -10℃, we can get the offset data 10℃. Then, amplify it by 10 times to get 100, which is a 4-digit integer 0100.

[0026] Specifically, for communication signal strength, since there is a negative sign, the sign conversion also needs to be considered. Therefore, for communication signal strength, the data needs to be offset first to eliminate the positive and negative signs. Then, the offset data is amplified, and then the amplified data is converted into an integer. For example, the voltage fluctuation coefficient can be offset by "140dBm". For example, when the voltage fluctuation coefficient is -40 dBm, by adding 140dBm to -40 dBm, we can get the offset data 100dBm. Then, amplify it by 10 times to get 1000, that is, a 4-digit integer 1000.

[0027] Thus, four 4-bit integers are obtained in sequence, for example, 0105, 0070, 0100, and 1000. Then, these four 4-bit integers are concatenated in sequence to obtain a 128-bit binary dynamic string, that is, 0105, 0070, 0100, and 1000 are concatenated in sequence to obtain the 128-bit binary string "0105007001001000".

[0028] S1022. Concatenate the dynamic check code and its own identifier code into a string and use it as input. Use the national cryptographic SM3 hash algorithm to generate an M-bit SM3 hash value and use the SM3 hash value as the dynamic perturbation code.

[0029] Specifically, a composite input data is formed by combining a dynamic verification code with the smart meter's own identification code. This composite data contains the device's real-time operating characteristics and unique identifier. It is then used as the calculation source for the national cryptographic SM3 hash algorithm to generate a 256-bit SM3 hash value. Finally, the 256-bit SM3 hash value is used as a dynamic perturbation code.

[0030] S1023. Perform an XOR operation between the first M / 2 bits of the M-bit initial session key and the first M / 2 bits of the dynamic perturbation code to obtain the M / 2-bit dynamic communication key.

[0031] In some embodiments, the above-mentioned S103 is achieved through the following steps: S1031. The smart meter generates raw data blocks based on the data to be sent. It adopts the national cryptographic SM4 algorithm, uses the dynamic communication key as the encryption key, and uses the last 128 bits of the dynamic check code as the initial vector (IV). The raw data blocks are encrypted in groups of 128 bits each to generate SM4 encrypted data blocks. S1032. The smart meter adds the dynamic verification code as a feature identifier segment to the end of the SM4 encrypted data block to obtain an encrypted data packet, and sends the encrypted data packet to the upper-level management device.

[0032] In some embodiments, the above-mentioned S104 is implemented through the following steps: S1041. After receiving the encrypted data packet, the superior management device extracts the dynamic verification code from the encrypted data packet, and calls the historical operation database of the smart meter according to the identification code of the smart meter. It then extracts the operation data of the smart meter for a preset time period from the historical operation database to obtain multiple operation data ranges.

[0033] For example, the preset time period can be set according to actual needs, such as one day, three days, or one week.

[0034] S1042. The upper-level management device verifies the dynamic check code by determining whether each type of operational data in the dynamic check code is within the corresponding operational data range of multiple operational data ranges. If each type of data in the dynamic check code is within the corresponding operational data range of multiple operational data ranges, the verification is successful; otherwise, the verification fails.

[0035] For example, the upper-level management equipment can extract the current fluctuation range, voltage fluctuation coefficient fluctuation range, normal temperature range, and effective range of communication signal strength of the smart meter over the past day. For example, the current fluctuation range is 0-60A, the voltage fluctuation coefficient fluctuation range is -0.5~0.5V, the normal temperature range is -10~60℃, and the effective range of communication signal strength is -120~-50dBm. From the string "0105007001001000", the current value characteristic 105, voltage fluctuation coefficient characteristic 70, temperature characteristic 100, and communication signal strength characteristic 1000 are obtained sequentially. These characteristics are then reduced by a factor of 10, resulting in 10.5, 0.7, 10, and 100 respectively. 0.7 is then subtracted by 1V to obtain -0.3V, 10 is subtracted by 20℃ to obtain -10℃, and 100 is subtracted by 140dBm to obtain -40dBm. Thus, these four operating data are reconstructed. Next, these four operating data are compared with the corresponding ranges in the four data ranges mentioned above. If all four operating data fall within their respective ranges, the verification passes; otherwise, the verification fails, decryption is rejected, and a warning is triggered.

[0036] In some embodiments, the above-mentioned S105 is implemented through the following steps: S1051. The superior management device obtains the last used session key from its own session key usage record and determines whether the lifecycle of the last used session key has ended.

[0037] S1052. If yes, the upper-level management device will use the first key in the key hash chain after the last used session key as the initial session key and assign a lifecycle to the initial session key; otherwise, the last used session key will be used as the initial session key.

[0038] It should be noted that the principle by which the upper-level management device determines the initial session key based on the key hash chain is the same as that of the smart meter, and will not be elaborated here.

[0039] S1053. The upper-level management device concatenates the dynamic verification code and the smart meter's identification code into a string and uses it as input. It then uses the national cryptographic SM3 hash algorithm to generate an M-bit SM3 hash value and uses the SM3 hash value as the restored dynamic perturbation code.

[0040] S1054. The upper-level management device performs an XOR operation on the first M / 2 bits of the initial session key and the first M / 2 bits of the restored dynamic perturbation code to obtain the restored dynamic communication key of M / 2 bits, and uses the restored dynamic communication key to decrypt the encrypted data packet.

[0041] Specifically, the upper-level management device uses the restored dynamic communication key as the decryption key and the last 128 bits of the restored dynamic perturbation code as the initial vector IV to decrypt the SM4 encrypted data block, thus obtaining the decrypted data block.

[0042] In this invention, the aforementioned smart meter is located in a region, and N-1 other smart meters are distributed within this region. Each smart meter has a public-private key pair and a region code. The upper-level management device also has a public-private key pair and a region code corresponding to that region. It should be noted that these public-private keys and region codes, as well as the aforementioned identification code, can all be obtained during registration with the central management center or the management center of the region. Based on this, the method for each smart meter to negotiate and generate a key hash chain with the upper-level management device includes the following steps: S001, Superior management equipment is based on regional code , one's own public key Its own identification code Generate verification code According to the verification code Its own identification code and its own public key Generate a message and send it to N smart meters in the area.

[0043] Here, N is a positive integer greater than 2.

[0044] here, , This represents a hash operation. This indicates concatenation. A message can be represented as... .

[0045] S002, Each smart meter is based on its area code. and the information in the message Verify the verification code If the verification passes, then based on the area code... , its own location information and its own identification code Generate its own encrypted location key And send it to the superior management device, It is the first Location key of a smart meter The value of is from 1 to N.

[0046] Specifically, each smart meter is based on its area code. and the information in the message Recalculate the verification code. If the recalculated verification code matches... If they match, the verification is successful; otherwise, the verification is unsuccessful.

[0047] Specifically, the first Location key of a smart meter Indicates adoption right The ciphertext obtained by encryption, , Indicates the first The location coordinates of each smart meter.

[0048] S003, The superior management device uses the encrypted location key of N smart meters. Generate a key tree, and based on the root key of the key tree... and random numbers Construct a key hash chain and generate missing key information for each smart meter based on the key tree. and random number Using root key Encrypted along with missing key information Send them together to each smart meter.

[0049] Specifically, S003 is achieved through the following steps: S1. The superior management equipment uses a regional code. Encrypted location key for each smart meter Decryption is performed to obtain the location key for each smart meter. .

[0050] S2, The upper-level management device will transfer the location keys of N smart meters. These are the N leaf nodes of the key tree.

[0051] S3. When N is even, the upper-level management device creates N / 2 Class I nodes, where each leaf node belongs to only one Class I node, and each Class I node is the parent node of two leaf nodes. Each Class I node is calculated based on the two leaf nodes. When N is odd, the upper-level management device creates (N-1) / 2+1 Class I nodes.

[0052] S4. The upper-level management device adopts the principle of S2 above and continues to generate second-class nodes based on the obtained first-class nodes. This calculation continues until the root node is calculated, thus obtaining the key tree.

[0053] For example, when N is 3, and the location keys of these 3 smart meters are respectively , and The steps for constructing a key tree are as follows: First, ... , and As three distinct leaf nodes of the key tree; then, according to and Calculate a class of nodes , , Representing the generator of elliptic curves, As another type of node , Next, based on a type of node and a type of node Calculate a type II node , Thus, one can obtain the following: Figure 2 The key tree shown is shown, and the root key of the key tree is... .

[0054] S5. The upper-level management device uses the root node of the key tree as the root key. According to the root key and random numbers Generate a hash chain and use the hash chain as the key hash chain.

[0055] Specifically, the key hash chain is ,in, The value ranges from 1 to For example, when If so, it means that there are 200 keys in the key hash chain, and... It is the root key of the key tree. .

[0056] S6. The upper-level management device uses the location key of each smart meter. In the key tree, determine the missing key information for each smart meter in generating the key tree, and use this missing key information as the missing key information for each smart meter. .

[0057] Specifically, such as Figure 2 As shown, for the first smart meter, the missing key information for generating its key tree is: and For the second smart meter, the missing key information for generating its key tree is: and For the third smart meter, the missing key information for generating its key tree is: .

[0058] S004. Each smart meter, based on its own missing key information... and its own location key Calculate the root key And using the calculated root key Decryption yields a random number According to the root key and random numbers Construct a key hash chain.

[0059] For example, for the first smart meter, first according to and generate reuse and generate Thus, the root key is obtained. .

[0060] The present invention also provides a smart meter, including a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; Memory, used to store computer programs; When the processor executes the program stored in the memory, it implements the steps performed by the smart meter in the above-described smart meter communication method.

[0061] The present invention also provides a management device, including a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus; Memory, used to store computer programs; When the processor executes the program stored in the memory, it implements the steps performed by the superior management device in the above-described smart meter communication method.

[0062] The present invention has the following advantages: 1) This invention breaks through the traditional single SM4 encryption mode and constructs a logic that integrates SM4 symmetric encryption and SM3 hash dynamic salting. The SM3 hash value is used as the dynamic initial vector for SM4 encryption, rather than an independently added MAC code. This makes the encryption process deeply coupled with the data hash value, thereby increasing the difficulty of cracking exponentially and greatly improving the security of data transmission.

[0063] 2) This invention is the first to incorporate real-time operating data of the electricity meter (e.g., real-time current value, voltage fluctuation coefficient, electricity meter temperature, and communication signal strength) as a dynamic feature factor for encryption into the generation process of the SM4 encryption key, achieving the effect of "one key per moment". Even for the same electricity meter, the communication key changes in real time under different operating states, making it difficult to crack and greatly improving security.

[0064] 3) This invention adds a verification step based on historical operating data to the decryption process of the upper-level management device. By comparing the historical operating characteristic threshold range of the smart meter, it can determine whether the encrypted data comes from a real and legitimate smart meter, thus resisting attacks that use static keys for encryption by counterfeit devices.

[0065] 4) In this invention, since the key hash chain includes multiple keys and the key hash chain is generated by the meter in advance through negotiation with the upper-level management device, multiple secure initial session keys can be obtained through one negotiation, and the initial session keys can be changed as needed, which not only saves communication overhead, but also greatly improves security.

[0066] It should be noted that the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Therefore, features defined as "first" or "second" may explicitly or implicitly include one or more features. In the description of this invention, "a plurality of" means two or more, unless otherwise explicitly specified.

[0067] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the present invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Furthermore, those skilled in the art can combine and integrate the different embodiments or examples described in this specification.

[0068] In this specification, the word "comprising" does not exclude other components or steps, and "a" or "an" does not exclude multiple instances. While different embodiments may describe certain measures, this does not mean that these measures cannot be combined to produce a good effect.

[0069] The above description, in conjunction with specific preferred embodiments, provides a further detailed explanation of the present invention. It should not be construed that the specific implementation of the present invention is limited to these descriptions. For those skilled in the art, various simple deductions or substitutions can be made without departing from the concept of the present invention, and all such modifications and substitutions should be considered within the scope of protection of the present invention.

Claims

1. A communication method for a smart meter, characterized in that, include: When a smart meter needs to communicate with an upper-level management device, the smart meter determines the initial session key based on the key hash chain pre-negotiated and generated with the upper-level management device stored in its own memory; The smart meter collects its current operating data and generates a dynamic verification code and a dynamic communication key based on the initial session key, its current operating data, and its own identification code. The smart meter generates an encrypted data packet based on the dynamic communication key, the dynamic verification code, and the data to be sent, and sends it to the upper-level management device. After receiving the encrypted data packet, the upper-level management device extracts the operating data of the smart meter for a preset time period from the historical operating database, and verifies the dynamic verification code in the encrypted data packet based on the operating data for the preset time period. When the verification is successful, the upper-level management device determines the initial session key based on the key hash chain it stores, determines the restored dynamic communication key based on the initial session key and the smart meter's identification code, and uses the restored dynamic communication key to decrypt the encrypted data packet.

2. The smart meter communication method according to claim 1, characterized in that, The key hash chain contains multiple keys; The smart meter determines the initial session key based on a key hash chain pre-negotiated with the upper-level management device, which it stores, including: The smart meter retrieves the last used session key from its own session key usage record and determines whether the lifecycle of the last used session key has ended. If so, the first key in the key hash chain after the last used session key is taken as the initial session key, and a lifecycle is assigned to the initial session key; If not, then the last used session key will be used as the initial session key.

3. The smart meter communication method according to claim 1, characterized in that, The process of generating a dynamic verification code and a dynamic communication key based on the initial session key, its current operating data, and its own identifier includes: After preprocessing each type of current running data, multiple preprocessed data are obtained. The multiple preprocessed data are then fused to obtain an M / 8-bit dynamic string, which is then used as the dynamic check code. The dynamic check code and its own identifier are concatenated into a string and used as input. The national cryptographic SM3 hash algorithm is used to generate an M-bit SM3 hash value, and the SM3 hash value is used as a dynamic perturbation code. The first M / 2 bits of the initial session key and the first M / 2 bits of the dynamic perturbation code are XORed to obtain the dynamic communication key of M / 2 bits.

4. The smart meter communication method according to claim 3, characterized in that, The current operating data of the smart meter includes: current current value, current voltage fluctuation coefficient, current internal temperature of the meter, and current communication signal strength. After preprocessing each type of current operating data, multiple preprocessed data are obtained. These multiple preprocessed data are then fused to obtain an M / 8-bit dynamic string, including: The current current value, the current voltage fluctuation coefficient, the current internal temperature of the meter, and the current communication signal strength are each converted into an integer within the range of 0 to M, resulting in four 4-bit integers. The four 4-digit integers are concatenated in order to obtain an M / 8-digit dynamic string.

5. The smart meter communication method according to claim 1, characterized in that, The current operating data of the smart meter includes various operating data; after receiving the encrypted data packet, the upper-level management device extracts the operating data of the smart meter for a preset time period from the historical operating database, and verifies the dynamic verification code in the encrypted data packet based on the operating data of the preset time period, including: After receiving the encrypted data packet, the upper-level management device extracts the dynamic verification code from the encrypted data packet, and calls the historical operation database of the smart meter according to the identification code of the smart meter, and extracts the operation data of the smart meter for a preset time period from the historical operation database to obtain multiple operation data ranges; The upper-level management device verifies the dynamic verification code by determining whether each type of operational data in the dynamic verification code falls within the corresponding operational data range of the multiple operational data ranges. If each type of data in the dynamic verification code falls within the corresponding operational data range of the multiple operational data ranges, the verification passes; otherwise, the verification fails.

6. The smart meter communication method according to claim 3, characterized in that, The upper-level management device determines the initial session key based on the key hash chain it stores, and determines the restored dynamic communication key based on the initial session key and the smart meter's identification code, including: The upper-level management device obtains the last used session key from its own session key usage record and determines whether the lifecycle of the last used session key has ended. If yes, the upper-level management device will use the first key in the key hash chain after the last used session key as the initial session key and assign a lifecycle to the initial session key; if no, the last used session key will be used as the initial session key. The upper-level management device concatenates the dynamic verification code and the identification code of the smart meter into strings and uses them as input. It then uses the national cryptographic SM3 hash algorithm to generate an M-bit SM3 hash value and uses the SM3 hash value as the restored dynamic perturbation code. The upper-level management device performs an XOR operation on the first M / 2 bits of the M-bit initial session key and the first M / 2 bits of the restored dynamic perturbation code to obtain the M / 2-bit restored dynamic communication key.

7. The smart meter communication method according to claim 1, characterized in that, The smart meter is located in an area, and N-1 other smart meters are distributed in the area. Each smart meter has a pair of public and private keys and an area code. The upper-level management device has a pair of public and private keys and the area code corresponding to the area. The method for the smart meter to negotiate and generate a key hash chain with the upper-level management device includes: The superior management device is based on the region code. , one's own public key Its own identification code Generate verification code According to the verification code Its own identification code and its own public key Generate a message and send it to N smart meters in the area; Each smart meter is based on the area code. Verify the verification code using the information in the message. If the verification passes, then according to the stated region code... , its own location information and its own identification code Generate its own encrypted location key And send it to the higher-level management device; The upper-level management device uses the encrypted location key of the N smart meters. Generate a key tree, and based on the root key of the key tree... and random numbers Construct the key hash chain and generate missing key information for each smart meter based on the key tree. and the random number Using the root key Encrypted together with the missing key information Send them together to each smart meter; Each smart meter is based on its missing key information. and its own location key Calculate the root key And using the calculated root key Decryption yields the random number According to the root key and the random number Construct the key hash chain.

8. The smart meter communication method according to claim 7, characterized in that, The upper-level management device uses the encrypted location key of the N smart meters. Generate a key tree, and based on the root key of the key tree... and random numbers Construct the key hash chain and generate missing key information for each smart meter based on the key tree. ,include: S1, The superior management device uses the region code. Encrypted location key for each smart meter Decryption is performed to obtain the location key for each smart meter. ; S2, the upper-level management device will transfer the location keys of the N smart meters. As the N leaf nodes of the key tree; S3. When N is even, the upper-level management device creates N / 2 first-class nodes, where each leaf node belongs to only one first-class node, each first-class node is the parent node of two leaf nodes, and each first-class node is calculated based on the two leaf nodes; when N is odd, the upper-level management device creates (N-1) / 2+1 first-class nodes. S4. The upper-level management device adopts the principle of S2 above, and continues to generate second-type nodes based on the obtained first-type nodes. This calculation is repeated until the root node is calculated, thus obtaining the key tree. S5. The upper-level management device uses the root node of the key tree as the root key. According to the root key and random numbers Generate a hash chain, and use the hash chain as the key hash chain; S6, the higher-level management device uses the location key of each smart meter. Based on the position in the key tree, determine the missing key information for each smart meter in generating the key tree, and use the missing key information as the missing key information for each smart meter. .

9. The smart meter communication method according to claim 7, characterized in that, The key hash chain includes multiple hash values, and the first hash value is the root key. Each hash value is used as a session key.

10. A smart meter, comprising a processor, a communication interface, a memory, and a communication bus, characterized in that, The processor, the communication interface, and the memory communicate with each other via the communication bus; The memory is used to store computer programs; When the processor executes the program stored in the memory, it implements the steps performed by the smart meter in any one of the methods described in claims 1-9.