| The quality and safety of agricultural products is the most concerned issue of consumers.The traceability data of agricultural products reflects the information of the production,processing,storage,transportation and sales of agricultural products.Obtaining high-quality agricultural product traceability data is of great significance to ensure food safety,improve the quality of agricultural products,and enhance market transparency.The agricultural production environment is greatly affected by uncontrollable external factors such as soil,climate,and man-made,and the traceability data of agricultural products is prone to abnormalities during the collection process.Abnormal monitoring of agricultural product traceability data and elimination of abnormal data can ensure the reliability of the data.In recent years,scholars at home and abroad have carried out a lot of research work in the field of data anomaly monitoring,but there is still the problem of low algorithm accuracy for the anomaly monitoring of agricultural product traceability data.To this end,this paper takes the tea traceability data of a company in Huangshan as the research object,designs an abnormal data monitoring method for agricultural product blockchain traceability based on smart contracts,improves the abnormal data monitoring algorithm,improves the accuracy of abnormal data monitoring,and can Data and monitoring and analysis results are fed back to agricultural product companies.The main research work of this paper is as follows:(1)The abnormal data monitoring model of agricultural product blockchain traceability is constructed.In order to reduce the problems of consumers being misled and corporate reputation damaged due to inaccurate agricultural product information,this model includes data acquisition,abnormal monitoring and abnormal feedback modules to ensure the accuracy and reliability of agricultural product traceability data.Among them,the data acquisition module is used to collect and organize relevant data of agricultural products,such as production process,supply chain information and quality inspection results,etc.;the abnormality monitoring module uses the improved algorithm to monitor the traceability data of agricultural products in real time;the abnormality feedback module will monitor The results are fed back to relevant enterprises.Enterprises can correct and improve according to abnormal situations to ensure the quality and safety of agricultural products.(2)An abnormal monitoring algorithm for agricultural product blockchain traceability data is proposed.Using the density-based LOF algorithm,the distance-based KNN algorithm and the Ensemble-based IForest algorithm,the LOKI algorithm for abnormal monitoring of agricultural product blockchain traceability data is designed,and the DBSCAN algorithm is used for parameter adjustment to improve the accuracy of abnormal data monitoring.The experimental results show that the LOKI algorithm can maintain a high monitoring accuracy under different proportions of abnormal data,with an average accuracy rate of 96.9%,an average detection rate of 91.8%,an average recall rate of 98.6%,and an AUC value of 0.96.Abnormal data in blockchain traceability data of agricultural products.(3)Developed an abnormal data monitoring system for agricultural product blockchain traceability based on smart contracts.Constructed alliance chain and separate front-end and back-end based on Docker;compiled smart contracts such as traceability data upload,abnormal data monitoring based on LOKI algorithm,and abnormal feedback.The test verified the effectiveness of the agricultural product blockchain traceability abnormal data monitoring model,the unsupervised abnormality monitoring algorithm and the algorithm parameter adjustment method,and realized functions such as traceability data upload,abnormal data monitoring,and abnormal feedback.This study achieves innovative results in monitoring anomalous data of agricultural traceability,which is of positive significance to guarantee the quality of agricultural traceability data. |