Food safety risk early warning method and system

The food safety risk early warning system addresses subjective analysis in existing systems by employing data preprocessing and AI-driven models to enhance the objectivity and accuracy of food safety monitoring, ensuring timely and comprehensive risk identification.

CN119202518APending Publication Date: 2024-12-27CCIC SHANGHAI TESTING TECH CO LTD +1

Patent Information

Application Number
CN202410865744.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-01
Publication Date
2024-12-27

AI Technical Summary

Technical Problem

Existing food safety risk early warning systems rely heavily on subjective human factors and lack objective, dynamic data analysis, leading to missed important data information and limited effectiveness in food safety monitoring.

Method used

A food safety risk early warning method and system that utilizes data input, preprocessing, intelligent analysis using statistical theory and artificial intelligence, and outputs comprehensive analysis results, including four types of alarm models (Class A, B, C, and D) and data overviews.

Benefits of technology

Enhances the objectivity and accuracy of food safety monitoring by identifying anomalies and risks through standardized data analysis, providing timely alarms and detailed data overviews, thereby improving the effectiveness of food safety supervision.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119202518A_ABST
    Figure CN119202518A_ABST
Patent Text Reader

Abstract

The invention provides a food safety risk early warning method and system. The food safety risk early warning system comprises a data input module, a data preprocessing module, a data analysis module and an analysis result output module. The data input module is used for acquiring original data from an exogenous database; the data preprocessing module is used for screening and cleaning the original data according to a preset rule to obtain standardized data conforming to a data analysis specification; the data analysis module performs intelligent analysis on the standardized data based on a statistics theory and an artificial intelligence technology; and the analysis result output module is used for outputting an analysis result, and the analysis result comprises a data overview and early warning information. The system provides an intelligent, precise and visual macroscopic quantitative monitoring means for related management departments, assists food safety supervision digital transformation, and reduces the occurrence rate of food safety accidents.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of food safety, and in particular to a food safety sampling risk early warning method and system. Background Art

[0002] Food safety is directly related to people's well-being and is an inevitable requirement for high-quality economic and social development. In food safety supervision, food safety sampling has always been an important part of food safety work. Food safety risk warning is a complete functional system for food safety issues established by monitoring, tracking, quantitative analysis and forecasting food safety issues, and timely issuing alarms for potential food safety issues, so as to achieve early prevention and control of food safety incidents, minimize losses, and change post-processing to advance warning.

[0003] Many countries and organizations in the world have established and are improving their own food safety early warning systems. In recent years, my country has been actively strengthening the construction of a food safety early warning system. Given the breadth of areas involved in food safety early warning and the complexity of the required technology, the research and development of a food safety risk early warning system needs to be improved.

[0004] Since the qualified rate of food safety sampling inspection results is generally above 95%, the unqualified rate (abnormal data) is very low, and the actual abnormal data is sparsely distributed. The use of general weighted methods to calculate and analyze historical data information will lead to large errors. In addition, the indicator parameters constructed by the existing food safety risk early warning system are artificially set too heavy, and the analysis results are affected by subjective human factors. It is easy to miss really important data information, and it is impossible to achieve objective and independent analysis, which has a very limited effect on food safety early warning. Therefore, it is necessary to establish a food safety sampling risk early warning system that is based on data and allows data to speak objectively and dynamically, so as to obtain more complete food safety abnormal monitoring information. Summary of the invention

[0005] In order to overcome the above technical defects, the first aspect of the present invention provides a food safety risk early warning method, which comprises:

[0006] Step S1: Data input: obtaining original data from an external database;

[0007] Step S2: Data preprocessing: Screen and clean the raw data according to pre-set rules to obtain standardized data that meets data analysis specifications;

[0008] Step S3: Data analysis: intelligently analyze the standardized data based on statistical theory and artificial intelligence technology;

[0009] Step S4: Output analysis results, which include data overview and warning information.

[0010] Furthermore, step S2 includes: (1) data screening: selecting regions, links, and food categories from the original data (for example, the original data is in the form of a data table); (2) data cleaning: first retaining the columns used for classification and calculation in the original data, and then using the hash algorithm to supplement the missing sample number information; unifying the names of the inspection items and the four-level classification of samples in the original data according to the provisions of the "2022 National Food Safety Supervision and Sampling Implementation Rules"; in the "Whether Detected" column, fill in "Not Detected" or "Detected"; adding column contents for the limit values ​​and result judgments of the supplementary new standards; the inspection items refer to the inspection items corresponding to different food categories specified in the "2022 National Food Safety Supervision and Sampling Implementation Rules"; the new standards refer to the "National Food Safety Standard Maximum Residue Limits of Pesticides in Food" (GB 2763-2021), the "National Food Safety Standard Maximum Residue Limits of 112 Pesticides in Food, including 2,4-D Butyrate Sodium Salt" (GB 2763.1-2022) and National Food Safety Standard Limits of Contaminants in Food (GB 2762-2022);

[0011] The standardized data that conforms to the data analysis specifications include sampling number, year, month, date, city where the sampled unit and production unit are located, county where the sampled unit and production unit are located, sampling link, major food category, food subcategory, food sub-subcategory, food subcategory, sample name, inspection items, inspection results, result judgment, result judgment under the new standard, whether detected, conclusion, minimum allowable limit, maximum allowable limit, new standard minimum allowable limit and new standard maximum allowable limit, a total of 23 columns of data.

[0012] Furthermore, step S3 uses statistical theory and artificial intelligence technology to perform big data deep learning modeling on standardized data, and analyzes and obtains four major types of alarm and early warning algorithm models: Class A single item exceeding standard risk alarm model, Class B new project risk alarm model, Class C limited project alarm and early warning model and Class D risk cumulative effect alarm and early warning model.

[0013] Furthermore, the Class A single-item exceeding-standard risk alarm model includes the Class A1 hazardous single-value exceeding-standard alarm model, the Class A2 multiple exceeding-standard alarm model, and the Class A3 new and old standard exceeding-standard difference alarm model:

[0014] The A1-type hazardous substance single value exceeding standard alarm model is to alarm when a certain test item of the sample exceeds the standard:

[0015] Assume that the detection value of a certain inspection item of a food is x, and if it is not detected, let x = 0. At the same time, the minimum and maximum allowable limits of the inspection item under the food category of the food are x and 0 respectively. l and xh If it cannot be detected, let x l =x h =0, if:

[0016] x l >x or x h <x

[0017] Then the A1-type hazardous substance single value exceeding standard alarm information will be output for the inspection item of the food;

[0018] The A2 type multiple exceeding standard alarm model is that if a food inspection item exceeds the standard multiple times in the following years, the alarm information will be output:

[0019] Assign parameter detection coefficient y to all food sub-categories in the tth year t ,

[0020]

[0021] Then, the detection item under the food subcategory is assigned the number of detections y(x) related to the year number x parameter.

[0022]

[0023] For the required number of detections n, if y t (x) ≥ n, it means that the detection item has exceeded the standard more than n times in x years, so the A2 type multiple exceeding standard alarm information is output;

[0024] The A3 type new and old standard exceeding difference alarm model is to alarm when a certain test item of a sample produces a different exceeding result due to the change of the limit standard:

[0025] Assign parameters to all food sub-categories in the tth year to determine whether the new standard has a detection coefficient y. t ′,

[0026]

[0027] Compare t ′ and y t , if y t ′≠y t , it means that the test item has different exceeding standard results under the new and old standards, so the A3 type new and old standard exceeding standard difference alarm information is output.

[0028] Furthermore, the B-type newly added item risk alarm model includes the B1-type newly added detection item alarm model and the B2-type first detected object alarm model:

[0029] The B1 new test item alarm model outputs an alarm message when a new test item that has not been tested appears in the sample:

[0030] Assign parameter z to all food test items under each food category in year t t ,

[0031]

[0032] If z t =1, output B1 alarm information;

[0033] The B2 first-detection alarm model outputs an alarm message when an existing or newly added test item of a sample is detected for the first time:

[0034] If in the above A2 category multiple exceeding standard alarms y t (∞)=lim x→∞ y t (x) = 1 and y t-1 (∞)=lim x→∞ y t-1 If (x)=0, it means that the detected object is detected for the first time in the food subcategory, and a B2 alarm message is output.

[0035] Furthermore, the C-type limited item alarm and early warning model includes the C1-type exceeding standard rate abnormal alarm and early warning model and the C2-type detection rate abnormal alarm and early warning model: the C1-type exceeding standard rate abnormal alarm and early warning model outputs an alarm message when the exceeding standard rate of the sample is outside the control interval; at the same time, the control interval is determined based on the existing historical data and the exceeding standard rate of the sample type and the inspection item in the next year is estimated. If it is outside the control interval, the early warning message is output; the C2-type detection rate abnormal alarm and early warning model outputs an alarm message when the detection rate of the sample is outside the control interval; at the same time, the control interval is determined based on the existing historical data and the detection rate of the sample type and the inspection item in the next year is estimated. If it is outside the control interval, the early warning message is output:

[0036] When performing anomaly detection on time series data, the Grubbs test method is used:

[0037] Let the sample data to be tested be {x 1 ,x 2 ,…,x n}, then the null hypothesis and alternative hypothesis of Grubbs test are:

[0038]

[0039] The algorithm steps of Grubbs test are:

[0040] 1. Standardize data:

[0041]

[0042] 2. Compare the deviation degree of outliers with the Grubbs critical value by looking up the table:

[0043] First, set a detection level α, combine the detection level α with the sample size n, and find the corresponding Grubbs critical value in the table below, denoted as G(α,n); compare the standardized data Z i and G(α,n), if Z i >G(α,n), Grubbs test considers that the corresponding data x i is an outlier, that is, the null hypothesis H 0 Not true;

[0044] n 90.00% 95.00% 97.50% 99.00% 99.50 3 1.148 1.153 1.155 1.155 1.155 4 1.425 1.463 1.481 1.492 1.496 5 1.602 1.672 1.715 1.749 1.764 6 1.729 1.822 1.887 1.944 1.973 7 1.828 1.938 2.020 2.097 2.139 8 1.909 2.032 2.126 2.22 2.274 9 1.977 2.110 2.215 2.323 2.387 10 2.036 2.176 2.290 2.410 2.482 11 2.088 2.234 2.355 2.485 2.564 12 2.134 2.285 2.412 2.550 2.636 13 2.175 2.331 2.462 2.607 2.699 14 2.213 2.371 2.507 2.659 2.755 15 2.247 2.409 2.549 2.705 2.806 16 2.279 2.443 2.585 2.747 2.852 17 2.309 2.475 2.620 2.785 2.894 18 2.335 2.501 2.651 2.821 2.932 19 2.361 2.532 2.681 2.954 2.968 20 2.385 2.557 2.709 2.884 3.001

[0045] Alternatively, when performing anomaly detection on time series data, an IQR-based anomaly detection method is used. The algorithm first obtains the first partition of the data into points Q 1 and the third quantile Q 3 , and then calculate the internal quantile range IQR, and finally according to Q 1 , Q 3 , IQR and the predetermined quantile range multiple β are used to obtain the limit range of reasonable data, and the data points outside the limit range are the detected abnormal data points; the specific algorithm steps are:

[0046] 1. Calculate the first quantile n of the data 1 and the third quantile n 3 :

[0047] Assume the total number of data is n, then

[0048] n 1 =round(0.25×n), (4)

[0049] n 3 =round(0.75×n). (5)

[0050] Among them, round represents the rounding function;

[0051] 2. Calculate the internal quantile range IQR:

[0052] Arrange n data in order from small to large x (1) , x (2) , …, x (n) , get the first quantile n (0.25) and the third quantile n (0.75) After that, the calculation method of the internal quantile range IQR is:

[0053]

[0054] 3. The lower control line LCL and upper control line UCL of normal data:

[0055]

[0056]

[0057] 4. Identify outliers:

[0058] The inner quantile anomaly detection method takes all the anomalies within the limit [LCL β , UCL β ] are called abnormal data points and are set at [LCL 1.5 ,UCL 1.5 Abnormal data outside the range of [LCL 2 ,UCL 2 ] Abnormal data outside the range is a serious abnormality, and different levels of abnormalities will output alarm information marked with different colors.

[0059] Furthermore, the D-type risk cumulative effect alarm and early warning model includes a D1-type risk index abnormal alarm and early warning model and a D2-type risk weight abnormal alarm and early warning model: the D1-type risk index abnormal alarm and early warning model assigns risk weights to each subcategory under a certain food category, uses the cumulative effect of previous years' data to adjust the risk weight of each sample, outputs alarm information based on the ranking of the risk index of all subcategories under the food category, and at the same time determines the warning line based on the existing historical data and estimates the risk index of the subcategory for the next year. If the warning line is exceeded, the early warning information is output; the D2-type weight index abnormal alarm and early warning model assigns risk weights to each subcategory under a certain food category, uses the cumulative effect of previous years' data to adjust the risk weight of each sample, outputs alarm information based on the ranking of the weight index of all subcategories under the food category, and at the same time determines the warning line based on the existing historical data and estimates the weight index of the subcategory for the next year. If the warning line is exceeded, the early warning information is output;

[0060] The D-type risk cumulative effect alarm and early warning model algorithm is based on the statistical analysis model. Suppose a food category S includes N food subcategories S i (i=1,2,...,K), assuming that when S is a food category, S i For each food subcategory, the specific steps of the cumulative effect algorithm are as follows:

[0061] 1) Initialize data:

[0062] Each food subcategory i With initial weight index This index represents the degree to which this category requires special attention; the total number of samples obtained when the food subcategory is first sampled is n i , the number of qualified samples is m i , then the initial safety index is:

[0063]

[0064] 2) Count the latest sample sizes of various data:

[0065] Get Food Subcategory S i The total number of samples at time t is The number of qualified samples is

[0066] 3) Iteratively update the statistics of the new time:

[0067] First, calculate each subclass S i The pass rate of (i=1,2,...,K) for:

[0068]

[0069] Then the weighted pass rate wq of category S t for:

[0070]

[0071] The safety index of category S in the previous year is recorded as a t-1 , then the safety index a in year t is t for:

[0072] a t =c×a t-1 +(1-c)×wq , (3)

[0073] Where c is a pre-set silver retention factor, which is a constant between 0 and 1. The c value represents the degree to which the safety index remains unchanged.

[0074] If category S is not sampled in the current random inspection, its current safety index is equal to its safety index in the previous year, that is:

[0075] a t =a t-1 .

[0076] Risk index of major food categoriesv t for:

[0077] v t =1-a t . (4)

[0078] 4) Update the risk weight index and the new temporary risk weight index for:

[0079]

[0080] This formula means that for food categories with higher risks, more attention needs to be paid to them. In order to ensure that the sum of the risk weight index is 1, the new risk weight is standardized to obtain the final new risk weight index w i t for:

[0081]

[0082] Updated and stored for calculation in the next year;

[0083] 5) The abnormal alarm and early warning model of the risk accumulation index is used to achieve the following three functions:

[0084] ① Vertical abnormal alarm and early warning of cumulative risk index: By analyzing the accumulated risk index over the years and applying the linear regression model to predict the potential risk index v of the food category in the next year t+1 The model uses the risk index of the past few years including the current year as a data set to evaluate the abnormality of the risk index of the current year. If the risk index of this year is v t If a food is identified as an outlier, the system will issue a risk index abnormality alert for the food category. In addition, the risk index forecast value v for the food category in the next year will be t+1 Conduct Grubbs test, and if the test result is abnormal, issue an abnormal risk index warning for the food category;

[0085] ② Alarm for the impact of limit standard value adjustment on risk index and weight index: Set v t The cumulative risk index of a food category calculated according to the old standard is recalculated after the new standard is implemented to obtain a new index V. t , if V t >v t , which indicates that the adjustment of the standard value has increased the risk index of this food category, that is, the risk index of this food category has deteriorated under the new standard, increasing the possibility of abnormal risk index; on the contrary, if V t <v t , it means that the adjustment of the standard value leads to a decrease in the risk index of the food category, that is, the risk index performance of the food category has improved under the new standard, reducing the risk of abnormal risk index;

[0086] ③ Horizontal abnormal alarm of cumulative risk index between different categories at the same level: Analyze each food subcategory S under a specific food category S in a certain year i(i=1,2,...,K), their respective cumulative risk index Perform anomaly detection, and in the detection results, abnormal values ​​will be given different levels of alerts.

[0087] Furthermore, in step S4, the data overview is divided into annual overview, monthly overview and bar chart, regional overview and bar chart, overview of inspected units, overview of inspected production enterprises, overview of major food categories and bar charts, overview of sub-category food and bar charts, overview of sub-sub-category food and bar charts, overview of sub-category food and bar charts, and overview of inspection items.

[0088] Specifically, 1. Annual overview: the total number of samples tested each year, the number of unqualified samples, and the calculation of the unqualified rate.

[0089] 2. Monthly overview and bar chart: The number of samples tested and the number of unqualified samples in each month of this year, calculate the unqualified rate and compare it with previous years, and draw a bar chart of unqualified rate-month for this year.

[0090] 3. Regional overview and bar chart: The number of samples tested and the number of unqualified samples in each region this year, calculate the unqualified rate and compare it with previous years, and draw a bar chart of unqualified rate-region this year.

[0091] 4. Overview of inspected units: The number of samples inspected by different inspection units this year, the number of unqualified samples and the calculated unqualified rate can be used to screen out the minimum number of times exceeding the standard in recent years.

[0092] 5. Overview of the inspected production enterprises: The number of samples inspected by different production enterprises this year, the number of unqualified samples and the calculation of the unqualified rate can be used to screen the minimum number of times exceeding the standard in recent years.

[0093] 6. Overview of major food categories and bar charts: The number of samples tested and the number of unqualified samples in each major food category this year, calculate the unqualified rate and compare it with previous years, and draw a bar chart of this year's unqualified rate-major food category.

[0094] 7. Overview of food subcategories and bar graphs: The number of samples tested and the number of unqualified samples for each food subcategory this year, calculate the unqualified rate and compare it with previous years, and draw a bar graph of unqualified rate-food subcategory for the top ten food subcategories with the highest unqualified rate this year.

[0095] 8. Overview and bar graph of food sub-categories: The number of samples tested and the number of unqualified samples for each food sub-category this year, calculate the unqualified rate and compare it with previous years, and draw a bar graph of unqualified rate-food sub-category for the top ten food sub-categories with the highest unqualified rate this year.

[0096] 9. Overview and bar chart of food subcategories: The number of samples tested and the number of unqualified samples for each food subcategory this year, calculate the unqualified rate and compare it with previous years, and draw a bar chart of unqualified rate-food subcategory for the top ten food subcategories with the highest unqualified rate this year.

[0097] 10. Inspection item overview: the number of random inspections and the number of unqualified items for each inspection item this year, calculate the unqualified rate and compare it with previous years.

[0098] Furthermore, in step S4, the warning information is divided into single-item exceeding-standard risk alarm information, new-item risk alarm information, limited-quantity-item alarm and warning information, and risk cumulative effect alarm and warning information.

[0099] The second aspect of the present application provides a food safety risk early warning system, which includes:

[0100] A data input module, wherein the data input module is used to obtain original data from an external database;

[0101] A data preprocessing module, which is used to screen and clean the original data according to pre-set rules to obtain standardized data that meets data analysis specifications;

[0102] A data analysis module, which is used to perform intelligent analysis on standardized data based on statistical theory and artificial intelligence technology;

[0103] The analysis result output module is used to output the analysis results, which include data overview and warning information.

[0104] Furthermore, the data preprocessing module is used for: (1) data screening: selecting regions, links, and food categories from the original data; (2) data cleaning: first retaining the columns used for classification and calculation in the original data, and then using the hash algorithm to supplement the missing sample number information; unifying the inspection item names and the four-level classification of samples in the original data according to the provisions of the "2022 National Food Safety Supervision Sampling Implementation Rules"; filling in "not detected" or "detected" in the "whether detected" column; adding column contents to supplement the limit values ​​and result judgments of the new standard;

[0105] The standardized data that conforms to the data analysis specifications include sampling number, year, month, date, city where the sampled unit and production unit are located, county where the sampled unit and production unit are located, sampling link, major food category, food subcategory, food sub-subcategory, food subcategory, sample name, inspection items, inspection results, result judgment, result judgment under the new standard, whether detected, conclusion, minimum allowable limit, maximum allowable limit, new standard minimum allowable limit and new standard maximum allowable limit, a total of 23 columns of data.

[0106] Furthermore, the data analysis module is used to perform big data deep learning modeling on standardized data through statistical theory and artificial intelligence technology, and analyze to obtain four major types of alarm and early warning algorithm models: Class A single item exceeding the standard risk alarm model, Class B new project risk alarm model, Class C limited project alarm and early warning model and Class D risk cumulative effect alarm and early warning model.

[0107] Furthermore, the Class A single-item exceeding-standard risk alarm model includes the Class A1 hazardous single-value exceeding-standard alarm model, the Class A2 multiple exceeding-standard alarm model, and the Class A3 new and old standard exceeding-standard difference alarm model:

[0108] The A1-type hazardous substance single value exceeding standard alarm model is to alarm when a certain test item of the sample exceeds the standard:

[0109] Assume that the detection value of a certain inspection item of a food is x, and if it is not detected, let x = 0. At the same time, the minimum and maximum allowable limits of the inspection item under the food category of the food are x and 0 respectively. l and x h If it cannot be detected, let x l =x h =0, if:

[0110] x l >x or x h <x

[0111] Then the A1-type hazardous substance single value exceeding standard alarm information will be output for the inspection item of the food;

[0112] The A2 type multiple exceeding standard alarm model is that if a food inspection item exceeds the standard multiple times in the following years, the alarm information will be output:

[0113] Assign parameter detection coefficient y to all food sub-categories in the tth year t ,

[0114]

[0115] Then, the detection item under the food subcategory is assigned the number of detections y(x) related to the year number x parameter.

[0116]

[0117] For the required number of detections n, if y t (x) ≥ n, it means that the detection item has exceeded the standard more than n times in x years, so the A2 type multiple exceeding standard alarm information is output;

[0118] The A3 type new and old standard exceeding difference alarm model is to alarm when a certain test item of a sample produces a different exceeding result due to the change of the limit standard:

[0119] Assign parameters to all food sub-categories in the tth year to determine whether the new standard has a detection coefficient y. t ′,

[0120]

[0121] Compare t ′ and y t , if y t ′≠y t , it means that the test item has different exceeding standard results under the new and old standards, so the A3 type new and old standard exceeding standard difference alarm information is output.

[0122] Furthermore, the B-type newly added item risk alarm model includes the B1-type newly added detection item alarm model and the B2-type first detected object alarm model:

[0123] The B1 new test item alarm model outputs an alarm message when a new test item that has not been tested appears in the sample:

[0124] Assign parameter z to all food test items under each food category in year t t ,

[0125]

[0126] If z t =1, output B1 alarm information;

[0127] The B2 first-detection alarm model outputs an alarm message when an existing or newly added test item of a sample is detected for the first time:

[0128] If in the above A2 category multiple exceeding standard alarms y t (∞)=lim x→∞ y t (x) = 1 and y t-1 (∞)=lim x→∞ y t-1 If (x)=0, it means that the detected object is detected for the first time in the food subcategory, and a B2 alarm message is output.

[0129] Furthermore, the C-type limited item alarm and early warning model includes the C1-type exceeding standard rate abnormal alarm and early warning model and the C2-type detection rate abnormal alarm and early warning model: the C1-type exceeding standard rate abnormal alarm and early warning model outputs an alarm message when the exceeding standard rate of the sample is outside the control interval; at the same time, the control interval is determined based on the existing historical data and the exceeding standard rate of the sample type and the inspection item in the next year is estimated. If it is outside the control interval, the early warning message is output; the C2-type detection rate abnormal alarm and early warning model outputs an alarm message when the detection rate of the sample is outside the control interval; at the same time, the control interval is determined based on the existing historical data and the detection rate of the sample type and the inspection item in the next year is estimated. If it is outside the control interval, the early warning message is output:

[0130] When performing anomaly detection on time series data, the Grubbs test method is used:

[0131] Let the sample data to be tested be {x 1 , x 2 , ..., x n}, then the null hypothesis and alternative hypothesis of Grubbs test are:

[0132]

[0133] The algorithm steps of Grubbs test are:

[0134] 1. Standardize data:

[0135]

[0136] 2. Compare the deviation degree of outliers with the Grubbs critical value by looking up the table:

[0137] First, set a detection level α, combine the detection level α with the sample size n, and find the corresponding Grubbs critical value in the table below, denoted as G(α, n); compare the standardized data Z i and G(α,n), if Z i >G(α,n), Grubbs test considers that the corresponding data x i is an outlier, that is, the null hypothesis H 0 Not true;

[0138] n 90.00% 95.00% 97.50% 99.00% 99.50 3 1.148 1.153 1.155 1.155 1.155 4 1.425 1.463 1.481 1A92 1.496 5 1.602 1.672 1.715 1.749 1.764 6 1.729 1.822 1.887 1.944 1.973 7 1.828 1.938 2.020 2.097 2.139 8 1.909 2.032 2.126 2.22 2274 9 1.977 2.110 2215 2.323 2.387 10 2.036 2.176 2.290 2.410 2.482 11 2.088 2.234 2.355 2.485 2.564 12 2.134 2.285 2.412 2.550 2.636 13 2.175 2.331 2.462 2.607 2.699 14 2.213 2.371 2.507 2.659 2.755 15 2.247 2.409 2.549 2.705 2.806 16 2.279 2.443 2.585 2.747 2.852 17 2.309 2.475 2.620 2.785 2.894 18 2.335 2.501 2.651 2.821 2.932 19 2.361 2.532 2.681 2.954 2.968 20 2.385 2.557 2.709 2.884 3.001

[0139] Alternatively, when performing anomaly detection on time series data, an IQR-based anomaly detection method is used. The algorithm first obtains the first partition of the data into points Q 1 and the third quantile Q 3 , and then calculate the internal quantile range IQR, and finally according to Q 1 ,Q 3, IQR and the predetermined quantile range multiple β are used to obtain the limit range of reasonable data. The data points outside the limit range are the detected abnormal data points. The specific algorithm steps are as follows:

[0140] 1. Calculate the first quantile n of the data 1 and the third quantile n 3 :

[0141] Assume the total number of data is n, then

[0142] n 1 =round(0.25×n), (4)

[0143] n 3 =round(0.75×n). (5)

[0144] Among them, round represents the rounding function;

[0145] 2. Calculate the internal quantile range IQR:

[0146] Arrange n data in order from small to large x (1) ,x (2) ,…,x (n) , get the first quantile n (0.25) and the third quantile n (0.75) After that, the calculation method of the internal quantile range IQR is:

[0147]

[0148] 3. The lower control line LCL and upper control line UCL of normal data:

[0149]

[0150] 4. Identify outliers:

[0151] The inner quantile anomaly detection method takes all the anomalies within the limit [LCL β ,UCL β ] are called abnormal data points and are set at [LCL 1.5 ,UCL 1.5 Abnormal data outside the range of [LCL 2 ,UCL 2 ] Abnormal data outside the range is a serious abnormality, and different levels of abnormalities will output alarm information marked with different colors.

[0152] Furthermore, the D-type risk cumulative effect alarm and early warning model includes a D1-type risk index abnormal alarm and early warning model and a D2-type risk weight abnormal alarm and early warning model: the D1-type risk index abnormal alarm and early warning model assigns risk weights to each subcategory under a certain food category, uses the cumulative effect of previous years' data to adjust the risk weight of each sample, outputs alarm information based on the ranking of the risk index of all subcategories under the food category, and at the same time determines the warning line based on the existing historical data and estimates the risk index of the subcategory for the next year. If the warning line is exceeded, the early warning information is output; the D2-type weight index abnormal alarm and early warning model assigns risk weights to each subcategory under a certain food category, uses the cumulative effect of previous years' data to adjust the risk weight of each sample, outputs alarm information based on the ranking of the weight index of all subcategories under the food category, and at the same time determines the warning line based on the existing historical data and estimates the weight index of the subcategory for the next year. If the warning line is exceeded, the early warning information is output;

[0153] The D-type risk cumulative effect alarm and early warning model algorithm is based on the statistical analysis model. Suppose a food category S includes N food subcategories S i (i=1,2,...,K), assuming that when S is a food category, S i For each food subcategory, the specific steps of the cumulative effect algorithm are as follows:

[0154] 1) Initialize data:

[0155] Each food subcategory i With initial weight index This index represents the degree to which this category requires special attention; the total number of samples obtained when the food subcategory is first sampled is n i , the number of qualified samples is m i , then the initial safety index is:

[0156]

[0157] 2) Count the latest sample sizes of various data:

[0158] Get Food Subcategory S i The total number of samples at time t is The number of qualified samples is

[0159] 3) Iteratively update the statistics of the new time:

[0160] First, calculate each subclass S i The pass rate of (i=1,2,...,K) for:

[0161]

[0162] Then the weighted pass rate wq of category S t for:

[0163]

[0164] The safety index of category S in the previous year is recorded as a t-1 , then the safety index a in year t is t for:

[0165] a t =c×a t-1 +(1-c)×wq, (3)

[0166] Where c is a pre-set silver retention factor, which is a constant between 0 and 1. The c value represents the degree to which the safety index remains unchanged.

[0167] If category S is not sampled in the current random inspection, its current safety index is equal to its safety index in the previous year, that is:

[0168] a t =a t-1 .

[0169] Risk index of major food categoriesv t for:

[0170] v t =1-a t . (4)

[0171] 4) Update the risk weight index and the new temporary risk weight index for:

[0172]

[0173] This formula means that for food categories with higher risks, more attention needs to be paid to them. In order to ensure that the sum of the risk weight index is 1, the new risk weight is standardized to obtain the final new risk weight index w i t for:

[0174]

[0175] Updated and stored for next year's calculation;

[0176] 5) The abnormal alarm and early warning model of the risk accumulation index is used to achieve the following three functions:

[0177] ① Vertical abnormal alarm and early warning of cumulative risk index: By analyzing the accumulated risk index over the years and applying the linear regression model to predict the potential risk index v of the food category in the next year t+1The model uses the risk index of the past few years including the current year as a data set to evaluate the abnormality of the risk index of the current year. If the risk index of this year is v t If a food is identified as an outlier, the system will issue a risk index abnormality alert for the food category. In addition, the risk index forecast value v for the food category in the next year will be t+1 Conduct Grubbs test, and if the test result is abnormal, issue an abnormal risk index warning for the food category;

[0178] ② Alarm for the impact of limit standard value adjustment on risk index and weight index: Set v t The cumulative risk index of a food category calculated according to the old standard is recalculated after the new standard is implemented to obtain a new index V. t , if V t >v t , which indicates that the adjustment of the standard value has increased the risk index of this food category, that is, the risk index of this food category has deteriorated under the new standard, increasing the possibility of abnormal risk index; on the contrary, if V t <v t , it means that the adjustment of the standard value leads to a decrease in the risk index of the food category, that is, the risk index performance of the food category has improved under the new standard, reducing the risk of abnormal risk index;

[0179] ③ Horizontal abnormal alarm of cumulative risk index between different categories at the same level: Analyze each food subcategory S under a specific food category S in a certain year i (i=1,2,...,K), for their respective cumulative risk index v i t Perform anomaly detection, and in the detection results, abnormal values ​​will be given different levels of alerts.

[0180] Furthermore, the data overview is divided into annual overview, monthly overview and bar chart, regional overview and bar chart, overview of inspected units, overview of inspected production enterprises, overview of major food categories and bar charts, overview of sub-category food and bar charts, overview of sub-sub-category food and bar charts, overview of sub-category food and bar charts, and overview of inspection items.

[0181] Specifically, 1. Annual overview: the total number of samples tested each year, the number of unqualified samples, and the calculation of the unqualified rate.

[0182] 2. Monthly overview and bar chart: The number of samples tested and the number of unqualified samples in each month of this year, calculate the unqualified rate and compare it with previous years, and draw a bar chart of unqualified rate-month for this year.

[0183] 3. Regional overview and bar chart: The number of samples tested and the number of unqualified samples in each region this year, calculate the unqualified rate and compare it with previous years, and draw a bar chart of unqualified rate-region this year.

[0184] 4. Overview of inspected units: The number of samples inspected by different inspection units this year, the number of unqualified samples and the calculated unqualified rate can be used to screen out the minimum number of times exceeding the standard in recent years.

[0185] 5. Overview of the inspected production enterprises: The number of samples inspected by different production enterprises this year, the number of unqualified samples and the calculation of the unqualified rate can be used to screen the minimum number of times exceeding the standard in recent years.

[0186] 6. Overview of major food categories and bar charts: The number of samples tested and the number of unqualified samples in each major food category this year, calculate the unqualified rate and compare it with previous years, and draw a bar chart of this year's unqualified rate-major food category.

[0187] 7. Overview of food subcategories and bar graphs: The number of samples tested and the number of unqualified samples for each food subcategory this year, calculate the unqualified rate and compare it with previous years, and draw a bar graph of unqualified rate-food subcategory for the top ten food subcategories with the highest unqualified rate this year.

[0188] 8. Overview and bar graph of food sub-categories: The number of samples tested and the number of unqualified samples for each food sub-category this year, calculate the unqualified rate and compare it with previous years, and draw a bar graph of unqualified rate-food sub-category for the top ten food sub-categories with the highest unqualified rate this year.

[0189] 9. Overview and bar chart of food subcategories: The number of samples tested and the number of unqualified samples for each food subcategory this year, calculate the unqualified rate and compare it with previous years, and draw a bar chart of unqualified rate-food subcategory for the top ten food subcategories with the highest unqualified rate this year.

[0190] 10. Inspection item overview: the number of random inspections and the number of unqualified items for each inspection item this year, calculate the unqualified rate and compare it with previous years.

[0191] Furthermore, the warning information output by the analysis result output module is divided into single-item exceeding-standard risk alarm information, new-item risk alarm information, limited-quantity-item alarm and warning information, and risk cumulative effect alarm and warning information.

[0192] The food safety risk early warning system in this application provides intelligent, precise and intuitive macro quantitative monitoring means for relevant management departments. After adopting the above technical solution, compared with the existing technology, it has the following beneficial effects:

[0193] 1. The cumulative effect algorithm model is adopted to construct the cumulative effect index, which avoids the problem of reduced algorithm sensitivity and accuracy caused by extreme data imbalance (scarce abnormal data).

[0194] 2. The statistical anomaly detection algorithm is used to eliminate the risk of errors caused by human intervention.

[0195] 3. A comprehensive and in-depth statistical overview of the data was conducted from multiple dimensions and angles, achieving data visualization.

[0196] 4. The early warning system focuses on risk points, reduces tedious manual data analysis, improves personnel work efficiency, easily digitizes, reduces management costs, and improves economic benefits.

[0197] 5. By establishing a food safety risk early warning system, we can provide effective monitoring means for relevant management departments, grasp the food safety situation at a macro level, and provide a scientific basis for government management decisions.

[0198] 6. The present invention is based on statistical theory and artificial intelligence technology. By establishing a food safety risk early warning system, the government regulatory authorities can upgrade their analysis of food safety issues from qualitative to quantitative analysis, provide scientific decision-making tools for food safety regulatory authorities, and easily digitize tedious manual data analysis, thereby assisting in the digital transformation of food safety supervision, improving regulatory capabilities, achieving leapfrog development in regulatory methods, reducing the incidence of food safety accidents, and protecting the people's "food safety".

[0199] 7. The detection of abnormal data is very important for food safety risk warning. Among the various abnormal data detection methods, different methods have different abnormal standards and their corresponding advantages and disadvantages. The present invention proposes an abnormality detection method based on the Grubbs test method and the IQR. These two methods respectively perform abnormality detection and analysis on food safety data from the time dimension (vertical) and the category dimension (horizontal), and have very good effects on abnormal detection of different types of food safety data. This method can perform a comprehensive statistical analysis on the abnormal detection results of food safety monitoring data, thereby realizing graded safety warnings for abnormal foods. Using a statistical anomaly detection algorithm, abnormal information is completely mined from the data, and the idea of ​​big data decision-making based on data and letting data speak is fully realized, eliminating the risk of errors caused by human intervention.

[0200] 8. In food safety risk warning, since food safety risk is a result of long-term accumulation, only analyzing the data of a specific year is often not enough to comprehensively determine the risks of a certain food category. Therefore, it is very necessary to conduct a comprehensive analysis of various indicators of food safety data in combination with historical data. Since the abnormal data of food safety monitoring are sparsely distributed, the algorithm using general weighted historical data information will have a large error, so it is necessary to establish a set of quantitative indicators that can make full use of historical data information and conduct comprehensive analysis. The present invention adopts cumulative effect indicators, including cumulative risk index, cumulative weight index and weighted qualified rate. These indexes are based on the cumulative calculation of historical data. It is well realized that the food safety data is analyzed in depth from multiple dimensions from different aspects such as time and classification, which can comprehensively reflect the long-term accumulated safety status of various types of food. At the same time, the concept of cumulative index avoids the influence of sparse abnormal data on the results to the greatest extent. The alarm map is divided into serious alarm, ordinary alarm and normal state according to the size of the food safety cumulative risk index and the possible harm, which are represented by red, yellow and white respectively, and intuitively remind the regulatory authorities to pay attention. BRIEF DESCRIPTION OF THE DRAWINGS

[0201] Figure 1 The flowchart of the food safety risk early warning method in this application.

[0202] Figure 2 This is the classification of the warning types in this application.

[0203] Figure 3 This is an example of a partial cumulative index alarm map.

[0204] Figure 4 This is a module structure diagram of the food safety risk early warning system in this application.

[0205] Figure 5 This is a partial example of the user interface of a city’s food safety risk warning software. DETAILED DESCRIPTION

[0206] The advantages of the present invention are further described below in conjunction with the accompanying drawings and specific embodiments. Those skilled in the art should understand that the following specific description is illustrative rather than restrictive, and should not be used to limit the scope of protection of the present invention.

[0207] Example 1

[0208] like Figure 1 As shown, this embodiment provides a food safety risk early warning method, which includes steps S1 to S4:

[0209] Step S1: Data input: Obtain original data from an external database.

[0210] Obtain raw data from an external target database. Specifically, the test result data of each laboratory is reported to this system. For example, the sorted data is imported using an EXCEL table. For example, based on some external food safety inspection data sharing platforms, various types of food sampling data (supervision sampling, evaluation sampling, risk monitoring) and food safety public opinion data at all levels (national, provincial, municipal, district and county levels) in a certain city in recent years are collected to deeply mine the large amount of food safety information contained in the data.

[0211] Step S2: Data preprocessing: Screen and clean the original data according to pre-set rules to obtain standardized data (i.e., target data) that meets data analysis specifications.

[0212] Regarding data preprocessing, since the types of raw sampling data entering the database are diverse and the standards are complicated, a lot of manual work is needed to standardize them. Overall, there is still a lack of data analysis and mining. Therefore, in order to further estimate the overall situation and risks of food safety based on these sampling data, it is necessary to summarize and organize the raw sampling data. In addition, due to the lack of standardization in the manual statistics and sorting process, we must first supplement and organize the data such as the number code. For this, we choose to use hash functions to supplement the numbering and generate corresponding data to test whether the results of the algorithm are reasonable.

[0213] Items closely related to food safety early warning, such as food categories, test items, test quantity, detected quantity, exceeded quantity, detection rate, exceeded rate, etc., need to be analyzed. At the same time, in the actual analysis process, we found that due to the sparseness of abnormal data in food safety sampling data, the use of conventional linear fitting and other methods to process data will cause the algorithm's detection sensitivity to drop sharply.

[0214] The raw data collected from the sampling inspection information system is screened and cleaned according to pre-set rules to meet the requirements of data analysis standardization.

[0215] (1) Data screening

[0216] Filter out the column contents that meet the input requirements of the early warning system from the original data table. For example, select regions, links, and food categories.

[0217] (2) Data cleaning

[0218] 2.1 Sample number

[0219] If the sample number is missing in the original data, the hash algorithm is used to supplement the missing sample inspection number and other information. In the data supplement, we initially used the hash algorithm to supplement the missing sample inspection number and other information, but there was a large supplement deviation problem for products in the edible agricultural products category. Later, for this problem, we first cleaned the data, retained the columns used for classification and calculation in the original data, and then supplemented the data, which improved the accuracy of the supplement number.

[0220] 2.2 Inspection Items

[0221] The problem of inconsistent names of inspection items in the original data will be unified in accordance with the provisions of the "2022 Edition of the National Food Safety Supervision and Sampling Implementation Rules".

[0222] 2.3 Four-level classification of samples

[0223] The four-level classification of samples should be unified in accordance with the provisions of the "2022 Edition of the National Food Safety Supervision and Sampling Implementation Rules".

[0224] 2.4 Fill in the "Whether Checked Out" column

[0225] In the "Whether Detected" column, fill in "Not Detected" or "Detected".

[0226] If the test result is not detected, or less than the lower limit of the detection method, fill in "not detected". Otherwise, fill in "detected".

[0227] 2.5 Add new standard limit values ​​and result determination columns

[0228] Due to the changes in the limit values ​​of the new and old standards, the column contents of the limit values ​​and result judgments of the new standards are added to supplement them.

[0229] On the basis of risk index and weight index, due to the change of limit values ​​between the old and new standards, we have added alarms on the impact of limit value standard changes on these indexes, and actively output situations where the change of limit value standards has a greater impact, so as to facilitate data analysts to conduct further analysis.

[0230] For example, the target data that meets the data analysis specifications include sampling number, year, month, date, city where the sampled unit or production unit is located, county where the sampled unit or production unit is located, sampling link, major food category, food subcategory, food sub-subcategory, food subcategory, sample name, inspection items, inspection results, result judgment, result judgment under the new standard, whether detected, conclusion, minimum allowable limit, maximum allowable limit, new standard minimum allowable limit and new standard maximum allowable limit, a total of 23 columns of data.

[0231] The old standard for the limit value refers to the "National Food Safety Standard for Limits of Contaminants in Food" (GB 2762-2017). The "new standard" refers to the new national standards "National Food Safety Standard for Maximum Residue Limits of Pesticides in Food" (GB 2763-2021), "National Food Safety Standard for Maximum Residue Limits of 112 Pesticides including 2,4-D Butyrate Sodium Salt in Food" (GB 2763.1-2022) and "National Food Safety Standard for Limits of Contaminants in Food" (GB 2762-2022), which will be implemented on September 3, 2021, May 11, 2023 and June 30, 2023 respectively. Since the tightening and relaxation of the limit values ​​of the new and old versions of the standards will cause changes in the result judgment and affect the sampling work, some indicators will prompt the limit difference alarm. For example, if the limit value is relaxed, the unqualified rate will show a downward trend and the risk will decrease, and vice versa.

[0232] Step S3: Data analysis: Conduct early warning analysis on standardized data based on statistical theory and artificial intelligence technology.

[0233] Based on the types of food safety risks, through statistical theory and artificial intelligence technology, big data deep learning modeling is carried out on standardized data, four major categories of model algorithms are constructed, and an objective dynamic food safety risk early warning system is established that relies on data and lets the data speak, discovers and focuses on existing problems, and proposes early warning plans.

[0234] Through statistical theory and artificial intelligence technology, the detection data is modeled by deep learning of big data, such as Figure 2 As shown, the analysis results in four major alarm and warning models: (1) Category A single-item exceeding-standard risk alarm model: including the alarm model for a single value exceeding the standard of a hazardous substance (A1), the alarm model for multiple exceeding-standards (A2), and the alarm model for the difference between the old and new standards exceeding the standard (A3); (2) Category B new item risk alarm model: including the alarm model for a new detection item (B1) and the alarm model for the first detection of an object grid (B2); (3) Category C limited-quantity item alarm and warning model: including the alarm and warning model for abnormal exceeding-standard rate (C1) and the alarm and warning model for abnormal detection rate (C2); (4) Category D risk cumulative effect alarm and warning model: including the alarm and warning model for abnormal risk index (D1) and the alarm and warning model for abnormal risk weight (D2). The working principles of the four major model algorithms are as follows:

[0235] 1. Class A single item exceeding standard risk alarm model

[0236] (1) Alarm model for single value exceeding the standard for Class A1 hazardous substances: an alarm is triggered when a certain test item of a sample exceeds the standard.

[0237] Assume that the detection value of a certain test item of a food is x (if it is not detected, x=0), and the minimum and maximum allowable limits of the test item under the food category of the food are x and l and x h (If it is not detected, then let x l =x h =0), if:

[0238] x l >x or x h <x

[0239] Then an A1 alarm will be output for this type of detection item of the food.

[0240] (2) Class A2 multiple-exceeding-standard alarm model: If a food inspection item exceeds the standard multiple times in a certain year, an alarm will be output.

[0241] Assign parameter detection coefficient y to all food sub-categories in the tth year t ,

[0242]

[0243] Then, the detection item under the food subcategory is assigned the number of detections y(x) related to the year number x parameter.

[0244]

[0245] For the required number of detections n, if y t (x)≥n, it means that the detection item has exceeded the standard more than n times within x years, so the A2 alarm is output.

[0246] (3) Category A3 alarm model for the difference between the old and new standards: Since the limit standards may change in the new year, the data of the same year may show different exceeding results under the new and old standards. When a certain test item of a sample produces a different exceeding result due to the change of the limit standard, an alarm will be issued.

[0247] Assign parameters to all food sub-categories in the tth year to determine whether the new standard has a detection coefficient y. t ′,

[0248]

[0249] Compare t ′ and y in (2) t , if y t ′≠y t , it means that the test item has different exceeding standard results under the new and old standards, so the A3 class alarm is output.

[0250] 2. Risk Alarm Model for New Category B Projects

[0251] (4) Category B1 new inspection item alarm model: When new inspection items that have not been inspected appear in the sample, an alarm is output.

[0252] Assign parameter z to all food test items under each food category in year t t ,

[0253]

[0254] If z t =1, output Class B1 alarm.

[0255] (5) Class B2 first-detection object alarm model: When an existing or newly added test item of a sample is detected for the first time, an alarm is output.

[0256] If in the above A2 category multiple exceeding standard alarms y t (∞)=lim x→∞ y t (x) = 1 and y t-1 (∞)=lim x→∞ y t-1 If (x)=0, it means that the detected object is detected for the first time in this food category, and a Class B2 alarm is output.

[0257] 3. Alarm and early warning model for Class C limited items

[0258] (6) Class C abnormal alarm and early warning model for the excess rate (or detection rate): Under normal circumstances, the excess rate (or detection rate) of a certain inspection item in a specific food always fluctuates within a certain range, and fluctuations within the statistical distribution range are normal. If the excess rate (or detection rate) of the sample is outside the control range, an alarm is output; at the same time, the control range is determined based on the existing historical data and the excess rate of the sample type and inspection item in the next year is estimated. If it is outside the control range, an early warning is output.

[0259] The C-type model algorithm uses an anomaly detection method based on the improved Grubbs test method and an anomaly detection method based on the IQR statistic to mine abnormal information from the data, let the data speak for itself, and eliminate the risk of error caused by human intervention. These two methods perform anomaly detection and analysis on food safety data from the time dimension (vertical) and the category dimension (horizontal). In the longitudinal anomaly data detection and analysis based on historical data, we use the Grubbs test, and in the horizontal anomaly data detection and analysis based on historical data, we use the IQR anomaly detection method. It has a very good effect on anomaly detection of different types of food safety data, and can provide graded safety warnings for abnormal foods.

[0260] (6.1) Data anomaly detection method based on Grubbs test

[0261] When performing anomaly detection on time series data, we can use the Grubbs test method. The Grubbs test is a statistical anomaly detection method that is built on the framework of hypothesis testing and is generally used for a single outlier in a univariate data set under a normal distribution. The outlier may be the maximum or minimum value in the data set. Let the sample data to be tested be {x 1 ,x 2 ,…,x n}, then the null hypothesis and alternative hypothesis of Grubbs test are:

[0262]

[0263] The algorithm steps for Grubbs test are:

[0264] 1. Standardize the data.

[0265]

[0266] 2. Look up the table to compare the degree of deviation of the outliers with the Grubbs critical value.

[0267] First, we need to set a detection level α. The higher the detection level, the higher the tolerance for outliers. It is generally set to 95%. Combining the detection level α with the sample size n, we can find the corresponding Grubbs critical value in Table 1, which we record as G(α, n). Compare the standardized data Z i and G(α,n), if Z i >G(α,n), Grubbs test considers that the corresponding data x i is an outlier, that is, the null hypothesis H 0 Not true.

[0268] Table 1 Grubbs critical value

[0269] n 90.00% 95.00% 97.50% 99.00% 99.50 3 1.148 1.153 1.155 1.155 1.155 4 1.425 1.463 1.481 1.492 1.496 5 1.602 1.672 1.715 1.749 1.764 6 1.729 1.822 1.887 1.944 1.973 7 1.828 1.938 2.020 2.097 2.139 8 1.909 2.032 2.126 2.22 2.274 9 1.977 2.110 2.215 2.323 2.387 10 2.036 2.176 2.290 2.410 2.482 11 2.088 2.234 2.355 2.485 2.564 12 2.134 2.285 2.412 2.550 2.636 13 2.175 2.331 2.462 2.607 2.699 14 2.213 2.371 2.507 2.659 2.755 15 2.247 2.409 2.549 2.705 2.806 16 2.279 2.443 2.585 2.747 2.852 17 2.309 2.475 2.620 2.785 2.894 18 2.335 2.501 2.651 2.821 2.932 19 2.361 2.532 2.681 2.954 2.968 20 2.385 2.557 2.709 2.884 3.001

[0270] (6.2) IQR-based anomaly detection method

[0271] When performing anomaly detection on time series data, we can also use an anomaly detection method based on IQR.

[0272] IQR anomaly detection method, full name interquartile range anomaly detection method, is a statistical method that relies on the distribution characteristics of data and uses quantiles and interquartile range (IQR) to find anomalies. The algorithm first obtains the first point Q of the data. 1 and the third quantile Q3 , and then calculate the internal quantile range (IQR), and finally according to Q 1 ,Q 3 , IQR and the predetermined quantile range multiple β are used to obtain the limit range of reasonable data. Data points outside the limit range are detected as abnormal data points. The specific algorithm steps are:

[0273] 1. Calculate the first quantile n of the data 1 and the third quantile n 3 .

[0274] Assume the total number of data is n, then

[0275] n 1 =round(0.25×n), (4)

[0276] n 3 =round(0.75×n). (5)

[0277] Among them, round represents the rounding function.

[0278] 2. Calculate the internal quantile range (IQR).

[0279] Arrange n data in order from small to large x (1) ,x (2) ,…,x (n) , get the first quantile n (0.25) and the third quantile n (0.75) After that, the calculation method of the internal quantile range IQR is

[0280]

[0281] 3. The lower control line LCL and upper control line UCL of normal data:

[0282]

[0283]

[0284] 4. Identify outliers.

[0285] The inner quantile anomaly detection method takes all the anomalies within the limit [LCL β ,UCL β ] are called abnormal data points. In practical applications, we set [LCL 1.5 ,UCL 1.5 ] Abnormal data outside the range is a general abnormality, which needs to trigger a yellow alarm; in [LCL 2 ,UCL 2 ] Abnormal data outside the range is a serious abnormality and a red alarm needs to be triggered.

[0286] C1 type exceedance rate abnormal alarm and early warning model: output alarm when the exceedance rate of the sample is outside the control range; at the same time, determine the control range based on the existing historical data and estimate the exceedance rate of this sample type and this inspection item in the next year. If it is outside the control range, output early warning.

[0287] C2 type detection rate abnormal alarm and early warning model: when the detection rate of the sample is outside the control range, an alarm is output; at the same time, the control range is determined based on the existing historical data and the detection rate of this sample type and this inspection item in the next year is estimated. If it is outside the control range, an early warning is output.

[0288] 4. Class D risk cumulative effect alarm and early warning model

[0289] (7) Class D risk (or weight) index abnormal alarm and early warning model: In order to solve the problem of sparse abnormal data in the detection data, a set of cumulative effect indicators is proposed, including cumulative risk index, cumulative weight index and weighted qualified rate. These indexes are based on the cumulative calculation of historical data and can comprehensively reflect the long-term cumulative safety status of various types of food. At the same time, the concept of cumulative index avoids the impact of sparse abnormal data and random fluctuations to the greatest extent. Impact on the results. Risk weights are assigned to each subcategory under a certain food category, and the risk weights of each sample are adjusted using the cumulative effect of data from previous years. The risk index of all subcategories under the food category is ranked and an alarm is output. At the same time, the warning line is determined based on the existing historical data and the risk index of the subcategory in the next year is estimated. If the warning line is exceeded, an early warning is output.

[0290] D1 risk index abnormal alarm and early warning model: assign risk weights to each subcategory under a certain food category, use the cumulative effect of previous years' data to adjust the risk weight of each sample, output an alarm based on the ranking of the risk index of all subcategories under the food category, and determine the warning line based on the existing historical data and estimate the risk index of the subcategory in the next year. If the warning line is exceeded, an early warning will be output.

[0291] D2 weight index abnormal alarm and early warning model: assign risk weights to each subcategory under a certain food category, use the cumulative effect of previous years' data to adjust the risk weight of each sample, output an alarm based on the ranking of the weight index of all subcategories under the food category, and determine the warning line based on the existing historical data and estimate the weight index of the subcategory in the next year. If the warning line is exceeded, an early warning will be output.

[0292] In the process of detecting Class D risks, we propose an alarm and early warning model algorithm for cumulative effects. This algorithm is based on a statistical analysis model and aims to solve two main problems: first, to reduce the problem of reduced detection sensitivity caused by the sparsity of abnormal data; second, to eliminate the impact of random fluctuations in the data on the analysis results. We assume that a certain food category S includes N food subcategories S i(i=1,2,...,K), for example, when S is a food category, S i For each food subcategory. The specific steps of the cumulative effect algorithm are as follows:

[0293] 1) Initialize data

[0294] Each food subcategory i With initial weight index The index represents the degree to which this category needs special attention. The total number of samples for the first random inspection of the food subcategory is n i , the number of qualified samples is m i , then the initial safety index (safety rate) is

[0295]

[0296] 2) Count the latest sample sizes of various data

[0297] Get Food Subcategory S i The total number of samples at time t is The number of qualified samples is

[0298] 3) Iteratively update the statistics of the new time

[0299] First, calculate each subclass S i The pass rate of (i=1,2,...,K) for:

[0300]

[0301] Then the weighted pass rate wq of category S t for:

[0302]

[0303] The safety index (safety rate) of the category S in the previous year is recorded as a t-1 , then the safety index a in year t is t for:

[0304] a t =c×a t-1 +(1-c)×wq, (3)

[0305] Where c is a pre-set silver retention factor, which is a constant between 0 and 1. The c value represents the degree to which the safety index remains unchanged. The closer it is to 0, the more it tends to be affected by the latest year's data, that is, the safety index is less affected by history. Since the sampling data in this article only covers 3 years (2020-2022) and the historical data only covers 2 years (2020-2021), considering that the data will fluctuate greatly from year to year, c=0.9 is taken in this article to reduce the interference caused by fluctuations in historical information.

[0306] If category S is not sampled in the current random inspection, its current safety index is equal to its safety index in the previous year, that is:

[0307] a t =a t-1 .

[0308] Risk index (risk rate) of major food categories v t for:

[0309] v t =1-a t . (4)

[0310] 4) Update the risk weight index and the new temporary risk weight index for:

[0311]

[0312] This formula means that we need to pay more attention to food categories with higher risks. In order to ensure that the sum of the risk weight index is 1, the new risk weight is standardized to obtain the final new risk weight index. for:

[0313]

[0314] Updated and stored for calculation in the next year. Each cumulative index transmits historical data information by cumulative calculation year by year.

[0315] 5) The abnormal alarm and early warning mechanism of the risk accumulation index covers the following aspects: first, the vertical abnormal alarm and early warning of the risk accumulation index; second, the alarm for adjusting the limit standard value of the risk index and weight index; and finally, the horizontal abnormal alarm of the risk accumulation index of products of the same category.

[0316] ① Vertical abnormal alarm and early warning of cumulative risk index: By analyzing the accumulated risk index over the years and applying the linear regression model to predict the potential risk index v of the food category in the next year t+1The model uses the risk index of the past few years including the current year as a data set to evaluate the abnormality of the risk index of the current year. t If a food is identified as an outlier, the system will issue an abnormal risk index alert for the food category. In addition, the predicted risk index value v for the food category in the next year is t+1 Conduct a Grubbs test, and if the test result is abnormal, output an abnormal risk index warning for the food category.

[0317] ② Alarm for the impact of limit standard value adjustment on risk index and weight index: Set v t The cumulative risk index of a food category calculated according to the old standard. After the new standard is implemented, we recalculate the cumulative risk index of the food category and get a new index V t , if V t >v t , which indicates that the adjustment of the standard value has increased the risk index of this food category, that is, the risk index of this food category has deteriorated under the new standard, increasing the possibility of abnormal risk index; on the contrary, if V t <v t , it means that the adjustment of the standard value has led to a decrease in the risk index of this food category, that is, the risk index performance of this food category has improved under the new standard, reducing the risk of abnormal risk index.

[0318] ③ Horizontal abnormal alarm of cumulative risk index between different categories at the same level: Analyze each food subcategory S under a specific food category S in a certain year i (i=1,2,...,K), their respective cumulative risk index Perform anomaly detection. In the detection results, outliers are assigned different levels of alerts, with red alerts used to mark the top 5% of anomaly data and yellow alerts used to mark the top 10% of anomaly data.

[0319] The alarm map is divided into serious alarms, ordinary alarms and normal conditions according to the size of the cumulative risk index and the possible harm caused. They are represented by red, yellow and white respectively, to intuitively remind regulatory authorities to pay attention. Figure 3 A portion of the cumulative index alarm map is shown.

[0320] Step S4: Output analysis results, which include data overview and warning information.

[0321] (1) Data Overview

[0322] The data overview is divided into annual overview, monthly overview and bar chart, regional overview and bar chart, overview of sampled units, overview of sampled production enterprises, overview of major food categories and bar charts, overview of sub-category food and bar charts, overview of sub-sub-category food and bar charts, overview of sub-category food and bar charts, and overview of inspection items. The results are presented in a combination of tables and images.

[0323] (2) Warning type

[0324] Through statistical theory and artificial intelligence technology, the detection data is modeled by deep learning of big data, and the output warning information is divided into single-item exceeding risk alarm information (category A), new item risk alarm information (category B), limited item alarm and warning information (category C), and risk cumulative effect alarm and warning information (category D). 1) Category A single-item exceeding risk alarm information includes: single value exceeding alarm (A1) information of hazardous substances, multiple exceeding alarm (A2) information, and new and old standard exceeding difference alarm (A3) information; 2) Category B new item risk alarm information includes: new detection item alarm (B1) information, first detection object grid alarm (B2) information; 3) Category C limited item alarm and warning information includes: exceeding rate abnormal alarm and warning (C1) information, detection rate abnormal alarm and warning (C2) information; 4) Category D risk cumulative effect alarm and warning information includes: risk index abnormal alarm and warning (D1) information, risk weight abnormal alarm and warning (D2) information. Among them, categories A and B only contain alarm information, while categories C and D contain both alarm information and warning information.

[0325] Preferably, the data overview and warning information are integrated into a risk warning report.

[0326] Example 2

[0327] like Figure 4 As shown, this embodiment provides a food safety risk early warning system, which includes: a data input module, a data preprocessing module, a data analysis module, and an analysis result output module.

[0328] The data input module is used to obtain original data from an external database; specifically, the data input module is used to execute step S1 in Example 1, which will not be repeated here for the sake of brevity.

[0329] The data preprocessing module is used to screen and clean the original data according to pre-set rules to obtain standardized data that meets the data analysis specifications; specifically, the data preprocessing module is used to execute step S2 in Example 1, which will not be repeated here for the sake of brevity.

[0330] The data analysis module is used to perform intelligent analysis on standardized data based on statistical theory and artificial intelligence technology; specifically, the data analysis module is used to execute step S3 in Example 1, which will not be repeated here for the sake of brevity.

[0331] The analysis result output module is used to output the analysis result, which includes a data overview and warning information. Specifically, the analysis result output module is used to execute step S4 in Example 1, which will not be repeated here for the sake of brevity.

[0332] Preferably, the food safety risk early warning system further includes a local database, which is used to store original data, standardized data and analysis results.

[0333] For example, the above-mentioned food safety risk early warning system is designed and written as a visual micro APP software, such as a visual shiny APP software, which has a visual, dynamic, and spatiotemporal food safety risk early warning analysis, provides a scientific decision-making basis for food regulatory departments, and realizes scientific prevention and control of food safety risks, which has a good application prospect. The module has high cohesion and low coupling, and the developed system has higher independence, so that the system is easy to maintain and has good scalability. The APP page is simple, and then by directly uploading the standardized data table, you can directly get the analysis result data table.

[0334] An example of the user interface of the APP warning software is as follows: Figure 5 As shown, the software has 4 major functional modules:

[0335] (1) Data input: The sorted data is imported using an EXCEL table.

[0336] (2) Screening: Screening is performed based on regions, links (e.g., catering links, circulation links, and production links), food categories (e.g., major food categories, sub-categories, and minor sub-categories), etc.

[0337] (3) Data Overview: The data overview is divided into annual overview, monthly overview and bar chart, regional overview and bar chart, overview of sampled units, overview of sampled production enterprises, overview of major food categories and bar charts, overview of sub-category food and bar charts, overview of sub-sub-category food and bar charts, overview of sub-category food and bar charts, and overview of inspection items. The results are presented in a combination of tables and images.

[0338] (4) Alarm system: Output four categories of alarm and warning data tables, ABCD. For example: 1) New items and first detection table, which is the information of new items exceeding the standard or the first detection of a certain item in various test items, mainly for B1 and B2 alarms; 2) Exceeding rate table and detection rate table, which will be updated every year based on new data, specifically for the calculation of C1 and C2 alarms and warnings (with warning lines). Contains the exceeding rate or detection rate results of each sample name corresponding to the test items in each year calculated in Table 1; 3) Annual historical cumulative data table: Generate a historical cumulative data corresponding to each level of food classification every year, specifically for the calculation of Class D cumulative effect alarms and warnings. Contains information such as food major category, food subcategory, food sub-subcategory, food subcategory, sample name, test quantity, exceeding quantity, qualified rate at each level, risk rate at each level, weight at each level, etc. According to the size of the cumulative risk index, the possible harm is divided into serious alarm, ordinary alarm and normal situation. For example, the alarm map is represented by red, yellow and white respectively, which intuitively reminds the regulatory authorities to pay attention. Through these tables, data analysts can intuitively draw from the tables the food categories and their corresponding projects that were found to be alarming in that year, as well as warnings of projects that may pose risks in the coming year.

[0339] It should be noted that the embodiments of the present invention have better practicability and do not impose any form of limitation on the present invention. Any technician familiar with the field may use the technical content disclosed above to change or modify it into an equivalent effective embodiment. However, any modification or equivalent changes and modifications made to the above embodiments based on the technical essence of the present invention without departing from the content of the technical solution of the present invention are still within the scope of the technical solution of the present invention.

Claims

1. A food safety risk early warning method, characterized in that: include: Step S1: Data input: obtaining original data from an external database; Step S2: Data preprocessing: Screen and clean the raw data according to pre-set rules to obtain standardized data that meets data analysis specifications; Step S3: Data analysis: early warning analysis of standardized data based on statistics and artificial intelligence technology; Step S4: Output analysis results, which include data overview and warning information.

2. The food safety risk early warning method according to claim 1, characterized in that: The step S2 includes: (1) data screening: selecting regions, links, and food categories from the original data; (2) data cleaning: first retaining the columns used for classification and calculation in the original data, and then using the hash algorithm to supplement the missing sample number information; unifying the inspection item names and the four-level classification of samples in the original data according to the provisions of the "2022 National Food Safety Supervision Sampling Implementation Rules"; filling in "not detected" or "detected" in the "whether detected" column; adding the column content of the limit value and result judgment of the supplementary new standard; The standardized data that conforms to the data analysis specifications include sampling number, year, month, date, city where the sampled unit and production unit are located, county where the sampled unit and production unit are located, sampling link, major food category, food subcategory, food sub-subcategory, food subcategory, sample name, inspection items, inspection results, result judgment, result judgment under the new standard, whether detected, conclusion, minimum allowable limit, maximum allowable limit, new standard minimum allowable limit and new standard maximum allowable limit, a total of 23 columns of data.

3. The food safety risk early warning method according to claim 1, characterized in that: The step S3 uses statistical theory and artificial intelligence technology to perform big data deep learning modeling on the standardized data, and analyzes and obtains four major types of alarm and early warning algorithm models: Class A single item exceeding the standard risk alarm model, Class B new project risk alarm model, Class C limited project alarm and early warning model and Class D risk cumulative effect alarm and early warning model.

4. The food safety risk early warning method according to claim 3, characterized in that: Class A single-item over-standard risk alarm model, including Class A1 hazardous single value over-standard alarm model, Class A2 multiple over-standard alarm model, Class A3 new and old standard over-standard difference alarm model: The A1-type hazardous substance single value exceeding standard alarm model is to alarm when a certain test item of the sample exceeds the standard: Assume that the detection value of a certain inspection item of a food is x, and if it is not detected, let x = 0. At the same time, the minimum and maximum allowable limits of the inspection item under the food category of the food are x and 0 respectively. l and x h If it cannot be detected, let x l =x h =0, if: x l >x or x h <x Then the A1-type hazardous substance single value exceeding the standard alarm information will be output for the inspection item of the food; The A2 type multiple exceeding standard alarm model is that if a food inspection item exceeds the standard multiple times in the following years, the alarm information will be output: Assign parameter detection coefficient y to all food sub-categories in the tth year t , Then, the detection item under the food subcategory is assigned the number of detections y(x) related to the year number x parameter. For the required number of detections n, if y t (x) ≥ n, it means that the detection item has exceeded the standard more than n times in x years, so the A2 type multiple exceeding standard alarm information is output; The A3 type new and old standard exceeding difference alarm model is to alarm when a certain test item of a sample produces a different exceeding result due to the change of the limit standard: Assign parameters to all food sub-categories in the tth year to determine whether the new standard is detected. t ′, Compare t ′ and y t , if y t ′≠y t , it means that the test item has different exceeding standard results under the new and old standards, so the A3 type new and old standard exceeding standard difference alarm information is output.

5. The food safety risk early warning method according to claim 3, characterized in that: The risk alarm model for newly added items of category B includes the alarm model for newly added detection items of category B1 and the alarm model for first detection of objects of category B2: The B1 new test item alarm model outputs an alarm message when a new test item that has not been tested appears in the sample: Assign parameter z to all food test items under each food category in year t t , If z t =1, output B1 alarm information; The B2 first-detection alarm model outputs an alarm message when an existing or newly added test item of a sample is detected for the first time: If in the above A2 category multiple exceeding standard alarms y t (∞)=lim x→∞ y t (x) = 1 and y t-1 (∞)=lim x→∞ y t-1 If (x)=0, it means that the detected object is detected for the first time in the food subcategory, and a B2 alarm message is output.

6. The food safety risk early warning method according to claim 3, characterized in that: The C-type limited item alarm and early warning model includes the C1-type exceeding standard rate abnormal alarm and early warning model and the C2-type detection rate abnormal alarm and early warning model: the C1-type exceeding standard rate abnormal alarm and early warning model outputs an alarm message when the exceeding standard rate of the sample is outside the control interval; at the same time, the control interval is determined based on the existing historical data and the exceeding standard rate of the sample type and the inspection item in the next year is estimated. If it is outside the control interval, the early warning message is output; the C2-type detection rate abnormal alarm and early warning model outputs an alarm message when the detection rate of the sample is outside the control interval; at the same time, the control interval is determined based on the existing historical data and the detection rate of the sample type and the inspection item in the next year is estimated. If it is outside the control interval, the early warning message is output: When performing anomaly detection on time series data, the Grubbs test method is used: Let the sample data to be tested be {x1,x2,…,x n }, then the null hypothesis and alternative hypothesis of Grubbs test are: H0: x i Not an outlier H1: x i Outliers The algorithm steps of Grubbs test are:

1. Standardize data:

2. Compare the deviation degree of outliers with the Grubbs critical value by looking up the table: First, set a detection level α, combine the detection level α with the sample size n, and find the corresponding Grubbs critical value in the table below, denoted as G(α,n); compare the standardized data Z i and G(α,n), if Z i >G(α,n), Grubbs test considers that the corresponding data x i It is an outlier, that is, the original hypothesis H0 is not true; Alternatively, when performing anomaly detection on time series data, an IQR-based anomaly detection method is used. The algorithm first obtains the first quantile point Q1 and the third quantile point Q3 of the data, then calculates the inner quantile range IQR, and finally obtains the limit range of reasonable data based on Q1, Q3, IQR and the predetermined quantile range multiple β. The data points outside the limit range are the detected abnormal data points. The specific algorithm steps are:

1. Calculate the first quantile n1 and the third quantile n3 of the data: Assume the total number of data is n, then n1=round(0.25×n), (4) n3=round(0.75×n). (5) Among them, round represents the rounding function; 2. Calculate the internal quantile range IQR: Arrange n data in order from small to large x (1) ,x (2) ,…,x ( n ) , get the first quantile n (0.25) and the third quantile n (0.75) After that, the calculation method of the internal quantile range IQR is:

3. The lower control line LCL and upper control line UCL of normal data:

4. Identify outliers: The inner quantile anomaly detection method takes all the anomalies within the limit [LCL β ,UCL β ] are called abnormal data points and are set at [LCL 1.5 ,UCL 1.5 ] is a general abnormality, and the abnormal data outside the range of [LCL2,UCL2] is a serious abnormality. Different levels of abnormalities will output alarm information marked with different colors.

7. The food safety risk early warning method according to claim 3, characterized in that: D-type risk cumulative effect alarm and early warning model, which includes D1-type risk index abnormal alarm and early warning model, D2-type risk weight abnormal alarm and early warning model: D1-type risk index abnormal alarm and early warning model is to assign risk weights to each sub-category under a certain food category, adjust the risk weight of each sample by using the cumulative effect of previous years' data, output alarm information for the ranking of the risk index of all sub-categories under the food category, and determine the warning line based on the existing historical data and estimate the risk index of the sub-category in the next year. If the warning line is exceeded, the warning information is output; The D2 weight index abnormal alarm and early warning model assigns risk weights to each subcategory under a certain food category, adjusts the risk weights of each sample using the cumulative effect of previous years' data, outputs alarm information based on the ranking of the weight index of all subcategories under the food category, and determines the warning line based on the existing historical data and estimates the weight index of the subcategory in the next year. If the warning line is exceeded, an early warning message is output; The D-type risk cumulative effect alarm and early warning model algorithm is based on the statistical analysis model. Suppose a food category S includes N food subcategories S i (i=1,2,...,K), assuming that when S is a food category, S i For each food subcategory, the specific steps of the cumulative effect algorithm are as follows: 1) Initialize data: Each food subcategory i With initial weight index This index represents the degree to which this category requires special attention; The total number of samples for the first random inspection of a food subcategory is n i , the number of qualified samples is m i , then the initial safety index is: 2) Count the latest sample sizes of various data: Get Food Subcategory S i The total number of samples at time t is The number of qualified samples is 3) Iteratively update the statistics of the new time: First, calculate each subclass S i The pass rate of (i=1,2,...,K) for: Then the weighted pass rate wq of category S t for: The safety index of category S in the previous year is recorded as a t-1 , then the safety index a in year t is t for: a t =c×a t-1 +(1-c)×wq , (3) Where c is a pre-set silver retention factor, which is a constant between 0 and 1. The c value represents the degree to which the safety index remains unchanged. If category S is not sampled in the current random inspection, its current safety index is equal to its safety index in the previous year, that is: a t =a t-1 . Risk index of major food categoriesv t for: in t =1-a t . (4) 4) Update the risk weight index and the new temporary risk weight index for: This formula means that for food categories with higher risks, more attention needs to be paid to them. In order to ensure that the sum of the risk weight index is 1, the new risk weight is standardized to obtain the final new risk weight index. for: Updated and stored for next year's calculation; 5) The abnormal alarm and early warning model of the risk accumulation index is used to achieve the following three functions: ① Vertical abnormal alarm and early warning of cumulative risk index: By analyzing the accumulated risk index over the years and applying the linear regression model to predict the potential risk index v of the food category in the next year t+1 The model uses the risk index of the past few years including the current year as a data set to evaluate the abnormality of the risk index of the current year. If the risk index of this year is v t If a food is identified as an outlier, the system will issue a risk index abnormality alert for the food category. In addition, the risk index forecast value v for the food category in the next year will be t+1 Conduct Grubbs test, and if the test result is abnormal, issue an abnormal risk index warning for the food category; ② Alarm for the impact of limit standard value adjustment on risk index and weight index: Set v t The cumulative risk index of a food category calculated according to the old standard is recalculated after the new standard is implemented to obtain a new index V t , if V t >v t , which indicates that the adjustment of the standard value has increased the risk index of this food category, that is, the risk index of this food category has deteriorated under the new standard, increasing the possibility of abnormal risk index; on the contrary, if V t <v t , it means that the adjustment of the standard value leads to a decrease in the risk index of the food category, that is, the risk index performance of the food category has improved under the new standard, reducing the risk of abnormal risk index; ③ Horizontal abnormal alarm of cumulative risk index between different categories at the same level: Analyze each food subcategory S under a specific food category S in a certain year i (i=1,2,...,K), their respective cumulative risk index Perform anomaly detection, and in the detection results, abnormal values ​​will be given different levels of alerts.

8. The food safety risk early warning method according to any one of claims 1 to 7, characterized in that: In step S4, the data overview is divided into annual overview, monthly overview and bar chart, regional overview and bar chart, overview of inspected units, overview of inspected production enterprises, overview of major food categories and bar charts, overview of sub-category food and bar charts, overview of sub-sub-category food and bar charts, overview of sub-category food and bar charts, and overview of inspection items.

9. The food safety risk early warning method according to any one of claims 1 to 7, characterized in that: In step S4, the warning information is divided into single-item over-standard risk alarm information, new project risk alarm information, limited-quantity project alarm and warning information, and risk cumulative effect alarm and warning information.

10. A food safety risk early warning system, characterized in that: include: A data input module, wherein the data input module is used to obtain original data from an external database; A data preprocessing module, which is used to screen and clean the original data according to pre-set rules to obtain standardized data that meets data analysis specifications; A data analysis module, which is used to perform intelligent analysis on standardized data based on statistical theory and artificial intelligence technology; The analysis result output module is used to output the analysis results, which include data overview and warning information.

Citation Information

Patent Citations

  • Automatic grading and early warning system and method for safety risk of imported food

    CN113762764A

  • Food safety trend analysis and early warning method based on sampling detection information

    CN117575324A

  • Method of online tracing pesticide residues and visualizing warning on basis of high resolution mass spectrum, internet and geographic information

    WO2018192421A1

  • AU2020103340A4

Cited By

  • System capable of sharing food safety data and sharing method thereof

    CN120725192A