Smart grid terminal group secure communication method and device based on certificateless public key cryptography

By adopting a certificateless public-key cryptography scheme in the smart grid, dynamic group partitioning, hierarchical key negotiation, and fault self-healing are achieved, solving the problems of registration and communication efficiency of smart terminals and improving the security and availability of the system.

CN122001579APending Publication Date: 2026-05-08ELECTRIC POWER RESEARCH INSTITUTE OF STATE GRID SHANDONG ELECTRIC POWER COMPANY +1
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
ELECTRIC POWER RESEARCH INSTITUTE OF STATE GRID SHANDONG ELECTRIC POWER COMPANY
Filing Date
2026-03-09
Publication Date
2026-05-08

AI Technical Summary

Technical Problem

In smart grids, certificateless public key cryptography schemes for smart terminals suffer from problems such as terminal registration mechanisms not being adapted to dynamic group architectures, key negotiation schemes not being layered and adapted, lack of fault self-healing capabilities, and low efficiency of broadcast communication.

Method used

A secure communication method for smart grid terminal groups based on certificateless public key cryptography is adopted. Through system initialization and registration, key negotiation and communication, and fault self-healing stages, dynamic group division, hierarchical key negotiation and lightweight terminal access are realized, and arbitration and fault self-healing are performed using a security gateway.

Benefits of technology

It achieves secure communication for smart grid terminal groups with high security, high availability, and high efficiency, reduces the load on the central system, supports dynamic terminal registration and fault self-healing, and meets the low power consumption requirements of resource-constrained devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122001579A_ABST
    Figure CN122001579A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of network security and cryptography, and discloses an intelligent power grid terminal group security communication method and device based on certificateless public key cryptography, comprising three stages of system initialization and registration, key negotiation and communication, and fault self-healing. A key generation center constructs certificateless public key cryptosystem parameters of elliptic curve cryptography, a security gateway carries out offline registration, an intelligent terminal carries out broadcast registration and is arbitrated and taken over by an intra-group gateway, and encryption communication of a management-gateway layer, a gateway terminal layer and a group broadcast layer is realized by adopting a layered key negotiation architecture. A gateway fault self-healing mechanism of heartbeat detection and arbitration takeover is designed, and meanwhile, a device for realizing the method is matched. Certificate management and key escrow risks are eliminated, the lightweight operation requirement of the terminal is adapted, terminal dynamic registration and gateway fault self-recovery are realized, the broadcast communication efficiency is improved, high communication security, high availability and high efficiency are considered, and the method is suitable for a large-scale smart grid terminal group security communication scene.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of cryptographic information security, specifically to a secure communication method and apparatus for smart grid terminal groups based on certificateless public key cryptography. Background Technology

[0002] With the deepening of smart grid construction, a massive number of smart terminals (such as smart meters, sensors, and distribution terminals) interact with the master station system through communication networks to achieve data exchange and remote control. However, the large number, wide distribution, and limited resources of these terminals pose serious challenges to secure communication. Traditional authentication schemes based on Public Key Infrastructure (PKI) rely on digital certificates, which suffer from problems such as complex certificate management, high storage overhead, and low verification efficiency, making them unsuitable for resource-constrained smart terminals. While Identity-Based Cryptography (IBC) eliminates the need for certificates, its keys are entirely controlled by the Key Generation Center (KGC), posing a serious risk of key escrow. Once the KGC is compromised, the entire network security will be completely compromised.

[0003] To balance certificate-free and key-free escrow, Certificateless Public Key Cryptography (CL-PKC) has been proposed and applied to the security architecture of the power Internet of Things (IoT). CL-PKC avoids both certificate management and key escrow issues by splitting the user's private key into a "partial private key" generated by the KGC and a user-selected "secret value." However, existing CL-PKC solutions still face bottlenecks in smart grid scenarios, including: First, the terminal registration mechanism is not suitable for dynamic group architectures. Existing solutions mostly use point-to-point registration, which cannot support smart terminals automatically discovering and joining neighboring groups after power-on. Especially at the edge of the distribution area, when multiple security gateways coexist, the lack of an effective arbitration mechanism to determine a unique agent can easily lead to registration conflicts or duplicate access. Second, the key negotiation scheme does not adapt to different communication entities in a layered manner. High-security two-way authentication is required between the data processing center and the security gateway, while smart terminals have limited resources and only require lightweight encryption. However, existing CL-PKC protocols often employ a unified negotiation model, rely excessively on long-term private key storage at terminals, or are impractical due to mathematical structural flaws (such as inconsistent shared key materials); third, they lack self-healing capabilities. As the core of the group, if the security gateway fails, all terminals under its jurisdiction will lose secure communication capabilities. Current technologies lack effective automatic takeover and key reconstruction mechanisms after gateway failures, making system availability difficult to guarantee.

[0004] Furthermore, for broadcast-type downlink commands (such as electricity price adjustments and power outage commands), existing solutions mostly use unicast encryption one by one, resulting in low communication efficiency; while simple group key distribution makes it difficult to guarantee forward security and member traceability. Summary of the Invention

[0005] The purpose of this invention is to provide a secure communication method and device for smart grid terminal groups based on certificateless public key cryptography, which supports dynamic group partitioning, hierarchical key negotiation, lightweight terminal access, and fault self-healing. It achieves a balance of high security, high availability, and high efficiency while ensuring that there are no certificates or key escrow.

[0006] To achieve the above objectives, the present invention employs the following technical solutions.

[0007] A secure communication method for smart grid terminal groups based on certificateless public key cryptography is applied to a smart grid system including a data processing center, a key generation center (KGC), multiple security gateways (SG), and a large number of smart terminals (ST). All smart terminals and security gateways are divided into groups, with multiple smart terminals and several security gateways forming a group, and different groups are logically isolated from each other. The method includes three stages: system initialization and registration, key negotiation and communication, and fault self-healing. The system initialization and registration include: S1. The key generation center establishes system parameters based on elliptic curve cryptography (ECC) certificateless public key cryptography system. The system parameters include the system master key and public system parameters. S2. The security gateway to be registered sends a registration request to the KGC through a secure offline channel. The registration request includes the identity identifier and network address information of the security gateway to be registered. The KGC verifies whether the identity identifier of the security gateway to be registered exists in the stored security gateway pre-registration list. If the security gateway does not exist, the KGC rejects the registration request, and the registration ends; otherwise, the KGC generates a partial private key for the security gateway to be registered and securely sends the partial private key and the system's public parameters to the security gateway to be registered; at the same time, the KGC moves the information of the security gateway to be registered from the security gateway pre-registration list to the security gateway access list and stores its partial private key and network address information; in addition, the KGC also sends the identity information of other security gateways that have successfully registered in the group to which the security gateway to be registered belongs to the security gateway to be registered. The security gateway to be registered generates a random master key, constructs a complete private key, calculates the public key component corresponding to the random master key, and constructs a complete public key. S3. The smart terminal registers online via local broadcast. After the smart terminal is powered on and joins the group network, it broadcasts a registration request locally. The registration request includes the identity identifier of the smart terminal. All security gateways within the group network receive registration requests and determine the winner locally through arbitration. The winning security gateway forwards the identity information of the smart terminal to the KGC for verification, while the other non-winning security gateways discard the broadcast registration request; If KGC fails to verify the identity information of the smart terminal, it will refuse to process the registration request and the registration will end; otherwise, KGC will authorize the winner security gateway to take over the smart terminal and move the identity information of the smart terminal from the smart terminal pre-registration list to the winner security gateway takeover list. The Winner Security Gateway receives the authorization information and adds the identity information of the smart terminal to its local takeover list; at the same time, the Winner Security Gateway returns confirmation information to the KGC and sends the system public parameters to the smart terminal. KGC receives and confirms the confirmation information returned by the winner security gateway, and the smart terminal receives and saves the publicly available system parameters; The key negotiation and communication include: S4. The data processing center and the security gateway perform certificateless public-key cryptographic two-party authentication key negotiation to generate a management-gateway layer session key and encrypt communication based on this key: The two communicating parties perform a two-party authentication key negotiation using high-security certificateless public key cryptography (CL-PKC) to generate a management-gateway layer session key, which is then added to the management-gateway layer session key list maintained locally by both communicating parties. The management-gateway layer session key list contains the management-gateway layer session key and the identity information of the communicating parties. When the two parties communicate, the initiator uses the corresponding management-gateway layer session key to symmetrically encrypt the communication data, and then appends a message authentication code (MAC) generated based on the management-gateway layer session key to the ciphertext before sending it. The receiver verifies the message authentication code, and after successful authentication, decrypts it using the management-gateway layer session key. S5. The security gateway and the smart terminal taking over the control derive the gateway-terminal layer session key through elliptic curve Diffie-Hellman (ECDH) and identity binding, and add it to the gateway-terminal layer session key list maintained locally by both parties. The gateway-terminal layer session key list contains the gateway-terminal layer session key and the identity information of the communicating parties. When the security gateway and the takeover smart terminal communicate point-to-point, the initiator uses the corresponding gateway-terminal layer session key to perform lightweight symmetric encryption, and appends a message authentication code (MAC) generated based on the gateway-terminal layer session key to the ciphertext before sending it; the receiver verifies the message authentication code, and decrypts it using the management-gateway layer session key after successful authentication. S6. The security gateway and all the smart terminals it manages jointly participate in an ECC-based group authentication key negotiation protocol, with each smart terminal generating a temporary public key. The security gateway aggregates the temporary public keys of all the smart terminals it manages and calculates a shared group session key. When the security gateway broadcasts a downlink command to all the smart terminals it manages, the security gateway uses the shared group session key to symmetrically encrypt the downlink command and appends a message authentication code (MAC) generated based on the shared group session key to the ciphertext before sending it. Each smart terminal verifies the message authentication code, and after successful authentication, decrypts it using the shared group session key. The fault self-healing includes: S7. The security gateway continuously broadcasts a light heartbeat. After the data processing center does not receive a heartbeat from a certain security gateway for several consecutive cycles, it triggers the security gateway's fault self-healing process. The remaining healthy security gateways initiate arbitration within a fixed time window. The winner of each arbitration takes over the security gateway in the list of smart terminals in turn. The healthy security gateway and the newly taken-over security gateway re-establish point-to-point key negotiation.

[0008] Furthermore, the system master key is derived from an integer modulo elliptic curve prime number. multiplication group Random numbers selected from ; The publicly available system parameters include elliptic curve base points. prime order of elliptic curves System public key The first hash function used for identity mapping The second hash function used for key derivation and a third hash function used to generate key confirmation messages. The base point of the elliptic curve belongs to a prime-order cyclic group. The first hash function is a hash function that maps a binary string of arbitrary length to the prime-order cyclic group. The second hash function is a hash function that maps points in the prime-order cyclic group to a fixed-length binary string. The third hash function is a regular hash function; The publicly available system parameters are sent to the data processing center and all registered security gateways and smart terminals within the system.

[0009] Furthermore, the key generation center stores and maintains a security gateway pre-registration list and a security gateway access list. The security gateway pre-registration list contains the identity identifiers and pre-assigned group identifiers of legitimate but unregistered security gateways, and the security gateway access list contains the identity identifiers, group identifiers, and corresponding partial private keys of successfully registered security gateways. The private key generated by the key generation center is , This serves as the identity identifier for the security gateway; Random master key of security gateway For the multiplication group of elliptic curve prime order modulo integers The random number selected from the list; The complete private key of the security gateway It consists of a random master key and a portion of the private key; The public key component of the security gateway is ; Full public key It consists of the identity identifier and public key component of the security gateway.

[0010] Furthermore, the key generation center stores and maintains a pre-registered list of smart terminals and a smart terminal takeover list of each registered security gateway. The pre-registered list of smart terminals contains the identity identifiers of legitimate but unregistered smart terminals, and the smart terminal takeover list contains the identity identifiers of smart terminals taken over by the corresponding security gateway. The steps for determining the winner through group-wide security gateway arbitration are as follows: All security gateways that receive registration requests automatically become candidate security gateways. Candidate security gateways broadcast their own proposals and collect proposals from other candidate security gateways within a fixed time window. The proposals include identity information, current load rate, and timestamp information. After the fixed time window expires, the candidate security gateway stops receiving proposals from other candidate security gateways, calculates its own score and the score of all received proposals using a deterministic arbitration scoring function, and the gateway with the highest score is the winner and forwards the terminal registration request to the key generation center. The other gateways ignore the registration request.

[0011] Furthermore, if multiple winners are generated by local arbitration among the candidate security gateways, each winner forwards the registration request of the smart terminal to the key generation center. After receiving the request, if the key generation center verifies that the smart terminal is legitimate and has not been authorized to register, it authorizes the security gateway currently forwarding the request to take over the smart terminal; otherwise, it ignores the registration verification request.

[0012] Furthermore, the steps for two-party authentication key negotiation in certificateless public-key cryptography are as follows: In the first round of communication, communicator A generates a multiplicative group of integer modulo elliptic curve prime order. Temporary private key And calculate the corresponding temporary public key. The identity identifier of communication party A Public key components Temporary public key Send to communicator B; In the second round of communication, party B generates a temporary private key with the same rules. And calculate the corresponding temporary public key The communicating party B then calculates the shared key material. , This is the random master key for communication party B. pass Calculated; the communication party B derives the session key through the second hash function. A key confirmation message is generated using a third hash function. Then, the identity identifier of communication party B. Public key components Temporary public key Key confirmation message Send to communication party A; In the third round of communication, party A calculates the shared key material according to the same rules. And derive session key , Communication party A verifies the key confirmation message from communication party B. If verification fails, the protocol terminates; if verification succeeds, a key confirmation message is generated and sent. To Communication Party B; Communication Party B Verification After successful verification, both parties confirm the use of the same session key. As the management-gateway layer session key.

[0013] Furthermore, the steps for the security gateway and the takeover smart terminal to perform key negotiation based on elliptic curve Diffie-Hellman and identity binding derivation are as follows: Both communicating parties A and B generate temporary private keys within the multiplicative group of integer modulo elliptic curve prime order. , And calculate the corresponding temporary public key. , After exchanging temporary public keys, each party calculates the elliptic curve scalar multiplication result of its own temporary private key and the other party's temporary public key as the shared key material. Finally, the shared key material and the identities of both parties are jointly processed using a second hash function to derive the gateway-terminal layer session key. .

[0014] Furthermore, when any smart terminal in the group is revoked or abnormally offline, its takeover gateway removes it from the list of active members and immediately updates the shared group session key; the new key is distributed only to the remaining legitimate smart terminals through a point-to-point secure channel; the key generation center updates the long-term key of the security gateway periodically or when a security event is triggered and re-executes the full-process key negotiation.

[0015] This invention also proposes a secure communication device for a smart grid terminal group based on certificate-free public-key cryptography, comprising: The system initialization unit is used by the key generation center to generate and publish system parameters for a certificateless public-key cryptosystem based on elliptic curve cryptography. The registration management unit is used to execute offline registration of security gateways, online broadcast registration of smart terminals, and arbitration takeover authorization processes for security gateways within groups; The key negotiation unit, integrated into the security gateway, supports cross-group two-party key negotiation, group broadcast key negotiation, and smart terminal point-to-point key negotiation; The encrypted communication unit is used to encrypt communication data based on the session keys at each level and attach a message authentication code, while also verifying and decrypting the message authentication code of the received ciphertext. The key update unit responds to timing policies, member changes, or security alarms to trigger key rotation and secure distribution at all levels. The fault takeover unit is used to detect security network key bounces, trigger fault self-healing processes, and complete the takeover and key negotiation reconstruction of faulty gateway terminals.

[0016] Furthermore, the intelligent terminal is a smart meter, power distribution terminal, or load monitoring device, which is resource-constrained and only supports lightweight elliptic curve cryptography and symmetric encryption operations; the security gateway is deployed in the distribution area concentrator, edge gateway, or FPGA module and has a complete certificateless public key cryptographic protocol stack.

[0017] The advantages of this invention are: By offloading communication proxy and key management functions to the distributed security gateway, the data processing center only needs to interact with the security gateway and no longer directly handles the registration, authentication and key negotiation requests of massive smart terminals, which significantly reduces the load on the central system and improves system scalability. Employing a certificateless public-key cryptography (CL-PKC)-based cryptography system, this approach avoids the certificate management overhead of traditional PKI and the key escrow risks of identity-based cryptography (IBC). Smart terminals do not require pre-installed long-term private keys; point-to-point key negotiation can be completed simply by performing two ECC scalar multiplications, meeting the low-power and low-computational requirements of resource-constrained devices. Furthermore, all session keys possess forward security, ensuring that historical communications are protected even if long-term keys are compromised. The smart terminal initiates online registration via local broadcast, and the group's security gateway automatically elects the best takeover through a lightweight arbitration mechanism. No pre-configuration of ownership relationships is required, which realizes dynamic, anonymous, and highly available terminal registration and binding. A layered key system is adopted to balance security and efficiency. Specifically: Management-Gateway Layer: Three rounds of CL-PKC authentication key negotiation ensure high-security command transmission between the data processing center and the security gateway, as well as between different security gateways within the group; Gateway-Terminal Layer (Point-to-Point): Based on ECDH + identity binding to derive session keys, it ensures end-to-end confidentiality and traceability of uplink data; Group Broadcast Layer: By aggregating temporary public keys to generate a shared group key, a single broadcast can cover the entire group, significantly reducing the communication overhead of downlink commands. Attached Figure Description

[0018] Figure 1 This is a schematic diagram of the overall system architecture provided by the present invention; Figure 2 This is a schematic diagram of the secure communication method for smart grid terminal groups based on certificate-free public key cryptography according to the present invention. Detailed Implementation

[0019] The technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention.

[0020] Example 1 In existing smart grid large-scale terminal access scenarios, data processing centers (such as master stations, cloud platforms, or control centers) typically need to communicate directly with a massive number of smart terminals (such as smart meters, sensors, actuators, etc.) to achieve core business functions such as remote meter reading, status monitoring, command issuance, and security authentication. However, with the exponential growth in the number of terminals, this traditional "center-to-terminal" architecture has exposed serious bottlenecks: on the one hand, the communication load is highly concentrated in the data processing center, resulting in huge pressure on connection management, message processing, and bandwidth, limiting system scalability and easily forming performance bottlenecks; on the other hand, the complexity of security key management increases dramatically, with each terminal needing to establish an independent secure channel with the center, involving full lifecycle management of key generation, distribution, update, and revocation, which not only consumes a lot of computing and storage resources but also significantly increases the operation and maintenance costs of security policy configuration and auditing.

[0021] To address the aforementioned issues, this embodiment proposes a technical solution that introduces a distributed group security gateway between the data processing center and the smart terminals, forming a smart grid system comprised of a data processing center, a key generation center (KGC), multiple security gateways (SG), and a large number of smart terminals (ST). The system is further layered and logically grouped. The data processing center and key generation center are designated as the core control layer. Smart terminals and security gateways are grouped into logically isolated groups, each consisting of multiple smart terminals and several security gateways. For the overall system architecture, please refer to the appendix. Figure 1 .

[0022] Based on the above system architecture, multiple security gateways are deployed and run in parallel within each logical group, forming a masterless, fully active distributed agent cluster. Massive numbers of smart terminals interact only with the security gateway currently managing their communication, and the data processing center communicates only with the security gateway cluster, no longer directly connecting to the terminals. Under this architecture, critical tasks such as communication connection, data aggregation, security authentication, and key negotiation are partially offloaded to the group edge and collaboratively undertaken by the distributed security gateways. Specifically: each security gateway is responsible for managing the registration, authentication, and session key establishment of its subordinate smart terminals; the generation, storage, and updating of smart terminal key materials are all completed locally by the security gateway, without frequent requests to the center; security gateways within the group can achieve fault takeover and load migration through a lightweight arbitration mechanism, ensuring high availability. Thus, the communication concurrency pressure and key management burden of the data processing center are effectively distributed to the distributed security gateway cluster at the edge, giving the system good scalability, fault tolerance, and security, making it particularly suitable for large-scale smart terminal access scenarios in smart grid systems.

[0023] This embodiment provides a secure communication method for smart grid terminal groups based on certificate-free public-key cryptography. Please refer to the appendix. Figure 2 ,include: Step S101: KGC establishes system parameters for a Certificateless Public Key Cryptography (CL-PKC) system based on Elliptic Curve Cryptography (ECC).

[0024] This example employs the CL-PKC cryptographic framework. In the initial system phase, the KGC performs system initialization operations, establishing a secure foundation supporting CL-PKC. The KGC establishes a complete set of system parameters based on ECC, which includes both the confidential master key and publicly available parameters that all participants must know.

[0025] First, KGC chooses a safe elliptic curve and defines a prime-order cyclic group on it. Its order is a large prime number. (usually meets) Subsequently, KGC selected one generator from the group. The base point of the elliptic curve is used as the common starting point for subsequent scalar multiplication operations.

[0026] Next, KGC starts from integer modulo multiplication group A random integer is selected as the system master key, denoted as . The master key It is kept strictly confidential by KGC and will not be disclosed to the outside world; it is the core secret of the entire CL-PKC system's security.

[0027] Based on the system master key and base point KGC computing system public key Among them, the symbol " " represents scalar multiplication on an elliptic curve. It is a publicly available elliptic curve point used for subsequent user identity binding and key verification.

[0028] In addition, KGC predefines three cryptographically secure hash functions: Identity Mapping Hash Function Used to deterministically map identity identifiers of arbitrary length (such as device serial numbers, MAC addresses, etc.) to groups. One of the points; Key-derived hash function Used to derive a fixed length from points on an elliptic curve. Symmetric keys (e.g., or ), used for subsequent session key generation or message authentication; Key confirmation message generation hash function Used to generate key confirmation messages, which can use ordinary hash functions (e.g., SM3).

[0029] Ultimately, KGC will exclude the system master key mentioned above. The parameters are integrated into a public system parameter set. The system then distributes this parameter set to all legitimate entities within the system, including the data processing center, all registered security gateways, and smart terminals. Upon receiving the publicly available system parameters, these entities can perform subsequent registration, key negotiation, and secure communication processes based on the CL-PKC framework.

[0030] For example, suppose a smart meter access system for a smart grid is configured with the national standard SM2 elliptic curve cryptography as its KGC. As a safe elliptic curve, the corresponding prime-order cyclic group Features of finite fields curve coefficients , Base point , base point level cofactor Joint representation. According to GM / T 0003.5-2012 "SM2 Elliptic Curve Public Key Cryptography Algorithm Part 5: Parameter Definition", the values ​​of the above parameters are shown in Table 1.

[0031] Table 1 Parameter Values Subsequently, based on integer modulo multiplication group Select system master key and combined with the base point Computing system public key .

[0032] For three predefined hash functions The Hash-to-Curve method based on SM3 is adopted. Using SM3 KDF mode, Use SM3 directly.

[0033] In summary, the publicly available system parameter set has been adjusted as follows: .

[0034] Step S102: The security gateway completes registration through a secure offline channel, generates a random master key, constructs a complete private key, calculates the public key components, and constructs a complete public key.

[0035] In this invention, the security gateway, acting as an edge proxy node, must first complete secure registration before participating in subsequent key negotiation and data forwarding. This registration process interacts with the KGC through a secure offline channel (such as a USB configuration interface, encrypted SD card, factory-pre-installed security chip, etc.) to ensure the secure injection of initial key materials.

[0036] To achieve effective management of security gateways, KGC maintains and manages them by storing a pre-registered list and an access list. The pre-registered list contains at least the identity, network address, and pre-assigned group identifier information of legitimate but unregistered security gateways. This list is pre-configured by the system administrator before deployment and supports real-time information entry. The access list contains the identity, group identifier, network address, and a portion of the private key calculated and distributed to the security gateway by KGC for security gateways that have successfully registered and accessed the system. When a security gateway registers, its information is moved from the pre-registered list to the access list, and the corresponding network address and partial private key information are added.

[0037] The specific implementation steps for the security gateway to register through the secure offline channel are as follows: Step S201: Enter the identity identifier, network address, and pre-assigned group identifier of the pre-registered security gateway into the KGC. In KGC, the identity identifier of the pre-registered security gateway is entered through methods such as manual input. (e.g., device serial number, MAC address, or a combination thereof), network address (e.g., MAC address, IP address), and the group identifier of the pre-assigned group for the security gateway. Stored in the security gateway's pre-registration list; Step S202: The security gateway initiates a registration request. The security gateway reads its unique identifier upon first power-on or initialization. And send a registration request to KGC through a secure offline channel (such as a USB configuration interface, encrypted SD card, factory-pre-installed security chip, etc.), the request containing at least information.

[0038] Step S203: KGC verifies identity and generates partial private key. After receiving the registration request, KGC queries the registration request for details. Whether the information is in the pre-registration list of the security gateway maintained locally.

[0039] like If the application is not in the pre-registration list, KGC will reject the registration request and terminate the registration process. If it exists, KGC continues to perform the following operations: Step S2031: Based on the system master key and hash function Calculate part of the private key of the registered security gateway ; Step S2032: Transfer part of the private key and public system parameter set It is returned to the security gateway through a secure offline channel.

[0040] Step S204: The security gateway returns confirmation information and constructs a complete key pair. After receiving the parameters returned by the KGC, the security gateway sends a confirmation message to the KGC and then performs local key generation: Step S2041: Generate a random master key. The security gateway from A random integer is selected as its random master key. This value is generated autonomously by the security gateway, without the KGC needing to know it, thus solving the key escrow problem; Step S2042: Construct the complete private key. The security gateway will automatically generate... Partial keys distributed with KGC Combine to form a complete private key ; Step S2043: Calculate the public key component. The security gateway utilizes the elliptic curve base points exposed by the system. Calculate its public key components ; Step S2044: Construct the complete public key. The security gateway uses its identity... With public key components Together they constitute the complete public key .

[0041] Step S205: KGC receives confirmation, forwards the identity information of registered security gateways in the group, and maintains the security gateway pre-registration list and access list.

[0042] After receiving the confirmation message from the security gateway, KGC sends the identity information of the remaining security gateways that have successfully registered in the same group as the security gateway to the security gateway; at the same time, KGC sends the identity identifier of the security gateway. and pre-assigned group identifiers The information is moved from the security gateway pre-registration list to the security gateway access list in the identity and group identifier fields, while also storing its network address and some private key information.

[0043] Step S206: After receiving the identity information of the registered security gateways in the group forwarded by KGC, the security gateway returns a confirmation message, which KGC receives.

[0044] At this point, the security gateway has completed its registration and is capable of participating in subsequent secure communications.

[0045] For example, assuming the security gateway device to be registered has a device serial number of "SG_ELE_001" and a MAC address of 3C:FD:FE:A1:B2:C3, the system uses a combination of these two as its identity identifier. Meanwhile, the security gateway pre-classifies the group identifiers in the system as follows: Before registering, first enter the above information into the security gateway pre-registration list maintained by KGC.

[0046] The security gateway registers via a secure USB configuration interface. During registration, it performs initialization, reads its own device serial number and MAC address information, and constructs a corresponding identity identifier. It is then packaged as a data payload into a registration request and sent to KGC.

[0047] After receiving the registration request, KGC parses the identity information in the data payload as follows: KGC checks this Is the information in its locally maintained security gateway pre-registration list? If the device is not in the pre-registration list, KGC will determine it as an illegal device and reject the registration request, terminating the registration process; if... If the application is already in the pre-registration list, the registration process continues.

[0048] KGC is based on the system master key. and hash function Calculate part of the private key Then, that part of the private key and public system parameter set It is packaged as a data payload and sent to the security gateway via the USB configuration interface.

[0049] After receiving the returned information, the security gateway parses it to obtain part of the private key. and public system parameter set The information is then sent to the KGC as a confirmation message. Simultaneously, the security gateway is based on... The information Value, from the corresponding Randomly select an integer (for example, ) as a random master key Part of the private key and random master key Constitute a complete private key And store it in the secure non-volatile storage device of the security gateway; on the other hand, the security gateway is based on The information Value, calculate public key components and combined with identity markers This constitutes a complete public key. And store.

[0050] After receiving the confirmation message from the security gateway, KGC, on the one hand, based on the security gateway access list, sends the identity information of the remaining security gateways that have successfully registered in the same group as the security gateway to the security gateway; on the other hand, it sends the identity identifier of the corresponding security gateway. and pre-assigned group identifiers The information is removed from the security gateway's pre-registration list, and the identity identifier is also removed. Group identifier Network address and part of the private key The information is added to the security gateway access list.

[0051] After receiving the identity information of registered security gateways within the group forwarded by the KGC, the security gateway stores the information and returns a confirmation message. At this point, the security gateway enters the ready state. The KGC receives and recognizes the confirmation message. The registration process for the security gateway is now complete.

[0052] Step S103: The smart terminal initiates online registration via local broadcast, and the winner of the arbitration by the group's security gateway verifies the identity with the KGC on behalf of the user, thereby achieving dynamic binding.

[0053] To achieve effective management of smart terminals, both the KGC and the security gateway store and maintain information lists related to smart terminals. Specifically: 1) The KGC maintains a pre-registered list of smart terminals and a smart terminal takeover list for each registered security gateway. The pre-registered list contains the identity information (including identifier, MAC address, IP address, etc.) of legitimate but unregistered smart terminals, used for authentication during smart terminal registration. The smart terminal takeover list of a registered security gateway contains the identity information of all smart terminals taken over by that security gateway, including identifier, MAC address, IP address, etc., used to provide the identity information of smart terminals to be taken over to other group gateways in case of security gateway failure. 2) The security gateway maintains its own smart terminal takeover list, containing the identity information of all smart terminals it has taken over.

[0054] In this embodiment, after the smart terminal is powered on for the first time or after the network is reconnected, it does not need to pre-configure the security gateway to which it belongs. Instead, it automatically completes the registration through a local broadcast mechanism, and multiple security gateways in the group dynamically elect a single takeover through lightweight local arbitration, thereby realizing the elastic and highly available binding between the terminal and the gateway.

[0055] The specific implementation steps are as follows: Step 301: The smart terminal initiates a broadcast registration request. After the smart terminal powers on and successfully connects to the local group network, it generates a registration request message, which contains at least its unique identifier. (For example, device serial number, MAC address, or a combination thereof). This request is sent via local broadcast to ensure that all security gateways within the group can receive it.

[0056] Step 302: The security gateway within the group initiates the arbitration process. All security gateways that receive a registration request automatically become candidate security gateways and immediately initiate a local arbitration protocol: Step 3021: Proposal Broadcast Phase. Each candidate security gateway constructs and broadcasts its own proposal, which includes its own identity identifier. Current load rate (e.g., number of terminals taken over / maximum capacity), timestamp (used to resolve timing conflicts).

[0057] Step 3022: Proposal Collection Phase. All candidate security gateways listen for and cache proposals from other security gateways within a fixed time window (e.g., 170 milliseconds) after receiving a registration request; Step 3023: Decision Phase. After the time window ends, each security gateway stops accepting new proposals and calculates the score of all proposals, including its own, based on a deterministic arbitration scoring function. The gateway with the highest score wins.

[0058] Step 303: The winner's security gateway submits a verification request to the KGC. If a security gateway determines that it is the winner, it will transmit the identity information (including identity identifier) ​​of the smart terminal. (MAC address, IP address, etc.) are forwarded to KGC for legality verification; the remaining non-winners are discarded by GSG to avoid duplicate processing.

[0059] Step 304: KGC Verification and Authorization After receiving the verification request, KGC queries the list of pre-registered smart terminals.

[0060] If the identity information of the smart terminal is not in the pre-registration list, the request is rejected and the registration is terminated. Otherwise, KGC returns an authorization confirmation message to the winner security gateway that forwarded the verification request, and at the same time moves the identity information of the smart terminal (including identity ID, MAC address, IP address, etc.) to the smart terminal takeover list of the winner security gateway. Step 305: Winner Security Gateway completes local binding After receiving the authorization confirmation message, the Winner Security Gateway adds the identity information of the smart terminal to its local smart terminal takeover list, and simultaneously unicasts the system public parameters to the smart terminal for use in subsequent key negotiation.

[0061] At this point, the smart terminal has completed online registration.

[0062] Specifically, during the aforementioned security gateway arbitration process, if multiple security gateways win simultaneously due to network latency or identical scores, all winners are allowed to send verification requests to the KGC. The KGC completes authorization upon receiving the first valid request and ignores subsequent duplicate requests.

[0063] For example, suppose there are 5 security gateways in the current group, denoted as SG001~SG005. A smart terminal ST009 is preparing to register. Its device serial number is "ST_ZNDB_009", MAC address is 5A:9D:F9:C6:A2:D9, IP address is 192.168.10.25, and its identity uses... Before registration, the identity identifier of the smart terminal ST009 must first be entered. The MAC address and IP address information are entered into the smart terminal pre-registration list maintained by KGC.

[0064] When the smart terminal ST009 is powered on and connected to the group's local network, it uses its identity identifier. The timestamp information is packaged into a data payload to form a broadcast registration request message, which is then sent. Security gateways SG001 through SG005 within the group can all receive this registration request message.

[0065] After receiving the registration request, security gateways SG001 to SG005 interact and arbitrate to determine the winner. Taking security gateway SG001 as an example, after receiving the registration request message from smart terminal ST009, it extracts the MAC address and IP address information of smart terminal ST009 and parses its identity identifier. and timestamp Information. Then, extract its identity identifier. (For example, "SG_ELE_001_3C_FD_FE_A1_B2_C3"), calculate the current load rate (e.g., 80%), obtain the current system timestamp, and package the above information into a broadcast proposal and broadcast it within the group. On the other hand, use the timestamp of the registration request... Based on this, proposal messages from security gateways SG002 to SG005 are collected within a fixed time window (e.g., 500ms). When the time window ends, receiving new proposals stops, but proposal messages from security gateways SG002 to SG005 are received normally at this time. Then, scores are calculated for the proposal itself and the proposals from security gateways SG002 to SG005 based on a deterministic arbitration scoring function. The deterministic arbitration scoring function is defined as follows: in, , and These are the weighting coefficients. It is the difference between the scoring calculation start time and the proposal timestamp. The scores of each security gateway are calculated as follows: the proposal score of SG001 is 0.62, the proposal score of SG002 is 0.80, and the proposal scores of SG003 - SG005 are < 0.7. Its own proposal score < the proposal score of SG002, so it is not the winner and the registration request is discarded. The security gateway SG002 adopts the same arbitration process and determines that its own proposal score of 0.8 is the highest, being the winning security gateway.

[0066] As the winning security gateway, the security gateway SG002 encrypts and packages the identity information of the intelligent terminal ST009 (including the identity identifier , MAC address, IP address, etc.) into a new intelligent terminal registration request message and forwards it to the KGC for verification.

[0067] The KGC receives the new registration request message forwarded by the security gateway SG002, decrypts and analyzes the identity information of the intelligent terminal , and then compares and verifies it with the information in the local pre - registration list of intelligent terminals. If the current identity information does not match all the information in the pre - registration list, the registration request is rejected and this registration terminates; otherwise, the KGC authorizes the security gateway SG002 to take over the intelligent terminal ST009. At the same time, the identity information of the intelligent terminal ST009 (including the identity identifier , MAC address, IP address, etc.) is moved to the intelligent terminal takeover list of the winning security gateway; After receiving the authorization takeover message, the security gateway SG002 adds the identity information of the intelligent terminal ST009 to its local intelligent terminal takeover list. At the same time, the security gateway SG002 unicasts the system public parameters to the intelligent terminal ST009 for subsequent key negotiation.

[0068] The intelligent terminal ST009 receives the system public parameters and saves them.

[0069] Step S104: The data processing center and the security gateway, as well as between security gateways, perform high - security CL - PKC two - party authentication key negotiation and encrypt the communication based on the generated management - gateway layer session key.

[0070] In this invention, to ensure the confidentiality, integrity, and identity authentication of the communication in the management plane (such as between the data processing center and the security gateway, and between different security gateways in a group), the system adopts a three - round authentication key negotiation protocol based on the certificateless public key cryptosystem (CL - PKC). This protocol not only provides forward security but also ensures that the session keys derived by both parties are consistent through the key confirmation mechanism, effectively resisting man - in - the - middle attacks.

[0071] For the data processing center and the security gateway, the initial key negotiation is initiated by the security gateway after it completes registration. For key negotiation between different security gateways within the group, the newly registered security gateway initiates the negotiation after obtaining the identity information of the registered security gateways in the group sent by the KGC. During the key update phase, either device can initiate the negotiation first.

[0072] Taking the key negotiation initiated by communication party A to communication party B as an example, the specific process steps are as follows: In the first round, communication is initiated by communication party A to communication party B.

[0073] First, based on the publicly available system parameters params, communication party A... A random integer is selected as the temporary private key. And further calculate its temporary public key. ; Then, communication party A will identify itself. Temporary public key and the public key component generated during its registration. The public key component is packaged as a data payload and sent to the communicating party B. , This is the random master key of communication party A.

[0074] In the second round, communication is initiated by communication party B to communication party A.

[0075] Communicator B receives from Communicator A After receiving the information, based on the system's publicly available parameters `params`, from... A random integer is selected as the temporary private key. And calculate its temporary public key. Then, based on the publicly available system parameters and The function, and the receiver. Information, computing Further calculation of shared key materials ,in, The random master key generated by communication party B during registration; based on publicly available system parameters. The function derives the session key. Regenerate key confirmation message ; Finally, party B will identify itself. Temporary public key Public key components and key confirmation message Package and send to communication party A.

[0076] In the third round, communication is initiated by communication party A to communication party B.

[0077] Communicator A receives from Communicator B After receiving the information, calculate the shared key material. and derive session key Then, calculate And verify its relationship with Check if they are equal. If they are not equal, the verification fails and key negotiation terminates; if they are equal, a key confirmation message is generated. And send it to the communicating party B.

[0078] Finally, the communication party B verifies... and Are they equal? ​​If they are equal, then accept the session key. .

[0079] Both communicating parties will use the successfully negotiated session key. The management-gateway layer session key list is stored locally as a management-gateway layer session key. This list stores the identity information of the communicating parties and their corresponding session keys.

[0080] When conducting data communication, the sender uses The plaintext data is symmetrically encrypted, such as with SM4 or AES, and a Message Authentication Code (MAC) is appended to the ciphertext. The receiver first verifies the MAC; if it passes, it proceeds. Decrypt, otherwise discard the data.

[0081] For example, suppose that after security gateway SG006 successfully registers, it receives the identity information of registered security gateways SG001-SG005 from the KGC. Then, security gateway SG006 performs key negotiation with security gateways SG001-SG005 in turn.

[0082] Taking the key negotiation initiated by security gateway SG006 to security gateway SG001 as an example, after the three rounds of communication interaction described above, security gateway SG006 and security gateway SG001 confirm their respective session keys. or .in: , ; , .

[0083] in, For adoption function, , , , and These are the temporary private key, random master key, temporary public key, identity identifier, and public key component of the security gateway SG001. , , , and These are the temporary private key, random master key, temporary public key, identity identifier, and public key component of the security gateway SG006.

[0084] When the two parties are communicating, security gateway SG001 sends plaintext data to security gateway SG006. Security gateway SG001 uses... Encrypt as the session key to obtain ciphertext. and generate ,in, This uses a national standard symmetric encryption function, with Nonce1 being a random number. After receiving the encrypted message, the security gateway SG006 first verifies the MAC address. If the verification is successful, it utilizes... Decrypt the ciphertext to obtain the plaintext result.

[0085] Step S105: The security gateway and the taken-over smart terminal perform a lightweight ECDH key negotiation with identity binding, and realize point-to-point encrypted communication based on the generated gateway-terminal layer session key.

[0086] To meet the low-power, high-efficiency, and secure communication requirements of resource-constrained smart terminals, a lightweight, two-round key negotiation mechanism is adopted between the security gateway and the smart terminals it has taken over. This mechanism is based on the Elliptic Curve Diffie-Hellman (ECDH) protocol and combines the identities of both parties for key derivation, achieving implicit authentication and forward security while avoiding the burden of complex certificate management or long-term private key storage.

[0087] After the smart terminal is taken over by the security gateway through step 103, the smart terminal initiates key negotiation with the security gateway. The specific process steps are as follows: In the first round, the smart terminal communicates with the security gateway.

[0088] First, the smart terminal generates a temporary private key based on the system's publicly available parameters, params. And calculate the temporary public key. Then, identify it. and temporary public keys Send to the security gateway; In the second round, communication is initiated between the security gateway and the smart terminal.

[0089] The security gateway also generates a temporary private key based on the system's publicly available parameters, params. And calculate the temporary public key. Then, identify it. and temporary public keys Send to the security gateway.

[0090] The smart terminal and security gateway independently calculate the ECDH shared key material. and ,in, and Strict equality, denoted as Finally, both parties can derive the gateway-endpoint layer session key. A security gateway may take over multiple smart terminals, therefore it needs to maintain a gateway-terminal layer session key list to store the smart terminals being taken over and their corresponding gateway-terminal layer session keys; smart terminals, on the other hand, only communicate with the security gateway taking over, so they only need to store the identity of the security gateway taking over and its gateway-terminal layer session key.

[0091] When a smart terminal communicates with a security gateway, the sender generates a one-time random number (Nonce) and then uses the gateway-terminal layer session key. Lightweight symmetric encryption, such as SM4-CTR or AES-128-CTR, is applied to the plaintext to obtain the ciphertext. Then, the message authentication code is calculated. and send To the receiver; the receiver first checks the MAC address, and if the verification passes, then uses... Decrypt the ciphertext to obtain the plaintext data.

[0092] Specifically, for the communication process of a smart terminal uploading data to a security gateway, if a replay protection function is further implemented, the smart terminal will encrypt and generate a MAC address before sending the data. The MAC address is then passed to the security gateway. After the security gateway verifies the MAC address, it checks if the Nonce is duplicated; that is, the security gateway caches the Nonce value within a fixed-length time window. Only after successful verification is the MAC address used. Decrypt the data.

[0093] For example, assume that security gateway SG002 takes over smart terminal ST009. After successful registration, smart terminal ST009 receives the publicly available system parameters params forwarded by security gateway SG002. Smart terminal ST009 then initiates key negotiation with security gateway SG002.

[0094] The smart terminal ST009 first randomly generates a temporary key. And calculate the temporary public key. Then send To security gateway SG002; Security gateway SG002 randomly generates temporary keys And calculate the temporary public key. Then send To the smart terminal ST009; Both parties calculate the shared key material. and and respectively derived and If the two are equal, it is denoted as .

[0095] When the smart terminal ST009 reports measurement data to the security gateway SG002, it generates Nonce=0x25452154, and then uses... The encrypted data yields the ciphertext "0xA45E...", and the MAC is calculated as 0xD453... before being sent. To security gateway SG002. Security gateway SG002 checks the MAC value sequentially ( The verification passed with the Nonce value (0x25452154). Decrypt the data.

[0096] Step S106: The security gateway negotiates a group authentication key with the smart terminal being taken over, and broadcasts downlink instructions based on the generated shared group session key.

[0097] To efficiently support the security gateway in issuing downlink commands, such as parameter configuration, control commands, and firmware updates, to a large number of smart terminals under its jurisdiction, the system adopts a group authentication key negotiation protocol based on elliptic curve cryptography (ECC). This protocol enables secure communication of all smart terminals in the group through a single broadcast, significantly reducing communication overhead while ensuring the confidentiality and integrity of commands and the legitimacy of group members' identities.

[0098] Suppose a security gateway currently manages n legitimate smart terminals, whose identity set is . Group key negotiation is performed as follows: Step 601: Each smart terminal generates and reports a temporary public key. Each smart terminal Generate a temporary private key independently based on the system's publicly available parameters (params). Calculate the temporary public key And send to the security gateway it takes over through the point-to-point encrypted channel established in step 105. ; Step 602: Security gateway aggregates and calculates shared group session keys The security gateway receives all data from the smart terminals that have been taken over. After receiving the information, first verify each one. Check if the device exists in its local smart terminal takeover list to ensure that only legitimate smart terminals participate; after successful verification, calculate the aggregated public key. The following calculation methods can be used. Then generate your own temporary private key. Based on temporary private key and aggregated public keys Calculate shared group session key materials: Finally, derive the shared group session key. ,in, The group identifier for the group where the security gateway is located.

[0099] Step 603: Security gateway distributes shared group session keys point-to-point. The security gateway derives a shared group session key. Subsequently, based on the point-to-point encrypted channel established in step 105, encrypted distribution is made to all smart terminals under its control. Each smart terminal stores the session key.

[0100] When the security gateway needs to issue general commands, it uses a shared group session key. The plaintext instruction is symmetrically encrypted to obtain Ciphertext; then, a message authentication code is generated. and broadcast the message After receiving the broadcast message, each smart terminal uses its locally stored... Verify MAC address; use after successful verification. Decrypt the ciphertext command and execute it. If the verification fails, discard the message.

[0101] For example, suppose the security gateway SG006 manages 500 smart meter terminals, and the group identifier of its group is... .

[0102] During the key negotiation phase, each of the 500 smart meters independently generates a temporary public key. and combined with their respective identity markers The message is sent to the security gateway SG006 via a point-to-point encrypted channel; the security gateway SG006 then verifies the identity identifier sent. Whether it is on the smart terminal takeover list. After all smart meter identities are verified, the security gateway SG006 generates a temporary private key. Then calculate the aggregated public key. And calculate shared group session key material Finally, based on this and group identifier Derived shared group session key Derivatives Distributed to all smart terminals via a point-to-point encrypted channel.

[0103] During the command broadcast phase, the security gateway SG006 generates plaintext commands and uses them. Perform SM4 symmetric encryption to obtain Ciphertext. Simultaneously, generate Nonce=0x9C56... and calculate... Among them, SM3 is adopted Function. Finally, The information is packaged and broadcast. The 500 smart meters managed by the security gateway SG006 receive the broadcast information, first calculate the MAC address and verify it, then use the locally stored... Decrypt the code and then execute the command.

[0104] Step S107: When the security gateway fails, the health and security gateway takes over its smart terminal through arbitration and rebuilds secure communication.

[0105] In the distributed group security architecture of this invention, to ensure high system availability and business continuity, when a security gateway fails (such as a power outage, network interruption, or software crash), the system automatically triggers a fault self-healing mechanism. This mechanism involves the data processing center detecting the fault, and other healthy security gateways within the group dynamically taking over the smart terminals under the jurisdiction of the faulty security gateway through lightweight local arbitration, and rebuilding the point-to-point secure communication channel to ensure uninterrupted terminal services.

[0106] The specific steps of the security gateway fault self-healing process are as follows: Step S701: Fault Detection and Triggering Each security gateway broadcasts a lightweight heartbeat message to the data processing center every 10 seconds at a fixed interval. The data processing center maintains a heartbeat status table for all security gateways. If no heartbeat is received from a security gateway for N consecutive periods (N=4), the security gateway is determined to be faulty and broadcasts a fault notification to the remaining security gateways in the group, which includes the identity of the faulty security gateway. .

[0107] Step S702: Fault Detection and Triggering Upon receiving a fault notification, all health and safety gateways in the group that are still sending heartbeats will initiate a local arbitration process. The specific steps are as follows: Step S7021: Candidate Phase. All health and security gateways automatically become takeover candidates; Step S7022: Proposal Broadcast Phase. Each candidate security gateway broadcasts its own proposal, including: its own identity identifier. Current load rate (e.g., number of terminals taken over / maximum capacity), timestamp.

[0108] Step S7023: Proposal Collection Phase. All candidate security gateways listen for and cache proposals from other security gateways within a fixed time window of 150 milliseconds after receiving a registration request; Step S7024: Decision Phase. After the time window ends, each security gateway stops receiving new proposals and calculates the score of all proposals, including its own, based on a deterministic arbitration scoring function. The gateway with the highest score wins. Step S7025: Smart Terminal Takeover. The Winner Security Gateway requests the identity information of the smart terminal to be taken over from the Data Processing Center; Upon receiving the takeover request, the Data Processing Center extracts the identity information of the smart terminal to be taken over from the smart terminal takeover list of the Fault-Safe Gateway and sends it to the Winner Security Gateway in encryption; The Winner Security Gateway receives the identity information of the smart terminal and adds it to the temporary smart terminal takeover list, while simultaneously returning a takeover confirmation message to the Data Processing Center; Upon receiving the takeover confirmation message, the Data Processing Center moves the identity information of the smart terminal to be taken over from the smart terminal takeover list of the Fault-Safe Gateway to the smart terminal takeover list of the Winner Security Gateway. Step S7026: Multi-round arbitration execution. The data processing center determines whether there are still smart terminals awaiting takeover in the smart terminal takeover list of the fault-tolerant gateway. If so, steps 7022 to 7025 are re-executed; if not, the arbitration ends.

[0109] Step S703: Rebuild secure communication Each security gateway, based on the temporary smart terminal takeover list, sequentially re-negotiates keys with the newly taken-over smart terminals. After the negotiation is completed, the corresponding smart terminal identity information is moved from the temporary smart terminal takeover list to the smart terminal takeover list, until all smart terminals have completed the reconstruction of secure communication.

[0110] For example, suppose security gateway SG002 goes offline due to a power failure, while the other security gateways SG001 and SG003-SG005 continue to operate normally. Security gateway SG002 manages 500 smart terminals. The data processing center fails to receive its heartbeat information for four consecutive cycles, determining that it has failed. The data processing center then broadcasts a fault notification, which includes the identifier of the failed security gateway. .

[0111] Security gateways SG001 and SG003-SG005 performed the first round of lightweight arbitration. Security gateway SG003 won and initiated a takeover request to the data processing center. The data processing center extracted min([500 / (4)) from the smart terminal takeover list of security gateway SG003. 10)], The identity information of each smart terminal is encrypted and sent to the security gateway SG003. The remaining number of takeoverable devices for security gateway SG003 is determined. Security gateway SG003 adds the corresponding smart terminal identity information to the temporary smart terminal takeover list and returns a takeover confirmation message to the data processing center. The data processing center moves the corresponding smart terminal identity information to the smart terminal takeover list of security gateway SG003, and then checks whether there are still any untaken smart terminals in the smart terminal takeover list of security gateway SG002. If so, the next round of arbitration is executed, and the above takeover process is repeated. In the second round, security gateway SG004 takes over, and the arbitration takeover is executed again. Finally, when all smart terminals of security gateway SG002 have been taken over, the takeover arbitration ends.

[0112] Security gateways SG001 and SG003-SG005 each re-establish key negotiation and re-establish secure channels for the smart terminals in the temporary smart terminal takeover list in turn, until the secure channels of all smart terminals are re-established.

[0113] Example 2 This embodiment discloses a secure communication device for a smart grid terminal group based on certificate-free public-key cryptography, including: The system initialization unit is used by the key generation center to generate and publish system parameters for a certificateless public-key cryptosystem based on elliptic curve cryptography. The registration management unit is used to execute offline registration of security gateways, online broadcast registration of smart terminals, and arbitration takeover authorization processes for security gateways within groups; The key negotiation unit, integrated into the security gateway, supports cross-group two-party key negotiation, group broadcast key negotiation, and smart terminal point-to-point key negotiation; The encrypted communication unit is used to encrypt communication data based on the session keys at each level and attach HMAC or CMAC message authentication codes, while simultaneously verifying and decrypting the message authentication codes of the received ciphertext. The key update unit responds to timing policies, member changes, or security alarms to trigger key rotation and secure distribution at all levels. The fault takeover unit is used to detect security network key bounces, trigger fault self-healing processes, and complete the takeover and key negotiation reconstruction of faulty gateway terminals.

[0114] The intelligent terminal is a smart meter, distribution terminal, or load monitoring device, which is resource-constrained and only supports lightweight elliptic curve cryptography and symmetric encryption operations. The security gateway is deployed in the distribution concentrator, edge gateway, or FPGA module and has a complete certificateless public key cryptography protocol stack.

[0115] Finally, it should be noted that the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A secure communication method for smart grid terminal groups based on certificate-free public-key cryptography, characterized in that, It is applied to smart grid systems that include a data processing center, a key generation center, multiple security gateways and a large number of smart terminals. All smart terminals and security gateways are divided into groups, with multiple smart terminals and several security gateways forming a group, and different groups are logically isolated. The method includes three stages: system initialization and registration, key negotiation and communication, and fault self-healing. The system initialization and registration include: S1. The key generation center establishes system parameters based on elliptic curve cryptography and a certificateless public-key cryptosystem. The system parameters include the system master key and public system parameters. S2. The security gateway to be registered sends a registration request to the key generation center through a secure offline channel. After verifying its identity, the key generation center sends a portion of the private key and public system parameters, and sends the identity information of the security gateways that have been successfully registered in the group to which the security gateway to be registered belongs to the security gateway to be registered. The security gateway to be registered generates a random master key and constructs a complete public-private key pair. S3. The smart terminal broadcasts a registration request locally. The security gateway within the group arbitrates and determines a winner. The winner verifies the terminal's identity with the key generation center. After the key generation center verifies the identity, it authorizes the winner to take over the terminal. The winner then sends public system parameters to the smart terminal. The key negotiation and communication include: S4. The data processing center and the security gateway perform certificateless public key cryptography two-party authentication key negotiation, generate a management-gateway layer session key, and encrypt communication based on the key; S5, the security gateway and the smart terminal being taken over complete lightweight encrypted communication through elliptic curve Diffie-Hellman and identity binding derived gateway-terminal layer session keys; S6. The security gateway and all the smart terminals it manages complete the group authentication key negotiation and generate a shared group session key to achieve broadcast encrypted communication. All of the above communications are appended with a message authentication code after the ciphertext. The receiver decrypts the message after verifying it. The fault self-healing includes: S7. The security gateway continuously broadcasts a lightweight heartbeat. After the data processing center detects a security gateway failure, it triggers a self-healing process. Within the group, healthy security gateways are arbitrated to determine a winner. The winner takes over the smart terminals under the jurisdiction of the failed security gateway and re-establishes point-to-point key negotiation with the newly taken-over smart terminals.

2. The secure communication method for smart grid terminal groups based on certificateless public-key cryptography according to claim 1, characterized in that, The system master key is derived from an integer modulo elliptic curve prime number. multiplication group Random numbers selected from ; The disclosed system parameters include elliptic curve base points. prime order of elliptic curves System public key The first hash function used for identity mapping The second hash function used for key derivation and a third hash function used to generate key confirmation messages. The base point of the elliptic curve belongs to a prime-order cyclic group. The first hash function is a hash function that maps a binary string of arbitrary length to the prime-order cyclic group. The second hash function is a hash function that maps points in the prime-order cyclic group to a fixed-length binary string. The third hash function is a regular hash function; The publicly disclosed system parameters are sent to the data processing center and all registered security gateways and smart terminals within the system.

3. The secure communication method for smart grid terminal groups based on certificateless public-key cryptography according to claim 2, characterized in that, The key generation center stores and maintains a security gateway pre-registration list and a security gateway access list. The security gateway pre-registration list contains the identity identifiers and pre-assigned group identifiers of legitimate but unregistered security gateways. The security gateway access list contains the identity identifiers, group identifiers, and corresponding partial private keys of successfully registered security gateways. The private key generated by the key generation center is... , This serves as the identity identifier for the security gateway; The random master key of the security gateway For the multiplication group of elliptic curve prime order modulo integers The random number selected from the list; The complete private key of the security gateway It consists of a random master key and a portion of the private key; The public key component of the security gateway is ; Full public key It consists of the identity identifier and public key component of the security gateway.

4. The secure communication method for smart grid terminal groups based on certificateless public-key cryptography according to claim 1, characterized in that, The key generation center stores and maintains a pre-registered list of smart terminals and a smart terminal takeover list of each registered security gateway. The pre-registered list of smart terminals contains the identity identifiers of legitimate but unregistered smart terminals, and the smart terminal takeover list contains the identity identifiers of smart terminals taken over by the corresponding security gateway. The steps for determining the winner through group-wide security gateway arbitration are as follows: All security gateways that receive registration requests automatically become candidate security gateways. Candidate security gateways broadcast their own proposals and collect proposals from other candidate security gateways within a fixed time window. The proposals include identity information, current load rate, and timestamp information. After the fixed time window expires, the candidate security gateway stops receiving proposals from other candidate security gateways, calculates its own score and the score of all received proposals using a deterministic arbitration scoring function, and the gateway with the highest score is the winner and forwards the terminal registration request to the key generation center. The other gateways ignore the registration request.

5. The secure communication method for smart grid terminal groups based on certificateless public-key cryptography according to claim 4, characterized in that, If multiple winners are generated by local arbitration among the candidate security gateways, each winner forwards the registration request of the smart terminal to the key generation center. After receiving the request, if the key generation center verifies that the smart terminal is legitimate and has not been authorized to register, it authorizes the security gateway that is currently forwarding the request to take over the smart terminal; otherwise, it ignores the registration verification request.

6. The secure communication method for smart grid terminal groups based on certificateless public-key cryptography according to claim 2, characterized in that, The steps for negotiating the authentication key between the two parties in the certificateless public key cryptography are as follows: In the first round of communication, communicator A generates a multiplicative group of integer modulo elliptic curve prime order. Temporary private key And calculate the corresponding temporary public key. The identity identifier of communication party A Public key components Temporary public key Send to communicator B; In the second round of communication, party B generates a temporary private key with the same rules. And calculate the corresponding temporary public key The communicating party B then calculates the shared key material. , This is the random master key for communication party B. pass Calculated; the communication party B derives the session key through the second hash function. A key confirmation message is generated using a third hash function. Then, the identity identifier of communication party B. Public key components Temporary public key Key confirmation message Send to communication party A; In the third round of communication, party A calculates the shared key material according to the same rules. And derive session key , Communication party A verifies the key confirmation message from communication party B. If verification fails, the protocol terminates; if verification succeeds, a key confirmation message is generated and sent. To Communication Party B; Communication Party B Verification After successful verification, both parties confirm the use of the same session key. As the management-gateway layer session key.

7. The secure communication method for smart grid terminal groups based on certificateless public-key cryptography according to claim 1, characterized in that, The steps for the security gateway and the takeover smart terminal to perform key negotiation based on elliptic curve Diffie-Hellman and identity binding derivation are as follows: Both communicating parties A and B generate temporary private keys within the multiplicative group of integer modulo elliptic curve prime order. , And calculate the corresponding temporary public key. , After exchanging temporary public keys, each party calculates the elliptic curve scalar multiplication result of its own temporary private key and the other party's temporary public key as the shared key material. Finally, the shared key material and the identities of both parties are jointly processed using a second hash function to derive the gateway-terminal layer session key. .

8. The secure communication method for smart grid terminal groups based on certificateless public-key cryptography according to claim 3, characterized in that, When any smart terminal in the group is revoked or goes offline abnormally, its takeover gateway removes it from the list of active members and immediately updates the shared group session key; The new key is distributed only to the remaining legitimate smart terminals through a point-to-point secure channel; the key generation center updates the long-term key of the security gateway periodically or when a security event is triggered and re-executes the full key negotiation process.

9. A secure communication device for a smart grid terminal group based on certificateless public-key cryptography, implementing the method of any one of claims 1 to 8, characterized in that, include: The system initialization unit is used by the key generation center to generate and publish system parameters for a certificateless public-key cryptosystem based on elliptic curve cryptography. The registration management unit is used to execute offline registration of security gateways, online broadcast registration of smart terminals, and arbitration takeover authorization processes for security gateways within groups; The key negotiation unit, integrated into the security gateway, supports cross-group two-party key negotiation, group broadcast key negotiation, and smart terminal point-to-point key negotiation; The encrypted communication unit is used to encrypt communication data based on the session keys at each level and attach a message authentication code, while also verifying and decrypting the message authentication code of the received ciphertext. The key update unit responds to timing policies, member changes, or security alarms to trigger key rotation and secure distribution at all levels. The fault takeover unit is used to detect security network key bounces, trigger fault self-healing processes, and complete the takeover and key negotiation reconstruction of faulty gateway terminals.

10. The smart grid terminal group secure communication device based on certificateless public key cryptography according to claim 9, characterized in that, The intelligent terminal is a smart meter, power distribution terminal, or load monitoring device, which is resource-constrained and only supports lightweight elliptic curve cryptography and symmetric encryption operations; the security gateway is deployed in the distribution area concentrator, edge gateway, or FPGA module and has a complete certificateless public key cryptographic protocol stack.