Abstract:Objective To establish a food safety risk assessment and early warning system suitable for food safety sampling data. Methods By using structured query language, efficient matching algorithm based on rule base engine, 145 data attributes were filtered and optimized through preprocessing of data, construction of basic event mode and compound event mode, and rule base configuration. 53 047 pieces of food safety sampling data was used for verification and testing. Results 4 types of core attributes were selected, and 7 basic rules and 3 compound rules were formed. Through verification, the early warning system was good and stable, and the test results were consistent with the manual labeling results. Conclusion This study has created a rule generation and synthesis mechanism, and established a food safety risk assessment and early warning system that can realize real-time and early warning. The system can realize fast and accurate early warning of food safety risk assessment.