| Consensus algorithms are criteria that ensure that most nodes in a blockchain achieve final consistency.They are generally divided into two categories:strong consensus where the update results are synchronously stored and accessed by all nodes,and weak consensus where the update results are synchronously stored and accessed by all nodes after being delayed.Raft is a classic strong consensus algorithm in blockchain,which is widely used due to its easy to understand and implement characteristics.However,Raft still issues with voting classification,unreliable leaders,high communication pressure,low availability,and privacy breaches.This article conducts research based on the Raft algorithm.The main research content and innovative scheme are as follows:(1)In private chain,nodes are small in size.Aiming at the problems of random election results,split voting,and frequent leader replacement caused by Raft algorithm,such as high election time delay and low leader reliability,a federated learning model based election consensus algorithm FL_Raft is proposed.A high-performance node group is filtered through a federated learning training model,and a behavior based rights calculation model is established for rights election.Finally,all nodes vote to generate a leader node.Experimental results show that compared to the Raft algorithm,FL_Raft has a 50%reduction in election latency and a 99%leader reliability.(2)In homogeneous consortium chain,nodes have a large scale.In order to address the issues of increased consensus latency and throughput degradation caused by frequent node interactions and security vulnerabilities in the Raft algorithm,a committee consensus algorithm based on federated learning,FRaft,is proposed.Introduce a federated learning model migration scheme,build a committee architecture,and design load balancing and log distribution nodes.Experimental results show that compared to the Raft algorithm,the consensus delay of FRaft is reduced by 21%and the throughput is improved by 27%.(3)In heterogeneous consortium chain,there are various types of nodes.Aiming at the problems of high cluster pressure and low availability caused by the complex structure and increased overhead of Raft clusters,a semi asynchronous aggregation consensus algorithm FRCR based on federated reconstruction is proposed.Based on federated reconstruction technology,the process of model training,updating,and evaluation is optimized,and a semi asynchronous buffer mechanism and strategies to resist malicious node attacks are introduced.Experiments and analysis were conducted on five aspects of FRCR,verifying the effectiveness of FRCR in consensus clusters. |