Blockchain technology has the characteristics of decentralization,distributed storage,consensus mechanism,security,information encryption,anonymity,etc.,which can effectively solve the pain points of traditional industries such as information asymmetry,poor information transparency,channel costs,and credit risks.In recent years,blockchain technology has received widespread attention,making it not only used to exchange cryptocurrencies,but also expected to be used to exchange other types of assets without the need for a strong and credible third party.This will provide new solutions to the pain points of traditional industries.At present,the application research of blockchain in traceability,cryptocurrency,etc.is in a steady development stage,and the consensus mechanism is also a module that has attracted more attention.The consensus mechanism is mainly to achieve the consistent purpose of message communication in the distributed network.There are currently consensus algorithms such as Po W,Po S,DPo S,and PBFT.These consensus algorithms are directly applied to systems in specific fields,and there are still high latency and slow communication,inadequate and so on.By studying the problems of these consensus mechanisms,this topic proposes improved algorithms for the problems to meet the requirements of specific applications.The main research contents of this article are as follows:(1)Analyzed the blockchain technology and its underlying principles,briefly explained the six-layer architecture model of the blockchain,and then focused on the consensus algorithm of the blockchain,and analyzed and compared it,including the details of the Byzantine fault-tolerant consensus algorithm the description provides theoretical basis and technical support for subsequent research and improvement.(2)By analyzing the throughput,communication complexity,applicable scenarios,and fault tolerance of the existing consensus algorithms in the blockchain,improvements to the Byzantine fault tolerance mechanism are proposed,including: changing the selection method of the master node to make the master node the election is more random.At the same time,it simplifies the process of view switching consensus protocol,reduces the complexity of communication,and is conducive to efficient consensus.Through these measures,the Byzantine fault-tolerant algorithm is improved,and the advantages of the improved algorithm in terms of throughput and efficiency are experimentally verified,and the results are obtained.(3)Traditional agricultural product traceability systems are all centralized structures,which are prone to single point of failure and tampering.Therefore,the improved consensus algorithm is applied to the agricultural product traceability field to optimize the operation process.And focused on analyzing the operating mechanism of the system consensus layer,which is more conducive to the accountability of agricultural product safety issues. |