Method for realizing legally relevant data protection on the basis of MPU mechanism and electricity meter

By dividing the chip into legal and non-legal storage areas and using the MPU mechanism to protect legal data, the problem of achieving engineering isolation between legal and non-legal data in a single chip is solved, ensuring the security and integrity of legal data while reducing costs.

WO2026102825A1PCT designated stage Publication Date: 2026-05-21JIANGSU LINYANG ENERGY CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
JIANGSU LINYANG ENERGY CO LTD
Filing Date
2024-12-02
Publication Date
2026-05-21

AI Technical Summary

Technical Problem

How to rationally allocate storage areas within a limited storage space on a single chip to achieve isolation between legal and non-legal engineering, ensuring that non-legal engineering cannot access legal data, while considering the physical characteristics of the chip's storage architecture to prevent unauthorized access and reduce costs.

Method used

The chip's storage space is divided into a legal storage area and a non-legal storage area using the MPU mechanism. The legal storage area is protected by the MPU mechanism. A legal security interface thread is set up to handle access requests from non-legal projects. Digital signatures and access control rules are used to ensure legitimacy and prevent non-legal projects from tampering with legal data.

Benefits of technology

It achieves isolation and protection of legal data, prevents direct access to legal data by unauthorized projects, ensures the confidentiality and integrity of legal data, and reduces costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024136102_21052026_PF_FP_ABST
    Figure CN2024136102_21052026_PF_FP_ABST
Patent Text Reader

Abstract

The present invention provides a method for realizing legally relevant data protection on the basis of an MPU mechanism and an electricity meter. By means of MPU protection, safe separation of a legally relevant part and a non-legally relevant part is realized in a single chip, a chip supporting an MPU is divided into two regions, one running a legally relevant project and the other running a non-legally relevant project; and independent RAMs and FLASH are allocated within the chip to the legally relevant project and the non-legally relevant project. By means of the MPU, legally relevant functions, parameters, and data cannot be directly accessed by a non-legally relevant project, and the present invention has good application prospects.
Need to check novelty before this filing date? Find Prior Art

Description

A method for legal data protection based on MPU mechanism and an electricity meter Technical Field

[0001] This invention belongs to the field of electricity meters, and particularly relates to a method and an electricity meter for separating legal and non-legal systems based on the MPU mechanism. Background Technology

[0002] Currently, the EU MID certification standard for measuring instruments, WELMEC Guide 7.2, requires the separation of legal and non-legal functions in software testing. Legal functions include raw data from the energy meter such as electricity consumption, voltage, and current. Non-legal functions include functions that perform secondary processing based on the raw data, such as demand and curves. Modifications to legal functions require recertification, while modifications to non-legal functions do not. Non-legal functions can only access legal data, such as electricity consumption and voltage, through limited interfaces. Non-legal functions cannot directly access data and parameters in the secure area.

[0003] Currently, there are chips on the market that use two chips and support TrustZone functionality, but these solutions are relatively expensive.

[0004] In isolating legal and non-legal engineering processes, allocating appropriate storage areas for both within the limited chip storage space is a significant technical challenge. Legal engineering requires sufficient storage to ensure the storage of critical data and code, while non-legal engineering also needs a certain amount of storage to run necessary functions. Improper storage allocation may cause one of the processes to malfunction. Furthermore, achieving complete isolation between the two processes at the physical storage level of the chip is also a thorny issue when dividing storage areas. This requires considering the physical characteristics of the memory and the chip's storage architecture to prevent unauthorized access to the storage areas of the legal engineering process and ensure the reliability of the isolation. Summary of the Invention

[0005] The purpose of this invention is to address the problem of isolating legal and non-legal engineering processes within a single chip. It proposes a method and energy meter based on an MPU mechanism for legal data protection. In this invention, non-legal functions access legal data through a secure interface in the legal region. Because legal functions and peripherals are protected by the MPU, non-legal functions cannot write their own low-level drivers or forcibly access legal data; this ensures that non-legal functions cannot affect legal data and parameters. Furthermore, this invention employs an MPU mechanism, meaning any chip supporting the M3 core supports MPU functionality, effectively reducing costs.

[0006] The technical solution of this invention is:

[0007] This invention provides a method for legal data protection based on the MPU mechanism, comprising:

[0008] Configure a single chip that supports MPU functionality, and divide the chip's storage space into a legal storage area and a non-legal storage area;

[0009] Legal engineering and non-legal engineering are created within the chip, and the legal engineering is deployed in the legal storage area, while the non-legal engineering is deployed in the non-legal storage area.

[0010] The legal storage area is protected by an MPU mechanism, which prevents non-legal projects from directly accessing the legal storage area.

[0011] The legal engineering project includes a legal thread and a legal security interface thread. The legal security interface thread is used to receive and process access requests from the non-legal engineering project, and to judge the legality of the request according to the preset access control rules. If the request is judged to be legal, access is allowed; otherwise, access is denied.

[0012] Furthermore, the legal system engineering also includes:

[0013] The legal system is protected by digital signatures, and the public key used to verify the signature is stored in the electricity meter to ensure that the legal system can only be upgraded by the predetermined authorized party and to prevent it from being illegally tampered with.

[0014] Furthermore, an asymmetric encryption algorithm is used to sign the binary file of the legal system project using the private key provided by the client, resulting in a digital signature, which is then appended to the binary file of the legal system project.

[0015] Furthermore, the illegal project includes an illegal thread. When creating an illegal thread, the hash value and digital signature of the illegal project carried in the request need to be verified, and the thread priority of the request needs to be checked. Only if the verification passes and the priority is lower than that of the legal thread can the thread be created.

[0016] Furthermore, for operation requests involving the reading of legal data, the legal security interface thread also needs to verify the digital signature carried in the request, and access is only allowed if the verification is successful.

[0017] Furthermore, the peripheral access interface of the chip is protected by the MPU, allowing only legal engineering to access it, thus preventing non-legal engineering from bypassing the security interface to directly operate the peripheral access data.

[0018] Furthermore, the step of protecting the legal storage area using the MPU mechanism includes:

[0019] Configure the MPU's access permission table to assign different access permissions to different threads or processes, and set the access permission of the legal storage area to allow only legal engineering to access it.

[0020] Furthermore, the legal security interface thread is used to receive and process access requests from non-legal engineering projects, including:

[0021] Address range checks are performed on access requests initiated by unauthorized threads to ensure that unauthorized threads can only access FLASH and RAM resources within their own region.

[0022] Requests from unauthorized threads to access data in the legal storage area are subject to signature verification to ensure that only authorized unauthorized functional code can access data in the legal storage area.

[0023] Furthermore, the step of determining the legality of the request based on preset access control rules includes:

[0024] Obtain information such as the source address, destination address, and operation type of the request, and match it with a preset access control list. If a match is found, the request is considered valid; otherwise, the request is considered invalid.

[0025] An electricity meter for legal data protection based on an MPU mechanism is provided. The method described herein includes a single chip that supports MPU functionality. The chip's storage space is divided into a legal storage area and a non-legal storage area. The legal storage area is used to run legal engineering processes, and the non-legal storage area is used to run non-legal engineering processes. Data interaction between the two storage areas is performed through a legal security interface thread.

[0026] The beneficial effects of this invention are:

[0027] This invention uses the MPU mechanism to divide and protect the chip storage space, deploying legal engineering in the protected legal storage area and non-legal engineering in the non-legal storage area, thereby achieving isolation and protection of legal data.

[0028] This invention sets up a legal security interface thread within the legal engineering project to receive and process access requests from unauthorized legal engineering projects. Based on preset access control rules and digital signature verification mechanisms, it controls unauthorized legal engineering projects' access to legal data.

[0029] This invention also provides digital signature protection for legal engineering projects and ensures that legal engineering projects can only be upgraded by authorized parties by storing the public key for verifying the signature within the chip, thus preventing unauthorized tampering.

[0030] This invention utilizes the MPU mechanism to protect the peripheral access interface of the chip, allowing only legal engineering to access it, thus preventing illegal engineering from bypassing the security interface and directly accessing sensitive data.

[0031] This invention effectively solves the security risks faced when legal data coexists with non-legal engineering data within a single chip, and provides a reliable legal data security protection scheme to ensure the confidentiality and integrity of legal data.

[0032] Other features and advantages of the present invention will be described in detail in the following detailed description section. Attached Figure Description

[0033] 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.

[0034] Figure 1 shows a system architecture diagram according to an embodiment of the present invention. Detailed Implementation

[0035] 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.

[0036] Figure 1 shows a system architecture diagram according to an embodiment of the present invention.

[0037] As shown in Figure 1, this invention provides a method for legal data protection based on an MPU mechanism. By using MPU protection, legal and non-legal data are securely separated within a single chip. The chip supporting the MPU is divided into two areas: one area runs legal functions, and the other runs non-legal functions. The legal and non-legal functions are two independent projects, compiled to produce two binary files. The legal project's bin file contains the legal signature. The private key is held by the client, and the public key is stored in a table.

[0038] The legal and non-legal functions are completely separated in terms of RAM and FLASH allocated within the chip, and data interaction between the two processes can only be accessed through a secure interface thread. A legal thread and a legal security interface thread are created within the legal process. Both the legal thread and the legal security interface thread can only be accessed through the privileged mode of the MPU, while the non-legal thread can only be accessed in user mode. However, the non-legal thread can send messages to the legal security interface thread.

[0039] The operating system described in this invention creates threads within the legal function's engineering process. Threads cannot be created without legal mechanisms, but the information used to create such threads is provided by the illegal mechanism. To prevent attacks, the hash value and signature of the illegal mechanism are stored at the end of the illegal mechanism's engineering process. The creation of illegal threads is prohibited when the hash, signature, or thread priority of the illegal mechanism is abnormal.

[0040] The legal security interface of this invention has three functions: 1. Accessing illegal storage; 2. Accessing a security algorithm; 3. Accessing legal data. When accessing illegal storage, the address range of the memory is restricted, allowing access only to the illegal data area. The security algorithm includes encryption and signature algorithms. Accessing legal data includes setting and reading legal data, such as setting time, reading time, and displaying data. No authentication is required when communicating with the algorithm after accessing illegal storage, but a signature is required when accessing legal data. This ensures that modification of illegal data does not affect the functionality of the legal system.

[0041] In this invention, the private key for the signature of the legal system engineering is held by the customer, while the public key is stored in a table. It can only be set within the factory and cannot be modified outside the factory. Upgrading the legal system function requires verifying the correctness of the signature. Because the private key is stored in the table, it ensures that only the customer can upgrade the legal system function, and the meter manufacturer cannot upgrade it, thus guaranteeing that the legal system engineering cannot be rewritten. This ensures the security of the meter's legal system function.

[0042] In this embodiment, the present invention achieves the separation of legal and non-legal security in a single chip through MPU protection, which can effectively distinguish between legal and non-legal areas. Data, parameters, and measurements in the legal area are protected, while the non-legal area cannot be directly accessed, thereby ensuring the security of legal data.

[0043] This invention provides an energy meter that implements legal data protection based on an MPU mechanism. The energy meter includes a single chip that supports MPU functionality. The chip's storage space is divided into a legal storage area and a non-legal storage area. The legal storage area is used to run legal engineering, and the non-legal storage area is used to run non-legal engineering. Data interaction between the two storage areas is performed through a legal security interface thread.

[0044] In this embodiment, the legal functions of the electricity meter include: chip peripherals, interrupts, I / O, EE driver, NOR flash driver, metering function, upgrade function, data security function, and power consumption function. These legal functions can only run within the legal thread, and are protected by the MPU. Unauthorized threads cannot access these functions; when an unauthorized thread needs to access the legal thread, it can only do so by sending a message to the security interface thread. The security interface thread filters the accessed data, memory address, and ID; if the data being accessed is out of bounds, access is prohibited.

[0045] The method of the present invention divides the chip supporting the MPU into two regions: legal engineering and non-legal engineering. Independent RAM and FLASH storage space are allocated for the two engineerings inside the chip to achieve physical isolation.

[0046] There are four ways to rewrite the data and parameters of a non-standard system: 1. Directly operate the chip's peripherals to access the memory; 2. Know the address of the function that drives the standard system's memory write function and directly access the function at that address; 3. Send a message through the standard system's interface; 4. Upgrade and rewrite the standard system's functions.

[0047] In response to the four methods mentioned above, the measures of this invention are as follows: 1. Since the MPU protects the chip's peripherals, unauthorized code cannot directly operate the peripherals, and therefore cannot write its own driver to access the memory protection; 2. The memory driver function is also protected by the MPU. If an unauthorized code uses a pointer to convert to a function address to directly access the memory, it will trigger an MPU interrupt, thus protecting the security of the code; 3. The security interface also requires a signature, which unauthorized code cannot directly rewrite, thus ensuring the security of the code; 4. The signature for upgrading the code is controlled by the customer, and only the customer can upgrade it, which also protects the data and parameters of the code.

[0048] 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 legal data protection based on the MPU mechanism, characterized in that, include: Configure a single chip that supports MPU functionality, and divide the chip's storage space into a legal storage area and a non-legal storage area; Legal engineering and non-legal engineering are created within the chip, and the legal engineering is deployed in the legal storage area, while the non-legal engineering is deployed in the non-legal storage area. The legal storage area is protected by an MPU mechanism, which prevents non-legal projects from directly accessing the legal storage area. The legal engineering project includes a legal thread and a legal security interface thread. The legal security interface thread is used to receive and process access requests from the non-legal engineering project, and to judge the legality of the request according to the preset access control rules. If the request is judged to be legal, access is allowed; otherwise, access is denied.

2. The method for legal data protection based on the MPU mechanism according to claim 1, characterized in that, The legal system project also includes: The legal system is protected by digital signatures, and the public key used to verify the signature is stored in the electricity meter to ensure that the legal system can only be upgraded by the predetermined authorized party and to prevent it from being illegally tampered with.

3. The method for legal data protection based on the MPU mechanism according to claim 2, characterized in that, An asymmetric encryption algorithm is used to sign the binary file of the legal system project using the private key provided by the client, resulting in a digital signature. The generated digital signature is then appended to the binary file of the legal system project.

4. The method for legal data protection based on the MPU mechanism according to claim 1, characterized in that, The illegal project includes an illegal thread. When creating an illegal thread, the hash value and digital signature of the illegal project carried in the request need to be verified, and the thread priority of the request needs to be checked. Only if the verification passes and the priority is lower than that of the legal thread can the thread be created.

5. The method for legal data protection based on the MPU mechanism according to claim 1, characterized in that, For operation requests involving the reading of legal data, the legal security interface thread also needs to verify the digital signature carried in the request, and access is only allowed if the verification is successful.

6. The method for legal data protection based on the MPU mechanism according to claim 1, characterized in that, The peripheral access interface of the chip is protected by the MPU, allowing only legal engineering to access it, thus preventing non-legal engineering from bypassing the security interface to directly operate the peripheral access data.

7. The method for legal data protection based on the MPU mechanism according to claim 1, characterized in that, The steps for protecting the legal storage area using the MPU mechanism include: Configure the MPU's access permission table to assign different access permissions to different threads or processes, and set the access permission of the legal storage area to allow only legal engineering to access it.

8. The method for legal data protection based on the MPU mechanism according to claim 4, characterized in that, The legal security interface thread is used to receive and process access requests from non-legal projects, including: Address range checks are performed on access requests initiated by unauthorized threads to ensure that unauthorized threads can only access FLASH and RAM resources within their own region. Requests from unauthorized threads to access data in the legal storage area are subject to signature verification to ensure that only authorized unauthorized functional code can access data in the legal storage area.

9. The method for legal data protection based on the MPU mechanism according to claim 1, characterized in that, The step of determining the legality of a request based on preset access control rules includes: Obtain information such as the source address, destination address, and operation type of the request, and match it with a preset access control list. If a match is found, the request is considered valid; otherwise, the request is considered invalid.

10. An energy meter for legal data protection based on an MPU mechanism, employing the method described in any one of claims 1-8, characterized in that, The electricity meter includes a single chip that supports MPU functionality. The chip's storage space is divided into a legal storage area and a non-legal storage area. The legal storage area is used to run legal engineering projects, and the non-legal storage area is used to run non-legal engineering projects. Data interaction between the two storage areas is conducted through a legal security interface thread.