| Blockchain is widely used in digital economy,Internet of things,health care and other fields because of its characteristics of decentralization,non-tampering and data transparency.As a key technology in blockchain,consensus algorithm is used to ensure that distributed nodes reach a consensus on the state of some data in a complex network environment,which determines the data safety and processing efficiency of blockchain.Practical Byzantine Fault Tolerance(PBFT)is a common consensus algorithm for consortium blockchain.This algorithm efficiently solves the Byzantine Generals Problem,but its shortcomings such as high network delay,random selection of master nodes,and inability to dynamically add or delete nodes limit its application scenarios.In order to solve these problems,this paper conducts the following research:(1)Aiming at the problem of large communication overhead of PBFT algorithm,a Practical Byzantine Fault Tolerant algorithm based on reputation model is proposed(Reputation Practical Byzantine Fault Tolerance,R-PBFT).Firstly,the calculation method of local reputation value of Eigen Trust reputation model is improved,and the dynamic local reputation value is obtained by introducing time decay factor,which is more in line with the reality.In addition,according to the reputation value of nodes,the nodes are divided into first-level nodes that participate in the consensus and second-level nodes that passively receive the consensus results,which reduces the network communication time.Finally,this paper proposes a punishment method for malicious nodes.When a node commits evil,its reputation value is reduced according to its historical evil times,and the malicious node is downgraded from the first-level node to the second-level node,which can effectively reduce the malicious behavior of nodes.Experimental results show that the R-PBFT algorithm has less communication overhead than the PBFT algorithm.(2)Aiming at the problem that PBFT algorithm cannot dynamically add or delete nodes and select the order of master nodes,this paper proposed a Practical Byzantine Fault Tolerance algorithm based on dynamic mechanism(Elastic Practical Byzantine Fault Tolerance,E-PBFT).Firstly,the process of adding and deleting nodes of the PBFT consensus algorithm is optimized,so that nodes can join and leave the network when the network is running,which improves the flexibility of the blockchain network.Then,the verifiable random function was used to randomly select the master node,which inhibited the attack of malicious nodes on the master node.Finally,the simulation results show that E-PBFT algorithm is more efficient than PBFT algorithm. |