A method, system, and medium for differentiated security upgrades of various modules in a smart meter.
By constructing a multi-layered decryption key acquisition mechanism and signature verification mechanism, the problem of lack of differentiated protection in the upgrade of smart meter modules is solved, and the refined management and security improvement of module security upgrades are realized.
Patent Information
- Application Number
- CN202611267822.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-20
- Publication Date
- 2026-11-17
AI Technical Summary
Existing security upgrade schemes for various modules of smart meters lack differentiated protection, which poses risks such as upgrade package tampering, key leakage, algorithm obsolescence, and version rollback. Furthermore, there is a lack of security strategies for different modules.
Employing a multi-layered decryption key acquisition mechanism, a flexible signature verification configuration mechanism, and a dynamic module security circuit breaker strategy, differentiated security protection for modules is achieved by constructing an upgrade package that includes a metadata area, a decryption information encapsulation area, and a signature information encapsulation area.
Effectively prevents risks of key leakage, data tampering, and version rollback, enhances the security and flexibility of smart meter upgrades, and enables refined management.
Smart Images

Figure CN123122839A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of smart meter technology, specifically relating to a method for securely upgrading the firmware of various modules in a smart meter. Background Technology
[0002] With the rapid development of smart grids, smart meters, as key terminal devices in the power system, undertake important functions such as energy metering, data acquisition, and remote communication. Their operational stability and security directly affect the reliable operation of the power system. Smart meters typically consist of multiple functional modules, including a main control module, a communication module, and a metering module. These modules require remote upgrade packages for function updates, vulnerability patching, and security hardening during daily use. Therefore, the security of the upgrade process for each module of a smart meter becomes a crucial link in ensuring the normal operation of the meter and the security of the power system.
[0003] In the field of smart meter upgrades, traditional upgrade security solutions typically employ a unified encryption and signature verification mechanism. This means all modules use the same pre-set key and signature algorithm for security verification of the upgrade package. While this approach is relatively simple to implement, its drawbacks are becoming increasingly apparent as smart meter applications become more complex and security requirements rise. Specifically, the following security risks exist: 1. Upgrade package tampering risk: Malicious attackers may tamper with the upgrade package content, leading to meter malfunctions or the implantation of malicious code. 2. Key leakage risk: There is a risk of leakage during the storage and transmission of symmetric encryption keys. Once leaked, all upgrade packages encrypted with that key will be compromised. 3. Algorithm obsolescence risk: With the development of cryptographic technology, traditional encryption algorithms may face the risk of being cracked, but there is a lack of effective algorithm update mechanisms. 4. Version rollback risk: Older version upgrade packages may be re-pushed, causing the meter to be downgraded or run software with security vulnerabilities. 5. Insufficient module differentiation: Different meter modules (illegal zone, illegal zone, and various communication modules) have different security requirements, but existing solutions lack targeted security strategies. Summary of the Invention
[0004] The purpose of this invention is to address the technical problem of the lack of differentiated protection and refined management in existing smart meter module upgrade security schemes. This invention proposes a method for differentiated security upgrades of smart meter modules. This method establishes a multi-layered decryption key acquisition mechanism, a flexible signature verification configuration mechanism, a dynamic module security circuit breaker strategy, and an upgrade package time validity verification mechanism. It implements differentiated security protection strategies for the security needs of different modules in the smart meter, achieving a balance between security and flexibility in the upgrade process, and effectively improving the refined level of overall smart meter upgrade security management.
[0005] The technical solution of this invention is: In a first aspect, the present invention provides a method for differentiated security upgrades of smart meter modules, comprising: S1. The smart meter obtains an upgrade package, which includes a metadata area, a decryption information encapsulation area, a signature information encapsulation area, and a payload area. The metadata area includes a module identifier, a decryption key identifier, a signature verification public key identifier, an upgrade package generation time, and a firmware version number. S2. The smart meter parses and obtains the module identifier, decryption key identifier, signature verification public key identifier and upgrade package generation time from the metadata area. It performs decryption circuit breaker verification, signature circuit breaker verification and generation time verification for the module. If all three verifications pass, it proceeds to S3. S3. Obtain the pre-master key from the decryption information encapsulation area according to the decryption key identifier, derive the decryption key through the key derivation function KDF, and decrypt the signature information encapsulation area and payload area with the decryption key. If the decryption is successful, proceed to S4. S4. Obtain the actual upgrade package signature verification public key from the decrypted signature information encapsulation area according to the signature verification public key identifier. Perform signature verification on the metadata area, decrypted information encapsulation area and payload area using the actual upgrade package signature verification public key. If the signature verification passes, proceed to S5. S5. Based on the decryption key identifier and signature verification public key identifier of the upgrade package, circuit breakers are applied to decryption circuit breakers with values lower than the decryption key identifier and to signature circuit breakers with values lower than the signature verification public key identifier.
[0006] Furthermore, the smart meter is equipped with: a pre-set decryption key, a pre-set signature verification public key, and an upgrade security policy circuit breaker schedule for each module. The area containing these three sets of information is configured as a one-time programmable area, namely the OTP area. The preset decryption keys include a preset symmetric key, a preset ECDH private key, and a preset ML_KEN private key. These three keys exist in the meter in the form of encryption by the hardware-unique key HUK. Pre-configured signature verification public keys, including a pre-configured ECDSA public key and a pre-configured ML_DSA public key; The upgrade security strategy circuit breaker schedule for each module includes three circuit breaker points. The circuit breaker schedule is set according to the security requirements of each module. Two preset decryption key circuit breakers are used to circuit break the preset key and the ECDH key; A signature circuit breaker bit is used to circuit breaker the ECDSA public key.
[0007] Furthermore, in S2, before performing the three verifications, the smart meter obtains the current time and the upgrade security policy circuit breaker schedule of the target module, performs circuit breaker on the preset decryption key bit and signature circuit breaker bit; and obtains the last successful upgrade time of the target module stored locally.
[0008] Furthermore, in S2, the decryption circuit breaker verification, signature circuit breaker verification, and generation time verification include: Determine whether the decryption circuit breaker bit corresponding to the decryption key identifier has been circuit-broken to obtain the decryption circuit breaker verification result; determine whether the signature circuit breaker bit corresponding to the signature verification public key identifier has been circuit-broken to obtain the signature circuit breaker verification result; determine whether the upgrade package generation time is earlier than the last successful upgrade time to obtain the generation time verification result.
[0009] Furthermore, the decryption information encapsulation area described in S3 changes according to the decryption key identifier in the metadata area: When the decryption key identifier is 0 (preset symmetric key), the decryption information encapsulation area is empty, and the pre-stored preset symmetric key is obtained from the OTP area as the pre-master key. When the decryption key identifier is 1, which is a preset ECDH private key, the decryption information encapsulation area is the ECDH public key of the upgrade package publisher. The smart meter negotiates the pre-master key through the preset ECDH private key and the publisher's ECDH public key. When the decryption key identifier is 2, the pre-set ML_KEN private key, the decryption information encapsulation area is the pre-master key encapsulated by the ML_KEN public key. The smart meter obtains the pre-set ML_KEN private key to decapsulate the encapsulated pre-master key and obtains the pre-master key in plaintext state.
[0010] Furthermore, the preset symmetric key exists in the form of being encrypted by the hardware unique key HUK. The preset symmetric key encrypted by the hardware unique key HUK is decrypted to obtain the plaintext preset symmetric key.
[0011] Furthermore, the derivation of the decryption key via the key derivation function KDF described in S3 includes: A pseudo-random key PRK is generated by the hash-based message authentication code key derivation and extraction algorithm HKDF-Extract. The HKDF-Extract algorithm uses the pre-master key as the source key material and the upgrade package generation time as the salt value. The pseudo-random key PRK is expanded using the hash-based message authentication code key derivation expansion algorithm HKDF-expand to obtain the upgrade package decryption key OKM = T(1) | T(2) | ... | T(N), where T(0) = module identifier | firmware version number, T(i) = HMAC-Hash(PRK, T(i-1) | i); where T(1) is used to decrypt the signature information encapsulation area, and T(N) is used to decrypt the N-1th payload area; HMAC represents hash-based message authentication code, N represents the number of upgrade package segments, and i represents the upgrade package segment number, i∈(1,N); where HMAC-Hash is generally written as HMAC-SHA256, HMAC-SHA3-512 to indicate the specific algorithm used.
[0012] Furthermore, the step S4, which describes obtaining the signature verification algorithm and verification public key from the decrypted signature information encapsulation area based on the signature verification public key identifier, includes: Extract the pre-set signature public key usage information, the actual upgrade package signature verification public key and its signature value, and the upgrade package signature value from the decrypted signature information encapsulation area; When the preset signature public key usage information is 1, the upgrade package is directly signed and verified to determine that the actual upgrade package signature verification public key is empty; the locally stored preset signature verification public key is obtained as the verification public key, and the upgrade package and the upgrade package signature value are signed and verified through the verification public key. If the preset signature public key usage information is 2, obtain the locally stored preset signature verification public key to verify the actual upgrade package signature verification public key; if the verification is successful, further compare the actual upgrade package signature verification public key with the signature verification public key identifier; if they match, determine the actual upgrade package signature verification public key as the verification public key, and use the actual upgrade package signature verification public key to verify the upgrade package and the upgrade package signature value.
[0013] Secondly, the present invention provides a system for differentiated security upgrades of smart meter modules, the system being configured to perform the method described.
[0014] Thirdly, the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed, implements the method described thereon.
[0015] The beneficial effects of this invention are: This invention constructs a structured upgrade package containing a metadata area, a decryption information encapsulation area, a signature information encapsulation area, and a payload area. It introduces a multimodal key acquisition mechanism, a layered signature verification mechanism, and a time-based dynamic circuit breaker access mechanism. On the basis of effectively preventing the risks of key leakage, data tampering, and version rollback, it realizes differentiated security protection and refined management of the upgrade of each module of the smart meter, while taking into account the smooth upgrade of the algorithm, so that the upgrade of each module achieves a balance between security and performance.
[0016] Other features and advantages of the present invention will be described in detail in the following detailed description section. Attached Figure Description
[0017] The above and other objects, features and advantages of the present invention will become more apparent from the more detailed description of exemplary embodiments of the invention in conjunction with the accompanying drawings, wherein the same reference numerals generally represent the same components in the exemplary embodiments of the invention.
[0018] Figure 1 A schematic diagram of the structure of a smart meter upgrade package according to an embodiment of the present invention is shown.
[0019] Figure 2 A flowchart of a method for differentiated security upgrade of a smart meter module according to an embodiment of the present invention is shown. Detailed Implementation
[0020] Preferred embodiments of the invention will now be described in more detail with reference to the accompanying drawings. While preferred embodiments of the invention are shown in the drawings, it should be understood that the invention can be implemented in various forms and should not be limited to the embodiments set forth herein.
[0021] This embodiment provides a method for differentiated security upgrades of various modules in a smart meter. This method is used on smart meters where different modules can be upgraded individually. The smart meter can determine which module the upgrade package belongs to based on the received upgrade package information, and determine whether the upgrade package meets the security upgrade requirements based on the current upgrade security circuit breaker status of the module in the smart meter, and perform differentiated security verification.
[0022] In this method, the main structure of the upgrade package is as follows: Figure 1 As shown, it includes a metadata area, a decryption information encapsulation area, a signature information encapsulation area, and a payload area. The metadata is divided into: module identifier, decryption information identifier, signature information identifier, upgrade package generation time, and firmware version number.
[0023] Smart meters are pre-configured with a decryption key, a pre-configured signature verification public key, and a circuit breaker schedule for security policies during module upgrades. These three sets of information are located in an area designated as the OTP zone. The pre-set decryption keys include a pre-set symmetric key, a pre-set ECDH private key (elliptic curve Diffie-Hellman private key), and a pre-set ML_KEN private key (Module-Lattice-Based Key-Encapsulation Mechanism private key). These three keys exist within the meter in a HUK-encrypted form. The pre-set signature verification public keys include a pre-set ECDSA public key (elliptic curve digital signature algorithm public key) and a pre-set ML_DSA public key (Module-Lattice-Based Digital Signature Algorithm Public Key). The circuit breaker schedule for each module includes two pre-set decryption key circuit breaker bits for circuit breaking the pre-set key and ECDH key, and one signature circuit breaker bit for circuit breaking the ECDSA public key. These three circuit breaker bits are configured according to the security requirements of each module.
[0024] After receiving the upgrade package, the specific process for verifying the upgrade package is as follows: Figure 2 As shown, it specifically includes the following 6 steps: The smart meter parses the module identifier in the metadata area, and performs circuit breaking of the preset decryption key circuit breaking bit and signature key circuit breaking bit according to the current time of the smart meter and the circuit breaking time schedule of the module upgrade security policy, and obtains the last successful upgrade time of the module.
[0025] The smart meter parses the decryption information identifier and the signature verification public key identifier, and performs decryption circuit breaker and signature circuit breaker access verification for the module. If the verification is successful, proceed to the next step. If the decryption information identifier has been circuit breaker, record upgrade failure event 1: module upgrade blocked by decryption circuit breaker; if the signature verification public key identifier has been circuit breaker, record upgrade failure event 2: module upgrade blocked by signature circuit breaker.
[0026] The smart meter analyzes the upgrade package generation time. If the generation time is earlier than the last upgrade time of the module recorded in the meter, then upgrade failure event 3 is recorded: module upgrade package time abnormal.
[0027] The smart meter obtains the pre-master key of the upgrade package based on the decryption information identifier and decryption information encapsulation area in the metadata area, derives the decryption key through KDF, and decrypts the signature information sub-encapsulation area and payload area. If the decryption is successful, it proceeds to S4; otherwise, it records event 4: module upgrade package decryption failed.
[0028] The decryption information encapsulation area changes according to the decryption key identifier in the metadata area: When the decryption information identifier is 0 (pre-set symmetric key), the decryption information encapsulation area is empty, and the pre-set symmetric key is directly used as the pre-master key; when the decryption information identifier is 1 (pre-set ECDH private key), the decryption information encapsulation area contains the ECDH public key of the upgrade package publisher, and the smart meter negotiates the pre-master key using the pre-set ECDH private key and the publisher's ECDH public key; when the decryption information identifier is 2 (pre-set ML_KEN private key), the decryption information encapsulation area contains the pre-master key encapsulated with the ML_KEN public key, and the smart meter uses the pre-set ML_KEN private key to decapsulate the encapsulated pre-master key to obtain the pre-master key, and then derives the upgrade package decryption key from the master key. 1. Use the HKDF-Extract algorithm to generate a pseudo-random key PRK. The algorithm uses the pre-master key as the source key material and the upgrade package generation time as the salt value.
[0029] 2. Use the HKDF-expand algorithm to expand the key and obtain the final upgrade package decryption key OKM = T(1) |T(2) | ... | T(N), where T(0) = module identifier | firmware version number, T(i) = HMAC-Hash(PRK, T(i-1)| i); where T(1) is used to decrypt the signature information encapsulation area, and T(N) is used to decrypt the N-1th payload area; N represents the number of upgrade package segments, i represents the upgrade package segment number, i∈(1,N), where HMAC represents the hash-based message authentication code; HMAC-Hash is generally written as HMAC-SHA256, HMAC-SHA3-512 to indicate the specific algorithm used.
[0030] For example, if the upgrade package payload area is 66Kbyte, and it is divided into 2Kbyte segments, then the payload area is divided into a total of 33 segments. In addition, the decryption signature information encapsulation area is the first segment, and the upgrade package is divided into a total of 34 segments. Then N is 34, i∈(1,34), T(1) is used to decrypt the signature information encapsulation area, T(1) is used to decrypt the 2Kbyte data of the first segment of the payload area, and T(34) is used to decrypt the 2Kbyte data of the last segment (segment 33) of the payload area.
[0031] The smart meter obtains the signature verification algorithm and upgrade package verification public key based on the signature verification public key identifier in the metadata area and the decrypted signature information encapsulation area. It then performs upgrade package signature verification on the metadata area, decrypted information encapsulation area, and payload area. If the signature verification is successful, the upgrade package is set to successful parsing; otherwise, upgrade failure event 5 is recorded: module upgrade package signature verification failed.
[0032] The signature information encapsulation area includes three regions: 1. Pre-set signature public key purpose, 2. Actual upgrade package signature verification public key and its signature value, and 3. Upgrade package signature value.
[0033] The pre-configured signature public key has two uses: 1. to directly verify the signature of the upgrade file; 2. to verify the signature of the upgrade file using the signature verification public key.
[0034] When the preset signature public key is used for purpose 1, the 2 in the signature information encapsulation area is empty. The smart meter directly uses the preset signature public key to verify the upgrade package and its signature value.
[0035] When the preset signature public key is used for purpose 2, the preset signature public key is used to verify the actual upgrade package signature verification public key. If the verification is successful and the actual upgrade package signature verification public key is consistent with the signature verification public key identifier, then the actual upgrade package signature verification public key is used to verify the upgrade package and the upgrade package signature value.
[0036] The smart meter uses the decryption key identifier and signature verification public key identifier in the module upgrade package to trigger the decryption circuit breaker for bits lower than the decryption key identifier and the signature circuit breaker for bits lower than the signature verification public key identifier.
[0037] The decryption key identifiers are categorized into three types based on security level, from lowest to highest: pre-set symmetric key, ECDH key negotiation, and ML_KEM key encapsulation. The smart meter will sequentially fuse the pre-set symmetric key and ECDH key of each module according to the module's fuse schedule to mitigate the risks of key leakage and algorithm obsolescence. Similarly, the signature verification public key identifiers are categorized into ECDSA and ML_DSA based on security level, from lowest to highest. Each module has one ECDSA fuse bit, which fuses at a set time to mitigate the risk of algorithm obsolescence.
[0038] The various embodiments of the present invention have been described above. These descriptions are exemplary and not exhaustive, nor are they limited to the disclosed embodiments. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described embodiments.
Claims
1. A method for differentiated security upgrades of smart meter modules, characterized in that, include: S1. The smart meter obtains an upgrade package, which includes a metadata area, a decryption information encapsulation area, a signature information encapsulation area, and a payload area. The metadata area includes a module identifier, a decryption key identifier, a signature verification public key identifier, an upgrade package generation time, and a firmware version number. S2. The smart meter parses and obtains the module identifier, decryption key identifier, signature verification public key identifier and upgrade package generation time from the metadata area. It performs decryption circuit breaker verification, signature circuit breaker verification and generation time verification for the module. If all three verifications pass, it proceeds to S3. S3. Obtain the pre-master key from the decryption information encapsulation area according to the decryption key identifier, derive the decryption key through the key derivation function KDF, and decrypt the signature information encapsulation area and payload area with the decryption key. If the decryption is successful, proceed to S4. S4. Obtain the actual upgrade package signature verification public key from the decrypted signature information encapsulation area according to the signature verification public key identifier. Perform signature verification on the metadata area, decrypted information encapsulation area and payload area using the actual upgrade package signature verification public key. If the signature verification is successful, proceed to S5. S5. Based on the decryption key identifier and signature verification public key identifier of the upgrade package, circuit breakers are applied to decryption circuit breakers with values lower than the decryption key identifier and to signature circuit breakers with values lower than the signature verification public key identifier.
2. The method as described in claim 1, characterized in that, The smart meter is equipped with: a pre-set decryption key, a pre-set signature verification public key, and an upgrade security policy circuit breaker timetable for each module. The area containing these three sets of information is configured as a one-time programmable area, namely the OTP area. The preset decryption keys include a preset symmetric key, a preset ECDH private key, and a preset ML_KEN private key. These three keys exist in the meter in the form of encryption by the hardware-unique key HUK. Pre-configured signature verification public keys, including a pre-configured ECDSA public key and a pre-configured ML_DSA public key; The upgrade security strategy circuit breaker schedule for each module includes three circuit breaker points. The circuit breaker schedule is set according to the security requirements of each module. Two preset decryption key circuit breakers are used to circuit break the preset key and the ECDH key; A signature circuit breaker bit is used to circuit breaker the ECDSA public key.
3. The method as described in claim 2, characterized in that, In S2, before performing the three verifications, the smart meter obtains the current time and the upgrade security policy circuit breaker schedule of the target module, performs circuit breaker on the preset decryption key bit and signature circuit breaker bit; and obtains the last successful upgrade time of the target module stored locally.
4. The method as described in claim 3, characterized in that, In S2, the decryption circuit breaker verification, signature circuit breaker verification, and generation time verification include: Determine whether the decryption circuit breaker bit corresponding to the decryption key identifier has been circuit-broken to obtain the decryption circuit breaker verification result; determine whether the signature circuit breaker bit corresponding to the signature verification public key identifier has been circuit-broken to obtain the signature circuit breaker verification result; determine whether the upgrade package generation time is earlier than the last successful upgrade time to obtain the generation time verification result.
5. The method as described in claim 1, characterized in that, The decryption information encapsulation area described in S3 changes according to the decryption key identifier in the metadata area: When the decryption key identifier is 0 (preset symmetric key), the decryption information encapsulation area is empty, and the pre-stored preset symmetric key is obtained from the OTP area as the pre-master key. When the decryption key identifier is 1, which is a preset ECDH private key, the decryption information encapsulation area is the ECDH public key of the upgrade package publisher. The smart meter negotiates the pre-master key through the preset ECDH private key and the publisher's ECDH public key. When the decryption key identifier is 2, the pre-set ML_KEN private key, the decryption information encapsulation area is the pre-master key encapsulated by the ML_KEN public key. The smart meter obtains the pre-set ML_KEN private key to decapsulate the encapsulated pre-master key and obtains the pre-master key in plaintext state.
6. The method as described in claim 5, characterized in that, The preset symmetric key exists in the form of being encrypted by the hardware unique key HUK. The preset symmetric key encrypted by the hardware unique key HUK is decrypted to obtain the plaintext preset symmetric key.
7. The method as described in claim 1, characterized in that, The decryption key derived through the key derivation function KDF as described in S3 includes: A pseudo-random key PRK is generated by the hash-based message authentication code key derivation and extraction algorithm HKDF-Extract. The HKDF-Extract algorithm uses the pre-master key as the source key material and the upgrade package generation time as the salt value. The pseudo-random key PRK is expanded using the hash-based message authentication code key derivation expansion algorithm HKDF-expand to obtain the upgrade package decryption key OKM = T(1) | T(2) | ... | T(N), where T(0) = module identifier | firmware version number, T(i) = HMAC-Hash(PRK, T(i-1) | i); where T(1) is used to decrypt the signature information encapsulation area, and T(N) is used to decrypt the N-1th payload area; HMAC represents the hash-based message authentication code, N represents the number of upgrade package segments, and i represents the upgrade package segment number, i∈(1,N).
8. The method as described in claim 1, characterized in that, The method described in S4 for obtaining the signature verification algorithm and verification public key from the decrypted signature information encapsulation area based on the signature verification public key identifier includes: Extract the pre-set signature public key usage information, the actual upgrade package signature verification public key and its signature value, and the upgrade package signature value from the decrypted signature information encapsulation area; When the preset signature public key usage information is 1, the upgrade package is directly signed and verified to determine that the actual upgrade package signature verification public key is empty; the locally stored preset signature verification public key is obtained as the verification public key, and the upgrade package and the upgrade package signature value are signed and verified through the verification public key. If the preset signature public key usage information is 2, obtain the locally stored preset signature verification public key to verify the actual upgrade package signature verification public key; if the verification is successful, further compare the actual upgrade package signature verification public key with the signature verification public key identifier; if they match, determine the actual upgrade package signature verification public key as the verification public key, and use the actual upgrade package signature verification public key to verify the upgrade package and the upgrade package signature value.
9. A system for differentiated security upgrades of smart meter modules, characterized in that, The system is configured to perform the method as described in any one of claims 1-8.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that... When the program is executed, it implements the method as described in any one of claims 1-8.
