Livestock and poultry product evaluation method and system based on knowledge graph
By constructing a full-link causal temporal knowledge graph and an uncertainty measurement causal knowledge graph, the problems of insufficient causal directionality and uncertainty quantification in existing technologies are solved, enabling efficient and reliable evaluation and early warning of real-time production decisions.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- THE SIXTH AFFILIATED HOSPITAL OF XINJIANG MEDICAL UNIV
- Filing Date
- 2026-04-10
- Publication Date
- 2026-07-10
AI Technical Summary
Existing static correlation maps lack causal directionality, uncertainty quantification, and automatic derivation mechanisms for monitoring complex precursors in real-time production decision-making, resulting in inaccurate online early warnings, low credibility of inference conclusions, and a disconnect between monitoring and evaluation.
We construct a full-link causal-temporal knowledge graph model that integrates causal and temporal information, integrate an uncertainty-measured causal knowledge graph, extract real-time monitorable source event combinations, form a precursor signal pattern library, and generate hierarchical decision instructions and diagnostic reports by matching real-time data streams with the pattern library, thereby optimizing the knowledge graph model.
It has realized a complete closed-loop evaluation and decision support system from data perception to real-time reasoning and accurate decision-making, which improves the accuracy of real-time monitoring and early warning of the production process and ensures the credibility and reliability of decisions.
Smart Images

Figure CN122367253A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of intelligent animal husbandry technology, and in particular to a method and system for evaluating livestock and poultry products based on knowledge graphs. Background Technology
[0002] With the increasing demand for intelligent and quality traceability in the livestock and poultry industry, achieving scientific evaluation and precise process control across the entire product chain from breeding to processing has become crucial. Traditional post-event evaluation models relying on terminal testing are insufficient to meet the needs of proactive process intervention. Knowledge graph technology has been introduced into this field to integrate multi-source data and construct a network describing the relationship between production factors and product quality. Existing technologies analyze historical data and use statistical or machine learning methods to mine the impact of key parameters on quality indicators, forming static correlation graphs. This achieves structured integration and macro-level correlation analysis of information, providing a foundation for understanding the causes of quality issues.
[0003] These static correlation graphs have limitations in supporting real-time production decision-making. They focus on describing historical correlations and lack quantitative representation of the dynamic causal direction and degree of uncertainty between factors. This makes it difficult to efficiently infer the causal relationship between surface precursor events and deep-seated quality risks when real-time anomalies occur in production, thus failing to achieve accurate online early warning. The relationship edges in existing graphs only express correlations and do not integrate uncertainty measures, making it impossible to assess the credibility of real-time inference conclusions. Furthermore, there is a lack of a mechanism to automatically derive monitorable composite precursor signals from causal networks, resulting in a disconnect between real-time monitoring and in-depth evaluation. Summary of the Invention
[0004] In view of the aforementioned existing problems, the present invention is proposed.
[0005] Therefore, this invention provides a knowledge graph-based method for evaluating livestock and poultry products to address the problems of inaccurate online early warnings, low reliability of inference conclusions, and disconnect between monitoring and evaluation caused by the lack of causal directionality, uncertainty quantification, and automatic derivation mechanism for monitoring composite precursors in real-time production decision-making using existing static association graphs.
[0006] To solve the above-mentioned technical problems, the present invention provides the following technical solution: In a first aspect, the present invention provides a method for evaluating livestock and poultry products based on knowledge graphs, which includes collecting multi-source data from the entire chain of livestock and poultry breeding and processing and preprocessing it to obtain standardized real-time data and historical data streams, and constructing a full-link causal-temporal knowledge graph model with causal and temporal information. Based on the full-link causal temporal knowledge graph model, an uncertainty measurement causal knowledge graph is constructed to extract real-time monitorable source event combinations and form a precursor signal pattern library. The standardized real-time data is matched with the real-time data in the historical data stream and the precursor signal pattern library to obtain the specific precursor pattern matching event that is triggered. Starting with specific precursor pattern matching events, the cumulative propagation of uncertainty is deduced in the causal knowledge graph of uncertainty measurement, generating hierarchical decision instructions and diagnostic reports; Execute hierarchical decision-making instructions and diagnostic reports, and optimize and update the full-link causal temporal knowledge graph model and uncertainty measurement causal knowledge graph based on execution feedback and final quality results.
[0007] As a preferred embodiment of the knowledge graph-based livestock and poultry product evaluation method of the present invention, the specific steps for obtaining standardized real-time data and historical data streams are as follows: After receiving multi-source data from the entire livestock and poultry breeding and processing chain through a multi-source data interface, the data is cleaned. The cleaned multi-source data is mapped and aligned with a unified timestamp and production identifier; The aligned multi-source data is divided into a real-time portion and a stored historical portion, resulting in standardized real-time data and historical data streams.
[0008] As a preferred embodiment of the knowledge graph-based livestock and poultry product evaluation method of the present invention, the specific steps of the full-link causal temporal knowledge graph model are as follows: Causal discovery algorithms are applied to learn and analyze the statistical dependencies between various production and quality variables in historical data streams, identify associations with potential causal direction, and obtain potential causal relationships. By labeling events based on potential causal relationships, the causal relationships and temporal associations can be obtained; By structuring and storing causal relationships and temporal connections, a full-link causal temporal knowledge graph model is obtained.
[0009] As a preferred embodiment of the knowledge graph-based livestock and poultry product evaluation method of the present invention, the specific steps for forming the precursor signal pattern library are as follows: For each causal relationship in the full-link causal temporal knowledge graph model, the data quality and sample sufficiency of the causal relationship being processed in the full-link causal temporal knowledge graph model are integrated to evaluate the uncertainty interval and obtain the causal relationship with integrated uncertainty measure. The uncertainty interval and the corresponding causal relationship are stored together in the full-link causal temporal knowledge graph model to obtain a causal relationship that incorporates uncertainty measurement; By integrating the causal relationship that incorporates uncertainty measurement with the complete structure of the full-link causal temporal knowledge graph model, an uncertainty measurement causal knowledge graph is obtained. Based on the evaluation target of livestock and poultry product quality deterioration, specific negative quality final state nodes are located in the uncertainty measurement causal knowledge graph. Starting from each negative quality final state node, a reverse traversal is performed along the causal relationship dimension that integrates the uncertainty measurement causal relationship to trace back to the physical quantity characterized by sensors at the breeding or processing site. The logical combination of the physical quantities is defined as a real-time monitorable source event combination that characterizes a specific quality risk pattern, thus obtaining a real-time monitorable source event combination. Real-time monitorable source events are grouped and structured according to their associated negative quality final state nodes to form a precursor signal pattern library.
[0010] As a preferred embodiment of the knowledge graph-based livestock and poultry product evaluation method of the present invention, the specific steps of the triggered specific precursor pattern matching event are as follows: Establish a streaming computing task that runs continuously with a sliding time window to obtain a continuously updated real-time data window; The continuously updated real-time data window is compared with the logical conditions defined for each pattern in the precursor signal pattern library to obtain preliminary matching results. For results that meet the logical conditions in the preliminary matching results, record the timestamp of meeting the conditions, the pattern identifier, and the associated real-time data snapshot to obtain the specific precursor pattern matching event that was triggered.
[0011] As a preferred embodiment of the knowledge graph-based livestock and poultry product evaluation method of the present invention, the specific steps for generating hierarchical decision instructions and diagnostic reports are as follows: Based on the pattern identifier carried by the specific precursor pattern matching event, the corresponding starting node and the complete causal influence path are located in the uncertainty measurement causal knowledge graph. Along the causal influence path of the location, from the starting node to the negative quality final state node, the uncertainty interval of each causal relationship on the path is obtained in sequence, and the interval is merged and calculated step by step according to the predetermined interval operation rules to obtain the comprehensive prediction uncertainty interval to reach the final state node. The severity of quality degradation is assessed based on the center value of the comprehensive prediction uncertainty interval, and the overall prediction confidence is assessed using the width of the comprehensive prediction uncertainty interval. Based on the preset decision matrix, the predicted severity and overall confidence level are mapped to the corresponding decision level, generating graded decision instructions and a diagnostic report.
[0012] As a preferred embodiment of the knowledge graph-based livestock and poultry product evaluation method of the present invention, the specific steps for executing the hierarchical decision-making instructions and diagnostic reports are as follows: Execute and record operations according to hierarchical decision instructions to obtain the executed operation records and corresponding execution feedback data, and obtain the final quality results of the associated batches; The execution feedback data and final quality results are compared with the diagnostic report to obtain the difference analysis results; The results of the difference analysis were used to update the end-to-end causal temporal knowledge graph model and the uncertainty measure causal knowledge graph, resulting in an optimized knowledge graph model.
[0013] Secondly, the present invention provides a knowledge graph-based livestock and poultry product evaluation system, including a preprocessing module that collects multi-source data from the entire livestock and poultry breeding and processing chain and performs preprocessing to obtain standardized real-time data and historical data streams, and constructs a full-link causal-temporal knowledge graph model of causal and temporal information. The extraction module, based on the full-link causal temporal knowledge graph model, constructs an uncertainty measurement causal knowledge graph, extracts real-time monitorable combinations of source events, and forms a precursor signal pattern library; The matching module matches standardized real-time data with real-time data in historical data streams and a precursor signal pattern library to obtain the specific precursor pattern matching event that has been triggered. The deduction module starts with specific precursor pattern matching events, and performs cumulative propagation deduction of uncertainty in the causal knowledge graph of uncertainty measurement to generate hierarchical decision instructions and diagnostic reports. The execution module executes hierarchical decision-making instructions and diagnostic reports, and optimizes and updates the end-to-end causal temporal knowledge graph model and uncertainty measurement causal knowledge graph based on execution feedback and final quality results.
[0014] Thirdly, the present invention provides a computer device including a memory and a processor, wherein the memory stores a computer program, wherein when the computer program is executed by the processor, it implements any step of the knowledge graph-based livestock and poultry product evaluation method as described in the first aspect of the present invention.
[0015] Fourthly, the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein: when the computer program is executed by a processor, it implements any step of the knowledge graph-based livestock and poultry product evaluation method as described in the first aspect of the present invention.
[0016] The beneficial effects of this invention are as follows: By collecting and standardizing multi-source data from the entire livestock and poultry breeding and processing chain, a full-link causal-temporal knowledge graph model containing causal and temporal information is constructed. Based on this model, a causal knowledge graph integrating uncertainty measurement is built. Simultaneously, source event combinations that can be directly monitored by sensors and characterize specific quality risks are derived from this graph, forming a precursor signal pattern library. By matching real-time data streams with this pattern library, specific precursor pattern matching events are triggered. Starting from this event, uncertainty is accumulated and propagated along the causal path in the uncertainty measurement causal knowledge graph, quantifying and predicting the severity and confidence of the risk, and generating hierarchical decision instructions and diagnostic reports accordingly. Based on decision execution feedback and final quality results, the knowledge graph model is iteratively optimized, thus forming a complete closed-loop evaluation and decision support system from data perception, knowledge construction, real-time reasoning, accurate decision-making to model self-evolution. Attached Figure Description
[0017] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the following description of the embodiments will be briefly introduced. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0018] Figure 1 This is a flowchart of a knowledge graph-based method for evaluating livestock and poultry products.
[0019] Figure 2 This is a schematic diagram of a knowledge graph-based livestock and poultry product evaluation system. Detailed Implementation
[0020] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings.
[0021] Many specific details are set forth in the following description in order to provide a full understanding of the invention. However, the invention may also be practiced in other ways different from those described herein, and those skilled in the art can make similar extensions without departing from the spirit of the invention. Therefore, the invention is not limited to the specific embodiments disclosed below.
[0022] Secondly, the term "one embodiment" or "example" as used herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation of the invention. The appearance of an embodiment in different places in this specification does not necessarily refer to the same embodiment, nor is it a single or selective embodiment that mutually excludes other embodiments.
[0023] Reference Figures 1-2This is one embodiment of the present invention, which provides a method for evaluating livestock and poultry products based on knowledge graphs, including the following steps: S1. Collect multi-source data from the entire livestock and poultry breeding and processing chain and preprocess it to obtain standardized real-time data and historical data streams.
[0024] S1.1 After receiving multi-source data from the entire livestock and poultry breeding and processing chain through the multi-source data interface, the data is cleaned.
[0025] Furthermore, through the multi-source data interfaces provided by livestock and poultry breeding environment sensors, feeding equipment controllers, individual identification readers, slaughter line industrial control computers, and laboratory information management databases, the system receives multi-source data such as temperature and humidity in the breeding sheds, ammonia concentration, feed input, livestock and poultry individual numbers, slaughtering process parameters, and meat quality testing indicators, resulting in unprocessed multi-source data. Data cleaning operations are then performed on the unprocessed multi-source data, including identifying and correcting abnormal values that are significantly outside the reasonable range, filling in missing fields caused by transmission interruptions, and unifying the units of measurement and data formats from different sources. Finally, the cleaned multi-source data is output.
[0026] Specifically, by establishing a unified multi-source data interface standard, heterogeneous data streams from physical sensors, control equipment, and information systems are aggregated in real time, providing a complete data foundation for subsequent analysis. The data cleaning process not only addresses common data quality issues but also identifies specific anomalies in livestock and poultry production scenarios. For example, a sudden drop in feed intake may be related to equipment malfunction rather than actual feeding behavior. The cleaning logic can make judgments and corrections based on context, ensuring that the cleaned multi-source data retains the authenticity of the original information while eliminating noise and inconsistencies. This allows the subsequent knowledge graph to be built based on high-quality, highly consistent data input, thereby improving the reliability and accuracy of the entire evaluation system. It processes multi-dimensional data such as environment, feeding, and individual identification, and coordinates the logical consistency between them. For example, it ensures that individual numbers completely correspond in feeding records and slaughter records, avoiding analytical biases caused by data silos or format conflicts.
[0027] S1.2 Map and align the cleaned multi-source data with a unified timestamp and production identifier.
[0028] Furthermore, each record in the cleaned multi-source data is associated with a globally unified and precise timestamp, which comes from a high-precision time synchronization service. At the same time, each record is bound to a corresponding production batch number, livestock and poultry individual identifier, or processing line station code, etc. Through the dual mapping of timestamps and production identifiers, all data entries are precisely aligned in the time dimension and production entity dimension, and the aligned multi-source data is output.
[0029] Specifically, through a dual mapping mechanism of timestamps and production identifiers, precise alignment of the entire data chain across time and space is achieved. This requires all data records to be bound to a unified time base and a unique production identifier, ensuring the authenticity of event sequences and the accuracy of entity associations in subsequent causal analysis. For example, although stress events in the breeding stage and meat quality test results in the slaughtering stage occur at different times and locations, the same individual identifier and unified timeline allow for precise tracing of the entire life cycle of the same batch of livestock. This enables the subsequently constructed causal temporal knowledge graph to reconstruct the true causal chain and time window effect based on strictly aligned data, laying a temporal logical foundation for accurate evaluation.
[0030] S1.3 Divide the aligned multi-source data into a real-time part and a stored historical part to obtain standardized real-time data and historical data streams.
[0031] Furthermore, the aligned multi-source data is divided according to the timestamp of data generation and a preset timeliness threshold. The latest generated data within the timeliness threshold is divided into the real-time part, and the data that exceeds the timeliness threshold or has completed the production batch is divided into the historical part. The real-time part is organized in the form of a streaming data buffer for subsequent real-time processing tasks to consume, and the historical part is persistently stored in the form of a time-series database, outputting standardized real-time data and historical data streams.
[0032] Specifically, the system automatically distinguishes between real-time and historical data based on timeliness thresholds. Real-time data is imported into a low-latency streaming channel to support immediate alerts, while historical data is archived to optimized storage for in-depth analysis. This allows real-time evaluation tasks to focus on the latest developments, while historical analysis tasks can access the complete archive. The two processes operate independently yet share a unified data source. For example, the real-time portion can be immediately used to detect environmental anomalies in the current batch, while the historical portion is used to train and update causal models. This architecture ensures both the agility of real-time response and the completeness of historical data, providing an efficient data supply chain for end-to-end evaluation.
[0033] S2. Construct a full-link causal-temporal knowledge graph model for causal and temporal information.
[0034] S2.1. Apply causal discovery algorithms to learn and analyze the statistical dependencies between various production and quality variables in historical data streams, identify associations with potential causal direction, and obtain potential causal relationships.
[0035] Furthermore, multidimensional production variables, including environmental parameters, feeding records, and management operations, as well as quality variables, including meat physicochemical indicators and sensory scores, are extracted from historical data streams to form a multivariate time series dataset. Constraint-based causal discovery algorithms, such as the PC algorithm, are used to gradually eliminate spurious correlation edges between variables by performing a series of conditional independence tests, thus initially forming a skeleton network describing the undirected associations between variables. Algorithms based on scores or functional causal models, such as the LiNGAM algorithm, are then used to analyze the non-Gaussian distribution characteristics or functional causal mechanisms between variables, inferring the direction of edges in the skeleton network, and identifying associations with potential causal directionality. For example, it is determined that the average environmental temperature during the fattening period is a cause of the carcass pH24 value, rather than the other way around, thus obtaining a set of potential causal relationships with directionality.
[0036] Specifically, the cutting-edge causal discovery algorithm framework is systematically applied to multivariate analysis across the entire livestock and poultry production chain. This aims to transcend traditional correlation analysis and reveal the inherent causal direction between variables, forming the logical foundation for subsequent real-time causal inference. Traditional data analysis methods, whether simple statistical regression or machine learning models, primarily identify covariate relationships between variables, failing to distinguish causal directions and easily leading to misjudgments. For example, traditional methods might find a positive correlation between vitamin E levels in feed and meat shelf life, but cannot determine whether vitamin E extends shelf life or whether high-vitamin E feed was chosen to pursue a longer shelf life. Causal discovery algorithms, however, can learn from observational data and infer causal hypotheses more likely to reflect the true driving direction, such as determining the causal path from vitamin E levels to meat antioxidant properties and then to shelf life. This cognitive leap from correlation to causation transforms the constructed knowledge graph from a static fact-based association diagram into a more comprehensive understanding.
[0037] S2.2. Mark events based on potential causal relationships to obtain causal relationships and temporal associations.
[0038] Furthermore, temporal analysis is performed on historical data streams to identify event points representing state changes or key operations, such as the onset of a high-temperature warning, a change in feed formulation, the execution of a herd transfer, and the completion of slaughter and bleeding. These event points are then associated with relevant entity nodes in potential causal relationships, and each causal relationship is labeled with its effective temporal context or lifecycle. For example, for the potential causal relationship of decreased feed intake due to high-temperature stress, it is marked that it is only significant under the temporal condition that livestock and poultry are in the fattening stage and the duration of the high-temperature warning exceeds a certain threshold. Similarly, for the causal relationship between a certain vaccine injection and subsequent increases in antibody levels, the time point of the injection event and the time window for antibody level detection are clearly marked. This transforms static causal propositions into causal relationships and temporal associations with temporal constraints.
[0039] Specifically, by integrating the temporal dimension as a first-class citizen into causal relationships, a temporal association between causality and time is created. In real livestock and poultry production, the existence and intensity of causal effects strongly depend on the temporal context. For example, increasing feed energy concentration usually leads to increased body fat deposition, but this effect may differ in intensity in the early and late fattening stages, and may manifest differently in hot summers and cool autumns. By explicitly marking the effective time window, duration, or sequence of prerequisite events of causal relationships, the knowledge graph can characterize dynamic production logic. This allows subsequent reasoning, especially prediction and attribution in real-time scenarios, to be based on precise temporal logic regarding when, under what conditions, and what causal relationships will take effect. This greatly improves the modeling accuracy and scenario adaptability of dynamic behaviors in complex production systems. For example, it can distinguish between stress caused by insufficient ventilation in hot summers and cold stress caused by poor insulation in winter. Although both affect health, the physiological pathways and the temporal patterns of their effects on meat quality are different, thus supporting more refined management decisions.
[0040] S2.3. Structure and store the causal relationships and temporal connections to obtain a full-link causal temporal knowledge graph model.
[0041] Furthermore, by employing standard graph data models such as the resource description framework, entity concepts in the production and quality domain are instantiated as nodes in the knowledge graph. For example, nodes such as chicken house A, rapid cooling process for slaughter, and intramuscular fat content are created. Potential directional causal relationships are instantiated as directed edges connecting nodes, and the edge type is defined as either causing or influencing. The temporal constraint information contained in the causal relationship and temporal association is transformed into attributes attached to the corresponding edges or nodes, such as storing them as attribute fields for effective start time, effective end time, and duration requirements. All nodes, directed edges, and their attributes are integrated into a unified graph database, forming a machine-readable, queryable, and reasonable end-to-end causal temporal knowledge graph model that can represent the causal and temporal relationships between various elements from the source of breeding to the processing terminal.
[0042] Specifically, by using causal direction and temporal markers as basic components of the graph, a knowledge representation format is established. Structured storage not only records that A may lead to B, but also records that A may lead to B within time period C, or that B may be triggered within time unit D after event A. This makes the graph a knowledge base containing rich spatiotemporal context, providing direct data support for time-aware causal reasoning. For example, when tracing the reasons for poor color in a batch of meat, the graph can not only list potential causes such as long transportation time and pre-slaughter stress, but also, based on temporal associations, determine that if the cause of long transportation time occurs within a specific pre-slaughter period, its causal association with poor color is stronger, thus enabling more accurate root cause ranking. This deeply integrated structure provides the core infrastructure for evaluation methods to achieve dynamic, accurate, and interpretable reasoning.
[0043] S3. Based on the full-link causal temporal knowledge graph model, construct an uncertainty measurement causal knowledge graph, extract real-time monitorable source event combinations, and form a precursor signal pattern library.
[0044] S3.1 For each causal relationship in the full-link causal temporal knowledge graph model, integrate the data quality and sample sufficiency based on the causal relationship being processed in the full-link causal temporal knowledge graph model to evaluate the uncertainty interval.
[0045] Furthermore, for each causal relationship in the end-to-end causal temporal knowledge graph model, the data foundation supporting this causal relationship is analyzed. The data foundation analysis encompasses two dimensions: data quality, assessing the accuracy, completeness, and consistency of the data involved; and sample sufficiency, assessing the size and representativeness of the sample size and distribution. Based on the comprehensive assessment results of data quality and sample sufficiency, a predefined mapping relationship is applied to transform the assessment results into a quantitative uncertainty interval, which characterizes the statistically reliable range of the causal relationship being processed in the end-to-end causal temporal knowledge graph model. The uncertainty interval assessment process is essentially the process of quantifying and labeling the reliability of each causal relationship in the end-to-end causal temporal knowledge graph model. The completion of this step signifies that each abstract causal relationship has been assigned an uncertainty interval describing its own confidence level.
[0046] Specifically, the uncertainty of causal knowledge is transformed from implicit, qualitative expert experience into explicit, quantitative, and computable knowledge graph attributes. Current technologies, when constructing knowledge graphs, typically assume that the extracted causal relationships are deterministic or only represent them broadly with simple confidence scores. This masks the inherent ambiguity of knowledge, leading to fragile conclusions in graph-based reasoning scenarios with high data noise or small sample sizes. Delving into the root of causal relationship generation—data—a joint evaluation is conducted from two fundamental dimensions: data quality and sample sufficiency, characterizing the robustness of the knowledge itself. For example, a causal relationship based on a small-scale experiment—that feed additive A improves meat color—is assigned a wider uncertainty range due to its limited sample size; conversely, a causal relationship based on years of industry-wide monitoring data—that increased transportation time leads to increased drip loss—is assigned a narrower range, allowing for more prudent and robust judgments. Uncertainty measurement in causal knowledge graphs is no longer an idealized perfect model, but a self-declaring limitation, thus becoming a more credible and usable decision support foundation.
[0047] S3.2. Store the uncertainty interval and the corresponding causal relationship together in the full-link causal temporal knowledge graph model to obtain the causal relationship that incorporates uncertainty measurement.
[0048] Furthermore, the uncertainty interval assessed for each causal relationship is treated as an inherent attribute of that causal relationship and persistently stored in the end-to-end causal temporal knowledge graph model along with other defining information about the causal relationship. In terms of storage implementation, the uncertainty interval is recorded as a pair of lower and upper bound values in the edge attributes of the corresponding causal relationship. Through this storage operation, each causal relationship in the end-to-end causal temporal knowledge graph model is upgraded from merely describing its existence and strength to simultaneously describing the range of uncertainty within which it holds true. The end-to-end causal temporal knowledge graph model is thus enhanced into a knowledge network composed of causal relationships that incorporate uncertainty measurements.
[0049] Specifically, uncertainty is transformed from external annotations into an intrinsic structural component of knowledge. Existing technologies typically manage causal knowledge and the evaluation of knowledge (such as uncertainty) separately, for example, by building a separate metadata database outside the graph or calculating it separately at the application layer, making efficient collaboration during reasoning difficult. By directly embedding the uncertainty interval as an inseparable part of the causal relationship, causality and uncertainty are atomically bound at the data structure level. For example, when the reasoning algorithm needs to traverse the path of feed mold → liver damage → meat quality decline, it can instantly read the uncertainty interval bound to each edge and perform propagation calculations without additional queries, ensuring the real-time performance and consistency of the reasoning. This integrated knowledge-measure design solves the problem of the integrity of the evidence chain in credible reasoning, ensuring that any conclusion based on this graph naturally carries a credibility traceability chain.
[0050] S3.3 Integrate the causal relationship that incorporates uncertainty measurement with the complete structure of the full-link causal temporal knowledge graph model to obtain the uncertainty measurement causal knowledge graph.
[0051] Furthermore, for each causal relationship that has undergone uncertainty interval assessment and incorporates uncertainty measures, a structured integration operation is performed. While maintaining the original topological structure of the full-link causal temporal knowledge graph model, including entity nodes, timestamps, and non-causal relationships, the uncertainty interval attribute carried by the causal relationship incorporating uncertainty measures is written as a new, mandatory set of metadata fields into the graph storage of the full-link causal temporal knowledge graph model, and persistently bound to the corresponding causal relationship edges. The integration process ensures that the data structure of each causal edge is expanded from containing only basic fields such as start and end nodes, relationship type, and strength weight to an enhanced structure that simultaneously includes the lower and upper bound values of the uncertainty interval. Once all causal relationships in the full-link causal temporal knowledge graph model have undergone this attribute injection and structural update, the integration is complete, and the resulting knowledge representation is the uncertainty measure causal knowledge graph.
[0052] Specifically, through mandatory expansion at the data structure level, uncertainty measurement is elevated to a first-order attribute on par with causality itself, achieving atomic unity between the two in physical storage and logical access. This fundamentally avoids the overhead of frequent cross-database join queries and consistency maintenance during subsequent inference, transforming uncertainty from an evaluation requiring additional computation into an instantly readable fact. For example, when tracing the cause of meat rancidity, the inference engine, while traversing the path of abnormal feed fermentation → excessive rumen acidity → decreased meat pH, can read the uncertainty interval of the relationship between abnormal feed fermentation → excessive rumen acidity as a wide interval, and excessive rumen acidity → decreased meat pH as a narrow interval, just as if directly reading the existence of a causal relationship. This allows any analysis based on the causal knowledge graph of uncertainty measurement, such as risk propagation simulation or decision optimization, to seamlessly integrate reliability information in a streaming, online manner, constructing a knowledge foundation intrinsically supporting uncertainty propagation computation.
[0053] S3.4 Based on the evaluation target of livestock and poultry product quality deterioration, locate the specific negative quality final state node in the uncertainty measurement causal knowledge graph, and start from each negative quality final state node, traverse backward along the causal relationship dimension in the causal relationship of the fused uncertainty measurement, and trace back to the physical quantity represented by the sensors at the breeding or processing site.
[0054] Furthermore, based on the evaluation objectives of livestock and poultry product quality deterioration, all specific negative quality final state nodes predefined as evaluation endpoints are located in the causal knowledge graph of uncertainty measurement. These nodes include those with insufficient tenderness, abnormal meat color, or lack of specific flavor substances. Starting from each located negative quality final state node, a step-by-step reverse traversal and path search is performed along the causal relationship dimension in the causal relationship that integrates uncertainty measurement and exists in the form of directed edges. During the reverse traversal, only the causal direction of the edges is considered and followed, that is, tracing back from the result node to the cause node, and ignoring the uncertainty interval attributes coexisting in the same relationship, until it is impossible to continue tracing back or a specific type of node is reached. The attributes of this type of node indicate that its state can be continuously monitored and quantitatively characterized by physical sensors deployed at the breeding or processing site, such as internal temperature sensor readings, feed scale weight readings, infrared thermometer values at the slaughter line, or ammonia concentration detection values. The complete reverse causal path from the negative quality final state node to these monitorable physical quantity nodes is recorded, thereby completing the tracing.
[0055] Specifically, guided by the evaluation objective (such as excessive drip loss or insufficient tenderness), the system retrieves all relevant quality indicator nodes in the graph. However, it doesn't just match names; instead, it calculates the actual abnormal deviation of each candidate node in recent historical data. This deviation is then comprehensively weighted and evaluated along with the cumulative uncertainty of the node across all upstream causal paths pointing to it. The positioning logic prioritizes nodes with significantly deviated actual measurements from the normal range and relatively narrow predictive uncertainty ranges for upstream causal paths pointing to the node, classifying them as high-confidence negative quality final state nodes. Conversely, nodes with abnormal measurements but wide uncertainties across all upstream paths are marked as suspected nodes requiring close investigation rather than direct final state nodes. For example, when the evaluation objective is meat safety, the Salmonella detection level node in the graph might be retrieved due to an excessive detection value. However, the system simultaneously analyzes the uncertainties of all upstream paths that could lead to this excessive level (such as feed contamination, water contamination, and cross-contamination during processing). If the uncertainty range of the feed contamination → Salmonella pathway is narrow, while other pathways are wide, the system will identify the Salmonella detection level node as the core final state node with high confidence and direct the tracing focus to feed-related physical quantities. If the uncertainty of all pathways is wide, the node will be identified as "suspected," and it will be recommended to prioritize expanding testing to reduce the uncertainty of the critical pathway. This positioning mechanism deeply internalizes the path-level uncertainty measurement generated during algorithm improvement into the initial node selection logic, ensuring that subsequent tracing begins with a node with a clear problem and a relatively clear root cause, thus improving the efficiency of the entire source tracing analysis and the reliability of the conclusions from the starting point.
[0056] S3.5 Define the logical combination of the physical quantities as a real-time monitorable source event combination that characterizes a specific quality risk pattern, and obtain the real-time monitorable source event combination.
[0057] Furthermore, the physical quantities characterized by sensors at the breeding or processing sites are logically combined and defined based on the causal path topology that they all point to the same negative quality final state node, as well as the co-occurrence and synergistic change patterns among these physical quantities in historical data streams. The terminal physical quantity nodes on one or more causal paths tracing back to the same negative quality final state node are analyzed. If historical data shows that these physical quantities tend to appear simultaneously or sequentially in a specific state (such as exceeding a threshold or undergoing a sudden change) within a specific time window, then this combination of their states is defined as a logical expression. For example, the state of physical quantity A being greater than a certain threshold and the state of physical quantity B showing a downward trend over a period of time are combined through a logical AND relationship. This logical expression represents a real-time monitorable source event combination that triggers the specific quality risk. The abstract causal path is transformed into a concrete event combination composed of logical operations of observable physical quantity states, resulting in a real-time monitorable source event combination.
[0058] Specifically, the source events that can be monitored in real time are defined as specific logical combinations of multiple underlying physical quantities, rather than independent threshold judgments of a single physical quantity. Utilizing the multiple causal path information revealed by the causal knowledge graph of uncertainty measurement, key physical quantity clusters that have historically led to the same quality problem are identified, and abnormal state patterns are extracted into a logical combination. For example, regarding the negative quality of PSE meat, the graph may reveal that pre-slaughter stress and improper cooling rates are two main causal paths. Tracing back, multiple physical quantities such as transport vibration amplitude, ambient noise in the resting area, and the temperature of the first section of the cooling line are obtained. Analysis of historical data reveals that when high transport vibration amplitude, high ambient noise, and insufficient temperature in the first section of the cooling line occur simultaneously, they are highly correlated with PSE meat. Defining the combination of these three states as a composite event generates a warning signal with strong causal interpretability and specificity, capable of characterizing truly risky, multi-stage imbalanced complex scenarios.
[0059] S3.6. Classify and structure the real-time monitorable source events according to the associated negative quality final state nodes to form a precursor signal pattern library.
[0060] Furthermore, each combination is categorized based on the negative quality final state node that it begins with during reverse traversal. An independent logical group is created for each negative quality final state node, and all real-time monitorable source event combinations pointing to that final state node are stored in the corresponding logical group. The real-time monitorable source event combinations within each logical group are structured, including assigning a unique pattern identifier to each combination, recording its complete logical expression, a causal path summary associated with its source, and additional relevant uncertainty interval information inherited from the causal relationship of the original fusion uncertainty measure. Finally, all logical groups and their contained normalized information are integrated into an indexed knowledge set that can be efficiently queried and matched by real-time stream processing tasks, forming a precursor signal pattern library.
[0061] Specifically, by categorizing by result and encapsulating in a structured manner, scattered and specific monitoring rules are elevated into a knowledge base with a clear semantic system and hierarchical structure, capable of directly driving real-time decision-making. For example, all composite event patterns used to warn of insufficient tenderness are organized together, while all patterns used to warn of flavor defects are organized separately. This structuring is reflected in several aspects: during real-time monitoring, selective pattern matching can be performed on key quality indicators of current concern, improving computational efficiency; when a pattern is triggered, the specific risk type it foreshadows (such as insufficient tenderness) can be immediately identified, and it can be quickly associated with the corresponding causal explanation and treatment knowledge. This organizational form facilitates knowledge iteration and management; when new causal relationships are discovered or new physical quantities are added, they can be clearly incorporated into the classification of the corresponding quality final state node. It is an action guide that is isomorphic to the deep causal knowledge graph, interpretable, maintainable, and efficiently executable, realizing the construction of a bridge from causal cognition to real-time action.
[0062] S4. Match the standardized real-time data with the real-time data in the historical data stream and the precursor signal pattern library to obtain the specific precursor pattern matching event that was triggered.
[0063] S4.1 Establish a streaming computing task that runs continuously with a sliding time window to obtain a continuously updated real-time data window.
[0064] Furthermore, a data processing pipeline is established to connect to and consume standardized real-time data, within which a sliding time window mechanism based on event time or processing time is configured. This sliding time window mechanism continuously and periodically extracts a continuous subset of data from the streaming data according to a preset window length and sliding step size. Each extracted subset of data containing the latest standardized real-time data within a specific time period is output as a continuously updated real-time data window. In this way, the data processing pipeline can continuously generate real-time data windows that are continuous or overlapping in time, thereby achieving continuous segmentation and encapsulation of the data stream and obtaining continuously updated real-time data windows.
[0065] Specifically, a sliding time window mechanism is employed to process standardized real-time data streams, thereby constructing a data view that reflects the latest dynamics of the production process without omissions and with low latency. This overcomes the shortcomings of traditional batch processing or fixed time window methods in terms of real-time performance and continuity. The continuous operation of the sliding time window ensures that events occurring at any given time point can be included in one or more consecutive windows for analysis, achieving a panoramic scan of the data stream rather than sampling. For example, in livestock and poultry farming, a stress process induced by the slight deterioration of multiple environmental parameters and lasting for several hours can be continuously captured by the sliding window throughout its occurrence and development, through a series of interconnected windows. Unlike fixed-interval checks, which may miss some key phases of change, this ensures that the input data for subsequent pattern matching is a continuous, complete, and timely snapshot of the latest on-site state, laying a solid data foundation for the real-time and accurate capture of complex combinations of precursory events.
[0066] S4.2. Compare the continuously updated real-time data window with the logical conditions defined for each mode in the precursor signal mode library to obtain preliminary matching results.
[0067] Furthermore, for each continuously updated real-time data window, each pattern stored in the precursor signal pattern library is traversed. For the currently traversed pattern, the logical conditions contained in the pattern definition are extracted. These logical conditions are combinations of Boolean expressions concerning the state of one or more specific physical quantities (such as numerical range, trend of change, duration). In the continuously updated real-time data window, the current state value or statistical characteristics of each physical quantity involved in the logical conditions are found and calculated. The physical quantity states are compared and evaluated one by one with the Boolean expressions specified in the logical conditions to determine whether all logical conditions are satisfied simultaneously within the time period represented by the currently continuously updated real-time data window. The comparison and evaluation results of all patterns are summarized, and it is recorded which patterns have all their logical conditions satisfied, thus obtaining a preliminary matching result listing all patterns satisfied within the current window.
[0068] Specifically, each pattern in the precursor signal pattern library is defined as a combination of logical conditions that can be directly parsed and executed by the streaming computing engine, and a full-library traversal matching is performed on a continuous stream of real-time data windows. This enables real-time monitoring to be based directly on knowledge, rather than on isolated signals. For example, a pattern warning of heat stress leading to decreased feed intake and thus affecting weight gain might have logical conditions including the AND relationship of multiple conditions such as the average internal temperature exceeding a threshold, the standard deviation of internal temperature being lower than a threshold, and the feed consumption rate decreasing within the same time window. The streaming matching task can simultaneously evaluate the average temperature level, stability, and feed change trend within a time window. Only when all three conditions are met is the pattern considered matched. This can accurately capture composite events that conform to specific causal assumptions, reduce false alarms caused by short-term fluctuations of single factors, and ensure that each matched precursor signal has a high causal correlation and early warning value. This represents a qualitative leap from sensor signal alarms to causal scenario recognition.
[0069] S4.3 For the results that meet the logical conditions in the preliminary matching results, record the timestamp of meeting the conditions, the pattern identifier, and the associated real-time data snapshot to obtain the specific precursor pattern matching event that was triggered.
[0070] Furthermore, the preliminary matching results are filtered to extract all records where the logical conditions are met. For each record that meets the conditions, the unique pattern identifier in the precursor signal pattern library corresponding to that record is extracted and recorded. At the same time, the end timestamp or center timestamp of the continuously updated real-time data window that triggered the pattern matching is recorded as the event trigger time. The contents of the continuously updated real-time data window that triggered the matching, or a subset of physical quantity data directly related to the logical conditions of the matching pattern, are also snapshotted and saved to form an associated real-time data snapshot. The pattern identifier, the event trigger time, and the associated real-time data snapshot are encapsulated into a complete event record and output as the specific precursor pattern matching event that was triggered.
[0071] Specifically, a successful match is treated as a significant event requiring detailed documentation. This not only records its identity and time but also secures the original data evidence that triggered it. This makes every alert traceable and auditable. By replaying real-time data snapshots, the correctness of the match can be verified manually or automatically, avoiding black-box alerts. Complete real-time data snapshots provide the most direct and abundant input data for uncertain causal reasoning, ensuring that the reasoning is based on the real-world state at the moment of triggering. These structured event records provide high-quality labeled data for subsequent model optimization. For example, when a pattern related to cold stress risk is triggered, the generated event includes precise snapshots of data such as temperature, wind speed, and livestock distribution heatmaps at that time. This information can be used immediately to assess the potential severity of cold stress and, when it is subsequently determined whether the livestock actually have health or quality problems, to verify and correct the logical conditions or uncertainty parameters of the cold stress risk pattern itself. This forms a complete data loop from perception and decision-making to learning, enhancing the credibility and adaptability of the entire evaluation system.
[0072] S5. Match the standardized real-time data with the real-time data in the historical data stream and the precursor signal pattern library to obtain the specific precursor pattern matching event that was triggered.
[0073] S5.1 Based on the pattern identifier carried by the specific precursor pattern matching event, locate the corresponding starting node and the complete causal influence path in the uncertainty measurement causal knowledge graph.
[0074] Furthermore, based on the pattern identifier carried by the specific precursor pattern matching event, a query is performed in the uncertainty measurement causal knowledge graph. This query uses the pattern identifier as the key to retrieve the metadata associated with the pattern identifier in the precursor signal pattern library. The metadata records the unique identifiers of one or more starting nodes corresponding to the pattern, extracted and stored from the uncertainty measurement causal knowledge graph when constructing the precursor signal pattern library. These starting nodes are the physical quantity nodes directly characterized by sensors at the aquaculture or processing site. Based on the starting node identifiers obtained from the query, these specific starting nodes are located in the uncertainty measurement causal knowledge graph. Using the stored complete causal influence path information from these starting nodes to the specific negative quality final state node, which is stored in the uncertainty measurement causal knowledge graph, the entire causal transmission sequence represented by the pattern is directly obtained, thereby completing the location.
[0075] Specifically, through the information link of pattern identifiers, the triggered specific precursor pattern matching event is instantly anchored to a predefined, complete causal influence path in the uncertainty measure causal knowledge graph. This achieves a seamless connection from pattern matching to causal inference. During the construction of the precursor signal pattern library, each composite event pattern is pre-linked and structuredly stored with its corresponding source node and determined causal path in the uncertainty measure causal knowledge graph. Therefore, when a pattern is matched and triggered in the real-time stream, there is no need for time-consuming graph search; a complete causal inference blueprint can be obtained immediately through a lookup operation using the pattern identifier. For example, when a pattern identified as PSE_Risk_01 is triggered, this identifier is directly associated with the transport vibration sensor node X and the resting circle noise node Y in the uncertainty measure causal knowledge graph as starting nodes, and is associated with a pre-defined complete causal influence path that leads from the stress hormone level node to the PSE meat quality node. By addressing the complexity of reasoning at the knowledge base construction stage, and achieving ultimate efficiency and certainty in the real-time decision-making stage, it ensures that accurate causal inference can be initiated in milliseconds in emergency early warning scenarios.
[0076] S5.2. Along the causal influence path of the location, from the starting node to the negative quality final state node, the uncertainty interval of each causal relationship on the path is obtained in sequence, and the intervals are merged and calculated step by step according to the predetermined interval operation rules to obtain the comprehensive prediction uncertainty interval for reaching the final state node.
[0077] Furthermore, the uncertainty interval is obtained from the first causal relationship along the path, and this interval is defined by a lower bound. and upper bound value Definition: The path decay factor for the first causal relationship. With interval width penalty coefficient Applied to 1 and Through calculation and and The product yields the adjusted lower bound of the first cumulative uncertainty interval. And through a specific transformation formula , and The adjusted upper bound of the first cumulative uncertainty interval is obtained by combining the calculations. This completes the setting of the initial accumulation interval, and affects the causal influence path from the second segment to the first segment. Each causal relationship in the segment is processed iteratively, and at the 1st... In processing segment relationships, obtain the lower bound of its uncertainty interval. and upper bound value And determine the comprehensive adjustment coefficient for this relationship. The lower bound of the cumulative uncertainty interval obtained in the previous iteration. and upper bound value , with the current paragraph and as well as By combining these methods, new cumulative lower bound values are calculated separately using specific linear interpolation merging formulas. and cumulative upper bound This iterative process continues until the first step on the path has been processed. The cumulative lower bound value obtained at this point represents a causal relationship. and cumulative upper bound This is output as the lower bound of the comprehensive prediction uncertainty interval for reaching the negative quality final state node. and upper bound value .
[0078] Specifically, the natural decay rate of causal influence during transmission is quantified by the path decay factor, simulating the phenomenon of weakening influence of distant causes on the final result; the interval width penalty coefficient is used to... The weighting of causal relationships with excessively high inherent uncertainty (i.e., excessively wide intervals) is automatically reduced in the merging process, suppressing the interference of low-quality evidence on the final conclusion, and the overall adjustment coefficient is adjusted accordingly. This dynamically balances the integration ratio of historical cumulative effects and current stage influences. For example, in a long causal chain of feed contamination → digestive disorders → immunosuppression → disease occurrence → meat quality decline, the attenuation of the disease occurrence → meat quality decline relationship near the endpoint is relatively small. However, the attenuation effect of the initial feed contamination → digestive disorders relationship on the endpoint is smaller after multiple steps of transmission. If the medical evidence for the immunosuppression → disease occurrence link is insufficient, resulting in a wide uncertainty range, the interval width penalty mechanism will automatically reduce the contribution of this link in the overall risk accumulation calculation. This mechanism ensures that the final comprehensive prediction uncertainty range not only reflects the accumulation of risk and the reliability structure of the risk transmission path, but also generates risk prediction conclusions with both quantitative assessment and confidence statement attributes, providing unprecedented refinement and reliability assurance for decision-making based on uncertainty knowledge.
[0079] Set the initial accumulation interval to the first interval, but adjust it according to its position and width; ; in, This is the lower bound of the first cumulative uncertainty interval. This represents the lower bound of the uncertainty interval for the first causal relationship. This is the path decay factor for the first causal relationship. This is the interval width penalty coefficient for the first causal relationship; ; in, This is the upper bound of the first cumulative uncertainty interval. This is the upper bound of the uncertainty interval for the first causal relationship (i.e., from the starting node to the first intermediate node). For the Cause and effect relationship ( From 2 to ), will the current cumulative interval , With the The intervals are merged, and the merging weight is determined by the decay factor and the penalty coefficient.
[0080] ; in, For the first The lower bound of the uncertainty interval of a causal relationship. In the process of merging calculations at each level, up to and including the [number]th [level]... After establishing a causal relationship, the lower bound of the cumulative uncertainty interval is obtained. For the first The comprehensive adjustment coefficient for the causal relationship of the segment. For the first The lower bound of the new cumulative uncertainty interval obtained after merging the uncertainties of the segment relationships. ; in, In the process of merging calculations at each level, the first After merging the uncertainties of the segment relationships, the upper bound of the new cumulative uncertainty interval is obtained. In the process of merging calculations at each level, up to and including the [number]th [level] After establishing a causal relationship, the upper bound of the cumulative uncertainty interval is obtained. For the first The upper bound of the uncertainty interval of a causal relationship; The expression for the uncertainty interval of the comprehensive forecast is: ; in, The lower and upper bounds of the comprehensive prediction uncertainty interval for reaching the negative quality final state node are given. These are the lower and upper bounds of the final cumulative uncertainty interval obtained at the end of the step-by-step merging calculation process. This represents the total number of causal path segments from the starting node to the last intermediate node before the final state node. It should be noted that the uncertainty interval characterizes the range of the estimated strength of the causal relationship and its reliability. According to predetermined interval calculation rules, the successively obtained uncertainty intervals are merged and calculated step by step. This simulates the structured process of risk transmission and evolution along a clearly defined causal chain. During merging, the numerical range of each interval is considered, incorporating mechanisms such as path decay and interval width penalty to reflect the natural decay of the influence of distant causal relationships and the prudent handling of relation segments with high initial uncertainty. Through this sequential, cumulative merging calculation, a comprehensive predictive uncertainty interval characterizing the overall risk level of the entire chain from the occurrence of the initial event to the degradation of the final quality is obtained. This interval simultaneously includes the predicted magnitude of the risk effect (characterized by the interval's central trend) and the confidence level of the predicted conclusion (characterized by the interval width).
[0081] S5.3. Assess the severity of quality degradation based on the center value of the comprehensive prediction uncertainty interval, and assess the overall prediction confidence using the width of the comprehensive prediction uncertainty interval.
[0082] Furthermore, the severity of quality degradation is assessed based on the central value of the comprehensive forecast uncertainty interval. The specific calculation process involves taking the lower bound of the comprehensive forecast uncertainty interval. and upper bound value The arithmetic mean or weighted average of the values is used as the central value to quantify the degree of quality degradation in the prediction. The overall confidence level of the prediction is assessed using the width of the overall prediction uncertainty interval. The calculation process involves using the upper bound of the overall prediction uncertainty interval. Subtract the lower bound value The interval width is obtained, and then the width value is compared with a reference width benchmark or converted into a confidence score through a monotonically decreasing mapping function. The smaller the interval width, the higher the overall confidence score of the prediction is. Two independent quantitative indicators are output: the prediction severity, which represents the size of the risk, and the overall confidence score of the prediction, which represents the reliability of the prediction.
[0083] Specifically, within the single probability output of the comprehensive prediction uncertainty interval, two orthogonal decision dimensions—predicted severity and overall prediction confidence—are separated and extracted. This achieves a dimensional upgrade and decoupling of traditional early warning information, directly transforming the mathematical characteristics of the comprehensive prediction uncertainty interval into decision elements with clear management significance. Predicted severity originates from the interval's central trend, answering the question of how bad it is most likely to be; overall prediction confidence originates from the interval's width, answering the question of how certain this judgment is. For example, facing the risk of declining meat tenderness, a narrow interval derived from high-quality data, even if its central value indicates a moderate predicted decline, may still require serious attention due to its high confidence; conversely, a wide interval derived from sparse, noisy data, even if its central value indicates a high predicted decline, will be marked as needing further verification due to its low confidence. This separate assessment expands the perception of risk from a one-dimensional size to a two-dimensional size-certainty plane.
[0084] S5.4 Based on the preset decision matrix, the predicted severity and overall confidence level are mapped to the corresponding decision level, generating graded decision instructions and a diagnostic report.
[0085] Furthermore, a two-dimensional lookup table-style decision matrix is predefined. The rows and columns of this matrix consist of discretized predicted severity levels and predicted overall confidence levels, respectively. Each cell in the matrix stores a predefined decision level code and its corresponding instruction template. After obtaining the predicted severity and predicted overall confidence, the corresponding discretized level is determined based on their values, and the corresponding cell is located in the decision matrix. Based on the found decision level code, specific hierarchical decision instructions are generated. The instructions may include directly controlling the parameters of the actuator, generating verification or intervention work orders to be dispatched to personnel, or simply logging and generating a diagnostic report.
[0086] Specifically, during the decision generation process, based on the two-dimensional evaluation query decision matrix obtained from the deconstruction of the comprehensive prediction uncertainty interval, intermediate data and adjustment parameters in the step-by-step merging calculation process are called and analyzed to generate instructions with clear tracing directions. When the decision matrix maps out instructions such as immediately initiating targeted verification, the logic that generates the instruction will backtrack the entire process record of merging calculation to locate the causal relationship links whose contribution is limited due to the reduction of the interval width penalty coefficient, or to identify the distant causal relationships whose influence is excessively weakened in the final interval due to the influence of the path decay factor. The located links are the key uncertainty causal links. The targeted verification instruction will clearly indicate that the original data quality, sample sufficiency, or domain knowledge of these links need to be reviewed and enhanced. The algorithm improvement (introducing dynamic mechanisms such as decay and penalty) not only changes the calculation results of the risk interval.
[0087] S6. Execute hierarchical decision-making instructions and diagnostic reports, and optimize and update the full-link causal temporal knowledge graph model and uncertainty measurement causal knowledge graph based on execution feedback and final quality results.
[0088] S6.1 Execute and record operations according to the hierarchical decision instructions, obtain the executed operation records and corresponding execution feedback data, and obtain the final quality results of the associated batch.
[0089] Furthermore, the generated hierarchical decision-making instructions are sent to the corresponding environmental control equipment, feeding controllers, or production management work order platforms through a standardized control protocol interface, triggering and completing the physical actions or manual tasks required by the instructions. At the same time, an executed operation record containing the instruction content, execution time, executing equipment or responsible person, and target parameters is generated and stored. Within a preset observation period after the instruction is executed, sensor readings and process parameters directly related to the intervened link are continuously collected from the standardized real-time data stream, and this data is organized into execution feedback data. Meanwhile, after the associated production batch completes all processing procedures, the final quality test value corresponding to the warning negative quality final state node of the batch of livestock and poultry products is extracted from the laboratory information management database or quality test report as the final quality result.
[0090] Specifically, the entire lifecycle data of a single early warning decision is forcibly bound and structured. When a hierarchical decision instruction is generated, whether it is an automatic control instruction or a manual work order, its execution itself generates an executed operation record. After execution, the system automatically locks the relevant production process parameters, forming execution feedback data to observe whether the intervention measures have produced the expected intermediate effects. Then, the final quality result of the batch of products is obtained as the gold standard for verifying whether the prediction has come true. For example, for the instruction to activate the water curtain for cooling generated by the high-temperature stress risk warning, the execution record will record the activation time and target temperature, the execution feedback data will record the actual temperature drop curve after activation, and the final quality result will be the pH value and drip loss rate of the batch of meat. In livestock and poultry production evaluation, a traceable and analyzable complete data chain between decision actions and multi-dimensional results is established, providing indispensable high-quality labeled data for model self-verification and optimization. This is the cornerstone for realizing the continuous evolution of knowledge graphs and improving the level of intelligent decision-making.
[0091] S6.2 Compare the execution feedback data and the final quality results with the diagnostic report to obtain the difference analysis results.
[0092] Furthermore, the predicted content recorded in the diagnostic report is extracted, including the comprehensive prediction uncertainty interval for the final state node of negative quality and the predicted severity based on it. The actual value of the final quality result is compared with the comprehensive prediction uncertainty interval to determine whether the actual value falls within the prediction interval. The magnitude and direction of the deviation between the actual value and the central value of the interval are calculated to obtain a quantitative deviation regarding the prediction accuracy. The trend and magnitude of the process parameter changes reflected in the execution feedback data are compared with the expected changes in the intermediate state after intervention based on the causal influence path inference in the diagnostic report to analyze whether the actual effect of the intervention measures is consistent with the causal inference expectation, thus obtaining an analysis of the effectiveness of the causal path. The combined analysis of prediction accuracy deviation and causal path effectiveness results forms a structured description of the differences between the prediction and the actual situation and their possible causes.
[0093] Specifically, variance analysis is divided into two levels: the first level is endpoint verification, which uses the final quality results to test the reliability of the overall prediction uncertainty range; the second level is process review, which uses execution feedback data to test whether the causal path from the intervention point to the quality endpoint holds true. For example, if it is predicted that turning on ventilation can alleviate heat stress and thus improve meat quality, but the meat quality does not improve in the end, variance analysis will reveal whether the temperature did not drop after turning on ventilation (inconsistent process feedback, pointing to execution problems or inaccurate environmental models), or whether the temperature dropped but the meat quality was still poor (the causal path does not hold true, pointing to the strength of the causal relationship between heat stress and meat quality or the uncertainty range needing adjustment). Based on the ability of variance analysis to accurately locate potential problem links in the knowledge graph, it is a practical experience of prediction-execution-feedback.
[0094] S6.3. Update the full-link causal temporal knowledge graph model and the uncertainty measure causal knowledge graph using the difference analysis results to obtain the optimized knowledge graph model.
[0095] Furthermore, the difference analysis results are analyzed. If the difference analysis indicates that the final quality result falls within the comprehensive prediction uncertainty range and the process feedback meets expectations, the confidence of each segment of the causal relationship on the relevant causal path is strengthened. This is manifested in fine-tuning the directional weights of the relevant causal relationships in the full-link causal temporal knowledge graph model and narrowing the uncertainty range of the corresponding causal relationships in the uncertainty measurement causal knowledge graph. If the difference analysis indicates that there is a significant deviation in the prediction, the direction or strength of the relevant causal relationships in the full-link causal temporal knowledge graph model is adjusted according to the deviation direction and the process review conclusion, or new constraints are added to the temporal association. At the same time, in the uncertainty measurement causal knowledge graph, the uncertainty range of the relevant causal relationships is re-evaluated and widened according to the degree of deviation and data quality. The above adjustments are applied to the storage structure of the two knowledge graphs, and the updated full-link causal temporal knowledge graph model and uncertainty measurement causal knowledge graph model are output, which are the optimized knowledge graph models.
[0096] Specifically, each early warning decision and its subsequent verification are viewed as an active test or natural experiment of local causal hypotheses in the knowledge graph. Using refined differential analysis results, the knowledge graph is surgically updated. If the prediction is accurate, the knowledge of that path is strengthened, its uncertainty range is tightened, and its weight in future reasoning is increased. If the prediction is inaccurate, the knowledge of that path is weakened or corrected, its uncertainty range is widened to reflect cognitive deficiencies, and even the causal relationship is modified. For example, if multiple data feedbacks confirm that a certain feed additive is ineffective in improving meat color when used in summer, the causal strength of the additive → meat color edge can be adjusted to approach zero, and its uncertainty range significantly widened. Environmental temperature can be explored and added as a moderating variable (temporal association) for this causal relationship, enabling the knowledge graph to continuously learn from practice. Its evolution is data-driven, localized, and interpretable, achieving autonomous growth in evaluation and decision-making intelligence.
[0097] This embodiment also provides a knowledge graph-based livestock and poultry product evaluation system, including: a preprocessing module, which collects multi-source data from the entire livestock and poultry breeding and processing chain and performs preprocessing to obtain standardized real-time data and historical data streams; and constructs a full-link causal-temporal knowledge graph model with causal and temporal information based on the historical data streams. The extraction module, based on the full-link causal temporal knowledge graph model, constructs an uncertainty measurement causal knowledge graph, extracts real-time monitorable combinations of source events, and forms a precursor signal pattern library; The matching module matches standardized real-time data with real-time data in historical data streams and a precursor signal pattern library to obtain the specific precursor pattern matching event that has been triggered. The deduction module starts with specific precursor pattern matching events, and performs cumulative propagation deduction of uncertainty in the causal knowledge graph of uncertainty measurement to generate hierarchical decision instructions and diagnostic reports. The execution module executes hierarchical decision-making instructions and diagnostic reports, and optimizes and updates the end-to-end causal temporal knowledge graph model and uncertainty measurement causal knowledge graph based on execution feedback and final quality results.
[0098] This embodiment also provides a computer device applicable to the knowledge graph-based livestock and poultry product evaluation method, comprising: a memory and a processor; the memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions to implement the knowledge graph-based livestock and poultry product evaluation method proposed in the above embodiment.
[0099] The computer device can be a terminal, comprising a processor, memory, communication interface, display screen, and input devices connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, carrier networks, NFC (Near Field Communication), or other technologies. The display screen can be an LCD screen or an e-ink screen. The input devices can be a touch layer covering the display screen, buttons, a trackball, or a touchpad on the computer device's casing, or an external keyboard, touchpad, or mouse.
[0100] This embodiment also provides a storage medium storing a computer program that, when executed by a processor, implements the knowledge graph-based livestock and poultry product evaluation method proposed in the above embodiments. The storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as Static Random Access Memory (SRAM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read Only Memory (EPROM), Programmable Red-Only Memory (PROM), Read-Only Memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.
[0101] In summary, this invention collects and standardizes multi-source data from the entire livestock and poultry breeding and processing chain, constructs a full-link causal-temporal knowledge graph model containing causal and temporal information, and builds a causal knowledge graph integrating uncertainty measurement on this model. Simultaneously, it reverse-engineers combinations of source events that can be directly monitored by sensors and characterize specific quality risks from this graph, forming a precursor signal pattern library. By matching real-time data streams with this pattern library, specific precursor pattern matching events are triggered. Starting from this event, uncertainty is accumulated and propagated along the causal path in the uncertainty measurement causal knowledge graph, quantifying and predicting the severity and confidence of the risk, and generating hierarchical decision instructions and diagnostic reports accordingly. Based on decision execution feedback and final quality results, the knowledge graph model is iteratively optimized, thus forming a complete closed-loop evaluation and decision support system from data perception, knowledge construction, real-time reasoning, accurate decision-making to model self-evolution.
[0102] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.
Claims
1. A knowledge graph-based method for evaluating livestock and poultry products, characterized in that: This includes collecting multi-source data from the entire livestock and poultry breeding and processing chain and preprocessing it to obtain standardized real-time data and historical data streams, and constructing a full-link causal-temporal knowledge graph model with causal and temporal information; Based on the full-link causal temporal knowledge graph model, an uncertainty measurement causal knowledge graph is constructed to extract real-time monitorable source event combinations and form a precursor signal pattern library. The standardized real-time data is matched with the real-time data in the historical data stream and the precursor signal pattern library to obtain the specific precursor pattern matching event that is triggered. Starting with specific precursor pattern matching events, the cumulative propagation of uncertainty is deduced in the causal knowledge graph of uncertainty measurement, generating hierarchical decision instructions and diagnostic reports; Execute hierarchical decision-making instructions and diagnostic reports, and optimize and update the full-link causal temporal knowledge graph model and uncertainty measurement causal knowledge graph based on execution feedback and final quality results.
2. The knowledge graph-based livestock and poultry product evaluation method as described in claim 1, characterized in that: The specific steps for obtaining standardized real-time data and historical data streams are as follows: After receiving multi-source data from the entire livestock and poultry breeding and processing chain through a multi-source data interface, the data is cleaned. The cleaned multi-source data is mapped and aligned with a unified timestamp and production identifier; The aligned multi-source data is divided into a real-time portion and a stored historical portion, resulting in standardized real-time data and historical data streams.
3. The knowledge graph-based livestock and poultry product evaluation method as described in claim 2, characterized in that: The specific steps of the full-link causal temporal knowledge graph model are as follows: Causal discovery algorithms are applied to learn and analyze the statistical dependencies between various production and quality variables in historical data streams, identify associations with potential causal direction, and obtain potential causal relationships. By labeling events based on potential causal relationships, the causal relationships and temporal connections can be obtained; By structuring and storing causal relationships and temporal connections, a full-link causal temporal knowledge graph model is obtained.
4. The knowledge graph-based livestock and poultry product evaluation method as described in claim 3, characterized in that: The specific steps for forming the precursor signal pattern library are as follows: For each causal relationship in the full-link causal temporal knowledge graph model, the uncertainty interval is evaluated by integrating the data quality and sample sufficiency of the causal relationship being processed in the full-link causal temporal knowledge graph model. The uncertainty interval and the corresponding causal relationship are stored together in the full-link causal temporal knowledge graph model to obtain a causal relationship that incorporates uncertainty measurement; By integrating the causal relationship that incorporates uncertainty measurement with the complete structure of the full-link causal temporal knowledge graph model, an uncertainty measurement causal knowledge graph is obtained. Based on the evaluation target of livestock and poultry product quality deterioration, specific negative quality final state nodes are located in the uncertainty measurement causal knowledge graph. Starting from each negative quality final state node, a reverse traversal is performed along the causal relationship dimension that integrates the uncertainty measurement causal relationship to trace back to the physical quantity characterized by sensors at the breeding or processing site. The logical combination of the physical quantities is defined as a real-time monitorable source event combination that characterizes a specific quality risk pattern, thus obtaining a real-time monitorable source event combination. Real-time monitorable source events are grouped and structured according to their associated negative quality final state nodes to form a precursor signal pattern library.
5. The knowledge graph-based livestock and poultry product evaluation method as described in claim 4, characterized in that: The specific steps of the triggered specific precursor pattern matching event are as follows: Establish a streaming computing task that runs continuously with a sliding time window to obtain a continuously updated real-time data window; The continuously updated real-time data window is compared with the logical conditions defined for each pattern in the precursor signal pattern library to obtain preliminary matching results. For results that meet the logical conditions in the preliminary matching results, record the timestamp of meeting the conditions, the pattern identifier, and the associated real-time data snapshot to obtain the specific precursor pattern matching event that was triggered.
6. The knowledge graph-based livestock and poultry product evaluation method as described in claim 5, characterized in that: The specific steps for generating hierarchical decision-making instructions and diagnostic reports are as follows: Based on the pattern identifier carried by the specific precursor pattern matching event, the corresponding starting node and the complete causal influence path are located in the uncertainty measurement causal knowledge graph. Along the causal influence path of the location, from the starting node to the negative quality final state node, the uncertainty interval of each causal relationship on the path is obtained in sequence, and the interval is merged and calculated step by step according to the predetermined interval operation rules to obtain the comprehensive prediction uncertainty interval to reach the final state node. The severity of quality degradation is assessed based on the center value of the comprehensive prediction uncertainty interval, and the overall prediction confidence is assessed using the width of the comprehensive prediction uncertainty interval. Based on the preset decision matrix, the predicted severity and overall confidence level are mapped to the corresponding decision level, generating graded decision instructions and a diagnostic report.
7. The knowledge graph-based livestock and poultry product evaluation method as described in claim 6, characterized in that: The specific steps for executing hierarchical decision-making instructions and diagnostic reports are as follows: Execute and record operations according to hierarchical decision instructions to obtain the executed operation records and corresponding execution feedback data, and obtain the final quality results of the associated batches; The execution feedback data and final quality results are compared with the diagnostic report to obtain the difference analysis results; The results of the difference analysis were used to update the end-to-end causal temporal knowledge graph model and the uncertainty measure causal knowledge graph, resulting in an optimized knowledge graph model.
8. A knowledge graph-based livestock and poultry product evaluation system, based on the knowledge graph-based livestock and poultry product evaluation method according to any one of claims 1 to 7, characterized in that: This includes a preprocessing module, which collects multi-source data from the entire livestock and poultry breeding and processing chain and preprocesses it to obtain standardized real-time data and historical data streams, and constructs a full-link causal-temporal knowledge graph model of causal and temporal information; The extraction module, based on the full-link causal temporal knowledge graph model, constructs an uncertainty measurement causal knowledge graph, extracts real-time monitorable combinations of source events, and forms a precursor signal pattern library; The matching module matches standardized real-time data with real-time data in historical data streams and a precursor signal pattern library to obtain the specific precursor pattern matching event that has been triggered. The deduction module starts with specific precursor pattern matching events, and performs cumulative propagation deduction of uncertainty in the causal knowledge graph of uncertainty measurement to generate hierarchical decision instructions and diagnostic reports. The execution module executes hierarchical decision-making instructions and diagnostic reports, and optimizes and updates the end-to-end causal temporal knowledge graph model and uncertainty measurement causal knowledge graph based on execution feedback and final quality results.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, it implements the steps of the knowledge graph-based livestock and poultry product evaluation method according to any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by the processor, it implements the steps of the knowledge graph-based livestock and poultry product evaluation method according to any one of claims 1 to 7.