Resource aggregation layer distributed consensus method and system

By using the key negotiation algorithm of Schnorr protocol and DH algorithm of the virtual power plant, node reputation value calculation and target K-means algorithm to form a two-layer network structure, the energy consumption and communication overhead problems of the blockchain consensus mechanism of the virtual power plant are solved, and efficient and secure resource aggregation and transaction management are achieved.

CN120278816APending Publication Date: 2025-07-08YUNNAN POWER GRID CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202510209648.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-25
Publication Date
2025-07-08

AI Technical Summary

Technical Problem

The existing blockchain consensus mechanism has problems such as high energy consumption, slow transaction processing speed, and large communication overhead in virtual power plant scenarios, which is difficult to meet the diversified needs of multi-stakeholders in terms of transaction security, efficiency and fairness.

Method used

The key negotiation algorithm based on the Schnorr protocol and DH algorithm is used to perform node identity authentication and key negotiation, and a two-layer network structure is formed by combining node reputation value calculation and target K-means algorithm, and a view rotation protocol is introduced to handle master node exceptions.

Benefits of technology

It reduces computing and communication costs, improves consensus efficiency and system stability, enhances attack resistance, and ensures transaction security and data consistency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120278816A_ABST
    Figure CN120278816A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of application of a block chain in a virtual power plant, in particular to a resource aggregation layer distributed consensus method and system, and the method comprises the steps: completing node registration and identity authentication; the nodes are calculated and clustered to form a double-layer network structure; and consensus is carried out on the nodes according to a preset process. The method has the advantages that the defects of a traditional consensus algorithm in the aspects of energy consumption, transaction processing speed and large-scale node communication overhead are effectively overcome by adopting the preset consensus process, and efficient and safe resource aggregation and transaction management are achieved; a key negotiation algorithm based on a Schnorr protocol and a DH algorithm is adopted, so that the calculation and communication cost is reduced, a safe and reliable communication channel is provided for a distributed system, and the anti-attack capability of the system is enhanced; through a node reputation value calculation method integrating multiple factors and a target K-means algorithm, a multi-consensus-group double-layer network structure is formed, the communication overhead is reduced, and the consensus efficiency and the system stability are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of the application of blockchain in virtual power plants, and particularly to a distributed consensus method and system for a resource aggregation layer. Background Art

[0002] With the transformation of the global energy structure and the development of intelligent power grids, the virtual power plant (VPP), as an innovative energy management model, has gradually become an important part of the power industry. The virtual power plant integrates distributed energy resources (such as solar energy, wind energy, small hydropower stations, energy storage devices, etc.) to achieve unified coordination and optimized management of various energies, thereby improving energy utilization efficiency and enhancing the stability and reliability of the power grid. However, the operation of the virtual power plant involves multiple stakeholders, such as distributed power generation owners, energy storage operators, load aggregators, etc. These stakeholders have different interest demands and operation modes, making the resource aggregation and collaborative management of the virtual power plant face many challenges.

[0003] Blockchain technology, with its characteristics of decentralization, immutability, traceability, etc., provides a new solution for the resource management of virtual power plants. Blockchain can achieve trusted interaction and data sharing among different stakeholders, ensuring the authenticity and security of transactions. However, there are some problems with existing blockchain consensus mechanisms when applied to the virtual power plant scenario. For example, traditional consensus algorithms such as Proof of Work (PoW) have high energy consumption and slow transaction processing speed, making it difficult to meet the real-time requirements of the virtual power plant for rapid processing of power transactions. The Practical Byzantine Fault Tolerance (PBFT) algorithm has a large communication overhead when the number of nodes is large, and it is difficult to adapt to the high-frequency transaction requirements of large-scale nodes in virtual power plants.

[0004] In addition, the existing research on blockchain applications in virtual power plants mainly focuses on data storage and transaction records, lacking targeted optimization of consensus mechanisms. This makes it difficult for existing technologies to fully meet the diverse needs of multiple stakeholders in terms of transaction security, efficiency, and fairness in the complex environment of virtual power plants. Summary of the Invention

[0005] To solve the above technical problems, the present invention provides the following technical solutions:

[0006] In a first aspect, the present invention provides a distributed consensus method for a resource aggregation layer, including completing node registration and identity authentication;

[0007] Performing calculation and clustering on nodes to form a two-layer network structure;

[0008] Performing consensus on nodes according to a preset process.

[0009] As a preferred solution of the distributed consensus method for the resource aggregation layer of the present invention, wherein: Completing node registration and identity authentication includes:

[0010] The node submits a registration application, and the transaction supervisor reviews and issues an identity certificate;

[0011] A key negotiation algorithm based on the Schnorr protocol and the DH algorithm is used for secure authentication of node identities and efficient key negotiation.

[0012] As a preferred solution of the distributed consensus method for the resource aggregation layer of the present invention, wherein: Calculating and clustering nodes to form a two-layer network structure includes:

[0013] Calculate the reputation value of each node by considering preset factors;

[0014] According to the reputation value of the nodes, the target K-means algorithm is used to group and cluster the nodes to form a two-layer network structure of multiple consensus groups.

[0015] As a preferred solution of the distributed consensus method for the resource aggregation layer of the present invention, wherein: The two-layer network structure of multiple consensus groups includes a number of lower-layer consensus sets and an upper-layer consensus set. Among them, each lower-layer consensus set includes several consensus groups, and a consensus group includes a leader node and ordinary nodes.

[0016] As a preferred solution of the distributed consensus method for the resource aggregation layer of the present invention, wherein: The formula for calculating the node reputation value is:

[0017] R i =αT i +βS i +χC i +δA i

[0018] In the formula: T i is the transaction success rate of the node; S i is the stability of the node; C i is the communication quality of the node; A i is the activity of the node; α, β, χ, δ are weight coefficients, and α + β + χ + δ = 1.

[0019] As a preferred solution of the distributed consensus method for the resource aggregation layer of the present invention, wherein: The preset process includes four stages: registration, preparation, hierarchical consensus, and reputation value update.

[0020] As a preferred solution of the distributed consensus method for the resource aggregation layer of the present invention, wherein: The method further includes electing a new primary node through a view rotation protocol when the primary node has an abnormality, wherein the primary node is the leader node in the lower-layer consensus set;

[0021] The anomalies of the primary node include the failure of the primary node or the occurrence of Byzantine behavior.

[0022] In a second aspect, the present invention provides a resource aggregation layer distributed consensus system, including: an authentication module for completing node registration and identity authentication;

[0023] a computing module for performing calculations and clustering on nodes to form a two-layer network structure;

[0024] a consensus module for conducting consensus on nodes according to a preset process.

[0025] In a third aspect, the present invention provides a computer device, including a memory and a processor. The memory stores a computer program, and when the processor executes the computer program, the steps of the above method are implemented.

[0026] In a fourth aspect, the present invention provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the above method are implemented.

[0027] Compared with the prior art, the beneficial effects of the present invention are as follows: By adopting a preset consensus process, the deficiencies of traditional consensus algorithms in terms of energy consumption, transaction processing speed, and large-scale node communication overhead are effectively solved, and efficient and secure resource aggregation and transaction management are achieved; By adopting a key negotiation algorithm based on the Schnorr protocol and the DH algorithm, the calculation and communication costs are reduced, a secure and reliable communication channel is provided for the distributed system, and the anti-attack ability of the system is enhanced; Through a comprehensive multi-factor node reputation value calculation method and the target K-means algorithm, a two-layer network structure of multiple consensus groups is formed, reducing communication overhead, improving consensus efficiency and system stability, and at the same time enhancing the ability to resist malicious attacks; And by introducing a view rotation protocol, the stable operation of the system and data consistency are ensured when the primary node is abnormal. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the following drawings are only some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.

[0029] Figure 1 It is a schematic diagram of a two-layer network structure of multiple consensus groups.

[0030] Figure 2 It is a schematic diagram of the node consensus process.

[0031] Figure 3Schematic diagram of the consensus process for a double - layer network structure. Detailed implementation manners

[0032] To make the above - mentioned objects, features, and advantages of the present invention more obvious and understandable, the following will describe the detailed implementation manners of the present invention with reference to the accompanying drawings of the specification. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.

[0033] Example 1, referring to Figures 1 to 3 , which is the first embodiment of the present invention. This embodiment provides a resource aggregation layer distributed consensus method, including:

[0034] S1. Complete node registration and identity authentication.

[0035] Further, completing node registration and identity authentication includes:

[0036] The node submits a registration application, and the transaction supervisor reviews and issues an identity certificate.

[0037] It should be noted that in the virtual power plant electricity trading network, virtual power plant nodes need to meet the requirements of electricity trading qualifications. Before joining the blockchain network, the node must complete the registration phase, specifically including submitting a registration application to the transaction supervisor. The transaction supervisor is responsible for reviewing these registration applications to ensure that the nodes meet the corresponding conditions and regulations. Once the review is passed, the transaction supervisor will issue a unique identity certificate to the node and initialize the node information. This identity certificate serves as the unique identity identifier of the node in the blockchain network and plays a key role in the subsequent identity authentication process. Finally, after the node successfully passes the identity verification, it can safely participate in the consensus and trading activities in the electricity trading network.

[0038] Adopt a key negotiation algorithm based on the Schnorr protocol and the DH algorithm for secure authentication of node identities and efficient key negotiation.

[0039] The specific process is as follows:

[0040] Step 1: Parameter setting and distribution. The transaction supervisor randomly selects a prime number p, ensuring that p - 1 is divisible by the small prime number q, and at the same time selects the primitive root g modulo p as the generator. Subsequently, these two core parameters p and g are transmitted to node i and node j to lay the foundation for subsequent calculations.

[0041] Step 2: Node parameter calculation. After receiving the parameters, node i uses its own confidential private key a (satisfying 0 < a < q), according to the formula Y i = ga Perform operations modulo p to obtain the DH algorithm interaction parameter Y i Node j also, based on its private key (0 < b < q), through the formula Y j = g b mod p calculates Y j .

[0042] Step 3: Generate zero - knowledge proof. Node i selects a random number r1, first calculates R1 = g r1 , then calculates c1 = H(r1 × Y i ) according to the hash H function, and further obtains z1 = H(r1 + αc1), thus constructing the Schnorr zero - knowledge proof {R1, z1} of the node. Node j performs a similar operation, selects a random number r2, calculates R2 = g r2 and c2 = H(r2 × Y j ), and then obtains z2 = H(r2 + αc2), forming its Schnorr zero - knowledge proof {R2, z2}.

[0043] Step 4: Proof exchange and verification preparation. Node i sends the calculated Y i , R1 and z1 to node j, and node j sends Y j , R2 and z2 to node i, and both parties are ready to perform the verification operation.

[0044] Step 5: Key negotiation and determination. After node i receives the information from node j, it verifies its Schnorr proof. When holds, it indicates that the proof of node j is valid. At this time, node i calculates the shared key K according to the formula . Node j verifies the proof of node i. If holds, the proof is valid. Node j calculates the shared key K according to the formula . Thus, the key negotiation algorithm based on the zero - knowledge proof protocol and the DH algorithm is completed, realizing secure key negotiation.

[0045] Preferably, the unique mathematical design of the Schnorr protocol can achieve zero - knowledge proof, thus effectively reducing the computational and communication costs and significantly improving the authentication efficiency; the DH algorithm allows nodes to securely generate shared keys without pre - sharing keys, building a secure communication channel for distributed systems. Further, both the Schnorr protocol and the DH algorithm are based on the discrete logarithm problem, and the high computational complexity of the discrete logarithm problem provides strong security guarantees for these algorithms, enabling them to effectively resist various attacks and ensuring the security and reliability of identity authentication and key negotiation.

[0046] S2. Calculate and cluster the nodes to form a two - layer network structure.

[0047] Furthermore, the nodes are calculated and clustered to form a two-layer network structure, including:

[0048] Calculate the reputation value of each node by considering preset factors, where the preset factors include but are not limited to the transaction success rate, stability, communication quality, and activity of the node;

[0049] It should be noted that the transaction success rate of the node reflects the reliability and ability of the node in the transaction processing link.

[0050] Furthermore, the formula for calculating the node reputation value is:

[0051] R i = αT i + βS i + χC i + δA i

[0052] In the formula: T i is the transaction success rate of the node; S i is the stability of the node; C i is the communication quality of the node; A i is the activity of the node; α, β, χ, δ are weight coefficients, and α + β + χ + δ = 1. Among them, the weight coefficients can be dynamically adjusted according to the characteristics and requirements of the blockchain application scenario to highlight the key degree of different factors in a specific environment.

[0053] It should be noted that the calculation of the transaction success rate of the node is as follows:

[0054]

[0055] In the formula: t success is the number of successful transactions of the node in transaction processing; t tota l is the total number of transactions of the node in transaction processing.

[0056] Furthermore, the stability of the node (the larger S i , the stronger the stability of the node) is calculated as follows:

[0057]

[0058] In the formula: O i is the online duration, D i is the number of disconnections, and Δt is the duration of the statistical period.

[0059] Furthermore, the communication quality of the node (the higher the value of C i , the better the communication quality of the node) is calculated as follows:

[0060]

[0061] Where: L i is the packet loss rate during data transmission; D avg is the average delay during data transmission.

[0062] Furthermore, the activity of the node is calculated as follows:

[0063]

[0064] Where: is the number of transactions participated by node i within the trading cycle t; is the maximum number of transactions participated by all nodes within the trading cycle.

[0065] It should be further noted that at the initial stage of the node, relevant data of each node needs to be collected and the node is given an initial reputation value through calculation. By interacting with data sources such as transaction records and node operation logs in the blockchain network, information such as the number of successful transactions, online duration, number of disconnections, packet loss rate, average delay, and number of participation activities of the node is obtained, and substituted into the above reputation value calculation formula to determine the initial reputation value for each node. This initial reputation value serves as the basis for evaluating the subsequent behavior of the node in the network, provides an important reference basis for the classification and management of nodes in the initial stage of the system operation, preliminarily screens out relatively reliable and active nodes, and at the same time identifies nodes that may have problems, laying a foundation for subsequent hierarchical grouping clustering operations.

[0066] Group and cluster the nodes using the target K-means algorithm according to the reputation value of the nodes to form a two-layer network structure with multiple consensus groups.

[0067] It should be noted that after the initialization of the node reputation value, the target K-means algorithm is introduced to group and cluster the nodes. During the clustering process, the transaction success rate T i , stability S i , communication quality C i , activity A i , and reputation value R i are used as the key feature values of the target K-means algorithm. The specific process is as follows:

[0068] Step 1: Assume that there are n consensus nodes in the system. First, randomly select m nodes as the initial cluster centers C = {c1, c2,..., c m}, where: c k = (T k , S k , C k , A k , R k), where \(k = 1, 2, \cdots, m\) are the cluster centers, corresponding to the transaction success rate \(T\) of each node \(k\) k , stability \(S\) k , communication quality \(C\) k , activity \(A\) k and reputation value \(R\) k of these five characteristic values.

[0069] Step 2: For each consensus node \(i\), calculate the distance \(d\) between it and the \(m\) cluster centers using the following formula ik , and assign it to the cluster corresponding to the nearest cluster center:

[0070]

[0071] where: \(\omega\) T , \(\omega\) S , \(\omega\) C , \(\omega\) A , \(\omega\) R are the weight coefficients corresponding to each feature, which can be reasonably adjusted according to the actual needs and key attention factors of the blockchain network.

[0072] Step 3: Recalculate the center of each cluster \(C\) k , and select a node with the optimal comprehensive reputation index from the nodes within the cluster as the new clustering center \(D\) j . The formula is as follows:

[0073]

[0074] where: \(T\) j , \(S\) j , \(C\) j , \(A\) j , \(R\) j correspond to the five characteristic values of the transaction success rate, stability, communication quality, activity, and reputation value of node \(j\) respectively.

[0075] Repeat the above steps of node assignment and cluster center update until the cluster centers no longer change significantly or reach the preset maximum number of iterations, thereby completing the grouping and clustering of nodes.

[0076] Furthermore, the two-layer network structure of multiple consensus groups includes several lower-layer consensus sets and an upper-layer consensus set. Among them, each lower-layer consensus set includes several consensus groups, and a consensus group includes a leader node and ordinary nodes.

[0077] It should be noted that after clustering all consensus nodes using the target K-means algorithm, several lower-layer consensus sets will be formed within the network, and each lower-layer consensus set contains multiple consensus groups. In each consensus group, a leading node is elected based on various factors such as the reputation value, transaction success rate, and stability of the nodes. These leading nodes from different consensus groups jointly form the upper-layer consensus set and participate in the global consensus process. Within each consensus group of each lower-layer consensus set, the nodes are divided into leading nodes elected as members of the upper-layer consensus set and ordinary nodes that are not elected. In the upper-layer consensus set, the main nodes (the leading nodes in the lower-layer consensus set, where the main nodes include active main nodes and passive main nodes, and the active main nodes drive the passive main nodes to conduct consensus) dominate the relevant operations, and the remaining nodes from each consensus group of the lower-layer consensus set act as slave nodes (ordinary nodes in the lower-layer consensus set) to cooperate. Thus, the local consensus of each consensus group in the lower-layer consensus set and the global consensus of the upper-layer consensus set constitute a multi-consensus-group double-layer network structure, which helps to improve the consensus efficiency and ensure the stability and reliability of the system.

[0078] Furthermore, it should be noted that when conducting consensus using a bottom-up double-layer network architecture, the nodes within the consensus group complete the identity authentication within the consensus set based on zero-knowledge proofs. Subsequently, the main nodes in the upper-layer consensus set first package the transactions. The consensus main nodes in the lower-layer affiliated consensus groups will broadcast their identity information within the blockchain network. After receiving the message, the other main nodes will also verify the identity of this main node according to the zero-knowledge proof authentication protocol, and the main nodes form the upper-layer consensus. During the consensus process in the upper-layer consensus set, when the main nodes in the upper-layer consensus set receive a certain number of confirmation messages, it indicates that the consensus is successful. The main nodes in each upper-layer consensus set can directly broadcast the consensus result within their respective lower-layer consensus groups without the need to separately execute consensus verification, thus significantly reducing the communication overhead and consensus efficiency during the consensus process.

[0079] As Figure 3 shown, the main nodes in the upper-layer consensus set lead the slave nodes in their respective consensus groups to complete the first round of local consensus process. If the local consensus is successfully executed, the leading nodes in the lower-layer consensus groups will submit the consensus result to the upper-layer consensus set and act as the main nodes for this round of consensus in the upper-layer consensus set to complete the second round of global consensus. It should be noted that in the blockchain network, if two nodes are going to conduct a transaction, they first complete the identity verification according to the key agreement algorithm of zero-knowledge identity authentication and obtain the shared key to transmit the transaction information to execute the subsequent transaction process. The zero-knowledge identity authentication process will be recorded on the blockchain. Before conducting consensus on the encrypted transaction information sent by the two trading parties, the consensus nodes need to verify the identity through the on-chain proof process and then can execute the consensus.

[0080] S3. Conduct consensus on the nodes according to the preset process.

[0081] Further, the consensus of nodes according to a preset process includes:

[0082] The preset process includes four stages: registration, preparation, hierarchical consensus, and reputation value update.

[0083] Specifically, in the registration stage: in the virtual power plant electricity trading network, virtual power plant nodes need to meet the requirements for electricity trading qualifications. Before a node joins the blockchain network, it must complete the registration process, which includes submitting a registration application to the trading regulator. The trading regulator is responsible for reviewing these registration applications to ensure that the nodes meet the corresponding conditions and regulations. Once the review is passed, the trading regulator will issue a unique identity certificate to the node and initialize the node information. This identity certificate serves as the unique identity identifier of the node in the blockchain network and plays a key role in the subsequent identity authentication process. In this way, after successfully passing the identity verification, the node can safely participate in the consensus and trading activities in the electricity trading network.

[0084] In the preparation stage: the initial reputation value of the node will be obtained, and the nodes will be clustered according to the target K-means algorithm and divided into m lower-level consensus groups. Next, the nodes in each consensus group will execute the authentication protocol to ensure the legitimacy of their identities and exchange necessary information with other nodes. Subsequently, based on the results of the reputation value, a leader node will be elected in each consensus group, and together with other leader nodes, they will form the master nodes of the upper-level consensus set. This process ensures that in electricity trading, the nodes are effectively organized and classified, and there is a leader node in each lower-level consensus group to manage and coordinate the consensus process. This hierarchical structure helps to improve the efficiency and reliability of electricity trading.

[0085] The hierarchical consensus stage: mainly consists of two parts: the consensus of the lower-level consensus set and the consensus of the upper-level consensus set. In the lower-level consensus set, the slave nodes of each consensus group conduct consensus on the blocks proposed by the leader nodes of the lower-level consensus group. Once the lower-level consensus is successful, the leader node will send the block to the upper-level consensus set, and then this leader node will act as the active master node of the upper-level consensus set to guide the completion of the consensus of the upper-level consensus set. Finally, the blocks passed through the consensus will be broadcast by the master nodes in the upper-level consensus set to each lower-level consensus group in the lower-level consensus set, and the slave nodes will verify and update the local ledger after passing. This process can not only ensure the effective transmission of consensus and the verification of blocks, but also ensure the consistency and security of data.

[0086] Reputation value update phase: Based on the transaction behavior of nodes in the current consensus, the reputation value is updated. In leader election, factors such as transaction success rate, stability, communication quality, and activity are usually considered. Based on these factors, nodes can calculate their reputation values and submit them to the consensus system to participate in leader election. This helps ensure that the selection of leader nodes is based on the actual performance and contributions of each node, thereby improving the efficiency and reliability of the consensus system.

[0087] It should be noted that the successful completion of each round of consensus or consensus timeout will trigger a view change to enter a new round of the consensus process. Usually, the consensus system will set a threshold, and when this threshold is reached, a view change will be triggered to start a new consensus cycle. Before the start of this new cycle, the consensus system usually reapplies the target K-means algorithm to partition the nodes into a consensus set. This process ensures that in the power trading network, consensus can be completed within a certain time and number of rounds, while allowing view changes under certain conditions to handle possible consensus failures or timeouts. Repartitioning the consensus group helps adapt to changes and dynamics of nodes in the network, improving the robustness and performance of the consensus system.

[0088] Furthermore, the method also includes electing a new primary node through a view rotation protocol when the primary node is abnormal, where the primary node is the leader node in the lower-level consensus set;

[0089] The abnormality of the primary node includes the failure of the primary node or the occurrence of Byzantine behavior.

[0090] It should be noted that the view rotation protocol is a key link to ensure the continuous and stable operation of the system. Its design aims to effectively handle abnormal situations such as the failure of the primary node or Byzantine behavior, ensuring the uninterrupted progress of the consensus process and the maintenance of data consistency. Specifically, when the following trigger conditions occur during the system operation, the view rotation process will be initiated: First, the primary node fails to successfully respond to the request messages of other nodes within a preset time interval and does not respond to the messages in the prepare phase or commit phase within the preset time; Second, when the primary node deliberately sends different messages to other nodes in the pre-prepare phase, and other nodes detect inconsistencies during the message verification phase and determine that the primary node is malicious, they will initiate the view switching protocol. Once the view rotation is triggered, the system will execute the following rigorous steps: First, the node broadcasts a view change message (VIEW-CHANGE), which encapsulates in detail the current view number (v) of the node, the latest stable checkpoint information (checkpoint), the node's own identity identifier (node_id), and a brief description of the abnormal behavior of the current primary node (abnormal_description). After receiving this message, other nodes will strictly verify it based on the information recorded by themselves, including checking the continuity of the view number, verifying the consistency of the checkpoint information, and validating the legitimacy of the sending node. If the verification passes, the receiving node will record the view change message locally and continue to wait for similar messages from different nodes.

[0091] When a node collects more than [2f + 1] (f is the maximum number of Byzantine nodes allowed in the system) valid view change messages, it will elect a new primary node according to predefined rules. The election process comprehensively considers the reputation values of the nodes. After the new primary node is elected, it will broadcast a new view message (NEW-VIEW), which contains the new view number (v + 1), its own identity authentication information (new_primary_auth_info), and the updated system configuration parameters (such as cluster division information, communication protocol parameters, etc.). After receiving the new view message, other nodes will conduct a comprehensive verification again, including verifying the legitimacy of the new primary node, checking the correctness of the view number, and comparing the consistency of the system configuration parameters. After successful verification, the node updates the local view state and continues the subsequent consensus process according to the instructions of the new primary node, such as resending the unfinished transaction requests, updating the local ledger information, etc., so as to ensure that the system can quickly resume normal operation after the primary node anomaly, maintain the consistency and integrity of the data, and ensure the reliability and stability of the blockchain system.

[0092] In summary, the beneficial effects of the distributed consensus method for the resource aggregation layer of the present invention are as follows: By adopting the preset consensus process, it effectively solves the deficiencies of traditional consensus algorithms in terms of energy consumption, transaction processing speed, and large-scale node communication overhead, and realizes efficient and secure resource aggregation and transaction management; By adopting the key negotiation algorithm based on the Schnorr protocol and the DH algorithm, it reduces the computing and communication costs, provides a secure and reliable communication channel for the distributed system, and enhances the anti-attack ability of the system; Through the comprehensive multi-factor node reputation value calculation method and the target K-means algorithm, it forms a double-layer network structure of multiple consensus groups, reduces the communication overhead, improves the consensus efficiency and system stability, and at the same time enhances the resistance to malicious attacks; And by introducing the view rotation protocol, it ensures the stable operation of the system and data consistency when the primary node is abnormal.

[0093] Embodiment 2 is the second embodiment of the present invention. This embodiment provides a distributed consensus system for the resource aggregation layer, including an authentication module for completing node registration and identity authentication;

[0094] A calculation module for calculating and clustering nodes to form a double-layer network structure;

[0095] A consensus module for conducting consensus on nodes according to a preset process.

[0096] Embodiment 3 is the third embodiment of the present invention. The difference from the previous two embodiments is:

[0097] If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or a part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods in the various embodiments of the present invention. And the aforementioned storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memories (ROM, Read-Only Memory), random access memories (RAM, Random Access Memory), magnetic disks, or optical discs that can store program codes.

[0098] Logic and / or steps represented in a flowchart or otherwise described herein, for example, can be considered as a definitional list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by or in connection with an instruction execution system, apparatus, or device, such as a computer-based system, a system including a processor, or other systems that can fetch instructions from and execute instructions of the instruction execution system, apparatus, or device. As used in this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate, or transport a program for use by or in connection with the instruction execution system, apparatus, or device.

[0099] More specific examples (non-exhaustive list) of computer-readable media include the following: an electrical connection part (electronic device) having one or more wirings, a portable computer diskette (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disc read-only memory (CDROM). Additionally, the computer-readable medium can even be paper or other suitable media on which a program can be printed, as the program can be obtained electronically, for example, by optically scanning the paper or other media, followed by editing, interpretation, or other suitable processing as necessary, and then stored in a computer memory.

[0100] It should be understood that various parts of the present invention can be implemented by hardware, software, firmware, or a combination thereof. In the above-described embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, any one or a combination of the following techniques well known in the art can be used: discrete logic circuits having logic gate circuits for implementing logical functions on data signals, application-specific integrated circuits having appropriate combinational logic gate circuits, programmable gate arrays (PGAs), field programmable gate arrays (FPGAs), etc.

[0101] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit them. Although the present invention has been described in detail with reference to the preferred embodiments, those of ordinary skill in the art should understand that the technical solutions of the present invention can be modified or equivalently replaced without departing from the spirit and scope of the technical solutions of the present invention, and they should all be covered by the scope of the claims of the present invention.

Claims

1. A distributed consensus method for a resource aggregation layer, characterized in that: Including: Completing node registration and identity authentication; Calculating and clustering nodes to form a two-layer network structure; Performing consensus on nodes according to a preset process.

2. The distributed consensus method for the resource aggregation layer according to claim 1, wherein: The completion of node registration and identity authentication includes: The node submits a registration application, and the transaction supervisor reviews and issues an identity certificate; Adopting a key negotiation algorithm based on the Schnorr protocol and the DH algorithm for secure authentication of node identities and efficient key negotiation.

3. The distributed consensus method for the resource aggregation layer according to claim 2, wherein: The calculation and clustering of nodes to form a two-layer network structure includes: Calculating the reputation value of each node by considering preset factors; Grouping and clustering nodes using the target K-means algorithm according to the reputation value of the nodes to form a two-layer network structure with multiple consensus groups.

4. The distributed consensus method for the resource aggregation layer according to claim 3, wherein: The two-layer network structure with multiple consensus groups includes a number of lower-layer consensus sets and an upper-layer consensus set. Among them, each lower-layer consensus set includes a number of consensus groups, and each consensus group includes a leader node and ordinary nodes.

5. The distributed consensus method for the resource aggregation layer according to claim 4, wherein: The formula for calculating the node reputation value is: R i = αT i + βS i + χC i + δA i Where: T i is the transaction success rate of the node; S i is the stability of the node; C i is the communication quality of the node; A i is the activity of the node; α, β, χ, δ are weight coefficients, and α + β + χ + δ = 1.

6. The distributed consensus method for the resource aggregation layer according to claim 5, characterized in that: The preset process includes four stages: registration, preparation, hierarchical consensus, and reputation value update.

7. The distributed consensus method for the resource aggregation layer according to any one of claims 4 to 6, characterized in that: The method further includes that when the main node has an abnormality, a new main node is elected through a view rotation protocol, where the main node is the leader node in the lower-layer consensus set; The situation where the main node has an abnormality includes the failure of the main node or the occurrence of Byzantine behavior.

8. A distributed consensus system for a resource aggregation layer, characterized in that, Including: An authentication module for completing node registration and identity authentication; A calculation module for calculating and clustering nodes to form a two-layer network structure; A consensus module for performing consensus on nodes according to a preset process.

9. A computer device, comprising a memory and a processor, the memory storing a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method described in any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the steps of the method described in any one of claims 1 to 7.

Citation Information

Cited By

  • Virtual power plant data aggregation method based on edge calculation and consensus mechanism

    CN121567708A