CN114938292A - Node reliability-based multi-level optimization PBFT consensus method - Google Patents

Node reliability-based multi-level optimization PBFT consensus method Download PDF

Info

Publication number
CN114938292A
CN114938292A CN202210445397.XA CN202210445397A CN114938292A CN 114938292 A CN114938292 A CN 114938292A CN 202210445397 A CN202210445397 A CN 202210445397A CN 114938292 A CN114938292 A CN 114938292A
Authority
CN
China
Prior art keywords
node
consensus
nodes
message
credibility
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202210445397.XA
Other languages
Chinese (zh)
Other versions
CN114938292B (en
Inventor
唐宏
刘双
张瑞彤
苏烨盈
蒋从科
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Chongqing University of Post and Telecommunications
Original Assignee
Chongqing University of Post and Telecommunications
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Chongqing University of Post and Telecommunications filed Critical Chongqing University of Post and Telecommunications
Priority to CN202210445397.XA priority Critical patent/CN114938292B/en
Publication of CN114938292A publication Critical patent/CN114938292A/en
Application granted granted Critical
Publication of CN114938292B publication Critical patent/CN114938292B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/06Management of faults, events, alarms or notifications
    • H04L41/069Management of faults, events, alarms or notifications using logs of notifications; Post-processing of notifications
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/14Network analysis or design
    • H04L41/145Network analysis or design involving simulating, designing, planning or modelling of a network
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/06Network architectures or network communication protocols for network security for supporting key management in a packet data network
    • H04L63/062Network architectures or network communication protocols for network security for supporting key management in a packet data network for key distribution, e.g. centrally by trusted party
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Hardware Design (AREA)
  • Computer Security & Cryptography (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Hardware Redundancy (AREA)
  • Computer And Data Communications (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention belongs to the technical field of a block chain consensus mechanism, and particularly relates to a node reliability-based multi-level optimized PBFT consensus method; the method comprises the following steps: carrying out reliability evaluation on the nodes to obtain reliability scores of the nodes; performing node role attribute distribution and hierarchical structure division according to the credibility scores of the nodes to obtain a node consensus model; performing node consensus according to the node consensus model; when a new node is added or an old node is withdrawn, a node consensus model is updated by adopting a dynamic node access management method; the invention can effectively reduce the communication traffic in the consensus process and improve the expandability of the system; when a new node is added or an old node is withdrawn, the system does not need to be restarted, and the requirements of the real application scene can be met; and the agent nodes are selected through credibility scoring, so that the probability of view switching is reduced, the consensus efficiency and the system safety are improved, and the practicability of a block chain system is improved.

Description

Node reliability-based multi-level optimization PBFT consensus method
Technical Field
The invention belongs to the technical field of block chain consensus mechanisms, and particularly relates to a node reliability-based multilayer optimization PBFT consensus method.
Background
The essence of the blockchain is a decentralized distributed ledger database. The problems of data monopoly and poor safety of the traditional centralized system can be solved. The network communication and consensus algorithm based on the public identity authentication integrates technical principles such as network communication, consensus algorithm and cryptography foundation, has the characteristics of being not falsifiable and easy to verify, and is greatly developed in the fields of finance, internet of things, notarization and the like. The consensus algorithm is used as a core mechanism of a block chain bottom layer and is responsible for ensuring that all nodes in the system reach the consistency of transaction sequences packed within specific time, so that the problem of information asymmetry is avoided, and the consensus algorithm plays an important role in realizing data sharing and data consistency of a distributed system.
The block chain system is different according to different application scenes and the attribute and access condition of each participant in the system. Generally, the method can be divided into three types of public chains, alliance chains and private chains. The public block chain means that all participants can join the system, is not restricted by any condition and is completely decentralized; the block chain of the alliance is managed by a plurality of organizations together, and the nodes can be added into the system after being authorized by identities, which belongs to partial decentralization; the private block chain is only used by individuals or single organizations, is rarely opened to the outside, abandons the characteristics of decentralization and belongs to a centralization system. In the three types of architectures, the block chains of the alliances have the characteristic of local centralization, multiple organizations can be allowed to cooperate together, the practical application scene is met, the controllability is high, and the block chains are currently mainstream research architectures. The PBFT (practical byzantine fault-tolerant) algorithm is the most commonly used and most widely applied core consensus algorithm in the current federation chain.
The PBFT algorithm reduces the complexity of the algorithm from exponential level to polynomial level, so that the Byzantine fault-tolerant algorithm has practical feasibility. However, the following problems exist, which limit the consensus efficiency and application scenarios: firstly, the PBFT algorithm requires all nodes in the system to participate in a consensus process, and data consistency is realized through a three-stage consensus protocol, so that the system performance is greatly reduced along with the increase of the number of the nodes after the number of the nodes reaches a specific threshold value, and the system expandability is poor; secondly, the PBFT algorithm cannot dynamically sense the node change, and when a new node is added or an old node is withdrawn, the system needs to be restarted, so that the requirement of a real application scene is difficult to meet; and finally, the main node is selected by the algorithm through a simple formula, so that the Byzantine node and the honest node have the chance of equally selecting the main node, the probability of view switching is increased, and the consensus efficiency and the safety of the system are influenced.
Disclosure of Invention
Aiming at the defects in the prior art, the invention provides a multilayer suboptimal PBFT consensus method based on node credibility, which comprises the following steps:
s1: carrying out reliability evaluation on the nodes to obtain reliability scores of the nodes;
s2: carrying out node role attribute distribution and hierarchical structure division according to the credibility scores of the nodes to obtain a node consensus model; the role attributes comprise agent nodes and backup nodes, the hierarchical structure comprises a primary consensus layer and a secondary consensus layer, the primary consensus layer comprises a primary consensus group, and the secondary consensus layer comprises at least one secondary consensus group;
s3: performing node consensus according to the node consensus model;
s4: and when a new node is added or an old node is withdrawn, updating the node consensus model by adopting a dynamic node in-out management method.
Preferably, the process of evaluating the credibility of the node comprises:
s11: calculating the basic configuration score of the nodes according to the number of CPU cores, the memory capacity of the computer and the capacity of the hard disk;
s12: calculating the consensus reputation value, the activity degree and the consensus success rate of the nodes; calculating consensus scores of the nodes according to the consensus reputation values, the activity degrees and the consensus success rates of the nodes;
s13: and calculating the credibility score of the node according to the basic configuration score and the consensus score of the node.
Further, the formula for calculating the consensus score of the nodes is as follows:
R j =k 1 ρ j +k 2 p j +k 3 E j
Figure BDA0003616568710000031
Figure BDA0003616568710000032
wherein R is j Denotes the consensus score, ρ, of node j j Indicating the activity level, p, of node j j Indicates the consensus success rate of node j, E j Representing a consensus reputation value, k, for node j 1 Denotes a first adjustment factor, k 2 Denotes a second adjustment factor, k 3 Representing a third adjustment factor, lambda represents an activity factor, n represents the number of consensus times that the node participates, n represents success Representing the consensus number of times the node successfully completed the job.
Further, the formula for calculating the credibility score of the node is as follows:
C j =K 1 B j +K 2 R j
wherein, C j Representing a confidence score for node j, B j Represents the base configuration score, R, of node j j Denotes the consensus score, K, of node j 1 Denotes a first weight, K 2 Representing a second weight.
Preferably, the process of obtaining the node consensus model includes:
s21: setting the group number M, sequencing credibility scores of the nodes in a high-to-low sequence, taking M nodes before the credibility scores are sequenced as proxy nodes, and taking the rest nodes as backup nodes;
s22: carrying out hierarchical structure division according to the number of the agent nodes and the backup nodes to obtain a node consensus model;
s23: and after each consensus, reconstructing the node consensus model.
Further, the process of performing hierarchical structure division includes: dividing all the agent nodes into a primary consensus layer, and dividing all the backup nodes into a secondary consensus layer; dividing the backup node number by the proxy node number to obtain a quotient n and a remainder r; and dividing each group of nodes into secondary consensus groups of different agent nodes by taking each n nodes as a group, and uniformly distributing the rest nodes to the secondary consensus groups of r agent nodes.
Preferably, the process of node consensus includes:
s31: the client node sends a request message to all the agent nodes in the master consensus group;
s32: the agent node receives the request message, verifies the identity of the client according to the request message, and sends a pre-preparation message to all backup nodes in the secondary consensus group of the agent node after the verification is passed;
s33: the backup node receives the pre-preparation message and verifies the correctness of the pre-preparation message, and after the pre-preparation message is verified, the backup node writes the message into a local log and broadcasts a new preparation message to other backup nodes in the same consensus group;
s34: the backup node broadcasts a confirmation message to other backup nodes in the same consensus group;
s35: each backup node feeds back a consensus result to the agent node to which the backup node belongs, and the agent node feeds back the consensus result to the client node; when the client receives the consensus result sent by more than half of the proxy nodes, the system achieves the consensus.
Preferably, the process of updating the node consensus model by using the dynamic node access management method includes:
when a new node enters a system, the new node acquires admission permission of each participating institution in a block chain of the alliance; the system carries out credibility evaluation on the new node to obtain a credibility score; distributing the new node to a secondary consensus group according to the credibility score and broadcasting a join message to all nodes in the system; each node receives the joining message and verifies the correctness of the message, and the information and the signature of each node are sent to a new node after the verification is passed; when the new node receives two messages which exceed two thirds of the total node number of the system, the new node is successfully added into the system;
when the old node exits the system, the old node acquires the exit permission of each participating mechanism in the block chain of the alliance; the old node broadcasts an exit message to other nodes in the system; each node receives the quit message and verifies the correctness of the message, and sends a quit confirmation message to the old node after the verification is passed; and when the old node receives two quitting confirmation messages which exceed three-third of the total nodes of the system, the old node successfully quits the system.
The invention has the beneficial effects that: the method comprises the steps of sequentially constructing a consensus model by performing role attribute division and hierarchy division on nodes, performing local consensus on the consensus model, and performing global consensus according to the local consensus; the invention can effectively reduce the communication traffic in the consensus process and improve the expandability of the system; when a new node is added or an old node is withdrawn, the system does not need to be restarted, and the requirements of the real application scene can be met; and the agent nodes are selected through credibility scoring, so that the probability of view switching is reduced, the consensus efficiency and the system safety are improved, and the practicability of a block chain system is improved.
Drawings
FIG. 1 is a flow chart of a multi-level optimized PBFT consensus method based on node credibility in the present invention;
FIG. 2 is a schematic diagram of a node consensus model according to the present invention;
fig. 3 is a schematic diagram of a consensus flow of the multi-level optimized PBFT consensus method based on node credibility in the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The invention provides a node reliability-based multi-level optimization PBFT consensus method, which specifically comprises the following steps as shown in FIG. 1:
s1: and evaluating the reliability of the nodes to obtain the reliability scores of the nodes.
From basic configuration and consensus representationStarting from two dimensions, evaluating the reliability of the nodes, and scoring the result through the reliability C j In this embodiment, the score is the data basis for subsequent role attribute assignment.
S11: calculating the basic configuration score B of the node according to the number of CPU cores, the memory capacity of the computer and the capacity of the hard disk j (ii) a The calculation process is as follows:
for the number of the CPU cores, the memory capacity of the computer and the hard disk capacity of the parameters, which are different in unit, in order to facilitate unified calculation, the parameters are standardized by using a normalization formula to obtain the numerical values of the standardized parameters:
Figure BDA0003616568710000051
wherein, X p Is the actual value, X b Is the value obtained after standardization, Min (X) p ) Denotes the minimum value of the parameter, Max (X) p ) Representing the maximum value of the parameter.
And (3) constructing a discrimination matrix according to the importance of the three parameters by adopting an analytic hierarchy process, and obtaining a weight vector according with importance ranking according to the discrimination matrix. For example, the three aspects have an importance ratio of
Figure BDA0003616568710000052
The discrimination matrix can be constructed as:
Figure BDA0003616568710000061
the available weight vector is: [0.20.20.6]。
According to the weight vector and the normalized value X b Carrying out weight assignment on each parameter, and adding the parameters subjected to weight assignment to obtain a basic configuration score B of the node j
S12: calculating consensus reputation value, activity degree and consensus success rate of the nodes; calculating consensus score R of the nodes according to consensus reputation value, activity degree and consensus success rate of the nodes j (ii) a The specific calculation process is as follows:
by using the hostThe Peer reputation model evaluates the behavior of the nodes in the consensus process to obtain a consensus reputation value E j
The HonestPeer reputation model aims to solve the problem that the EigenTrust model excessively depends on a pre-trust node, so that other honest nodes are marginalized. The HonestPeer model adopts the same normalized local reputation value mode as the EigenTrust model, and the improved core is that a node with the highest reputation value is endowed with higher authority when a global reputation value is calculated; the selection mode of the node with the highest global reputation value is shown as the following formula:
t h (k) =max(t 1 (k) ,t 2 (k) ,…t n (k) )
wherein, t h (k) Representing the global reputation value of node h.
In the HonestPeer model, honest nodes have higher status, and if the honest nodes are in a node set p trusted in advance, each node in the p still has great influence when determining the trust values of other nodes; however, if the honest nodes are not in the set p, the influence of each node in p will be weakened, the honest nodes will exert higher influence, and the global reputation value of the node i can be calculated by using the following formula:
Figure BDA0003616568710000062
wherein, C ni Is represented by the formula p i And h represents the honest node with the highest reputation value, a represents the reputation weight factor, and the numerical value of a can be calculated by the following formula:
Figure BDA0003616568710000063
taking the global reputation value of the node i after the normalization processing as a consensus reputation value E of the node j
The activity degree refers to whether the node actively participates in the consensus process, and the calculation formula is as follows:
Figure BDA0003616568710000071
wherein, ρ represents the activity degree of the node, λ represents the activity factor, and n represents the consensus number of participation of the node.
The consensus success rate refers to the ratio of tasks to the total tasks successfully completed in the consensus process in which the node participates, and the calculation formula is as follows:
Figure BDA0003616568710000072
wherein p represents the consensus success rate, n success Representing the consensus number of times the node successfully completed the job.
Calculating consensus scores R of the nodes according to the consensus reputation values, the activity degrees and the consensus success rates of the nodes j The calculation formula is as follows:
R j =k 1 ρ j +k 2 p j +k 3 E j
wherein R is j Denotes the consensus score, ρ, of node j j Indicating the activity level, p, of node j j Indicates the consensus success rate, k, of node j 1 Denotes a first adjustment factor, k 2 Denotes a second adjustment factor, k 3 Represents a third adjustment factor; the size of the adjustment factor is defined according to the trust degree of the block chain system of the alliance.
S13: scoring B based on the underlying configuration of the node j And consensus score R j Credibility score C of computing node j (ii) a The calculation formula is as follows:
C j =K 1 B j +K 2 R j
wherein, C j Representing a confidence score, K, for node j 1 Denotes a first weight, K 2 Representing a second weight; in determining two weights K 1 And K 2 In size, although the higher the basic configuration of the node, the faster the information transfer rate and the better the system performance, in order to resist the corruptionAnd the risk that the nodes are gathered to attack by using high-configuration equipment is avoided, and the proportion of the basic configuration of the nodes in the node credibility evaluation is not too high. Therefore, compared with the basic configuration, the dynamic reliability of the nodes in the consensus process should be higher in the evaluation of reliability, i.e. the weight factor should be satisfied (K) 1 <K 2 ) Condition (1) K 1 And K 2 The specific value of (A) is reasonably valued according to the actual situation.
S2: carrying out node role attribute distribution and hierarchical structure division according to the credibility scores of the nodes to obtain a node consensus model; the role attribute comprises an agent node and a backup node, the hierarchical structure comprises a primary consensus layer and a secondary consensus layer, the primary consensus layer comprises a primary consensus group, and the secondary consensus layer comprises at least one secondary consensus group.
S21: and setting the group number M, sequencing the credibility scores of the nodes in a high-to-low sequence, taking M nodes before sequencing the credibility scores as proxy nodes, and taking the rest nodes as backup nodes.
The agent node is used as a main consensus group member and is responsible for receiving the request message from the client and serving as a main node for leading the consensus process of the consensus group in the secondary consensus layer. The main work comprises the following steps: broadcasting request messages to each backup node in the group, packaging verification messages from each backup node, feeding final results back to the client node, and the like.
The backup node is a participant in the consensus process of each consensus group of the secondary consensus layer and is other nodes in the system except the agent node. And the system is responsible for completing the consensus verification work of the messages in the consensus group under the leader of the agent node, and feeding back the consensus result to the agent node after the verification is completed.
S22: carrying out hierarchical structure division according to the number of the agent nodes and the backup nodes to obtain a node consensus model; as shown in fig. 2, the following contents are specifically included:
dividing all the agent nodes into a primary consensus layer, and dividing all the backup nodes into a secondary consensus layer; dividing the backup node number by the proxy node number to obtain a quotient n and a remainder r; dividing each group of nodes into secondary consensus groups of different agent nodes by taking every n nodes as a group, and uniformly dividing the rest nodes into the secondary consensus groups of r agent nodes; preferably, the nodes are grouped according to the credibility score ordering, each group of nodes is divided into a corresponding secondary consensus group according to the credibility score ordering of the agent nodes, and the rest nodes are uniformly distributed to the first r corresponding agent nodes according to the credibility score ordering.
For example, assuming that there are N nodes in the system, all nodes are grouped into M consensus groups. After the credibility scores are arranged in a descending order, the first M nodes with the highest scores are selected as agent nodes, a main consensus group is established in a first-level consensus layer, and the rest nodes are merged into a secondary consensus group led by each agent node in a second-level consensus layer according to the scoring order:
Figure BDA0003616568710000091
firstly, dividing N-M backup nodes into M parts according to the credibility grading sorting, wherein each part comprises N backup nodes, dividing the M parts of backup nodes into corresponding agent nodes according to the credibility grading sorting, for example, dividing the N backup nodes with the highest grades into a secondary common identification group of the agent node with the highest credibility grading, and dividing the rest r backup nodes into the first r corresponding agent nodes according to the credibility grading sorting, for example, dividing the backup node with the highest grade in the r backup nodes into the secondary common identification group of the agent node with the highest credibility grading; and the secondary consensus group of each agent node is divided into a backup node.
If the total number N of the nodes is less than the group number M, the original PBFT algorithm single-layer system structure is directly adopted, and hierarchical grouping is not needed. If the total number of nodes N is greater than the number of groups M, the above-described hierarchical grouping improvement may be performed.
S23: and after each consensus, reconstructing the node consensus model.
Judging whether the consensus request is finished or not, if not, in order to ensure the safety and reliability of the system, performing credibility evaluation on the nodes again according to the performance of each node in the consensus process after each round of consensus, updating the credibility scoring list, constructing a node consensus model, and performing the next consensus according to the reconstructed node consensus model.
S3: and carrying out node consensus according to the node consensus model. As shown in fig. 3, the following contents are specifically included:
s31: a Request stage: the client node sends a request message to all agent nodes in the main consensus group; the format of the request message is:
Figure BDA0003616568710000092
wherein, PREQUST is the message type identifier of the solicited message, represent the message is the solicited message; m denotes a request message, t denotes a time stamp, σ c Representing the signature of client node c.
S32: pre-rrepart stage: the agent node receives the request message, verifies the identity of the client according to the request message, and sends a pre-preparation message to all backup nodes in the secondary consensus group of the agent node after the verification is passed;
after receiving a request message from a client, an agent node i verifies the identity of the client and distributes a sequence number n for the request message; after the verification is passed, sending the pre-preparation message to all backup nodes in a secondary consensus group led by the agent node in a secondary consensus layer; the format of the prepare message is:
Figure BDA0003616568710000101
wherein PRE-PREPARE is the message type identifier of the PRE-prepared message, representing that the message is the PRE-prepared message, v represents the current view number, n represents the node number, d requests the abstract of the message m, σ i Representing the signature of the proxy node i.
S33: stage Rrepare: the backup node receives the pre-preparation message and verifies the correctness of the pre-preparation message, and after the pre-preparation message is verified, the backup node writes the message into a local log and broadcasts a new preparation message to other backup nodes in the same consensus group;
after receiving the pre-preparation message, the backup node j verifies the correctness of the message, writes the message into a local log after the verification is passed, and broadcasts a new preparation message to other backup nodes in the same consensus group; when more than 2f consistent preparation messages (new preparation messages) sent by different backup nodes are received, the preparation stage is completed; f represents the number of nodes; the format of the new prepare message is:
Figure BDA0003616568710000102
wherein, PREPARE is the message type identifier of the ready message, represent the message is the ready message; d (m) represents,. sigma.) j Representing the signature of backup node j.
S34: and a Commit stage: the backup node broadcasts a confirmation message to other backup nodes in the same consensus group;
the backup node j broadcasts confirmation messages to all nodes except the node in the secondary consensus group, and after the node receives (2f +1) pieces of consistency confirmation messages (confirmation messages) including the node, the messages reach consensus in the secondary consensus group; the format of the acknowledgement message is:
Figure BDA0003616568710000103
s35: a Reply stage: each backup node feeds back a consensus result to the agent node to which the backup node belongs, and the agent node feeds back the consensus result to the client node; when the client receives the consensus result sent by more than half of the proxy nodes, the system achieves the consensus;
and after the group consensus is finished, each backup node feeds back the final consensus result to the agent node to which the backup node belongs. When the agent node i receives more than (f +1) pieces of consistency feedback (consensus result), the agent node i indicates that the second-level consensus layer agrees on the message. The agent node feeds back the consensus result to the client node, and when the client receives the consensus result sent by more than half of the agent nodes in the main consensus group, the system achieves consensus.
S4: and when a new node is added or an old node is withdrawn, updating the node consensus model by adopting a dynamic node in-out management method.
When a new node enters a system, the new node acquires admission permission of each participating institution in a block chain of the alliance;
after the admission permission is obtained, the system firstly carries out credibility evaluation on a new node (at the moment, the node only has a static basic configuration score);
and distributing the new node to a secondary consensus group according to the credibility score and broadcasting an adding message to all nodes in the system, wherein the format of the adding message is as follows:
<<JOIN,score,m>σ m >σ p
wherein, JOIN is the message type identifier of the new node joining message, representing that the message is the new node joining message; score represents the credibility score of the new node, m represents the node number assigned by the new node, and sigma m Representing new node signature, σ p Representing a signature of the consensus master node.
After each node receives the join message, the correctness of the content of the message is immediately verified, and after the verification is passed, the relevant information of the node and the signature are sent to a new node for local verification and storage, so that the new node can smoothly communicate with other nodes and timely participate in subsequent work; the related information comprises a node number, a group to which the node number belongs and a credibility score.
When the new node receives more than 2N/3 messages, the joining message has been authenticated by most nodes in the system, and represents that the new node successfully joins the system, wherein N is the total number of nodes in the system.
When the old node exits the system, the old node acquires the exit permission of each participating mechanism in the block chain of the alliance;
after obtaining the quit permission, the old node needs to broadcast the quit information of the node to other nodes in the system; the format of the exit message is:
<<LEAVE,group,n>σ n >σ p
wherein, LEAVE is the message type identifier of the old node exit message, and represents that the message is the old node exit message; the group represents the secondary consensus group to which the node belongs.
And the rest nodes of the system receive the quitting message and verify the correctness of the quitting message, the quitting message is sent to the old node N after the verification is passed, and when the old node N receives more than 2N/3 quitting message, the quitting message is considered to be confirmed by most nodes, and the node successfully quits the system.
The method comprises the steps of sequentially constructing a consensus model by performing role attribute division and hierarchy division on nodes, performing local consensus on the consensus model, and performing global consensus according to the local consensus; the invention can effectively reduce the communication traffic in the consensus process and improve the expandability of the system; when a new node is added or an old node is withdrawn, the system does not need to be restarted, and the requirements of the real application scene can be met; and the agent nodes are selected through credibility scoring, so that the probability of view switching is reduced, the consensus efficiency and the system safety are improved, and the practicability of the block chain system is improved.
The above-mentioned embodiments, which further illustrate the objects, technical solutions and advantages of the present invention, should be understood that the above-mentioned embodiments are only preferred embodiments of the present invention, and should not be construed as limiting the present invention, and any modifications, equivalents, improvements, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (8)

1. A multi-level optimized PBFT consensus method based on node credibility is characterized by comprising the following steps:
s1: carrying out reliability evaluation on the nodes to obtain reliability scores of the nodes;
s2: performing node role attribute distribution and hierarchical structure division according to the credibility scores of the nodes to obtain a node consensus model; the role attributes comprise agent nodes and backup nodes, the hierarchical structure comprises a primary consensus layer and a secondary consensus layer, the primary consensus layer comprises a primary consensus group, and the secondary consensus layer comprises at least one secondary consensus group;
s3: carrying out node consensus according to the node consensus model;
s4: and when a new node is added or an old node is withdrawn, updating the node consensus model by adopting a dynamic node in-out management method.
2. The multi-level optimization PBFT consensus method based on node credibility as claimed in claim 1, wherein the process of credibility assessment on nodes comprises:
s11: calculating the basic configuration score of the nodes according to the number of CPU cores, the memory capacity of the computer and the capacity of the hard disk;
s12: calculating consensus reputation value, activity degree and consensus success rate of the nodes; calculating consensus scores of the nodes according to the consensus reputation values, the activity degrees and the consensus success rates of the nodes;
s13: and calculating the credibility score of the node according to the basic configuration score and the consensus score of the node.
3. The multi-level optimization PBFT consensus method based on node credibility as claimed in claim 2, wherein the formula for calculating the consensus score of the node is:
R j =k 1 ρ j +k 2 p j +k 3 E j
Figure FDA0003616568700000011
Figure FDA0003616568700000012
wherein R is j Denotes the consensus score, ρ, of node j j Indicating the activity level, p, of node j j Indicates the consensus success rate of node j, E j Representing a consensus reputation value, k, for node j 1 Denotes a first adjustment factor, k 2 Denotes a second adjustment factor, k 3 Denotes a third adjustment factor, and λ denotes an activity factorSon, n represents the number of consensus times that the node participates in, n success Representing the consensus number of times the node successfully completed work.
4. The multi-level optimization PBFT consensus method based on node credibility as claimed in claim 2, wherein the formula for calculating the credibility score of the node is:
C j =K 1 B j +K 2 R j
wherein, C j Representing a confidence score for node j, B j Represents the base configuration score, R, of node j j Denotes the consensus score, K, of node j 1 Denotes a first weight, K 2 Representing a second weight.
5. The multi-level optimization PBFT consensus method based on node credibility as claimed in claim 1, wherein the process of obtaining the node consensus model comprises:
s21: setting the group number M, sequencing credibility scores of the nodes in a high-to-low sequence, taking M nodes before the credibility scores are sequenced as proxy nodes, and taking the rest nodes as backup nodes;
s22: carrying out hierarchical structure division according to the number of the agent nodes and the backup nodes to obtain a node consensus model;
s23: and after each consensus, reconstructing the node consensus model.
6. The node-credibility-based multi-level optimization PBFT consensus method according to claim 5, wherein the hierarchical partitioning process comprises: dividing all the agent nodes into a primary consensus layer, and dividing all the backup nodes into a secondary consensus layer; dividing the backup node number by the proxy node number to obtain a quotient n and a remainder r; and dividing each group of nodes into secondary consensus groups of different agent nodes by taking each n node as a group, and uniformly distributing the rest nodes to the secondary consensus groups of r agent nodes.
7. The multi-level optimization PBFT consensus method based on node credibility according to claim 1, wherein the process of performing node consensus comprises:
s31: the client node sends a request message to all agent nodes in the main consensus group;
s32: the agent node receives the request message, verifies the identity of the client according to the request message, and sends a pre-preparation message to all backup nodes in the secondary consensus group of the agent node after the verification is passed;
s33: the backup node receives the pre-preparation message and verifies the correctness of the pre-preparation message, and after the pre-preparation message is verified, the backup node writes the message into a local log and broadcasts a new preparation message to other backup nodes in the same consensus group;
s34: the backup node broadcasts a confirmation message to other backup nodes in the same consensus group;
s35: each backup node feeds back a consensus result to the agent node to which the backup node belongs, and the agent node feeds back the consensus result to the client node; when the client receives the consensus result of more than half the number of the proxy nodes, the system achieves the consensus.
8. The node-reliability-based multi-level optimization PBFT consensus method according to claim 1, wherein the updating of the node consensus model using a dynamic node access management method comprises:
when a new node enters a system, the new node acquires admission permission of each participating institution in a block chain of the alliance; the system carries out credibility evaluation on the new node to obtain a credibility score; distributing the new node to a secondary consensus group according to the credibility score and broadcasting a join message to all nodes in the system; each node receives the joining message and verifies the correctness of the message, and after the verification is passed, the node sends the self information and the signature to the new node; when the new node receives two messages which exceed three-third of the total nodes of the system, the new node is successfully added into the system;
when the old node exits the system, the old node acquires the exit permission of each participating mechanism in the block chain of the alliance; the old node broadcasts an exit message to other nodes in the system; each node receives the quit message and verifies the correctness of the message, and sends a quit confirmation message to the old node after the verification is passed; and when the old node receives two quit confirmation messages which exceed three thirds of the total nodes of the system, the old node successfully quits the system.
CN202210445397.XA 2022-04-26 2022-04-26 Multi-level optimization PBFT consensus method based on node credibility Active CN114938292B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210445397.XA CN114938292B (en) 2022-04-26 2022-04-26 Multi-level optimization PBFT consensus method based on node credibility

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210445397.XA CN114938292B (en) 2022-04-26 2022-04-26 Multi-level optimization PBFT consensus method based on node credibility

Publications (2)

Publication Number Publication Date
CN114938292A true CN114938292A (en) 2022-08-23
CN114938292B CN114938292B (en) 2023-05-23

Family

ID=82863005

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210445397.XA Active CN114938292B (en) 2022-04-26 2022-04-26 Multi-level optimization PBFT consensus method based on node credibility

Country Status (1)

Country Link
CN (1) CN114938292B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115622716A (en) * 2022-12-19 2023-01-17 湖南天河国云科技有限公司 Internet of things equipment identity authentication method based on block chain
CN117294720A (en) * 2023-11-27 2023-12-26 江西农业大学 Block chain consensus method, device, storage medium and equipment

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20200344111A1 (en) * 2020-05-14 2020-10-29 Rani Malhotra System and method for obtaining consensus in a distributed ledger network
CN111858105A (en) * 2020-08-26 2020-10-30 电子科技大学 Personal archive permission chain management system and method based on improved multi-layer PBFT
CN112039964A (en) * 2020-08-24 2020-12-04 大连理工大学 Node reputation consensus method based on block chain
CN113259179A (en) * 2021-06-18 2021-08-13 杭州云智声智能科技有限公司 Byzantine fault-tolerant consensus method and system based on node scoring
CN113781218A (en) * 2021-09-03 2021-12-10 桂林电子科技大学 Grouping PBFT consensus algorithm based on feature trust

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20200344111A1 (en) * 2020-05-14 2020-10-29 Rani Malhotra System and method for obtaining consensus in a distributed ledger network
CN112039964A (en) * 2020-08-24 2020-12-04 大连理工大学 Node reputation consensus method based on block chain
CN111858105A (en) * 2020-08-26 2020-10-30 电子科技大学 Personal archive permission chain management system and method based on improved multi-layer PBFT
CN113259179A (en) * 2021-06-18 2021-08-13 杭州云智声智能科技有限公司 Byzantine fault-tolerant consensus method and system based on node scoring
CN113781218A (en) * 2021-09-03 2021-12-10 桂林电子科技大学 Grouping PBFT consensus algorithm based on feature trust

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
YANJUN JIANG: "Scalable efficient byzantine fault tolerance" *
段靓;吕鑫;刘凡;: "基于信任委托的区块链分层共识优化", 计算机工程 *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115622716A (en) * 2022-12-19 2023-01-17 湖南天河国云科技有限公司 Internet of things equipment identity authentication method based on block chain
CN117294720A (en) * 2023-11-27 2023-12-26 江西农业大学 Block chain consensus method, device, storage medium and equipment
CN117294720B (en) * 2023-11-27 2024-02-20 江西农业大学 Block chain consensus method, device, storage medium and equipment

Also Published As

Publication number Publication date
CN114938292B (en) 2023-05-23

Similar Documents

Publication Publication Date Title
CN109151013B (en) Logistics industry information platform based on alliance block chain
CN109871669B (en) Data sharing solution based on block chain technology
CN111082943B (en) Efficient block chain consensus method
CN114938292B (en) Multi-level optimization PBFT consensus method based on node credibility
Hassanzadeh-Nazarabadi et al. Lightchain: A dht-based blockchain for resource constrained environments
Yu et al. Proof-of-QoS: QoS based blockchain consensus protocol
US20220237181A1 (en) Method, apparatus, device, and storage medium for proposal message processing for blockchain
EP4318362A1 (en) Blockchain-based data processing method, apparatus and device, and storage medium
Wang et al. A comparative study of blockchain consensus algorithms
Zoican et al. Blockchain and consensus algorithms in internet of things
CN112540926A (en) Resource allocation fairness federal learning method based on block chain
Wang et al. A trusted consensus fusion scheme for decentralized collaborated learning in massive IoT domain
Zhang et al. Cycledger: A scalable and secure parallel protocol for distributed ledger via sharding
Wang et al. Beh-Raft-Chain: a behavior-based fast blockchain protocol for complex networks
CN115665170B (en) Block chain consensus method based on reputation and node compression mechanism
CN111935207A (en) Block chain system consensus method based on improved C4.5 algorithm
CN111798234B (en) Lightweight block chain system and construction method
Kim et al. Improved raft algorithm exploiting federated learning for private blockchain performance enhancement
CN114490020A (en) Block chain fragmentation method and system and electronic equipment
CN111858105A (en) Personal archive permission chain management system and method based on improved multi-layer PBFT
Ren et al. Pooled mining is driving blockchains toward centralized systems
CN116611840A (en) Distributed data asset circulation traceability system and method based on blockchain
Ji et al. A personal information management using blockchain
Mohsenzadeh et al. A novel reputation-based consensus framework (RCF) in distributed ledger technology
CN111598389B (en) Transaction system for preventing bill market risk based on blockchain

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant