Food safety traceability method and system based on internet of things
By using IoT technology to detect and analyze food safety data, a safety impact analysis model is constructed, which solves the problem of insufficient data analysis in the existing system and achieves efficient and accurate food safety traceability and risk management.
Patent Information
- Application Number
- CN202411222066.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-02
- Publication Date
- 2025-11-28
- Estimated Expiration
- 2044-09-02
AI Technical Summary
Existing IoT-based food safety traceability systems lack in-depth data analysis and risk assessment mechanisms, making it difficult to accurately identify the root causes of food safety problems. Traditional traceability methods are inefficient and prone to errors.
By conducting safety tests on food, obtaining a quality test set, comparing it with a standard set, extracting items that exceed the standard, using IoT data and a pre-set database to calculate correlation coefficients, constructing a safety impact analysis model, and conducting risk assessment and source tracing.
It achieves high efficiency and accuracy in food safety management, enabling rapid problem identification, improved resource utilization efficiency, enhanced supply chain transparency and consumer confidence, and provides a basis for scientific decision-making.
Smart Images

Figure CN119205138B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of Internet of Things applications, in particular to a food safety traceability method and system based on Internet of Things. BACKGROUND
[0002] In the current field of food safety supervision, with the increasing complexity and globalization of the food supply chain, it has become a major challenge to ensure that every link of food from production to consumption meets safety standards. Traditional food safety traceability methods often rely on paper records or manual monitoring, which is not only inefficient, but also prone to errors and difficult to fully cover all links of the food supply chain.
[0003] With the rapid development of Internet of Things technology, its application in the field of food safety is increasingly widespread. Internet of Things technology can collect real-time and accurate data of food at various stages of processing, transportation, storage, and sales through sensors, RFID tags, GPS positioning, and other means, providing strong technical support for food safety traceability. However, existing food safety traceability systems based on Internet of Things mostly focus on simple data collection and display, lack in-depth data analysis and risk assessment mechanisms, and often fail to accurately identify the root cause of food safety problems. SUMMARY
[0004] To solve the above technical problems, the present application provides a food safety traceability method and system based on Internet of Things, which solves the problems of traditional food safety traceability methods, improves the overall efficiency and effectiveness of food safety management, and provides technical support for food safety.
[0005] In a first aspect, the present application provides a food safety traceability method based on Internet of Things, which comprises:
[0006] Performing safety detection on food to obtain a food safety quality detection set; the food safety quality detection set includes detection results of multiple items;
[0007] Comparing the food safety quality detection set with a food safety quality standard set, and extracting and summarizing items with detection results exceeding the standard to obtain a food safety over-standard item set;
[0008] For each over-standard item, extract the corresponding food stage-related vector in the pre-set item stage-related database;
[0009] Calculate the sum of the processing stage-related coefficient, the transportation stage-related coefficient, the storage stage-related coefficient, and the sales stage-related coefficient in all food stage-related vectors, and sort the stages according to the calculation results to obtain a first-order food safety attention sequence;
[0010] Collecting Internet of Things data of each stage of the food, and extracting safety influence elements of the Internet of Things data of each stage to obtain a safety influence element data set of each stage;
[0011] For the safety influence element data set of each stage, input into a pre-constructed safety influence analysis model to obtain a food safety influence parameter corresponding to the stage;
[0012] Based on the food safety influence parameter of each stage, the sum of the correlation coefficients in the first-order food safety concern sequence is corrected, and the first-order food safety concern sequence is corrected according to the corrected result to obtain a second-order food safety concern sequence;
[0013] The stage with the largest value in the second-order food safety concern sequence is taken as the food safety traceability result.
[0014] Further, the method for obtaining the food safety exceeding item set comprises:
[0015] Obtaining a food safety quality detection set, including the results of chemical component detection, microbial detection, physical property detection and other specific detection;
[0016] Obtaining a food safety quality standard set, including relevant laws, regulations and standard guidelines formulated by the state and region;
[0017] Obtaining the highest allowable limit value of each detection item;
[0018] The mathematical expression of the food safety quality standard set is:
[0019] ;
[0020] Among them, represents the food safety standard set and contains the highest allowable limit value of all detection items, represents the highest allowable limit value of the th detection item;
[0021] Then, compare the detection results in the food safety quality detection set with the standard limit values in the food safety quality standard set one by one; for each detection result , when , the detection item is considered to be over standard, wherein is the highest allowable limit value of the detection item;
[0022] All detection items exceeding the standard limit value are summarized into a set to form a food safety exceeding item set;
[0023] Output the summarized food safety exceeding item set to provide data support for subsequent analysis.
[0024] Further, the food safety over-standard item set is:
[0025] ;
[0026] Wherein, represents the food safety over-standard item set and contains all detection results exceeding the maximum allowable limit value of the detection item, represents the food safety quality detection set and contains the detection results of all detection items, represents the detection result of the th detection item, represents the maximum allowable limit value of the th detection item, represents the detection result of the th detection item exceeds the maximum allowable limit value of the th detection item.
[0027] Further, the food stage related vector includes a processing stage related coefficient, a transportation stage related coefficient, a storage stage related coefficient, and a sales stage related coefficient.
[0028] Further, the acquisition method of the first-order food safety attention sequence includes:
[0029] From the food stage related vector set, extract the food stage related vector of each over-standard item;
[0030] Each food stage related vector is: contains a processing stage related coefficient , a transportation stage related coefficient , a storage stage related coefficient , and a sales stage related coefficient ;
[0031] For all over-standard items, the sum of the processing stage related coefficient, the transportation stage related coefficient, the storage stage related coefficient, and the sales stage related coefficient is calculated respectively; the sum of the processing stage related coefficient is , the sum of the transportation stage related coefficient is , the sum of the storage stage related coefficient is , and the sum of the sales stage related coefficient is ;
[0032] According to the size of the sum of the processing stage related coefficient, the transportation stage related coefficient, the storage stage related coefficient, and the sales stage related coefficient, and sorting, the sorted sequence constitutes the first-order food safety attention sequence.
[0033] Further, the first-order food safety attention sequence is:
[0034] ;
[0035] in, For use function, where The sum of correlation coefficients across the processing stages is expressed mathematically as follows:
[0036] ;
[0037] The sum of correlation coefficients for each transportation stage is expressed mathematically as follows:
[0038] ;
[0039] The sum of correlation coefficients at the storage stage is expressed mathematically as follows:
[0040] ;
[0041] The sum of correlation coefficients across the sales stages is expressed mathematically as follows:
[0042] ;
[0043] This indicates a set of items that exceed food safety standards. The number of elements.
[0044] Furthermore, the method for constructing the safety impact analysis model includes:
[0045] Data cleaning, outlier removal, and missing value filling are performed on the collected food safety incident cases and related IoT data;
[0046] Feature engineering was performed on the dataset through feature selection. Features included temperature fluctuations, humidity changes, chemical exposure, physical damage, risk of biological contamination, and transportation time and route.
[0047] Standardize or normalize the features;
[0048] Select machine learning models to build security impact analysis models based on the characteristics of the data and available technical tools;
[0049] The dataset is divided into a training set and a test set. The security impact analysis model is trained using the training set.
[0050] Use grid search and random search to adjust the parameters of the security impact analysis model to optimize model performance;
[0051] After training, the safety impact analysis model is tested using a test set.
[0052] After the safety impact analysis model is constructed, the safety impact element data set of each stage is input into the corresponding safety impact analysis model;
[0053] The safety impact analysis model outputs the food safety impact parameter corresponding to each stage.
[0054] In another aspect, the present application also provides a food safety traceability system based on the Internet of Things, which comprises:
[0055] The system comprises:
[0056] A safety detection module is configured to detect the safety of the food and obtain a food safety quality detection set comprising a plurality of detection items;
[0057] A result comparison module is configured to compare the food safety quality detection set with the food safety quality standard set, and extract the items with detection results exceeding the standard to form a food safety exceeding standard item set;
[0058] A stage-related database extraction module is configured to extract, for each exceeding standard item, a food stage-related vector corresponding to the exceeding standard item from a pre-set item stage-related database;
[0059] A stage sorting module is configured to calculate the sum of the stage-related coefficients in all food stage-related vectors, and generate a first-order food safety attention sequence according to the calculation result;
[0060] An Internet of Things data acquisition module is configured to acquire Internet of Things data of the food at each stage of processing, transportation, storage and sales;
[0061] A safety impact element extraction module is configured to extract safety impact elements from the Internet of Things data of each stage to form a safety impact element data set of each stage;
[0062] A safety impact analysis model is configured to input the safety impact element data set of each stage into a pre-constructed safety impact analysis model to obtain a food safety impact parameter corresponding to the stage;
[0063] An impact correction and sorting module is configured to correct the sum of the related coefficients in the first-order food safety attention sequence based on the food safety impact parameter of each stage, and generate a second-order food safety attention sequence according to the corrected result;
[0064] A traceability result determination module is configured to select the stage with the largest value from the second-order food safety attention sequence as the result of food safety traceability.
[0065] In a third aspect, the present application provides an electronic device, comprising a bus, a transceiver, a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the transceiver, the memory and the processor are connected through the bus, and the computer program, when executed by the processor, implements the steps of any one of the above methods.
[0066] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of any one of the above methods.
[0067] Compared with the prior art, the present application has the following advantages: through the Internet of Things technology, the data of food at each link of processing, transportation, storage and sales can be collected in real time and accurately, ensuring the comprehensiveness and accuracy of the data, and the extraction of safety influencing elements based on the Internet of Things data can accurately identify the factors affecting food safety; by comparing the food safety quality detection set with the food safety quality standard set, the items that do not meet the standards can be automatically identified, the automatic out-of-standard item detection and aggregation function can quickly locate the problem, and the problem response speed is improved; the food stage-related vectors stored in the project stage-related database can quantify the correlation between different detection items and each stage of the supply chain, realize data-driven risk assessment, prioritize the stage with the highest risk by calculating and sorting the correlation coefficients of different stages, and improve the effectiveness of risk management; the safety influence analysis model can correct the food safety attention sequence according to the safety influencing elements in the Internet of Things data, so that the risk assessment is closer to the actual situation, and through the construction of the second-order food safety attention sequence, the attention degree of each stage can be dynamically adjusted, ensuring the flexibility and effectiveness of the food safety management strategy; through the sorting and correction of the food safety attention sequence, the supervision resources are more reasonably allocated, the most urgent problems are solved with concentrated efforts, and the supervision departments and enterprises focus on the high-risk links, improving the resource utilization efficiency; by providing a complete traceability chain, the supervision departments and consumers can track the whole process of food from the source to the table, enhancing the transparency of the supply chain and improving the confidence of consumers, and also establishing a good brand image for enterprises; by regularly updating the project stage-related database according to new research findings and industry changes, the continuous improvement and adaptability of the food safety management system are ensured, and by collecting new food safety event cases and adjusting the correlation coefficients, the latest correlation situation can be reflected in time, maintaining the timeliness and effectiveness of the system; through data analysis and risk assessment, decision-makers are provided with data-based evidence, which helps to make more scientific and reasonable decisions, develop more targeted food safety policies and standards, and improve the overall food safety level of the industry; the food safety traceability method based on the Internet of Things solves the problems existing in the traditional food safety traceability method, improves the overall efficiency and effectiveness of food safety management, and provides technical support for food safety. BRIEF DESCRIPTION OF DRAWINGS
[0068] Figure 1 is a flowchart of the present application;
[0069] Figure 2 is a flowchart of the construction method of the safety impact analysis model;
[0070] Figure 3 is an example diagram of a project phase related database structure;
[0071] Figure 4 is a structural diagram of the food safety traceability system based on the Internet of Things. DETAILED DESCRIPTION
[0072] In the description of the present application, those skilled in the art should know that the present application can be implemented as a method, device, electronic device and computer readable storage medium. Therefore, the present application can be specifically implemented as the following forms: complete hardware, complete software (including firmware, resident software, microcode, etc.), hardware and software combined form. In addition, in some embodiments, the present application can also be implemented as a computer program product in one or more computer readable storage media, which contains computer program code.
[0073] The above computer readable storage medium can adopt any combination of one or more computer readable storage media. The computer readable storage medium includes: electrical, magnetic, optical, electromagnetic, infrared or semiconductor systems, devices or devices, or any combination thereof. More specific examples of computer readable storage medium include: portable computer disk, hard disk, random access memory, read-only memory, erasable programmable read-only memory, flash memory, optical fiber, optical disk read-only memory, optical storage device, magnetic storage device or any combination thereof. In the present application, the computer readable storage medium can be any tangible medium containing or storing programs, which can be used or combined with instruction execution system, device, device.
[0074] The acquisition, storage, use, processing and the like of data in the technical solution of the present application comply with the relevant provisions of national laws.
[0075] The present application describes the provided method, device and electronic equipment through flowchart and / or block diagram.
[0076] It should be understood that each block of a flowchart and / or block diagram, as well as combinations of blocks in a flowchart and / or block diagram, can be implemented by computer-readable program instructions. These computer-readable program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus to produce a machine that, when executed by a computer or other programmable data processing apparatus, creates means for implementing the functions / operations specified in the blocks of the flowchart and / or block diagram.
[0077] These computer-readable program instructions may also be stored in a computer-readable storage medium that enables a computer or other programmable data processing device to function in a particular manner. In this way, the instructions stored in the computer-readable storage medium produce an instruction apparatus product that includes the functions / operations specified in the blocks of a flowchart and / or block diagram.
[0078] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus or other device to cause a series of operational steps to be performed on the computer, other programmable data processing apparatus or other device to produce a computer-implemented process, such that the instructions that execute on the computer or other programmable data processing apparatus provide a process for implementing the functions / operations specified in the blocks of the flowchart and / or block diagram.
[0079] This application will now be described with reference to the accompanying drawings.
[0080] Example 1: As Figures 1 to 3 As shown, the food safety traceability method based on the Internet of Things of the present invention specifically includes the following steps:
[0081] S1. Conduct safety testing on food to obtain a food safety and quality test set; the food safety and quality test set includes test results for multiple items.
[0082] Step S1 is the foundation of the entire food safety traceability method, involving the process of conducting safety tests on food and obtaining a set of food safety quality test results; specifically as follows:
[0083] First, preparations are made for food safety testing, including testing with high-precision chemical analyzers, microbial detectors and other professional instruments; representative samples are randomly selected from the batches of food to be tested according to food safety testing standards and procedures; and testing personnel are ensured to have received appropriate training and are familiar with operating procedures and safety regulations.
[0084] The detection items of the food to be detected are then classified, including chemical component detection, microbial detection, physical property detection, and nutritional component detection; chemical component detection is to detect whether the chemical substances such as additives, heavy metals, and pesticide residues in the food exceed the standard; microbial detection is to check the microbial contamination such as bacteria, mold, and yeast; physical property detection is to measure the physical indexes such as moisture content, pH value, and fat content of the food; and nutritional component detection is to perform specific detection according to different food types, such as detection of protein, fat, and carbohydrate;
[0085] After the food detection is completed, the detection data is recorded, including: using an electronic recording system to record all data during the detection process to ensure the accuracy and traceability of the data; using a standardized format to record the detection results for subsequent analysis and processing;
[0086] A strict quality control system needs to be established during food detection to ensure the reliability and consistency of the detection results; and the detection equipment needs to be calibrated and verified regularly to ensure accuracy;
[0087] The detection results of all detection items are summarized into a food safety quality detection set; and the food safety quality detection set is stored in a structured form for subsequent processing;
[0088] The mathematical expression of the food safety quality detection set is:
[0089] ;
[0090] Wherein, represents the food safety quality detection set, represents the th detection item, represents the detection result of the th detection item.
[0091] By using high-precision chemical analyzers, microbiological detectors and other professional instruments, the accuracy of the test results is ensured; according to the food safety detection standards and procedures, representative samples are randomly selected from the food batches to be tested, ensuring the representativeness of the samples and improving the effectiveness of the test results; ensuring that the detection personnel have received appropriate training, are familiar with the operation process and safety specifications, and improve the accuracy and safety of the detection; through chemical composition detection, microbiological detection, physical property detection and other specific detection methods, the safety of the food is comprehensively evaluated to ensure that all factors affecting food safety are covered; an electronic recording system is used to record all data during the detection process, ensuring the accuracy and traceability of the data, and using a standardized format to record the test results for subsequent data analysis and processing; a strict quality control system is established to ensure the reliability and consistency of the test results, and the detection equipment is calibrated and verified regularly to ensure the accuracy of the equipment; all test results of the test items are collected into a food safety quality detection set, and the set is stored in a structured form to facilitate subsequent data processing and utilization; through the construction of an efficient, accurate and reliable food safety quality detection method, strong technical support is provided for food safety.
[0092] S2, compare the food safety quality detection set with the food safety quality standard set, and extract the test results exceeding the standard to form a food safety exceeding standard item set;
[0093] Step S2 is to compare the food safety quality detection set with the food safety quality standard set, determine which test results exceed the safety standard limit, and collect these exceeding standard items to form a food safety exceeding standard item set; the specific steps are as follows:
[0094] Obtain the food safety quality detection set in step S1, which includes the results of chemical composition detection, microbiological detection, physical property detection and other specific detection;
[0095] Obtain the food safety quality standard set, including the highest allowable limit value of each test item according to the relevant laws and regulations and standard guidelines formulated by the country and region; the standard limit value includes the national food safety standard, the industry recommended standard or other applicable standard;
[0096] The food safety quality standard set is:
[0097] ;
[0098] Among them, represents the food safety standard set and contains the highest allowable limit value of all test items, represents the highest allowable limit value of the th test item;
[0099] After that, compare the detection results in the food safety quality detection set with the standard limits in the food safety quality standard set one by one; for each detection result , if , then the detection item is considered to be over the standard, where is the highest allowable limit of the detection item;
[0100] Collect all detection items that exceed the standard limits into a set to form the food safety over-standard item set;
[0101] Output the food safety over-standard item set after aggregation to provide data support for subsequent analysis.
[0102] Further, the food safety over-standard item set is:
[0103] ;
[0104] wherein represents the food safety over-standard item set and contains all detection items whose detection results exceed their highest allowable limits, represents the food safety quality detection set and contains the detection results of all detection items, represents the detection result of the th detection item, represents the highest allowable limit of the th detection item, represents the detection result of the th detection item exceeds its highest allowable limit .
[0105] By using high-precision professional instruments for testing, the accuracy of test results is guaranteed. A strict quality control system is established, and testing equipment is regularly calibrated and verified to ensure accurate results. Appropriate training of testing personnel ensures consistency and standardization of operations, familiarizing them with operating procedures and safety regulations. Standardized formats are used to record test results for easy subsequent analysis and processing. All test data is recorded electronically to ensure accuracy and traceability. Test results are stored in a structured manner for easy processing and retrieval. Non-compliant items are promptly identified by quickly comparing the food safety quality test results with the set of food safety quality standards. Excessive items are compiled into a set for easy tracking and handling. The legality of testing work is ensured by adhering to relevant national and regional laws, regulations, and standards guidelines, and food safety complies with regulatory requirements by comparing with official food safety standards and industry recommendations. A clear list of excessive items is provided, enabling regulatory authorities, manufacturers, and consumers to understand specific food issues. The compilation of excessive food safety items effectively improves the efficiency of food safety management, ensures food quality and safety, and protects consumer health.
[0106] S3. For each item exceeding the standard, extract the food stage-related vector corresponding to the item from the preset project stage-related database; the food stage-related vector includes the processing stage correlation coefficient, transportation stage correlation coefficient, storage stage correlation coefficient and sales stage correlation coefficient.
[0107] Step S3 involves extracting the food stage-related vectors corresponding to the projects exceeding the standards from a pre-defined project stage-related database; the details are as follows:
[0108] First, build the relevant databases for the project phase, including:
[0109] List all food safety testing items, including chemical component testing, such as heavy metal and pesticide residue testing; microbiological testing, such as bacteria and mold testing; physical property testing, such as moisture content and pH value testing; and nutritional component testing, such as protein, fat, and carbohydrate testing.
[0110] Identify the various stages in the food process from production to consumption, including processing, transportation, storage, and sales;
[0111] Collect past food safety incident cases, including detailed descriptions of the incidents, types of food affected, testing items, and the stages at which problems occurred; analyze these cases to determine which testing items are associated with which stages.
[0112] An expert group on food safety was organized to assess the correlation between each testing item and different stages. Based on their experience and expertise, the expert group assigned a correlation coefficient to each testing item and each stage.
[0113] The correlation coefficients of each test item with each stage of processing, transportation, storage, and sales are entered into the database. Each test item has a corresponding stage correlation vector. The stage correlation vector for food is as follows:
[0114] ;
[0115] Correlation coefficient Values between 0 and 1 are used, where 0 represents no correlation and 1 represents high correlation.
[0116] Regularly update the relevant databases for each project phase to reflect new research findings or industry changes; collect new food safety incident cases and adjust the correlation coefficients to reflect the latest associations;
[0117] like Figure 3 The image shows an example of a database structure related to project phases. A matrix is used to represent the correlation coefficients between these projects and phases, where:
[0118] A, B, C, and D represent chemical composition testing, microbial testing, physical property testing, and nutritional composition testing, respectively; processing, transportation, storage, and sales represent the supply chain status.
[0119] exist Figure 3 The correlation coefficient between project A and the processing stage is 0.8, meaning that the project is highly correlated with the processing stage; the correlation coefficient between project B and the transportation stage is 0.7, indicating that the project is highly correlated with the transportation stage; and so on, making it easy to see the correlation between each project and each stage.
[0120] For example:
[0121] Test item A, such as pesticide residues:
[0122] The correlation coefficient for the processing stage was 0.8, indicating that pesticide residues are highly correlated with the processing stage.
[0123] The correlation coefficient during the transportation stage was 0.4, indicating that pesticide residues are somewhat correlated with the transportation stage.
[0124] The correlation coefficient during the storage stage was 0.3, indicating that the correlation between pesticide residues and the storage stage was low.
[0125] The correlation coefficient at the sales stage was 0.2, indicating that the correlation between pesticide residues and the sales stage was the lowest.
[0126] Test item B, such as bacterial contamination:
[0127] The correlation coefficient of the processing stage is 0.2, indicating that the bacterial contamination is less relevant to the processing stage;
[0128] The correlation coefficient of the transportation stage is 0.7, indicating that the bacterial contamination is highly relevant to the transportation stage;
[0129] The correlation coefficient of the storage stage is 0.5, indicating that the bacterial contamination has certain relevance to the storage stage;
[0130] The correlation coefficient of the sales stage is 0.1, indicating that the bacterial contamination has the lowest relevance to the sales stage;
[0131] After the project stage correlation database is constructed, in the food safety exceeding standard project set obtained in step S2, each exceeding standard project is selected ; for each exceeding standard project , the corresponding entry in the project stage correlation database is searched; the food stage correlation vector in the entry is:
[0132] ;
[0133] wherein and respectively represent the correlation coefficients of the exceeding standard project and the processing, transportation, storage, and sales stages;
[0134] For each exceeding standard project , the sum of the correlation coefficients of each stage in the food stage correlation vector is calculated.
[0135] By constructing a project-stage related database, this system systematically analyzes the correlation between different food safety testing items and various stages of the food supply chain, including processing, transportation, storage, and sales. By assessing the correlation between each testing item and different stages, it refines food safety management, specifically identifying key links where problems occur. Quantifying the correlation coefficients between testing items and different stages allows for more data-driven, data-driven decision-making, rather than relying on experience and intuition. The project-stage related database is regularly updated to reflect new research findings or industry changes, ensuring that food safety management strategies are up-to-date. Past food safety incident cases are collected, and the correlation between testing items and problematic stages is analyzed, providing empirical evidence for food safety management. A food safety expert group is organized to assess the correlation between testing items and different stages, ensuring the accuracy and reliability of correlation coefficients. By analyzing stage-related vectors, potential food safety risks are predicted, allowing for proactive preventative measures. It clarifies which testing items are highly correlated with which stages, helping regulatory authorities and food production enterprises allocate resources more effectively and focus on high-risk links. By extracting food stage-related vectors corresponding to the exceeding items from the project-stage related database, the efficiency and accuracy of food safety management are improved, ensuring that every link in the food supply chain meets safety standards.
[0136] S4. Calculate the sum of correlation coefficients for the processing stage, transportation stage, storage stage, and sales stage in all food stage correlation vectors, and sort each stage according to the calculation results to obtain the first-order food safety concern sequence.
[0137] The objective of step S4 is to calculate the sum of the correlation coefficients for the processing, transportation, storage, and sales stages among all food stage correlation vectors, and to rank these stages based on the calculation results, thereby obtaining a first-order food safety concern sequence; specifically as follows:
[0138] Extract the food stage-related vector for each item that exceeds the standard from the set of food stage-related vectors obtained in step S3;
[0139] The relevant vector for each food stage is: Including correlation coefficients of processing stages Correlation coefficient of transportation stage Correlation coefficient during storage stage and the correlation coefficient of the sales stage ;
[0140] For all items exceeding the standard, the sum of the correlation coefficients for the processing, transportation, storage, and sales stages was calculated separately; the sum of the correlation coefficients for the processing stage was... The sum of the correlation coefficients for the transportation stages is the sum of the correlation coefficients of the storage stage is and the sum of the correlation coefficients of the sales stage is ;
[0141] According to the size of the sum of the correlation coefficients of the processing stage, the transportation stage, the storage stage and the sales stage, and sorting, the sorted sequence constitutes a first-order food safety attention sequence;
[0142] The first-order food safety attention sequence is:
[0143] ;
[0144] wherein, is a function used , wherein represents the sum of the correlation coefficients of the processing stage, and the mathematical expression is:
[0145] ;
[0146] represents the sum of the correlation coefficients of the transportation stage, and the mathematical expression is:
[0147] ;
[0148] represents the sum of the correlation coefficients of the storage stage, and the mathematical expression is:
[0149] ;
[0150] represents the sum of the correlation coefficients of the sales stage, and the mathematical expression is:
[0151] ;
[0152] represents the number of elements of the food safety exceeding item set .
[0153] By comparing the food safety quality detection set with the food safety quality standard set, it can systematically identify which detection results exceed the safety standard limit; and covers all major aspects of food safety detection, including chemical composition detection, microbial detection, physical property detection and other specific detection, to build a project phase-related database covering the whole process of food from production to consumption, including processing, transportation, storage and sales; by extracting food stage-related vectors related to the over-standard project, it is convenient to determine the specific stage where the problem occurs; the expert group evaluates the correlation between each detection project and different stages, making the problem positioning more accurate; the correlation coefficient is used to measure the correlation between different stages and food safety incidents, providing quantitative indicators; the sum of the correlation coefficients of each stage is calculated to provide clear data support for decision-makers, facilitating the determination of priority areas for handling; the project phase-related database is updated regularly to ensure that information reflects the latest research findings and industry changes in a timely manner; the continuous maintenance and update of the database helps to improve the food safety management system and adapt to changing situations; the first-order food safety attention sequence calculated guides the regulatory authorities and enterprises to take targeted measures to address problems in high-risk areas; the output of the aggregated food safety over-standard project set increases the transparency of food safety test results; by providing a comprehensive framework to identify and solve food safety problems, it can also guide the effective allocation of resources through quantitative analysis, improving the efficiency and effectiveness of food safety management.
[0154] S5, collecting Internet of Things data of each stage of food, and extracting safety influence factors from the Internet of Things data of each stage to obtain a safety influence factor data set of each stage;
[0155] The objective of step S5 is to collect Internet of Things data of each stage of food, and extract safety influence factors from the Internet of Things data of each stage to obtain a safety influence factor data set of each stage; the details are as follows:
[0156] Various Internet of Things sensors and devices are deployed at different stages of the food supply chain, such as temperature sensors, humidity sensors, pressure sensors, location trackers, and RFID tags; sensors and devices cover key nodes in the food supply chain, including processing, transportation, storage, and sales, and can capture and transmit data in real time; the types of data collected are diverse, including temperature, humidity, light intensity, location information, timestamp, and food status; data collection should ensure real-time and accuracy to reflect changes in food status;
[0157] The collected data is processed, including removing noise data, duplicate data, and error data, to ensure data accuracy and consistency;
[0158] The processed output is sent to a central server or cloud platform through a wireless network such as Wi-Fi, 4G / 5G, LoRaWAN, etc. The data is stored using a database management system such as MySQL, MongoDB, etc. to ensure data security and accessibility.
[0159] The collected data is pre-processed using data analysis tools and techniques such as Python's Pandas library, R language, etc. Key safety impact factors are extracted from the processed data, including temperature fluctuations, humidity changes, chemical substance exposure, physical damage, biological contamination risk, transportation time, and transportation route.
[0160] Among them, temperature fluctuations can cause food quality to decline or spoilage, and excessive temperature can accelerate chemical reactions in food, leading to nutrient loss or the production of harmful substances, and excessive temperature can cause some food to freeze, change the taste or texture, and inappropriate temperature can promote the growth of microorganisms, especially bacteria and fungi, which can cause food spoilage. High or low humidity can affect the preservation of food, and high humidity can cause food to absorb moisture, increasing water content and affecting taste and quality, and high humidity can also promote mold growth, especially for grains and dry foods, and low humidity can cause some foods to lose moisture and become dry or hard. Chemical substance exposure refers to the exposure of food to harmful chemicals during processing, packaging, or transportation, and exposure to harmful chemicals such as plasticizers in some plastic products and heavy metals in metal containers can cause chemical contamination, and chemicals can migrate into food, posing a potential threat to human health. Physical damage usually refers to mechanical damage to food during processing, packaging, or transportation, and physical damage can damage the integrity of food, making it easier for microorganisms to invade damaged areas, and damage can also cause food to change appearance and taste, reducing its market value. Biological contamination risk refers to food contamination caused by bacteria, viruses, fungi, and other biological organisms, and microbial contamination can cause food spoilage and produce toxins that pose a threat to human health, and biological contamination can also cause foodborne illnesses such as food poisoning. Transportation time and transportation route refer to the length of time and path of food from production to sales, and longer transportation time can increase the risk of food spoilage during transportation, and inappropriate transportation route can cause poor temperature and humidity conditions, affecting food preservation, and delays during transportation can also increase the risk of food spoilage.
[0161] The extracted security impact factors are integrated into a dataset for subsequent analysis; data visualization tools, such as Tableau and Power BI, are used to present the data in chart form to help understand the data intuitively.
[0162] Real-time data collection enables regulatory agencies to respond quickly to potential safety issues, reducing the risk of food contamination or spoilage; coverage of key nodes throughout the food supply chain ensures data capture and analysis of all critical links; data cleaning ensures accuracy and consistency, reducing the possibility of false alarms; efficient database management systems store data, guaranteeing security and accessibility; advanced data analysis tools and technologies extract valuable information from the data to help identify food safety risks; data visualization tools make complex data easy to understand, allowing non-technical personnel to quickly grasp the situation; the provided datasets can be directly used in subsequent safety impact analysis models, providing a scientific basis for decision-makers; real-time data sharing enhances supply chain transparency, facilitating the building of consumer trust; adjustments and expansions based on new needs and technological advancements ensure the system's continued effectiveness and advancement; and the effective collection of IoT data from all stages of the food supply chain, extracting key elements related to food safety, supports subsequent risk assessments and food safety traceability.
[0163] S6. Input the dataset of safety impact factors for each stage into the pre-built safety impact analysis model to obtain the food safety impact parameters corresponding to that stage.
[0164] The goal of step S6 is to input the dataset of safety impact factors for each stage into a pre-built safety impact analysis model to obtain the food safety impact parameters corresponding to that stage; specifically as follows:
[0165] First, a security impact analysis model is constructed, including:
[0166] Data cleaning, outlier removal, and missing value filling are performed on the collected food safety incident cases and related IoT data;
[0167] Feature engineering is performed on the dataset through feature selection or feature transformation to ensure that the input to the safety impact analysis model consists of the most predictive features. Features include temperature fluctuations, humidity changes, chemical exposure, physical damage, biological contamination risk, and transportation time and route. Features are standardized or normalized to ensure that they are on the same order of magnitude.
[0168] Considering the characteristics of the data and the available technical tools, choose a rule-based model, a statistical model, or a machine learning model to build the security impact analysis model;
[0169] The data set is divided into training set and test set, the safety impact analysis model is trained by the training set, and the safety impact analysis model parameters are adjusted by using methods such as grid search and random search to optimize the model performance;
[0170] After training, the safety impact analysis model is tested by the test set; cross-validation and other techniques are used to prevent overfitting; evaluation indicators such as accuracy, precision, recall, F1 score, etc. are used to evaluate the performance of the model, and the best model is selected based on the evaluation results;
[0171] After the safety impact analysis model is constructed, the safety impact element data set of each stage is input into the corresponding safety impact analysis model; the safety impact analysis model outputs the food safety impact parameter corresponding to each stage, and the food safety impact parameter corresponding to each stage reflects the potential impact of the stage on food safety;
[0172] The safety impact analysis model is , which is used to calculate the safety impact parameter , for each stage of the safety impact element data set , the output of the safety impact analysis model ;
[0173] For the processing stage, the safety impact element data set is , and the food safety impact parameter of the processing stage is ;
[0174] For the transportation stage, the safety impact element data set is , and the food safety impact parameter of the transportation stage is ;
[0175] For the storage stage, the safety impact element data set is , and the food safety impact parameter of the storage stage is ;
[0176] For the sales stage, the safety impact element data set is , and the food safety impact parameter of the sales stage is .
[0177] Safety impact parameters calculated through safety impact analysis models provide a deeper understanding of the impact of each stage on food safety. These models offer quantitative risk assessment results, facilitating accurate identification of the root causes of food safety problems. Safety impact parameters provide decision-makers with a scientific basis, supporting more effective resource allocation and risk management. Safety impact analysis models are adjusted and optimized based on new data and knowledge to adapt to constantly changing circumstances. Advanced data analysis and machine learning technologies improve the efficiency and accuracy of food safety supervision. Real-time data collection enables regulatory agencies to respond quickly to potential safety issues, reducing the risk of food contamination or spoilage. Covering key nodes throughout the entire food supply chain ensures data security at all critical stages. All data can be captured and analyzed; data cleaning ensures accuracy and consistency, reducing the possibility of false alarms; an efficient database management system is used to store data, ensuring data security and accessibility; advanced data analysis tools and technologies are used to extract valuable information from the data, helping to identify food safety risks; data visualization tools make complex data easy to understand, allowing non-technical personnel to quickly grasp the situation; the provided datasets can be directly used in subsequent safety impact analysis models, providing scientific basis for decision-makers; through safety impact analysis models, food safety impact parameters are effectively extracted from the safety impact factor datasets at various stages, providing strong support for subsequent food safety traceability and risk assessment.
[0178] S7. Based on the food safety impact parameters at each stage, the sum of the correlation coefficients of each item in the first-order food safety concern sequence is corrected for impact, and the first-order food safety concern sequence is corrected according to the corrected result to obtain the second-order food safety concern sequence.
[0179] Step S7 involves refining and refining the first-order food safety concern sequence obtained through data analysis based on the food safety impact parameters provided by IoT data, thereby obtaining a more accurate second-order food safety concern sequence; the steps are as follows:
[0180] Obtain food safety impact parameters for each stage of processing, transportation, storage, and sales from step S6. and ;
[0181] Define correction factor This is used to represent the degree of influence of food safety impact parameters on the food safety concern sequence;
[0182] For each stage, use the correction factor. To adjust the total correlation coefficient for this stage; the corrected total correlation coefficient Multiply by the correction factor ;
[0183] According to the modified correlation coefficient sum, each stage is reordered to form a new sequence ; the new sequence is the second-order food safety concern sequence.
[0184] The second-order food safety concern sequence is:
[0185] First, obtain the food safety impact parameters, including: food safety impact parameters of the processing stage food safety impact parameters of the transportation stage food safety impact parameters of the storage stage food safety impact parameters of the sales stage
[0186] The correction coefficient is a linear function of the food safety impact parameter , then , where and are constants.
[0187] For the processing stage, ; for the transportation stage ; for the storage stage ; for the sales stage .
[0188] The original correlation coefficient sum of the processing stage is , then the modified correlation coefficient sum is: ; similarly, the modified correlation coefficient sum of the transportation stage is: ; the modified correlation coefficient sum of the storage stage is: ; and the modified correlation coefficient sum of the sales stage is: .
[0189] According to the modified correlation coefficient sum , each stage is reordered to form a new sequence .
[0190] The second-order food safety concern sequence is:
[0191] .
[0192] wherein is the function used.
[0193] By introducing food safety impact parameters, the potential impact of different stages on food safety can be assessed more accurately; the revised sequence can more accurately indicate which stages have the greatest impact on food safety, thereby guiding further investigations and improvement measures; the revised sequence provides decision-makers with a more scientific basis, supporting more effective resource allocation and risk management; adjustments and optimizations can be made based on new data and knowledge to adapt to constantly changing situations; advanced data analysis techniques can be used to improve the efficiency and accuracy of food safety supervision; by extracting food safety impact parameters from the datasets of safety impact factors at each stage and revising the food safety concern sequence accordingly, support can be provided for subsequent food safety traceability and risk assessment.
[0194] S8. The stage with the largest value in the second-order food safety concern sequence is taken as the food safety traceability result;
[0195] Step S8 involves identifying the stage from the revised food safety concern sequence where food safety issues are most likely to occur; specifically as follows:
[0196] Obtain the revised second-order food safety concern sequence from step S7. ;
[0197] In the second-order food safety concern sequence Find the sum of the correlation coefficients with the largest value; the stage with the largest sum of correlation coefficients is the stage where food safety problems are most likely to occur.
[0198] When the second-order food safety concern sequence Including the sum of the corrected correlation coefficients ;
[0199] turn up The sum of the highest median correlation coefficients ,when for Food safety issues are most likely to occur during the processing stage; when for Food safety issues are most likely to occur during the transportation phase; when for Food safety issues are most likely to occur during the storage stage; when for Food safety issues are most likely to occur during the sales stage.
[0200] By determining the stage where the food safety problem is most likely to occur, targeted measures are taken to improve problem-solving efficiency; clear food safety problem source information is provided to decision-makers to support more effective resource allocation and risk management; the stage where the problem occurs is determined to concentrate resources on improving the stage to reduce the occurrence of food safety problems; the stage where the food safety problem is most likely to occur is determined by an automated method to save manpower and material resources; food safety impact parameters are extracted from the safety impact element data set of each stage, and the food safety attention sequence is corrected accordingly to determine the stage where the food safety problem is most likely to occur, providing strong support for subsequent food safety traceability and risk assessment.
[0201] Embodiment two: as shown in the figure, the food safety traceability system based on the Internet of Things of the application specifically comprises the following modules; Figure 4
[0202] The safety detection module is used for safety detection of the food, and a food safety quality detection set containing multiple detection items is obtained;
[0203] The result comparison module is used for comparing the food safety quality detection set with the food safety quality standard set, and extracting the items with detection results exceeding the standard to form a food safety exceeding standard item set;
[0204] The stage-related database extraction module is used for extracting, for each exceeding standard item, a food stage-related vector corresponding to the exceeding standard item from a pre-set item stage-related database;
[0205] The stage sorting module is used for calculating the sum of the stage-related coefficients in all food stage-related vectors, and generating a first-order food safety attention sequence according to the calculation result;
[0206] The Internet of Things data acquisition module is used for acquiring Internet of Things data of the food in various stages such as processing, transportation, storage and sales;
[0207] The safety impact element extraction module is used for extracting safety impact elements from the Internet of Things data of each stage to form a safety impact element data set of each stage;
[0208] The safety impact analysis model is used for inputting the safety impact element data set of each stage into a pre-constructed safety impact analysis model to obtain the food safety impact parameter corresponding to the stage;
[0209] The impact correction and sorting module is used for correcting the sum of the related coefficients in the first-order food safety attention sequence based on the food safety impact parameter of each stage, and generating a second-order food safety attention sequence according to the corrected result;
[0210] The traceability result determination module is configured to select a stage with the largest value from the second-order food safety concern sequence as a result of food safety traceability.
[0211] By automating food safety detection and data comparison, human error is reduced and efficiency is improved; by quantifying different stages of food safety risk factors, it helps identify which links will have food safety problems; by using Internet of Things technologies such as sensors, RFID tags, etc., real-time data collection is achieved to ensure data accuracy and timeliness; by analyzing Internet of Things data, key factors affecting food safety are extracted to improve the accuracy of problem identification; by using machine learning or other advanced data analysis techniques, the safety impact factors of each stage are analyzed to provide accurate risk assessment; by dynamically adjusting the focus points according to the latest data analysis results, new food safety risks can be discovered in a timely manner; by comprehensive analysis to determine the root cause of food safety problems, scientific basis is provided for regulatory authorities to improve decision-making accuracy; by allowing more data sources and technical improvements in the future, better response to changing food safety challenges is facilitated; by providing detailed food supply chain information, consumer and regulatory confidence in food safety is improved; by combining Internet of Things technology and advanced data analysis methods, an efficient, accurate and comprehensive solution for food safety supervision is provided to improve food safety management efficiency and enhance the prevention capability of food safety problems.
[0212] The various variations and specific embodiments of the food safety traceability method based on the Internet of Things in the foregoing embodiment one are also applicable to the food safety traceability system based on the Internet of Things in the present embodiment. Through the foregoing detailed description of the food safety traceability method based on the Internet of Things, those skilled in the art can clearly understand the implementation method of the food safety traceability system based on the Internet of Things in the present embodiment. Therefore, in order to make the description brief, the implementation method of the food safety traceability system based on the Internet of Things in the present embodiment will not be described in detail here.
[0213] In addition, the present application also provides an electronic device, including a bus, a transceiver, a memory, a processor and a computer program stored in the memory and executable on the processor, the transceiver, the memory and the processor are connected through the bus, the computer program is executed by the processor to realize each process of the method for controlling output data, and the same technical effect can be achieved, to avoid repetition, which will not be described here.
[0214] The above only describes the preferred embodiments of the present application. It should be noted that for those skilled in the art, without departing from the technical principles of the present application, several improvements and modifications can be made, which should also be considered as the protection scope of the present application.
Claims
1. A food safety traceability method based on Internet of Things, characterized in that, The method comprises: safety detection is carried out on the food, and a food safety quality detection set is obtained; the food safety quality detection set comprises detection results of multiple items; the food safety quality detection set is compared with a food safety quality standard set, and items with detection results exceeding the standard are extracted and summarized to obtain a food safety exceeding standard item set; for each exceeding standard item, a food stage related vector corresponding to the exceeding standard item is extracted from a preset item stage related database; the sum of the processing stage related coefficient, the transportation stage related coefficient, the storage stage related coefficient and the sales stage related coefficient in all food stage related vectors is calculated, and each stage is sorted according to the calculation result to obtain a first-order food safety attention sequence; Internet of Things data of each stage of the food is collected, and safety influence element extraction is performed on the Internet of Things data of each stage to obtain a safety influence element data set of each stage; for each stage safety influence element data set, input into a pre-constructed safety influence analysis model to obtain the corresponding food safety influence parameter of the stage; based on the food safety influence parameters of each stage, the sum of the related coefficients in the first-order food safety attention sequence is corrected, and the first-order food safety attention sequence is sequence corrected according to the corrected result to obtain a second-order food safety attention sequence; the stage with the largest value in the second-order food safety attention sequence is taken as the food safety traceability result.
2. The IoT based food safety traceability method as claimed in claim 1 wherein, The method for obtaining the food safety exceeding standard item set comprises: obtaining a food safety quality detection set, including the results of chemical component detection, microbial detection, physical property detection and other specific detection; obtaining a food safety quality standard set, including relevant laws, regulations and standard guidelines formulated by the state and region; obtaining the highest allowable limit value of each detection item; the mathematical expression of the food safety quality standard set is: ; wherein represents the set of food safety standards and contains the highest permissible limit values for all detection items, represents the highest permissible limit value for the th detection item; After that, compare the detection results in the food safety quality detection set with the standard limits in the food safety quality standard set item by item; for each detection result When , the detection item is considered to be over the limit, where is the highest allowable limit of the detection item; all detection items exceeding the standard limit value are summarized into a set to form a food safety exceeding standard item set; output the food safety exceeding standard item set after summarization to provide data support for subsequent analysis.
3. The IoT based food safety traceability method as claimed in claim 2 wherein, The food safety exceeding standard item set comprises: ; wherein, denotes the set of food safety over-standard items and contains all detection results exceeding the maximum allowable limit value of the detection item, denotes the set of food safety quality detection and contains the detection results of all detection items, denotes the detection result of the th detection item, denotes the maximum allowable limit value of the th detection item, denotes the detection result of the th detection item exceeds the maximum allowable limit value of the th detection item.
4. The IoT based food safety traceability method as claimed in claim 1 wherein, The food stage related vector comprises a processing stage related coefficient, a transportation stage related coefficient, a storage stage related coefficient and a sales stage related coefficient.
5. The IoT based food safety traceability method as claimed in claim 1 wherein, The method for obtaining the first-order food safety attention sequence comprises: extracting the food stage related vector of each exceeding standard item from the food stage related vector set; Each food stage related vector is: comprising a processing stage related coefficient , a transport stage related coefficient , a storage stage related coefficient and a sales stage related coefficient ; for all exceeding standard items, the sum of the processing stage related coefficient, the transportation stage related coefficient, the storage stage related coefficient and the sales stage related coefficient is calculated; the sum of the correlation coefficients for the processing phase is the sum of the correlation coefficients for the transport phase is the sum of the correlation coefficients for the storage phase is and the sum of the correlation coefficients for the sales phase is ; according to the size of the sum of the processing stage related coefficient, the transportation stage related coefficient, the storage stage related coefficient and the sales stage related coefficient, the sequence is sorted, and the sorted sequence constitutes the first-order food safety attention sequence.
6. The IoT based food safety traceability method as claimed in claim 5 wherein, The first-order food safety attention sequence comprises: ; wherein for use function, wherein represents the sum of the process phase correlation coefficients, the mathematical expression of which is: ; represents the sum of the correlation coefficients for the transport phase, which is mathematically expressed as: ; denotes the sum of the correlation coefficients for the storage phase, which is mathematically expressed as: ; represents the sum of the sales phase correlation coefficients, and is mathematically expressed as: ; an element number of a food safety over-limit item set an element number of a food safety over-limit item set 7. The IoT based food safety traceability method as claimed in claim 1 wherein, The method for constructing the safety influence analysis model comprises: data cleaning, removal of abnormal values and missing value filling are performed on the collected food safety event cases and associated Internet of Things data; The data set is subjected to feature engineering through feature selection, including temperature fluctuations, humidity changes, chemical substance exposure, physical damage, biological contamination risks, and transportation time and route; The features are standardized or normalized; A machine learning model is selected based on the characteristics of the data and available technical tools to build a safety impact analysis model; The data set is divided into a training set and a test set, and the safety impact analysis model is trained using the training set; The safety impact analysis model parameters are adjusted using grid search and random search to optimize model performance; After training, the safety impact analysis model is tested using the test set; After the safety impact analysis model is built, the safety impact factor data sets of each stage are input into the corresponding safety impact analysis model; The safety impact analysis model outputs the food safety impact parameters corresponding to each stage.
8. A food safety traceability system based on Internet of Things, characterized in that, The system comprises: A safety detection module for detecting the safety of food and obtaining a food safety quality detection set containing multiple detection items; A result comparison module for comparing the food safety quality detection set with a food safety quality standard set, extracting the items with detection results exceeding the standard into a food safety exceeding item set; A stage-related database extraction module for extracting a food stage-related vector corresponding to each exceeding item from a pre-set item stage-related database; A stage sorting module for calculating the sum of the correlation coefficients of all food stage-related vectors and generating a first-order food safety attention sequence based on the calculation results; An Internet of Things data acquisition module for acquiring Internet of Things data of food at various stages of processing, transportation, storage, and sales; A safety impact factor extraction module for extracting safety impact factors from the Internet of Things data at each stage to form a safety impact factor data set for each stage; A safety impact analysis model for inputting the safety impact factor data set of each stage into a pre-built safety impact analysis model to obtain the food safety impact parameters corresponding to the stage; An impact correction and sorting module for correcting the sum of the correlation coefficients in the first-order food safety attention sequence based on the food safety impact parameters of each stage, and generating a second-order food safety attention sequence based on the corrected results; A traceability result determination module for selecting the stage with the largest value from the second-order food safety attention sequence as the result of food safety traceability.
9. An Internet of Things based food safety traceability electronic device comprising a bus, a transceiver, a memory, a processor and a computer program stored on the memory and executable on the processor, the transceiver, the memory and the processor being connected through the bus, characterized in that, The computer program is executed by the processor to implement the steps in the method of any one of claims 1-7.
10. A computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to implement the steps in the method of any one of claims 1-7.
Citation Information
Patent Citations
Meat product quality safety tracing method based on block chain
CN111695916A
Tracing method and tracing system for agricultural product safety information
CN118278960A