A food safety supervision method and device based on digital twinning and a medium

By constructing digital twins and risk prediction models, the problem of regulatory lag in the food safety supervision system has been solved, enabling timely detection and precise handling of potential risks, and improving the efficiency and accuracy of food safety supervision.

CN122175381APending Publication Date: 2026-06-09GUANGZHOU SMART AGRI SERVICE CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
GUANGZHOU SMART AGRI SERVICE CO LTD
Filing Date
2026-04-23
Publication Date
2026-06-09

AI Technical Summary

Technical Problem

Existing food safety regulatory systems rely on real-time sensor readings, making it difficult to detect potential risks in a timely manner, resulting in regulatory lag and inefficiency.

Method used

Construct a digital twin synchronized with the physical food supervision scenario, combine it with a risk prediction model to predict risks, analyze real-time monitoring data through state correlation analysis, generate abnormal traceability relationship links, and output a set of correction instructions.

Benefits of technology

It has improved the foresight of risk detection and the accuracy and timeliness of corrective action, thus achieving high efficiency and foresight in food safety supervision.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122175381A_ABST
    Figure CN122175381A_ABST
Patent Text Reader

Abstract

The embodiment of the application discloses a food safety supervision method and device based on digital twinning and a medium. The technical scheme provided by the embodiment of the application can realize multi-physical entity associated risk prediction and full-link traceability correction of food safety supervision by introducing a digital twin body synchronized with a physical scene and combining a risk prediction model based on entity state association, thereby improving the foresight of risk discovery and the accuracy and timeliness of risk correction processing, and meeting the foresight and efficiency requirements of food safety supervision scenarios for food safety risk monitoring.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to a food safety supervision method, device and medium based on digital twins. Background Technology

[0002] Currently, in food safety supervision scenarios, sensor-based monitoring methods are commonly used to reduce food safety risks. This involves deploying various sensors in food production, storage, and processing environments (such as kitchens and warehouses) to collect real-time data on temperature, humidity, and images. When the data detected by the sensors exceeds a preset safety threshold, the monitoring system triggers an alarm mechanism to alert operators or management personnel to an abnormal situation.

[0003] However, existing sensor-based monitoring methods only perform discrete data acquisition and one-way threshold comparison alarms. Their regulatory actions rely on real-time sensor readings, making it difficult to detect potential safety risks in a timely manner. Furthermore, after a safety alarm is triggered, manual investigation of each related link is required to trace the abnormal node, resulting in significant delays and low efficiency in the entire food safety regulatory process. Summary of the Invention

[0004] This application provides a food safety supervision method, device, and medium based on digital twins. It can introduce a digital twin synchronized with the physical scene and combine it with a risk prediction model based on the correlation between entity states to predict risks, thereby improving the foresight of risk discovery and the accuracy and timeliness of risk correction and handling. This solves the technical problems of lagging risk monitoring and low supervision efficiency in existing food safety supervision systems.

[0005] In a first aspect, embodiments of this application provide a food safety supervision method based on digital twins, comprising: Construct a digital twin that is synchronized with the physical food supervision scenario. The digital twin includes multiple physical entities in the physical food supervision scenario and the monitoring status of the physical entities. The physical entities include personnel, equipment, food ingredients and environmental information. The system acquires real-time monitoring data for each physical entity in the physical food supervision scenario, inputs the real-time monitoring data into a pre-built risk prediction model for risk prediction, outputs the corresponding risk prediction results, and updates the monitoring status of the corresponding physical entity based on the real-time monitoring data and risk prediction results. The risk prediction model is used to perform state evolution analysis based on the state correlation between each physical entity and the corresponding real-time monitoring data, and outputs the corresponding risk prediction results. In the event of an abnormal risk event in the risk prediction results, multiple target entities associated with the abnormal risk event are identified from the physical entities based on the state correlation relationship, and an abnormal traceability relationship link is generated based on the target entities. A correction instruction set is output based on the traceability relationship link to process the abnormal risk event.

[0006] Furthermore, based on the state relationships between various physical entities and the corresponding real-time monitoring data, state evolution analysis is performed to output corresponding risk prediction results, including: Based on state correlation, a corresponding subset of monitoring data is selected from the real-time monitoring data; Image features are obtained by identifying image data within a subset of monitoring data, and compliance and abnormal behavior predictions are made based on historical behavior patterns learned by the risk prediction model. Image features include personnel operation behavior features, equipment status features, and food visual features. The sensor data within the monitoring data subset are identified to obtain parameter features. Based on the historical parameter patterns learned by the risk prediction model, the parameter features are used to predict the state trend and threshold exceedance. The parameter features include environmental parameter time series features and equipment operation parameter features. The risk prediction results are calculated by integrating the prediction results of compliance prediction, abnormal behavior prediction, status trend prediction and threshold exceedance prediction.

[0007] Furthermore, the prediction results from compliance prediction, abnormal behavior prediction, state trend prediction, and threshold exceedance prediction are fused and calculated, including: Based on the predefined entity influence weights of state association relationships, the prediction results of compliance prediction, abnormal behavior prediction, state trend prediction, and threshold over-limit prediction are weighted and fused for calculation.

[0008] Furthermore, the training process for the risk prediction model includes: Collect historical monitoring data and corresponding historical risk event labeling data for physical food regulatory scenarios; Based on the state correlation, the corresponding historical monitoring data is selected and input into the risk prediction model for model training, and the loss function is calculated based on the model output and the historical risk event labeled data. The model parameters are iteratively adjusted based on the loss function until the risk prediction model converges.

[0009] Furthermore, before inputting real-time monitoring data into a pre-built risk prediction model for risk prediction, the following steps are also included: Based on the business logic and spatial structure of physical food supervision scenarios, the state association relationships between multiple physical entities are defined. The state association relationships include at least one of the following: food delivery link relationship information, entity spatiotemporal adjacency relationship information, and event association impact relationship information.

[0010] Furthermore, the correction instruction set includes at least one of the following: control instructions for adjusting the operating parameters of specified equipment, prompting instructions for prompting target personnel to perform specific operations, instructions for handling specified ingredients, and operational instructions for triggering cleaning and disinfection of the target environment.

[0011] Furthermore, in cases where abnormal risk events exist in the risk prediction results, the method also includes: Real-time monitoring data is input into a preset simulation model for simulation verification, and the simulation verification results are output. The simulation model simulates the state evolution of the corresponding physical entity based on the real-time monitoring data and state correlation of the corresponding physical entity. The risk prediction results are verified based on the simulation results, and the monitoring status of the corresponding physical entities in the digital twin is updated.

[0012] In a second aspect, embodiments of this application provide a food safety monitoring device based on digital twins, comprising: The construction module is used to build a digital twin that is synchronized with the physical food supervision scenario. The digital twin contains multiple physical entities in the physical food supervision scenario and the monitoring status of the physical entities. The physical entities include personnel, equipment, food and environmental information. The prediction module is used to acquire real-time monitoring data of each physical entity in the physical food supervision scenario, input the real-time monitoring data into the pre-built risk prediction model to make risk predictions, output the corresponding risk prediction results, and update the monitoring status of the corresponding physical entity based on the real-time monitoring data and risk prediction results; the risk prediction model is used to perform state evolution analysis based on the state correlation between each physical entity and the corresponding real-time monitoring data, and output the corresponding risk prediction results. The correction module is used to identify multiple target entities associated with the abnormal risk events from physical entities based on state correlation when there are abnormal risk events in the risk prediction results, generate an abnormal traceability link based on the target entities, and output a correction instruction set based on the traceability link to process the abnormal risk events.

[0013] In a third aspect, embodiments of this application provide an electronic device, including: Memory and one or more processors; The memory is used to store one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the digital twin-based food safety supervision method as described in the first aspect.

[0014] In a fourth aspect, embodiments of this application provide a storage medium containing computer-executable instructions, which, when executed by a computer processor, are used to perform the food safety supervision method based on digital twins as described in the first aspect.

[0015] This application embodiment constructs a digital twin synchronized with the physical food supervision scenario. The digital twin includes multiple physical entities in the physical food supervision scenario and their corresponding monitoring status. The physical entities include personnel, equipment, ingredients, and environmental information. Real-time monitoring data for each physical entity in the physical food supervision scenario is acquired, and the real-time monitoring data is input into a pre-constructed risk prediction model for risk prediction. The model outputs the corresponding risk prediction results and updates the monitoring status of the corresponding physical entities based on the real-time monitoring data and the risk prediction results. The risk prediction model is used to perform state evolution analysis based on the state correlation between each physical entity and the corresponding real-time monitoring data, and outputs the corresponding risk prediction results. In the event of an abnormal risk event in the risk prediction results, multiple target entities associated with the abnormal risk event are determined from the physical entities according to the state correlation, and an abnormal traceability relationship link is generated based on the target entities. A correction instruction set is output based on the traceability relationship link to handle the abnormal risk event. By employing the aforementioned technical means, introducing a digital twin synchronized with the physical scene, and combining it with a risk prediction model based on the correlation between entity states, risk prediction can be achieved for multiple physical entities, and full-chain traceability and correction can be carried out. This improves the foresight of risk discovery and the accuracy and timeliness of risk correction and handling, thus meeting the needs of food safety supervision scenarios for forward-looking and efficient food safety risk monitoring. Attached Figure Description

[0016] Figure 1 This is a flowchart of a food safety supervision method based on digital twins provided in Embodiment 1 of this application; Figure 2 This is a flowchart of the risk prediction model in Embodiment 1 of this application; Figure 3 This is a flowchart of the training process for the risk prediction model in Embodiment 1 of this application; Figure 4 This is a simulation verification flowchart of the risk prediction results in Embodiment 1 of this application; Figure 5 This is a schematic diagram of the structure of a food safety monitoring device based on digital twin provided in Embodiment 2 of this application; Figure 6 This is a schematic diagram of the structure of an electronic device provided in Embodiment 3 of this application. Detailed Implementation

[0017] To make the objectives, technical solutions, and advantages of this application clearer, specific embodiments of this application will be described in further detail below with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are merely for explaining this application and not for limiting it. It should also be noted that, for ease of description, only the parts relevant to this application are shown in the drawings, not all of them. Before discussing exemplary embodiments in more detail, it should be mentioned that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although the flowcharts describe operations (or steps) as sequential processes, many of these operations can be performed in parallel, concurrently, or simultaneously. Furthermore, the order of the operations can be rearranged. The process can be terminated when its operation is completed, but may also have additional steps not included in the drawings. The process can correspond to a method, function, procedure, subroutine, subprogram, etc.

[0018] Example 1: Figure 1 A flowchart of a food safety supervision method based on digital twins, provided in Embodiment 1 of this application, is given. This method can be executed by a food safety supervision device based on digital twins. This device can be implemented through software and / or hardware, and can consist of two or more physical entities, or a single physical entity. Generally, this device can be a server host for food safety supervision, a backend monitoring device, or other processing equipment.

[0019] The following description uses a digital twin-based food safety monitoring device as an example to illustrate the implementation of the digital twin-based food safety monitoring method. (Refer to...) Figure 1 This food safety supervision method based on digital twins specifically includes: S110. Construct a digital twin synchronized with the physical food supervision scenario. The digital twin includes multiple physical entities in the physical food supervision scenario and the monitoring status of the physical entities. The physical entities include personnel, equipment, food ingredients and environmental information.

[0020] The food safety monitoring equipment of this application, when implementing food safety monitoring methods, first constructs a digital twin corresponding to the physical food monitoring scenario to achieve efficient food safety monitoring. The physical food monitoring scenario refers to the collection of real physical spaces and entities involved in food processing, storage, and supply, including specific environments such as kitchens, warehouses, and food preparation areas, as well as personnel within these environments, operating equipment, flowing ingredients, and related environmental parameters (such as temperature and humidity). This scenario is the physical environment directly affected by regulatory actions, and its state is monitored through corresponding sensors. The digital twin refers to a virtualized model that maps the physical food monitoring scenario in the information space. Through digital modeling, the digital twin creates corresponding digital images with attributes, states, and behaviors for the entities (personnel, equipment, ingredients, environment) in the physical scenario, and defines the relationship network between them according to physical rules and business logic. Driven by real-time monitoring data of each physical entity, it evolves synchronously with the physical food monitoring scenario, thus facilitating regulators' intuitive understanding of the dynamic changes in the entire food monitoring scenario.

[0021] Specifically, when constructing a digital twin synchronized with the physical food supervision scenario, a 3D model corresponding to specific environments such as the kitchen, warehouse, and food preparation area is first built. Then, based on the basic information obtained from the on-site deployed sensor network, business management system, and manual input interfaces, physical entities such as personnel, equipment, ingredients, and environmental areas in the physical food supervision scenario are uniquely identified and digitally defined, creating corresponding digital mirrors for each in virtual space. Each digital mirror records its static attributes (such as equipment model, personnel position, and ingredient category) and monitoring status. The monitoring status can be a data structure composed of multi-dimensional variables. Through this monitoring status, the real-time status of different physical entities can be dynamically displayed, allowing back-end supervisors to understand the overall situation of the physical food supervision scenario.

[0022] S120. Obtain real-time monitoring data for each physical entity in the physical food supervision scenario, input the real-time monitoring data into a pre-built risk prediction model for risk prediction, output the corresponding risk prediction results, and update the monitoring status of the corresponding physical entity based on the real-time monitoring data and the risk prediction results; the risk prediction model is used to perform state evolution analysis based on the state correlation between each physical entity and the corresponding real-time monitoring data, and output the corresponding risk prediction results.

[0023] Based on the aforementioned digital twin, food safety monitoring equipment further acquires real-time monitoring data from various physical entities and inputs it into a risk prediction model for analysis and prediction. Specifically, it obtains real-time monitoring data streams through various sensors deployed in the physical environment (such as temperature and humidity sensors, gas sensors, and visual cameras), which are then input into a pre-built risk prediction model for risk prediction. Furthermore, the food safety monitoring equipment can also interface with external systems (such as procurement systems and human resources systems) to obtain relevant personnel and food-related data as real-time monitoring data.

[0024] After acquiring the aforementioned real-time monitoring data, the risk prediction model performs correlation analysis on the real-time monitoring data of multiple related entities based on the state relationships between them. State relationships represent predefined association information within the digital twin that describes the interaction and influence logic between various physical entities (personnel, equipment, food, environment). Specifically, state relationships can describe the association information between entities in terms of transportation, space, time sequence, and state influence. For example, food stored in a certain device (storage relationship), personnel operating a certain device, or the temperature of a certain area affecting adjacent food items (state influence relationship).

[0025] Based on this state correlation, when making real-time monitoring data predictions, for a physical entity, real-time monitoring data of itself and other related physical entities can be filtered and analyzed according to its relevant state correlations. For example, a risk prediction model can simultaneously analyze the real-time temperature time series data of a refrigerator, the historical storage data of a specific batch of food stored in it, and the recent operation records of the personnel managing the refrigerator. By analyzing the co-evolution of the states of these related entities, potential risk trends can be identified, and corresponding risk prediction results can be output. Thus, by integrating real-time monitoring data from multiple related physical entities for correlation analysis, the predictability of risk discovery is enhanced.

[0026] Optionally, before inputting real-time monitoring data into a pre-built risk prediction model for risk prediction, the following steps are also included: Based on the business logic and spatial structure of physical food supervision scenarios, the state association relationships between multiple physical entities are defined. The state association relationships include at least one of the following: food delivery link relationship information, entity spatiotemporal adjacency relationship information, and event association impact relationship information.

[0027] By determining the business logic and spatial structure relationships within a physical food supervision scenario, the state relationships between multiple physical entities are defined accordingly. These state relationships primarily include: food transport link information, describing the sequentially associated entity nodes (such as warehouse shelves, handling tools, washing pools, processing tables, cooking equipment, and food preparation tables) and their order in relation to business logic, from food entry, storage, processing to finished product; entity spatiotemporal adjacency information, defining the relationships between entities that are spatially adjacent or temporally connected based on the actual layout of the physical scenario. For example, different knives on the same workbench may have a risk of cross-contamination due to their proximity, or a refrigerator and an adjacent pre-processing area may have a personnel operational association due to frequent personnel movement; and event-related impact information, defining the direct or indirect impact of certain events or state changes on other entities based on business rules. For example, the completion of disinfection operations positively affects the microbial contamination risk status of that area, while a refrigeration equipment malfunction event negatively affects the freshness status of food stored in that equipment. By defining these three types of relationships, the risk prediction model can clearly identify the interrelationships between physical entities when it receives real-time monitoring data. This ensures that subsequent state evolution analysis can integrate the correlation information of different physical entities in business logic and spatial structure, thereby achieving more accurate risk prediction.

[0028] Optionally, refer to Figure 2 Based on the state relationships between various physical entities and the corresponding real-time monitoring data, state evolution analysis is performed, and corresponding risk prediction results are output, including: S1201. Based on the state correlation, filter out the corresponding monitoring data subset from the real-time monitoring data; S1202. Image features are obtained by identifying image data within the subset of monitoring data, and compliance and abnormal behavior predictions are made based on historical behavior patterns learned by the risk prediction model. Image features include personnel operation behavior features, equipment status features, and food visual features. S1203. Identify the sensor data within the subset of monitoring data to obtain parameter features, and perform state trend prediction and threshold exceedance prediction on the parameter features based on the historical parameter patterns learned by the risk prediction model. The parameter features include environmental parameter time series features and equipment operating parameter features. S1204. The prediction results based on compliance prediction, abnormal behavior prediction, status trend prediction and threshold exceedance prediction are fused and calculated to output the corresponding risk prediction results.

[0029] When conducting risk prediction, based on the predefined state relationships in the digital twin, the various types of real-time monitoring data collected are first screened. Taking the currently analyzed physical entity as the center, according to the state relationships, all physical entities associated with the current physical entity are identified, and the real-time monitoring data belonging to these identified physical entities are extracted to construct a subset of monitoring data.

[0030] After filtering the monitoring data subset, the image data within the subset (such as images collected by visual sensors in the operating area and storage area) is first identified and its features extracted using a pre-defined computer vision algorithm to obtain structured image features. Feature recognition mainly includes personnel operation behavior features extracted from video frame sequences (such as gesture trajectories, tool usage methods, and clothing compliance), equipment status features extracted from equipment monitoring images (such as dashboard readings, indicator light status, and equipment surface cleanliness), and food visual features extracted from food images (such as color, texture, and shape changes). Prior to this, the computer vision algorithm (such as a convolutional neural network) is trained according to the image features required for actual needs to achieve the corresponding image feature acquisition. There are many ways to acquire image features based on computer vision algorithms, and this application does not impose any fixed restrictions. The acquired image features are then input into a pre-trained sub-module in the risk prediction model. This sub-module infers the current features based on normal and abnormal historical behavior patterns learned from a large amount of historical data. Specifically, the submodule performs compliance prediction to quantify the degree of deviation between the current operation and the standard operating procedure; and performs abnormal behavior prediction to identify whether there are any historical or model-inferred patterns of violations (such as failure to clean according to procedures or the tendency to mix raw and cooked utensils). Thus, the prediction results for compliance and abnormal behavior are obtained based on image features.

[0031] On the other hand, for sensor data in the monitoring data subset (such as data from various environmental and equipment sensors for temperature, humidity, gas, current, etc.), parameter features are obtained through time series analysis and feature extraction. Parameter features include time series features of environmental parameters with timestamps (such as temperature curves, humidity fluctuations, and changes in specific gas concentrations) and equipment operating parameter features (such as motor current, compressor start-stop cycles, and door magnetic switch records). These parameter features are also input into another sub-module pre-trained in the risk prediction model. This sub-module analyzes the current data based on learned historical parameter patterns (such as normal equipment operating cycles, time series patterns of environmental parameters, and parameter degradation characteristics before failures) to perform state trend prediction, i.e., using time series prediction algorithms (such as LSTM) to infer the trajectory of corresponding parameters over a future period; and performs threshold exceedance prediction, i.e., based on parameter changes, predicting when an exceedance might occur, or identifying hidden risks that are not yet exceeded but are already in an abnormal fluctuation range, thus obtaining the prediction results of the state trend prediction and threshold exceedance prediction.

[0032] Subsequently, the compliance predictions and abnormal behavior predictions obtained from image analysis, along with the state trend predictions and threshold exceedance predictions obtained from sensor data analysis, are comprehensively calculated. Specifically, based on the influence weights between entities defined by state relationships, each prediction result is weighted and fused to ultimately output a comprehensive risk prediction result.

[0033] Specifically, the prediction results from compliance prediction, abnormal behavior prediction, state trend prediction, and threshold exceedance prediction are fused and calculated, including: Based on the predefined entity influence weights of state association relationships, the prediction results of compliance prediction, abnormal behavior prediction, state trend prediction, and threshold over-limit prediction are weighted and fused for calculation.

[0034] In this process, each prediction result is assigned an entity influence weight value based on the strength of the business logic impact contained in the predefined state relationships within the digital twin. The entity influence weight reflects the contribution of different entity state changes to the final comprehensive risk event. For example, for the prediction of a state trend of rising temperature in a cold storage warehouse, if the relationship definition indicates a strong influence relationship between this trend and the perishable food stored in the warehouse, then this prediction result can be assigned a higher weight value in advance.

[0035] Then, using a pre-defined fusion algorithm (such as weighted linear combination), the prediction results (quantified as risk probability values) from different analytical dimensions are weighted and comprehensively calculated using the aforementioned weights to obtain the final risk prediction result. This ensures that the final risk prediction result can more accurately reflect the overall risk situation caused by the complex interactions between entities, improving the accuracy of risk assessment and its relevance to decision-making.

[0036] Optionally, refer to Figure 3 The training process for the risk prediction model includes: S1001. Collect historical monitoring data and corresponding historical risk event labeling data for physical food supervision scenarios; S1002. Based on the state correlation, the corresponding historical monitoring data is selected and input into the risk prediction model for model training, and the loss function is calculated based on the model output results and the historical risk event labeled data. S1003. Iteratively adjust the model parameters based on the loss function until the risk prediction model converges.

[0037] Prior to this, the risk prediction model was pre-trained for risk analysis of real-time monitoring data. This involved collecting historical monitoring data and corresponding historical risk event annotation data from physical food supervision scenarios as training samples. Historical monitoring data came from sensors, video recordings, and operational logs, while historical risk event annotation data was generated by labeling monitoring data for corresponding time periods based on actual safety events (such as food spoilage or operational accidents), indicating the risk type, occurrence time, and scope of impact. During training, the corresponding historical monitoring data was first selected as input to the model based on state relationships. Then, the corresponding sub-modules of the risk prediction model were trained using image data and sensor data from the historical monitoring data. This allowed the model to simulate the context information of a specific risk event in each training iteration, selecting a subset of historical monitoring data corresponding to the set of entities logically related to the event as input. This ensured the model could learn the risk evolution patterns of mutual influence between entities. The two sub-modules extracted and reasoned about the features of the corresponding historical monitoring data according to the aforementioned prediction methods for compliance prediction, abnormal behavior prediction, state trend prediction, and threshold exceedance prediction, and then obtained the model output by fusing the prediction results. A loss function is calculated based on the model output and historical risk event annotation data. This function measures the difference between the model's predicted risk (such as the predicted risk type, probability, and timing) and the actual annotation. Based on this loss function, the model parameters are iteratively adjusted through backpropagation, thereby driving the model to gradually correct its rules for multi-source data fusion, temporal pattern recognition, and correlation inference. Through iterative training on a large number of data batches, the model is considered to have converged when its predictive performance on the validation set stabilizes and the loss function drops to a preset threshold. At this point, the model can learn the implicit risk generation and transmission patterns from historical data, enabling it to perform state evolution analysis and risk prediction on real-time monitoring data, and obtain the predicted risk result.

[0038] S130. In the event of an abnormal risk event in the risk prediction results, multiple target entities associated with the abnormal risk event are identified from the physical entities according to the state association relationship, and an abnormal traceability relationship link is generated based on the target entities. A correction instruction set is output according to the traceability relationship link to process the abnormal risk event based on the correction instruction set.

[0039] Based on the aforementioned risk prediction results, if the risk prediction results do not predict any abnormal risk events, the monitoring status of the corresponding physical entity in the digital twin is directly updated based on real-time monitoring data and risk prediction results. This allows users to understand the overall status of the physical food supervision scenario through the content displayed in the digital twin. When the risk prediction model outputs abnormal risk events, the process begins by identifying the physical entity with the risk (i.e., the risk source) and performs a bidirectional correlation analysis based on the predefined state relationships in the digital twin. Specifically, the food safety monitoring equipment performs reverse causal tracing to find all upstream or preceding entities that may have caused the current risk state (e.g., possible causes of food spoilage include supplier batch issues, transport vehicle temperature records, warehousing acceptance errors, storage equipment malfunctions, etc.). Simultaneously, it performs forward impact propagation analysis to determine all downstream or subsequent entities that may be affected by the current risk (e.g., which dishes the spoiled food has been used in, which meals it has been served, and the student groups that may be affected). Through this analysis process, a set of target entities associated with the abnormal risk event can be identified. Subsequently, these target entities and their relationships are integrated according to chronological order and causal relationships in business logic to generate a visualized anomaly tracing relationship chain. This chain completely demonstrates the generation, transmission, and impact path of risks. Based on this complete anomaly tracing relationship chain, precise and targeted corrective instruction sets can be generated. These instruction sets instruct relevant personnel or equipment to take specific measures to handle abnormal risk events. The content of the corrective instruction set is pre-configured according to the type, severity, and scope of impact of the abnormal risk event. For example, if the abnormal risk event is food spoilage, the corrective instruction set can be set to: instruct relevant personnel to immediately stop using the batch of food, trace and recall dishes that have already used the food, inspect and repair storage equipment, and control the triggering of the disinfection mechanism of the food storage equipment, etc.

[0040] Specifically, the correction instruction set includes at least one of the following: control instructions for adjusting the operating parameters of specified equipment, prompting instructions for prompting target personnel to perform specific operations, instructions for handling specified ingredients, and operational instructions for triggering cleaning and disinfection of the target environment.

[0041] The corrective instruction set is a collection of specific intervention measures generated after identifying and tracing abnormal risk events across the entire chain. Its purpose is to achieve accurate and rapid risk management. This instruction set includes differentiated operational commands generated specifically for different target entities within the abnormal tracing chain. Specifically, control commands for adjusting the operating parameters of designated equipment directly affect the physical equipment entity mapped by the digital twin. For example, sending a command to lower the target temperature to the refrigerator controller, or sending start / stop and parameter reset commands to disinfection equipment that is malfunctioning. Prompt commands for prompting personnel to perform specific operations are pushed to the relevant responsible persons through message interfaces (such as mobile applications, workstation screens, and voice broadcasts). For example, a message may instruct "Please immediately re-weigh batch X of ingredients" or "Please complete the disinfection check of knives in area Y within 10 minutes." Commands for disposing of designated ingredients are generated based on the predicted and traceable status of the ingredients. For example, batches of ingredients that have been determined to be at risk of spoilage are electronically locked, and isolation or scrapping commands are issued to the order system and warehouse management system to prevent them from entering the processing flow. Commands for triggering the cleaning and disinfection of the target environment are generated based on environmental monitoring anomalies or cross-contamination risk analysis, and work orders are assigned to cleaning personnel or smart devices, specifying the work area, work standards, and time limits. Corrective action sets can be issued to relevant personnel or equipment via an integrated control bus or business system interface, thereby transforming risk prediction and analysis into actual control actions and improving the timeliness, accuracy, and enforceability of regulatory responses.

[0042] Optionally, refer to Figure 4 In cases where abnormal risk events exist in the risk prediction results, the method also includes: S1301. Input the real-time monitoring data into the preset simulation model for simulation verification, and output the simulation verification results; the simulation model simulates the state evolution of the corresponding physical entity based on the real-time monitoring data and state correlation of the corresponding physical entity. S1302. Verify the risk prediction results based on the simulation verification results, and update the monitoring status of the corresponding physical entity in the digital twin.

[0043] To further enhance the reliability and accuracy of decision-making after the risk prediction model outputs an indication of an abnormal risk event, this application introduces a simulation verification process. Real-time monitoring data is input into a pre-set simulation model for verification, outputting simulation verification results. The simulation model is a computational model built based on physical rules and business logic. When the simulation model receives real-time monitoring data containing all relevant physical entities, it combines the state relationships between entities and, based on these inputs, simulates the state evolution of the physical entities related to the risk prediction in a virtual environment under different parameter assumptions over a short time period. For example, if the risk prediction indicates a continuous upward trend in cold storage temperature, potentially leading to food spoilage, the simulation model can simulate the specific temperature field change curves and their impact on the core temperature of specific food items over the next few hours based on detailed parameters such as the current temperature distribution within the cold storage, equipment cooling power, door opening logs, and environmental heat exchange coefficient. The simulation verification results output the operational trajectory of the physical entities and the probability of event occurrence derived by the model.

[0044] Based on the simulation verification results, the risk prediction results can be verified, and the monitoring status of the corresponding physical entities in the digital twin can be updated. Specifically, the prediction results output by the risk prediction model are compared and analyzed with the simulation verification results output by the simulation model. If they are consistent, the reliability of the risk warning is enhanced; if there is a discrepancy, the simulation verification results and risk prediction results can be updated in the digital twin as the monitoring status of the corresponding physical entities. For example, the monitoring status can be updated from "Risk Prediction" to different types of monitoring statuses such as "High Risk, Confirmed by Simulation" or "Risk to be Observed, Suspicious by Simulation." When discrepancies are found in the comparison analysis, manual review can be used to further confirm the risk event. This overall enhances the robustness and scientific rigor of the regulatory system in dealing with complex risks.

[0045] For example, the food safety supervision method based on digital twins of this application can be applied to a canteen or a catering company. By deploying a food safety supervision system based on digital twins within the canteen or catering company, a comprehensive digital model of the physical entity of the canteen or catering company is created, constructing a digital twin. Through IoT technology, the physical entity and the digital twin are connected in real time, ensuring that the digital twin can reflect the operational status of the physical entity in real time. Real-time monitoring data from various physical entities is continuously collected, including sensor data (such as temperature, humidity, gas concentration, etc.) and video recording data. This data is transmitted to the digital twin in real time as input to a risk prediction model. Based on rules trained on historical data, the risk prediction model analyzes the real-time monitoring data in real time, predicting potential compliance risks, abnormal behavior risks, status trend risks, and threshold exceedance risks. When the risk prediction model detects an abnormal risk event, an anomaly tracing mechanism is activated. Through traversal analysis of related links, all target entities that may be affected by the risk are identified, thereby generating a visualized anomaly tracing relationship chain to demonstrate the generation, transmission, and impact path of the risk. Furthermore, based on the anomaly tracing chain, a precise and targeted set of corrective instructions is generated. These instructions are then issued to the appropriate personnel or equipment for execution, ensuring that risks are addressed promptly and effectively.

[0046] In one embodiment, this application can also simulate risk events based on digital twins to construct corresponding emergency plans. This involves inputting the event parameters of the risk event into the digital twin. Within the digital twin, the entire process of the event is simulated and extrapolated based on the current actual personnel status, equipment status, inventory of ingredients, and the meal delivery process. Based on the simulation results, an executable emergency plan is generated. For example, for a risk event involving contaminated ingredients, the entire process from ingredient procurement and warehousing, processing, meal distribution, to student consumption can be simulated to analyze the potential scope and impact of the contaminated ingredients. Based on the simulation results, an emergency plan can be generated that includes specific measures such as stopping the use of the contaminated batch of ingredients, tracing the flow of used ingredients, cleaning and disinfecting related processing equipment and the environment, notifying affected students, and arranging health checks. Furthermore, this emergency plan can be dynamically adjusted and optimized according to the type and severity of different risk events to adapt to emergency needs in different scenarios. Therefore, by simulating risk events using digital twins, reasonable emergency plans can be developed in advance, further improving the emergency response capabilities and handling efficiency of food safety supervision.

[0047] The above describes a process involving the construction of a digital twin synchronized with the physical food supervision scenario. This digital twin includes multiple physical entities within the scenario and their corresponding monitoring statuses. These physical entities include personnel, equipment, ingredients, and environmental information. Real-time monitoring data for each physical entity within the scenario is acquired and input into a pre-built risk prediction model for risk prediction. The model outputs corresponding risk prediction results and updates the monitoring status of the corresponding physical entities based on the real-time monitoring data and the risk prediction results. The risk prediction model performs state evolution analysis based on the state relationships between physical entities and the corresponding real-time monitoring data, outputting corresponding risk prediction results. In the event of an abnormal risk event, multiple target entities associated with the abnormal risk event are identified from the physical entities based on the state relationships. An abnormal traceability link is generated based on the target entities, and a correction instruction set is output based on the traceability link to handle the abnormal risk event. By employing the aforementioned technical means, introducing a digital twin synchronized with the physical scene, and combining it with a risk prediction model based on the correlation between entity states, risk prediction can be achieved for multiple physical entities, and full-chain traceability and correction can be carried out. This improves the foresight of risk discovery and the accuracy and timeliness of risk correction and handling, thus meeting the needs of food safety supervision scenarios for forward-looking and efficient food safety risk monitoring.

[0048] Example 2: Based on the above embodiments, Figure 5 This is a schematic diagram of a food safety monitoring device based on digital twins, provided in Embodiment 2 of this application. (Reference) Figure 5 The food safety monitoring device based on digital twins provided in this embodiment specifically includes: Module 21 is used to build a digital twin that is synchronized with the physical food supervision scenario. The digital twin contains multiple physical entities in the physical food supervision scenario and the monitoring status of the physical entities. The physical entities include personnel, equipment, food and environmental information. Prediction module 22 is used to acquire real-time monitoring data of each physical entity in the physical food supervision scenario, input the real-time monitoring data into the pre-built risk prediction model for risk prediction, output the corresponding risk prediction results, and update the monitoring status of the corresponding physical entity based on the real-time monitoring data and risk prediction results; the risk prediction model is used to perform state evolution analysis based on the state correlation between each physical entity and the corresponding real-time monitoring data, and output the corresponding risk prediction results. The correction module 23 is used to determine multiple target entities associated with the abnormal risk event from the physical entities according to the state association relationship when there is an abnormal risk event in the risk prediction result, generate an abnormal traceability relationship link based on the target entities, and output a correction instruction set according to the traceability relationship link to process the abnormal risk event based on the correction instruction set.

[0049] Furthermore, based on the state relationships between various physical entities and the corresponding real-time monitoring data, state evolution analysis is performed to output corresponding risk prediction results, including: Based on state correlation, a corresponding subset of monitoring data is selected from the real-time monitoring data; Image features are obtained by identifying image data within a subset of monitoring data, and compliance and abnormal behavior predictions are made based on historical behavior patterns learned by the risk prediction model. Image features include personnel operation behavior features, equipment status features, and food visual features. The sensor data within the monitoring data subset are identified to obtain parameter features. Based on the historical parameter patterns learned by the risk prediction model, the parameter features are used to predict the state trend and threshold exceedance. The parameter features include environmental parameter time series features and equipment operation parameter features. The risk prediction results are calculated by integrating the prediction results of compliance prediction, abnormal behavior prediction, status trend prediction and threshold exceedance prediction.

[0050] Specifically, the prediction results from compliance prediction, abnormal behavior prediction, state trend prediction, and threshold exceedance prediction are fused and calculated, including: Based on the predefined entity influence weights of state association relationships, the prediction results of compliance prediction, abnormal behavior prediction, state trend prediction, and threshold over-limit prediction are weighted and fused for calculation.

[0051] Specifically, the training process for the risk prediction model includes: Collect historical monitoring data and corresponding historical risk event labeling data for physical food regulatory scenarios; Based on the state correlation, the corresponding historical monitoring data is selected and input into the risk prediction model for model training, and the loss function is calculated based on the model output and the historical risk event labeled data. The model parameters are iteratively adjusted based on the loss function until the risk prediction model converges.

[0052] Specifically, before inputting real-time monitoring data into a pre-built risk prediction model for risk prediction, the following steps are also included: Based on the business logic and spatial structure of physical food supervision scenarios, the state association relationships between multiple physical entities are defined. The state association relationships include at least one of the following: food delivery link relationship information, entity spatiotemporal adjacency relationship information, and event association impact relationship information.

[0053] Specifically, the correction instruction set includes at least one of the following: control instructions for adjusting the operating parameters of specified equipment, prompting instructions for prompting target personnel to perform specific operations, instructions for handling specified ingredients, and operational instructions for triggering cleaning and disinfection of the target environment.

[0054] Specifically, when there are abnormal risk events in the risk prediction results, the method also includes: Real-time monitoring data is input into a preset simulation model for simulation verification, and the simulation verification results are output. The simulation model simulates the state evolution of the corresponding physical entity based on the real-time monitoring data and state correlation of the corresponding physical entity. The risk prediction results are verified based on the simulation results, and the monitoring status of the corresponding physical entities in the digital twin is updated.

[0055] The above describes a process involving the construction of a digital twin synchronized with the physical food supervision scenario. This digital twin includes multiple physical entities within the scenario and their corresponding monitoring statuses. These physical entities include personnel, equipment, ingredients, and environmental information. Real-time monitoring data for each physical entity within the scenario is acquired and input into a pre-built risk prediction model for risk prediction. The model outputs corresponding risk prediction results and updates the monitoring status of the corresponding physical entities based on the real-time monitoring data and the risk prediction results. The risk prediction model performs state evolution analysis based on the state relationships between physical entities and the corresponding real-time monitoring data, outputting corresponding risk prediction results. In the event of an abnormal risk event, multiple target entities associated with the abnormal risk event are identified from the physical entities based on the state relationships. An abnormal traceability link is generated based on the target entities, and a correction instruction set is output based on the traceability link to handle the abnormal risk event. By employing the aforementioned technical means, introducing a digital twin synchronized with the physical scene, and combining it with a risk prediction model based on the correlation between entity states, risk prediction can be achieved for multiple physical entities, and full-chain traceability and correction can be carried out. This improves the foresight of risk discovery and the accuracy and timeliness of risk correction and handling, thus meeting the needs of food safety supervision scenarios for forward-looking and efficient food safety risk monitoring.

[0056] The food safety supervision device based on digital twins provided in Embodiment 2 of this application can be used to execute the food safety supervision method based on digital twins provided in Embodiment 1 above, and has corresponding functions and beneficial effects.

[0057] Example 3: This application provides an electronic device in embodiment three, referring to... Figure 6 The electronic device includes a processor 31, a memory 32, a communication module 33, an input device 34, and an output device 35. The electronic device may have one or more processors and one or more memories. The processor, memory, communication module, input device, and output device of the electronic device can be connected via a bus or other means.

[0058] Memory, as a computer-readable storage medium, can be used to store software programs, computer-executable programs, and modules, such as the program instructions / modules corresponding to the digital twin-based food safety supervision method described in any embodiment of this application (e.g., the construction module, prediction module, and correction module in a digital twin-based food safety supervision device). Memory may primarily include a program storage area and a data storage area, wherein the program storage area may store the operating system and at least one application program required for a function; the data storage area may store data created based on the use of the device, etc. Furthermore, memory may include high-speed random access memory and non-volatile memory, such as at least one disk storage device, flash memory device, or other non-volatile solid-state storage device. In some instances, memory may further include memory remotely located relative to the processor, and these remote memories can be connected to the device via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.

[0059] The communication module is used for data transmission.

[0060] The processor executes various functional applications and data processing of the device by running software programs, instructions, and modules stored in memory, thereby realizing the aforementioned food safety supervision method based on digital twins.

[0061] Input devices can be used to receive input numerical or character information, and to generate key signal inputs related to user settings and function control of the device. Output devices may include display devices such as displays.

[0062] The electronic device provided above can be used to execute the food safety supervision method based on digital twins provided in Embodiment 1 above, and has the corresponding functions and beneficial effects.

[0063] Example 4: This application embodiment also provides a storage medium containing computer-executable instructions. When executed by a computer processor, the computer-executable instructions are used to execute a food safety supervision method based on digital twins. This method includes: constructing a digital twin synchronized with a physical food supervision scenario; the digital twin containing multiple physical entities in the physical food supervision scenario and their corresponding monitoring statuses; physical entities including personnel, equipment, ingredients, and environmental information; acquiring real-time monitoring data for each physical entity in the physical food supervision scenario; inputting the real-time monitoring data into a pre-constructed risk prediction model for risk prediction; outputting corresponding risk prediction results; updating the monitoring status of the corresponding physical entities based on the real-time monitoring data and risk prediction results; the risk prediction model performing state evolution analysis based on the state correlation between physical entities and the corresponding real-time monitoring data; and outputting corresponding risk prediction results when abnormal risk events exist in the risk prediction results; determining multiple target entities associated with the abnormal risk events from the physical entities according to the state correlation, generating an abnormal traceability link based on the target entities, and outputting a correction instruction set based on the traceability link to handle the abnormal risk events.

[0064] Storage medium – any type of memory device or storage device. The term “storage medium” is intended to include: mounting media, such as CD-ROM, floppy disk, or magnetic tape devices; computer system memory or random access memory, such as DRAM, DDR RAM, SRAM, EDO RAM, Rambus RAM, etc.; non-volatile memory, such as flash memory, magnetic media (e.g., hard disk or optical storage); registers or other similar types of memory elements, etc. Storage medium may also include other types of memory or combinations thereof. Furthermore, storage medium may reside in a first computer system in which the program is executed, or it may reside in a different second computer system connected to the first computer system via a network (such as the Internet). The second computer system can provide program instructions to the first computer for execution. The term “storage medium” can include two or more storage media residing in different locations (e.g., in different computer systems connected via a network). Storage medium may store program instructions (e.g., specifically implemented as a computer program) executable by one or more processors.

[0065] Of course, the computer-executable instructions provided in the embodiments of this application are not limited to the food safety supervision method based on digital twins as described above, but can also perform related operations in the food safety supervision method based on digital twins provided in any embodiment of this application.

[0066] The food safety supervision device, storage medium, and electronic equipment based on digital twins provided in the above embodiments can execute the food safety supervision method based on digital twins provided in any embodiment of this application. For technical details not described in detail in the above embodiments, please refer to the food safety supervision method based on digital twins provided in any embodiment of this application.

[0067] The above description is merely a preferred embodiment and the technical principles employed in this application. This application is not limited to the specific embodiments described herein, and various obvious changes, readjustments, and substitutions that can be made by those skilled in the art will not depart from the scope of protection of this application. Therefore, although this application has been described in detail through the above embodiments, this application is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of this application, the scope of which is determined by the scope of the claims.

Claims

1. A food safety supervision method based on digital twins, characterized in that, include: Construct a digital twin synchronized with the physical food supervision scenario. The digital twin includes multiple physical entities in the physical food supervision scenario and the monitoring status of the physical entities. The physical entities include personnel, equipment, food ingredients and environmental information. The system acquires real-time monitoring data for each physical entity in the physical food supervision scenario, inputs the real-time monitoring data into a pre-built risk prediction model for risk prediction, outputs the corresponding risk prediction results, and updates the monitoring status of the corresponding physical entity based on the real-time monitoring data and the risk prediction results. The risk prediction model is used to perform state evolution analysis based on the state correlation between the various physical entities and the corresponding real-time monitoring data, and output the corresponding risk prediction results. In the event of an abnormal risk event in the risk prediction result, multiple target entities associated with the abnormal risk event are determined from the physical entities according to the state association relationship, and an abnormal traceability relationship link is generated based on the target entities. A correction instruction set is output according to the traceability relationship link to process the abnormal risk event based on the correction instruction set.

2. The food safety supervision method based on digital twins according to claim 1, characterized in that, The process of performing state evolution analysis based on the state relationships between the various physical entities and the corresponding real-time monitoring data, and outputting the corresponding risk prediction results, includes: Based on the aforementioned state correlation, a corresponding subset of monitoring data is selected from the real-time monitoring data; Image features are obtained by identifying image data within the subset of monitoring data, and compliance prediction and abnormal behavior prediction are performed on the image features based on the historical behavior patterns learned by the risk prediction model. The image features include personnel operation behavior features, equipment status features, and food visual features. The sensor data within the subset of monitoring data are identified to obtain parameter features, and the parameter features are used to predict state trends and threshold exceedances based on the historical parameter patterns learned by the risk prediction model. The parameter features include environmental parameter time series features and equipment operating parameter features. The risk prediction result is output by merging the prediction results of the compliance prediction, the abnormal behavior prediction, the state trend prediction, and the threshold exceedance prediction.

3. The food safety supervision method based on digital twins according to claim 2, characterized in that, The fusion calculation based on the prediction results of the compliance prediction, the abnormal behavior prediction, the state trend prediction, and the threshold exceedance prediction includes: Based on the predefined entity influence weights of the state association relationship, the prediction results of the compliance prediction, the abnormal behavior prediction, the state trend prediction, and the threshold exceedance prediction are weighted and fused for calculation.

4. The food safety supervision method based on digital twins according to claim 1, characterized in that, The training process for the risk prediction model includes: Collect historical monitoring data and corresponding historical risk event labeling data for the aforementioned physical food supervision scenarios; Based on the state correlation, the corresponding historical monitoring data is selected and input into the risk prediction model for model training, and the loss function is calculated based on the model output and the historical risk event labeled data. The model parameters are iteratively adjusted based on the loss function until the risk prediction model converges.

5. The food safety supervision method based on digital twins according to claim 1, characterized in that, Before inputting the real-time monitoring data into the pre-built risk prediction model for risk prediction, the method further includes: Based on the business logic and spatial structure of the physical food supervision scenario, the state association relationship between the multiple physical entities is defined. The state association relationship includes at least one of the following: food delivery link relationship information, entity spatiotemporal adjacency relationship information, and event association influence relationship information.

6. The food safety supervision method based on digital twins according to claim 1, characterized in that, The set of corrective instructions includes at least one of the following: control instructions for adjusting the operating parameters of specified equipment, prompting instructions for prompting target personnel to perform specific operations, instructions for handling specified ingredients, and operational instructions for triggering cleaning and disinfection of the target environment.

7. The food safety supervision method based on digital twins according to claim 1, characterized in that, In the event that an abnormal risk event exists in the risk prediction result, the method further includes: The real-time monitoring data is input into a preset simulation model for simulation verification, and the simulation verification results are output. The simulation model simulates the state evolution of the corresponding physical entity based on the real-time monitoring data and the state correlation relationship of the physical entity. The risk prediction results are verified based on the simulation results, and the monitoring status of the corresponding physical entity in the digital twin is updated.

8. A food safety monitoring device based on digital twins, characterized in that, include: The construction module is used to build a digital twin that is synchronized with the physical food supervision scenario. The digital twin includes multiple physical entities in the physical food supervision scenario and the monitoring status of the physical entities. The physical entities include personnel, equipment, food ingredients and environmental information. The prediction module is used to acquire real-time monitoring data of each physical entity in the physical food supervision scenario, input the real-time monitoring data into a pre-built risk prediction model to perform risk prediction, output the corresponding risk prediction result, and update the monitoring status of the corresponding physical entity based on the real-time monitoring data and the risk prediction result. The risk prediction model is used to perform state evolution analysis based on the state correlation between the various physical entities and the corresponding real-time monitoring data, and output the corresponding risk prediction results. The correction module is used to determine multiple target entities associated with the abnormal risk event from the physical entities according to the state association relationship when the risk prediction result shows an abnormal risk event, generate an abnormal traceability relationship link based on the target entities, and output a correction instruction set according to the traceability relationship link to process the abnormal risk event based on the correction instruction set.

9. An electronic device, characterized in that, include: Memory and one or more processors; The memory is used to store one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the food safety supervision method based on digital twins as described in any one of claims 1-7.

10. A storage medium containing computer-executable instructions, characterized in that, The computer-executable instructions, when executed by a computer processor, are used to perform the food safety supervision method based on digital twins as described in any one of claims 1-7.