The construction of traceability system of agricultural products supply chain is an effective measure to solve the quality and safety of agricultural products.The advantages of decentralization,anti-tampering ability and traceability of blockchain technology make it possible to solve the problem of untrusted traceability data faced by traditional agricultural products traceability system,which is of great significance to the real and reliable traceability of agricultural products traceability data.However,the amount of traceability data of agricultural products is large,and there are shortcomings in data storage.At the same time,the agricultural product blockchain traceability system mainly accesses the data of each link of the agricultural product supply chain,which involves many roles of enterprises and cannot guarantee the security of enterprise nodes,resulting in low security and low efficiency of blockchain consensus.To this end,this thesis proposes an improved PBFT consensus algorithm for the traceability of agricultural product blockchain.The main research contents are as follows:(1)A credibility voting model for the traceability of agricultural product blockchain is constructed.By adding the voting mechanism,the node reputation model is constructed to evaluate the node election behavior and consensus behavior.According to the node reputation value,the nodes are classified,the malicious nodes are eliminated,and the consensus nodes with high reputation value are screened,which solves the problem of poor security of consensus transaction in the traceability of agricultural product blockchain.The experimental results show that the addition of the reputation voting model reduces the proportion of Byzantine nodes in the consensus nodes,reduces the probability of malicious nodes becoming primary nodes,and enhances the security of blockchain consensus.(2)A node status monitoring method for agricultural product blockchain traceability is proposed.Through the communication interaction between consensus nodes,the downtime or non-response nodes are identified and eliminated,and the replacement consensus nodes are added to solve the defects of host failure and bandwidth delay in the process of agricultural product blockchain traceability consensus.(3)The grouping consensus mechanism of agricultural product blockchain traceability is designed.The consensus nodes are grouped on average and the optimal grouping is calculated based on the minimum number of broadcast messages.The intra-group consensus and global consensus are used to reduce the communication complexity of the traditional PBFT algorithm,reduce the number of broadcast messages,and improve the consensus efficiency.The experimental results show that the time required for the mechanism to complete a round of consensus is 50 s longer than that of the original PBFT algorithm.(4)An agricultural product blockchain traceability system based on improved PBFT algorithm is developed.The ’ on-chain + off-chain ’ dual storage mode is adopted to solve the limited storage performance of the blockchain;the underlying super ledger blockchain environment is deployed,and an agricultural product blockchain traceability system based on improved PBFT algorithm is designed and implemented.Combined with the traceability data of six hundred miles of Taiping Houkui tea in Huangshan,the functional test and performance test of the system are carried out.Experiments show that the storage capacity of the system is increased by 218.3 %,the average transaction throughput of the system is increased from 10.56(block / min)to 97.59(block / min),and the response time of the system page is within 1.5 s. |