An improved alliance chain consensus method and system based on contribution degree and grouping
By introducing the CG-PBFT consensus method, which incorporates contribution and grouping into consortium blockchains, the problems of high communication overhead, poor scalability, and master node randomness in existing technologies are solved, achieving an efficient and secure consensus process and improving system performance and stability.
Patent Information
- Application Number
- CN202411224185.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-03
- Publication Date
- 2025-10-17
- Estimated Expiration
- 2044-09-03
AI Technical Summary
When the number of nodes in the existing consortium chain consensus algorithm increases, the communication overhead and computational complexity increase, resulting in a decline in system performance, limiting the scalability and efficiency of the system. In addition, the randomness of the master node selection leads to resource waste and security issues.
An improved consortium blockchain consensus method based on contribution and grouping (CG-PBFT) is adopted. The grouping strategy reduces the communication complexity between nodes, and the contribution consensus mechanism is introduced to select the node with the highest contribution as the master node. The PoC and PBFT algorithms are combined to ensure consistency and security.
It improved network throughput and efficiency, reduced the number of communications, enhanced system security and scalability, optimized resource utilization, reduced the impact of Byzantine attacks, and achieved a more efficient and reliable consensus process.
Smart Images

Figure CN119254773B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to but is not limited to the field of alliance chain consensus technology, and in particular relates to an improved alliance chain consensus method and system based on contribution and grouping. Background Art
[0002] In consortium blockchains, Byzantine Fault Tolerance (BFT) and Practical Byzantine Fault Tolerance (PBFT) are widely considered representative consensus algorithms. Both aim to solve the Byzantine Generals' Problem. The Byzantine Fault Tolerance consensus algorithm is a key distributed system design technology that provides complex algorithms and protocol mechanisms to address node failures or malicious behavior, thereby ensuring system stability, reliability, and security. However, the Byzantine Fault Tolerance consensus algorithm also faces several challenges. These include the relatively complex implementation of the algorithm, which involves multiple rounds of message exchanges and complex protocol mechanisms. In terms of performance overhead, the multiple rounds of message exchanges and complex computational processes can lead to decreased system performance and efficiency. Furthermore, as the number of participating nodes increases, the communication overhead and computational complexity of the Byzantine Fault Tolerance algorithm also increase, limiting the system's scalability. The Practical Byzantine Fault Tolerance algorithm is developed based on the fundamental theory of Byzantine Fault Tolerance, but it introduces specific optimizations and mechanisms that make it more suitable for solving the Byzantine Generals' Problem in real-world distributed systems. The Practical Byzantine Fault Tolerance consensus algorithm is fault-tolerant, meaning that the system is able to withstand attacks and errors to a certain extent, thus maintaining normal operation. However, the algorithm still has problems such as high communication complexity, lack of support for master node selection, and low scalability, which bring many obstacles to industrial applications.
[0003] These issues are common in consortium blockchain implementations, and researchers are actively conducting research. Existing optimization solutions can be broadly divided into two categories: controlling the number of nodes and optimizing the consensus process. In 2019, Gan's team proposed an ePBFT consensus protocol. This protocol, by setting a node lifecycle and allowing for dynamic node joining and exit, improved the PBFT masternode selection method by leveraging the longest chain principle. However, it can only be applied to scenarios with a small number of nodes. The same year, the LIQ team proposed the K-medoids clustering algorithm, which determines node similarity by selecting appropriate clustering characteristics. This algorithm is suitable for large-scale networks and reduces communication overhead, but its inherent dependence on certain characteristics hinders widespread application. In 2021, Zheng's team proposed a hybrid consensus algorithm combining PoS and PBFT. Compared to traditional PBFT algorithms, this algorithm significantly improves throughput, latency, and network communication time. However, its relatively high communication overhead makes it unsuitable for scenarios with large numbers of nodes. In 2022, Xu's team optimized the PBFT consensus process, employing a scoring grouping mechanism to improve consensus efficiency and the robustness of the Internet of Vehicles. However, this algorithm suffers from the issue of arbitrary masternode selection.
[0004] In view of the above analysis, the existing technical problems to be solved urgently in the prior art are that the existing consensus research mainly pursues optimization of consistency, ignores performance, and the message mechanism and communication protocol between nodes increase communication overhead and delay, reduce system performance, and limit system scalability and performance as the number of nodes increases, which is not suitable for large-scale networks and is not conducive to the development of the blockchain industry. SUMMARY
[0005] In view of the problems existing in the prior art, the present application provides an improved consortium chain (CG-PBFT) consensus method and system based on contribution and grouping.
[0006] The present application is implemented as follows: an improved consortium chain consensus method based on contribution and grouping, comprising:
[0007] S1, grouping strategy: grouping of the consensus set can reduce communication complexity between nodes, making it easier for nodes within each group to collaborate and improving network throughput and efficiency;
[0008] S2, management master node selection phase: in the blockchain network, a consensus mechanism based on contribution (PoC) is introduced, and the node with the highest contribution is selected as the master node through the management master node election phase, solving the problems of performance imbalance, security and resource consumption of PBFT;
[0009] S3, node contribution calculation: node contribution is a measure of the contribution of each node on the blockchain to the entire network, which is mainly composed of node data contribution and online resource consumption;
[0010] S4, CG-PBFT optimization consistency protocol based on contribution and grouping: CG-PBFT groups the consensus set, introduces the PoC contribution algorithm to select the master node, initializes the contribution of each node, and retains the PBFT algorithm phase, adds the master node election phase to solve the problem of random selection of master nodes, and further reduces the number of communications;
[0011] S5, correctness analysis: the CG-PBFT algorithm guarantees consensus consistency through the PoC algorithm, and then guarantees the final consistency of the nodes through the PBFT algorithm;
[0012] S6, defense against Byzantine attacks: the security of the second phase of the CG-PBFT algorithm is guaranteed by the characteristics of PBFT;
[0013] S7, resilience against other attacks: in the CG-PBFT algorithm, the consensus nodes are reasonably grouped to reduce the number of nodes controlled by the attacker to tamper with the consensus.
[0014] Further, the grouping step in S1 is as follows:
[0015] (1) System initialization: Before the blockchain network starts, the system is initialized, including authenticating newly added nodes and selecting F as candidate management nodes among these nodes. This step ensures that the network has a group of recognized master node candidates at the beginning.
[0016] (2) Isolation state confirmation: Confirm that the nodes in the network have not established contact and are in isolation, which is to ensure that all nodes are in a fair and isolated state before the response speed test is conducted, avoiding the influence of external factors.
[0017] (3) Group detection message: Prepare the master node a∈(1, 2, … N), assuming node 1 (a) sends a group detection message <subset, t1, S_a> to other nodes in the network, indicating that it is time t1, and its digital signature is S_a. These messages are used to solicit the willingness of other nodes to join the consensus cluster, starting communication and information transfer between nodes.
[0018] (4) Request to join the consensus set: When node x (x∈1, 2, … n) gets this message, it first proves the signature of node 1 (a) to ensure that the message is authentic and valid. If correct, then node x decides to join node 1's consensus cluster and sends a join request <subset request, t2, S_x> to node 1, where t2 is the current timestamp of node x and S_x is the digital signature of the current round.
[0019] (5) Processing join request: After receiving the join request, node a first checks whether the number of its consensus set members has reached the upper limit Nmax. If the group size is not full and the information of node x is verified, node 1 agrees to the join request of node x and adds node x to its consensus set member list. If the number of node 1's consensus set members is full or the information of node x is not verified, node 1 will send a rejection message to node x, and node x can try to send a join request to other standby master nodes.
[0020] (6) Find the next standby master node: If node 2 sends a rejection message to node x, then node x requests another standby master node to join its consensus cluster. This step ensures that nodes can find a suitable consensus cluster through multiple attempts. Repeat the above steps.
[0021] (7) Grouping ends and information broadcast: After all nodes have tried to join the consensus cluster, each standby management node will broadcast its consensus cluster member list for verification, and then distribute this information to its respective group members to complete the grouping confirmation, such as Figure 2The consensus cluster to which each node belongs is shown. This ensures that each node can eventually find the consensus cluster to which it belongs, and ensures that the member list of each consensus cluster is up-to-date and accurate.
[0022] Further, S2 specifically comprises: in the management master node selection stage, when the grouping of the consensus set is completed, a flag is entered into the master node election based on the contribution degree. First, the nodes in each group will be comprehensively evaluated according to their contribution degree in the network, and this contribution degree evaluation can be based on multiple indicators, including the online duration of the node, the data volume contribution degree of the node, and the online resource consumption factor of the node; according to these indicators, the contribution degree of each node is calculated; then each node will be assigned a corresponding contribution degree score, and according to the contribution degree score of the node, the node with the highest contribution degree in the group is selected as the master node, and this election process can be completed by voting, ranking or other mechanisms; the node will broadcast its contribution degree score to other nodes in the network, and other nodes will rank according to this information, and ultimately select the node with the highest contribution degree as the master node; once the master node is selected in each group, it enters the out-of-group consensus.
[0023] Further, S3 specifically comprises:
[0024] First, the node contribution degree is affected by the data volume contribution degree and the data information entropy, and a large amount of high-quality data provided by the node can effectively support the normal operation and transaction processing of the blockchain network, thereby improving the contribution degree of the node; the online resource consumption is affected by the computing power, bandwidth and storage space resources consumed by the node in maintaining the blockchain network, and the node needs to consume a large amount of resources to verify and confirm transactions, maintain the integrity of the network, and provide services to other nodes, and the greater the resource overhead, the higher the contribution degree of the node; then, the contribution degree of the node in a contribution degree model evaluation is defined as follows:
[0025] C(i) = C D (i) + C R (i) (1)
[0026] Wherein, C(i) represents the node contribution degree, C D (i) represents the data contribution degree, C R (i) represents the online resource consumption;
[0027] The node online resource consumption is mainly estimated by CPU usage. Assuming that the data volume of each node transceiving message is the same, and the frequency of the CPU is set to A, then the CPU resource consumption of node i for one consensus is defined as follows:
[0028] C R (i) = τa i v i f i 2 (2)
[0029] wherein τ represents the ability of the node computing chip set to store charge, a i represents the CPU cycle of the node i once consensus, v i represents the data size required for consensus.
[0030] Further, S4 specifically includes:
[0031] (1) Request phase
[0032] A plurality of transaction requests <REQUEST, t, c, t x ,S c are sent by the client to each consensus node of each consensus set;
[0033] (2) In-group master node selection phase
[0034] The contribution of each node in the consensus set is calculated and sorted, and the node with the highest contribution is selected as the master node The master node then pre-processes the transactions related to the current state of the blockchain network and the transactions to be involved in the consensus, and the transactions after verification and processing will be combined into a pre-preparation message <WITHIN-PREPREPARE, t, Vd, Nd, H(m) p ,j> ; The pre-preparation message contains detailed information of the proposal, such as proposal number, message digest of client request, timestamp, etc. The node receives the message of the master node first verifies its legality, including verifying the signature and serial number of the message, etc. to ensure the source and integrity of the message; if the message is verified, the node will put the proposal into its own proposal queue and wait for the subsequent preparation message; if the message fails to verify, the node will ignore the message and continue to wait for other messages or process other tasks;
[0035] (3) In-group preparation phase
[0036] If the node verifies, that is, the pre-preparation message is legal and effective, the next step is to broadcast the information interaction of all nodes. The consensus node will verify the received interaction information, and when receiving a sufficient number of consistent interaction information from different nodes, the next step can be taken, otherwise the consensus process is terminated, the node is replaced, and the consensus process is restarted; the node approves the proposal and generates a preparation message <WITHIN-PREPARE, Nd, vd, B, d(m), S F ,t> containing its approval information;
[0037] (4) In-group submission phase
[0038] The master node fully checks the received preparation message, which includes checking the consistency of the message and confirming whether a sufficient number of nodes support the proposal, which constitutes a majority opinion; once the legality and consistency of the message are confirmed and consensus is reached, the node initiates a response to the proposal <WITHIN-COMMIT, vd, B, t, d(m), proofc>; at the same time, these messages can be directly broadcast to other nodes in the entire network, so that other nodes can understand and verify these confirmation information; in this way, the entire system can gradually reach consensus;
[0039] (5) Preparation phase beyond consensus setting
[0040] After confirming that the message from the team member is received, the master node verifies the legality of the message. If it is valid, it means that consensus has been reached within the consensus set. Then each master node as a representative of its own group participates in the consensus and broadcasts <WITHOUT-PREPARE, Nd, vd, B, d(m), S F ,t> to other master nodes except itself, and also accepts the broadcast of other master nodes, entering the preparation phase.
[0041] (6) Submission phase without consensus set
[0042] In this phase, the node will verify the received broadcast message; if no problem is found, the node will continue to process the message; if there is any objection, the node will reject the message. In addition, if the node receives the same message from more than 2f nodes, it will consider it an acceptable message and broadcast <WITHOUT-COMMIT, vd, B, t, d(m), S F >.
[0043] (7) Group reply phase
[0044] The node will verify the received confirmation message to ensure the legality and consistency of the message; in addition, the node will determine the status of the proposal according to the received message and its own state, and if the node determines that the proposal is legal and has received enough confirmation, it will generate a reply message containing its final approval information for the proposal <WITHIN-REPLY, vd, B, t, d(m), S F >, and the node will notify the generated reply message to other members in the group;
[0045] (8) Reply phase beyond consensus
[0046] The master node replies to the client <WITHOUT-REPLY, vd, B, t, d(m), S c >, and the consensus is completed.
[0047] At this time, only one master node initiates a consensus request in the entire consensus process in a consensus set (without a byzantine node), and other nodes only need to verify the transaction hash and signature, without the need to initiate a consensus request, the master node is selected based on the contribution degree, and then the group consensus is carried out. This mode similar to the implementation mechanism of having a leader node can facilitate the initiation of consensus, and can also effectively avoid repeated consensus and competition between nodes, and improve the efficiency of the entire consensus process.
[0048] Further, S5 specifically comprises: the CG-PBFT algorithm guarantees consensus consistency through the PoC algorithm, and then guarantees the final consistency of the nodes through the PBFT algorithm; in the first consensus stage, the PoC algorithm mainly realizes the selection of the master node by means of the contribution degree proof mechanism and the randomness mechanism, and controls the number of malicious nodes, that is, it is agreed to determine a master node, and the other nodes jointly act, the PoC algorithm allows the number of existing fault nodes f to be controlled within 30% of the total number of nodes N, and guarantees the consistency of consensus; in the second consensus stage, the PBFT algorithm ensures that the nodes can reach consensus while avoiding errors or cheating behaviors between nodes, and guarantees the final consistency, that is, when the number of fault nodes f in the PBFT algorithm is less than (N-1) / 3, the fault tolerance of the consensus stage can be ensured.
[0049] Further, S6 specifically comprises: the PBFT algorithm has fault tolerance, assuming that the total number of nodes is N, there are at most f Byzantine nodes, when f≤(N-1) / 3, even if a small number of nodes fail, the honest nodes can still continue to communicate and keep consistent, thereby ensuring security; in addition, in the consensus process, the view switching mechanism of PBFT solves the problem of consensus failure caused by master node failure or other reasons, so that the consensus process can be quickly recovered, and the continuity and security of consensus are ensured. Moreover, through the message signature mechanism, the PBFT algorithm can prevent malicious behaviors such as forgery, replay attack and tampering, and ensure the security of consensus.
[0050] Another purpose of the present application is to provide a contribution degree and grouping based improved consortium chain consensus system for realizing the contribution degree and grouping based improved consortium chain consensus method, comprising:
[0051] The grouping strategy module: through the grouping of the consensus set, the communication complexity between the nodes can be reduced, the nodes in each group are more easily cooperated, and the network throughput and efficiency are improved;
[0052] The management master node selection module: in the blockchain network, the consensus mechanism based on the contribution degree is introduced, and the node with the highest contribution degree is selected as the master node through the management master node election stage, so as to solve the problems of performance imbalance, security and resource consumption of PBFT;
[0053] Node contribution calculation module: node contribution is a measurement method for measuring the contribution of each node on the blockchain to the entire network, and the node contribution is mainly composed of node data contribution and online resource consumption;
[0054] CG-PBFT optimized consensus protocol module: CG-PBFT groups the consensus set, introduces PoC contribution algorithm to select the master node, initializes the contribution of each node, at the same time retains the PBFT algorithm stage, increases the master node election stage, solves the problem of random selection of master node, and reduces the communication frequency;
[0055] Correctness analysis module: CG-PBFT algorithm guarantees consensus consistency through PoC algorithm, and then guarantees the final consistency of nodes through PBFT algorithm;
[0056] Defense against Byzantine attack module: the security of the second stage of the CG-PBFT algorithm is guaranteed by the characteristics of PBFT;
[0057] Elasticity module against other attacks: in the CG-PBFT algorithm, the consensus nodes are reasonably grouped to reduce the number of nodes controlled by the attacker to tamper with the consensus.
[0058] Another object of the present application is to provide a computer device, which comprises a memory and a processor, the memory stores a computer program, and the computer program is executed by the processor to make the processor execute the steps of the improved consortium chain consensus method based on contribution and grouping.
[0059] Another object of the present application is to provide a computer readable storage medium, which stores a computer program, and the computer program is executed by the processor to make the processor execute the steps of the improved consortium chain consensus method based on contribution and grouping.
[0060] Another object of the present application is to provide an information data processing terminal, which comprises the improved consortium chain consensus system based on contribution and grouping.
[0061] In combination with the above technical solutions and the technical problems solved, the technical solution to be protected by the present application has the following advantages and positive effects:
[0062] First, the application proposes a new practical Byzantine fault-tolerant blockchain consensus algorithm based on contribution and grouping. This algorithm is based on the contribution consensus algorithm and proposes a new contribution model for node contribution evaluation. According to the calculated contribution, the nodes with the highest contribution are selected as the main nodes for consensus. This solves the problem of arbitrary selection of main nodes, improves the fairness of node selection, reduces the possibility of malicious nodes becoming main nodes and attacking the system, optimizes system performance, improves system adaptability, promotes active participation and benign competition in the network, and ultimately realizes a more robust and efficient distributed system.
[0063] The application groups the consensus set according to the response speed. After grouping, the contribution model is used to select the main node for consensus in the group, and then the results in the consensus set are used to participate in the consensus between groups. Not only does it improve performance, but it also enhances system security and fault tolerance, provides good structured, parallel processing capabilities, fault isolation and network governance capabilities, and most importantly, effectively reduces system overhead, thereby improving the robustness and adaptability of the entire network.
[0064] The application simplifies the consensus protocol and reduces the communication burden in the protocol, enhancing the efficiency of the system. Selecting nodes with high contribution as main nodes ensures system stability. Through these improvements, the system can handle a large number of operations and transactions more flexibly and reliably while maintaining security and efficiency.
[0065] Second, as a creative auxiliary evidence for the claims of the application, it is also reflected in the following important aspects:
[0066] (1) The expected revenue and commercial value of the technical solution of the application after transformation are:
[0067] Cost-effectiveness and efficiency improvement: Alliance chain technology reduces labor and time costs in the transaction and cooperation process through automation and the application of smart contracts. In addition, through grouping and contribution evaluation, high-value nodes can play a greater role in the consensus process, thereby reducing the time and resource costs required to reach consensus.
[0068] Security and trust establishment: The decentralized and tamper-proof nature of blockchain ensures data security and transaction credibility. Participants can confidently share sensitive data and participate in complex business processes without worrying about the risk of information tampering or leakage, thereby establishing a more solid cooperative trust relationship. In addition, the grouping mechanism can reduce the impact of malicious nodes on the entire system, and the contribution evaluation can ensure that high-quality nodes dominate the system, thereby improving the security and stability of the system.
[0069] Flexibility and adaptability: Consortium chain technology allows for flexible adjustment and expansion of the network's size and functionality according to business needs. Different industries and organizations can customize consortium chain solutions based on their own characteristics to meet specific business processes and security requirements, enhancing the adaptability and scalability of the system.
[0070] Innovation and competitive advantage: Enterprises and organizations that adopt consortium chain technology can quickly launch innovative products and services. Consortium chain promotes cross-organizational innovation and helps enterprises gain greater competitive advantage and market share in the market.
[0071] Compliance and audit convenience: The transparency and traceability of blockchain make compliance monitoring and auditing easier and more effective. All transaction records and data modifications are recorded on the tamper-proof blockchain, providing reliable evidence and evidence for compliance audits.
[0072] Globalization and cross-border cooperation: Consortium chain technology supports cross-border cooperation and data sharing among organizations and enterprises around the world. The characteristics of not being limited by geographical location enable participants to easily cross borders and cooperate, promoting global business development.
[0073] Promote ecological development: This consensus mechanism can encourage nodes to actively participate in the construction and operation of the consortium chain, forming a healthy ecological cycle. At the same time, through contribution assessment and grouping mechanism, it can also provide strong support for the expansion and upgrade of the consortium chain.
[0074] Third. Existing technical problems solved:
[0075] 1. Node communication complexity and network efficiency problem:
[0076] In existing technologies, the communication between nodes of the blockchain network is complex, resulting in low network throughput and efficiency.
[0077] 2. Performance imbalance and security problems of PBFT consensus mechanism:
[0078] PBFT (Practical Byzantine Fault Tolerance) consensus mechanism has performance imbalance, security problems and resource consumption problems.
[0079] 3. Randomness of master node selection and excessive communication times:
[0080] In PBFT, the selection of master nodes is usually random, which leads to improper selection of master nodes and increases the number of communications, affecting efficiency.
[0081] 4. Insufficient defense capability against Byzantine attacks and other attacks:
[0082] The existing technology has limited defense capabilities against Byzantine attacks and other types of attacks.
[0083] Significant technological progress:
[0084] 1. Grouping strategy and network efficiency improvement:
[0085] By grouping the consensus set, the communication complexity between nodes is significantly reduced, making it easier for nodes within each group to collaborate, thereby improving network throughput and efficiency.
[0086] 2. Contribution-based primary node selection mechanism:
[0087] Introducing a consensus mechanism based on contribution, and selecting the node with the highest contribution as the primary node through the management of the primary node election phase, effectively solving the performance imbalance, security problems and resource consumption problems of PBFT.
[0088] 3. Node contribution calculation and fairness:
[0089] Node contribution is a measure of the contribution of each node to the entire network on the blockchain, mainly composed of node data contribution and online resource consumption. This method is more fair and reasonable.
[0090] 4. CG-PBFT optimized consensus protocol:
[0091] CG-PBFT groups the consensus set, introduces the PoC (Proof of Contribution) contribution algorithm to select the primary node, and retains the PBFT algorithm phase while adding a primary node election phase, solving the problem of random selection of primary nodes and reducing the number of communications.
[0092] 5. Consistency and eventual consistency guarantee:
[0093] CG-PBFT algorithm guarantees consensus consistency through PoC algorithm, and then guarantees the eventual consistency of nodes through PBFT algorithm, improving the reliability and stability of consensus.
[0094] 6. Enhanced ability to defend against Byzantine attacks:
[0095] The security of the second phase of the CG-PBFT algorithm is guaranteed by the characteristics of PBFT, enhancing the defense capability against Byzantine attacks.
[0096] 7. Improved resilience against other attacks:
[0097] In the CG-PBFT algorithm, by reasonably grouping the consensus nodes, the number of nodes controlled by the attacker to tamper with the consensus is reduced, and the flexibility and security of the system are improved. BRIEF DESCRIPTION OF DRAWINGS
[0098] Figure 1 is a flowchart of an improved alliance chain consensus method based on contribution degree and grouping provided by an embodiment of the present application;
[0099] Figure 2 is a schematic diagram of a grouping formation process provided by an embodiment of the present application;
[0100] Figure 3 is a schematic diagram of an optimized consensus protocol of CG-PBFT provided by an embodiment of the present application;
[0101] Figure 4 is a schematic diagram of the number of communications of three consensus algorithms provided by an embodiment of the present application;
[0102] Figure 5 is a schematic diagram of communication overload of five consensus algorithms provided by an embodiment of the present application;
[0103] Figure 6 is a schematic diagram of flux comparison of CG-PBFT and PBFT provided by an embodiment of the present application;
[0104] Figure 7 is a schematic diagram of throughput of five consensus algorithms provided by an embodiment of the present application;
[0105] Figure 8 is a schematic diagram of transaction delay of five consensus algorithms provided by an embodiment of the present application;
[0106] Figure 9 is a schematic diagram of the number of Byzantine nodes accommodated by CG-PBFT and PBFT provided by an embodiment of the present application;
[0107] Figure 10 is a schematic diagram of performance results of the algorithm under different performance indicators provided by an embodiment of the present application;in the figure, (a) is a throughput evaluation result, (b) is a fault tolerance evaluation result, (c) is a transaction delay evaluation result, and (d) is a communication overhead evaluation result;
[0108] Figure 11 is a structural diagram of an improved alliance chain consensus system based on contribution degree and grouping provided by an embodiment of the present application. DETAILED DESCRIPTION
[0109] In order to make the purpose, technical scheme and advantages of the present application clearer, the present application will be further described in detail below with reference to the embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application, and are not used to limit the present application.
[0110] The present application aims to design a consensus algorithm with excellent performance and suitable for large-scale consortium chain scenarios. To this end, a practical Byzantine fault tolerance algorithm using contribution degree and grouping mechanism is proposed.
[0111] CG-PBFT adds a grouping stage and a master node selection stage. CG-PBFT first proposes a grouping method according to response speed, as shown in Figure 2 , the large-scale network nodes are grouped, so that the load of a single consensus set can be reduced, the network performance and throughput can be improved, each sub-network can independently execute the consensus algorithm, thereby reducing the delay and congestion of the entire network, and the fault tolerance, privacy protection level can be improved, and customized governance mechanism is allowed, thereby better meeting the needs of different users and applications. At the same time, the contribution degree algorithm is introduced. The design focus is to use PoC to sort the contribution degree to improve the problems of large PBFT communication overhead and low throughput. In particular, the contribution degree proof is mainly related to the online time contribution degree, data volume contribution degree, and data contribution degree of the node, for example, the online duration of the node, the cumulative online duration or continuous online duration can be selected, and the contribution degree of each node is calculated after reading the blockchain account data and other data after the consensus process. In the CG-PBFT algorithm, the nodes are divided into master nodes, candidate nodes, and consensus nodes according to their different functions. The selection of the master node is based on the node with the highest contribution degree. Usually, the candidate node refers to the remaining excellent nodes after the selection of the master node. The consensus node needs to receive and respond to messages from the master node and participate in the consensus. Among them, the candidate node that meets the specific qualification standard is the constituent element of the consensus node. Under normal circumstances, the master node is responsible for executing the consensus mechanism, verifying transactions, and packaging blocks, at which time the candidate node participates in the consensus process and propagates transaction information and block data. When the master node cannot operate normally, the candidate node will become a new master node through the contribution degree ranking and start a new round of consensus process. Assuming that the total number of blockchain network nodes is N (N≥12), the number of groups satisfies F≥4, and the number of nodes in each group is U≥3. The flowchart of the improved algorithm is shown in Figure 1 .
[0112] 1.1 Grouping strategy
[0113] By grouping the consensus set, the communication complexity between nodes can be reduced, making it easier for nodes within each group to collaborate, thereby improving network throughput and efficiency. Second, grouping also helps optimize network resource utilization, allowing for rational allocation of resources based on node performance and characteristics, enabling each node within a group to fully utilize its own characteristics and improve the efficiency of each node, thereby improving the efficiency and performance of the entire blockchain network. In addition, group consensus can serve as an error isolation mechanism, as even if a node within a group is attacked, the nodes in other groups can continue to operate normally and will not affect the consensus of the entire network. At the same time, the use of group consensus results in additional verification of the group consensus, improving the error tolerance of the system and reducing the risk of the entire network. At the same time, the grouping strategy of the consensus set can achieve horizontal expansion of the network, that is, when the network needs to be expanded, new consensus set groups can be dynamically added without affecting the entire network. In summary, in the consensus set division phase, grouping the consensus set is to improve network efficiency, enhance network security, improve network scalability, and optimize resource utilization, providing users with more stable and reliable services.
[0114] In addition, grouping the consensus set can help solve the performance expansion, attack risk, and network congestion problems that exist in PBFT. In traditional PBFT consensus algorithms, nodes communicate with each other, and as the number of nodes increases, the communication overhead increases, affecting network performance. By grouping the consensus set, the communication complexity between nodes can be reduced, improving network efficiency and thus solving the performance expansion problem. In addition, if there are malicious nodes within the consensus set, it will cause problems in the consensus process. By grouping the consensus set, even if there are malicious nodes within a group, the nodes in other groups can continue to work normally, thereby reducing the risk of the entire network being attacked. In addition, in traditional PBFT, all nodes need to participate in the consensus process, and when the consensus set is too large, it causes network congestion. By grouping the consensus set into different subsets, network congestion can be effectively alleviated, maintaining the normal operation of the network.
[0115] As mentioned earlier, the core idea of this method is to divide nodes into different groups according to their response speed, so as to better utilize the performance of each node in the consensus process, thereby improving the processing capacity and response speed of the entire network. First, a mechanism for measuring the communication delay or response time between nodes needs to be introduced in the network. Heartbeat packets are sent regularly or ping tests between nodes are conducted to monitor the response speed of each node in real time. Based on these data, the response speed of each node can be obtained as the basis for dividing the consensus set. Then, according to the response speed data of the nodes, all nodes are sorted by response speed from fast to slow to obtain a sorted list. To ensure the fairness and effectiveness of the division of the consensus set, the grouping rules are determined. The maximum and minimum number of nodes in each consensus set is set to avoid the consensus set being too large or too sparse, thereby improving the fault tolerance and attack resistance of the network. It is particularly important to regularly monitor the response speed of the nodes and the performance of the network, and dynamically adjust the composition of the consensus set according to the actual situation to maintain the stability and efficiency of the network. Next, an example of assigning nodes to different consensus sets based on the response speed of the nodes to the "preliminary master node" is described.
[0116] Assume that in a blockchain network, the total number of nodes is N (N ≥ 4), and we want to divide them into F (F ≥ 4) groups centered on different "preliminary master nodes". Imagine that at the beginning of the activation of the blockchain system, all participating nodes on the network are not in communication with each other, i.e. in isolation. Through the implementation of the authentication program of the members of the consortium chain, F nodes are selected to serve as the initial master node team. Based on the speed of the nodes' response to the F preliminary master nodes, the nodes will be assigned to F different consensus sets. The grouping steps are as follows:
[0117] (1) System initialization: Before the blockchain network starts, the system is initialized, including authenticating newly joined nodes and selecting F as candidate management nodes among these nodes. This step ensures that the network has a group of recognized master node candidates at the beginning.
[0118] (2) Isolation state confirmation: Confirm that the nodes in the network have not established contact and are in isolation, which is to ensure that all nodes are in a fair and isolated state before the response speed test, avoiding the influence of external factors.
[0119] (3) Group detection message: Preliminary master node a ∈ (1, 2, … N), assume node 1 (a) sends a group detection message <subset, t1, S_a> to other nodes in the network, indicating that it is time t1 and its digital signature is S_a. These messages are used to solicit the willingness of other nodes to join the consensus set group, starting the communication and information transfer between nodes.
[0120] (4) Request to join consensus set: When node x (x e 1, 2,... n) gets this message, it first proves the signature of node 1 (a) to ensure that the message is authentic and valid. If correct, then node x decides to join the consensus set group of node 1, sends a request to join <subset request, t2, S_x> to node 1, where t2 is the current timestamp of node x and S_x is the digital signature of the current round.
[0121] (5) Processing of joining request: After receiving the joining request, node a first checks whether the number of members in its consensus set group has reached the upper limit Nmax. If the group is not full and the information of node x is verified, node 1 agrees to the joining request of node x and adds node x to its consensus set member list. If the consensus set group of node 1 is full or the information of node x is not verified, node 1 will send a rejection message to node x, and node x can try to send a joining request to other standby master nodes.
[0122] (6) Finding the next standby master node: If node 2 sends a rejection message to node x, then node x requests another standby master node to join its consensus set group. This step ensures that nodes can find a suitable consensus set group through multiple attempts. Repeat the above steps.
[0123] (7) Grouping ends and information broadcast: After all nodes have tried to join the consensus set group, each standby management node will broadcast its consensus set group member list for verification, and then distribute this information to its respective group members to complete the grouping confirmation, as shown in Figure 2 This ensures that each node can eventually find its own consensus set group and ensures that the member list of each consensus set group is up-to-date and accurate.
[0124] These steps are closely connected and constitute the whole process of nodes joining the consensus set according to response speed. Each step has a specific task and responsibility, ensuring the smooth progress of the grouping process and the effective realization of the final result.
[0125] 1.2 Management master node selection stage
[0126] In a blockchain network, a consensus mechanism based on contribution is introduced, and by managing the master node election stage, the node with the highest contribution is selected as the master node, which can solve the problems of performance imbalance, security and resource consumption of PBFT. First, the management of the master node election stage selects the node with the highest contribution as the master node by evaluating the contribution of the node, thereby optimizing the network performance. In the traditional PBFT, the master node is randomly or roundly selected, and each node has the same opportunity to become the master node, but the performance and contribution of the node are different. Some nodes with good performance have a greater contribution to the stability and efficiency of the network, and the random selection of the master node leads to performance imbalance, affecting the performance of the entire network. Compared with the traditional PBFT, the election mechanism based on contribution can ensure that the master node has better performance and stability, and improve the performance of the entire blockchain network. In this way, the network can more efficiently handle transactions, improve throughput and response speed, and also reduce congestion and delay caused by performance imbalance.
[0127] In addition, the management of the master node election stage enhances the security of the network. The traditional random selection of the master node has the risk of being attacked, and the election mechanism based on contribution can reduce this risk. Because the nodes with high contribution usually have better performance and reliability, electing these nodes as master nodes can increase the network's ability to resist attacks and improve the security and stability of the network. In particular, the management of the master node election stage optimizes resource utilization. In the traditional way, resources will be wasted on nodes that do not have the conditions to become master nodes, but still consume network resources for master node election, which will affect the efficiency and resource utilization of the entire network. The election mechanism based on contribution can make the network more efficient in resource utilization. Only the node with the highest contribution has the opportunity to become the master node, avoiding the waste of resources on unnecessary nodes and improving the resource utilization of the network. In summary, the management of the master node election stage and the consensus mechanism based on contribution to a large extent solve the problems of PBFT, thereby optimizing the performance of the blockchain network, improving the security of the network, optimizing resource utilization, and also encouraging nodes to actively participate and contribute, providing a more reliable and efficient foundation for the development and application of the blockchain network. Since the management of the master node selection stage has such a great impact on traditional PBFT, the implementation process will be introduced in detail.
[0128] In the management master node selection stage, when the grouping of the consensus set is completed, the flag enters the master node election based on the contribution degree. First, each node in the group will be comprehensively evaluated according to its contribution degree in the network, and this contribution degree evaluation can be based on multiple indicators, such as the online duration of the node, the data volume contribution degree of the node, the online resource consumption of the node and other factors. According to these indicators, the contribution degree of each node is calculated. Then each node will be assigned a corresponding contribution degree score, and according to the contribution degree score of the node, the node with the highest contribution degree in the group is selected as the master node, and this election process can be completed by voting, ranking or other mechanisms, and we use the ranking method here. Usually, the node will broadcast its contribution degree score to other nodes in the network, and other nodes will rank according to this information, and finally select the node with the highest contribution degree as the master node. Once the master node of each group is selected, it can enter the out-of-group consensus.
[0129] 1.3 Node contribution calculation
[0130] Node contribution degree is a measure method to measure the contribution of each node on the blockchain to the entire network. Node contribution degree is mainly composed of node data contribution degree and online resource consumption. First, node contribution degree is affected by data volume contribution degree and data information entropy. A large amount of high-quality data provided by the node can effectively support the normal operation and transaction processing of the blockchain network, thereby improving the contribution degree of the node. In addition, online resource consumption is affected by the computing power, bandwidth and storage space consumed by the node in maintaining the blockchain network. The node needs to consume a large amount of resources to verify and confirm transactions, maintain the integrity of the network, and provide services to other nodes. The more resource consumption, the higher the contribution degree of the node. Then, the contribution degree of the node in a contribution degree model evaluation is defined as follows.
[0131] C(i) = C D (i) + C R (i) (1)
[0132] Where C(i) represents the node contribution degree, C D (i) represents the data contribution degree, C R (i) represents the online resource consumption.
[0133] Node online resource consumption is mainly estimated by CPU usage. Assuming that the data volume of each node transceiving message is the same each time, and the frequency of the CPU is set to A, then the CPU resource consumption of node i for one consensus is defined as follows.
[0134] C R (i) = τa i v i f i 2 (2)
[0135] where τ represents the ability of the node computing chip set to store charge.a i denotes the CPU cycle of the node i once consensus, v i denotes the data size required for consensus.
[0136] Referring to the classical information theory principle, the data information entropy can reflect the quality and importance of the data provided by the data provider. The higher the information entropy, the higher the uncertainty and complexity of the data, and vice versa. Therefore, it can be used as a basis for evaluating its contribution in the consensus process. In short, the larger the amount of information contained in the data set provided by the data provider, the greater its contribution will be. Because such data is more important for the consensus process or the normal operation of the network, the contribution is greater. Judging the contribution of data providers by information entropy can help the network better identify and reward those participant nodes that provide valuable information. Next we define the concept of information entropy.
[0137] Definition 1. Data Tuple. For a given data set D, a tuple t is defined as a non-empty subset of a record r in D, i.e. and
[0138] Definition 2. Tuple Set. A tuple set refers to a set containing multiple tuples Each tuple can contain different types of data, and each tuple is unique in the set. Tuple sets are usually used to store objects or data records with different attributes. Tuple sets can be part or the whole of a data set. Therefore, the tuple set is a non-empty part of the data set D, i.e. Tup∈D and
[0139] Definition 3. Data Information Entropy. Data information entropy is an important indicator to measure the degree of uncertainty or chaos in a data set, which represents the degree of chaos or uncertainty when different elements in the data set appear with a probability distribution. It can be used to measure the amount of information contained in a single tuple set, and the tuple set is the smallest unit of information entropy measurement. The higher the information entropy, the more uncertain or uniform the data distribution. For a tuple set with n tuples, the information entropy H ind is defined as
[0140]
[0141] The PoC consensus algorithm is based on the node online time, node data volume contribution degree and node data contribution degree to compete for the right to record the blockchain ledger. When receiving a blockchain transaction request, the nodes are sorted according to the contribution degree, and the node with the largest contribution degree is selected as the master node to accept the transaction request and return the hash value of the transaction and the block state and other parameters. The initial contribution degree of all nodes is represented by CT.
[0142] The initial contribution degree of the node is closely related to the online time. Because the continuous online time can make other nodes more easily trust the node, because it shows the commitment of the node to the stability and reliability of the network. That is, the longer the node online time, the more it means that the node can provide continuous services and resources, thereby enhancing the stability of the entire network; at the same time, it encourages the node to remain active and participate in the network for a long time. The online time contribution degree (Contribution Of Online Time, CT) of the algorithm is calculated as follows.
[0143] CT = λlog(T l -T j -T u ) (4)
[0144] In formula 4, CT represents the online contribution degree of the node, λ represents the online time coefficient, T l represents the time stamp of the last block added in the current blockchain network, T j represents the time stamp of the first time each node joins, and T u represents the time interval of the node offline.
[0145] Cross-entropy is used to measure the deviation between the amount of message data sent by the node and the actual result. Assuming that all participating nodes in the blockchain network transmit transaction data set d n = {(x1,y1),(x2,y2),...,(x i ,y i ),…,(x n ,y n )}, then the cross-entropy H(f(x i ),y i ) of data (x i ,y i ) is calculated as follows.
[0146]
[0147] Where x i represents the number of transactions received by node i, y i represents the number of transactions sent by node i. f(x i ) represents the prediction result of the node. H(f(x i ),yi The smaller the value of the formula (1) is, the closer the predicted probability distribution is to the real situation, and in short, the better the consensus effect is.
[0148] The data contribution degree refers to the degree and quality of the node in storing, transmitting or processing data in the network. The performance of the node in data storage, transmission and processing directly determines its role and contribution degree in the blockchain. The data contribution degree of the node is mainly determined by the data information entropy H ind (d i ) and the proportion of data contribution degree C i in the total data amount, and β is the weight parameter. The improvement of data contribution degree means the increase of importance and value of the node in the network, and thus is one of the important factors in evaluating the contribution degree of the node. The data contribution degree is represented by C i , and its value is determined according to the data amount ratio of the participating node i to other participating nodes.
[0149]
[0150] Therefore, the data contribution degree C D of the node can be defined as
[0151]
[0152] It can also be expressed as
[0153]
[0154] According to the above formula reasoning, the contribution degree C(i) of the node can be rewritten as formula (2).
[0155]
[0156] In addition, in the consensus process, the contribution degree of the node can be calculated according to the non-negative property of the data information entropy, where ε is the adjustment coefficient.
[0157]
[0158] After the consensus process starts, the node with the highest contribution degree is selected as the main node to process transaction requests and package into blocks, which is usually described as B i = {<H i-1, H M ,t i >, T x [d i , H(f(x i ), y i )], proofc}. The specific meaning is as follows: the content of < > is the block header, where H i-1 represents the hash value of the previous block, H Mrepresents the hash value of the Merkle root in the block, t i represents the timestamp, T x represents the transaction content, d i represents the transaction data, H(f(x i ), y i represents the cross-entropy, so that it can be recorded in the form of a transaction on the chain, and proofc represents the proof of contribution of the node.
[0159] Based on the PoC consensus algorithm, the contribution of each node is calculated and ranked in descending order, where the timeout threshold is represented by Tt, and the node P i with the highest contribution is selected as the master node. Then the master node P i performs consensus and broadcasts the block B i . Other consensus nodes verify the block information, such as the participating nodes P k verify the generated block B i , and if the verification is passed, the ownership of the accounting right is determined, usually returning a signed block (block) s k , indicating acceptance of the new block or transaction, and adding it to the blockchain. The PoC algorithm is described in Algorithm 1.
[0160] Algorithm 1 helps to select the master node
[0161]
[0162]
[0163] As the ranking of the node contribution decreases, the corresponding accounting block probability also decreases. When deciding the accounting right of the new block, the blockchain system will preferentially select the node with the highest contribution within a certain period of time, which will optimize the consensus process, be more simple and efficient than the PBFT algorithm alone, and at the same time ensure the fairness of node selection, improve the processing efficiency and throughput of the network. At the same time, when the network topology or the hardware performance of the node changes, the contribution of the node will change accordingly, which is more suitable for the application requirements of large-scale distributed systems.
[0164] 1.4 CG-PBFT optimized consensus protocol
[0165] CG-PBFT groups the consensus set, introduces the PoC contribution algorithm to select the master node, initializes the contribution of each node, and at the same time retains the stages of the PBFT algorithm, increases the master node election stage, solves the problem of random selection of the master node, and reduces the number of communications. The optimized consensus protocol of CG-PBFT is shown in Figure 3 .
[0166] (1) Request phase
[0167] Multiple transaction requests <REQUEST, t, c, t x ,S c are sent by the client to each consensus node in the consensus set.
[0168] (2) In-group master node selection phase
[0169] The contribution of each node in the consensus set is calculated and sorted, and the node with the highest contribution is selected as the master node The master node then preprocesses the transactions related to the current state of the blockchain network and the transactions to be involved in the consensus, and the transactions after verification and processing will be combined into a pre-preparation message <WITHIN-PREPREPARE, t, Vd, Nd, H(m)>. p j>. The pre-preparation message contains detailed information of the proposal, such as proposal number, message digest of client request, timestamp, etc. The node receives the master node's message first to verify its legality, including verifying the signature and serial number of the message, etc. to ensure the source and integrity of the message. If the message is verified, the node will put the proposal into its own proposal queue and wait for the subsequent preparation message. If the message fails to verify, the node will ignore the message and continue to wait for other messages or process other tasks.
[0170] (3) In-group preparation phase
[0171] If the node verifies that the pre-preparation message is legal and valid, the next step is to broadcast the information interaction of all nodes. The consensus node will verify the received interaction information, and when it receives a sufficient number of consistent interaction information from different nodes, it can proceed to the next step, otherwise the consensus process is terminated, the node is replaced, and the consensus process is restarted. The node approves the proposal and generates a preparation message <WITHIN-PREPARE, Nd, vd, B, d(m), S F ,t> containing its approval information.
[0172] (4) In-group commit phase
[0173] The master node conducts a comprehensive review of the received preparation messages, which includes verifying the consistency of the messages and confirming whether a sufficient number of nodes have supported the proposal, which constitutes a majority opinion. Once the legality and consistency of the messages are confirmed and consensus is reached, the node initiates a response to the proposal <WITHIN-COMMIT, vd, B, t, d(m), proofc>. At the same time, these messages can be directly broadcast to other nodes in the entire network, allowing other nodes to understand and verify these confirmation information. In this way, the entire system can gradually reach consensus.
[0174] (5) Preparation phase beyond the consensus set
[0175] After the master node confirms the message from the team member, it verifies the legitimacy of the message. If it is valid, it means that consensus has been reached within the consensus set. Then each master node participates in the consensus as a representative of the respective group, broadcasting WITHOUT-PREPARE, Nd, vd, B, d(m), S to other master nodes except itself F , t> while also accepting the broadcast from its master node, entering the preparation phase.
[0176] (6) Without consensus set submission phase
[0177] In this phase, the node verifies the received broadcast message. If no problems are found, the node will continue to process the message. If there are any objections, the node will reject the message. In addition, if the node receives the same message from more than 2f nodes, it considers it an acceptable message and broadcasts <WITHOUT-COMMIT, vd, B, t, d(m), S F .
[0178] (7) Group reply phase
[0179] The node verifies the received confirmation message to ensure the legitimacy and consistency of the message. In addition, the node determines the status of the proposal based on the received message and its own state. If the node determines that the proposal is legitimate and has received enough confirmations, it generates a reply message <WITHIN-REPLY, vd, B, t, d(m), S F > containing its final approval information for the proposal. The node notifies other members of the group of the generated reply message.
[0180] (8) Reply phase outside consensus
[0181] The master node replies to the client <WITHOUT-REPLY, vd, B, t, d(m), S c >.
[0182] At this time, only one master node initiates a consensus request in a consensus set during the entire consensus process (in the case of no Byzantine nodes), and other nodes only need to verify the transaction hash and signature, without the need to initiate a consensus request. Based on the contribution degree, the master node is selected, and then the group consensus is performed. This mode is similar to the implementation mechanism of having a leader node, which can conveniently control the initiation of consensus, effectively avoid repeated consensus and competition among nodes, and improve the efficiency of the entire consensus process.
[0183] Where Request(m) represents sending a request message, the current view number is vd, the request number is Nd, the PBFT master node number is p, the slave node number is j, B represents the block number, t represents the timestamp, the client request message is m, H(m) represents the hash value of the message, the digest of the request message m is d(m), and the consensus set signs the message m as S F , the number of Byzantine nodes is f, the client is Client, and the signature of the message by the client is S c The partial group consensus of CG-PBFT is described as shown in Algorithm 2.
[0184]
[0185]
[0186] 1.5 Correctness analysis
[0187] Aldin et al. proposed that a distributed system can at most simultaneously satisfy two of the three items of consistency, availability, and partition tolerance, i.e., the CAP principle. Consistency refers to the fact that all nodes in a distributed system can see the same data state at the same time, even if some nodes in the system face failures or network partitions. Here, the strong consistency in theory is referred to, and achieving strong consistency usually requires high performance and complexity costs, and is not common. Therefore, based on actual needs and requirements, the BASE theory is usually combined with replica mechanisms, consistency protocols, distributed transactions, and other mechanisms to alleviate this problem to some extent and achieve a data consistent state. Availability is the ability of a system to continuously provide services, i.e., the system can respond to requests and return valid results at any time. Partition tolerance refers to the fact that a system can continue to operate normally when facing network partitions, and will not fail as a whole due to network partitions. That is, the system can continue to work after network partitioning, and will not be affected by the failure of some nodes or communication links. According to the CAP principle, if the network has a problem, the distributed system needs to make a trade-off between ensuring data consistency, availability, and partition tolerance. The system can choose to ensure data consistency, but will sacrifice some availability or partition tolerance; conversely, the same is true. This trade-off is one of the important factors to consider when designing a distributed system.
[0188] The CG-PBFT algorithm ensures consensus consistency through the PoC algorithm, and then ensures the final consistency of the nodes through the PBFT algorithm. In the first consensus stage, the PoC algorithm mainly realizes the selection of the master node by means of the contribution proof mechanism and the randomness mechanism, and controls the number of malicious nodes, that is, it is agreed to determine a master node to coordinate the joint action of other nodes. The PoC algorithm allows the number of existing fault nodes f to be controlled within 30% of the total number of nodes N, ensuring the consistency of consensus; in the second consensus stage, the PBFT algorithm ensures that the nodes can reach consensus while avoiding errors or cheating behaviors between nodes, ensuring the final consistency, that is, when the number of fault nodes f in the PBFT algorithm is less than (N-1) / 3, the fault tolerance of the consensus stage can be ensured.
[0189] 1.6 Defense against Byzantine attacks
[0190] The first stage of the CG-PBFT algorithm ensures the security of consensus through the PoC algorithm, and the PoC algorithm ensures the security of the consensus process through multiple mechanisms. For example, the deposit mechanism makes participants invest enough resources in competing for block production rights, ensuring that participants have the necessary economic motivation and enthusiasm to participate, ensuring the normal operation and security of the network, and at the same time, the deposit mechanism requires attackers to pay a high cost to perform malicious behavior, thereby increasing the security of the system; the puzzle solving mechanism usually sets some complex puzzles or riddles, and nodes need to solve these puzzles by calculation to generate the corresponding proof, which can prevent attackers from easily generating storage space; the introduction of randomness makes it impossible for nodes to predict the next block producer, which increases the difficulty of attacks on the one hand, and ensures the fairness of competition between nodes on the other hand.
[0191] Secondly, the verification of block legitimacy and the hash chain structure. In the PoC algorithm consensus process, each node needs to participate in verifying the legitimacy of the block, which is completed through a hardware encryption mechanism to avoid malicious attacks and encryption vulnerabilities, and in addition, the hash chain structure can prevent malicious transactions and operations. In addition, the block distribution is relatively uniform. In the POC consensus algorithm, all nodes participate in the production of fast, reducing the risk of inequality between nodes, thereby enhancing the security of the system. Moreover, the malicious behavior of any node will not affect the consensus of other nodes, ensuring the high fault tolerance and stability of the system; and the PoC algorithm ensures the reliability and fairness of consensus by dynamically changing the master node.
[0192] The security of the second phase of the CG-PBFT algorithm is guaranteed by the properties of PBFT. PBFT is fault-tolerant, assuming a total of N nodes, with at most f Byzantine nodes, when f ≤ (N-1) / 3, even if a small number of nodes fail, honest nodes can still continue to communicate and maintain consistency, ensuring security. In addition, during the consensus process, the view change mechanism of PBFT can solve the problem of consensus failure caused by node failure or other reasons, and can quickly recover the consensus process to ensure the continuity and security of the consensus. Moreover, through the message signature mechanism, PBFT algorithm can prevent malicious behaviors such as forgery, replay attack, tampering, etc., to ensure the security of the consensus.
[0193] 1.7 Resilience against other attacks
[0194] In the consortium chain, the identity of the participant user needs to be strictly examined, and measures such as using unique timestamps and random numbers are taken to prevent identity forgery and replay attacks, ensuring the security and reliability of blockchain transactions. These measures play a key role in transaction interactions, effectively preventing malicious participants from broadcasting verified transactions or blocks, thereby protecting the system from attacks by untrusted and unauthorized third parties.
[0195] Moreover, when each user signs transaction information with a private key and publishes it to the blockchain, it ensures the uniqueness and tamper resistance of the transaction, as only the private key holder can effectively sign the transaction. If there is a denial of transaction, confirming the identity of the signer through the public key associated with it can ensure the authenticity of the transaction and accountability, as the public key and private key are one-to-one.
[0196] The application of secure hash functions can further enhance the system's resistance to tampering attacks, as these functions generate a unique digest that converts transaction information into a fixed-length string, ensuring data integrity and security. In addition, the admission and token collateral mechanism links tokens with economic incentives, meaning that users need to pay tokens to participate in the system. This mechanism is effective in resisting distributed denial-of-service (DDoS) attacks, as token payment and economic benefits limit the motivation and nature of malicious users launching attacks.
[0197] In the CG-PBFT algorithm, by reasonably grouping consensus nodes, the ability of attackers to control enough nodes to tamper with consensus can be reduced. The grouped nodes can better supervise and correct each other during the consensus process, increasing the difficulty and cost of attacks and improving the overall network security. At the same time, the node selection process is optimized to ensure that the master node selected each time is a node with high contribution, thereby improving the security of the consensus. The above measures can effectively improve the resistance to 51% attacks.
[0198] 2. Experiment and result analysis
[0199] 2.1 Experimental environment
[0200] To further verify the performance of the CG-PBFT algorithm, we use Intel(R) Core(TM) i7-12700H 2.30GHz, memory 16.0GB, a win10 operating environment, and at the same time, we virtualize multiple operating system instances on a computer, with each instance representing a node, and each node running the same Byzantine fault-tolerant consensus algorithm software, and through mutual communication to complete the consensus process to simulate a multi-node environment and further simulate the construction of a blockchain system environment. We compare CG-PBFT with traditional PBFT, G-PBFT, WBFT and RBFT from four indicators of communication load, throughput, delay and fault tolerance to evaluate. After the system runs for 5 minutes, the client initiates 200 groups of requests, and the experiment is repeated 30 times, and the average of the 30 experimental results is taken as the final test result. The detailed experimental parameters are shown in Table 1.
[0201] Table 1 Experimental device
[0202]
[0203]
[0204] 2.2 Communication overhead
[0205] The communication resources consumed by each node in the process of information transmission, verification, synchronization data and other operations with other nodes constitute the communication overhead. These communication overheads play a crucial role in the consensus process, but also bring additional resource consumption. For example, in public chains, it can ensure the reliability and security of transactions and blocks, in private chains or consortium chains, communication overhead can be reduced by using more efficient algorithms and protocols. Lower communication overhead can reduce network congestion, transmission delay, and also reduce the burden and resource consumption of nodes. Therefore, under normal circumstances, lower communication overhead is an important goal of blockchain network optimization and improvement. The size of the communication overhead is related to the number of nodes and the communication frequency. By reducing the communication overhead, the efficiency and performance of the blockchain network can be improved.
[0206] This section analyzes the single consensus communication of PBFT algorithm, PoC algorithm and CG-PBFT algorithm respectively, and compares the differences in communication complexity of the three algorithms.
[0207] (1) Number of times of single consensus transmission
[0208] PBFT pre-preparation phase, preparation phase, submission phase, communication overhead is mainly concentrated in the last four stages. In the pre-preparation phase, the master node sends messages to other consensus nodes, and the network communication consensus of this stage is N-1 (N refers to the number of nodes). Enter the preparation phase, send messages to each other between all nodes except the node itself, the number of communications in this stage is N*(N-1). In the submission phase, all nodes verify the received preparation information to other nodes, in this stage, the communication consensus is N*(N-1). In the reply phase, each node sends an acknowledgment message to the client, and the communication times are N times. In summary, the PBFT consensus algorithm realizes the communication times T1 once.
[0209]
[0210] (2)Analysis ofPoC algorithmnetworkcommunicationinteraction
[0211] PoC consensus process is mainly divided into proposal phase, voting phase, calculation phase, announcement phase and other four stages. In the proposal phase, each node needs to send a broadcast to other nodes once. At this time, the communication times are N-1 times. In the voting phase, each node needs to send a voting message to other nodes once. Therefore, the communication times are M-1 times. Enter the calculation phase, the node needs to calculate the contribution degree of the winning proposal according to the received voting result, in this stage, each node needs to send a calculation result to other nodes once, at this time the communication times are N-1 times. In the announcement phase, each node needs to receive an announcement message from other nodes once, and the communication times in this stage are N-1 times. Therefore, the total communication times required in the consensus process of the contribution-based consensus algorithm once is as follows.
[0212] T2=4(N-1) (12)
[0213] (3)CG-PBFT algorithm network communication interaction analysis
[0214] The improved CG-PBFT consensus algorithm increases the consensus set grouping stage compared with the traditional PBFT algorithm, and introduces a contribution consensus mechanism to select the master node. In the algorithm division consensus set stage, the N nodes in the network need to be divided into F different consensus sets, and the communication times of this process is F (F refers to the number of consensus sets). After dividing the consensus set, the contribution mechanism is introduced to elect the master node for each consensus set. The total communication quantity is (N / F-1)*F. For the internal consensus set preparation stage, the master node selected by each consensus set broadcasts a message to the members in the consensus set, and the communication times is (N / F-1)*F. In the consensus set internal submission stage, each member of the consensus set submits a message to the master node, and the communication times is (N / F-1)*F. In the preparation stage outside the consensus set, the master node broadcasts a message to other nodes except itself, and the communication times is (F-1)*F. For the submission stage outside the consensus set, each master node verifies the received message and then sends it to other master nodes, and the communication times is (F-1)*F. Then the total communication times T3 of CG-PBFT is
[0215]
[0216] Assuming that N / F is an integer, let F=N / U, where U refers to the number of members in the consensus set and the value is any constant greater than 3, then formula 10 can also be simplified as:
[0217]
[0218] In addition, in the CG-PBFT algorithm, the division of the consensus set is first performed, and then the master node is selected for each consensus set before the consensus is performed. At this time, only the master node communicates with other nodes, that is, the total communication complexity can be regarded as the communication complexity of the master node. According to the analysis and calculation, the communication complexity of CG-PBFT algorithm is O(F 2 ), and the communication complexity of PBFT consensus mechanism is O(N 2 ), and the communication complexity of PoC consensus mechanism is O(N). Compared with PBFT, the CG-PBFT algorithm reduces the communication complexity and shortens the communication time. The comparison among the three algorithms is shown in Table 2.
[0219] Table 2 Comparison of three algorithms
[0220]
[0221] According to the above calculation formula, the traditional PBFT algorithm, PoC algorithm and CG-PBFT algorithm proposed in this paper are evaluated and demonstrated from two aspects of communication times and time complexity.
[0222] When N≥4, F≥4,
[0223] 2N 2 -1>3N+2N*(N-2)≥3N+2F*(F-2) (15)
[0224] From formula (12), it can be seen that T1>T3, that is, CG-PBFT requires less communication times than traditional PBFT, and the communication times decrease with the increase of the number of nodes.
[0225] Demonstrate the communication complexity. The communication time complexity of traditional PBFT is O(N 2 ), and the communication time complexity of CG-PBFT proposed by the application is O(F 2 ).
[0226] When N≥4, F≥4,
[0227] O(N 2 )>O(F 2 ) (16)
[0228] From formula (13), it can be seen that the algorithm complexity of PBFT is greater than that of CG-PBFT, that is, the CG-PBFT proposed in this paper is superior to the traditional PBFT algorithm.
[0229] Experiment 1: Assuming that the consensus set grouping F=4 in the simulation test, the total number of nodes is set to 20-44. The comparison of the communication times required for each single consensus of PoC, CG-PBFT and PBFT consensus algorithms is shown in Figure 4 .
[0230] From Figure 6 , it can be seen that the communication times of PBFT algorithm for completing a consensus are much higher than those of PoC and CG-PBFT, and the communication times of CG-PBFT algorithm are close to those of PoC algorithm. And with the gradual increase of the number of nodes, the communication times difference between PBFT algorithm and PoC and CG-PBFT algorithms gradually increases. For example, when the network of PBFT and CG-PBFT each has 28 nodes, the communication interaction times of PBFT are 1567 times, and the communication times of CG-PBFT are 100 times. When the number of nodes is 44, the communication times of PBFT algorithm are nearly 4000 times. These numbers show that CG-PBFT significantly reduces the communication interaction rounds in the consensus process.
[0231] Experiment 2: In order to more intuitively evaluate the communication load performance of CG-PBFT algorithm, a series of experiments are carried out to measure the communication load of PBFT, G-PBFT, RBFT, WBFT and CG-PBFT under different scene nodes. As Figure 5 shown is the experimental results of the communication load performance of the five consensus algorithms.
[0232] Figure 7 The communication overhead of the five algorithms increases with the increase of nodes. However, when the number of nodes in the network is less than 300, the communication overhead of all consensus algorithms is relatively low, and when the number of nodes exceeds 400, the communication overhead increases rapidly with the increase of the number of nodes. When the number of nodes is fixed, the communication overhead of CG-PBFT is relatively small. In addition, by observing the chart, it can be seen that the communication overhead of PBFT increases the fastest, while the increase of CG-PBFT is the smallest. For example, when the number of nodes is 800, it can be seen that the communication overhead performance of the other four consensus algorithms is better than that of PBFT, especially CG-PBFT, which shows that the algorithm proposed in this paper can reduce the communication overhead and effectively reduce the amount of message passing between nodes.
[0233] The experimental results confirm the superiority and effectiveness of CG-PBFT in reducing communication load, making it more promising in applications that require effective use of network resources. The main reason for CG-PBFT to reduce communication costs is the grouping of consensus sets and the introduction of the contribution mechanism, which makes the communication between different nodes more efficient and targeted, reduces unnecessary communication overhead, and improves the performance and efficiency of the algorithm. This means that CG-PBFT not only guarantees security, but also improves the efficiency and performance of the system, thereby better meeting the needs of practical applications.
[0234] CG-PBFT proposes a node contribution model, which can make the PBFT algorithm more efficient and reliable in node election. By reasonably evaluating the contribution of nodes, it can elect nodes with better quality as master nodes, and maintain an efficient consensus mechanism. At the same time, CG-PBFT introduces grouping of consensus sets, which can perform independent consensus verification for each group during the consensus process, thereby increasing the fault tolerance of the system and effectively preventing malicious interference by Byzantine nodes on the entire system.
[0235] 2.3 Throughput
[0236] Throughput generally refers to the amount of data or transactions processed by a system within a certain period of time. In blockchain, transactions per second (TPS) is a measure of throughput. TPS is usually defined as the number of transactions that can be processed per unit of time, that is,
[0237]
[0238] where Transactions Δt represents the number of transactions processed in Δt time, and Δt represents the time taken to process the corresponding transaction. High TPS usually means that the system has higher throughput and processing capacity, and can confirm transactions and generate blocks faster.
[0239] Experiment 1: In the simulation experiment, it is assumed that the nodes participating in consensus are 16-28, the client interval is set to 40 ms to send a request once, a maximum of 25N requests are processed per second, a block operation is performed every 10 s, and the average value of multiple stable data after 5 min of test running is taken as the throughput result of the test. The throughput test results of CG-PBFT and PBFT are as shown in Figure 6
[0240] As Figure 6 shown, the throughput of PBFT decreases with the increase of the number of nodes. For the CG-PBFT algorithm, when the consensus set is divided into 4 groups, the throughput increases with the increase of the number of nodes, and when the number of nodes in the fixed group is 3, the throughput decreases with the increase of the number of nodes. More importantly, no matter how the number of nodes changes, the performance of CG-PBFT is better than that of PBFT. When the grouping is fixed and the number of nodes in the group gradually increases, the throughput also increases; when the number of nodes in the group is fixed and the number of groups increases, the throughput gradually decreases. In addition, when the number of system nodes remains unchanged, the more the number of nodes in the group, the greater the throughput. The node concurrency degree is the main factor affecting the TPS.
[0241] Experiment 2: Set the number of nodes to 200-800, and then measure the average throughput of five algorithms under different nodes.
[0242] Figure 7 The figure shows that the throughput of the five consensus algorithms changes with the increase of the number of nodes. Figure 7 The horizontal coordinate value represents the number of nodes, and the vertical coordinate value represents the throughput. From the experimental results, the throughput of the CG-PBFT proposed in this paper is better than that of other algorithms. With the increase of the number of nodes, the throughput of all algorithms is decreasing, but the throughput of the PBFT algorithm decreases the most. When the number of nodes is 500, the throughput values of WBFT and G-PBFT are similar, about 226, and the throughput values of other algorithms are in the range of 160-420. In addition, from the figure, it can be seen that the throughput of CG-PBFT is higher than that of the comparative algorithm under different nodes, and the decrease amplitude is lower than that of the comparative algorithm. Therefore, it is proved that the throughput performance of CG-PBFT is higher than that of the comparative algorithm, and the advantage is more obvious with the continuous increase of the number of nodes, which shows that CG-PBFT is suitable for large-scale node scenarios and can more efficiently process transactions and improve the consensus speed.
[0243] 2.4 Consensus delay
[0244] ConsensusDelay can be used to evaluate the performance and efficiency of a blockchain system. Consensus delay refers to the time it takes for a transaction to be initiated by a client to be finally confirmed on the chain. Generally, a lower consensus delay is often considered a key indicator of a system performing well, meaning that nodes are able to reach consensus faster, and the processes of transaction verification, block generation and confirmation can be completed faster. This indicates that the entire system has higher efficiency and response speed, stronger transaction processing capacity and greater throughput. The consensus delay formula is expressed as follows:
[0245] Δt = t complete -t start (18)
[0246] where Δt represents the consensus delay, t complete represents the time when the client receives the PBFT reply message, i.e. the time when the transaction confirmation is completed, and t start represents the time when the client consensus starts. Record the data and take the average of multiple experimental results as the consensus delay of the algorithm. The test results of the consensus delay of the proposed CG-PBFT algorithm and PBFT, WBFT and G-PBFT are shown in Figure 8
[0247] It can be clearly seen from Figure 10 that the horizontal axis represents the node and the vertical axis represents the transaction delay. And with the increase of the number of nodes, the consensus delay of all algorithms shows an upward trend, among which WBFT and G-PBFT have similar increasing trend and rise slowly, while the PBFT algorithm rises rapidly. When the number of nodes exceeds 400, the PBFT transaction delay rises the fastest, while the CG-PBFT grows the slowest. In other words, under the same nodes and scenarios, the transaction delay of CG-PBFT is the shortest and the performance is the best. For example, when there are 600 nodes in the network, the PBFT delay is 11.38ms, the RBFT delay is 10.61ms, and the CG-PBFT delay is 4.51ms, which is 60.37% lower than PBFT and 57.49% lower than RBFT. The CG-PBFT reference contribution model selects high-contribution nodes as master nodes, and high-contribution nodes are usually able to process and transmit messages faster, thereby speeding up the consensus and reducing the delay. The experimental results confirm that the proposed CG-PBFT algorithm can effectively reduce the delay.
[0248] 2.5 Fault tolerance
[0249] To evaluate the security of the proposed CG-PBFT algorithm, the node fault tolerance of the algorithm is tested below. Generally, consortium chains have strict access mechanisms, such as identity verification when joining the consortium chain, to ensure that participants have a legal identity and meet specific access standards. However, the access mechanism can improve the security of the network to a certain extent, but it cannot completely prevent the existence of malicious nodes.
[0250] Fault tolerance is usually represented by f. To facilitate differentiation, the fault tolerance of traditional PBFT is represented by f p , and the fault tolerance of the CG-PBFT algorithm is represented by f cg . Generally, the number of Byzantine nodes allowed to be included in traditional PBFT is f p ≤(N-1) / 3. However, CG-PBFT adopts a consensus set grouping operation, so its fault tolerance consists of two parts: one part is one-third of the number of nodes within the group that are all Byzantine nodes f cg1 , and the other part is two-thirds of the number of nodes within the consensus set that are non-Byzantine nodes f cg2 .
[0251] f cg =f cg1 +f cg2 (19)
[0252]
[0253]
[0254] Then the system fault tolerance of the proposed algorithm is:
[0255]
[0256] Simplify formula 20:
[0257]
[0258] In particular, N represents the total number of nodes (N≥12), U (U≥3) represents the number of nodes within the consensus set, and F (F≥4) represents the number of groups.
[0259] From Figure 9 , it can be seen that the number of Byzantine nodes accommodated by PBFT and CG-PBFT increases with the increase in the number of nodes, and in particular, after the number of nodes exceeds 200, CG-PBFT shows a more rapid upward trend than PBFT. In addition, under the given conditions, the larger the value of U in the CG-PBFT algorithm, the stronger the system fault tolerance. Therefore, compared with PBFT, CG-PBFT shows better fault tolerance.
[0260] We have conducted a comparative experiment of five algorithms before. In order to more accurately distinguish the performance of CG-PBFT and PBFT algorithms, the experiment is simplified to compare the performance indicators of CG-PBFT and PBFT algorithms. This method can explore the differences between CG-PBFT and PBFT in various performance indicators in more detail, so as to more accurately evaluate the differences between them, and the test results are as shown in Figure 10 .
[0261] From Figure 10 it can be clearly seen that the evaluation results of the algorithm CG-PBFT proposed in this paper and the traditional PBFT under different performance indicators. The abscissa represents the node, and the ordinate represents different performance indicators. Figure 10 (a) shows that when the number of nodes increases, the throughput of CG-PBFT and PBFT algorithms is decreasing, but compared with the CG-PBFT algorithm, the number of nodes has a more significant impact on PBFT, because the speed of its throughput decline is significantly accelerated. Referring to Figure 10 (b), the more common nodes in the system, the more Byzantine nodes that PBFT and CG-PBFT can contain. Relatively speaking, the growth trend of PBFT is slightly slower than that of CG-PBFT. From Figure 10 (c) and (d), it can be seen that the transaction delay and communication overhead of CG-PBFT algorithm and PBFT algorithm increase with the increase of the number of nodes. Obviously, PBFT shows a higher growth rate than CG-PBFT. In other words, in the same scenario, PBFT needs to consume higher communication overhead than CG-PBFT, and the transaction delay of PBFT is longer than that of CG-PBFT. Most importantly, CG-PBFT outperforms PBFT.
[0262] As Figure 11 shown, the improved alliance chain consensus system based on contribution degree and grouping provided by the embodiment of the application comprises:
[0263] The grouping strategy module: through the grouping of the consensus set, the communication complexity between nodes can be reduced, making it easier for nodes within each group to cooperate, improving network throughput and efficiency;
[0264] The management master node selection module: in the blockchain network, a consensus mechanism based on contribution degree is introduced, and the node with the highest contribution degree is selected as the master node through the management master node election stage, solving the problems of performance imbalance, security and resource consumption of PBFT;
[0265] The node contribution calculation module: node contribution degree is a measurement method for measuring the contribution of each node on the entire network. The node contribution degree is mainly composed of node data contribution degree and online resource consumption;
[0266] CG-PBFT optimizes the consensus protocol module: CG-PBFT groups the consensus set, introduces the PoC contribution algorithm to select the master node, initializes the contribution of each node, and retains the PBFT algorithm stage, increases the master node election stage, solves the problem of random selection of master nodes, and reduces the number of communications;
[0267] Correctness analysis module: CG-PBFT algorithm guarantees consensus consistency through PoC algorithm, and then guarantees the final consistency of nodes through PBFT algorithm;
[0268] Defense against Byzantine attack module: the security of the second stage of CG-PBFT algorithm is guaranteed by the characteristics of PBFT;
[0269] Elasticity module against other attacks: in CG-PBFT algorithm, the consensus nodes are reasonably grouped to reduce the number of nodes controlled by attackers to tamper with the consensus.
[0270] The application embodiment of the present application provides a computer device, which comprises a memory and a processor, the memory stores a computer program, and the computer program is executed by the processor to make the processor execute the steps of the improved consortium chain consensus method based on contribution and grouping.
[0271] The application embodiment of the present application provides a computer readable storage medium, which stores a computer program, and the computer program is executed by the processor to make the processor execute the steps of the improved consortium chain consensus method based on contribution and grouping.
[0272] The application embodiment of the present application provides an information data processing terminal, which comprises an improved consortium chain consensus system based on contribution and grouping.
[0273] The specific application field or related product of the present application.
[0274] 1. Financial field
[0275] In the financial field, blockchain technology has broad application prospects. By optimizing the contribution calculation and grouping algorithm, we can further improve the application efficiency of blockchain in the financial field. For example, in the cross-border payment field, we can use blockchain technology to realize fast, safe and low-cost cross-border payment. By optimizing the grouping algorithm, we can distribute payment requests to nodes with high contribution and high performance for processing, thereby improving payment speed and security.
[0276] Related products include blockchain-based cross-border payment platforms, digital currency trading platforms, etc. These platforms can use optimized contribution calculation and grouping algorithms to provide users with more efficient and secure financial services.
[0277] 2. Internet of Things
[0278] The Internet of Things is another important field that can apply the improved PBFT algorithm. In the Internet of Things, there are a large number of devices and sensor nodes that need to cooperate with each other to complete various tasks. Due to the limited resources of Internet of Things nodes, an efficient and lightweight consensus algorithm is needed to support inter-node collaboration. The improved PBFT algorithm can reduce communication overhead and improve efficiency through contribution and grouping strategies, making it suitable for the Internet of Things field. For example, an Internet of Things data sharing platform based on the improved PBFT algorithm can be built to collect, process, and share various Internet of Things data. This platform can support efficient data sharing and collaborative processing while ensuring data security and reliability.
[0279] 3. Supply Chain Management
[0280] In the field of supply chain management, blockchain technology can help enterprises achieve transparent and traceable supply chain management. By optimizing contribution calculation and grouping algorithms, we can further improve the efficiency of blockchain applications in supply chain management. In the supply chain, there are multiple participants and complex business processes that require the authenticity and traceability of information. At the same time, the supply chain has high requirements for the real-time and accuracy of information transmission. The blockchain system using the improved PBFT algorithm can ensure the authenticity and traceability of information in the supply chain while improving the efficiency and accuracy of information transmission. For example, a supply chain management platform based on the improved PBFT algorithm can be built to track and manage various links and participants in the supply chain. This platform can record and process various business data and information in real time while providing efficient query and verification functions. It can also be applied in the field of logistics tracking, where we can use blockchain technology to achieve real-time and accurate logistics information tracking. By optimizing the grouping algorithm, we can distribute logistics information to nodes with high contribution and high performance for processing, thereby improving the accuracy and real-time performance of logistics tracking.
[0281] Related products include blockchain-based logistics tracking platforms and supply chain management platforms. These platforms can use optimized contribution calculation and grouping algorithms to provide more efficient and transparent supply chain management services for enterprises.
[0282] 4. Other Fields
[0283] In addition to the financial and supply chain management fields, blockchain technology can also be applied to many other fields. For example, in the field of copyright protection, we can use blockchain technology to protect the copyright of digital works; in the medical field, we can use blockchain technology to share and securely store medical data, etc. In these fields, the optimized contribution degree calculation and grouping algorithm can also improve the application efficiency and service quality of blockchain technology.
[0284] Related evidence of the technical effects obtained by the embodiments of the present application.
[0285] 1. Performance improvement
[0286] To verify the performance improvement of CG-PBFT, we conducted a series of experiments and compared them with traditional PBFT algorithms. The experimental results show that CG-PBFT has achieved significant advantages in transaction throughput, consensus delay, etc. Specifically, when the nodes are all 28, the communication frequency of CG-PBFT is 100 times, and the traditional PBFT algorithm is 1567 times; when there are 600 nodes in the network, CG-PBFT reduces the consensus delay by about 60% compared with traditional PBFT. This is mainly due to the application of the contribution mechanism and the grouping strategy.
[0287] (1) Contribution mechanism: In CG-PBFT, we introduce a contribution index for each node, which reflects the historical performance, resource input, etc. of the node. By calculating the contribution of the node, we can allocate different weights to different nodes, so that in the consensus process, nodes with high contribution have greater influence. This mechanism effectively avoids the problem of resource waste and low efficiency caused by equal participation of nodes in traditional PBFT algorithms.
[0288] (2) Grouping strategy: In order to reduce communication overhead and improve consensus efficiency, we group the nodes in the network according to their contribution. The nodes in each group communicate with each other to form local consensus, and then submit the local consensus result to the global consensus node for verification and confirmation. This grouping strategy effectively reduces the communication volume between nodes and reduces network congestion, thereby improving the overall performance of the system.
[0289] 2. Security enhancement
[0290] Security is one of the most core performance indicators of blockchain systems. We simulated malicious attack scenarios to verify the advantages of CG-PBFT in security. The experimental results show that CG-PBFT can effectively resist common malicious attack methods such as Byzantine attack, double payment attack, etc. This is mainly due to the following two aspects:
[0291] (1) Byzantine fault tolerance capability: CG-PBFT inherits the Byzantine fault tolerance capability of traditional PBFT algorithms, which means that it can still guarantee consensus among honest nodes even if there are some malicious nodes in the network. By introducing the contribution mechanism and grouping strategy, we further enhance the Byzantine fault tolerance capability of the system, making it stable even when facing larger-scale malicious attacks.
[0292] (2) Node contribution mechanism: In CG-PBFT, we establish a contribution record for each node, recording its contribution information and behavior. By analyzing the contribution record of a node, we can timely discover and isolate malicious nodes, preventing them from causing damage to the system.
[0293] 3. Reduced system overhead
[0294] In traditional PBFT algorithms, communication overhead and computational overhead between nodes are important factors that constrain system performance. To reduce system overhead, we have taken the following measures in CG-PBFT:
[0295] (1) Grouping strategy: By grouping nodes, we effectively reduce the amount of communication between nodes and lower communication overhead. At the same time, since the number of nodes in each group is small, the amount of computation required to reach consensus is also reduced, further reducing computational overhead.
[0296] (2) Contribution mechanism: In traditional PBFT (Practical Byzantine Fault Tolerance) algorithms, the selection of master nodes usually uses a simple rotation mechanism, which does not take into account the performance and contribution of nodes, leading to an increase in system overhead. To optimize this problem, we introduce a contribution algorithm that dynamically selects master nodes based on the actual contribution of nodes. Specifically, the contribution algorithm first defines a formula for calculating contribution, which takes into account factors such as resource input, request processing efficiency, and correctness of nodes. By regularly calculating and updating the contribution of each node, the system can identify the node with the highest contribution. Subsequently, when switching views
[0297] , the node with the highest contribution is selected as the new master node. This approach effectively avoids the blindness of master node selection in traditional PBFT, ensuring that the master node has high performance and reliability. By dynamically adjusting the master node, the system can more efficiently process requests, reducing network transmission and computational resource overhead, thereby improving the performance and stability of the entire system.
[0298] It should be noted that embodiments of the present application can be realized by hardware, software, or a combination of software and hardware. The hardware portion can be realized by a special logic; the software portion can be stored in a memory and executed by a proper instruction execution system, such as a microprocessor or a specially designed hardware. A person of ordinary skill in the art can understand that the above-mentioned apparatus and method can be realized by computer executable instructions and / or included in processor control codes, such as a carrier medium, such as a magnetic disk, CD or DVD-ROM, a programmable memory, such as a read-only memory (firmware), or a data carrier, such as an optical or electronic signal carrier. The apparatus of the present application and its modules can be realized by a hardware circuit, such as a very large scale integrated circuit or a gate array, a semiconductor, such as a logic chip, a transistor, or a programmable hardware device, such as a field programmable gate array, a programmable logic device, or the like, by software executed by various types of processors, or by a combination of the above-mentioned hardware circuit and software, such as firmware.
[0299] The above description is merely a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any modification, equivalent replacement, and improvement within the technical range disclosed by the present application, and within the spirit and principle of the present application, should be included in the protection scope of the present application.
Claims
1. An improved alliance chain consensus method based on contribution and grouping, characterized by: include: S1, Grouping Strategy: By grouping the consensus set, the communication complexity between nodes is reduced, making it easier for nodes in each group to collaborate, thereby improving network throughput and efficiency; S2, the management masternode selection phase: In the blockchain network, a contribution-based consensus mechanism is introduced. The node with the highest contribution is selected as the masternode during the management masternode election phase. This solves the performance imbalance, security issues, and resource consumption problems of PBFT. S3, node contribution calculation: Node contribution is a measure of the contribution of each node on the blockchain to the entire network. Node contribution consists of two aspects: node data contribution and online resource consumption. Node data contribution is affected by data volume contribution and data information entropy. Node online resource consumption is estimated by CPU usage. Assuming that the amount of message data sent and received by each node is the same, set the CPU frequency to , then the CPU resource consumption of a consensus of node i is defined as follows: ; in, Indicates the ability of the node computing chipset to store charge; Indicates the CPU cycles of a consensus of node i; Indicates the size of data required for consensus; S4, CG-PBFT optimizes the consensus protocol: CG-PBFT groups the consensus set, introduces the PoC contribution algorithm to select the master node, and initializes the contribution of each node. While retaining the PBFT algorithm stages, it adds a master node election stage to solve the problem of arbitrary master node selection, thereby reducing the number of communications. S5, Correctness Analysis: The CG-PBFT algorithm uses the PoC algorithm to ensure consensus consistency, and then uses the PBFT algorithm to ensure the final consistency of nodes; S6, Defense against Byzantine Attacks: The security of the second phase of the CG-PBFT algorithm is guaranteed by the characteristics of PBFT; S7, resilience against other attacks: In the CG-PBFT algorithm, consensus nodes are reasonably grouped to reduce the risk of attackers controlling enough nodes to tamper with consensus consistency.
2. The improved alliance chain consensus method based on contribution and grouping as claimed in claim 1 is characterized in that: The grouping steps in S1 are as follows: System initialization: Before the blockchain network is launched, the system is initialized, including authenticating newly joined nodes and selecting F of them as candidate management nodes. This step ensures that the network has a set of recognized master node candidates at the beginning. Isolation status confirmation: Confirm that the nodes in the network have not yet established any connection and are in an isolated state. This is to ensure that all nodes are in a fair and isolated state before the response speed test is carried out to avoid the influence of external factors; Group Probe Message: A prepared master node a∈(1, 2, ...N), assumed to be node 1 (a), sends a group probe message <subset, t1, S_a> to other nodes in the network, indicating that it is time t1 and its digital signature is S_a. These messages are used to solicit other nodes' willingness to join the consensus cluster and initiate communication and information transfer between nodes. Request to join the consensus set: When node x, x∈1,2,...n receives this message, it first proves the signature of node 1(a) to ensure that the message is authentic and valid; if correct, node x decides to join the consensus cluster of node 1(a) and sends a join request <subset request, t2, S_x> to node 1(a), where t2 is the current timestamp of node x and S_x is the digital signature of the current round; Processing a join request: After receiving a join request, node 1 (a) first checks whether the number of members in its consensus cluster has reached the upper limit Nmax. If the group is not full and node x's information verification is successful, node 1 (a) agrees to node x's join request and adds node x to its consensus set member list. If the number of members in node 1 (a)'s consensus cluster is full or node x's information verification fails, node 1 (a) sends a rejection message to node x, and node x attempts to send a join request to other candidate master nodes. Find the next candidate master node: If node 1 (a) sends a rejection message to node x, then node x requests another candidate master node to join its consensus cluster. This step ensures that the node finds a consensus cluster that suits it through multiple attempts and repeats the above steps. Grouping completion and information broadcast: After all nodes attempt to join the consensus cluster, each management node will broadcast their consensus cluster member list for verification, and then send this information to their respective group members to complete group confirmation; this ensures that each node can eventually find the consensus cluster to which it belongs, and that the member list of each consensus cluster is up-to-date and accurate.
3. The improved alliance chain consensus method based on contribution and grouping as claimed in claim 1 is characterized in that: S2 specifically includes: In the management master node selection phase, after the consensus set is grouped, the flag enters the contribution-based master node election; first, the nodes in each group will be comprehensively evaluated based on their contribution to the network, and then each node will be assigned a corresponding contribution score. Based on the node's contribution score, the node with the highest contribution in the group will be selected as the master node. The node will broadcast its contribution score to other nodes in the network. Other nodes will rank based on this information and finally select the node with the highest contribution as the master node; once each group selects the master node, it enters the extra-group consensus.
4. The improved alliance chain consensus method based on contribution and grouping as claimed in claim 1 is characterized in that: S4 specifically includes: Request phase: multiple transaction requests are sent by the client to the consensus nodes of each consensus set; In-group master node selection phase: The contribution of each node in the consensus set is calculated and ranked, and the node with the highest contribution is selected as the master node. The master node then pre-processes transactions related to the current state of the blockchain network and transactions to participate in the consensus. The verified and processed transactions are combined into a pre-prepared message; the pre-prepared message contains detailed information about the proposal, including the proposal number, the message digest requested by the client, and the timestamp. Upon receiving the message from the master node, the node first verifies its legitimacy, including the signature and sequence number information of the message to ensure the source and integrity of the message. If the message verification passes, the node will place the proposal in its own proposal queue and wait for subsequent prepare messages. If the message verification fails, the node will ignore the message and continue to wait for other messages or process other tasks. In-group preparation phase: If the node passes verification, the pre-preparation message is considered legal and valid. Then, the information exchange is broadcast to all nodes. The consensus node verifies the received interaction information. When a sufficient number of consistent interaction messages are received from different nodes, the next step is taken. Otherwise, the consensus process is terminated, the node's problem is replaced, and the consensus process is restarted. If the node approves the proposal, it generates a preparation message containing its own approval information. Intra-group commit phase: The master node conducts a comprehensive verification of the received prepare message, including verifying the consistency of the message and confirming whether a sufficient number of nodes support the proposal to form a majority opinion. Once the legitimacy and consistency of the message are confirmed and consensus is determined, the node initiates a response to the proposal. At the same time, these messages are directly broadcast to other nodes in the entire network, allowing other nodes to understand and verify these confirmation information. In this way, the entire system gradually reaches consensus. Beyond consensus setting: Among the members of the intra-group consensus cluster, the master node verifies the member's information and confirms its consensus within the group, and then conducts inter-group consensus. The master node broadcasts the message to other master nodes and enters the preparation phase; No-consensus set submission phase: Received broadcast messages are verified. If the verification passes, the node processes the message. If the node finds inconsistencies in the message, it rejects the message. If multiple nodes receive the same message, the message is considered acceptable and broadcast. Group reply phase: Verify the received confirmation messages to confirm their legitimacy and consistency. Based on these messages and the current state of the node, determine whether the proposal is accepted or rejected. If the confirmation message is valid, the node generates a final confirmation message and notifies other nodes in the group. Beyond the consensus response phase: The master node sends a reply to the client, marking the completion of a complete consensus process; only one master node in the consensus cluster initiates the consensus request, and other nodes are responsible for verifying the transaction hash and signature, avoiding duplicate consensus and competition issues and improving efficiency.
5. The improved alliance chain consensus method based on contribution and grouping as claimed in claim 1 is characterized in that: S5 specifically includes: The CG-PBFT algorithm ensures consensus consistency through the PoC algorithm, and then ensures the eventual consistency of nodes through the PBFT algorithm. In the first consensus phase, the PoC algorithm selects the master node through contribution proof and randomness, controlling malicious nodes to within 30% of the total number of nodes, thereby ensuring consistency. In the second phase, PBFT ensures that nodes reach consensus through message interaction, while avoiding errors or deceptive behavior, ensuring eventual consistency, and having fault tolerance as long as the number of faulty nodes does not exceed f.
6. An improved consortium chain consensus system based on contribution and grouping that implements the improved consortium chain consensus method based on contribution and grouping as described in any one of claims 1 to 5, comprising: Grouping strategy module: By grouping the consensus set, the communication complexity between nodes is reduced, making it easier for nodes in each group to collaborate, thereby improving network throughput and efficiency; Masternode selection management module: In the blockchain network, a contribution-based consensus mechanism is introduced. The node with the highest contribution is selected as the masternode by managing the masternode election phase. This solves the performance imbalance, security issues, and resource consumption problems of PBFT. Node contribution calculation module: Node contribution is a measurement method to measure the contribution of each node on the blockchain to the entire network. Node contribution is mainly composed of two aspects: node data contribution and online resource consumption; CG-PBFT optimizes the consistency protocol module: CG-PBFT groups the consensus set, introduces the PoC contribution algorithm to select the master node, and initializes the contribution of each node. While retaining the PBFT algorithm stages, it adds a master node election stage to solve the problem of arbitrary master node selection, thereby reducing the number of communications. Correctness analysis module: The CG-PBFT algorithm ensures consensus consistency through the PoC algorithm, and then ensures the final consistency of nodes through the PBFT algorithm; Byzantine attack defense module: The security of the second phase of the CG-PBFT algorithm is guaranteed by the characteristics of PBFT; Resilience module to resist other attacks: In the CG-PBFT algorithm, consensus nodes are reasonably grouped to reduce the number of nodes controlled by attackers to tamper with consensus consistency.
7. A computer device comprising a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the improved alliance chain consensus method based on contribution and grouping as described in any one of claims 1 to 5.
8. An information data processing terminal, comprising the improved alliance chain consensus system based on contribution and grouping as described in claim 6.
Citation Information
Patent Citations
Consensus device and method for file block chain based on contribution value proof
CN114741721A
Method and system for multi-block mining by a single node, in (a) single round(s), under different consensus schemes
US20230224176A1