| Consensus mechanism has always been one of the research hotspots of blockchain technology.A secure and efficient consensus mechanism can greatly improve the stability and operating efficiency of the blockchain system.Consortium blockchain has great application potential and research value because of its moderate performance and easy to combine with many scenarios of life.At present,the consortium blockchain mainly uses the practical Byzantine fault tolerance consensus mechanism.When the number of system nodes is small,the practical Byzantine fault tolerance mechanism performs well,but when the system nodes exceed 100,the performance of the algorithm will rapidly reduce,and there are also problems such as insufficient node expansion ability and reduced security.To solve the above problems,this paper proposes a multi-role practical Byzantine fault tolerant consensus mechanism based on the idea of node sorting and grouping.The algorithm reduces the number of nodes participating in the consensus in the system,improves the overall performance and improves the node expansion ability.Based on the first algorithm,a consensus communication protocol is designed,which is suitable for weakly distributed environment.This protocol reduces the communication complexity of practical Byzantine fault tolerance algorithm from exponential to linear,and greatly improves the communication efficiency of the algorithm.Finally,the two consensus algorithms proposed in this paper are combined with the same type of improved algorithms in recent years for comparative analysis.The main contributions of this paper are as follows:1.This paper proposes a multi-role practical Byzantine fault tolerance algorithm based on sorting and grouping.The algorithm firstly proposes a node scoring model to score and sort all system nodes.Based on the serialized node cluster,the algorithm introduces the parameter K to group the nodes,and divides the nodes of the whole network into four types of roles,which are master node,consensus node,ordinary node and redundant node.The algorithm can improve the overall performance of the system by reducing the number of consensus nodes.At the same time,the algorithm also includes the content of role conversion protocol,which is used to adjust the role of nodes in the system,mainly in order to deal with the situation that the consensus node and the master node are attacked to become Byzantine nodes,and the protocol can effectively improve the ability of the smooth operation of the system.2.A consensus protocol is designed for weakly distributed environments.On the basis of contribution 1,this protocol puts forward another improvement idea,which improves the consensus efficiency by optimizing the communication mode of nodes.The protocol is based on the idea of fragmentation,which divides the nodes of the system into small regions.If the nodes in each region reach a consensus,all nodes can reach a consensus.All regions in the protocol can start consensus at the same time and there is no need to wait for other regions,so the protocol can further improve the consensus efficiency of the system.The protocol includes specific message types and communication modes,which can reduce the communication complexity of practical Byzantine fault tolerance algorithm and improve the fault tolerance ability.3.This paper compares and analyzes the same type of improved algorithms in recent years,and summarizes them from multiple performance perspectives.It can be concluded that the two consensus mechanisms proposed in this paper are superior to the same type of algorithms in terms of comprehensive performance. |