Blockchain-based distributed power terminal access authentication method and system
By using blockchain technology to achieve decentralized authentication of distributed power terminals, the problems of complex certificate management and poor security in existing technologies are solved, providing a secure and reliable access authentication mechanism that supports large-scale distributed power access.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- STATE GRID CORPORATION OF CHINA
- Filing Date
- 2024-08-19
- Publication Date
- 2026-05-05
AI Technical Summary
In existing technologies, grid connection authentication schemes for distributed power sources suffer from problems such as complex certificate management, difficulty in ensuring security, and poor scalability, making it difficult to meet authentication requirements.
A blockchain-based distributed power terminal access authentication method is adopted, which realizes a decentralized, secure and reliable authentication mechanism through signature verification, blockchain network retrieval, distributed authentication group consensus algorithm and smart contract.
It provides secure, reliable, and efficient distributed power supply terminal access authentication, supports concurrent access of large-scale distributed power supply terminals under new power systems, and meets the application requirements of distributed power supply grid connection.
Smart Images

Figure CN118842646B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of terminal access authentication, and specifically relates to a distributed power terminal access authentication method and system based on blockchain. Background Technology
[0002] In recent years, with the rapid development of distributed power sources, the issue of grid connection authentication has become increasingly prominent. Traditional centralized authentication methods, such as those based on Public Key Infrastructure (PKI), identity authentication, and digital certificates, are unable to meet authentication requirements due to problems such as complex certificate management, difficulty in ensuring security, and poor scalability. Summary of the Invention
[0003] To address the shortcomings of existing technologies, this invention provides a blockchain-based distributed power terminal access authentication method and system, offering a more secure, reliable, and efficient solution for grid connection of distributed power terminals.
[0004] To solve the above-mentioned technical problems, the present invention adopts the following technical solution.
[0005] This invention first discloses a blockchain-based distributed power terminal access authentication method, which includes the following steps:
[0006] Receive authentication requests sent by distributed power terminal nodes, extract the terminal public key from the authentication request, and perform signature verification on the distributed power terminal nodes at the master node;
[0007] When the signature verification is successful, the terminal identifier in the authentication request is used to search for a blockchain node in the authentication blockchain network that matches the distributed power terminal, and multiple blockchain nodes are combined into a distributed authentication group.
[0008] The authentication request is broadcast to the distributed authentication group, and all nodes in the distributed authentication group are instructed to perform consensus authentication on the authentication request based on the consensus algorithm. When the consensus authentication is successful, the distributed power terminal is connected to the master node, and the authentication blockchain network is updated.
[0009] The present invention further includes the following preferred embodiments:
[0010] The step of performing signature verification on the distributed power terminal node at the master node further includes:
[0011] Distributed power terminal nodes send authentication requests to the master node through a secure channel. The authentication request includes a unique identifier string for the terminal type field, the terminal public key, and a digital certificate issued by an authorized authority to confirm the device's identity and authorization.
[0012] After receiving the authentication request, the master node uses the terminal's public key to verify the validity of the terminal signature.
[0013] The step of retrieving a blockchain node matching the distributed power terminal in the authentication blockchain network using the terminal identifier in the authentication request further includes:
[0014] The authentication blockchain network searches for legitimate nodes that have successfully connected to the power dispatching business system, have sufficient power and processing capabilities to run the authentication algorithm with a predefined threshold, and belong to the same category or business as the distributed power terminal to be connected to the power dispatching business system.
[0015] Extract information about the legitimate nodes, including access time, service type, operating status, and node type, and perform a comprehensive matching with the distributed power terminal to be connected.
[0016] The consensus authentication of the authentication request based on the consensus algorithm further includes:
[0017] The primary node sends the request number n, the client's request message m, and its own digital signature sig_primary to all replica nodes;
[0018] After receiving a message, each replica node verifies the signature and the validity of the message. If the verification passes, it enters the preparation phase.
[0019] Each replica node sends a preparation message to all other nodes. This message contains the request number n, the request message m, the signature sig_primary of the scheduling master, and its own signature sig_replica. When a replica node receives more than 2f+1 preparation messages with the same request number n, the same request message m, and a valid signature, it enters the commit phase. Here, f is the number of nodes with tolerable Byzantine faults.
[0020] During the commit phase, the replica node sends a commit message to all other nodes. This message contains the request number n, the request message m, the signature sig_primary of the scheduling master, its own signature sig_replica, and the set of prepared messages received. When a replica node receives more than 2f+1 commit messages with the same request number n, the same request message m, and a valid signature, it determines that the request has been confirmed and returns the result to the client.
[0021] Dynamic weights are assigned to each node based on its performance, stability, and historical behavior.
[0022] Weight i =α·Performance i +β·Stability i +γ·History i
[0023] Among them, Weight i It is the weight of node i, Performance i Stability i and History i These represent the node's performance, stability, and historical behavior scores, respectively. α, β, and γ are weighting coefficients, and nodes with higher dynamic weights are prioritized during the consensus process.
[0024] This invention also discloses a blockchain-based distributed power terminal access authentication system utilizing the aforementioned blockchain-based distributed power terminal access authentication method, comprising:
[0025] The signature verification module is used to receive the authentication request sent by the distributed power terminal node, extract the terminal public key in the authentication request, and perform signature verification on the distributed power terminal node at the master node.
[0026] The blockchain retrieval module is used to retrieve a blockchain node matching the distributed power terminal in the authentication blockchain network using the terminal identifier in the authentication request when the signature verification is passed, and to form a distributed authentication group from multiple blockchain nodes.
[0027] The consensus module is used to broadcast the authentication request to the distributed authentication group and instruct all nodes in the distributed authentication group to perform consensus authentication on the authentication request based on the consensus algorithm. When the consensus authentication is successful, the distributed power terminal is connected to the master node, and the authentication blockchain network is updated at the same time.
[0028] Accordingly, the present invention also discloses a terminal, including a processor and a storage medium;
[0029] The storage medium is used to store instructions;
[0030] The processor is configured to operate according to the instructions to execute the steps of the aforementioned blockchain-based distributed power terminal access authentication method.
[0031] Accordingly, the present invention also discloses a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the steps of the aforementioned blockchain-based distributed power terminal access authentication method.
[0032] The beneficial effects of this invention are that, compared with the prior art, it provides a blockchain-based distributed power terminal access authentication method and system, designs a detailed model and algorithm, and verifies its feasibility through implementation. By combining blockchain technology with distributed power access authentication, a decentralized, secure, and reliable authentication mechanism is achieved, which can support the concurrent access of large-scale distributed power terminals under new power systems and meet the application requirements of distributed power grid connection. Attached Figure Description
[0033] Figure 1 This is a schematic diagram of a scenario where a distributed power supply terminal accesses the scheduling master station in this invention.
[0034] Figure 2 This is a schematic diagram of the distributed power terminal access authentication model in this invention.
[0035] Figure 3 This is a schematic diagram of the distributed power terminal access authentication process in this invention.
[0036] Figure 4 This is a schematic diagram of the power terminal access authentication interaction process based on consensus algorithm in this invention.
[0037] Figure 5 This is a schematic diagram comparing the authentication time of traditional and blockchain access when the access scale is small, as described in this invention.
[0038] Figure 6 This is a diagram showing the comparison of access times between traditional authentication and blockchain authentication methods in this invention.
[0039] Figure 7 This is a schematic diagram illustrating the relationship between blockchain length and block generation time in this invention. Detailed Implementation
[0040] To make the objectives, technical solutions, and advantages of the present invention clearer, 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.
[0041] The embodiments described in this invention are merely some, not all, of the embodiments of this invention. Based on the spirit of this invention, any other embodiments obtained by those skilled in the art without inventive effort are within the protection scope of this invention.
[0042] To address the shortcomings of existing technologies, this invention proposes a distributed power terminal access authentication method and system based on blockchain. Blockchain technology possesses characteristics such as decentralization, immutability, transparency, and traceability. Each power terminal participates in the network as a blockchain node, jointly maintaining and managing authentication information. Simultaneously, the grid connection authentication information of the power terminal is securely stored on the blockchain, preventing malicious tampering and providing a complete historical record, facilitating traceability and auditing of the grid connection process. Furthermore, the use of smart contracts in the blockchain allows for the definition of grid connection authentication conditions and procedures, achieving an automated authentication process, reducing manual intervention and errors, and improving authentication efficiency and accuracy.
[0043] Distributed photovoltaic (PV) and other distributed power sources access the dispatching agency through three methods: the power dispatching data network, a Virtual Private Network (VPN) based on an external public data network, and a wireless network. This enables the transmission of remote signaling and telemetry data to the dispatching agency's main station, and the receipt of remote control and adjustment commands from the main station. When the distributed power source interacts with the grid, authentication and access control of the terminal devices are required to prevent attackers from impersonating or controlling the distributed power source to access the dispatching main station and launch network attacks against the grid. Scenarios for distributed power source terminals accessing the dispatching main station include... Figure 1 As shown.
[0044] See Figure 2 The distributed power terminal access authentication model includes identity authentication and registration, access management, access request management, blockchain storage and auditing, smart contracts, and security and privacy protection.
[0045] (1) Identity Authentication and Registration: The distributed power terminal first needs to register in the blockchain network. The registration information includes the terminal's MAC address, serial number, public key and other unique identifiers, manufacturer information and other authentication information. This information will be encrypted and stored in one or more blocks of the blockchain. When the terminal attempts to access the scheduling master station, it provides its private key for authentication. The scheduling master station uses the corresponding public key to verify the validity of the private key, thereby confirming the terminal's identity.
[0046] (2) Access Control: In the blockchain network, different access permissions are set for each distributed power terminal. Permissions can be defined based on terminal type, owner, geographical location, or other factors. First, permissions are defined, specifying different permission levels (such as read-only, read-write, administrator, etc.) and factors affecting permissions (such as terminal type, owner, geographical location, etc.). Then, a smart contract is written, implementing a function to verify and assign access permissions. Finally, the smart contract is deployed to the blockchain, registering the distributed power terminal by calling the permission function and assigning it an initial access permission level. When a terminal requests access to the scheduling master station, the scheduling master station queries the blockchain to verify whether the terminal has the required access permissions. If the permission verification is successful, the scheduling master station will allow the terminal to access.
[0047] (3) Access Request Management: The distributed power terminal submits an access request to the scheduling master station through a secure channel (such as TLS / SSL). The request includes the terminal's identity information, the type of service requested, and other relevant information. Upon receiving the access request, the scheduling master station first verifies the integrity and authenticity of the request. Then, it uses blockchain to verify the terminal's identity and permissions. If the access request is successfully verified, the scheduling master station will send an access response to the terminal, which includes necessary information such as the access token and session key. The terminal uses this information to establish a secure communication channel with the scheduling master station.
[0048] (4) Blockchain Storage and Auditing: Each time a distributed power terminal successfully connects to the dispatch master station, an access event is recorded in the blockchain. These events include detailed data such as access time, terminal information, and service type. The immutability and transparency of the blockchain allow access records to be audited and queried. Any modification to the records will compromise the integrity of the blockchain, thus ensuring the authenticity and credibility of the data.
[0049] (5) Smart Contracts: Smart contracts can be used to automate the access authentication process for distributed power supply terminals. For example, when a terminal submits an access request, a smart contract can automatically verify its identity and permissions and generate an access token. Smart contracts allow for the customization of authentication rules based on business needs. These rules can be defined based on factors such as terminal attributes, access history, and security level. Access authentication methods or functions are defined in the smart contract, and authentication is performed according to preset rules, including minimum security levels and access history requirements. The access authentication algorithm process includes verifying identity, checking permissions, applying custom rules, and generating an access token.
[0050] (6) Communication between the distributed power supply terminal and the dispatch master station uses encryption technology to protect the confidentiality and integrity of data security and privacy protection; access control policies can restrict access to the dispatch master station's critical services to only authenticated and authorized terminals; data stored in the blockchain can protect user privacy through encryption and anonymization technologies. Furthermore, only authorized users can access specific data.
[0051] Based on the above model Figure 3 This invention illustrates a distributed power supply terminal access authentication process based on blockchain technology, including: the distributed power supply sending an access authentication request; the master node performing preliminary authentication; if the terminal signature is deemed invalid, authentication ends and the distributed power supply access is rejected; if the terminal signature is deemed valid, the blockchain is retrieved, nodes are matched, and a block is generated; the blockchain is recorded and updated; the master node sends the authentication result to the access terminal; authentication ends, and the distributed power supply access is allowed. Specifically, the blockchain-based distributed power supply terminal access authentication method disclosed in this invention includes the following steps:
[0052] Step 1: Receive the authentication request sent by the distributed power terminal node, extract the terminal public key from the authentication request, and perform signature verification on the distributed power terminal node.
[0053] First, the distributed power supply sends an access authentication request. The distributed power supply terminal node sends the authentication request to the master node via a secure channel (such as TLS / SSL). This request includes a unique identifier string (ID) for the terminal type field, the terminal public key (Pub), and a digital certificate (R) issued by an authorized authority. This information is used to verify the device's identity and authorization.
[0054] Next, the master node performs initial authentication. Upon receiving the authentication request, the master node performs initial authentication, using the terminal's public key to verify the validity of the terminal's signature. If the signature verification passes, the master node proceeds to the next step. If the signature verification fails, the distributed power supply access is rejected, and the authentication process ends.
[0055] According to a further embodiment, prior to step 1, the distributed power terminal first needs to register in an authentication blockchain network. Registration information includes the terminal's MAC address, serial number, public key, and other unique identifiers, manufacturer information, and other authentication information. This information is encrypted and stored in one or more blocks of the blockchain. When the terminal attempts to access the scheduling master station (master node), it provides its private key for authentication. The scheduling master station uses the corresponding public key to verify the validity of the private key, thereby confirming the terminal's identity.
[0056] Step 2: When the signature verification is successful, use the terminal identifier in the authentication request to search for a blockchain node in the authentication blockchain network that matches the distributed power terminal, and form a distributed authentication group from multiple blockchain nodes.
[0057] After the signature verification is successful, the master node uses the node type field extracted from the terminal ID as a keyword to search in the access authentication blockchain to find out if there is a legitimate node that has successfully connected to the power dispatch business system, has sufficient power and processing capabilities for running the authentication algorithm with a predefined threshold, and belongs to the same category or business as the distributed power terminal to be connected to the power dispatch business system.
[0058] Each time a distributed power terminal successfully connects to the scheduling master station, an access event is recorded in the blockchain. These events include detailed data such as access time, terminal information, and service type.
[0059] After retrieving the legitimate nodes, the master node extracts information about these nodes (such as access time, service type, operating status, node type, etc.) and performs a comprehensive match with the distributed power terminal to be connected. The matching process is based on a series of conditions and rules for logical judgment, and a distributed protocol request message is generated and sent to the master node to form a distributed authentication group composed of these nodes. The matching algorithm process is as follows:
[0060] (1) The master node retrieves the attribute information of legitimate nodes from the blockchain. The attribute information includes access time, business type, running status, node type, etc.
[0061] (2) Predefine a series of matching conditions based on business needs. For example, it may be necessary to match nodes with the same business type, or to find nodes with good operating status.
[0062] (3) Compare the information of the distributed power terminal to be connected with the information of the legitimate node to determine whether it meets the predefined matching conditions.
[0063] (4) If multiple nodes meet the matching conditions, the best match can be selected according to the predefined strategy (such as load balancing, response time, etc.).
[0064] Step 3: Broadcast the authentication request to the distributed authentication group and instruct all nodes in the distributed authentication group to perform access authentication based on the consensus algorithm. When the consensus authentication is successful, connect the distributed power terminal to the master node and update the authentication blockchain network.
[0065] The master node sends requests to the formed distributed authentication group via multicast, initiating the distributed authentication process. During this process, nodes within the authentication group use the public key certificates of the nodes to be added and a voting consensus algorithm to form new blocks. This process ensures that multiple nodes participate in authentication decisions in a decentralized network environment, improving the security and trustworthiness of the authentication.
[0066] Optionally, when a terminal submits an access request, the smart contract can automatically verify its identity and permissions and generate an access token; the smart contract can customize authentication rules according to business needs. These rules can be defined based on factors such as the terminal's attributes, access history, and security level.
[0067] Once distributed authentication is complete and a consensus is reached (i.e., whether the distributed power terminal is allowed to access), this result is recorded in the blockchain. This record is immutable and permanently stored, providing a basis for future auditing and traceability. Simultaneously, the blockchain is updated based on new access information.
[0068] Furthermore, when a terminal requests access to the scheduling master station, the scheduling master station queries the blockchain to verify whether the terminal has the required access permissions. If the permission verification is successful, the scheduling master station will allow the terminal to access the system.
[0069] In a further preferred embodiment, in the scenario of a distributed power supply access scheduling master station, the Practical Byzantine Fault-Tolerant (PBFT) algorithm is adopted to ensure consensus and consistency of authentication results among all participants. The power terminal access authentication interaction process based on the consensus algorithm is as follows: Figure 4 As shown, it includes the request phase, the pre-preparation phase, the preparation phase, the submission phase, and the response phase.
[0070] (1) Request Phase: The distributed power terminal to be connected sends its access request to the scheduling master station (i.e., the master node). The request information includes the terminal's registration information, which includes ID, Pub, and R. ID is a unique identifier string containing a terminal type field, representing the terminal's signature; Pub is the terminal's public key; and R is the digital certificate issued by the authorizing authority. The master node uses the terminal's public key to confirm the terminal's signature, extracts the request information to form a distributed authentication protocol request message, and the scheduling master station broadcasts the access request to all slave nodes (i.e., replica nodes) to participate in the consensus process.
[0071] (2) Pre-preparation phase: The master dispatcher sends the request number n, the client's request message m, and its own digital signature sig_primary to all replica nodes. Each replica node verifies the validity of the signature and message upon receiving the message. If the verification passes, it enters the preparation phase.
[0072] (3) Preparation Phase: Each replica node sends a preparation message to all other nodes (including the scheduling master). This message contains the request number n, the request message m, the scheduling master's signature sig_primary, and its own signature sig_replica. When a replica node receives more than 2f+1 preparation messages with the same request number n, the same request message m, and a valid signature, it enters the commit phase. f is the tolerable number of Byzantine fault nodes.
[0073] (4) Commit phase: The replica node sends a commit message to all other nodes. The message contains the request number n, the request message m, the signature sig_primary of the scheduling master, its own signature sig_replica, and the set of prepared messages received. When a replica node receives more than 2f+1 commit messages with the same request number n, the same request message m, and a valid signature, it determines that the request has been confirmed and returns the result to the client.
[0074] (5) Response phase: The scheduling master station and replica nodes return the processing results of the request to the power terminal to be connected.
[0075] Preferably, each node is assigned a dynamic weight based on its performance (such as verification speed, network communication quality, response time, etc.) and historical behavior (such as whether it has ever initiated malicious requests). The weights are calculated using a formula, and nodes with higher weights are prioritized during the consensus process.
[0076] Weight i =α·Performance i +β·Stability i +γ·History i
[0077] Among them, Weight i It is the weight of node i, Performance i Stability i and History i These represent the node's performance, stability, and historical behavior scores, respectively. α, β, and γ are weighting coefficients that can be adjusted according to actual needs.
[0078] In addition, when a node joins the system, it is given an initial weight based on its initial performance and historical behavior. During the consensus process, the weight is dynamically adjusted based on the actual performance of the node (such as response speed, verification accuracy, etc.). During the consensus process, the primary node and backup node are selected based on the node's weight.
[0079] In a preferred embodiment, the dynamic weight adjustment algorithm formula and process are as follows:
[0080] 1. Initial weight setting:
[0081] When a node joins the system, it is assigned an initial weight (W_init) based on its initial performance (such as computing power, storage capacity, etc.) and historical behavior (such as past performance in the system, number of times it has participated in consensus, etc.). For example:
[0082] W_init=α*Perf+β*Hist
[0083] Perf is the initial performance score of a node (which can be quantified according to specific metrics), Hist is the historical behavior score of a node (which can be quantified based on past performance), and α and β are weighting coefficients, which are set according to system requirements.
[0084] 2. Adjust weights during the consensus process:
[0085] During the consensus process, the system dynamically adjusts the weight of nodes based on their actual performance (such as response speed, verification accuracy, etc.).
[0086] For each consensus round, nodes generate a performance score (Perf). round ).
[0087] Performance scores can be calculated based on a combination of multiple indicators, such as response speed, verification accuracy, and resource consumption.
[0088] 3. Weight Update:
[0089] After each consensus round, the node's weight is updated based on its performance score.
[0090] The weight update formula is:
[0091] W new =W old *(1+ΔW)
[0092] W old This represents the weights at the end of the previous round. ΔW is the weight adjustment factor, based on Perf... round The calculation yields: ΔW = γ*(Perf) round -Avg Perf ) / Avg Perf .
[0093] Perf round Rate the performance of the current round node. (Avg) Perf This represents the average performance score of all participating nodes in the current round. γ is an adjustment coefficient that controls the sensitivity of weight adjustments.
[0094] 4. Selection of primary and backup nodes:
[0095] Before each consensus round begins, the master node and backup node are selected based on the weights of all current nodes.
[0096] The primary node is usually selected from the nodes with the highest weight, while backup nodes are selected in descending order of weight.
[0097] In the alternative approach, data compression technology is used to compress messages during the consensus process. Before sending a message, a compression algorithm (such as GZIP, Snappy, etc.) is used to compress the message. After receiving the message, the receiver uses the corresponding decompression algorithm to decompress the message to reduce the amount of data transmitted over the network. In addition, during message transmission, a message queue or buffer is designed to merge multiple small messages to be sent into a larger message and then send it all at once to reduce the number of messages in the network.
[0098] When a distributed power terminal is connected to the grid, both sending and receiving data require encryption and decryption. Therefore, a Hardware Security Module (HSM) is needed. This module stores the private key and provides secure key generation, storage, import, export, and destruction functions. It also provides encryption and decryption capabilities to ensure data security during transmission and storage. By integrating the HSM device into the authentication node's hardware architecture, when data encryption or decryption is required, the corresponding encryption or decryption function is called via the HSM's API, and the result is returned to the authentication node. The authentication node and HSM use security protocols such as TLS / SSL to achieve encrypted communication and authentication.
[0099] In one specific embodiment of the present invention, an experimental environment is constructed using a public blockchain network, with the Ethereum framework selected for construction. Ethereum is an open-source platform based on blockchain technology that supports the construction of distributed power access authentication smart contracts and decentralized applications. It utilizes its powerful virtual machine (EVM) and rich development tools to meet the requirements for building a power terminal access authentication application environment.
[0100] Next, a smart contract is written on Ethereum to implement the power terminal access authentication function, defining data structures and functions to store user information, verify user identity, and manage authentication status. A basic access authentication logic is implemented using the Solidity language:
[0101] contractAccessControl{
[0102] / / User information structure
[0103] struct User{
[0104] bool isVerified; / / Whether it has been verified
[0105] uint256 verificationTimestamp; / / Verification timestamp
[0106] }
[0107] / / User verification function, which can only be called by administrators or unverified users.
[0108] function verifyUser(address_user)public{
[0109] require(msg.sender==owner||!users[_user].isVerified,"Only owner or unverified users can call this function.");
[0110] / / Set the user to verified and record the current timestamp.
[0111] users[_user].isVerified=true;
[0112] users[_user].verificationTimestamp=block.timestamp;
[0113] / / Triggering event
[0114] emit UserVerified(_user,true,block.timestamp);
[0115] }
[0116] / / Function to check user authentication status; anyone can call it.
[0117] function isUserVerified(address_user)public view returns(bool){
[0118] return users[_user].isVerified;
[0119] }
[0120] Develop software programs for authentication nodes, including functions such as data collection, processing, signing, and broadcasting, to enable interaction with the blockchain network. Authentication nodes need to collect access authentication request data sent by distributed power terminals; the collected access request data needs to be cleaned, verified, and formatted for subsequent signing and broadcasting; the processed access request data is signed using a private key to ensure data integrity and the true identity of the power terminal sender; and the signed data is broadcast to other nodes on the blockchain network.
[0121] #Main Program
[0122] defmain():
[0123] #Data Collection
[0124] raw_data = collect_data()
[0125] #Data Processing
[0126] processed_data=process_data(raw_data)
[0127] #Signature data
[0128] signature=sign_data(processed_data,PRIVATE_KEY)
[0129] #Broadcast Data
[0130] broadcast_data(processed_data,signature)
[0131] if __name__ == "__main__":
[0132] main()
[0133] Deploying smart contracts onto a blockchain network allows for the testing and verification of authentication node software.
[0134] During power terminal registration, a unique device ID and key are generated for each power terminal. The terminal information (device ID, key, etc.) is then registered on the blockchain via a smart contract. When a terminal connects to the distributed power system, it sends an access request to the blockchain platform. The blockchain platform verifies the terminal's identity information and access permissions through the smart contract. If the verification is successful, the terminal is allowed to access the system, and relevant log information is recorded. Figure 5The experiment measured the time required for different numbers of power supply terminals to access the scheduling master station. During the experiment, it was found that under the traditional centralized access authentication scheme, as the number of authentication nodes increases, the computational and network overhead of the authentication center increases, authentication efficiency decreases, and authentication time increases rapidly. Under the blockchain-based distributed authentication scheme, when the number of distributed power supply terminal nodes is small, the authentication efficiency is lower than centralized authentication. This is because the overhead of running the distributed authentication protocol in the blockchain scheme accounts for a larger proportion when the network scale is small. As the scale of distributed power supply access increases, the authentication efficiency improves significantly.
[0135] from Figure 5 It can be seen that when the number of distributed power supply terminal nodes is small, the authentication time of blockchain authentication is relatively long compared to traditional authentication methods. However, as the number of terminal nodes increases significantly, the blockchain authentication time shows a decreasing trend. Figure 6 As shown.
[0136] The experiment revealed that as the blockchain length increases, the time required to generate new blocks also increases, but the overall performance degradation is not significant. This indicates that the blockchain can support concurrent access for large-scale distributed power generation terminals in new power systems, meeting the application requirements for distributed power grid connection. The relationship between blockchain length and block generation time is as follows: Figure 7 As shown.
[0137] The beneficial effects of this invention are that, compared with the prior art, it provides a blockchain-based distributed power terminal access authentication method and system, designs a detailed model and algorithm, and verifies its feasibility through implementation. By combining blockchain technology with distributed power access authentication, a decentralized, secure, and reliable authentication mechanism is achieved, which can support the concurrent access of large-scale distributed power terminals under new power systems and meet the application requirements of distributed power grid connection.
[0138] This invention can be a system, method, and / or computer program product. This invention also discloses a blockchain-based distributed power terminal access authentication system based on the aforementioned blockchain-based distributed power terminal access authentication method, comprising:
[0139] The signature verification module is used to receive the authentication request sent by the distributed power terminal node, extract the terminal public key in the authentication request, and perform signature verification on the distributed power terminal node at the master node.
[0140] The blockchain retrieval module is used to retrieve a blockchain node matching the distributed power terminal in the authentication blockchain network using the terminal identifier in the authentication request when the signature verification is passed, and to form a distributed authentication group from multiple blockchain nodes.
[0141] The consensus module is used to broadcast the authentication request to the distributed authentication group and instruct all nodes in the distributed authentication group to perform consensus authentication on the authentication request based on the consensus algorithm. When the consensus authentication is successful, the distributed power terminal is connected to the master node, and the authentication blockchain network is updated at the same time.
[0142] Based on the spirit of this invention, those skilled in the art will readily conceive of obtaining a computer program product based on the aforementioned blockchain-based distributed power terminal access authentication method. The computer program product may include a computer-readable storage medium on which computer-readable program instructions are loaded to enable a processor to implement various aspects of this invention. That is, this invention also includes a terminal comprising a processor and a storage medium; the storage medium is used to store instructions; the processor is used to operate according to the instructions to execute the steps of the aforementioned blockchain-based distributed power terminal access authentication method.
[0143] Computer-readable storage media can be tangible devices capable of holding and storing instructions for use by an instruction execution device. Computer-readable storage media can be, for example, but not limited to, electrical storage devices, magnetic storage devices, optical storage devices, electromagnetic storage devices, semiconductor storage devices, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of computer-readable storage media include: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), static random access memory (SRAM), portable compact disc read-only memory (CD-ROM), digital multifunction disc (DVD), memory sticks, floppy disks, mechanical encoding devices, such as punch cards or recessed protrusions storing instructions thereon, and any suitable combination of the foregoing. The computer-readable storage media used herein are not to be construed as transient signals themselves, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through waveguides or other transmission media (e.g., light pulses through fiber optic cables), or electrical signals transmitted through wires.
[0144] The computer-readable program instructions described herein can be downloaded from computer-readable storage media to various computing / processing devices, or downloaded via a network, such as the Internet, local area network, wide area network, and / or wireless network, to an external computer or external storage device. The network may include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers, and / or edge servers. A network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards them to the computer-readable storage media in the respective computing / processing device.
[0145] The computer program instructions used to perform the operations of this invention may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages such as Smalltalk, C++, etc., and conventional procedural programming languages such as the "C" language or similar programming languages. The computer-readable program instructions may be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or may be connected to an external computer (e.g., via the Internet using an Internet service provider). In some embodiments, electronic circuitry, such as programmable logic circuitry, field-programmable gate arrays (FPGAs), or programmable logic arrays (PLAs), is personalized by utilizing state information from the computer-readable program instructions. This electronic circuitry can execute the computer-readable program instructions to implement various aspects of the invention.
[0146] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit it. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that modifications or equivalent substitutions can still be made to the specific implementation of the present invention. Any modifications or equivalent substitutions that do not depart from the spirit and scope of the present invention should be covered within the protection scope of the claims of the present invention.
Claims
1. A blockchain-based distributed power terminal access authentication method, characterized in that, Includes the following steps: Receive authentication requests sent by distributed power terminal nodes, extract the terminal public key from the authentication request, and perform signature verification on the distributed power terminal nodes at the master node; When the signature verification is successful, the terminal identifier in the authentication request is used to search for a blockchain node in the authentication blockchain network that matches the distributed power terminal, and multiple blockchain nodes are combined into a distributed authentication group. The authentication request is broadcast to the distributed authentication group, and all nodes in the distributed authentication group are instructed to perform consensus authentication on the authentication request based on the consensus algorithm. When the consensus authentication is successful, the distributed power terminal is connected to the master node, and the authentication blockchain network is updated at the same time. The consensus authentication of the authentication request based on the consensus algorithm further includes: The primary node sends the request number n, the client's request message m, and its own digital signature sig_primary to all replica nodes; After receiving a message, each replica node verifies the signature and the validity of the message. If the verification passes, it enters the preparation phase. Each replica node sends a preparation message to all other nodes. This message contains the request number n, the request message m, the signature sig_primary of the scheduling master, and its own signature sig_replica. When a replica node receives more than 2f+1 preparation messages with the same request number n, the same request message m, and a valid signature, it enters the commit phase. Here, f is the number of nodes with tolerable Byzantine faults. During the commit phase, the replica node sends a commit message to all other nodes. This message contains the request number n, the request message m, the signature sig_primary of the scheduling master, its own signature sig_replica, and the set of prepared messages received. When a replica node receives more than 2f+1 commit messages with the same request number n, the same request message m, and a valid signature, it determines that the request has been confirmed and returns the result to the client. The step of retrieving a blockchain node that matches the distributed power terminal further includes: The master node retrieves the attribute information of legitimate nodes from the blockchain. The attribute information includes access time, business type, running status, and node type. Based on business requirements, a series of matching conditions are predefined. The information of the distributed power terminal to be connected is compared with the information of the legitimate nodes to determine whether it meets the predefined matching conditions. If multiple nodes meet the matching conditions, the best match is selected according to the predefined strategy. The method also includes: Dynamic weights are assigned to each node based on its performance, stability, and historical behavior. Weight i =α·Performance i +β· Stability i + γ· History i Among them, Weight i It is the weight of node i, Performance i Stability i and History i These represent the node's performance, stability, and historical behavior scores, respectively. α, β, and γ are weighting coefficients, and nodes with higher dynamic weights are prioritized during the consensus process. When a node joins the system, it is given an initial weight W_init based on its initial performance and historical behavior: W_init = α * Perf + β * Hist Perf is the initial performance score of a node, Hist is the historical behavior score of a node, and α and β are weighting coefficients. During the consensus process, the weights of nodes are dynamically adjusted based on their actual performance. For each consensus round, the node generates a performance score, Perf. round ; After each consensus round, the node's weight is updated based on its performance score: IN new = In old * (1 + ΔW) W old The weights at the end of the previous round; ΔW is the weight adjustment factor, based on Perf. round The calculation yields: ΔW = γ* (Perf) round - Avg Perf ) / Avg Perf ; Perf round Score the performance of the current round node; Avg Perf The average performance score of all participating nodes in the current round; γ is the adjustment coefficient, which controls the sensitivity of weight adjustment; Before each consensus round begins, a master node and backup nodes are selected based on the weights of all current nodes. The master node is selected from the nodes with the highest weights, while backup nodes are selected in descending order of weight.
2. The blockchain-based distributed power terminal access authentication method according to claim 1, characterized in that, The step of performing signature verification on the distributed power terminal node at the master node further includes: Distributed power terminal nodes send authentication requests to the master node through a secure channel. The authentication request includes a unique identifier string for the terminal type field, the terminal public key, and a digital certificate issued by an authorized authority to confirm the device's identity and authorization. After receiving the authentication request, the master node uses the terminal's public key to verify the validity of the terminal signature.
3. The blockchain-based distributed power terminal access authentication method according to claim 2, characterized in that, The step of retrieving a blockchain node matching the distributed power terminal in the authentication blockchain network using the terminal identifier in the authentication request further includes: The authentication blockchain network searches for legitimate nodes that have successfully connected to the power dispatching business system, have sufficient power and processing capabilities to run the authentication algorithm with a predefined threshold, and belong to the same category or business as the distributed power terminal to be connected to the power dispatching business system. Extract information about the legitimate nodes, including access time, service type, operating status, and node type, and perform a comprehensive matching with the distributed power terminal to be connected.
4. A blockchain-based distributed power terminal access authentication system, characterized in that, include: The signature verification module is used to receive the authentication request sent by the distributed power terminal node, extract the terminal public key in the authentication request, and perform signature verification on the distributed power terminal node at the master node. The blockchain retrieval module is used to retrieve a blockchain node matching the distributed power terminal in the authentication blockchain network using the terminal identifier in the authentication request when the signature verification is passed, and to form a distributed authentication group from multiple blockchain nodes. The consensus module is used to broadcast the authentication request to the distributed authentication group and instruct all nodes in the distributed authentication group to perform consensus authentication on the authentication request based on the consensus algorithm. When the consensus authentication is successful, the distributed power terminal is connected to the master node, and the authentication blockchain network is updated at the same time. The consensus module is further used for: The primary node sends the request number n, the client's request message m, and its own digital signature sig_primary to all replica nodes; After receiving a message, each replica node verifies the signature and the validity of the message. If the verification passes, it enters the preparation phase. Each replica node sends a preparation message to all other nodes. This message contains the request number n, the request message m, the signature sig_primary of the scheduling master, and its own signature sig_replica. When a replica node receives more than 2f+1 preparation messages with the same request number n, the same request message m, and a valid signature, it enters the commit phase. Here, f is the number of nodes with tolerable Byzantine faults. During the commit phase, the replica node sends a commit message to all other nodes. This message contains the request number n, the request message m, the signature sig_primary of the scheduling master, its own signature sig_replica, and the set of prepared messages received. When a replica node receives more than 2f+1 commit messages with the same request number n, the same request message m, and a valid signature, it determines that the request has been confirmed and returns the result to the client. The step of retrieving a blockchain node that matches the distributed power terminal further includes: The master node retrieves the attribute information of legitimate nodes from the blockchain. The attribute information includes access time, business type, running status, and node type. Based on business requirements, a series of matching conditions are predefined. The information of the distributed power terminal to be connected is compared with the information of the legitimate nodes to determine whether it meets the predefined matching conditions. If multiple nodes meet the matching conditions, the best match is selected according to the predefined strategy. The consensus module is further used for: Dynamic weights are assigned to each node based on its performance, stability, and historical behavior. Weight i =α·Performance i +β· Stability i + γ· History i Among them, Weight i It is the weight of node i, Performance i Stability i and History i These represent the node's performance, stability, and historical behavior scores, respectively. α, β, and γ are weighting coefficients, and nodes with higher dynamic weights are prioritized during the consensus process. When a node joins the system, it is given an initial weight W_init based on its initial performance and historical behavior: W_init = α * Perf + β * Hist Perf is the initial performance score of a node, Hist is the historical behavior score of a node, and α and β are weighting coefficients. During the consensus process, the weights of nodes are dynamically adjusted based on their actual performance. For each consensus round, the node generates a performance score, Perf. round ; After each consensus round, the node's weight is updated based on its performance score: IN new = In old * (1 + ΔW) W old The weights at the end of the previous round; ΔW is the weight adjustment factor, based on Perf. round The calculation yields: ΔW = γ* (Perf) round - Avg Perf ) / Avg Perf ; Perf round Score the performance of the current round node; Avg Perf The average performance score of all participating nodes in the current round; γ is the adjustment coefficient, which controls the sensitivity of weight adjustment; Before each consensus round begins, a master node and backup nodes are selected based on the weights of all current nodes. The master node is selected from the nodes with the highest weights, while backup nodes are selected in descending order of weight.
5. The blockchain-based distributed power terminal access authentication system according to claim 4, characterized in that, The signature verification module is further used for: Distributed power terminal nodes send authentication requests to the master node through a secure channel. The authentication request includes a unique identifier string for the terminal type field, the terminal public key, and a digital certificate issued by an authorized authority to confirm the device's identity and authorization. After receiving the authentication request, the master node uses the terminal's public key to verify the validity of the terminal signature.
6. The blockchain-based distributed power terminal access authentication system according to claim 5, characterized in that, The blockchain retrieval module is further used for: The authentication blockchain network searches for legitimate nodes that have successfully connected to the power dispatching business system, have sufficient power and processing capabilities to run the authentication algorithm with a predefined threshold, and belong to the same category or business as the distributed power terminal to be connected to the power dispatching business system. Extract information about the legitimate nodes, including access time, service type, operating status, and node type, and perform a comprehensive matching with the distributed power terminal to be connected.
7. A terminal, comprising a processor and a storage medium; characterized in that: The storage medium is used to store instructions; The processor is configured to operate according to the instructions to perform the steps of the blockchain-based distributed power terminal access authentication method according to any one of claims 1-3.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the program implements the steps of the blockchain-based distributed power terminal access authentication method as described in any one of claims 1-3.
Citation Information
Patent Citations
Block chain-based method for accessing power Internet of Things terminal
CN109495516A
Distributed identity authentication method and system based on alliance chain
CN112702346A
Distributed identity authentication method based on alliance chain
CN117376024A