Electric energy meter and method for detecting whether memory is replaced based on Root Key

By using Root Key in the power meter to encrypt and decrypt the memory data, the problem of how to detect whether the power meter memory is replaced without increasing the hardware cost is solved, and effective detection and improvement of the safety of the power meter is achieved.

CN119862590APending Publication Date: 2025-04-22JIANGSU LINYANG ENERGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411836281.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-13
Publication Date
2025-04-22

AI Technical Summary

Technical Problem

How to effectively detect whether the power meter memory is replaced without increasing hardware costs to prevent power theft.

Method used

The data in the memory is encrypted and decrypted by using the Root Key, and the comparison is used to determine whether the memory is replaced. The specific steps include randomly generating a Root Key before the power meter leaves the factory, encrypting fixed data with the Root Key and writing it to the memory, using the Root Key to decrypt it during subsequent reading, and determining whether the memory has been replaced by comparing whether the decryption result is consistent with the original data.

Benefits of technology

It realizes effective detection of whether the power meter memory is replaced, improves the safety and reliability of the power meter, and does not require additional hardware and is cheap.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119862590A_ABST
    Figure CN119862590A_ABST
Patent Text Reader

Abstract

The invention provides a Root Key-based electric energy meter and method for detecting whether a memory is replaced, and the method comprises the steps: randomly generating a unique Root Key of each electric energy meter in an MCU of an intelligent electric energy meter, and enabling the Root Key not to be read after leaving a factory; the fixed data is encrypted by the Root Key and then written into the memory, the Root Key is used for decryption during reading, and whether the memory is replaced or not is determined by judging whether the decrypted data is original fixed data or not. According to the method, the Root Key is used for encrypting and decrypting the data in the memory, whether the memory of the electric energy meter is replaced or not can be detected, the cost is low, detection is accurate, and the method has a good application prospect.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of electric energy meters, and more particularly to an electric energy meter for detecting whether a memory has been replaced and a detection method thereof. Background Art

[0002] With the development of society, smart meters are used more and more. As a key device for measuring electricity consumption, the energy meter stores important metering data and parameters in its memory.

[0003] At present, the communication key and meter number of the smart meter are stored in the EE. If the EE of the original meter is placed in the backup meter, the main station will communicate with the backup meter. At this time, the original meter can disconnect the communication module to steal electricity, causing losses to the power bureau and seriously threatening the accuracy and fairness of electricity metering.

[0004] How to effectively detect whether the electricity meter memory has been replaced without increasing hardware costs has become a technical problem that needs to be solved urgently. Summary of the invention

[0005] The purpose of the present invention is to solve the problem of how to effectively detect whether the memory of an electric energy meter has been replaced, and to propose an electric energy meter and method for detecting whether the memory has been replaced based on a Root Key; the Root Key is used to encrypt and decrypt the data in the memory, and whether the memory has been replaced is determined by comparison. The method has low cost, accurate detection, and good application prospects.

[0006] The technical solution of the present invention is:

[0007] The present invention provides an electric energy meter for detecting whether a memory is replaced based on a Root Key, the electric energy meter comprises an MCU and a memory; the MCU is provided with a Root Key generating module, an encryption module, a decryption module and a judgment module, wherein;

[0008] The Root Key generation module is used to randomly generate a Root Key before the electric energy meter leaves the factory, and write the Root Key into the internal storage area of ​​the MCU;

[0009] The encryption module is used to encrypt the fixed data using the Root Key and write the encrypted ciphertext data into the memory;

[0010] The decryption module is used to read the ciphertext data from the memory, and use the Root Key to decrypt the read ciphertext data to obtain decrypted data;

[0011] The judgment module is used to judge whether the decrypted data is consistent with the fixed data. If they are consistent, it is determined that the memory has not been replaced; if they are inconsistent, it is determined that the memory has been replaced.

[0012] A method for detecting whether a memory has been replaced based on a Root Key is applied to the electric energy meter, and the method comprises the following steps:

[0013] A unique Root Key is randomly generated inside the MCU of each smart meter and cannot be read after leaving the factory.

[0014] The fixed data is encrypted with the Root Key and written into the memory. The Root Key is used to decrypt the data when reading. By judging whether the decrypted data is the original fixed data, it is determined whether the memory has been replaced.

[0015] Furthermore, the step of randomly generating a unique Root Key for each smart energy meter inside the smart energy meter MCU includes:

[0016] When programming the software in the smart energy meter MCU offline, the Root Key area data is fixed to all FFs or all 00s;

[0017] After power-on, the Root Key area data is detected in the boot program. If it is all FF or all 00, a random number is used to replace the Root Key value. The length of the Root Key is 16 bytes.

[0018] Furthermore, the step of encrypting the fixed data with the Root Key and writing it into the memory includes:

[0019] Before the smart energy meter leaves the factory, the preset 16-byte original data is encrypted using the Root Key, and the encrypted data is written into a fixed position in the smart energy meter memory.

[0020] Furthermore, the step of using the Root Key to decrypt during reading and determining whether the decrypted data is original fixed data to determine whether the memory has been replaced includes:

[0021] After the smart energy meter leaves the factory, the encrypted data is read from the memory regularly, the Root Key is used to decrypt the read data, and the decrypted result is compared with the preset 16-byte original data. If the comparison is consistent, it is determined that the memory has not been replaced. If the comparison is inconsistent, it is determined that the memory has been replaced.

[0022] Furthermore, the memory includes an EEPROM memory and an external Flash memory, and different fixed data are encrypted and stored in fixed positions of the EEPROM memory and the external Flash memory respectively.

[0023] Furthermore, the 16-byte first data is encrypted by the Root Key and stored in the EEPROM memory, and the 16-byte second data is encrypted by the Root Key and stored in the external Flash memory.

[0024] Furthermore, the periodic reading and decryption is performed for one hour. When the decrypted data is inconsistent with the original data after being read for five consecutive times, it is determined that the corresponding memory has been replaced.

[0025] Beneficial effects of the present invention:

[0026] The present invention discloses an electric energy meter and a method thereof for detecting whether the electric energy meter memory has been replaced based on a Root Key. Aiming at the potential safety hazard that the electric energy meter memory may be illegally replaced, a Root Key is randomly generated in an MCU, and the Key is used to encrypt, store and decrypt fixed data for verification, thereby achieving effective detection of whether the memory has been replaced.

[0027] Specifically, the MCU first encrypts the preset data with the Root Key and writes it into the memory, and then reads and decrypts the data. By comparing the decryption result with the original data, it is determined whether the memory has been replaced. When it is detected that the memory has been replaced, the present invention can also send an alarm message to the main station through the communication module. This method does not require additional hardware, has the advantages of simple implementation and low cost, and effectively improves the safety and reliability of the electric energy meter.

[0028] Other features and advantages of the present invention will be described in detail in the following detailed description. BRIEF DESCRIPTION OF THE DRAWINGS

[0029] The above and other objects, features and advantages of the present invention will become more apparent through a more detailed description of exemplary embodiments of the present invention in conjunction with the accompanying drawings, wherein like reference numerals generally represent like components throughout the exemplary embodiments of the present invention.

[0030] Figure 1 A flow chart of a method for detecting whether a memory is replaced based on a Root Key according to an embodiment of the present invention is shown. DETAILED DESCRIPTION

[0031] The preferred embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. Although the preferred embodiments of the present invention are shown in the accompanying drawings, it should be understood that the present invention can be implemented in various forms and should not be limited to the embodiments set forth herein.

[0032] Example 1

[0033] The present invention provides an electric energy meter for detecting whether a memory is replaced based on a Root Key, the electric energy meter comprises an MCU and a memory; the MCU is provided with a Root Key generating module, an encryption module, a decryption module and a judgment module, wherein;

[0034] The Root Key generation module is used to randomly generate a Root Key before the electric energy meter leaves the factory, and write the Root Key into the internal storage area of ​​the MCU;

[0035] The encryption module is used to encrypt the fixed data using the Root Key and write the encrypted ciphertext data into the memory;

[0036] The decryption module is used to read the ciphertext data from the memory, and use the Root Key to decrypt the read ciphertext data to obtain decrypted data;

[0037] The judgment module is used to judge whether the decrypted data is consistent with the fixed data. If they are consistent, it is determined that the memory has not been replaced; if they are inconsistent, it is determined that the memory has been replaced.

[0038] In one example, the Root Key generation module includes: a random number generation unit, used to generate the Root Key by random number method; and a Root Key writing unit, used to write the Root Key into the internal storage area of ​​the MCU.

[0039] In one example, the encryption module is specifically used to: use the Root Key and adopt a symmetric encryption algorithm to encrypt the preset fixed data to obtain the ciphertext data.

[0040] In one example, the decryption module is specifically used to: use the Root Key and adopt the same symmetric encryption algorithm as the encryption module to decrypt the ciphertext data to obtain the decrypted data.

[0041] In one example, the electric energy meter further includes a communication module, and the MCU is further configured to send memory abnormality alarm information to a master station through the communication module when it is determined that the memory has been replaced.

[0042] Example 2

[0043] Figure 1 A flow chart of a method for detecting whether a memory is replaced based on a Root Key according to an embodiment of the present invention is shown.

[0044] like Figure 1As shown, the present invention provides a method for detecting whether a memory has been replaced based on a Root Key, and using the electric energy meter, the method comprises the following steps:

[0045] Generate a Root Key randomly through the Root Key generation module, and write the Root Key into the internal storage area of ​​the MCU;

[0046] The encryption module encrypts the preset fixed data using the Root Key, and writes the encrypted ciphertext data into a preset location of the memory;

[0047] The decryption module reads ciphertext data from a preset position of the memory, and uses the RootKey to decrypt the read ciphertext data to obtain decrypted data;

[0048] The judgment module determines whether the decrypted data is consistent with the preset fixed data. If they are consistent, it is determined that the memory has not been replaced. If they are inconsistent, it is determined that the memory has been replaced.

[0049] The Root Key encrypts and decrypts the fixed data in the memory by first encrypting a fixed string of data with the Root Key and then writing it to the memory. When reading, it is decrypted with the Root Key and then it is determined whether it is the previous fixed value, so as to determine whether the memory has been replaced.

[0050] The Root Key is generated by fixing the Root Key area data to FF during offline programming of the software in the meter MCU. After power-on, the boot is used to detect whether the Root Key value is all 0xFF or 0x00. If so, a random value is used to replace the Root Key value. The length of the Root Key is 16 bytes.

[0051] The Root Key is used to encrypt and decrypt the fixed data in the memory. The Root Key is used to encrypt the 16-byte original data before the meter leaves the factory. Then it is written into the memory. After the meter leaves the factory, the data in the memory is read out regularly and then decrypted using the Root Key to see if it is consistent with the original 16-byte data. If it is consistent, the memory has not been replaced. If it is inconsistent, the memory has been replaced.

[0052] Specifically, the electricity meter has EE and external flash. We can encrypt 16 0x55s with Root Key in the factory and then write them into EE. We can encrypt 16 0xAAs with Root Key and then write them into external flash. Then read them every hour. When the data in EE is not 16 0x55s after decryption by Root Key for 5 consecutive times, it is considered that EE has been replaced. When the data in external flash is not 16 0xAA after decryption by Root Key for 5 consecutive times, it is considered that external flash has been replaced.

[0053] The embodiments of the present invention have been described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and changes will be apparent to those skilled in the art without departing from the scope and spirit of the described embodiments.

Claims

1. An electric energy meter based on Root Key to detect whether the memory has been replaced, characterized in that The electric energy meter includes an MCU and a memory; the MCU is provided with a Root Key generation module, an encryption module, a decryption module and a judgment module, wherein; The Root Key generation module is used to randomly generate a Root Key before the electric energy meter leaves the factory, and write the Root Key into the internal storage area of ​​the MCU; The encryption module is used to encrypt the fixed data using the Root Key and write the encrypted ciphertext data into the memory; The decryption module is used to read the ciphertext data from the memory, and use the Root Key to decrypt the read ciphertext data to obtain decrypted data; The judgment module is used to judge whether the decrypted data is consistent with the fixed data. If they are consistent, it is determined that the memory has not been replaced; if they are inconsistent, it is determined that the memory has been replaced.

2. A method for detecting whether a memory has been replaced based on a Root Key, applied to the electric energy meter according to claim 1, characterized in that: The method comprises the following steps: A unique Root Key is randomly generated inside the MCU of each smart meter and cannot be read after leaving the factory. The fixed data is encrypted with the Root Key and written into the memory. The Root Key is used to decrypt the data when reading. By judging whether the decrypted data is the original fixed data, it is determined whether the memory has been replaced.

3. The method for detecting whether a memory has been replaced based on Root Key according to claim 2, characterized in that: The step of randomly generating a unique Root Key for each smart energy meter inside the smart energy meter MCU includes: When programming the software in the smart energy meter MCU offline, the Root Key area data is fixed to all FFs or all 00s; After power-on, the Root Key area data is detected in the boot program. If it is all FF or all 00, a random number is used to replace the Root Key value. The length of the Root Key is 16 bytes.

4. The method for detecting whether a memory has been replaced based on Root Key according to claim 2, characterized in that: The step of encrypting the fixed data with the Root Key and writing it into the memory comprises: Before the smart energy meter leaves the factory, the preset 16-byte original data is encrypted using the Root Key, and the encrypted data is written into a fixed position in the smart energy meter memory.

5. The method for detecting whether a memory has been replaced based on Root Key according to claim 2, characterized in that: The step of using the Root Key to decrypt during reading and determining whether the decrypted data is original fixed data to determine whether the memory has been replaced includes: After the smart energy meter leaves the factory, the encrypted data is read from the memory regularly, the Root Key is used to decrypt the read data, and the decrypted result is compared with the preset 16-byte original data. If the comparison is consistent, it is determined that the memory has not been replaced. If the comparison is inconsistent, it is determined that the memory has been replaced.

6. The method for detecting whether a memory has been replaced based on a Root Key according to any one of claims 2 to 5, characterized in that: The memory comprises an EEPROM memory and an external Flash memory, and different fixed data are encrypted and stored in fixed positions of the EEPROM memory and the external Flash memory respectively.

7. The method for detecting whether a memory has been replaced based on Root Key according to claim 6, characterized in that: The 16-byte first data is encrypted by the Root Key and stored in the EEPROM memory, and the 16-byte second data is encrypted by the Root Key and stored in the external Flash memory.

8. The method for detecting whether a memory has been replaced based on Root Key according to claim 7, characterized in that: The period of periodic reading and decryption is 1 hour. When the decrypted data is inconsistent with the original data after being read for 5 consecutive times, it is determined that the corresponding memory has been replaced.