Optimization method and system of PBFT alliance blockchain consensus mechanism

Through the node integral model and randomized master selection strategy, the PBFT alliance blockchain consensus mechanism is optimized, the problem of low node participation efficiency is solved, consensus efficiency and reliability are improved, and the impact of Byzantine nodes is reduced.

CN118509158BActive Publication Date: 2024-11-15ZHEJIANG WANLI GONGLIAN TECH DEV CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202410964052.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-18
Publication Date
2024-11-15
Estimated Expiration
2044-07-18

AI Technical Summary

Technical Problem

The existing PBFT alliance blockchain consensus mechanism is inefficient in active participation of nodes, which affects consensus efficiency.

Method used

By building a node integral model, filtering out nodes with superior performance to form an ad hoc committee, and electing master nodes based on a randomized master selection strategy, triggering a view switching process to ensure the reliability and efficiency of consensus results.

Benefits of technology

It improves the election reliability and consensus efficiency of the master node, reduces the impact of Byzantine nodes, and enhances the stability and reliability of the consensus mechanism.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118509158B_ABST
    Figure CN118509158B_ABST
Patent Text Reader

Abstract

The present invention discloses an optimization method and system for a PBFT alliance blockchain consensus mechanism. A plurality of nodes with superior performance are screened according to an integral model, and a temporary committee is formed based on the plurality of nodes. If a consensus master node fails or is attacked, a view switching process is triggered based on the consensus mechanism. A master node is elected based on the plurality of nodes of the temporary committee and a random master election strategy. A consensus process of a new view is triggered based on the master node and the view switching process. At this time, a plurality of nodes with superior performance are screened according to the integral model to facilitate subsequent management and control of the plurality of nodes with superior performance, and a temporary committee is formed based on the plurality of nodes, thereby ensuring the superiority of establishing the temporary committee. At the same time, a master node is elected based on the plurality of nodes of the temporary committee and a random master election strategy, thereby improving the consensus efficiency of the PBFT alliance blockchain consensus mechanism under the premise of ensuring the reliability of the consensus result.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of PBFT alliance blockchain consensus mechanism, and in particular to an optimization method and system for the PBFT alliance blockchain consensus mechanism. Background Art

[0002] With the development of science and technology, consensus mechanism is the core component of blockchain, which ensures that nodes can reach consensus on the order and correctness of transactions in a distributed network environment. Among the alliance blockchains with access control, the PBFT alliance blockchain consensus mechanism that supports Byzantine fault tolerance is the most widely used. Among the many consensus mechanisms, the blockchain system can select the appropriate consensus mechanism according to different application scenarios and security requirements. However, in the existing PBFT consensus mechanism, it is impossible to mobilize nodes to actively participate, which affects the consensus efficiency of the PBFT alliance blockchain consensus mechanism. Summary of the invention

[0003] The purpose of the present invention is to overcome the shortcomings of the prior art. The present invention provides an optimization method and system for a PBFT alliance blockchain consensus mechanism. Multiple nodes with superior performance are screened according to an integral model to facilitate subsequent management and control of the multiple nodes with superior performance, and a temporary committee is formed based on multiple nodes to ensure the superiority of establishing a temporary committee and further improve the reliability of the election of the master node. At the same time, the master node is elected based on multiple nodes of the temporary committee and a randomized master election strategy, which further ensures the reliability of the election of the master node and improves the consensus efficiency of the PBFT alliance blockchain consensus mechanism while ensuring the reliability of the consensus result.

[0004] In order to solve the above technical problems, an embodiment of the present invention provides an optimization method for a PBFT alliance blockchain consensus mechanism, which is applied to the optimization scenario of the PBFT alliance blockchain consensus mechanism; the optimization method for the PBFT alliance blockchain consensus mechanism includes:

[0005] In the PBFT alliance blockchain, a node points model is constructed based on the comprehensive performance of the nodes in the consensus process;

[0006] Screen multiple nodes with superior performance based on the points model and form a temporary committee based on multiple nodes;

[0007] If the consensus master node fails or is attacked, the view switching process is triggered based on the consensus mechanism;

[0008] The master node is elected based on multiple nodes of the temporary committee and the randomized master election strategy;

[0009] The consensus process of the new view is triggered based on the master node and the view switching process.

[0010] Optionally, in the PBFT alliance blockchain consensus mechanism, a node score model is constructed according to the comprehensive performance of the node in the consensus process, including:

[0011] In the PBFT alliance blockchain consensus mechanism, locate the node;

[0012] The corresponding comprehensive performance is presented based on the nodes and consensus process. At this time, the comprehensive performance is determined based on the behavioral intention, attitude and subjective norms of the nodes;

[0013] A node points model is constructed based on the comprehensive performance of nodes in the consensus process.

[0014] Optionally, in the PBFT alliance blockchain consensus mechanism, the node score model is constructed according to the comprehensive performance of the node in the consensus process, and further includes: ; BI represents behavioral intention, A represents attitude, SN represents subjective norm, and PBC represents perceived behavioral control.

[0015] Optionally, the step of screening multiple nodes with superior performance according to the score model and forming a temporary committee based on the multiple nodes includes:

[0016] Fixed-frame integral model;

[0017] Screen multiple nodes with superior performance based on the integral model;

[0018] Sorting is performed based on multiple nodes and their corresponding points, and multiple nodes can be screened out according to the points ranking;

[0019] Form a temporary committee based on multiple nodes.

[0020] Optionally, the step of selecting multiple nodes with superior performance according to the score model and forming a temporary committee based on the multiple nodes further includes:

[0021] The integral weight set of all network nodes , ;in n is the total number of nodes in the entire network, Representation Node Nodes obtained from local statistics Points situation;

[0022] node The locally calculated Broadcast to other nodes for verification. Become the ScoreList recognized by the temporary committee in view view. ScoreList represents the weight of all node points in the network stored in a list structure. After that, the node will filter out the new temporary committee node cluster committee of view view+1 according to the screening criteria.

[0023] in, Sort by Nodes, is the permutation function used to sort in descending order of integral.

[0024] Optionally, if the consensus master node fails or is attacked, a view switching process is triggered based on the consensus mechanism, including:

[0025] If the consensus master node fails or is attacked, locate the consensus mechanism;

[0026] Send a view switching request based on the consensus mechanism;

[0027] The view switching process is triggered according to the view switching request.

[0028] Optionally, the method of selecting a master node based on multiple nodes of the temporary committee and a randomized master election strategy includes:

[0029] Collect multiple nodes of the temporary committee;

[0030] Multiple nodes of the associated temporary committee and random leader election strategy;

[0031] In the randomized leader election strategy, a random leader election is performed based on multiple nodes of the temporary committee and historical block hashes, and the master node is elected.

[0032] Optionally, the method of selecting a master node based on multiple nodes of the temporary committee and a randomized master election strategy further includes:

[0033] Calculate the probability of election of multiple nodes in the temporary committee :

[0034] in, Represents a temporary committee node The integral weight of

[0035] Introduce the roulette algorithm, calculate the cumulative probability of each node, traverse the cumulative probability of each node, and select the first one that satisfies Node As the master node with higher reliability in the new view; Represents the cumulative probability of each node; X is a random number determined by the random factor.

[0036] Optionally, the consensus process of triggering a new view based on the master node and view switching process includes:

[0037] Freeze the main node and view switching process;

[0038] Associate the master node and view switching process;

[0039] The consensus process of the new view is triggered according to the master node and view switching process, and the threshold signature algorithm is introduced to optimize the consensus process.

[0040] Optionally, a PBFT alliance blockchain consensus mechanism optimization system is applied to the above-mentioned PBFT alliance blockchain consensus mechanism optimization method, and the PBFT alliance blockchain consensus mechanism optimization system includes:

[0041] A building module used to construct a node score model based on the comprehensive performance of nodes in the consensus process in the PBFT alliance blockchain consensus mechanism;

[0042] The formation module is used to select multiple nodes with superior performance according to the integral model and form a temporary committee based on multiple nodes;

[0043] The process module is used to trigger the view switching process based on the consensus mechanism if the consensus master node fails or is attacked;

[0044] The election module is used to elect the master node based on multiple nodes of the temporary committee and the randomized master election strategy;

[0045] The consensus process module is used to trigger the consensus process of the new view based on the master node and the view switching process.

[0046] In an embodiment of the present invention, through the method in the embodiment of the present invention, in the PBFT alliance blockchain consensus mechanism, a node integral model is constructed according to the comprehensive performance of the node in the consensus process; multiple nodes with superior performance are screened according to the integral model, and a temporary committee is formed based on multiple nodes; if the consensus master node fails or is attacked, the view switching process is triggered based on the consensus mechanism; the master node is elected based on multiple nodes of the temporary committee and the randomized master election strategy; the consensus process of the new view is triggered based on the master node and the view switching process. At this time, multiple nodes with superior performance are screened according to the integral model to facilitate subsequent management and control of multiple nodes with superior performance, and a temporary committee is formed based on multiple nodes, which ensures the superiority of establishing the temporary committee and further improves the reliability of the election of the master node. At the same time, the master node is elected based on multiple nodes of the temporary committee and the randomized master election strategy, which further ensures the reliability of the election of the master node, and improves the consensus efficiency of the PBFT alliance blockchain consensus mechanism while ensuring the reliability of the consensus result. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0048] Figure 1 It is a flowchart of an optimization method for a PBFT alliance blockchain consensus mechanism in an embodiment of the present invention;

[0049] Figure 2 It is a flow chart of S11 in the optimization method of the PBFT alliance blockchain consensus mechanism in an embodiment of the present invention;

[0050] Figure 3 It is a flow chart of S12 in the optimization method of the PBFT alliance blockchain consensus mechanism in an embodiment of the present invention;

[0051] Figure 4 It is a flow chart of S13 in the optimization method of the PBFT alliance blockchain consensus mechanism in an embodiment of the present invention;

[0052] Figure 5 It is a flow chart of S14 in the optimization method of the PBFT alliance blockchain consensus mechanism in an embodiment of the present invention;

[0053] Figure 6 It is a flow chart of S15 in the optimization method of the PBFT alliance blockchain consensus mechanism in an embodiment of the present invention;

[0054] Figure 7 It is a schematic diagram of the structural composition of the optimization system of the PBFT alliance blockchain consensus mechanism in an embodiment of the present invention;

[0055] Figure 8 The figure is a hardware diagram of an electronic device according to an exemplary embodiment.

[0056] Reference numerals

[0057] 21. Construction module; 22. Building module; 23. Process module; 24. Election module; 25. Consensus process module;

[0058] 40. Electronic device; 41. Processing unit; 42. Storage unit; 421. Random access storage unit; 422. Cache storage unit; 423. Read-only storage unit (ROM); 424. Program tool; 425. Program module; 43. Bus; 44. Input / output (I / O) interface; 45. Network adapter. DETAILED DESCRIPTION

[0059] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0060] Method Embodiment

[0061] See also Figures 1 to 8 , an optimization method for a PBFT alliance blockchain consensus mechanism, applied to the optimization scenario of the PBFT alliance blockchain consensus mechanism; the optimization method for the PBFT alliance blockchain consensus mechanism includes:

[0062] Step S11: In the PBFT alliance blockchain consensus mechanism, a node score model is constructed based on the comprehensive performance of the node in the consensus process;

[0063] Step S12: screening multiple nodes with superior performance according to the score model, and forming a temporary committee based on the multiple nodes;

[0064] Step S13: If the consensus master node fails or is attacked, the view switching process is triggered based on the consensus mechanism;

[0065] Step S14: electing a master node based on multiple nodes of the temporary committee and a random master election strategy;

[0066] Step S15: triggering the consensus process of the new view based on the master node and the view switching process.

[0067] In an embodiment of the present invention, through the method in the embodiment of the present invention, multiple nodes with superior performance are screened according to the integral model to facilitate subsequent management and control of the multiple nodes with superior performance, and a temporary committee is formed based on multiple nodes, thereby ensuring the superiority of establishing the temporary committee and further improving the reliability of the election of the master node. At the same time, the master node is elected based on multiple nodes of the temporary committee and a randomized master election strategy, further ensuring the reliability of the election of the master node, and improving the consensus efficiency of the PBFT alliance blockchain consensus mechanism while ensuring the reliability of the consensus results.

[0068] In step S11, in the PBFT alliance blockchain consensus mechanism, a node score model is constructed according to the comprehensive performance of the node in the consensus process;

[0069] In the specific implementation process of the present invention, the specific steps may be:

[0070] S111: Locating nodes in the PBFT alliance blockchain consensus mechanism;

[0071] S112: Present the corresponding comprehensive performance based on the nodes and consensus process. At this time, the comprehensive performance is determined based on the behavioral intention, attitude and subjective norm of the nodes;

[0072] S113: Construct a node score model based on the comprehensive performance of the node in the consensus process.

[0073] In an embodiment of the present application, in the PBFT alliance blockchain consensus mechanism, the nodes are located to facilitate control of the nodes, thereby presenting corresponding comprehensive performance based on the nodes and the consensus process. At this time, the comprehensive performance is determined based on the behavioral intentions, attitudes and subjective norms of the nodes.

[0074] Comprehensive performance is introduced, and a node point model is constructed based on the comprehensive performance of nodes in the consensus process. The node point model fully utilizes the point control of each node, and then controls the participation of each node. At this time, the point model can reflect the comprehensive ability of the node according to the behavioral intention of the node to participate in the consensus process. According to the node point ranking, nodes with stronger comprehensive capabilities can be selected from the nodes of the entire network to form a temporary committee to participate in the view switching process. The comprehensive performance of the nodes in the temporary committee is excellent, and the possibility of Byzantine behavior of the nodes is low, so the reliability of the main node election can be improved.

[0075] In addition, ImpartialBFT constructs a node integration model based on the theory of planned behavior (TPB) in the field of psychology. TPB proposes that an individual's attitude towards a specific behavior, subjective norms, and perceived behavioral control are the three main factors that determine behavioral intention. The linear combination of the three can indicate how much effort an individual is willing to put in and how much effort he plans to put in to perform the behavior. At this time, ;

[0076] Among them, BI represents behavioral intention, A represents attitude, SN represents subjective norm, and PBC represents perceived behavioral control.

[0077] Secondly, during the consensus process, the various performances of nodes when participating in decision-making reflect the behavioral intention (BI) of the nodes. Among them, attitude (A) refers to the individual's evaluation of the execution of specific behaviors, which reflects the willingness of the node to participate in the consensus process; subjective norms (SN) refer to the social pressure or expectations of others perceived by individuals. Individuals with high social reputation tend to assume more social responsibilities, which reflects the historical performance of nodes in the consensus process and their contribution; perceived behavioral control (PBC) refers to the individual's subjective evaluation of the difficulty of executing behaviors, which reflects whether the node's own hardware and software conditions can meet the requirements of participating in consensus. The three major elements are linearly combined to finally reflect the comprehensive performance of the node and then judge the pros and cons of the node. Therefore, a node integration model can be constructed based on TPB, from screening superior nodes to participate in the consensus mechanism-related processes to enhance the correctness of the consensus results.

[0078] In step S12, multiple nodes with superior performance are selected according to the integral model, and a temporary committee is formed based on the multiple nodes;

[0079] In the specific implementation process of the present invention, the specific steps may be:

[0080] S121: Fixed-frame integral model;

[0081] S122: screening multiple nodes with superior performance according to the integral model;

[0082] S123: sorting based on the multiple nodes and the corresponding points, and screening out the multiple nodes according to the point rankings;

[0083] S124: Form a temporary committee based on multiple nodes.

[0084] In an embodiment of the present application, a fixed integral model is used to facilitate the introduction of the integral model to operate on each node, thereby screening multiple nodes with superior performance according to the integral model, and then sorting the multiple nodes based on the multiple nodes and the corresponding integrals. Multiple nodes can be screened out according to the integral ranking, ensuring the sorting of multiple nodes, thereby forming a temporary committee based on the multiple nodes.

[0085] At this point, the following describes the construction and update process of the node integration model:

[0086] Each node is assigned a benchmark score when it first joins the consensus network. , that is, the node is initialized The integral is , after t viewing rounds, the node score is updated to , as shown below, where Indicates that after t views, the node The integral change value of .

[0087]

[0088] At this point, the three factors of A, SN and PBC mentioned above that affect the node's behavioral intention can be reflected in factors such as the node's participation, activity, historical performance, consensus behavior and technical performance in the consensus process.

[0089] In the consensus process, the above factors can be counted and combined into specific integral indicators. Finally, the actual behavior intention performance of the node in a consensus decision can be calculated according to the following formula: , as follows, is a weight parameter, indicating that the degree of influence of each factor on the node behavior intention varies in different consensus scenarios and can be adjusted according to actual conditions.

[0090]

[0091] The attitude of the node ( ) reflects the node’s willingness to participate, which directly determines whether the node participates in the broadcast of the correct proposal to promote consensus. Therefore, It should be given the highest weight. Secondly, the nodes in the consensus mechanism communicate with each other to reach consensus decisions round by round, which means that the consensus mechanism relies on coordination and sociality. Therefore, the subjective norms of the nodes ( ), that is, the historical performance and personal contribution of the node in the consensus process should also have influence. Finally, perceived behavior control ( ) In the consensus mechanism, it can be reflected from the resources and technical conditions of the nodes. Therefore, the weight parameters should satisfy .

[0092] It is an attitude factor, which can be reflected from the degree of participation of the node in the consensus process. When a node sends a message to participate in the consensus and the message is recognized by the consensus, it will be recorded as a successful participation. It will increase atomically, and combined with the target communication number M, we can get The expression is:

[0093] The node's historical performance and contribution can reflect the node's subjective norms The historical performance score of the node is obtained by weighted processing of the integral decay function, and is calculated based on the contribution of the node in the consensus process. The expression is:

[0094]

[0095] in, Indicates the current view number; represents an exponential decay function to reflect that as the number of consensus rounds increases, the reference value of the node's historical points decreases; represents the integral of the t-th view node; Indicates the upper limit of the integral, which is always satisfied ; Q Indicates the contribution value of the node. That is, when the consensus processing of a proposal is completed, the contribution value will be assigned to it according to the specific behavior of the node in the process. Q , where full participation means that the node participated in the message transmission of each stage of this consensus and the consensus result is consistent with it, non-full participation means that the node missed the message transmission of a certain stage due to network delays and other reasons, fault behavior means that the node did not participate in the proposal message transmission of this consensus due to local fault factors, and malicious behavior means that the message transmitted by the node is inconsistent with the final consensus result: is the weighted value. In order to narrow the points gap between nodes, set the master node , replica node .

[0096] In the consensus process, the node's message transmission delay, message transmission success rate, resource utilization and other technical performance can reflect the node's , which can be expressed as follows:

[0097] in, c It is the node message transmission delay; represents the standard communication delay; Used to adjust communication delay The degree of influence, the communication delay is less than the standard, approaches 1, whereas approaches 0.

[0098] In summary, every time a proposal is completed and the consensus is determined, the node's points will be adjusted as follows: >1. It is worth noting that if the view switch is successfully triggered, the score of the master node of the old view will be set to .

[0099]

[0100] The integral update of all rounds of nodes in a view can be summarized as shown in the following formula, where k Represents the number of consensuses completed in view t.

[0101]

[0102] In the above-mentioned points model, nodes are ranked from high to low according to points (comprehensive performance), and the temporary committee node cluster can be screened out based on the points ranking. The following introduces the temporary committee node identity conversion, node screening, and term change process.

[0103] At this time, the node status will be converted between the three identities of ordinary node, temporary committee node, and master node as the node points change. The node points are updated according to the comprehensive performance in all consensuses in a round of views to evaluate whether the node can join the temporary committee. Only nodes in the temporary committee are eligible to participate in the next view switching process and have a chance to be elected as the master node.

[0104] The node will perform the node points aggregation work locally based on the comprehensive performance of the other nodes collected in the current view, and the points weight set of all nodes in the network , ;in n is the total number of nodes in the entire network, Representation Node Nodes obtained from local statistics Points situation;

[0105] node The locally calculated Broadcast to other nodes for verification. Become the ScoreList recognized by the temporary committee in view view. ScoreList represents the weight of all node points in the network stored in a list structure. After that, the node will filter out the new temporary committee node cluster committee of view view+1 according to the screening criteria.

[0106] in, Sort by Nodes, is the permutation function used to sort in descending order of integral.

[0107] In the process of selecting the master node during the consensus mechanism view switching, the election of the Byzantine node as the master node will seriously affect the consensus efficiency. If only the temporary committee nodes participate, the reliability of the temporary committee member screening becomes very important. Therefore, considering both consistency and consensus efficiency, the number of nodes in the temporary committee should be as small as possible and meet the majority principle to ensure that the selection of the new master node is highly consistent and reliable.

[0108] In order not to destroy the fault-tolerant characteristics of PBFT and ensure the security and reliability of consensus, the total number of nodes N in the consensus mechanism satisfies , where f is the number of Byzantine nodes. Byzantine behaviors in ImpartialBFT include node failure, node offline, and node malicious behavior. However, considering that the honesty of the selected temporary committee nodes cannot be strictly guaranteed, and the filtered nodes cannot be strictly guaranteed to be all Byzantine nodes, according to the screening strategy of the temporary committee, each screening will filter out nodes, the number of nodes in the temporary committee Control .

[0109] In step S13, if the consensus master node fails or is attacked, the view switching process is triggered based on the consensus mechanism;

[0110] In the specific implementation process of the present invention, the specific steps may be:

[0111] S131: If the consensus master node fails or is attacked, locate the consensus mechanism;

[0112] S132: Sending a view switching request based on a consensus mechanism;

[0113] S133: Triggering a view switching process according to the view switching request.

[0114] In an embodiment of the present application, if the consensus master node fails or is attacked, the consensus mechanism is located and the processing of the consensus mechanism is triggered. At this time, a view switching request is sent based on the consensus mechanism; and the view switching process is triggered according to the view switching request.

[0115] In addition, the term of office of the temporary committee is changed during the view switching process, with the nodes in the temporary committee Take as an example, the specific execution steps are as follows. The main execution steps are as follows:

[0116] Step 1: When the current host node is suspected of failure, a view switching request is sent. One of the requests in the message packet is to collect the respective .

[0117] Step 2: If It is the committee node that first discovers the failure of the main node. It will collect feedback from other committee nodes within the specified time. , and make statistics; then the majority of the consistency results are packaged and compressed, and broadcast to the temporary committee nodes for verification; if no consensus is received, , indicating that factors such as network failure have caused the change of leadership to fail, and it is necessary to re-initiate after recovery or wait for requests from other nodes.

[0118] Step 3: Provisional Committee Node Pair Sent Verify, broadcast the result after passing, and wait to collect verification results from other nodes.

[0119] Step 4: If the temporary committee node collects If there is a verified message, the ScoreList approved by the temporary committee can be determined, so as to screen out a new temporary committee and refer to the random leader selection strategy in the view switching process to select the new temporary committee. , and send the new status to If the conditions are not met, it means that factors such as network failure and node fraud have caused the change of leadership to fail, and the next step is to wait for the synchronization of other nodes.

[0120] Step 5: receive A consistent new state message will be broadcasted during the initialization view phase to achieve global final confirmation. At the same time, the view switching mechanism is the key to ensuring that the consensus mechanism can continue to provide consistent services.

[0121] S14: The master node is elected based on multiple nodes of the temporary committee and the randomized master election strategy;

[0122] In the specific implementation process of the present invention, the specific steps may be:

[0123] S141: Collect multiple nodes of the temporary committee;

[0124] S142: multiple nodes of the associated temporary committee and random leader election strategy;

[0125] S143: In the randomized leader election strategy, a random leader election is performed based on multiple nodes of the temporary committee and the historical block hash, and the master node is elected.

[0126] In an embodiment of the present application, when a master node fails during the consensus process, the system triggers a view switching mechanism and elects a new master node to restore the normal consensus process. At this time, multiple nodes of the temporary committee and a randomized master election strategy are associated. In the randomized master election strategy, a randomized master election is performed based on multiple nodes of the temporary committee and historical block hashes, and the master node is elected.

[0127] In addition, in the randomized master election strategy, according to the characteristics of blockchain, it can be assumed that the ledger is synchronized between nodes, and each node stores consistent blockchain data locally. Therefore, the randomized master election can be based on the historical block hash, reducing the risk of the master node being predicted without increasing the complexity of communication. However, using only the historical block hash still cannot prevent malicious nodes from making transactions in a short period of time to interfere with the master node selection results. On this basis, combining the ECC signature provided by each node in the view switching process to enhance randomness can further enhance the unpredictability of the master election and improve the reliability of the consensus mechanism. The design ideas are as follows:

[0128] The ECC signature and the latest historical block hash provided by the node are used as random factors, and the new master node number is calculated by combining the two random factors and the points of the temporary committee nodes. The randomized master selection strategy is described in detail below:

[0129] In the VC-AGGREGATE phase of the view switching process, the node collects and verifies signatures from k nodes and linearly combines them into a set singList. Therefore, based on the hash processing of singList, the first random factor can be obtained , which is specifically expressed as shown in the following formula. The hash operation uses the SHA256 encryption algorithm to generate a hexadecimal number with a length of 64.

[0130]

[0131] Use the latest block hash in the current blockchain ledger As the second random factor , which is specifically expressed as shown in the following formula.

[0132]

[0133] The random number X is determined by combining two random factors, as shown in the following formula. HexatoInt means converting hexadecimal to decimal, and Last8 means taking the last 8 digits. represents XOR operation, and mod represents modulo operation.

[0134]

[0135] Calculate the probability of election of multiple nodes in the temporary committee :

[0136] in, Represents a temporary committee node The integral weight of

[0137] Introduce the roulette algorithm, calculate the cumulative probability of each node, traverse the cumulative probability of each node, and select the first one that satisfies Node As a master node with higher reliability in the new view;

[0138]

[0139] in, Represents the cumulative probability of each node; X is a random number determined by the random factor.

[0140] S15: Trigger the consensus process of the new view based on the master node and view switching process;

[0141] In the specific implementation process of the present invention, the specific steps may be:

[0142] S151: freeze the main node and view switching process;

[0143] S152: Associating the master node and view switching process;

[0144] S153: The consensus process of the new view is triggered according to the master node and view switching process, and the threshold signature algorithm is introduced to optimize the consensus process.

[0145] In an embodiment of the present application, the master node and the view switching process are associated; the consensus process of the new view is triggered according to the master node and the view switching process, and the threshold signature algorithm is introduced to optimize the consensus process. At this time, the master node is elected based on multiple nodes of the temporary committee and the randomized master election strategy, which further ensures the reliability of the election of the master node, and improves the consensus efficiency of the PBFT alliance blockchain consensus mechanism while ensuring the reliability of the consensus result.

[0146] In addition, ImpartialBFT introduces a threshold signature algorithm to change the original PBFT node broadcast mode of pre-preparation, preparation, and submission in three stages to a five-stage master node collection mode of pre-preparation, preparation, verification of preparation, submission, and verification of submission, which greatly reduces the communication cost while ensuring the reliability of consensus.

[0147] To improve consensus efficiency, ImpartialBFT uses a threshold signature aggregation scheme in the preparation-verification preparation phase and the submission-verification submission phase of the consensus process, effectively compressing the communication complexity of the consensus process while ensuring the reliability of the consensus results.

[0148] This paper implements a blockchain prototype system based on the Java programming language to simulate the actual application environment. In terms of hardware and software, the experiment uses a server with a dual-core CPU, 16G running memory, and an operating system of Ubuntu Linux (64-bit). The prototype system is developed and implemented using IntelliJ IDEA2023.1 version programming software, and JMeter and Apipost testing tools are used for relevant performance testing and analysis. The relevant settings such as block capacity, timeout time, and integral model parameters in the experiment are shown in Table 1.

[0149]

[0150] This experiment first simulates an environment without Byzantine nodes to test whether the node points can be controlled and grow steadily. Set up 10 nodes, simulate manually triggering 10 views, and execute 100 consensuses for each view. Under the condition of no Byzantine nodes, the node points can show a stable growth with the increase of consensus rounds. After 1000 consensuses, the points of peer0 can also grow steadily and the growth rate is still within a controllable range.

[0151] Secondly, the experiment simulates a consensus environment with Byzantine nodes to test whether the score model can distinguish the pros and cons of nodes. Three Byzantine nodes {peer7~peer9} were set up in the experiment. The malicious behavior of the Byzantine nodes is manifested as "sending inconsistent responses, refusing replies, and timed replies." If a node behaves maliciously, its score can be widened from that of the honest nodes, and the honest node's score is always higher than that of the honest node as its consensus performance increases. The experimental results show that the node integration model is safe and controllable, and can effectively distinguish honest nodes from Byzantine nodes.

[0152] For stability comparison analysis, first, the experiment simulates multiple rounds of view switching to test the proportion of Byzantine nodes in the temporary committee. Three Byzantine nodes were set up in the experiment, including a fixed Byzantine node peer8, peer9 that triggers Byzantine behavior in stages, and a master node that triggers Byzantine behavior at each switch. The consensus processing of 5 views was simulated. If a node exhibits Byzantine behavior, its score will be significantly lower than that of an honest node, and it will be filtered by the temporary committee. The proportion of Byzantine nodes in the temporary committee can be lower than the 33.33% Byzantine proportion of the PBFT consensus mechanism. Therefore, it is proved that the temporary committee mechanism can reduce the proportion of Byzantine nodes in the nodes participating in the election of the master node, so that the overall reliability of the consensus mechanism can be improved.

[0153] Secondly, the experiment simulates multiple rounds of views at different node scales, and tests the probability of Byzantine nodes being elected as master nodes in ImpartialBFT and PBFT according to the results of master node election during view switching. The Byzantine ratio at each node scale in the experiment is .

[0154] Five rounds of views are executed at each scale, with 100 consensuses in each round. The last consensus in each round will automatically trigger a view switch. If a Byzantine node is elected during the view switch, the view switch is executed again. In ImpartialBFT, a phased Byzantine node is also set to increase the difficulty of screening. Since PBFT adopts a polling master election mechanism and the Byzantine node numbering is random, in order to enhance the reliability of the results, 10 experiments were conducted at each scale and the average results were taken. The experimental results are as follows: PBFT has a certain probability that a Byzantine node will be elected as the master node, while in ImpartialBFT the probability is almost 0.

[0155] In addition, the nodes of each temporary committee in the election process are shown. According to the random master election strategy, the "master node that caused the view switch" that has just been replaced has no chance of being elected. According to the reliability experiment above, it is difficult for nodes with Byzantine behavior to be selected into the temporary committee, so the probability of Byzantine nodes being elected is low. Therefore, compared with PBFT, ImpartialBFT has a significantly lower probability of Byzantine nodes being elected, and the consensus mechanism is more stable.

[0156] Therefore, this paper proposes an improved PBFT alliance blockchain consensus mechanism, which realizes a reasonable reward and punishment mechanism by constructing a node points model, and promotes nodes to participate in consensus more actively; designs a temporary committee mechanism and a random master election strategy, limits the participation of Byzantine nodes in the master election process, solves the problem of predictable master node election, and thus improves the reliability of the consensus mechanism; retains the form of all PBFT nodes participating in the consensus process, and ensures the democracy of nodes participating in consensus decision-making; introduces a threshold signature algorithm to improve consensus processing performance. Through experimental analysis in the blockchain prototype system, the improved ImpartialBFT has obvious optimization in consensus reliability, stability and performance compared with PBFT.

[0157] In an embodiment of the present invention, through the method in the embodiment of the present invention, in the PBFT alliance blockchain consensus mechanism, a node integral model is constructed according to the comprehensive performance of the node in the consensus process; multiple nodes with superior performance are screened according to the integral model, and a temporary committee is formed based on multiple nodes; if the consensus master node fails or is attacked, the view switching process is triggered based on the consensus mechanism; the master node is elected based on multiple nodes of the temporary committee and the randomized master election strategy; the consensus process of the new view is triggered based on the master node and the view switching process. At this time, multiple nodes with superior performance are screened according to the integral model to facilitate subsequent management and control of multiple nodes with superior performance, and a temporary committee is formed based on multiple nodes, which ensures the superiority of establishing the temporary committee and further improves the reliability of the election of the master node. At the same time, the master node is elected based on multiple nodes of the temporary committee and the randomized master election strategy, which further ensures the reliability of the election of the master node, and improves the consensus efficiency of the PBFT alliance blockchain consensus mechanism while ensuring the reliability of the consensus result.

[0158] System Example

[0159] See also Figure 7 , Figure 7 It is a schematic diagram of the structural composition of the optimization system of the PBFT alliance blockchain consensus mechanism in an embodiment of the present invention.

[0160] like Figure 7 As shown, an optimization system for a PBFT alliance blockchain consensus mechanism, the optimization system for a PBFT alliance blockchain consensus mechanism includes:

[0161] Building module 21, used to build a node score model according to the comprehensive performance of the node in the consensus process in the PBFT alliance blockchain consensus mechanism;

[0162] A forming module 22, used for selecting a plurality of nodes with superior performance according to the integral model, and forming a temporary committee based on the plurality of nodes;

[0163] Process module 23 is used to trigger the view switching process based on the consensus mechanism if the consensus master node fails or is attacked;

[0164] An election module 24 is used to elect a master node based on multiple nodes of the temporary committee and a randomized master election strategy;

[0165] The consensus process module 25 is used to trigger the consensus process of the new view based on the master node and the view switching process.

[0166] Example

[0167] See also Figure 8 , refer to the following Figure 8 The electronic device 40 according to this embodiment of the present invention will be described. Figure 8 The electronic device 40 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.

[0168] like Figure 8 As shown, the electronic device 40 is in the form of a general computing device. The components of the electronic device 40 may include but are not limited to: at least one processing unit 41, at least one storage unit 42, and a bus 43 connecting different system components (including the storage unit 42 and the processing unit 41).

[0169] The storage unit stores program codes, which can be executed by the processing unit 41, so that the processing unit 41 executes the steps according to various exemplary embodiments of the present invention described in the above “Embodiment Method” section of this specification.

[0170] The storage unit 42 may include a readable medium in the form of a volatile storage unit, such as a random access storage unit 421 and / or a cache storage unit 422 , and may further include a read-only storage unit (ROM) 423 .

[0171] The storage unit 42 may also include a program tool 424 having a set (at least one) of program modules 425, such program modules 425 including but not limited to: an operating system, one or more application programs, other program modules and program data, each of which or some combination may include the implementation of a network environment.

[0172] Bus 43 may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.

[0173] The electronic device 40 may also communicate with one or more external devices (e.g., keyboards, pointing devices, Bluetooth devices, etc.), one or more devices that enable a user to interact with the electronic device 40, and / or any device that enables the electronic device 40 to communicate with one or more other computing devices (e.g., routers, modems, etc.). Such communication may be performed via an input / output (I / O) interface 44. Furthermore, the electronic device 40 may also communicate with one or more networks (e.g., local area networks, wide area networks, and / or public networks, such as the Internet) via a network adapter 45. Figure 8 As shown, the network adapter 45 communicates with other modules of the electronic device 40 via the bus 43. It should be understood that although Figure 8 Not shown, other hardware and / or software modules may be used in conjunction with the electronic device 40, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, tape drives, and data backup planning systems.

[0174] Through the description of the above implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the implementation of the present disclosure.

[0175] Those skilled in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing related hardware through a program, and the program can be stored in a computer-readable storage medium, and the storage medium can include: a read-only memory, a random access memory, a disk or an optical disk, etc. In addition, it stores computer program instructions, and when the computer program instructions are executed by a computer, the computer executes the above method.

[0176] In addition, the optimization method and system of the PBFT alliance blockchain consensus mechanism provided by the embodiments of the present invention are introduced in detail above. Specific examples are used herein to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for those skilled in the art, according to the ideas of the present invention, there will be changes in the specific implementation methods and application scopes. In summary, the content of this specification should not be understood as limiting the present invention.

Claims

1. A method for optimizing the consensus mechanism of a PBFT alliance blockchain, characterized in that: Applied to the optimization scenario of PBFT alliance blockchain consensus mechanism; The optimization method of the PBFT alliance blockchain consensus mechanism includes: In the PBFT alliance blockchain consensus mechanism, a node points model is constructed based on the comprehensive performance of the nodes in the consensus process; Screen multiple nodes with superior performance according to the integral model, and form a temporary committee based on the multiple nodes; freeze the integral model; screen multiple nodes with superior performance according to the integral model; sort based on multiple nodes and corresponding integrals, and screen multiple nodes according to the integral ranking; form a temporary committee based on multiple nodes; The integral weight set of all network nodes ; in n is the total number of nodes in the entire network, Representation Node i Nodes obtained from local statistics j Points situation; node i The locally calculated Broadcast to other nodes for verification. Become the ScoreList approved by the temporary committee in the view view. ScoreList represents the weight of all node scores in the network stored in a list structure; After that, the node will select the new temporary committee node cluster committee of view+1 according to the screening criteria. in, Sort by Nodes, is the permutation function used to sort in descending order of integral; If the consensus master node fails or is attacked, the view switching process is triggered based on the consensus mechanism; if the consensus master node fails or is attacked, the consensus mechanism is located; a view switching request is sent based on the consensus mechanism; the view switching process is triggered based on the view switching request; Elect the master node based on multiple nodes of the temporary committee and the randomized master election strategy; collect multiple nodes of the temporary committee; associate multiple nodes of the temporary committee and the randomized master election strategy; in the randomized master election strategy, perform randomized master election based on multiple nodes of the temporary committee and historical block hashes, and elect the master node; Calculate the probability of election of multiple nodes in the temporary committee : in, Represents a temporary committee node i The integral weight of Introduce the roulette algorithm, calculate the cumulative probability of each node, traverse the cumulative probability of each node, and select the first one that satisfies Node i is used as the main node in the new view; in, represents the cumulative probability of each node; X is a random number determined by the random factor; The consensus process of triggering a new view based on the master node and view switching process; At this point, the following describes the construction and update process of the node integration model: Each node is assigned a benchmark score when it first joins the consensus network. , that is, the integral of node i at initialization is ,go through t View rounds, the node score is updated to , as shown below, where Indicates passing t The integral change value of node i after 1 view; At this point, the three factors mentioned, A, SN, and PBC, that affect the node’s behavioral intention, are reflected in the node’s participation, activity, historical performance, consensus behavior, and technical performance factors in the consensus process; Combined with the specific integral indicators, the actual behavior intention performance of the node in a consensus decision is finally calculated according to the following formula , as follows, α, β, γ is a weight parameter, indicating that the influence of each factor on the node behavior intention varies in different consensus scenarios and is adjusted according to the actual situation; The attitude of the node reflects the node's willingness to participate, which directly determines whether the node participates in the broadcast of the correct proposal to promote consensus. In the consensus mechanism, nodes communicate with each other to reach consensus decisions round by round, which means that the consensus mechanism relies on coordination and sociality. Therefore, the subjective norms of the nodes , that is, the historical performance and personal contribution of the node in the consensus process should also have influence; finally, perceived behavior control In the consensus mechanism, the resources and technical conditions of the nodes are reflected. Therefore, the weight parameters should satisfy ; It is an attitude factor, which can be reflected by the degree of participation of the node in the consensus process. If a node sends a message to participate in the consensus and the message is recognized by the consensus, it will be recorded as a successful participation. It will increase atomically, and the target communication times M are calculated. The expression is: The node's historical performance and contribution can reflect the node's subjective norms ; The historical performance score of the node is obtained through weighted processing of the integral decay function, and is calculated based on the contribution of the node in the consensus process. The expression is: in, v Indicates the current view number; Represents an exponential decay function to reflect that as the number of consensus rounds increases, the reference value of the node's historical points decreases; represents the integral of the t-th view node; Indicates the upper limit of the integral, which is always satisfied ; Q Indicates the contribution value of the node. That is, when the consensus processing of a proposal is completed, the contribution value will be assigned to it according to the specific behavior of the node in the process. Q , where full participation means that the node participated in the message transmission of each stage of this consensus and the consensus result was consistent with it, non-full participation means that the node missed the message transmission of a certain stage due to network delay, fault behavior means that the node did not participate in the proposal message transmission of this consensus due to local fault factors, and malicious behavior means that the message transmitted by the node is inconsistent with the final consensus result; is the weighted value. In order to narrow the points gap between nodes, set the master node , replica node ; In the consensus process, the node's message transmission delay, message transmission success rate, and resource utilization performance can reflect the node's , as follows: in, c It is the node message transmission delay; represents the standard communication delay; Used to adjust communication delay The degree of influence, the communication delay is less than the standard, Approaches 1, otherwise approaches 0; In summary, every time a proposal is completed and the consensus is determined, the node's points will be adjusted as follows: v >1; if the view switch is successfully triggered, the score of the master node of the old view will be set to ; The point update of all rounds of nodes in a view is summarized as shown in the following formula: k represents the number of consensuses completed in view t; 。 2. The optimization method of the PBFT alliance blockchain consensus mechanism according to claim 1 is characterized in that: The consensus process of triggering a new view based on the master node and view switching process includes: Freeze the main node and view switching process; Associate the master node and view switching process; The consensus process of the new view is triggered according to the master node and view switching process, and the threshold signature algorithm is introduced to optimize the consensus process.

3. An optimization system for the PBFT alliance blockchain consensus mechanism, characterized in that: The optimization system of the PBFT alliance blockchain consensus mechanism is applied to the optimization method of the PBFT alliance blockchain consensus mechanism as described in any one of claims 1-2, and the optimization system of the PBFT alliance blockchain consensus mechanism includes: A building module used to construct a node score model based on the comprehensive performance of nodes in the consensus process in the PBFT alliance blockchain consensus mechanism; A building module is used to screen multiple nodes with superior performance according to the integral model, and to form a temporary committee based on the multiple nodes; fix the integral model; screen multiple nodes with superior performance according to the integral model; sort based on multiple nodes and corresponding integrals, and screen multiple nodes according to the integral ranking; form a temporary committee based on multiple nodes; The integral weight set of all network nodes ; in n is the total number of nodes in the entire network, Representation Node i Nodes obtained from local statistics j Points situation; node i The locally calculated Broadcast to other nodes for verification. Become the ScoreList approved by the temporary committee in the view view. ScoreList represents the weight of all node scores in the network stored in a list structure; After that, the node will select the new temporary committee node cluster committee of view+1 according to the screening criteria. in, Sort by Nodes, is the permutation function used to sort in descending order of integral; The process module is used to trigger the view switching process based on the consensus mechanism if the consensus master node fails or is attacked; locate the consensus mechanism if the consensus master node fails or is attacked; send a view switching request based on the consensus mechanism; trigger the view switching process according to the view switching request; The election module is used to select the master node based on multiple nodes of the temporary committee and the randomized master election strategy; collect multiple nodes of the temporary committee; associate multiple nodes of the temporary committee and the randomized master election strategy; in the randomized master election strategy, the master node is randomly selected based on multiple nodes of the temporary committee and the historical block hash, and the master node is elected; Calculate the probability of election of multiple nodes in the temporary committee : in, Represents a temporary committee node i The integral weight of Introduce the roulette algorithm, calculate the cumulative probability of each node, traverse the cumulative probability of each node, and select the first one that satisfies Node i is used as the main node in the new view; in, represents the cumulative probability of each node; X is a random number determined by the random factor; The consensus process module is used to trigger the consensus process of the new view based on the master node and the view switching process; At this point, the following describes the construction and update process of the node integration model: Each node is assigned a benchmark score when it first joins the consensus network. , that is, the integral of node i at initialization is ,go through t View rounds, the node score is updated to , as shown below, where Indicates passing t The integral change value of node i after 1 view; At this point, the three factors mentioned, A, SN, and PBC, that affect the node’s behavioral intention, are reflected in the node’s participation, activity, historical performance, consensus behavior, and technical performance factors in the consensus process; Combined with the specific integral indicators, the actual behavior intention performance of the node in a consensus decision is finally calculated according to the following formula , as follows, α, β, γ is a weight parameter, indicating that the influence of each factor on the node behavior intention varies in different consensus scenarios and is adjusted according to the actual situation; The attitude of the node reflects the node's willingness to participate, which directly determines whether the node participates in the broadcast of the correct proposal to promote consensus. In the consensus mechanism, nodes communicate with each other to reach consensus decisions round by round, which means that the consensus mechanism relies on coordination and sociality. Therefore, the subjective norms of the nodes , that is, the historical performance and personal contribution of the node in the consensus process should also have influence; finally, perceived behavior control In the consensus mechanism, the resources and technical conditions of the nodes are reflected. Therefore, the weight parameters should satisfy ; It is an attitude factor, which can be reflected by the degree of participation of the node in the consensus process. If a node sends a message to participate in the consensus and the message is recognized by the consensus, it will be recorded as a successful participation. It will increase atomically, and the target communication times M are calculated. The expression is: The node's historical performance and contribution can reflect the node's subjective norms ; The historical performance score of the node is obtained through weighted processing of the integral decay function, and is calculated based on the contribution of the node in the consensus process. The expression is: in, v Indicates the current view number; Represents an exponential decay function to reflect that as the number of consensus rounds increases, the reference value of the node's historical points decreases; represents the integral of the t-th view node; Indicates the upper limit of the integral, which is always satisfied ; Q Indicates the contribution value of the node. That is, when the consensus processing of a proposal is completed, the contribution value will be assigned to it according to the specific behavior of the node in the process. Q , where full participation means that the node participated in the message transmission of each stage of this consensus and the consensus result was consistent with it, non-full participation means that the node missed the message transmission of a certain stage due to network delay, fault behavior means that the node did not participate in the proposal message transmission of this consensus due to local fault factors, and malicious behavior means that the message transmitted by the node is inconsistent with the final consensus result; is the weighted value. In order to narrow the points gap between nodes, set the master node , replica node ; In the consensus process, the node's message transmission delay, message transmission success rate, and resource utilization performance can reflect the node's , as follows: in, c It is the node message transmission delay; represents the standard communication delay; Used to adjust communication delay The degree of influence, the communication delay is less than the standard, Approaches 1, otherwise approaches 0; In summary, every time a proposal is completed and the consensus is determined, the node's points will be adjusted as follows: v >1; if the view switch is successfully triggered, the score of the master node of the old view will be set to ; The point update of all rounds of nodes in a view is summarized as shown in the following formula: k represents the number of consensuses completed in view t; 。

Citation Information

Cited By

  • Shard distribution device applied with sharding technique, method thereofm and blockchain network system including the same

    KR103045168B1