| Consensus algorithms directly affect the efficiency of the blockchain.Designing a secure and high-performance consensus algorithm is one of the hotspots in blockchain research in recent years,which plays a very important role in promoting its development and application.The PBFT consensus algorithm effectively solves the problem of malicious nodes sending error messages to disrupt the operation of the system in a distributed system is widely adopted in the federated blockchain,but its direct application to the blockchain system can also cause Some problems,such as poor scalability of nodes,cannot be directly applied to larger scale node network environment,higher communication complexity of PBFT consensus algorithm,etc.In this paper,after systematically analyzing the principles of the above consensus algorithm,the PBFT consensus algorithm is improved,and the main research contents are as follows.(1)The practical byzantine fault-tolerant consensus algorithm for federated chains is difficult to be applied to networks with a large number of nodes,and the wrong selection of master nodes in the consensus process will lead to the waste of system communication resources.In this paper,a trust-based practical byzantine fault tolerance algorithm based on the trust assessment model is proposed,which uses the clustering method to group consensus nodes in the system.Then,according to the historical behavior of nodes in the network,the trust degree is evaluated,and the reliable nodes are selected as the primary nodes in the consensus group.After an intra-group consensus is achieved,the inter-group consensus is implemented to ensure that the data stored on the consensus nodes in the system is consistent.The proposed improved algorithm can be better applied to large-scale blockchain network systems and can select more reliable master nodes.The throughput of the improved algorithm is obviously improved and the consensus time is effectively reduced.(2)The problem of high communication complexity of the PBFT consensus algorithm and the arbitrary selection of master nodes,this paper proposes a PBFT consensus algorithm based on node role division.According to the credit value,the roles of nodes in the team are divided into three roles,namely consensus node,backup node,and supervision node,to reduce the number of nodes participating in the consensus process and reduce the complexity of communication.In addition,an adaptive method is adopted to select the primary node in the consensus process,and random numbers are introduced to ensure the randomness and fairness of the primary node selection.Compared with the PBFT consensus algorithm,the improved algorithm has lower communication complexity and better decentralization. |