Food safety risk early warning method and system
By constructing a heterogeneous logistics relationship graph, the problem of the lack of predictability in food safety risk early warning in existing technologies is solved, enabling dynamic analysis and accurate prediction of supply chain risks, and improving the stability of the supply chain and the accuracy of risk early warning.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-20
- Publication Date
- 2026-04-07
AI Technical Summary
Existing knowledge graph technology lacks predictive analysis capabilities in food safety risk early warning, making it difficult to quantify the certainty of the supplier's next delivery, and it cannot automatically increase the delay risk level of batch products when a blizzard warning appears on the path.
Construct a heterogeneous logistics relationship graph, and generate an inventory delivery certainty index by inputting entity information such as product batches, warehousing units, and transportation units, as well as external environmental attributes. Identify potential risk nodes and calculate the domino effect risk propagation path, and establish a minimum logistics intervention instruction set.
It enables proactive prediction of future risks from historical data, enhances the ability to anticipate supply chain stability, and improves the accuracy of risk warnings and the traceability of the supply chain.
Smart Images

Figure CN121810022A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of knowledge graph technology, and in particular to a food safety risk early warning method and system. Background Technology
[0002] The field of knowledge graph technology aims to describe the concepts, entities, and relationships between them in the objective world in a structured graph form, which is a semantic network technology.
[0003] Existing knowledge graph technology has limitations when applied to risk warning in dynamic and complex fields such as food safety. For example, while a knowledge graph can clearly show the transportation route of a batch of milk, it struggles to automatically increase the delay risk level of that batch when a blizzard warning is issued along that route. Furthermore, the analytical capabilities of current technologies are mostly descriptive, answering questions about what happened in the past or what the current state is, lacking built-in predictive analysis mechanisms. While it can query a supplier's historical pass rate, it struggles to quantify the certainty of its next delivery. Therefore, improvements are needed. Summary of the Invention
[0004] The purpose of this invention is to address the shortcomings of existing technologies by proposing a food safety risk early warning method and system.
[0005] To achieve the above objectives, the present invention adopts the following technical solution: a food safety risk early warning method, comprising the following steps: Enter the entity information of product batches, warehousing units, transportation units and operators, as well as the attribute information of supplier geographical location, local weather warnings and financial news, set the process relationship of "transfer to" and "store at" and the co-location relationship of "shared storage at" and "shared transportation at", connect all entities and establish a logistics heterogeneous relationship graph; Based on the heterogeneous logistics relationship graph, the historical on-time delivery rate, quantity fulfillment rate and quality pass rate of the target supplier and material combination are extracted, and the performance base score is obtained. Then, the logistics path length, extreme weather probability and negative news risk signal are retrieved from the heterogeneous logistics relationship graph to generate the inventory delivery certainty index. Based on the heterogeneous relationship graph of logistics, select the product batch of the risk source, search the downstream nodes along the "transfer to" relationship, and search the associated nodes with cross-contamination risk along the co-location relationship at each storage unit node. Summarize all nodes to obtain the potential risk node set. Calculate the risk weight of each propagation path based on the co-location time and environmental temperature and humidity attributes in the potential risk node set to obtain the domino effect risk propagation path. Based on the domino effect risk propagation path, all terminal nodes in the path are analyzed, and the corresponding current location attributes in the logistics heterogeneous relationship graph are queried to obtain the current location list of affected inventory. All entries in the current location list of affected inventory are traversed to establish a minimal logistics intervention instruction set.
[0006] Preferably, the steps for obtaining the heterogeneous logistics relationship map are as follows: Collect raw fields of product batches, warehousing units, transportation units, operators, supplier geographical locations, local weather warnings and financial news, unify coding rules and timestamp formats, parse geographical coordinates into longitude and latitude values, extract weather warning level codes, extract corresponding supplier name entries and time tags from financial news, and obtain a structured entity list. Based on the structured entity list, the "transfer to" relationship and "store in" relationship are marked according to the batch flow records. The "shared storage in" relationship is determined according to the time overlap interval and the warehouse location code. The "shared transport in" relationship is determined according to the vehicle number and the same transportation time window. Duplicate records are cleaned up and the relationship direction is fixed to obtain the relationship edge list. Based on the aforementioned relation edge list, nodes with the same globally unique identifier are merged and their attributes are retained. Nodes are connected according to relation type and attached with longitude values, latitude values, weather warning level codes, and financial news time tags. Connectivity is verified to form a heterogeneous logistics relation graph.
[0007] Preferably, the steps for obtaining the inventory delivery certainty index are as follows: Based on the heterogeneous relationship graph of logistics, the order records of target suppliers and material combinations are screened, the on-time delivery status, delivery quantity and quality inspection results of each record are extracted, and the time interval is calculated by the difference between the delivery timestamp and the current time to form a historical performance index sequence. Calculate the inventory delivery certainty index based on the aforementioned historical performance indicator sequence; Based on the inventory delivery certainty index, a threshold judgment is made, and inventory delivery certainty indices below the safety lower limit are recorded and marked as potential anomalies. The corresponding supplier and material combination information is then fed back to the risk management system.
[0008] Preferably, the steps for obtaining the set of potential risk nodes are as follows: Based on the heterogeneous relationship graph of the logistics, the product batches of the risk source are selected, and downstream nodes are searched layer by layer along the "transfer to" relationship. At each storage unit node, potential cross-contamination risk nodes are searched along the co-location relationship. Based on the time sequence and path connectivity between nodes, the same path segments are merged to form a set of potential risk nodes.
[0009] Preferably, the steps for obtaining the domino effect risk propagation path are as follows: Calculate the risk weight of the propagation path based on the set of potential risk nodes; Based on the risk weights, a threshold screening is performed on the risk weights of all propagation paths. Propagation paths with risk weights below the set threshold are removed, while paths with risk exposure indices exceeding the threshold are retained and connected in chronological order to generate domino effect risk propagation paths.
[0010] Preferably, the step of obtaining the list of current locations of the affected inventory is as follows: Based on the terminal node analysis of the domino effect risk propagation path, query the current location attribute of the terminal node in the logistics heterogeneous relationship graph, associate the terminal node with the transport vehicle number or warehouse location code, check the corresponding inventory entries by product batch and material code, and form a list of the current location of the affected inventory.
[0011] Preferably, the step of obtaining the minimum logistics intervention instruction set is as follows: Based on the list of current locations of the affected inventory, the status tags of the transport vehicle numbers or warehouse location codes are retrieved one by one. The executable range of the corresponding product batch and material code is checked. The preset "freeze outbound" or "intercept transport" action templates are matched according to the terminal node type and the execution object is recorded to generate an intervention action mapping list.
[0012] Preferably, the step of obtaining the minimum logistics intervention instruction set further includes: grouping and merging similar "intercept transportation" instructions by transport vehicle number according to the intervention action mapping list, grouping and merging similar "freeze outbound" instructions by warehouse location code, deleting instructions that are repeated for the same execution object, and retaining the entry with the largest coverage and the shortest execution chain to form the minimum logistics intervention instruction set.
[0013] This invention also provides a food safety risk early warning system, including: The data modeling module is used to input entity information such as product batches, warehousing units, transportation units, and operators, as well as attribute information such as supplier geographical location, local weather warnings, and financial news. It sets the process relationship of "transfer to" and "stored at" and the co-location relationship of "shared storage at" and "shared transportation at", connects all entities, and establishes a heterogeneous logistics relationship graph. The fulfillment analysis module is used to extract the historical on-time delivery rate, quantity fulfillment rate and quality pass rate of the target supplier and material combination based on the logistics heterogeneous relationship graph, perform calculations to obtain the basic fulfillment score, and then retrieve the logistics path length, extreme weather probability and negative news risk signal from the logistics heterogeneous relationship graph to generate the inventory delivery certainty index. The risk propagation identification module is used to select the risk source product batch according to the logistics heterogeneous relationship map, search downstream nodes along the "transfer to" relationship, and search for related nodes with cross-contamination risk along the co-location relationship at each warehousing unit node. It summarizes all nodes to obtain a set of potential risk nodes, calculates the risk weight of each propagation path based on the co-location time and environmental temperature and humidity attributes in the set of potential risk nodes, and obtains the domino effect risk propagation path. The logistics intervention decision module is used to analyze all terminal nodes in the domino effect risk propagation path, query the corresponding current location attributes in the logistics heterogeneous relationship graph, obtain the current location list of affected inventory, traverse all entries in the current location list of affected inventory, and establish a minimum logistics intervention instruction set.
[0014] Compared with the prior art, the advantages and positive effects of the present invention are as follows: This invention deeply integrates internal operating entities such as product batches and warehousing and transportation units with external environmental attributes such as supplier locations, weather warnings, and financial news. It defines transshipment and storage relationships that characterize the logistics process and shared storage and shared transportation relationships that characterize risk coupling, constructing a dynamic heterogeneous logistics relationship graph. By extracting historical performance records from the graph and combining them with real-time updated multi-dimensional risk signals such as logistics routes, weather, and public opinion, it achieves a transformation from simple historical data statistics to proactive prediction of future risks, enhancing the predictive ability of supply chain stability. When a risk event actually occurs, it can perform dual searches along direct transfer paths and cross-location paths on the graph, and quantify the risk propagation weight of each path based on physical attributes such as environmental temperature and humidity, thereby simulating the domino effect of risk and improving the accuracy of traceability. Attached Figure Description
[0015] Figure 1 This is a schematic diagram of the steps of the present invention. Detailed Implementation
[0016] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.
[0017] Please see Figure 1 This invention provides a technical solution, a food safety risk early warning method, comprising the following steps: Enter the entity information of product batches, warehousing units, transportation units and operators, as well as the attribute information of supplier geographical location, local weather warnings and financial news, set the process relationship of "transfer to" and "store at" and the co-location relationship of "shared storage at" and "shared transportation at", connect all entities and establish a logistics heterogeneous relationship graph; Based on the heterogeneous relationship graph of logistics, the historical on-time delivery rate, quantity fulfillment rate and quality pass rate of target suppliers and material combinations are extracted, and the performance base score is obtained. Then, the logistics path length, extreme weather probability and negative news risk signal are retrieved from the heterogeneous relationship graph of logistics to generate the inventory delivery certainty index. Based on the heterogeneous relationship graph of logistics, select the product batch of the risk source, search the downstream nodes along the "transfer to" relationship, and search the associated nodes with cross-contamination risk along the co-location relationship at each storage unit node. Summarize all nodes to obtain the potential risk node set. Calculate the risk weight of each propagation path based on the co-location time and environmental temperature and humidity attributes in the potential risk node set to obtain the domino effect risk propagation path. Based on the domino effect risk propagation path, analyze all terminal nodes in the path and query the corresponding current location attributes in the logistics heterogeneous relationship graph to obtain the list of current locations of affected inventory. Traverse all entries in the list of current locations of affected inventory to establish a minimal logistics intervention instruction set.
[0018] The steps for obtaining the heterogeneous relationship map of logistics are as follows: Collect raw fields of product batches, warehousing units, transportation units, operators, supplier geographical locations, local weather warnings and financial news, unify coding rules and timestamp formats, parse geographical coordinates into longitude and latitude values, extract weather warning level codes, extract corresponding supplier name entries and time tags from financial news, and obtain a structured entity list. Based on the structured entity list, mark the "transfer to" relationship and "store in" relationship according to the batch flow record, determine the "shared storage in" relationship according to the time overlap interval and the same warehouse location code, determine the "shared transport in" relationship according to the vehicle number and the same transportation time window, clean up duplicate records and fix the relationship direction to obtain the relationship edge list; Based on the relation edge list, nodes with the same globally unique identifier are merged and their attributes are retained. Nodes are connected according to relation type and attached with longitude values, latitude values, weather warning level codes and financial news time tags. Connectivity is verified to form a heterogeneous logistics relation graph.
[0019] Specifically, after collecting the original fields for product batches, storage units, transportation units, operators, supplier locations, local weather warnings, and financial news, all entities are first uniformly coded. For example, product batches use the format "product code-production date-serial number," specifically PB-XXXXXXXX-YYYYMMDD-NNNN; storage units use the format "area code-warehouse type-number," WH-AREA-TYPE-NNN; transportation units use vehicle license plates as unique identifiers, TR-XXXXXX; and operators use employee ID numbers as unique identifiers. The process begins with an identifier, OP-NNNNNN, where the supplier uses a pre-assigned supplier code, SUP-NNNNNN. Then, all time information in the records is converted to the ISO 8601 format defined by the International Organization for Standardization, i.e., YYYY-MM-DDTHH:MM:SSZ. For non-standard time expressions, such as "May 1, 2023" or Unix timestamps, format conversion is performed using a parsing program. Next, geographic location information is processed by calling a geocoding service interface to batch convert text addresses, such as "XX Province XX City XX District XX Street XX Number," to WG. Longitude and latitude values in the S-84 coordinate system are marked as requiring manual verification if conversion fails or multiple possible results are returned. The supplier's superior regional center coordinates are temporarily used as a substitute. Then, a meteorological data interface is connected to obtain weather warning information for the specified supplier's geographical location and cities along major transportation routes. A warning level code mapping table is established based on the warning type and severity; for example, blue warning is mapped to 1, yellow warning to 2, orange warning to 3, and red warning to 4. This level code is then associated with the corresponding time and geographical location. Finally, for financial news data, a BERT-based named entity recognition model is used to extract terms matching supplier names in the structured entity list. The model's input is the text data of the news article, and the output is the entity name tagged as "organization". Its model structure includes a 12-layer Transformer encoder, with a linear classification layer and a Softmax activation function connected at the top for entity category prediction for each token. This model was fine-tuned and trained on a labeled dataset containing 500,000 financial news articles using the Adam optimizer with a learning rate set to [missing information]. The batch size is 32, the training cycle is 5 rounds, the training objective is to minimize the cross-entropy loss function, after extracting the supplier name, the news release time is extracted as the time tag, and all the above standardized and structured data items are summarized to form a structured entity list.
[0020] Based on the structured entity list, scan all product batch flow records. For each record, such as a record flowing from storage unit A to storage unit B, create two basic relationships: one is the "stored in" relationship between the batch and storage unit A, and the other is the "transfer to" relationship from storage unit A to storage unit B, and attach the corresponding timestamps. Next, determine co-location relationships. For the "co-stored in" relationship, iterate through all product batch pairs stored in the same storage unit, extract their respective inbound and outbound times, and construct a time interval. and The system calculates the overlap duration between two intervals. The overlap duration is calculated as the minimum end time of the two intervals minus the maximum start time. A valid "co-storage" relationship is determined only if the overlap duration exceeds a preset storage co-location time threshold. This threshold is set based on statistical analysis of historical warehousing operation data, taking 1.5 times the average inbound operation time of all batches plus one standard deviation. For example, if the average inbound operation time is 40 minutes and the standard deviation is 10 minutes, then the threshold is set to... This process filters out invalid co-locations caused by short stops or overlapping inbound / outbound operations. For determining "co-transportation" relationships, batches with the same vehicle number in all transport records are selected, and their transport time windows are compared. The overlap duration of these time windows is also calculated. When the overlap duration exceeds a transport co-location time threshold, a "co-transportation" relationship is established. This threshold is set at 20% of the shortest trunk line transport time. For example, if the shortest inter-warehouse transport record in the database is 5 hours, the threshold is set to 1 hour to ensure that genuine same-vehicle transport events are captured. After determining all relationships, data cleanup is performed, removing completely duplicate relationship records. For example, records with identical source nodes, target nodes, relationship types, and time windows are retained as only one. Finally, the relationship direction is fixed to ensure that all "transfer to" and "store at" relationships follow the physical flow of materials, such as from the supplier to the warehouse, or from the warehouse to the downstream node. For undirected relationships such as "shared storage at" and "shared transportation at", they are uniformly ordered according to the lexicographical order of the globally unique identifiers of the nodes, pointing from the smaller identifier to the larger identifier, thereby completing the construction of the relationship edge list.
[0021] Based on the relation edge list, node integration is first performed by creating an empty graph data structure. The system iterates through all globally unique identifiers of source and target nodes in the relation edge list, creating a graph node for each unique identifier. All attribute information corresponding to that identifier is then retrieved from the structured entity list, such as product batch specifications, warehouse unit capacity, and supplier rating. These attributes are appended to the newly created node. If multiple attribute records correspond to the same globally unique identifier in the list, an attribute merging strategy is executed. For static attributes that do not change over time, such as warehouse address, consistency is checked; inconsistencies are marked as data quality issues. For dynamic attributes that change over time, such as warehouse temperature and humidity, all records are stored as time-series data in the node attributes and sorted by timestamp. Next, the relation edge list is iterated again, creating edges in the graph based on the records in the list. For each relation record, its source and target nodes are connected, and the relation type is used as the edge label. Finally, external environment attributes are appended to the corresponding nodes or edges. Specifically, the parsed longitude and latitude values of the supplier's geographical location are appended to the attributes of the supplier node and warehouse unit node. In the process, for the "transfer to" relationship edge, based on its occurrence time window and the geographical path involved, the highest weather warning level code within the corresponding spatiotemporal range is matched from the weather warning data and used as the attribute of the edge. For the "stored at" relationship edge, the highest weather warning level code of the storage unit location within the storage time period is matched. For financial news information, news entries containing specific supplier names and their publication timestamps are extracted and appended as an attribute list to the corresponding supplier node. Finally, the connectivity of the graph is checked. Starting from all nodes identified as suppliers, a breadth-first search algorithm is used to traverse the entire graph to check if any product batch node cannot be reached from any supplier node. If such isolated nodes or subgraphs exist, they are recorded, which usually indicates missing upstream supply chain data. At the same time, the number of connected components in the graph is counted. If the number of connected components exceeds a baseline value based on historical averages, such as exceeding 1.5 times the historical monthly average number of connected components, a data integrity alarm is triggered. After completing all checks, a heterogeneous logistics relationship graph with heterogeneous nodes, diverse relationships, and rich spatiotemporal and environmental attributes is finally obtained.
[0022] The steps to obtain the inventory delivery certainty index are as follows: Based on the heterogeneous relationship graph of logistics, the order records of target suppliers and material combinations are screened, the on-time delivery status, delivery quantity and quality inspection results of each record are extracted, and the time interval is calculated by the difference between the delivery timestamp and the current time to form a historical performance index sequence. Based on the historical performance indicator series, the inventory delivery certainty index is calculated using the following formula: ; in, For inventory delivery certainty index, The basic performance score is calculated using the following formula: ; in, , For the first The overall score for a single performance record. For the first The on-time delivery status of each record (0 or 1). For the first The number of records satisfies the requirement. For the first The quality score of each record is qualified. The weighting coefficients for timeliness, quantity, and quality are respectively, and satisfy the following conditions: , The time decay constant, For the first The time interval between records For the first Several risk factors, including path length risk, extreme weather risk, and negative news risk. For the first The influence weight of each risk factor For the number of risk factors, This represents the total number of records in the historical performance indicator sequence. Risk sensitivity coefficient; Based on the inventory delivery certainty index, a threshold judgment is made, and inventory delivery certainty indices below the safety lower limit are recorded and marked as potential anomalies. The corresponding supplier and material combination information is then fed back to the risk management system.
[0023] Specifically, based on the heterogeneous relationship graph of logistics, the process first uses graph query language to locate all historical order records corresponding to the target supplier and material combination. For example, executing a Cypher-like query statement: "MATCH (s:Supplier{id: 'Supplier A'})-[r:DELIVERS]->(p:Product {id: 'Material X'}) RETURNr.transactions", this query will return all transaction edges from supplier A to the company for the delivery of material X. Each edge has detailed order record attributes attached. Then, each returned order record is traversed, and fulfillment indicators are extracted item by item. For on-time delivery status, the "actual arrival time stamp" and "planned arrival time stamp" in the record are compared. If the actual arrival time is not later than the planned arrival time, the on-time delivery status is recorded as 1; otherwise, it is recorded as 0. For delivery quantity, the "actual delivery quantity" and "order demand quantity" fields are directly read. For quality inspection results, the "inbound quality inspection comprehensive score" field is extracted. This score is based on multiple indicators in the quality inspection process. For example, factors such as microbial content, ingredient purity, and packaging integrity are comprehensively evaluated and normalized to values between 0 and 1. Then, the time interval for each record is calculated by subtracting the "actual arrival timestamp" in the record from the "current system timestamp" used in this calculation, and converting the difference into days. Finally, the on-time delivery status, actual delivery quantity, order demand quantity, comprehensive quality inspection score, and calculated time interval extracted from each order record are combined into a structured data tuple. The tuples corresponding to all historical order records for a specified supplier and material combination are arranged in ascending order of "actual arrival timestamp" to form a time series dataset, which is the historical performance indicator sequence.
[0024] The inventory delivery certainty index calculation formula divides the supplier's fulfillment capability into two parts: basic performance and risk disturbances. The supplier's stable performance is assessed by using a time-weighted average of historical delivery records, where the exponential decay term... The design gives higher weight to recent data than distant data, more accurately reflecting the supplier's current status and the overall performance score for a single fulfillment. The three core dimensions of delivery—timeliness, quantity fulfillment, and quality level—are then linearly combined using weighted coefficients to form a comprehensive evaluation of a single transaction. Another part of the formula, the exponential function, is used to quantify the negative impact of external risks on delivery certainty. This part works by considering multiple independent risk factors. A comprehensive "unreliability" is calculated using a weighted geometric mean, and then further analyzed using a risk sensitivity coefficient. Adjusting its degree of influence, it ultimately acts on the basic performance basis in the form of a decay factor. In this multiplicative approach, risk weakens the underlying performance, resulting in a delivery certainty assessment that both reviews the past and looks to the future.
[0025] For the first The on-time delivery status of each record is used to characterize whether the delivery was completed on time. It is obtained by extracting the "planned delivery timestamp" from the order record nodes or relationship edges in the heterogeneous logistics relationship graph. And "Actual delivery timestamp" The value is determined by comparing these two timestamps. "When" indicates that the delivery was on time or ahead of schedule. The value is 1, when When, it indicates a delivery delay. The value is 0. For example, if an order was scheduled to be delivered before 18:00 on October 25, 2023, but was actually delivered at 16:30 on October 25, 2023, then the record's value is 0. The value is 1.
[0026] For the first The quantity satisfaction score is a continuous variable between 0 and 1, used to quantify the degree of matching between the delivery quantity and order requirements. It is obtained by extracting the "order requirement quantity" from the order records. And "actual delivery quantity" The ratio of the two is calculated using the following formula: In practice, to prevent excessive delivery from causing this value to exceed 1 and thus have unintended effects on the model, its upper limit is set to 1, i.e. For example, if an order requires 1000 kg of material, and the supplier actually delivers 990 kg, then the quantity satisfaction rate for this record is... Calculated as .
[0027] For the first The quality pass score for each record is a continuous variable ranging from 0 to 1, used to measure the quality level of delivered products. Its acquisition method depends on the company's quality inspection process upon receiving the product. During quality inspection, multiple key quality indicators of the product are tested. For example, for a certain food ingredient, five indicators might be tested, including moisture content, total bacterial count, and heavy metal residue. Each indicator is assigned a score from 0 to 100 based on the degree of deviation of its test result from the standard range. Finally, the scores of these five indicators are weighted and averaged to obtain a final comprehensive quality score. The weighting of this score is determined by experts from the quality management department using the analytic hierarchy process (AHP) based on the degree of impact of different indicators on the final safety of the product. Finally, this percentage-based comprehensive score is normalized to obtain... The calculation formula is: For example, if the overall quality inspection score of a batch of materials is 95 points, then its quality qualification score is... for .
[0028] The weighting coefficients for timeliness, quantity, and quality reflect the importance that companies place on different dimensions when evaluating supplier performance. These coefficients are based on the Analytic Hierarchy Process (AHP) and were jointly developed by experts from multiple departments, including purchasing, quality, and production. First, a judgment matrix is constructed. Experts compare the importance of each of the three criteria—timeliness, quantity, and quality—pair by pair. For example, in the food industry, quality is generally considered more important than timeliness, and timeliness is more important than minor differences in quantity. This yields a judgment matrix. Then, the largest eigenvalue and its corresponding eigenvector of this matrix are calculated, and the eigenvector is normalized to obtain the weights of each indicator. For example, if the calculated eigenvector is (0.29, 0.14, 0.57), then the weights are set accordingly. , , And the sum of the three is 1.
[0029] This is a time decay constant used to control the rate at which the weight of historical records decreases over time. Its value determines the sensitivity of the performance baseline score calculation to recent performance. The value of and the information half-life Relatedly, half-life refers to the time required for the weight of a record to decay to half that of a new record, and is calculated using the following formula: The determination of half-life is based on the analysis of the dynamics of the supply chain of a specific material. For materials with rapid market price fluctuations and frequent technological updates, the performance of suppliers is highly time-sensitive, and a shorter half-life, such as 30 days, should be set. For basic materials with stable supply chains and long-term cooperative relationships, a longer half-life, such as 180 days, can be set. For example, for a highly seasonal agricultural raw material, its supply situation changes significantly within 3 months, so an information half-life should be set. If the time decay period is 90 days, then the time decay constant is... .
[0030] For the first The time interval of the record indicates the first record. The time span between the current delivery date and the current calculation date, in days, is obtained by subtracting the number of days from the current system date when forming the historical performance indicator sequence. The date corresponding to the "actual delivery timestamp" of each record is used to obtain a day difference. This parameter changes dynamically each time the DCI is recalculated, and all historical records are updated accordingly. All of these will increase; for example, when calculated on November 1, 2023, a delivery record completed on October 15, 2023, will see an increase. Value sky.
[0031] For the first Each risk factor quantifies different types of potential risks into a numerical value between 0 and 1. This method includes three risk factors: path length risk, path length risk, and path length risk. The calculation first extracts the standard transportation path length from the supplier to the delivery location from the heterogeneous logistics relationship graph. Then, based on the transportation route length data of all suppliers over the past year, the maximum route length is determined. and minimum value Finally, the risk value is calculated using the max-min normalization formula: For example, if a supplier's transportation route is 800 kilometers, and the historical data shows a route range of [50, 2000] kilometers, then... extreme weather risks The calculation, based on the weather warning level codes (levels 1-4) obtained from the map, establishes a nonlinear mapping relationship, for example... If the warning level is 2 (yellow), then Negative news risk The calculation uses natural language processing technology to perform sentiment analysis on news related to suppliers over the past 90 days, calculating the average sentiment score for negative news. (Range -1 to 0), then If the analysis yields an average negative sentiment of -0.2, then .
[0032] For the first The impact weights of each risk factor represent the relative importance of different risk types on delivery certainty, and their settings are related to... Similarly, using the analytic hierarchy process (AHP), supply chain risk management experts were invited to conduct pairwise comparisons of three risk categories: route length, extreme weather, and negative news. A judgment matrix was constructed. For example, experts believed that extreme weather had the greatest impact on fresh food delivery, followed by route length, while the impact of negative news was relatively indirect. The weight allocation was obtained by calculating the normalized eigenvector of the judgment matrix. For instance, the final weights were determined as follows: extreme weather... Path length Negative news And the sum of the three is 1.
[0033] This is a risk sensitivity coefficient used to adjust the intensity of the reduction in the performance baseline score due to overall risk. Its value is positively correlated with the importance or criticality of the material. The weighted average method can be used to calculate the cost, taking into account the proportion of procurement cost to total cost. The probability of production line shutdown due to material shortage and the number of alternative suppliers The calculation formula is: ,in It is the maximum number of alternative suppliers among all materials. (Range 0-1) mapped to Values, such as setting , making The range is between [1, 3]. For example, a certain material accounts for 0.15% of the cost, has a production line stoppage probability of 0.8, and can be replaced by one supplier. ),but ,and then .
[0034] This represents the total number of records in the historical performance indicator sequence. It is obtained by querying the database for the total number of orders for a specific supplier and material combination within a preset time window (e.g., the past two years). For example, if the query returns 50 delivery records from the past two years, then... .
[0035] In this method, three types of risks are defined to represent the number of risk factors: path length, extreme weather, and negative news. .
[0036] Calculations based on parameters: Set up a scenario with two history records, with the following parameters: Record 1: , , , sky.
[0037] Record 2: , , , sky.
[0038] Weights and constants: , , , , .
[0039] Risk factors and their weights: , , , , .
[0040] Calculate the comprehensive score for a single performance ; Calculate the time decay term ; Calculate the inventory delivery certainty index ; Converting the result to a percentage, the DCI is 41.47.
[0041] The result indicates that the inventory delivery certainty index (DCI) for this supplier and material combination is 41.47, which is a relatively low value. Typically, the DCI score ranges from 0 to 100; a higher score indicates higher delivery certainty, and vice versa. The DCI score can be divided into several levels, for example, [85, 100] represents high certainty (safety), [60, 85) represents medium certainty (concern), and [0, 60) represents low certainty (high risk). The current result of 41.47 falls into the high-risk range, which directly constitutes the basis for marking this index as a potential anomaly. This means that although the supplier's historical performance baseline score is acceptable (84.90), the combined impact of various external risks currently faced is significant, greatly weakening its future delivery reliability. The analysis and calculation process shows that the product effect of risk items and the high risk sensitivity coefficient are significant factors. This is the main reason for the low final score.
[0042] The specific process for threshold determination based on the Inventory Delivery Certainty Index (DCI) begins by setting a dynamic "safety lower limit" threshold. This threshold is not a fixed value but is determined based on the criticality of the materials and their historical data distribution. First, all materials are classified into three categories using the ABC classification method: A (most critical), B (second most critical), and C (general). Next, for each category, the system retrieves the historical DCI calculation data from all suppliers over the past year, forming the DCI score distribution for that category. Then, the percentile method is used to set the threshold. For category A materials, the safety lower limit threshold is set to the 20th percentile of the historical DCI score distribution; for category B materials, it is set to the 10th percentile; and for category C materials, it is set to the 5th percentile. For example, if statistical analysis shows that the 20th percentile of the historical DCI score for category A materials is 75.0, then all... The safe lower limit for the Delivery Certainty Index (DCI) of Category A materials is 75.0. When a newly calculated DCI value for a Category A material, such as 41.47, is lower than 75.0, the system automatically identifies the record as a potential anomaly. Once identified, a structured information package containing the supplier code, material code, current DCI score, corresponding safe lower limit threshold, and analysis of the main factors leading to the low score (e.g., whether the performance baseline score is too low or a certain risk factor score is too high) is pushed to the risk management system in real time via API. Upon receiving the information, the risk management system automatically triggers a preset response process. For example, it generates a high-priority alert on the system dashboard and sends an email and instant message notification to the purchasing manager of the material. At the same time, it automatically checks the current inventory level and in-transit quantity of the material and compares it with the safety stock line. If there is a risk of stockout, it generates a suggested task of "creating an emergency purchase order" or "assessing the activation of an alternative supplier" for relevant personnel to make decisions.
[0043] The steps to obtain the set of potential risk nodes are as follows: Based on the heterogeneous relationship graph of logistics, select the product batch of the risk source, search the downstream nodes layer by layer along the "transfer to" relationship, search the potential cross-contamination risk nodes along the co-location relationship at each storage unit node, and merge the same path segments according to the time sequence and path connectivity between nodes to form a set of potential risk nodes.
[0044] Specifically, based on the heterogeneous logistics relationship graph, the user first inputs the specified risk source product batch number, such as "PB-FRUIT-20231025-001," through the user interface or API interface to locate the starting node in the graph. A breadth-first search algorithm is then initiated to trace downstream, placing this starting node into a processing queue and initializing an empty set to store the final potential risk nodes. The algorithm iterates, retrieving a current node from the queue and traversing all outgoing "transfer to" relationship edges. The target node of the relationship, such as a transport unit or the next storage unit, is added to the processing queue and the final node set, provided that the node has not yet been visited. This process traces the physical flow path of materials downstream layer by layer. When the current node retrieved from the queue is of type "storage unit," a parallel cross-contamination retrieval process is triggered. At this storage unit node, all associated "shared storage" relationships are queried. These relationships connect other products that overlap in time and are stored in the same physical location. For each associated node found through the "co-storage" relationship, the system checks the overlap between its co-storage time interval and the residence time interval of the risk source product batch in the warehouse. Only when the overlap time exceeds the preset minimum exposure time, such as 6 hours, is a valid risk of cross-contamination considered to exist. This minimum exposure time is set based on the time required for common pathogens to undergo effective surface migration under typical storage conditions in microbiological studies. Once a risk is confirmed, the associated product batch node is added to the pending queue and the final node set, making it a new potential source of contamination to continue spreading downstream. During the entire traversal process, the system records the discovery path and time information of each node. After the traversal is completed, all discovered nodes are deduplicated, and all path segments from the risk source to these nodes are integrated. For example, if node A reaches node C through path 1 and then reaches node C through path 2, then node C is only retained once in the final node set. Finally, all marked nodes are summarized to form a potential risk node set.
[0045] The steps to obtain the risk propagation path of the domino effect are as follows: Based on the set of potential risk nodes, the risk weight of the propagation path is calculated using the following formula: ; in, For the first Risk weights for each transmission path The initial pollution load factor represents the degree of contamination in a batch of products from a risk source at the onset of contamination. The product susceptibility coefficient represents the degree to which a contaminated product is susceptible to microbial growth. For the first The duration of co-location of the propagation paths, For a moment The instantaneous growth rate is expressed as: , The baseline growth rate at the reference temperature. This represents the multiplication factor of microbial growth rate for every ten degrees Celsius increase in temperature. For the first The transmission path at any time Ambient temperature value, For reference temperature values, Let be the function affecting water activity, and its expression is: , For a moment The approximate value of water activity is calculated as follows: , For the first The transmission path at any time The relative humidity percentage value, This represents the minimum water activity threshold required for microbial growth. It is a nonlinear fitting index; Based on risk weights, threshold screening is performed on the risk weights of all propagation paths. Propagation paths with risk weights below the set threshold are removed, while paths with risk exposure indices exceeding the threshold are retained and connected in chronological order to generate domino effect risk propagation paths.
[0046] Specifically, in the risk weight calculation formula, the exponential growth component simulates the change in the number of microorganisms over time, by analyzing the instantaneous growth rate. Throughout the co-location time The integral above captures the cumulative effect of fluctuations in environmental conditions such as temperature and humidity on microbial growth, and the instantaneous growth rate. It is itself a combination of temperature effects (through) (model) and water activity effect (through The model uses a composite function (of the function) to simultaneously reflect the impact of these two key environmental factors. Furthermore, the model incorporates an initial pollution load factor. and product susceptibility coefficient These represent the initial severity of contamination and the ability of different food matrices to support microbial growth, respectively, making risk assessment more targeted and scenario-based.
[0047] The initial contamination load factor represents the initial microbial concentration transferred from the source product batch to the affected product during a cross-contamination event, expressed in colony-forming units per gram (CFU / g). This value is primarily determined by testing data from the source product batch. If a microbial sampling report is available for the batch, the count of relevant pathogenic bacteria (e.g., Salmonella) in the report is used directly. If no direct testing data is available, the 95th percentile of the microbial contamination level is used as a conservative estimate based on historical data for the material. In the absence of any historical data, the microbial limit standard for this type of product in food safety regulations or industry guidelines is referenced and multiplied by a safety factor (e.g., 1.5). For example, for a batch of untested fresh chicken, a historical database reveals that the 95th percentile of Salmonella contamination in similar products is 60 CFU / g, so the initial contamination load factor is set as follows: .
[0048] The product susceptibility coefficient is a dimensionless parameter used to adjust for differences in the sensitivity of different types of products to microbial growth. This coefficient is based on an internally established product classification risk matrix. This matrix categorizes all materials into different risk levels according to their physicochemical properties (such as pH value, nutritional components, and whether they contain antimicrobial agents) and processing methods (such as raw, cooked, and dried). For example, high-risk (e.g., raw meat, fresh milk)... Range 1.1-1.5), medium risk (if vegetables, cooked meat products, Range 0.8-1.1), low risk (such as cereals, biscuits, The range is 0.5-0.8. Specific values are determined by food microbiology experts based on experimental data fitting or empirical assessment. For example, for a batch of contaminated pasteurized milk (medium risk), its product susceptibility coefficient... It is set to 1.0.
[0049] For the first The co-location duration of a transmission path, in hours, represents the total time that two or more product batches at risk of cross-contamination are stored or transported together within the same storage or transportation unit. This value is directly extracted from the set of potential risk nodes generated in previous steps and is obtained by calculating the difference between the timestamp of the risk source product batch entering the unit and the timestamp of the affected product batch leaving the unit. For example, if a risk source batch enters location A of warehouse W01 at 08:00 on October 26th, and another batch leaves the same location at 14:00 on October 28th, then the co-location duration is... It takes 54 hours.
[0050] The baseline growth rate at the reference temperature represents the maximum specific growth rate of a specific microorganism under ideal conditions (specific product substrate, reference temperature), expressed in hours ( ). This parameter represents the inherent biological characteristics of microorganisms. Its value is obtained by querying specialized microbial model databases (such as ComBase) or relevant scientific literature. When querying, you need to specify the type of microorganism (e.g., Listeria monocytogenes), the type of food (e.g., milk), and the reference temperature. For example, if the literature indicates that bacterium XX exists in milk at a reference temperature... The baseline growth rate at ℃ is .
[0051] The growth rate multiplication factor for microorganisms is a dimensionless parameter used to describe the sensitivity of microbial growth rate to temperature increases of 10 degrees Celsius. This value is an empirical constant widely used in biology and ecology; for most mesophilic microorganisms, its value is typically between 2.0 and 3.0, indicating that for every 10°C increase in temperature, their growth rate approximately doubles or triples. Depending on the type of microorganism being studied, a standard value is selected from a microbiology handbook. For example, for common food pathogens, a certain value is set... .
[0052] For the first The transmission path at any time The ambient temperature value, in degrees Celsius (°C), is a function that changes over time. The data comes from the time-series data of IoT sensors recorded by the nodes of the storage or transportation units in the logistics heterogeneous relationship graph. These sensors record temperature and humidity information at a fixed frequency (e.g., once every 15 minutes). In the calculation, these discrete temperature readings are used for numerical integration. For example, there are 216 temperature recording points in a 54-hour co-location period.
[0053] This is a reference temperature value, in degrees Celsius (°C). This temperature is used to determine the baseline growth rate. The experimental temperature used must be consistent with... To ensure the accuracy of the model, the source must be kept consistent, based on the previous... The acquisition process is set here. ℃.
[0054] For the first The transmission path at any time The relative humidity percentage is a function that changes over time, and its data source and acquisition method are similar to those of temperature data. The data are similar, all derived from sensor time-series data recorded in the graph; for example, the sensor recorded 216 relative humidity readings over 54 hours.
[0055] The minimum water activity threshold required for microbial growth is a dimensionless parameter representing the minimum water activity required for microorganisms to grow and reproduce. Below this value, microorganisms will be dormant or die. This value is a physiological characteristic of microorganisms and is obtained by consulting professional microbiology literature. For example, the minimum water activity threshold required for the growth of Listeria monocytogenes is... It is approximately 0.92.
[0056] The nonlinear fit index is a dimensionless empirical parameter used to describe the nonlinear relationship between water activity and microbial growth rate as water activity changes from a minimum threshold to an optimum value. The value of this parameter is usually obtained by fitting laboratory data; for most predictive models, its value ranges from 1 to 2. Here, based on recommendations, it is set to... .
[0057] Calculations based on parameters: For example in During the co-location period of 24 hours, environmental conditions remained stable. ℃, .
[0058] Other parameter values are: CFU / g, , , , ℃, , .
[0059] First, calculate the approximate value of water activity. Influence function of water activity : ; ; Next, calculate the instantaneous growth rate under constant conditions. : ; Then calculate the integral term. Since the conditions are constant, the integral simplifies to multiplication: ; Finally, calculate the risk weight. : ; The results indicate that after 54 hours of cross-contamination and proliferation, the Listeria concentration in the affected product batch was expected to increase from an initial 60 CFU / g to approximately 115.95 CFU / g, which is a risk weighting factor. The value directly quantifies the level of microbial contamination at the end of the transmission path; the higher the value, the greater the food safety risk caused by the transmission path.
[0060] Based on risk weights, for all calculated... The propagation path of the value is screened one by one using a threshold system. This screening process employs a dual-standard threshold system, which includes an absolute safety threshold and a relative growth threshold. The absolute safety threshold is set according to the limits for specific pathogens in ready-to-eat foods as stipulated in relevant national food safety standards or EU regulations. For example, for Listeria monocytogenes, regulations stipulate that its content at the end of the shelf life must not exceed 100 CFU / g; therefore, the absolute safety threshold is set at 100. The relative growth threshold is set to identify "high-risk" processes where the final contamination level does not exceed the limit, but the microbial growth rate is too rapid. This threshold is set as the initial contamination load factor. The risk weight is 1.5 times that of the previous value, indicating that microorganisms are not allowed to grow by more than 50% on any single transmission route. For each transmission route, the risk weight is... The value will be compared with both thresholds simultaneously, and only when... The value is less than or equal to 100, and is also less than or equal to 100. A transmission path is considered safe and removed from the risk set only when its risk level is 1.5 times higher than the risk level; otherwise, any path is considered safe as long as its risk level is lower than the risk level. Values exceeding 100, or exceeding If the risk path is 1.5 times larger, it will be retained. All retained risk path segments, along with their constituent nodes (product batches, warehousing units, transportation units), are aggregated. Then, based on the connection relationships of these nodes in the original heterogeneous logistics relationship graph and the timestamp information on each relationship edge, these discrete risk path segments are connected in chronological order to reconstruct one or more complete end-to-end risk propagation chains that start from the risk source, pass through one or more cross-contamination and proliferation links, and finally extend to the currently affected product. This final chain network is the domino effect risk propagation path.
[0061] The steps to obtain the list of current locations of affected inventory are as follows: Based on the analysis of terminal nodes in the domino effect risk propagation path, the current location attributes of terminal nodes in the logistics heterogeneous relationship graph are queried, and the terminal nodes are associated with the transport vehicle number or warehouse location code. The corresponding inventory entries are checked by product batch and material code to form a list of the current location of affected inventory.
[0062] Specifically, based on the domino effect risk propagation path, firstly, all nodes in the path network are traversed to identify those nodes without an outgoing "transfer to" or "co-storage" relationship. These are the terminal nodes of the propagation chain, representing the current or most recent known state of the affected product batch. For each identified terminal node, a precise node query is performed in the logistics heterogeneous relationship graph using its globally unique identifier to retrieve the node's latest "current location" attribute. This attribute is a structured data field containing location type (warehouse or vehicle), specific identifier (warehouse location code or transport vehicle number), and update timestamp. Next, associations are made based on the location type. If the location type is "warehouse," the product batch information of the terminal node is bound to the warehouse location code; if the location type is "vehicle," then... After binding the location with the transport vehicle number, the system will further verify the data with the Inventory Management System (WMS) or Transportation Management System (TMS). Through API calls, the product batch number and material code are passed in to query the details of the corresponding inventory item at that location, including the inventory quantity, status (e.g., "available", "under quality inspection", "allocated"). This verification step is used to confirm that the map data is consistent with the real-time data of the actual inventory operating system and to obtain more detailed inventory information. The information of each verified terminal node, including its product batch number, material code, specific identifier of the current location (vehicle number or storage location code), and corresponding inventory quantity, is compiled into a record. Finally, the records generated by all terminal nodes are summarized to form a clear and executable list of the current locations of affected inventory.
[0063] The steps to obtain the minimum logistics intervention instruction set are as follows: Based on the list of current locations of affected inventory, retrieve the status tags of transport vehicle numbers or warehouse location codes one by one, verify the executable range of the corresponding product batch and material code, match the preset "freeze outbound" or "intercept transport" action templates according to the terminal node type and record the execution object, and generate an intervention action mapping list. Based on the intervention action mapping list, group and merge similar "intercept transportation" instructions by transport vehicle number, and group and merge similar "freeze outbound" instructions by warehouse location code. Delete instructions that are duplicated for the same execution object, and retain the entry with the largest coverage and shortest execution chain to form the minimum logistics intervention instruction set.
[0064] Specifically, based on the list of current locations of affected inventory, an automated processing flow is initiated, iterating through each entry in the list. For each record, its location identifier (vehicle number or warehouse location code) is first extracted. Then, the current status label of that location identifier is queried from the corresponding Transportation Management System (TMS) or Warehouse Management System (WMS) via the system interface. For example, for a vehicle, it is queried whether it is in a "driving," "parked," or "unloaded" state; for a warehouse location, it is queried whether it is in a "available," "locked," or "in inventory" state. Next, the executable intervention scope of the product batch and material code in that entry is verified. This requires querying a pre-configured intervention rule base, which defines the types of operations allowed to be performed on different materials in different states. For example, for materials that have entered the production waiting area, it may not be possible to perform certain operations. "Intercepting Transportation" is allowed, but only the higher-level "Production Line Isolation" can be executed. Based on the queried status label and the executable scope, the most appropriate intervention action is matched for the entry. This matching process is based on a preset action template mapping table, which associates the type of terminal node (transportation unit or storage unit) with predefined intervention actions. If the terminal node is a transportation unit (i.e., the inventory is on the vehicle), the "Intercept Transportation" action template is matched; if the terminal node is a storage unit (i.e., the inventory is in the warehouse), the "Freeze Outbound" action template is matched. After a successful match, a record is generated that includes the execution object (vehicle number or storage location code), the execution action ("Intercept Transportation" or "Freeze Outbound"), and the target material (product batch number, material code, quantity). All the records generated are summarized to form an intervention action mapping list.
[0065] Based on the intervention action mapping list, an algorithm for instruction optimization and merging is executed. First, all entries in the list are grouped according to the type of the execution object (transport vehicle number or warehouse location code), creating two independent lists: one for handling "intercept transport" instructions and the other for handling "freeze-out" instructions. In the "intercept transport" instruction list, all instructions are further grouped according to the transport vehicle number. For multiple instructions under the same vehicle number, for example, if batches P01 and P02 on vehicle V001 need to be intercepted simultaneously, these instructions will be merged into a single "intercept transport" instruction for vehicle V001. The instruction content will list all product batches that need to be intercepted in detail. Similarly, in the "freeze-out" instruction list, secondary grouping is performed according to the warehouse location code, and multiple instructions for the same location code are merged into one. Next, the instructions are deduplicated and optimized. The algorithm will check if... The algorithm checks for duplicate instructions targeting the same object. For example, if the list contains both a "freeze outbound" instruction for batch P03 in location A01 and a "freeze outbound" instruction for the entire warehouse area A containing location A01, the algorithm will determine that the latter covers the former. In this case, the instruction targeting a single location will be deleted, and only the warehouse area-level instruction with a larger coverage will be retained. This is an application of the "maximize coverage" principle. At the same time, the algorithm evaluates the length of the execution chain. For example, intercepting a truck that is about to arrive at the downstream warehouse has a shorter execution chain and is more efficient than waiting for the goods to be put into the warehouse and then freezing multiple scattered locations. Therefore, when there is a choice, the instruction with the shortest execution chain will be retained first. For example, "intercept transportation" will be selected instead of the subsequent "freeze outbound". Through this series of merging, deleting and optimization operations, a set of instructions that is non-redundant, efficient and simple in operation is finally generated, which is the minimum logistics intervention instruction set.
[0066] The above are merely preferred embodiments of the present invention and are not intended to limit the present invention in any other way. Any person skilled in the art may make changes or modifications to the above-disclosed technical content to create equivalent embodiments that can be applied to other fields. However, any simple modifications, equivalent changes, and modifications made to the above embodiments based on the technical essence of the present invention without departing from the scope of the present invention shall still fall within the protection scope of the present invention.
Claims
1. A food safety risk early warning method, characterized in that, Includes the following steps: Enter the entity information of product batches, warehousing units, transportation units and operators, as well as the attribute information of supplier geographical location, local weather warnings and financial news, set the process relationship of "transfer to" and "store at" and the co-location relationship of "shared storage at" and "shared transportation at", connect all entities and establish a logistics heterogeneous relationship graph; Based on the heterogeneous logistics relationship graph, the historical on-time delivery rate, quantity fulfillment rate and quality pass rate of the target supplier and material combination are extracted, and the performance base score is obtained. Then, the logistics path length, extreme weather probability and negative news risk signal are retrieved from the heterogeneous logistics relationship graph to generate the inventory delivery certainty index. Based on the heterogeneous relationship graph of logistics, select the product batch of the risk source, search the downstream nodes along the "transfer to" relationship, and search the associated nodes with cross-contamination risk along the co-location relationship at each storage unit node. Summarize all nodes to obtain the potential risk node set. Calculate the risk weight of each propagation path based on the co-location time and environmental temperature and humidity attributes in the potential risk node set to obtain the domino effect risk propagation path. Based on the domino effect risk propagation path, all terminal nodes in the path are analyzed, and the corresponding current location attributes in the logistics heterogeneous relationship graph are queried to obtain the current location list of affected inventory. All entries in the current location list of affected inventory are traversed to establish a minimal logistics intervention instruction set.
2. The food safety risk early warning method according to claim 1, characterized in that, The steps for obtaining the heterogeneous relationship map of logistics are as follows: Collect raw fields of product batches, warehousing units, transportation units, operators, supplier geographical locations, local weather warnings and financial news, unify coding rules and timestamp formats, parse geographical coordinates into longitude and latitude values, extract weather warning level codes, extract corresponding supplier name entries and time tags from financial news, and obtain a structured entity list. Based on the structured entity list, the "transfer to" relationship and "store in" relationship are marked according to the batch flow records. The "shared storage in" relationship is determined according to the time overlap interval and the same warehouse location code. The "shared transport in" relationship is determined according to the vehicle number and the same transportation time window. Duplicate records are cleaned up and the relationship direction is fixed to obtain the relationship edge list. Based on the aforementioned relation edge list, nodes with the same globally unique identifier are merged and their attributes are retained. Nodes are connected according to relation type and attached with longitude values, latitude values, weather warning level codes, and financial news time tags. Connectivity is verified to form a heterogeneous logistics relation graph.
3. The food safety risk early warning method according to claim 1, characterized in that, The steps for obtaining the inventory delivery certainty index are as follows: Based on the heterogeneous relationship graph of logistics, the order records of target suppliers and material combinations are screened, the on-time delivery status, delivery quantity and quality inspection results of each record are extracted, and the time interval is calculated by the difference between the delivery timestamp and the current time to form a historical performance index sequence. Calculate the inventory delivery certainty index based on the aforementioned historical performance indicator sequence; Based on the inventory delivery certainty index, a threshold judgment is made, and inventory delivery certainty indices below the safety lower limit are recorded and marked as potential anomalies. The corresponding supplier and material combination information is then fed back to the risk management system.
4. The food safety risk early warning method according to claim 1, characterized in that, The steps for obtaining the potential risk node set are as follows: Based on the heterogeneous relationship graph of the logistics, the product batch of the risk source is selected, and the downstream nodes are searched layer by layer along the "transfer to" relationship. At each storage unit node, the potential cross-contamination risk nodes are searched along the co-location relationship. According to the time sequence and path connectivity between nodes, the same path segments are merged to form a set of potential risk nodes.
5. The food safety risk early warning method according to claim 1, characterized in that, The steps for obtaining the domino effect risk propagation path are as follows: Calculate the risk weight of the propagation path based on the set of potential risk nodes; Based on the risk weights, a threshold screening is performed on the risk weights of all propagation paths. Propagation paths with risk weights below the set threshold are removed, while paths with risk exposure indices exceeding the threshold are retained and connected in chronological order to generate domino effect risk propagation paths.
6. The food safety risk early warning method according to claim 1, characterized in that, The steps for obtaining the list of current locations of the affected inventory are as follows: Based on the terminal node analysis of the domino effect risk propagation path, query the current location attribute of the terminal node in the logistics heterogeneous relationship graph, associate the terminal node with the transport vehicle number or warehouse location code, check the corresponding inventory entries by product batch and material code, and form a list of the current location of the affected inventory.
7. The food safety risk early warning method according to claim 1, characterized in that, The steps for obtaining the minimum logistics intervention instruction set are as follows: Based on the list of current locations of the affected inventory, the status tags of the transport vehicle numbers or warehouse location codes are retrieved one by one. The executable range of the corresponding product batch and material code is checked. The preset "freeze outbound" or "intercept transport" action templates are matched according to the terminal node type and the execution object is recorded to generate an intervention action mapping list.
8. The food safety risk early warning method according to claim 7, characterized in that, The steps for obtaining the minimum logistics intervention instruction set further include: grouping and merging similar "intercept transportation" instructions by transport vehicle number according to the intervention action mapping list, grouping and merging similar "freeze outbound" instructions by warehouse location code, deleting instructions that are repeated for the same execution object, and retaining the entry with the largest coverage and the shortest execution chain to form the minimum logistics intervention instruction set.
9. A food safety risk early warning system according to any one of claims 1-8, characterized in that, include: The data modeling module is used to input entity information of product batches, warehousing units, transportation units and operators, as well as attribute information such as supplier geographical location, local weather warnings and financial news. It sets the process relationship of "transfer to" and "store at" and the co-location relationship of "shared storage at" and "shared transportation at", connects all entities, and establishes a heterogeneous logistics relationship graph. The fulfillment analysis module is used to extract the historical on-time delivery rate, quantity fulfillment rate and quality pass rate of the target supplier and material combination based on the logistics heterogeneous relationship graph, perform calculations to obtain the basic fulfillment score, and then retrieve the logistics path length, extreme weather probability and negative news risk signal from the logistics heterogeneous relationship graph to generate the inventory delivery certainty index. The risk propagation identification module is used to select the risk source product batch according to the logistics heterogeneous relationship map, search downstream nodes along the "transfer to" relationship, and search for related nodes with cross-contamination risk along the co-location relationship at each warehousing unit node. It summarizes all nodes to obtain a set of potential risk nodes, calculates the risk weight of each propagation path based on the co-location time and environmental temperature and humidity attributes in the set of potential risk nodes, and obtains the domino effect risk propagation path. The logistics intervention decision module is used to analyze all terminal nodes in the domino effect risk propagation path, query the corresponding current location attributes in the logistics heterogeneous relationship graph, obtain the current location list of affected inventory, traverse all entries in the current location list of affected inventory, and establish a minimum logistics intervention instruction set.