Performance Optimization Method for Blockchain Consensus Mechanism Based on CPE-BFT Algorithm

CN116962426BActive Publication Date: 2026-09-01HARBIN ENG UNIV +2
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311063716.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-08-23
Publication Date
2026-09-01
Estimated Expiration
2043-08-23

AI Technical Summary

Technical Problem

但在资源分布不平衡场景下,节点间的计算与通信等决定自身共识能力强弱的资源差距极大,资源受限设备的计算、带宽等资源主要用于其核心业务功能,难以有额外的资源运行区块链的共识机制,导致系统对于交易的共识速度下降,进而降低区块链系统的性能

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116962426B_ABST
    Figure CN116962426B_ABST
Patent Text Reader

Abstract

This invention discloses a performance optimization method for blockchain consensus mechanisms based on the CPE-BFT algorithm. Belonging to the field of blockchain consensus, this invention includes: constructing a consensus performance evaluation module; evaluating the consensus capability of blockchain nodes based on the consensus performance evaluation module; selecting resource-constrained nodes based on the consensus capability, wherein the resource-constrained nodes include: a node committee and regular nodes; electing a node committee from the resource-constrained nodes based on the CPE-BFT algorithm; and conducting leadership consensus for the regular nodes based on the node committee. This invention achieves higher system throughput and lower latency than existing algorithms in scenarios with unbalanced resource distribution, i.e., higher consensus efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of blockchain consensus mechanism technology, and in particular relates to a performance optimization method for blockchain consensus mechanism based on CPE-BFT algorithm. Background Technology

[0002] In an industrial context, smart factories are seeing a surge of IoT devices, with various intelligent devices permeating the entire industrial production environment. However, the proliferation of intelligent sensor devices—including dedicated server equipment with abundant computing, bandwidth, and storage resources, as well as many resource-constrained intelligent sensor devices—has led to an imbalance in the distribution of system resources.

[0003] These IoT scenarios often exhibit an unbalanced distribution of node resources, where some nodes within the system are unable to store complete ledger data due to limited disk space. Existing storage solutions mostly employ a method of not storing complete blocks to reduce node storage pressure.

[0004] Blockchain, as a storage system based on Distributed Ledger Technologies (DLTs), possesses characteristics such as decentralization, transparency, openness, autonomy, anonymity, and immutability. Blockchain systems do not rely on authoritative central institutions and can provide decentralized management of data in scenarios such as the Industrial Internet of Things (IIoT), the Internet of Vehicles (IoV), and smart homes, offering guarantees of security and consistency. It helps eliminate information barriers between various complex devices, enhancing the application value of data. In short, blockchain is a powerful tool for secure and efficient data management in the era of the Internet of Everything.

[0005] The performance of a blockchain depends primarily on the consensus speed and the access speed of the ledger data. In scenarios with uneven resource distribution, resource-constrained nodes act as the performance bottleneck of the entire system, severely restricting the overall consensus speed and access speed of the ledger data.

[0006] In existing technologies, regarding the consensus process in a Byzantine environment, blockchain's distributed consensus requires all nodes to participate in the consensus process. However, in scenarios with uneven resource distribution, the resource gap between nodes, such as computation and communication, which determines the strength of their consensus capabilities, is enormous. Resource-constrained devices primarily use their core business functions for computing power and bandwidth, leaving little additional resources to run the blockchain's consensus mechanism. This results in a decrease in the system's consensus speed for transactions, thereby reducing the performance of the blockchain system. Summary of the Invention

[0007] This invention proposes a performance optimization method for blockchain consensus mechanisms based on the CPE-BFT algorithm to solve the technical problems existing in the prior art.

[0008] To achieve the above objectives, this invention provides a performance optimization method for blockchain consensus mechanisms based on the CPE-BFT algorithm, comprising: Construct a consensus performance evaluation module, and evaluate the consensus capability of blockchain nodes based on the consensus performance evaluation module; Based on the aforementioned consensus capability, resource-constrained nodes are selected; Based on the CPE-BFT algorithm, a node committee is elected from the resource-constrained nodes, and a leadership consensus is achieved among the regular nodes in the resource-constrained nodes based on the node committee.

[0009] Preferably, the process of evaluating the consensus capability of blockchain nodes includes: The performance metrics of blockchain nodes in the consensus process are selected as node evaluation metrics. Based on the node evaluation index, the weight of the evaluation index is obtained by the entropy weight method. Based on the node evaluation metrics and their weights, the consensus capability of blockchain nodes is evaluated using a node consensus performance evaluation algorithm.

[0010] Preferably, the process of obtaining the evaluation index weights using the entropy weight method includes: The node evaluation indicators are standardized to obtain standardized indicators. Based on the standardized indicators, the entropy weights of the standardized indicators are calculated, and the evaluation indicator weights are calculated based on the entropy weights of the standardized indicators.

[0011] Preferably, the process of evaluating the consensus capability of blockchain nodes using a node consensus performance evaluation algorithm includes: Obtain the optimal and worst solutions for node evaluation metrics. Based on the optimal and worst solutions, use the distance between optimal and worst solutions to obtain the node ranking. Based on the node ranking, obtain the consensus capability of the nodes.

[0012] Preferably, the process of electing a node committee among the resource-constrained nodes includes: Based on the consensus capability of the nodes, the node evaluation score is calculated. Based on the node evaluation score, the selection weight is calculated. Based on the selection weight, the node committee is elected through the node committee election algorithm.

[0013] Preferably, the process of achieving leadership consensus among the regular nodes in the resource-constrained nodes based on the node committee includes: Obtain the master node in the node committee, and broadcast the prepared message based on the master node; Obtain a copy of the root committee from the node committee, formulate the BFT protocol based on the root committee copy, and make an effective judgment on the pre-prepared message based on the BFT protocol; If the prepared message is valid, the prepared message is broadcast, and the root committee is judged whether it has received the prepared message. Based on the judgment result, different operations are taken.

[0014] Preferably, the process of taking different operations based on the judgment result includes: If the root committee receives a pre-commit message, the root committee replica broadcasts a pre-commit message. Based on the pre-commit message, the number of faulty nodes in the root committee is determined. If the number of faulty nodes exceeds half of the number of root committee members, the root committee members receive timeout complaints from regular nodes regarding the blocks in the pre-commit message; otherwise, no timeout complaint is made. Based on the timeout message of the timeout complaint, the root committee replica forwards the missing block loss message. If the root committee members do not receive the prepared message, the root committee replica recovers the lost block message by querying the regular nodes.

[0015] Preferably, it further includes: In the event of a view switch, the view of the node committee and ordinary nodes is changed. After the view change is successful, a new node committee is re-elected, and a leadership consensus is reached for the ordinary nodes based on the new node committee.

[0016] Compared with the prior art, the present invention has the following advantages and technical effects: This invention proposes a performance optimization method for blockchain consensus mechanisms based on the CPE-BFT algorithm. The method involves constructing a consensus performance evaluation module to evaluate the consensus capabilities of blockchain nodes; selecting resource-constrained nodes based on these capabilities, including a node committee and regular nodes; electing a node committee from among the resource-constrained nodes using the CPE-BFT algorithm; and conducting leadership consensus for the regular nodes based on the node committee.

[0017] This invention employs a node consensus performance evaluation model. Based on the node performance during the consensus process, it uses the entropy weight-superiority solution distance method to score node consensus performance, determine the contribution score of all nodes, and quantify and distinguish resource-constrained nodes. This invention utilizes the CPE-BFT algorithm model to elect a high-performance node committee to lead all nodes in consensus, restricting the consensus operation to within this high-performance node committee. This high-performance node committee then leads other nodes in reaching consensus on transactions, improving the overall system consensus speed. In scenarios with uneven resource distribution, this invention achieves higher system throughput and lower latency than existing algorithms, i.e., higher consensus efficiency. Attached Figure Description

[0018] The accompanying drawings, which form part of this application, are used to provide a further understanding of this application. The illustrative embodiments and descriptions of this application are used to explain this application and do not constitute an undue limitation of this application. In the drawings: Figure 1 This is a flowchart of the CPE-BFT system according to an embodiment of the present invention; Figure 2 This is a schematic diagram illustrating the impact of block size on system throughput in an embodiment of the present invention; Figure 3 This is a schematic diagram illustrating the impact of block size on latency in an embodiment of the present invention; Figure 4 This is a schematic diagram illustrating the impact of runtime on system throughput in an embodiment of the present invention; Figure 5 This is a schematic diagram illustrating the impact of runtime on latency in an embodiment of the present invention; Figure 6 This is a schematic diagram illustrating the impact of the proportion of resource-constrained nodes on system throughput in an embodiment of the present invention. Figure 7 This is a schematic diagram illustrating the impact of the proportion of resource-constrained nodes on latency in an embodiment of the present invention. Detailed Implementation

[0019] It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other. This application will now be described in detail with reference to the accompanying drawings and embodiments.

[0020] It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases the steps shown or described may be executed in a different order than that shown here.

[0021] Example 1 like Figure 1 As shown, this embodiment provides a performance optimization method for blockchain consensus mechanisms based on the CPE-BFT algorithm, including: Step 001. Propose a consensus performance evaluation model to evaluate the consensus capability of nodes.

[0022] Step 002. Propose the CPE-BFT algorithm model to solve the problem of reduced overall consensus speed caused by resource-constrained nodes participating in the three-phase consensus process.

[0023] Step 001 specifically includes the following steps: Step 00101. Propose evaluation metrics for the node consensus performance evaluation model; The following performance metrics are selected for the node consensus capability evaluation model: message verification rate, message generation rate, and block generation rate during the consensus message generation and verification phases, and node transmission power and throughput during the consensus message transmission phase. This is based on the performance of all nodes within the system. The consensus performance in the previous consensus process. The node consensus performance evaluation metrics are shown in Table 1.

[0024] Table 1 In Table 1, This column represents the data transmission power of nodes in the blockchain system. The data transmission capacity is such that a larger value indicates a larger amount of data transmitted per unit of time. This indicates the rate at which nodes verify consensus messages. The larger the value in this column, the more messages a node can verify per unit of time. This column represents the message generation rate of the node. The larger the value in this column, the more messages the node generates per unit of time. This column represents the message throughput of a node. The larger the value in this column, the more messages are sent per unit of time. This column represents the block production rate of a node. The larger the value in this column, the higher the block production rate of the node.

[0025] Step 00102. Propose determining the weights of evaluation indicators based on the entropy weight method. The specific operation is as follows: The indicator data from the previous consensus process were standardized, and the nodes... The Evaluation indicators The standardized calculation formula is: No. The entropy weights of the indicators are: Then the first The weighting coefficients for each indicator are: The weight vector for the node consensus performance evaluation index is: Step 00103. Based on the evaluation indicators and their weights, the Node Consensus Performance Evaluation Algorithm Based on the Best-in-Best Solution Distance Method (TOPSIS) is used to evaluate the consensus performance of the nodes. By assuming positive and negative ideal solutions, the distance between each sample and the positive and negative ideal solutions is calculated to obtain its relative closeness to the ideal solution (i.e., the closer to the positive ideal solution and the farther from the negative ideal solution), and the better-in-best of each evaluation object is ranked. The TOPSIS method avoids the subjectivity of the data, does not require an objective function, does not require a pass / fail test, and can well characterize the comprehensive influence of multiple influencing indicators.

[0026] The optimal solution is the set of values ​​where each indicator is at its best, while the worst solution is the set of values ​​where each indicator is at its worst. These sets are generally calculated through comparison. The ranking of nodes is determined by calculating the distance between each node and the optimal and worst solutions. A node's performance value is closer to the optimal solution and further away from the worst solution, thus ranking it higher. This embodiment first obtains the optimal and worst solutions for node evaluation metrics, then determines the node ranking by calculating their ratio, and finally selects the node with the highest ranking as the coordinating node. The node consensus performance evaluation algorithm is shown in Table 2. Table 2 Step 002 specifically includes the following steps: Step 00201. Propose the node committee election process for the CPE-BFT consensus algorithm.

[0027] Based on the node contribution evaluation algorithm, the node consensus performance evaluation score is determined for each node in the consensus process over a certain period. For node i, its relative weight is: relative weight During this round of node committee election, the election weight of the nodes is used as the election weight. Based on the election weight of the nodes, a node committee election algorithm based on weighted random probability is adopted, as shown in Table 3. Table 3 Step 00202. Propose a method for the node committee to lead other nodes in consensus under normal mode after successful election. The specific operation is as follows: The node committee designates the node with the smallest node number in the committee as the master node. The master node proposes blocks by broadcasting a pre-ready message to other members of the node committee. (Pre-ready message) Includes view number v and block sequence number Transaction list Its hash and the hash of the previous block A copy in the root committee. A custom BFT algorithm begins upon receiving the pre-ready message. Then, the replicas... If the prepared message is found to be valid, then broadcast the prepared message. After receiving the c / 2+1 preparation message from other root committee members, the copy... Broadcast pre-submission messages to the Root Commission If the copy Received from other root committee members If a pre-commit message is received, it will return success and continue executing the algorithm.

[0028] Problems can arise when more than half of the nodes on the root committee are faulty. In this situation, faulty root committee members might attempt to prevent updates without triggering a view change. There are several regular replicas. These replicas may not participate in the consensus process because malicious root committee members may not send messages to them, and they need to synchronize their history (downloading the most recently committed blocks) with other replicas.

[0029] Assumption It is one of the unsynchronized regular copies. (Root Committee member) You may receive a regular copy For blocks Timeout complaints. If the copy No copy received If a timeout message occurs for the same block or any block with a larger sequence number, then the replica... The missing block message will be forwarded (prepared and / or committed).

[0030] If the root committee members If a timeout does occur during the consensus process due to a lack of valid messages, it will broadcast its complaint to the regular nodes and return a non-success error. Therefore, if the replicas in the root committee... If no blocks are received from the malicious primary replica, it can recover blocks in return by querying regular nodes on the same replica. Lost messages can be sent to any regular node that requests them. In this way, members of the node committee and regular replicas download lost blocks from each other (without broadcasting), while controlling the complexity of the messages. .

[0031] Step 00203. Propose the flow of the CPE-BFT algorithm in the case of view switching.

[0032] A view switch occurs when a node fails to produce a block within a specified time or produces an illegal block. A view switch will involve a new node committee election.

[0033] In each period, a regular node waits to receive a proposal block or approval message from the root committee. If a regular node... If no block is received after the timeout, it considers the node committee to have failed and reports this to the node committee. If the node committee receives more than [a certain number of blocks]... When a node reports a timeout error, this will trigger a view change process in the node committee, and then the node committee members will... A timeout complaint is forwarded to a regular node, which in turn triggers a view change in the regular node.

[0034] After the view is successfully changed, each node The final state of its local history Broadcast to the new root committee members, including the latest block sequence number. Block hash Incremental number of views and at least A signed copy of the approved block. New root committee members await receipt from all copies. Local history And aggregate them into In the middle. Once they are from the copy Received Its local history (The block with the latest commit) will be from Extracted from. In of In this history, it can be guaranteed that at least one Each node is honest (at least one has a recent history). Therefore, at least... The most recent history in an honest copy (with the latest signed block) will be the starting point for generating the next block.

[0035] The new node committee will broadcast To all nodes, the nodes receive Afterwards, the copy Ensure its history and The latest history matches. If its history matches, the copy... Send a readiness message back to the new root committee The root node committee members will Individual ready responses are aggregated into a single The message is sent and broadcast to all copies. Received Afterwards, the copy Now ready to participate in the new view. If the node History and If the recent history is mismatched, it will need to synchronize its history by communicating with the new root committee. To ensure that all transactions are executed correctly, clients can resend their transactions to the new node committee after realizing they have not received any transaction responses (timeout).

[0036] To evaluate the improvement in consensus efficiency of the CPE-BFT consensus algorithm compared to other consensus algorithms in scenarios with uneven resource distribution, this experiment uses a controlled variable method, conducting multiple experiments on three parameters: block size, blockchain runtime, and the proportion of resource-constrained nodes. The differences in throughput and latency between the CPE-BFT consensus algorithm and its control group are also measured.

[0037] (1) The effect of block size on experimental results according to Figure 2 It can be seen that, when the proportion of resource-constrained nodes and the system runtime are the same, the system throughput of the four consensus algorithms generally decreases as the block size increases. This is because the more transactions a block contains, the greater the communication and computational pressure on the system, and the lower the system throughput. When the block size is set to 600 transactions per block, the system throughput of CPE-BFT is on average 19.24% higher than that of the PBFT algorithm, 17.63% higher than that of the Popt algorithm, and 14.34% higher than that of the VBFT algorithm.

[0038] according to Figure 3 It can be seen that, with the same proportion of resource-constrained nodes and system uptime, the transaction processing latency of the four consensus algorithms generally increases with the increase of block size. This is because the more transactions a block contains, the slower the nodes verify them, resulting in greater latency. When the block size is set to 600 transactions, the transaction processing latency of CPE-BFT is reduced by an average of 29.32% compared to the PBFT algorithm, 24.13% compared to the Popt algorithm, and 20.18% compared to the VBFT algorithm.

[0039] (2) The effect of running time on experimental results according to Figure 4It can be seen that, when the proportion of resource-constrained nodes and the block size are the same, the system throughput of the PBFT and Popt algorithms shows an overall decreasing trend with the increase of running time. This is because the consensus pressure of the PBFT and Popt algorithms increases quadratically with the increase of the number of nodes in the system. The CPE-BFT and VBFT algorithms, because their node committee size is constant, do not see an increase in the number of committee nodes with the increase of the number of nodes in the system. Their consensus efficiency is relatively stable. The system throughput does not change significantly with the extension of running time. When the blockchain running time is set to 400s, the system throughput of the CPE-BFT algorithm is nearly twice that of the PBFT and Popt algorithms, and 13.81% higher than that of the VBFT algorithm.

[0040] according to Figure 5 It can be seen that, with the same proportion of resource-constrained nodes and block size within the system, the transaction processing latency of all four consensus algorithms increases with time. This is because the increasing number of nodes in the system leads to a longer time for the system to reach consensus on transactions. The CPE-BFT algorithm, due to its higher-performance node committee, maintains faster transaction processing capabilities and exhibits the lowest degree of latency increase. When the system runtime is set to 400 seconds, the transaction processing latency of CPE-BFT is 15.74% lower than that of the PBFT algorithm, 12.68% lower on average than the Popt algorithm, and 10.17% higher on average than the VBFT algorithm.

[0041] (3) The impact of the proportion of resource-constrained nodes on the experimental results according to Figure 6 It can be seen that, with the same block size and system runtime, as the proportion of resource-constrained nodes increases, the system throughput of the four consensus algorithms initially remains in a stable fluctuation state. However, when the proportion of resource-constrained nodes exceeds a certain threshold, the system throughput of all four consensus algorithms shows a significant decrease until it reaches 0. When the proportion of resource-constrained nodes in the system is set to 70%, the system throughput of CPE-BFT is 27.26% higher than that of the PBFT algorithm, 26.45% higher on average than that of the Popt algorithm, and 25.56% higher on average than that of the VBFT algorithm.

[0042] according to Figure 7It can be seen that, with the same block size and system runtime, the transaction processing latency of the four consensus algorithms generally increases with the increase of the proportion of resource-constrained nodes. This is because an increasing proportion of resource-constrained nodes leads to more and more of them participating in the consensus process, which has quadratic time complexity, thus slowing down the system's transaction processing speed. When the proportion of resource-constrained nodes is set to 50%, the transaction processing latency of CPE-BFT is 39.24% lower than that of PBFT, 23.92% lower than that of Popt on average, and 9.82% lower than that of VBFT. CPE-BFT maintains the highest transaction verification speed among these four algorithms.

[0043] The above description is merely a preferred embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A performance optimization method for blockchain consensus mechanisms based on the CPE-BFT algorithm, characterized in that, Includes the following steps: A consensus performance evaluation module is constructed, and the consensus capability of blockchain nodes is evaluated based on the consensus performance evaluation module. Specifically, this includes: selecting the performance indicators of blockchain nodes in the consensus process as node evaluation indicators; obtaining the evaluation indicator weights through the entropy weight method based on the node evaluation indicators; and evaluating the consensus capability of blockchain nodes through a node consensus performance evaluation algorithm based on the node evaluation indicators and the evaluation indicator weights. Based on the aforementioned consensus capability, resource-constrained nodes are selected; Based on the CPE-BFT algorithm, a node committee is elected from the resource-constrained nodes; specifically, this includes: calculating a node evaluation score based on the node's consensus capability, calculating a selection weight based on the node evaluation score, and electing a node committee based on the selection weight using a node committee election algorithm. Based on the node committee, a leadership consensus is established among the regular nodes in the resource-constrained nodes. Specifically, this includes: obtaining the master node from the node committee and broadcasting a pre-preparation message based on the master node; obtaining a root committee replica from the node committee, formulating a BFT protocol based on the root committee replica, and validating the pre-preparation message based on the BFT protocol; if the pre-preparation message is valid, broadcasting a preparation message, determining whether the root committee has received the pre-preparation message, and taking different actions based on the determination result; if the root committee receives the pre-preparation message, the root committee replica broadcasts a pre-commit message; based on the pre-commit message, determining the number of faulty nodes in the root committee, if the number of faulty nodes exceeds half the number of root committee members, then the root committee members receive timeout complaints from regular nodes regarding blocks in the pre-commit message; otherwise, no timeout complaint is made; based on the timeout message from the timeout complaint, the root committee replica forwards a lost block message; if the root committee members have not received the pre-preparation message, the root committee replica recovers the lost block message by querying regular nodes.

2. The performance optimization method for blockchain consensus mechanism based on CPE-BFT algorithm according to claim 1, characterized in that, The process of obtaining the weights of evaluation indicators using the entropy weight method includes: The node evaluation indicators are standardized to obtain standardized indicators. Based on the standardized indicators, the entropy weights of the standardized indicators are calculated, and the evaluation indicator weights are calculated based on the entropy weights of the standardized indicators.

3. The performance optimization method for blockchain consensus mechanism based on CPE-BFT algorithm according to claim 1, characterized in that, The process of evaluating the consensus capability of blockchain nodes using a node consensus performance evaluation algorithm includes: Obtain the optimal and worst solutions for node evaluation metrics. Based on the optimal and worst solutions, use the distance between optimal and worst solutions to obtain the node ranking. Based on the node ranking, obtain the consensus capability of the nodes.

4. The performance optimization method for blockchain consensus mechanism based on CPE-BFT algorithm according to claim 1, characterized in that, Also includes: In the event of a view switch, the view of the node committee and ordinary nodes is changed. After the view change is successful, a new node committee is re-elected, and a leadership consensus is reached for the ordinary nodes based on the new node committee.