Food safety event scenario deduction method, electronic device and storage medium

By combining mathematics and food safety theory, a scenario simulation model was constructed and knowledge graphs were used to analyze food safety incidents. This solved the problem of the difficulty in predicting food safety incident risks in existing technologies, realized multi-dimensional risk prediction and early warning, and improved the accuracy of response measures.

CN117371535BActive Publication Date: 2026-11-27BEIJING CENT FOR PHYSICAL & CHEM ANALYSIS
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310264943.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-03-13
Publication Date
2026-11-27
Estimated Expiration
2043-03-13

AI Technical Summary

Technical Problem

Existing technologies are insufficient to accurately predict the risks of food safety incidents from multiple dimensions, especially to analyze the causes and evolution patterns of risks, resulting in ineffective response measures.

Method used

By combining mathematical theory, food safety theory, and scenario deduction theory, a model is constructed to represent scenario elements, their attribute states, and stage transition conditions. Knowledge graphs are used for data integration and analysis to predict changes in scenario stages.

Benefits of technology

It enables multi-dimensional risk prediction and early warning of food safety incidents, improves the accuracy and effectiveness of response measures, and reduces the losses caused by incidents.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117371535B_ABST
    Figure CN117371535B_ABST
Patent Text Reader

Abstract

The application discloses a food safety event scenario deduction method, an electronic device and a storage medium. The food safety event scenario deduction method comprises the following steps: acquiring attribute states of each scenario element at each time in a current scenario stage; calculating cumulative change amounts of the attribute states of the scenario elements; judging whether the cumulative change amounts exceed a preset cumulative change range threshold; if the cumulative change amounts are greater than or equal to the preset cumulative change range threshold, predicting that the scenario stage evolves from the current scenario stage to a next stage of the current scenario stage; and if the cumulative change amounts are less than the preset cumulative change range threshold, predicting that the scenario stage remains in the current scenario stage. According to the embodiment of the application, the model is constructed, and mathematical and statistical theories and methods are used to represent the scenario elements, the attribute states of the scenario elements, and the conversion conditions of the scenario stages, so that the scenario deduction theory in the food safety direction is enriched.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of food safety technology, and in particular to a method for simulating food safety incident scenarios, an electronic device, and a storage medium. Background Technology

[0002] In related technologies, food safety emergencies are characterized by their randomness, severity, and unpredictability. To effectively prevent food safety incidents and reduce losses after they occur, many engineers use artificial intelligence (AI) to predict and warn of food safety risks. Based on the results, they take preventative measures against potential risks; this risk management model is known as the "prediction-response" model. However, AI-assisted decision-making struggles to accurately predict food supply chain risks from multiple dimensions. For example, it's difficult to predict the causes and evolution patterns of risks, primarily because these dimensions are "context-dependent." Therefore, it's necessary to summarize the causes and evolution patterns of historical food safety incidents. Based on this, future food safety incidents can be predicted, and corresponding preventative measures can be proposed, forming a "context-response" emergency management model.

[0003] In related technologies, most technicians define a scenario as the state and trend of an event's occurrence and development, specifically as a set of attribute states of event scenario elements. Environment refers to the external environment that interacts with the occurrence and development of a sudden event; a sudden event refers to the patterns of its occurrence and development, as well as its impact; emergency management refers to the emergency resources, measures, and effects taken by the event's handling entity.

[0004] Current research in related technologies mainly focuses on scenario simulation from a theoretical perspective. However, there is a slight deficiency in expressing scenario elements, their attribute states, and the transformation conditions of scenario stages through model construction, by combining mathematical models, food safety theories, and scenario simulation theories. Summary of the Invention

[0005] This invention provides a method for scenario simulation of food safety incidents, an electronic device, and a storage medium to at least solve one of the aforementioned technical problems.

[0006] In a first aspect, embodiments of the present invention provide a method for predicting food safety incident scenarios, comprising: acquiring the attribute states of each scenario element at each time point in the current scenario stage; calculating the cumulative change in the attribute states of each scenario element; determining whether the cumulative change exceeds a preset cumulative change threshold; if the cumulative change is greater than or equal to the preset cumulative change threshold, predicting that the scenario stage evolves from the current scenario stage to the next stage of the current scenario stage; and if the cumulative change is less than the preset cumulative change threshold, predicting that the scenario stage remains in the current scenario stage.

[0007] Secondly, embodiments of the present invention provide an electronic device comprising: at least one processor, and a memory communicatively connected to the at least one processor, wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to execute any of the above-described food safety incident scenario simulation methods of the present invention.

[0008] Thirdly, embodiments of the present invention provide a storage medium storing one or more programs including execution instructions, which can be read and executed by electronic devices (including but not limited to computers, servers, or network devices) to perform any of the above-described food safety incident scenario simulation methods of the present invention.

[0009] Fourthly, embodiments of the present invention also provide a computer program product, the computer program product including a computer program stored on a storage medium, the computer program including program instructions, and when the program instructions are executed by a computer, causing the computer to execute any of the above-mentioned food safety incident scenario simulation methods.

[0010] This application combines mathematical theory, food safety theory, and scenario deduction theory. Through model construction, it uses mathematical and statistical theories and methods to represent scenario elements and their attribute states, as well as the transformation conditions of scenario stages, thus enriching the scenario deduction theory in the field of food safety. Attached Figure Description

[0011] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0012] Figure 1 A flowchart of a food safety incident scenario simulation method provided in an embodiment of the present invention is used in the current device;

[0013] Figure 2 A flowchart of another food safety incident scenario simulation method provided in an embodiment of the present invention, used in the current device;

[0014] Figure 3 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. Detailed Implementation

[0015] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0016] Please refer to Figure 1 The diagram shows a flowchart of a food safety incident scenario simulation method provided by an embodiment of the present invention.

[0017] like Figure 1 As shown, in step 101, the attribute states of each scenario element at each moment in the current scenario stage are obtained;

[0018] Then, in step 102, the cumulative change in the attribute state of each scenario element is calculated;

[0019] Then, in step 103, it is determined whether the cumulative change exceeds a preset cumulative change threshold.

[0020] Then, in step 104, if the cumulative change is greater than or equal to the preset cumulative change threshold, the prediction scenario stage evolves from the current scenario stage to the next stage of the current scenario stage.

[0021] Finally, in step 105, if the cumulative change is less than the preset cumulative change threshold, the prediction scenario stage remains in the current scenario stage.

[0022] In this embodiment of the application, for step 101, it is first necessary to obtain the attribute status of each scenario element at each moment in the current scenario stage.

[0023] Specifically, a scenario can be defined as the state and trend of an event's occurrence and development. In some optional embodiments, it can be further divided into static scenarios and dynamic scenarios. A static scenario can refer to the set of state elements of a scenario at a certain moment during the event simulation process, while a dynamic scenario can refer to the set of scenario chains composed of the state of scenario elements at different moments during the event simulation process. "Food safety incident scenario simulation" can refer to the process of deriving the occurrence state and development trend of a food safety incident. In some optional embodiments, the scenario elements of a food safety incident can be analyzed from three dimensions: the event object, the disaster-bearing carrier, and emergency response activities, as shown in Table 1.

[0024] Table 1 Scenario Element Analysis

[0025]

[0026] As shown in Table 1, the object of an event can be composed of elements such as the time of occurrence, location of occurrence, people involved, stages of occurrence, risk level, risk factors, and duration. The disaster-bearing carrier can refer to the groups directly or indirectly affected by a food safety incident, including people and objects, and is also the object of the risk factors, as well as the object that needs protection and intervention in emergency response activities. Among these, "people" refers to the consumer group, including those who directly consume food contaminated by harmful factors and those indirectly affected by the incident; "objects" refers to food contaminated by harmful factors and other foods in the food supply chain that use it as a raw material. Emergency response activities consist of elements such as the implementing entity, the target of implementation, start time, end time, duration, resources used, and activity content. Among these, the implementing entity refers to food-related departments; the target of implementation can refer to the responsible party that caused the incident, the involved enterprise and its relevant responsible persons, the victim group, and the contaminated food; the resources used include the media; the activity content mainly refers to punishing the responsible party who caused the incident according to the severity of the situation, providing economic compensation and free medical treatment to the victim group, and recalling and destroying the contaminated food.

[0027] (1) A static scenario can be composed of scenario elements and their attribute states. In a specific example, the set of scenario elements is represented as follows:

[0028]

[0029] Where, p i P represents a single scenario element i, and P represents a set of scenario elements.

[0030] (2) The attribute states of a scenario element can be represented by a set of state vectors. In a specific example, it is represented as follows:

[0031] Q = {q1, q2, ..., q} i qn} (2)

[0032] q i =(q i1 q i2 , ..., q it , ..., q im ) T , t∈[1…m] (3)

[0033] Where Q represents the set of attribute state vectors of the scenario element, q i This represents the attribute state vector of scenario element i. A static scenario consists of the attribute state of a scenario element at a certain moment, while a dynamic scenario consists of the different attribute states of a scenario element at different moments. The attributes of static scenario elements at different moments have temporal relationships and together form a dynamic scenario, reflecting the development trend of the situation.

[0034] (3) There can be corresponding mapping relationships between context elements and between element attributes, and the mapping function can also change over time. In a specific example, it is represented as follows:

[0035] F q ={f p1 f p2 , ..., f pt , ..., f pn}, f pt =f(p 1t p 2t , ..., p it , ..., p nt (4)

[0036] F q ={f q1 f q2 , ..., f qt , ..., f qn}, f qt =f(q) 1t q 2t , ..., q it , ..., q nt (5)

[0037] Among them, F p f represents the set of mapping relationships between dynamic scenario elements. p1 f p2 , ..., f pt , ..., f pn F represents the mapping relationship between static scenario elements. q f represents the set of mapping relationships between attributes of dynamic context elements. q1 f q2 , ..., f qt, ..., f qn This indicates the mapping relationship between attributes of static context elements.

[0038] (4) The dynamic evolution set of static scenario element attribute states at different times constitutes a dynamic scenario, and the changes in element attribute states at different times are closely related to previous attribute states. Therefore, the function mapping of the evolution of the attribute state of a single scenario element from time t to time t+1 can be expressed as:

[0039] q t+1 =f t (q t X t (6)

[0040] Where, q t+1 q represents the element's attribute at time t+1. t f represents the element's properties at time t. t (q t X t X represents the function mapping relationship of element attribute changes at different times. t Other factors affecting an element at time t include: the attribute state of other situational elements, the external natural environment, and subjective human factors. For example, the attribute state of the same situational element at the next time step is mainly related to its attribute state at the previous time step. Situations are composed of other elements that interact with each other. These other factors include elements other than the element itself, as well as the external natural environment and subjective human factors. Because both the external natural environment and subjective human factors influence the attribute state of an element, other factors also include the external natural environment and subjective human factors.

[0041] Next, in step 102, the cumulative change in the attribute state of each scenario element is calculated. When the attribute state of each scenario element is obtained, the cumulative change in the attribute state of the scenario element can be calculated. Therefore, in step 103, it is determined whether the cumulative change of each scenario element exceeds a preset cumulative change threshold. Then, in step 104, if the cumulative change is greater than or equal to the preset cumulative change threshold, it is predicted that the scenario stage will evolve from the current scenario stage to the next stage; or in step 105, if the cumulative change is less than the preset cumulative change threshold, it is predicted that the scenario stage will remain at the current scenario stage. Thus, by determining whether the cumulative change exceeds the preset cumulative change threshold, changes in the scenario stage can be predicted, thereby providing early warning.

[0042] In an optional embodiment, the scenario phase may include an initial scenario, a development scenario, an evolution scenario, and a disappearance scenario. The current scenario phase may be any one of the above four scenario phases, and this application is not limited thereto.

[0043] Specifically, the initial scenario refers to the landmark scenario in which the event occurs, that is, the set of elements, attributes, and states of the initial scenario. The development scenario refers to the developmental trend of the event, a series of dynamic evolutions from small to large, from simple to complex, according to the chronological order. The evolution from the initial scenario to the development scenario is marked by an increase in the number of similar food safety incidents, a wider scope of impact, and a greater degree of harm, attracting the attention of the public and relevant departments. The evolution scenario refers to the dynamic chain of evolutionary paths, specifically the process by which an event evolves along paths of derivation, spread, and coupling, influenced by the event itself and the external environment. Derivation refers to the secondary events caused by the primary food safety incident; spread refers to the propagation of risks caused by primary and secondary events along the food supply chain; and coupling refers to the interaction between primary and secondary events, causing the event to evolve along more complex paths. The evolution from the development scenario to the evolution scenario is marked by an increase in derivation, spread, and coupling events, causing the situation to develop in a more serious direction. The disappearance scenario refers to the dynamic chain of scenarios in which the event fades away or disappears, specifically the process by which the responsible parties and relevant departments take measures, the event is properly handled, or its impact gradually disappears over time. The transition from an evolving scenario to a disappearing scenario is marked by measures taken by relevant departments, which gradually reduce the severity of the incident and decrease public attention.

[0044] The scenario simulation phase is divided into four stages: initial scenario, development scenario, evolution scenario, and disappearance scenario. Each stage can contain many different moments, and the time sets of different stages can constitute the scenario time set, as shown below:

[0045] T = {T1, T2, T3, T4} (7)

[0046] Where T represents the scenario time set, and T1, T2, T3, and T4 represent the time sets of the initial scenario, the development scenario, the evolution scenario, and the disappearance scenario, respectively. The state of scenario element attributes gradually changes over time. A necessary and sufficient condition for the evolution of a scenario deduction stage could be, for example, that the cumulative change in the state of scenario element attributes exceeds a certain threshold. In a specific example, the conditions for scenario stage transitions can be represented by a formula. Through theoretical model construction, the cumulative change in the state of individual scenario element attributes is first quantified, and then the cumulative change in the state of all scenario element attributes is quantified.

[0047] (1) By constructing a reasonable quantitative index for the attribute state of scenario elements, the index can be quantified. To allow for the subtraction of attribute state vectors at different times and to measure the change in attribute state at different times, the initial state of the scenario elements is added to the attribute state vector of the scenario elements in stage T, as shown below:

[0048]

[0049]

[0050] in, This represents the attribute state vector of scenario element i in stage T. This represents the attribute state vector of scenario element i when the scenario phase transitions to phase T+1, with the newly added element q. i0 This can represent the attribute state of element i before the event occurs. As the scenario evolves, the cumulative change in the attribute state of a single element can be represented as follows:

[0051]

[0052] in, The cumulative change in the attribute state of element i can be quantified using the Euclidean normal form. This is because changes in element state can be positive or negative, resulting in both positive and negative values ​​after subtracting element states at different times. To obtain the cumulative change value for all elements, we need to calculate the cumulative change amount, which requires summing the squares. Therefore, the Euclidean normal form can be used to solve this problem, as shown below:

[0053]

[0054] in, To calculate the cumulative change in the attribute state of scenario element i during the evolution of the scenario phase, after quantifying the attribute state vectors of multiple scenario elements, the data needs to be standardized to remove different dimensions of absolute indicators. Standardization and dimensionless measurement is equivalent to compressing each feature variable to the range of 0-1. In practice, some variables have a value range of 0-1, while others have larger values. Comparing them uniformly would lead to incorrect conclusions. Therefore, data compression is necessary, focusing only on the numerical values ​​within a feature; comparing the numerical values ​​between features is meaningless. For example, in height and weight, 168cm is taller than 160cm, and 60kg is taller than 50kg, but we cannot say that 168cm is taller than 60kg. Standardization and dimensionless measurement are necessary because they represent different values.

[0055] (2) Based on the evolution conditions of different scenario stages, the cumulative change values ​​of the attribute states of scenario elements are represented through theoretical model derivation. Since the evolution of the attribute states of different scenario elements has varying degrees of importance to food safety risks at different scenario stages, a weighting coefficient for the cumulative change values ​​of the attribute states of scenario elements needs to be added. Combining the weighting coefficient and the cumulative change values ​​of the attribute states of scenario elements, the conditions for the evolution of scenario stages can be represented. The condition derivation part uses two different expression methods, both of which are solvable. The diagonal matrix is ​​superior because it can examine the relationship between different attribute states, as shown below:

[0056] ① Based on the importance of different scenario elements to food safety risks, design a 1×n order weight coefficient matrix, denoted as γ. T Construct an n×n diagonal matrix whose diagonal elements are the cumulative changes in the state of the scenario elements' attributes, and whose remaining elements are 0, denoted as ΔQ′. T+1 .

[0057]

[0058]

[0059] Where, ΔQ′ T+1 This is the matrix of cumulative changes in element attribute states as the scenario evolves from T to T+1, γ. T This is the weight coefficient matrix. The expression for the scenario-stage evolution is:

[0060]

[0061] Using F-norm for γ T ΔQ′ T+1 Solving for the modulus, we get:

[0062]

[0063] Based on the conditions for scenario stage evolution, let β be the threshold for the cumulative change in the state of scenario element attributes during the transition from stage T to stage T+1. T+1 Then the expression for the evolution condition of the scenario stage is:

[0064] ||γ T ΔQ′ T+1 || F ≥β T+1 (16)

[0065] ② Based on the importance of different scenario elements to food safety risks, design a 1×n order weight coefficient matrix, denoted as γ. T Construct an n×1 matrix with the cumulative change values ​​of the state attributes of the scenario elements as its elements, denoted as ΔQ′. T+1 .

[0066]

[0067]

[0068] Based on the conditions for the evolution of the scenario stages, let the threshold for the cumulative change in the state of the scenario element attributes during the transition from stage T to stage T+1 be δ. T+1 Then the expression for the evolution condition of the scenario stage is:

[0069] γ T ΔQ′ T+1 ≥δ T+1 (19)

[0070] In summary, based on the research needs and objectives, reasonable quantitative indicators for the state of scenario element attributes are constructed and quantified. Based on the transformation conditions of the scenario stages, the cumulative change value of the state of scenario element attributes is calculated, thereby enabling prediction and early warning of the scenario evolution stages.

[0071] Where, β T+1 δ T+1 It can be represented as:

[0072]

[0073]

[0074] Formulas (20) and (21) are the threshold calculation formulas for the evolution of food safety incident stages, where β T+1 δ T+1 The threshold is represented by N, which can be the number of similar food safety incidents in the past 10 years. This can be used as a weighting coefficient for similar food safety incidents over the past 10 years. In a specific example, the greater the severity and impact of an event, the higher its weighting coefficient. as well as This represents the threshold for the nth food safety incident. The threshold for the evolution of the scenario stage is calculated based on already occurred events, enabling prediction and early warning of the scenario stage for newly occurring food safety incidents.

[0075] This application combines mathematical theory, food safety theory, and scenario deduction theory. Through model construction, it uses mathematical and statistical theories and methods to represent scenario elements and their attribute states, as well as the transformation conditions of scenario stages, thus enriching the scenario deduction theory in the field of food safety.

[0076] In a specific example, the design of the cumulative change threshold can be based on the weighted average of the thresholds of the scenario stage evolution of similar food safety events in the past three years. Among them, the higher the degree of harm and severity of the event, the larger the weight coefficient.

[0077] In some alternative embodiments, a knowledge graph for scenario inference models oriented towards food safety can also be constructed. Optionally, before obtaining the attribute states of each scenario element at each time step in the current scenario stage, the method further includes: extracting the scenario elements that make up the event, the relationships between the scenario elements, and the attribute states of each scenario element at different times from the food safety event data; and performing classification and association analysis on similar food safety events and mining and reasoning on the implicit relationships contained therein through the knowledge graph to form a food safety event knowledge graph.

[0078] Optionally, the cumulative change threshold can also be calculated based on the modeling of historical food safety events in the food safety event knowledge graph. Further, optionally, the modeling calculation based on historical food safety events in the food safety event knowledge graph includes: extracting each scenario element, the attribute state of each scenario element, and the relationships between scenario elements based on similar food safety events that have completed all scenario stages; constructing each scenario element vector and its attribute state vector based on the extracted scenario elements, attribute states, and relationships between scenario elements; and calculating the cumulative change threshold of the scenario stage evolution conditions of the similar food safety events based on the evolutionary patterns of the similar food safety events.

[0079] Specifically, since most existing food safety incidents are unstructured or semi-structured text-based data, widely distributed, knowledge graphs can effectively integrate fragmented, massive amounts of heterogeneous data, enabling the extraction of event elements. Knowledge graphs are represented using triplet relationship graphs, primarily through entity-relationship-entity and entity-attribute-attribute value representations. Applied to scenario simulation models, they can extract event components, relationships between elements, and attribute values ​​of elements across different spatiotemporal dimensions from a large amount of heterogeneous food safety incident data, providing data support for food safety scenario simulation models. Furthermore, through the knowledge fusion and knowledge reasoning functions of knowledge graphs, under unified standards and rules, similar types of food safety incidents can be categorized and analyzed for correlation, and implicit relationships can be mined and inferred. When a new food safety incident occurs, a food safety incident knowledge graph can be used to extract elements, attributes, and relationships from similar food safety incidents. Based on the elements, relationships, and attribute values ​​of existing events at different times and spaces, model feature vectors can be constructed—that is, the construction of scenario elements and their attribute vectors in the event evolution. Furthermore, based on the evolutionary patterns of food safety incidents in the knowledge graph ontology, thresholds for the evolutionary conditions of the scenario stages of a food safety incident can be calculated. Based on the elements and scenario stage evolution thresholds of similar food safety incidents, the scenario stages of upcoming or ongoing food safety incidents can be identified and predicted, and the evolutionary path of the food safety incident can be predicted. This further leads to the development of handling methods for similar food safety incidents in the knowledge graph, providing decision-making support for relevant departments and reducing the losses caused by food safety incidents.

[0080] Based on typical food safety incidents that have occurred in recent years, a knowledge graph for food safety scenario simulation can be constructed. The construction process of the knowledge graph can include data acquisition and processing, knowledge extraction, knowledge fusion, knowledge reasoning, knowledge storage and visualization, as detailed below. Figure 2 As shown.

[0081] Data sources mainly include structured, unstructured, and semi-structured data. Data on food safety incidents primarily originates from unstructured and semi-structured data. Big data and data mining techniques are used to perform structuring processing on unstructured and semi-structured data, such as sentence segmentation, word segmentation, and word vector pre-training on the extracted text.

[0082] Knowledge extraction is the process of extracting entities, attributes, relationships, and events from heterogeneous source data. By extracting entities, attributes, and relationships, static contextual elements of food safety events and explicit relationships between these elements can be obtained. Entity extraction results in a set of static contextual elements, while relationship extraction results in a set of mapping relationships between these elements. Since food safety event data primarily originates from unstructured data, Hidden Markov Models, Conditional Markov Models, Convolutional Neural Networks, and Recurrent Neural Networks are used for entity discrimination and extraction. Relationship extraction can be viewed as a classification problem, employing Bootstrapping supervised learning methods. Event extraction mainly includes event trigger word extraction, event type identification, event element extraction and role identification, descriptive phrase extraction, and event relationship extraction. Based on the chronological order of event occurrence, dynamic contextual elements and explicit relationships between these elements are obtained. Event extraction can also be viewed as multiple classification problems, using models such as Support Vector Machines for event element extraction and identification.

[0083] Knowledge fusion is a process of integrating, disambiguating, processing, reasoning, verifying, and updating extracted knowledge within a unified standard framework. It includes entity linking and entity merging. Entity linking primarily connects scenario entity elements extracted from food safety incidents with corresponding entity objects in the knowledge base. Entity linking mainly comprises entity disambiguation and coreference resolution. Entity disambiguation addresses the problem of entities having the same name but different meanings, while coreference resolution addresses the problem of multiple interpretations pointing to the same entity. Knowledge merging is mainly the process of obtaining knowledge input from structured data. Knowledge fusion is primarily used to address the ontology heterogeneity problem of event scenario elements. It employs ontology integration and ontology mapping methods to solve language-level and model-level mismatches, mainly including three stages: importing ontology mappings, discovering ontology mappings, and representation mappings. The discovery of ontology mappings primarily utilizes natural language processing and machine learning techniques, leveraging existing mappings in the ontology database to calculate the similarity between ontology terms and structures, and to uncover potential mapping relationships between heterogeneous ontologies.

[0084] Knowledge reasoning is the process of mining implicit triple relationships between knowledge using methods such as semantic reasoning, indirect reasoning, rule-based engine reasoning, and machine learning-based reasoning. This application primarily uses the TransE model for knowledge reasoning. The triple vector is represented as (h, r, t), where h represents the head entity vector, r represents the relation vector, and t represents the tail entity vector. Assume:

[0085] h+r=t (22)

[0086] Based on the assumptions of the above formula, the triplet scoring function of the TransE model is designed as follows:

[0087] f(h, r, t) = ||h + tt|| (23)

[0088] The loss function of TransE is further designed as follows:

[0089]

[0090] The loss function is minimized using a gradient optimization algorithm until it converges.

[0091] Knowledge is primarily stored and displayed using three methods: relational databases, RDF triple databases, and Neo4j graph databases.

[0092] In summary, utilizing knowledge graphs to construct scenario simulations for food safety incidents allows for both static analysis of the incident's elements and its current state, and dynamic observation of its evolution. By combining the scenario simulation model with the degree of change in the knowledge graph structure, the evolutionary conditions and processes of each stage of the food safety incident scenario simulation can be determined. Furthermore, by summarizing the patterns of food safety incidents caused by a series of different types of contaminants, and using the scenario simulation model and knowledge graph, the evolutionary path of food safety incidents can be predicted.

[0093] This application's embodiments study scenario simulation from both theoretical and applied perspectives. First, through the construction of a theoretical model, it provides theoretical analysis and formulaic expression for the scenario elements, attribute states of the elements, and transformation conditions of the scenario stages of food safety incidents, enriching the theoretical research on scenario simulation. Second, based on the constructed scenario simulation model for food safety incidents, and combined with typical food safety incidents, it constructs a food safety incident knowledge graph, which helps predict the evolution path and evolution stages of food safety incidents, enriching the applied research on scenario simulation.

[0094] In other embodiments, the present invention also provides a non-volatile computer storage medium storing computer-executable instructions that can execute the food safety incident scenario simulation method in any of the above method embodiments;

[0095] In one embodiment, the non-volatile computer storage medium of the present invention stores computer-executable instructions, which are configured as follows:

[0096] Get the attribute status of each scenario element at each moment in the current scenario stage;

[0097] Calculate the cumulative change in the attribute state of each scenario element;

[0098] Determine whether the cumulative change exceeds a preset cumulative change threshold;

[0099] If the cumulative change is greater than or equal to the preset cumulative change threshold, the prediction scenario stage evolves from the current scenario stage to the next stage of the current scenario stage;

[0100] If the cumulative change is less than the preset cumulative change threshold, the prediction scenario stage remains in the current scenario stage.

[0101] Non-volatile computer-readable storage media may include a stored program area and a stored data area, wherein the stored program area may store an operating system and an application program required for at least one function; the stored data area may store data created based on the use of the food safety incident scenario simulation device, etc. Furthermore, the non-volatile computer-readable storage medium may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other non-volatile solid-state storage device. In some embodiments, the non-volatile computer-readable storage medium may optionally include memory remotely configured relative to the processor, and this remote memory may be connected to the food safety incident scenario simulation 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.

[0102] This invention also provides a computer program product, which includes a computer program stored on a non-volatile computer-readable storage medium. The computer program includes program instructions, which, when executed by a computer, cause the computer to perform any of the above-mentioned food safety incident scenario simulation methods.

[0103] Figure 3 This is a schematic diagram of the structure of the electronic device provided in the embodiment of the present invention, such as... Figure 3 As shown, the device includes one or more processors 310 and a memory 320. Figure 3 Taking a processor 310 as an example, the device for the food safety incident scenario simulation method may also include an input device 330 and an output device 340. The processor 310, memory 320, input device 330, and output device 340 can be connected via a bus or other means. Figure 3 Taking a bus connection as an example, the memory 320 is the aforementioned non-volatile computer-readable storage medium. The processor 310 executes various server functions and data processing by running non-volatile software programs, instructions, and modules stored in the memory 320, thereby implementing the food safety incident scenario simulation method described in the above embodiment. The input device 330 can receive input digital or character information and generate key signal inputs related to user settings and function control of the food safety incident scenario simulation device. The output device 340 may include a display screen or other display device.

[0104] The above-described product can execute the method provided in the embodiments of the present invention, and has the corresponding functional modules and beneficial effects for executing the method. Technical details not described in detail in this embodiment can be found in the method provided in the embodiments of the present invention.

[0105] In one embodiment, the above-mentioned electronic device is applied in a food safety incident scenario simulation device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to:

[0106] Get the attribute status of each scenario element at each moment in the current scenario stage;

[0107] Calculate the cumulative change in the attribute state of each scenario element;

[0108] Determine whether the cumulative change exceeds a preset cumulative change threshold;

[0109] If the cumulative change is greater than or equal to the preset cumulative change threshold, the prediction scenario stage evolves from the current scenario stage to the next stage of the current scenario stage;

[0110] If the cumulative change is less than the preset cumulative change threshold, the prediction scenario stage remains in the current scenario stage.

[0111] The electronic devices described in this application exist in various forms, including but not limited to:

[0112] (1) Mobile communication devices: These devices are characterized by their mobile communication capabilities and primarily aim to provide voice and data communication. These terminals include: smartphones (e.g., iPhones), multimedia phones, feature phones, and low-end phones, etc.

[0113] (2) Ultra-mobile personal computer devices: These devices fall under the category of personal computers, possessing computing and processing capabilities, and generally also have mobile internet access features. These terminals include PDAs, MIDs, and UMPCs, such as the iPad.

[0114] (3) Portable entertainment devices: These devices can display and play multimedia content. This category includes: audio and video players (e.g., iPods), handheld game consoles, e-book readers, as well as smart toys and portable car navigation devices.

[0115] (4) Server: A device that provides computing services. The components of a server include a processor, hard disk, memory, system bus, etc. Servers are similar to general computer architectures, but because they need to provide highly reliable services, they have higher requirements in terms of processing power, stability, reliability, security, scalability, and manageability.

[0116] (5) Other electronic devices with data interaction functions.

[0117] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.

[0118] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., including several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods of various embodiments or some parts of embodiments.

[0119] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for simulating food safety incident scenarios, comprising: Obtain the attribute states of each scenario element at each moment in the current scenario stage. The scenario elements include elements from the event object dimension, elements from the disaster-bearing carrier dimension, and elements from the emergency response activity dimension. The cumulative change in the attribute state of a single scenario element is represented as follows: ; in, This indicates the attribute state of element i when the event has not occurred. express Stage Context Elements The attribute state vector, The scenario phase is transformed into During the phase, scenario elements The attribute state vector, Representative elements The cumulative change in the attribute state; The cumulative change in the attribute states of multiple scenario elements is represented in the following way: based on the importance of different scenario elements to food safety risks, a design is made. The weight coefficient matrix of order 1 is denoted as The diagonal elements are constructed as the cumulative change values ​​of the context element attribute states, while the remaining elements are 0. A diagonal matrix of order 1, denoted as ; set up phased The threshold for the cumulative change in the state of the scenario element attributes during the phase transition is Then the expression for the evolution condition of the scenario stage is: , in, This indicates that the F-norm is used. Solve for the modulus; Design based on the importance of different scenario elements to food safety risks The weight coefficient matrix of order 1 is denoted as Construct a system with elements based on the cumulative change values ​​of the state attributes of scenario elements. An ordinal matrix, denoted as ; Based on the conditions for the evolution of the scenario stages, let's assume... phased The threshold for the cumulative change in the state of the scenario element attributes during the phase transition is Then the expression for the evolution condition of the scenario stage is: ; Calculate the cumulative change in the attribute state of each scenario element; Determine whether the cumulative change exceeds a preset cumulative change threshold; If the cumulative change is greater than or equal to the preset cumulative change threshold, the prediction scenario stage evolves from the current scenario stage to the next stage of the current scenario stage; If the cumulative change is less than the preset cumulative change threshold, the prediction scenario stage remains in the current scenario stage.

2. The method according to claim 1, wherein, The scenario stages include an initial scenario, a development scenario, an evolution scenario, and a disappearance scenario. The evolutionary indicators from the initial scenario to the development scenario include the increase in the number of similar food safety incidents exceeding a quantity threshold, the scope of impact exceeding a preset range, the degree of harm exceeding a preset degree threshold, and / or the degree of social attention exceeding a first preset degree threshold. The evolutionary markers from the development scenario to the evolutionary scenario include the increment of relevant events exceeding a preset increment threshold; The evolutionary indicators from the evolving scenario to the disappearing scenario include a cumulative decrease in the severity of the event that is greater than or equal to a preset threshold and / or a cumulative decrease in social attention that is greater than or equal to a second preset attention threshold.

3. The method according to any one of claims 1 or 2, wherein, Before obtaining the attribute states of each scenario element at each time step in the current scenario phase, the method further includes: Extract the various scenario elements that make up the event, the relationships between the scenario elements, and the attribute states of the scenario elements at different times from the food safety event data; By using knowledge graphs to classify and analyze similar food safety incidents, and to mine and reason about the implicit relationships contained therein, a food safety incident knowledge graph is formed.

4. The method according to claim 3, wherein, The cumulative change threshold is calculated based on modeling historical food safety events in the food safety event knowledge graph.

5. The method according to claim 4, wherein, The modeling and calculation based on historical food safety events in the food safety event knowledge graph includes: Based on similar food safety incidents that have completed all scenario stages, extract the scenario elements, the attribute states of the scenario elements, and the relationships between the scenario elements. Based on the extracted scenario elements, the attribute states of each scenario element, and the relationships between the scenario elements, the vectors of each scenario element and their attribute state vectors are constructed. Based on the evolutionary patterns of similar food safety incidents, the cumulative change threshold of the evolutionary conditions of the scenario stages of similar food safety incidents is calculated.

6. An electronic device comprising: At least one processor, and a memory communicatively connected to the at least one processor, wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the steps of the method according to any one of claims 1 to 5.

7. A storage medium having a computer program stored thereon, characterized in that, When the program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Urban cellular automaton scene simulation method and terminal equipment

    CN110059385A

  • Security event scene deduction construction method, system and device and medium

    CN110348578A