Search

CN-121998763-A - Micro-grid blockchain quick transaction method based on optimization PBFT

CN121998763ACN 121998763 ACN121998763 ACN 121998763ACN-121998763-A

Abstract

The invention provides a micro-grid blockchain quick transaction method based on optimization PBFT. Firstly, collecting transaction history and output stability parameters of distributed energy nodes (DERs) in a micro-grid, and establishing a dynamic credit scoring model. Then, the common leader is selected from the candidate nodes by using a verifiable random function, so as to form a security access mechanism adapting to topology change. The leader node generates a variant Schnorr signature by combining the electric energy transaction data and the power distribution network state timestamp, and the variant Schnorr signature is transmitted in the logic fragments through multicast. And the duplicate nodes verify, generate partial signatures and aggregate to realize message compression. And finally, verifying the aggregate signature in batches, updating the credit and asynchronously caching the blocks. The method relieves PBFT communication congestion and delay in high-frequency transaction, and improves system throughput and scheduling stability.

Inventors

  • YANG HUAIZHOU
  • ZHANG WENDI
  • JIN CHAOGE

Assignees

  • 西安石油大学

Dates

Publication Date
20260508
Application Date
20260107

Claims (8)

  1. 1. The utility model provides a micro-grid blockchain quick transaction method based on optimization PBFT, which is characterized by comprising the following steps: s1, initializing and credit evaluating, namely receiving access requests of a plurality of distributed energy nodes (DERs) in a micro-grid, constructing a dynamic credit scoring model based on historical transaction data and power generation output stability parameters of each node, and storing credit scores in a distributed credit account book. And S2, the dynamic leader election, namely, when each consensus period starts, randomly electing from a set of nodes to be selected with the credit score higher than a preset threshold value by utilizing a Verifiable Random Function (VRF) in combination with the credit score to generate the round of leader nodes, so as to realize the admission of the non-fixed roles adapting to DERs dynamic topology changes. S3, pre-preparation and variant signature, wherein the leader node packages the electric energy transaction order to be agreed into blocks, fuses the real-time running time stamp of the power distribution network and the block hash to generate variant Schnorr leader signature, and broadcasts a pre-preparation message to the copy nodes through a multicast mechanism; And S4, generating and aggregating partial signatures, namely generating corresponding variant Schnorr partial signatures after each copy node verifies that the pre-prepared message passes, and generating a single aggregate signature message after collecting partial signatures meeting the threshold number and executing splicing and Hash aggregation operations. And S5, batch verification and block submission, wherein each node receives the aggregate signature message, performs batch verification by using elliptic curve point addition operation, submits the transaction block to the distributed account book after verification is passed, and synchronously updates the node credit scores in the credit account book. And S6, asynchronously replying and caching acceleration, namely writing the submitted block into a block cache pool, supporting asynchronously replying a confirmation result to a transaction node, and utilizing the block cache pool to rapidly respond to the historical block synchronous inquiry of the node so as to realize the low-delay confirmation of the micro-grid high-frequency point-to-point energy transaction.
  2. 2. The method for optimizing PBFT-based fast transaction of a micro-grid blockchain as in claim 1, wherein the method for creating the dynamic credit scoring model in step S1 includes: Step S11, an initial credit value C init is distributed for the distributed energy nodes (DERs) newly accessed into the micro-grid, and a calculation formula is as follows: C init =0.5+0.3×rand+0.2 (1) Wherein rand is the generated [0,1] interval random number. And S12, establishing a credit account book creditBook, and recording credit score, historical output stability parameters and historical transaction records of all nodes. And step S13, after each round of transaction consensus is completed, dynamically weighting and updating the score in creditBook according to the response speed of the node in the consensus process, signature validity and whether malicious view switching behaviors exist.
  3. 3. The method for rapid transaction of a micro-grid blockchain based on optimization PBFT of claim 1, wherein the specific operation steps of step S2 include: And S21, searching all candidate nodes from creditBook, and screening nodes with credit scores higher than a preset threshold (0.7) to enter a round of consensus candidate pool. And S22, calling a verifiable random function VRF based on a crypto Keccak256 algorithm, and generating a verifiable random proving value by taking the candidate node private key and the current block height as inputs. And S23, selecting a node with the smallest random proof value as a leader node of the round of consensus, thereby constructing a dynamic admission mode of a non-fixed role and avoiding the core node of the micro-grid from being subjected to targeted attack.
  4. 4. The method for rapid transaction of a micro-grid blockchain based on optimization PBFT of claim 1, wherein the specific operation steps of step S3 include: and S31, the leader node acquires a real-time running time stamp T of the power distribution network through the synchronous signal. Step S32, mixing the hash value m of the electric energy transaction block to be identified with the timestamp T by utilizing a variation Schnorr signature algorithm, and calculating a challenge value formula as follows: e=H(m||T||R) (2) wherein R is a random point selected by the master node. And step S33, generating a variant Schnorr leader signature containing time stamp information, and transmitting PREPREPARE messages to the copy nodes in the corresponding micro-grid slicing area by using a multicast mechanism.
  5. 5. The method for rapid transaction of a micro-grid blockchain based on optimization PBFT of claim 1, wherein the specific operation steps of step S4 include: Step S41, the copy node verifies the validity of the signature of the master node, and if the copy node passes the signature, a corresponding variation Schnorr part signature is generated according to the private key d i of the copy node s i =k i +e·d i (modn) (3) Where k i is the random scalar generated by the node. And step S42, the collecting node stores the received partial signature in the PENDINGSIGS cache area in a structuring mode according to the sequence number and the node ID. Step S43, when the number n of the collected partial signatures is not less than 2f+1, scalar aggregation processing is executed, and the method is as follows: s i =∑s i (mod n) (4) compressing the plurality of partial signatures into a single aggregate signature reduces the communication complexity from 0 (n 2) to 0 (n).
  6. 6. The method for rapid transaction of a micro-grid blockchain based on optimization PBFT of claim 1, wherein the specific operation steps of step S5 include: in step S51, the receiving node reconstructs the aggregate public key p= Σpiand the aggregate random point r=Σri by using the public keys of the duplicate nodes. Step S52, executing a batch verification equation based on point addition operation: sG=R+e·P (5) Wherein G is the base point of the elliptic curve. Step S53, if the equation is satisfied, the verification is passed and the verification cost is reduced from 0n to a constant order 01, and the block submission is completed and the account book state is updated.
  7. 7. A micro-grid blockchain quick transaction system based on optimization PBFT is characterized by comprising a credit evaluation and selection main module, a safety signature and communication module, a signature aggregation and batch verification module and a response acceleration and cache module, wherein the credit evaluation and selection main module is used for randomly selecting a leader node from distributed energy nodes based on a VRF function and a dynamic credit model, the safety signature and communication module is used for generating a variant Schnorr signature containing a power distribution network timestamp and transmitting PREPREPARE messages in a multicast mode, the signature aggregation and batch verification module is used for executing scalar aggregation of partial signatures in a preparation stage and executing batch verification of aggregated signatures in a Commit stage through elliptic curve point addition, and the response acceleration and cache module is used for writing the submitted blocks into a blockCache block cache pool and supporting quick recovery of high-frequency P2P electric energy transaction results by utilizing an asynchronous processing mechanism.
  8. 8. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor performs the steps of a micro-electric blockchain fast transaction method based on optimization PBFT as claimed in any one of claims 1-6.

Description

Micro-grid blockchain quick transaction method based on optimization PBFT Technical Field The invention relates to the technical field of block chain consensus mechanism and energy Internet, in particular to a micro-grid block chain quick transaction method, system, medium and equipment based on optimization PBFT (practical Bayesian fault tolerance). The invention aims at the high-frequency point-to-point (P2P) electric energy transaction demand of the distributed energy nodes (DERs) in the micro-grid environment, and aims at improving the consensus efficiency, the safety and the transaction throughput of the blockchain system in the bandwidth limited environment by deeply optimizing the consensus algorithm in a main selection mechanism, a signature strategy and a verification flow. Background As an important form of a distributed energy system, with the continuous improvement of the permeability of renewable energy sources (such as photovoltaic and wind power), the internal peer-to-peer (P2P) electric energy transaction is increasingly frequent, and the traditional centralized transaction mode has the problems of high transaction delay, communication congestion, large potential safety hazard, single-point fault risk and the like, so that the high-frequency, small-amount and real-time micro-grid energy transaction requirements cannot be met. The blockchain technology provides a new thought for micro-grid energy transaction by the characteristics of decentralization, non-tampering, transparency, traceability and the like, and the blockchain technology is applied to aspects of micro-grid distributed transaction, intelligent contract settlement, data security storage and the like in the prior study. Currently, the Practical Bayesian Fault Tolerance (PBFT) algorithm is widely applied to a alliance chain consensus mechanism due to high safety, low delay and Bayesian fault tolerance capability, and is particularly suitable for scenes with moderate node scale such as micro-grids. However, the conventional PBFT algorithm has the problems of easy fixed attack of the main node, high communication complexity (O (n 2)), high signature verification overhead and the like, and has low consensus efficiency and lower TPS (secure system) under the dynamic topology change, limited bandwidth and high concurrency transaction environment of the micro-grid, so that the quick transaction requirement of a large-scale distributed energy node (DERs) cannot be supported. In recent years, scholars at home and abroad perform various optimizations on PBFT, such as introducing a credit mechanism for dynamic selection, aggregating signatures for reducing communication overhead, reducing node participation by hierarchical consensus, and the like, but the existing scheme does not fully consider the specific power generation intermittence, real-time timestamp requirement and bandwidth constraint of a micro-grid, and is difficult to realize high safety and high efficiency at the same time. Although partial researches combine VRF random election and credit scoring, deep optimization of variant signature replay attack resistance and batch verification O (1) overhead is not integrated, so that the problems of large consensus delay, high safety risk and the like still exist in a micro-grid high-frequency P2P transaction scene. Therefore, the traditional PBFT and the existing optimization thereof are difficult to completely adapt to the requirements of real-time performance, safety and expansibility of the micro-grid energy transaction. Therefore, a PBFT optimization method for a micro-grid scene is needed, so that the consensus efficiency is improved, the communication and calculation overhead is reduced, and meanwhile, the system robustness and the attack resistance are enhanced. Disclosure of Invention The utility model provides a micro-grid blockchain quick transaction method based on optimization PBFT, which is characterized by comprising the following steps: Step 1, initializing and credit evaluation, namely receiving access requests of a plurality of distributed energy nodes (DERs) in a micro-grid, constructing a dynamic credit scoring model based on historical transaction data and power generation output stability parameters of each node, and storing credit scores in a distributed credit account book. And 2, selecting a dynamic leader, namely generating a leader node of the round by randomly selecting a node set to be selected with the credit score higher than a preset threshold value by utilizing a Verifiable Random Function (VRF) in combination with the credit score at the beginning of each consensus period, and realizing the admission of the non-fixed role adapting to DERs dynamic topology changes. And step 3, pre-preparing and variant signature, namely packaging the electric energy transaction order to be commonly known into blocks by the leader node, fusing the real-time running time stamp of the power distribution network and the hash