Beer fermentation anomaly tracing method and device based on graph neural network and storage medium

By constructing a method for tracing the source of beer fermentation anomalies based on graph neural networks, and using temporal graph neural networks for feature learning and pattern recognition, the problem of early warning and root cause localization of anomalies in beer fermentation is solved, and rapid and accurate anomaly handling is achieved.

CN123140256APending Publication Date: 2026-11-20TIANJIN UNIV OF SCI & TECH +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202611626916.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-10-20
Publication Date
2026-11-20

AI Technical Summary

Technical Problem

Existing beer fermentation anomaly monitoring technologies cannot achieve early warning and automatic root cause location, resulting in low handling efficiency, and manual investigation relies on experience differences, leading to inconsistent judgments.

Method used

A graph neural network-based approach is used to construct a heterogeneous graph with the fermenter as the core. This graph is combined with a temporal graph neural network for feature learning and pattern recognition. Attention is calculated through biochemical mechanism association constraints to identify potential risks and locate the root causes of anomalies.

Benefits of technology

It enables early warning and rapid, accurate root cause localization during beer fermentation, avoiding the inefficiency and misjudgment of manual investigation, and meeting the needs of refined and intelligent anomaly monitoring.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123140256A_ABST
    Figure CN123140256A_ABST
Patent Text Reader

Abstract

The embodiment of the application provides a beer fermentation anomaly tracing method and device based on a graph neural network and a storage medium, and relates to the technical field of artificial intelligence. The method constructs a directed heterogeneous graph based on multi-source heterogeneous data; features of the directed heterogeneous graph are learned based on a time series graph neural network, attention calculation and weighted aggregation are performed through a time coding, memory updating mechanism and biochemical mechanism correlation constraint, real-time time series fermentation characteristics are obtained, and feature deviation degrees between the real-time time series fermentation characteristics and standard time series fermentation characteristics are calculated to realize hierarchical early warning, anomaly root causes are positioned through attention weight distribution, counterfactual intervention and production logic verification, a whole-process processing scheme of offline standard formulation, online real-time early warning and automatic root cause positioning is formed, rapid and accurate output of anomaly root causes is realized, and actual needs of fine and intelligent anomaly monitoring of a beer fermentation process are met.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of artificial intelligence technology, and in particular to a method, device and storage medium for tracing the source of beer fermentation anomalies based on graph neural networks. Background Technology

[0002] Beer fermentation is the core process in beer production, involving complex biochemical reactions such as yeast proliferation and sugar metabolism. It is highly sensitive to fluctuations in various process parameters, including temperature, pressure, and yeast activity. Any abnormality in any step can lead to the scrapping of the entire batch of beer.

[0003] Currently, monitoring of abnormal beer fermentation mainly relies on two methods: threshold alarms from Supervisory Control and Data Acquisition (SCADA) systems and offline sampling and testing. SCADA systems set fixed thresholds for each parameter, triggering alarms only when parameters exceed limits. This makes them unable to identify complex anomaly patterns involving multiple parameters deviating simultaneously, and alarms only indicate that a specific indicator has exceeded a limit, failing to pinpoint the root cause of the anomaly. Manual investigation is required, resulting in low efficiency. Offline sampling and testing, on the other hand, suffers from a 2-4 hour feedback delay, missing the window for timely intervention, and inconsistencies in judgment standards arise due to differences in the experience of different operators.

[0004] Therefore, existing technologies cannot achieve early warning and automatic root cause localization of fermentation abnormalities, making it difficult to meet the actual needs of beer fermentation process for refined and intelligent abnormality monitoring. Summary of the Invention

[0005] This application provides a method, device, and storage medium for tracing the source of beer fermentation anomalies based on graph neural networks, which can quickly locate the root cause during beer fermentation and improve the efficiency of handling beer fermentation anomalies.

[0006] This application provides a method for tracing the source of beer fermentation anomalies based on graph neural networks, including: acquiring real-time production data of a target fermentation tank, the real-time production data including numerical process parameters, attribute-type material information, and event-type operation records; constructing a real-time heterogeneous graph based on the target fermentation tank as the core node and according to preset node types and relationship types based on the real-time production data; the real-time heterogeneous graph contains multiple nodes and directed edges between nodes, nodes carry temporal state features, directed edges are configured with biochemical mechanism association constraints, the temporal state features are used to characterize the change trajectory of node attributes over time, and the biochemical mechanism association constraints are used to limit the attention interaction paths between nodes that conform to the fermentation biochemical laws; inputting the real-time heterogeneous graph into a temporal graph neural network, and aggregating the temporal state evolution information of each node in the real-time heterogeneous graph along the time dimension through time encoding and memory update mechanisms, based on each The temporal state evolution information of nodes is used for attention calculation and weighted aggregation through attention interaction paths constrained by biochemical mechanisms to obtain real-time temporal fermentation characteristics. The feature deviation between the real-time temporal fermentation characteristics and the pre-stored standard temporal fermentation characteristics is also calculated. When the feature deviation exceeds the safe deviation range, the attention weights of other nodes to the core node output by the temporal graph neural network during the inference process are extracted. Counterfactual intervention is performed on a specified number of candidate nodes with high attention weights. The causal effect value of each candidate node is determined by comparing the change in feature deviation before and after the intervention. Candidate nodes with causal effect values ​​exceeding a preset threshold are identified as candidate abnormal root cause nodes. Production logic verification is performed on the candidate abnormal root cause nodes. The abnormal information of the production object corresponding to the verified candidate abnormal root cause nodes is identified as the abnormal root cause of beer fermentation.

[0007] This application also provides a computing device, including: a memory and a processor; wherein, the memory stores executable code, and when the executable code is executed by the processor, the processor performs the above-described method.

[0008] This application also provides a computer-readable storage medium storing executable code, which, when executed by a processor of a computing device, causes the processor to perform the above-described method.

[0009] This application also provides a computer program product, including: a computer program / instructions, which, when executed by a processor, enable the processor to implement the steps in the above method.

[0010] The method provided in this application instantiates multi-source heterogeneous data, such as numerical process parameters, attribute-based material information, and event-based operation records, into a heterogeneous graph structure centered on the fermenter. Biochemical mechanism association constraints are configured for directed edges between nodes, establishing semantic connections between multi-source data at the fermentation production logic level. Based on the time encoding and memory update mechanism of a time-series graph neural network, the temporal state evolution information of each node is aggregated along the time dimension. Attention calculation and weighted aggregation are performed using attention interaction paths defined by biochemical mechanism association constraints to obtain a real-time time-series fermentation characterization. This characterization is then compared with standard time-series fermentation characteristics to calculate the feature deviation. This allows for the identification of potential risks even when fermentation parameters have not exceeded limits but the overall evolution trend has deviated from the normal baseline, achieving early warning before anomalies occur. When the feature deviation exceeds the safe deviation range, candidate nodes are screened by extracting attention weights, and counterfactual intervention is further performed on the candidate nodes. The causal effect value is used to identify nodes that have a causal contribution to the anomaly. After verification by the production logic, the root cause of the anomaly is finally determined. This avoids the problem of possible misjudgment by directly determining the cause based solely on the ranking of attention weights. While ensuring the accuracy of root cause location, it avoids the low efficiency and long time consumption of manual investigation, and realizes the rapid and accurate output of the root cause of the anomaly, meeting the actual needs of the beer fermentation process for refined and intelligent anomaly monitoring. Attached Figure Description

[0011] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings: Figure 1 A flowchart illustrating a time-series graph neural network training method for detecting abnormalities in beer fermentation, provided as an exemplary embodiment of this application; Figure 2 A schematic diagram of the structure of a temporal graph neural network is provided for an exemplary embodiment of this application; Figure 3 A flowchart illustrating an exemplary embodiment of this application provides a method for tracing the source of beer fermentation anomalies based on graph neural networks; Figure 4 This is a schematic diagram of the structure of a computing device provided for an exemplary embodiment of this application. Detailed Implementation

[0012] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application will be clearly and completely described below in conjunction with specific embodiments and corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0013] It should be noted that, in the cases involving user information in the embodiments of this application, the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in the embodiments of this application are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, use, and processing of related data must comply with relevant laws, regulations, and standards, and corresponding operation entry points are provided for users to choose to authorize or refuse. In addition, the various models involved in this application (including but not limited to language models or large models) comply with relevant laws and standards.

[0014] This application provides a method for tracing the source of beer fermentation anomalies based on graph neural networks. It unifies the multi-source heterogeneous data generated during beer fermentation into a heterogeneous graph with the fermentation tank as the core, and uses a temporal graph neural network to perform feature learning and pattern recognition on the heterogeneous graph. This enables early warning of fermentation anomalies, automatic location of the root cause of anomalies, and generation and execution of intervention strategies. It solves the technical problems of difficulty in early detection of multi-factor coupling anomalies during beer fermentation and the low efficiency of relying on human experience for root cause location.

[0015] The technical solutions provided by the embodiments of this application are described in detail below with reference to the accompanying drawings, from the three stages of offline training, online early warning, and closed-loop processing.

[0016] Figure 1 A flowchart illustrating a training method for a temporal graph neural network for detecting abnormalities in beer fermentation, provided as an exemplary embodiment of this application, is shown below. Figure 1 As shown, the method includes steps 11 to 15 as described below.

[0017] Step 11: Obtain historical data for historical fermentation batches. The historical data includes numerical process parameters, attribute-based material information, and event-based operation records.

[0018] Step 12: Using the fermenter as the core node, construct a heterogeneous graph based on historical data according to preset node types and relationship types. The historical heterogeneous graph contains multiple nodes and directed edges between nodes. Nodes carry temporal state features, which include the sampled value sequence of node attributes changing over time during the complete production cycle and the corresponding timestamps. Directed edges are configured with biochemical mechanism association constraints, which are used to limit the attention interaction paths between nodes that conform to the fermentation biochemical laws.

[0019] Step 13: Construct a temporal graph neural network, which includes a time encoder and a memory update network; randomly initialize parameters, use historical heterogeneous graphs of historical fermentation batches as training samples, and pre-train the model using self-supervised learning or contrastive learning strategies.

[0020] Step 14: Fix the parameters of the pre-trained time-series graph neural network, input the historical heterogeneous graphs of multiple historical normal fermentation batches into the time-series graph neural network one by one to obtain the time-series fermentation features of the core nodes of each batch, perform statistical analysis on the time-series fermentation features of each normal batch, and form the initial standard time-series fermentation features.

[0021] Step 15: Restore the parameters of the time-series graph neural network to a trainable state, and fine-tune the time-series graph neural network based on the current standard time-series fermentation features; after each round of training, re-extract and update the standard time-series fermentation features based on the current time-series graph neural network parameters until the training termination condition is met.

[0022] First, multi-source heterogeneous data is collected and standardized preprocessed to provide input data with a unified format and complete usability for subsequent heterogeneous graph construction and time-series graph neural network training.

[0023] Historical data includes multi-source data collected in a time-series fashion for each fermentation batch throughout its complete production cycle, along with corresponding fermentation status tags. Specifically, for any given batch, historical fermenter data from completed production cycles is obtained from multiple data sources. This includes real-time process numerical data (i.e., numerical process parameters) collected from the SCADA system, including but not limited to: fermenter temperature, pressure, pH, dissolved oxygen, diacetyl content, yeast concentration, and parameter adjustment records. This data is continuously collected by sensors at a specific sampling frequency and uploaded to the SCADA system. The sampling frequency is set according to actual needs; for example, it can be collected every 5 minutes.

[0024] Production data, i.e. attribute-type material information, is collected from the Manufacturing Execution System (MES), including but not limited to: work order information, production batch number, material feeding records (including yeast batch, wort batch, feeding time, feeding quantity), operators, process formula, process status, and work order operation records.

[0025] Data on raw material batch attributes and test records, i.e. event-based operation records, are collected from the Laboratory Information Management System (LIMS). These include, but are not limited to, yeast batch number, strain type, yeast activity, wort batch number, initial sugar content, α-amino nitrogen content, and quality test results of raw malt and hop batches.

[0026] Equipment status data, i.e., event-based operation records, is collected from the equipment management system. This includes, but is not limited to, equipment calibration time, fault records, equipment runtime, and maintenance records. The above data covers three heterogeneous types of data: numerical process parameters, attribute-based material information, and event-based operation records, each with different data formats, sampling frequencies, and units of measurement.

[0027] For each fermentation batch that has completed its full production cycle, the above-mentioned full data collection process is performed to ensure that each batch has a complete process value sequence, material batch information, equipment operating status and final fermentation result (normal or abnormal), providing a data foundation for subsequent batch-by-batch heterogeneous graph instantiation.

[0028] After the data collection is completed, the above-mentioned multi-source heterogeneous data is subjected to standardized preprocessing, including but not limited to data cleaning, format unification and encoding standardization, multi-source data association and alignment, and invalid data screening and removal.

[0029] First, data cleaning is performed. Missing values ​​and outlier removal are conducted on the time-series data acquired by the SCADA system. For missing values ​​caused by sensor communication interruptions or acquisition failures, linear interpolation is used to fill in the missing values ​​by using adjacent valid values ​​in the time series. If more than three consecutive sampling points are missing, the data for that period is marked as unusable and a missing value log is recorded. For abnormal readings exceeding the sensor's range or physically impossible range (such as temperatures exceeding 40℃ or below -5℃), these are directly removed and filled in using the aforementioned interpolation method. Duplicate entries or conflicting records in the MES, LIMS, and equipment management systems are deduplicated and conflict resolved. For example, if the format of material batch numbers is inconsistent in different systems, the coding rules of the MES system are used for standardization; if the naming methods for tank numbers of the same fermenter differ in different systems, a tank number mapping table is established to complete cross-system identity mapping.

[0030] Then, format unification and encoding standardization are carried out to unify the units of measurement for data from different sources and convert various process parameters to the same unit system; unify the format and time zone standard of all timestamps to ensure that cross-system data can be aligned in the time dimension; uniformly encode attribute-type discrete fields (operator, strain type, equipment model, anomaly type, treatment measures, etc.) and convert them into standardized identifiers; for free text log records, keywords related to fermentation status are extracted through regular expressions and converted into structured tag fields.

[0031] Secondly, multi-source data is aligned and linked according to production batch, fermenter number, and time node. Using the production batch number recorded in the MES system as the primary key, the time-series data from the SCADA system is extracted according to the start and end time windows of that batch. The start time of the extraction is based on the material feeding completion time recorded in the MES, and the end time is based on the tank discharge time or fermentation end time recorded in the MES. All SCADA sampling points within this time window are bound to that production batch. The raw material batch information and test results from the LIMS system are matched according to the corresponding material feeding records (such as yeast batch number and wort batch number) to ensure that each raw material attribute corresponds to a specific input batch. The equipment status records from the equipment management system are aligned with the SCADA time-series data according to the timestamp, and events such as calibration time and fault records are inserted into the corresponding time points. After the above alignment is completed, all data from the same fermentation batch is uniformly associated with a unique (production batch number, fermenter number, timestamp) triple key value, ensuring that data from different systems can accurately correspond to the same production stage.

[0032] Finally, invalid data is filtered and removed. Each batch of data after alignment is checked. If a batch is missing more than 20% of the total sampling points for any key process parameter (temperature, pressure, pH, dissolved oxygen) in the SCADA time-series data, it is marked as incomplete and will not be included in subsequent training. If a batch lacks key material identifiers such as yeast batch number or wort batch number in the LIMS system, it is also marked as an incomplete batch and excluded. If the MES system lacks the final fermentation result record (normal / abnormal) for a batch, it cannot be used as a labeling sample and is also excluded. Through the above filtering, erroneous data that does not conform to the actual production scenario is identified and removed, retaining complete, clearly labeled, and usable compliant batch data for subsequent heterogeneous graph instantiation.

[0033] For both normal and abnormal batches, the aforementioned multi-source heterogeneous data were acquired. The normal batch was used as positive samples to extract standard time-series fermentation features; the abnormal batch was used as negative samples for supervised training, enabling the time-series graph neural network to learn to distinguish between normal and abnormal data. After acquiring multi-source heterogeneous data from multiple batches, for each fermentation batch, a heterogeneous graph structure G=(V,E,R) containing multiple types of heterogeneous entities was constructed with the fermenter as the core node, where V is the set of nodes, E is the set of edges, and R is the set of relation types.

[0034] In this embodiment, the node types include fermenter nodes, yeast batch nodes, wort batch nodes, equipment nodes, and historical abnormal event nodes. Among them, the fermenter node is the core node of the entire heterogeneous graph. Each fermenter corresponds to one entity node, and its original attribute characteristics include static attribute information such as tank capacity, current liquid level, and running time, which are expressed as nominal tank capacity (unit: kiloliter), liquid level percentage (0~100%), and cumulative running days, respectively.

[0035] Each batch of yeast added to the fermenter corresponds to a physical node, denoted as the yeast batch node. Its original attributes include static information such as yeast generation (integer), initial activity (percentage), inoculum amount (unit: kg), and expansion batch number code. Each batch of wort entering the fermenter corresponds to a physical node, denoted as the wort batch node. Its original attributes include static information such as original wort concentration (unit: °P), α-amino nitrogen content (unit: mg / L), sugar composition ratio, and wort pH value. Equipment nodes are the physical nodes corresponding to the temperature sensors, pressure sensors, cooling valves, and other equipment associated with the fermenter. The original attributes of each equipment node include static information such as equipment model code, number of days since calibration date, and current operating status code (normal operation / fault / calibration in progress).

[0036] Historical anomaly event nodes refer to the entity nodes corresponding to various anomaly events that have occurred in the fermenter's history. Their original attribute characteristics include static attribute information such as anomaly type code, time since occurrence (in days), handling measure code, and handling effect score. For cases where multiple anomaly events have occurred in the same fermenter, each anomaly event is instantiated as an independent historical anomaly event node, rather than being merged into a single node. This ensures that the data from each anomaly record can independently participate in the attention weight calculation of the time-series graph neural network, thereby accurately identifying which type of historical anomaly pattern has the highest correlation with the current real-time anomaly during subsequent anomaly tracing.

[0037] Each node continuously generates dynamic data throughout the complete production cycle from feeding to fermentation completion. This includes, but is not limited to: time-series data on temperature, pressure, pH, and dissolved oxygen for the fermenter node; time-series data on yeast batch activity detection and wort batch concentration detection for the yeast batch node; time-series data on the real-time changes in operating parameters of equipment nodes as fermentation progresses; and time-series data on the changes in relevant process parameters and corresponding timestamps before and after the occurrence of historical abnormal events for the historical abnormal event node. Therefore, in addition to the aforementioned static attributes, the original attribute characteristics of each node also carry dynamic time-series state characteristics. These dynamic time-series state characteristics characterize the trajectory of node attributes over time, including the sequence of sampled values ​​of each attribute arranged chronologically within the complete production cycle and their corresponding timestamps. This allows the subsequent time-series graph neural network to aggregate the time-series state evolution information of each node along the time dimension. For example, the temperature time-series data for the fermenter node includes the temperature value and corresponding sampling time at each sampling moment within the fermentation cycle, while the activity detection time-series data for the yeast batch node includes the activity value and corresponding detection time at each detection time point before and after feeding.

[0038] For the aforementioned node types, several relationship types are defined, including usage relationships, injection relationships, connection relationships, relationships that have occurred, and relationships associated with. A directed edge is a concrete instantiation of a relationship, representing a definite business association between two actual nodes. Relationship types define the types of business associations that can be established between nodes; each type includes a relationship name, direction, and business meaning. A directed edge, driven by specific production data, is a directed connection between two concrete nodes after instantiating a particular relationship type.

[0039] In this context, a usage relationship indicates that a yeast batch has been added to the fermenter in the current production batch, and this edge points from the fermenter node to the yeast batch node. The trigger condition for a usage relationship is that the fermenter's feeding record in the MES system is explicitly associated with a yeast batch number. Whenever a fermenter's feeding record in the MES system is explicitly associated with a yeast batch number, a usage edge is created between the fermenter node and the yeast batch node.

[0040] An injection relationship indicates that a fermenter has received a wort batch in the current production batch, and this edge points from the fermenter node to the wort batch node. The injection relationship is triggered when the fermenter's feeding record in the MES system explicitly associates it with a wort batch number. Whenever a fermenter's feeding record in the MES system explicitly associates it with a wort batch number, an injection edge is created between that fermenter node and that wort batch node.

[0041] A connection indicates that a device is installed on the fermenter, and the edge points from the device node to the fermenter node. The connection is triggered when a physical installation association record exists between the device and the fermenter in the device management system. Whenever a physical installation association record exists between a device and a fermenter in the device management system, a connection edge is created between the device node and the fermenter node.

[0042] An "occurrence relationship" indicates that the fermenter has experienced a historical anomaly event, and this edge points from the historical anomaly event node to the fermenter node. The trigger condition for an "occurrence relationship" is that the tank number associated with the anomaly event in the historical anomaly record is the same as the current fermenter. Whenever the tank number associated with an anomaly event in the historical anomaly record is the same as the current fermenter, an "occurrence relationship" edge is created between the historical anomaly event node and the fermenter node.

[0043] The association relationship represents the correspondence between the data sources of real-time process parameters and fermenter nodes, indicating that the dynamic time-series state characteristics carried by the fermenter node originate from the real-time process parameter data belonging to the fermenter collected by the SCADA system.

[0044] After completing the topological connections of various relationships according to the aforementioned triggering conditions, each directed edge determines the two nodes it connects and their relationship type. At this point, it does not yet carry specific production business information and cannot be directly used for subsequent feature aggregation analysis of the time-series graph neural network. Therefore, it is still necessary to extract specific business attribute data corresponding to various relationships from each business system and populate them onto the corresponding directed edges to form edge instances carrying complete production records.

[0045] Population refers to binding the edge attribute data corresponding to each relationship to the created directed edge, forming an edge instance carrying a complete production record. Edge attribute data consists of field values ​​in the business record corresponding to the edge that are directly related to the relationship between the two nodes; that is, data describing when the relationship occurs, the amount involved, who performs the action, and the result. After each edge completes the topological connection between nodes based on the triggering conditions, it needs to extract the edge attribute data directly related to the relationship from the corresponding business system and append it to the edge in key-value pairs. For example, after creating a "Use" edge, business data such as the feeding time, feeding quantity, and operation order number from the MES system's feeding records are populated into the edge; after creating a "Connection" edge, data such as the equipment's installation location and installation date are populated into the edge based on the equipment management system's installation records; after creating an "Occurred" edge, data such as the occurrence time, handling measures, and handling effects of the abnormal event are populated into the edge based on historical anomaly records. After the data is populated, the complete format of each edge instance is (node1 identifier, node2 identifier, relation type, {edge attribute key-value pair}), for example (fermenter F03, yeast batch Y-2025-08, "use", {feeding time: 2025-08-01, 10:00, feeding amount: 500kg, operation order number: WO-2025-0801}), thus ensuring that each edge in the graph structure carries both topological connection information and complete business context, providing rich edge attribute inputs for subsequent feature aggregation of the temporal graph neural network.

[0046] In addition, each directed edge is configured with biochemical mechanism association constraints. These constraints are used to predefine attention interaction paths between nodes that conform to the biochemical laws of fermentation during the heterogeneous graph construction phase. These constraints are determined based on the biochemical reaction mechanism of beer fermentation and the logic of industrial production. During the heterogeneous graph construction phase, these constraints exist in the form of rules, pre-defining which types of node pairs are allowed to engage in attention interactions and the upper limit of the interaction strength for each type of relationship. During the real-time inference phase, these constraints are converted into allowable strength and weight constraints for attention interaction paths, participating in the calculation of the graph attention layer.

[0047] During the heterogeneous graph construction phase, based on the biochemical reaction mechanism of beer fermentation, the biochemical influence relationship between any two node pairs is categorized into direct, indirect, and no relationship. The biochemical influence relationship type is pre-labeled as a graph structure attribute and stored in each directed edge of the heterogeneous graph instance.

[0048] A direct biochemical influence relationship refers to a direct causal relationship in production logic between the entities represented by two nodes. That is, a change in the state of one node directly leads to a change in the state of the other node, without the intervention of other entities. For example, the activity change of the yeast batch node directly determines the sugar metabolism rate and flavor compound production in the fermenter, indicating a direct biochemical influence relationship between the two. Similarly, there is a direct biochemical influence relationship between the wort batch node and the fermenter node.

[0049] Indirect biochemical influence refers to a situation where there is no direct causal relationship in the production logic between the entities represented by two nodes. A change in the state of one node requires transmission through other intermediate entities to affect the state of the other node. For example, there is an indirect biochemical influence relationship between the equipment node and the fermentation tank node. Similarly, there is an indirect biochemical influence relationship between historical anomaly event nodes and the fermentation tank node.

[0050] No relationship means that there is no biochemical influence between the entities represented by the two nodes, that is, the state changes of the two do not affect each other. For example, between the yeast batch node and the wort batch node, the quality attributes of the two are determined independently before feeding, and they both act on the fermenter after feeding, but there is no direct or indirect mutual influence between the two.

[0051] Overall, for any historical batch that has completed the entire production process, a unique heterogeneous graph instance is created, using the production batch number as a unique identifier. The fermenter for that batch is selected as the core node. Corresponding yeast batch nodes and wort batch nodes are created based on the feeding information recorded in the MES system. Equipment nodes are created based on the equipment association information in the equipment management system. Historical anomaly event nodes are created based on the historical anomaly records of that fermenter. Each node is connected to the core node according to the aforementioned edge and relationship definitions. Preprocessed data is then populated into each node according to the corresponding node attribute fields, ensuring that each node carries complete static attribute information and dynamic temporal state characteristics.

[0052] The above instantiation operation is performed for each historical batch, ultimately resulting in a set of heterogeneous graph instances corresponding to the number of historical batches. Each heterogeneous graph uses the fermenter as the core node, and connects heterogeneous nodes such as yeast batches, wort batches, equipment, and historical anomalies into a complete graph structure data through five relationship types. It should be understood that in practical applications, there may be more or fewer node types or relationships related to fermentation state analysis.

[0053] Next, the heterogeneous graph instance set will be used as the input dataset for training the temporal graph neural network, and the training of the temporal graph neural network and extraction of standard temporal fermentation features will be carried out.

[0054] Before training, a temporal graph neural network is pre-constructed to serve as the execution vehicle for learning the features of all subsequent graph-structured data, ensuring the standardization of the analysis process and the reproducibility of the results. For example... Figure 2 As shown, the temporal graph neural network includes a preprocessing module, a temporal encoder, a memory update network, a graph attention layer, and an output processing layer.

[0055] The preprocessing module extracts two types of time-series related information from the input heterogeneous graph. For each node in the heterogeneous graph instance, the preprocessing module performs the following extraction operations: First, it extracts the sampled value sequence and sampling timestamp corresponding to each time-series data item specified by the feature vector template in the time-series state features of that node. Specifically, the preprocessing module presets a corresponding feature vector template for each type of node. The feature vector template specifies the identifiers of the time-series data items to be extracted from the time-series state features of that type of node. The preprocessing module indexes to the corresponding feature vector template according to the type of the current node, reads the identifiers of each time-series data item specified in the feature vector template, and extracts the sampled value sequence corresponding to the time-series data item identifier and the timestamp corresponding to each sampled value from the time-series state feature field of the current node. Time-series data items not specified by the template are not extracted. For example, if the feature vector template of the fermenter node specifies two items: temperature time-series data and pressure time-series data, then the preprocessing module extracts the temperature sampled value sequence and corresponding timestamp, and the pressure sampled value sequence and corresponding timestamp from the time-series state feature field of the fermenter node, but does not extract other time-series data such as dissolved oxygen time-series data.

[0056] On the other hand, the historical event records associated with the node and the corresponding event timestamp sequence are extracted. Historical event records refer to the event information carried by historical anomalous event nodes that were connected to the node through edges during the heterogeneous graph construction phase, including the anomalous event type and the event occurrence time. The preprocessing module reads the event type code and the event occurrence timestamp from the historical anomalous event nodes associated with each node, forming the historical event records associated with the node and the corresponding event timestamp sequence. The event type code is a unique numerical identifier pre-assigned to each type of historical anomalous event, used to convert text-based anomalous types into a numerical representation that can be computed by the time-series graph neural network according to a preset encoding mapping table.

[0057] After the above extraction operations, the preprocessing module outputs the sampled value sequence of each node and the corresponding sampled timestamp, as well as the historical event records associated with each node and the corresponding event timestamp sequence, which serve as inputs for the subsequent time encoder and memory update network.

[0058] The time encoder is used to convert the discrete timestamps of any node into a continuous time embedding vector corresponding to that node. The input of the time encoder is the sampled timestamps and event timestamps of each node output by the preprocessing module. For any node, suppose it has K timestamps (including sampled timestamps and event timestamps), which constitute the timestamp set of that node. The time encoder maps the entire timestamp set as a single time embedding vector. The mapping method is as follows: each timestamp in the timestamp set is mapped to a fixed-dimensional position encoding vector through a learnable temporal position encoding function, and then multiple position encoding vectors are aggregated into a single vector through a learnable sequence aggregation operation, which serves as the time embedding vector of that node.

[0059] Specifically, the time encoder internally maintains a set of learnable frequency and phase parameters. For any timestamp t in the timestamp set, timestamp t is multiplied by each frequency parameter, the corresponding phase parameter is added, and then a sine function value is taken to obtain the encoded value for each dimension. The encoded values ​​of each dimension are concatenated to form the position encoded vector corresponding to that timestamp. In other words, each dimension of the position encoded vector is calculated from the corresponding frequency and phase parameters. Different dimensions correspond to different frequency parameters, allowing different dimensions to encode time at different periods. After performing the above mapping for each timestamp, K position encoded vectors are obtained, all with the same dimension. The learnable frequency and phase parameters characterize the relative phase position of the timestamp in the fermentation cycle, enabling different timestamps to have distinguishable encoded representations in the vector space.

[0060] Furthermore, the temporal encoder aggregates K positional encoding vectors into a single temporal embedding vector through a learnable sequence aggregation operation. This application does not limit the implementation of the sequence aggregation operation; for example, it can average all positional encoding vectors dimension-wise to obtain an average pooled vector; or it can employ a learnable attention pooling mechanism to adaptively learn weight coefficients for each positional encoding vector and then perform a weighted sum; or it can input each positional encoding vector into a learnable sequence encoder (such as a gated recurrent unit) in chronological order and then extract the last hidden state. The sequence aggregation operation is used to compress multiple positional encoding vectors corresponding to the same node into a single vector of fixed length, preserving the overall distribution characteristics of each timestamp while eliminating dimensional differences caused by inconsistent timestamp numbers.

[0061] After completing the above mapping and aggregation for any node, the time encoder outputs the node's time embedding vector. This vector represents the overall distribution characteristics of the multiple timestamps corresponding to that node along the fermentation timeline, such as the total fermentation duration, the relative density of each timestamp, and the distribution pattern. This provides a global temporal reference for the node's time-series data in the subsequent memory update network. The time encoder's frequency parameters, phase parameters, and learnable parameters in the sequence aggregation operation are all optimized through backpropagation during training, enabling it to adaptively learn the influence weights of different timestamp distribution patterns on the evolution of the fermentation state. The time encoder independently performs the above encoding for each node in the heterogeneous graph instance, outputting the time embedding vector corresponding to each node.

[0062] The memory update network is used to aggregate the temporal state evolution information of each node throughout the complete production cycle along the time dimension, merging the sampled value sequences and historical event records of each node scattered at different time points into a unified node memory state vector. The input of the memory update network is the sampled value sequences and historical event records of each node output by the preprocessing module.

[0063] The memory update network employs a sequence modeling structure based on gated recurrent units (GRUs), independently maintaining an internal memory state that is iteratively updated over time steps for each node. For any node, assuming it has T sampled values ​​and historical event records over T time steps, the memory update network iteratively updates the node's internal memory state step by step from t=1 to t=T in chronological order.

[0064] At each time step t, the memory update network receives the synthesized input representation x of the current time step. t and the internal memory state h of the previous time step t-1 Output the internal memory state h at the current time step. t The comprehensive input represents x. t It is formed by concatenating the sampled value vector of the current time step and the encoded vector of the historical events that occurred at the current time step; if no historical events occur at the current time step, the encoded vector of the historical events is a zero vector.

[0065] Specifically, for the comprehensive input representation x at the current time step t and the internal memory state h of the previous time step t-1 The historical information is filtered and the current information is merged sequentially through the reset gate and the update gate. First, the internal memory state h from the previous time step is retrieved through the reset gate. t-1 Historical information related to the current time step is filtered out.

[0066] Reset door r t =σ(Wr×[h t-1, x t ]+br), where σ is the activation function, and Wr and br are learnable weight and bias parameters. The reset gate output value is between 0 and 1, obtained by comparing it with the internal memory state h from the previous time step. t-1 Element-wise multiplication controls the degree to which information in each dimension of the memory state from the previous time step is forgotten or retained. Dimensions with values ​​close to 0 in the reset gate indicate that historical information in that dimension has been forgotten, while those close to 1 indicate that historical information in that dimension has been retained, thus obtaining the filtered historical memory information. In the beer fermentation scenario, the reset gate allows the time-series graph neural network to determine which past trends have ended and no longer affect the current state. For example, a temperature fluctuation trend at a certain stage has passed and no longer needs to be continuously remembered.

[0067] The input representation x is based on the filtered historical memory information and the current time step. t Together, they generate candidate memory states for the current time step: h t =tanh(Wh×[r t ⊙h t-1 x t ]+bh), where ⊙ represents element-wise multiplication, and Wh and bh are learnable weight and bias parameters. This candidate memory state integrates current input information with filtered historical information, representing new information that should be included in memory at the current time step.

[0068] The internal memory state h of the previous time step is updated by the gate control. t-1 With the current candidate memory state h t The fusion ratio of ' is used to output the internal memory state h at the current time step. t =(1-z t )⊙h t-1 +z t ⊙h t '. Update Gate z t =σ(Wz×[h t-1 x t Wz and bz are learnable weight and bias parameters, respectively. The update gate output value is between 0 and 1. The closer the update gate value is to 1, the greater the contribution of the input information at the current time step to the update of the memory state; the closer it is to 0, the greater the proportion of historical memory information retained, i.e., more memory information from the previous time step is retained. In the fermentation scenario, the update gate's role is to allow the network to determine whether the changes in the sampled values ​​at the current time step or historical events have long-term impact value.

[0069] Through the synergistic effect of reset and update gates, the memory update network can adaptively determine at each time step which past information to forget and which current information to remember, thus adjusting the internal memory state h. tIt selectively retains trend information that has a long-term impact on the evolution of fermentation state, while discarding short-term fluctuations unrelated to the current fermentation state. Simultaneously, historical event records are used as a comprehensive input representation x. t A portion of it directly participates in the calculation of the reset gate, update gate, and candidate memory state. Therefore, the influence of historical events on the node state is naturally integrated into the internal memory state update of that time step and continues to be passed on in the memory state of subsequent time steps.

[0070] After iterating through all T time steps using the above process, the memory update network updates the internal memory state h of the last time step. T This is output as the node memory state vector. The node memory state vector represents the complete temporal evolution trajectory of the node from the start of fermentation to the current moment, including both the evolution trend of each attribute value over time and the cumulative impact of historical event records on the node's state.

[0071] The memory update network independently performs the above time step iterative update on each node in the heterogeneous graph, and outputs the node memory state vector corresponding to each node, which is then fused with the time embedding vector output by the time encoder.

[0072] The temporal embedding vector corresponding to each node is fused with the node's memory state vector to obtain the temporal state evolution information of each node. The fusion method is not limited. For example, a concatenation operation can be used: for any node, its temporal embedding vector and the node's memory state vector are concatenated along the feature dimension to obtain the temporal state evolution information of that node; or a gating fusion mechanism can be used, adaptively adjusting the fusion ratio of the two through learnable gating coefficients.

[0073] The graph attention layer consists of multiple graph attention sublayers stacked together. Based on the temporal state evolution information of each node and the biochemical mechanism association constraints, attention calculation and message passing are performed between each node. The temporal state evolution information of each node is propagated layer by layer along the graph topology to the core node (fermenter node), and finally the temporal fermentation representation of the core node is output.

[0074] Before the graph attention layer performs computation, the pre-stored biochemical influence relationship types of each node pair are read from the directed edges of the heterogeneous graph instance. Based on the biochemical influence relationship types, the attention mask value and upper limit of the interaction strength for each node pair are determined and converted into an attention mask matrix and attention weight coefficient constraints for use by the graph attention layer. This step can be performed by the preprocessing module or the graph attention layer. The attention mask value controls whether attention computation is allowed for the node pair, and its value ranges from [0, 1]. For node pairs with direct relationships, the attention mask value is set to 1, indicating that the complete attention interaction path is preserved. For node pairs with indirect relationships, the attention mask value is set to an intermediate value between 0 and 1, indicating that the interaction path is preserved but the basic interaction strength is reduced; the longer the indirect path and the more intermediate links, the lower the value. For node pairs with no relationship, the mask value is set to 0, indicating that the attention interaction path is completely blocked. The interaction strength cap controls the original attention score of the node pair, thereby controlling the maximum attention weight allowed after normalization. Node pairs with direct relationships are assigned a higher interaction strength cap, allowing them to dominate feature aggregation; node pairs with indirect relationships are assigned a lower interaction strength cap, limiting their normalized weights to a lower range even if their attention scores are high; no cap is set for node pairs with no relationship. The attention mask values ​​of each node pair are arranged by node pair index to form an attention mask matrix. The attention weight coefficient constraints of each node pair are arranged by node pair index to form an attention weight cap matrix. The attention mask matrix is ​​used to mask attention interaction paths between node pairs that do not conform to the fermentation biochemical relationship. The attention weight coefficient constraints are used to set corresponding interaction strength caps for node pairs with different relationship types.

[0075] Each graph attention sublayer contains a multi-head attention computation module. For any graph attention sublayer, the temporal state evolution information of each node (in the first layer) or the features output by the previous layer (in non-first layers) are used as the current feature representation of each node.

[0076] The current feature representations of each node are mapped to query vectors, key vectors, and value vectors respectively through a learnable linear transformation. Using the query vector of the core node as the query and the key vectors of other nodes as the keys, the original attention score of the core node relative to each node is calculated along the attention interaction path not masked by the attention mask matrix.

[0077] Specifically, for a node pair consisting of the core fermenter node and any other node, if the mask value corresponding to the node pair in the attention mask matrix is ​​0, the node pair is skipped, and its original attention score is not calculated. If the mask value is greater than 0, the dot product of the core node's query vector and the key vectors of the other nodes is calculated to obtain the original attention score of the core node relative to the other nodes. For node pairs with a mask value greater than 0 but less than 1, their original attention scores are further multiplied by the mask value for scaling. All calculated original attention scores constitute the set of original attention scores of the core node relative to all other nodes.

[0078] The interaction intensity of the original attention scores for each node pair is limited by the upper limit value corresponding to the upper limit value in the attention weight upper limit matrix. Original attention scores exceeding the upper limit value are truncated to that value, while those below remain unchanged. All attention scores after limiting are then normalized to obtain the attention weights of each other node relative to the core node. The sum of the attention weights of all nodes is 1. The attention weights quantify the contribution of other node features to the feature update of the core node.

[0079] Each other node is multiplied by its own value vector and its corresponding attention weight to obtain the weighted features of each other node. The weighted features of each other node are then summed to obtain the aggregated features of the core node in the current attention head. Multiple attention heads are set up in each graph attention sub-layer to perform the above calculations in parallel. The aggregated features of the core node output by each attention head in the same graph attention sub-layer are concatenated along the feature dimension, and after residual connection and layer normalization, they are used as the aggregated features of the core node output by the graph attention sub-layer.

[0080] In addition to the core node, other nodes also use themselves as query nodes, aggregating information from all other nodes according to the same calculation method to obtain their own updated aggregated features.

[0081] The aggregated features of all nodes output by the current graph attention sublayer serve as the input to the next graph attention sublayer. After propagation through multiple graph attention sublayers, the feature representations of each node in the graph gradually incorporate information from multi-hop neighbor nodes, with the feature representations of the core nodes incorporating the temporal state evolution information of all associated nodes. The aggregated features of the core nodes output by the final graph attention sublayer constitute the temporal fermentation representation. This temporal fermentation representation, in the form of a fixed-dimensional vector, summarizes all multi-source heterogeneous data and temporal evolution information of the current fermentation batch, representing the overall state of the entire fermentation batch and providing a complete representation of "the current state of the entire fermentation batch."

[0082] Meanwhile, after completing the attention calculation, each attention sublayer records the normalized attention weights of other nodes to the core node. The attention weights quantify the contribution of the features of other nodes to the feature update of the core node, reflecting the relative importance of different other nodes to the core node, and are used by the subsequent output processing layer.

[0083] In the aforementioned attention calculation process, the determination of biochemical influence relationships determines whether attention interaction paths in the temporal graph neural network are preserved or blocked, which affects the attention weight distribution of the graph neural network. Preserving or blocking attention interaction paths determines which node pairs' feature information can participate in subsequent attention calculations. Path preservation allows feature information between two nodes to propagate during message passing within the graph neural network. Path blocking completely blocks the feature propagation path between two nodes, preventing any feature interaction between them.

[0084] By using an attention mask matrix to block attentional interaction paths between node pairs that do not conform to the fermentation biochemical relationship, the message passing scope of the graph neural network is limited to node pairs that conform to the fermentation biochemical rules, avoiding noise interference from node pairs that do not conform to these rules. By constraining the attention weight coefficients to set corresponding upper limits on the interaction strength of different types of relationships, the attention weight values ​​of the graph neural network are limited to a reasonable range of biochemical influence. This ensures that the actual influence of node pairs corresponding to different types of relationships in feature aggregation matches the strength level of the biochemical influence relationship, preventing node pairs that indirectly influence or reference information categories from receiving excessively high attention weights due to accidental numerical features. Together, these two methods ensure that the attention calculation of the graph neural network conforms to the fermentation biochemical rules at both the feature interaction range limitation and weight value constraint levels. This enables a differentiated processing logic that prioritizes the influence of directly related nodes and uses historical reference nodes as auxiliary references, enhancing the rationality and interpretability of anomaly tracing results within the fermentation production logic.

[0085] The output processing layer is used to compare the temporal fermentation representation of the core node output by the graph attention layer with the pre-stored standard temporal fermentation features, calculate the feature deviation, and output three types of content according to the preset safe deviation range: standardized fermentation state judgment result, feature deviation value, and influence degree ranking.

[0086] The output processing layer pre-stores standard temporal fermentation features, which are vectors of the same dimension as the temporal fermentation features of the core node, representing the common temporal evolution benchmark under the normal fermentation state. For the input temporal fermentation features of the core node, the output processing layer calculates the Euclidean distance between the two as the feature deviation degree. The feature deviation degree represents the overall deviation degree between the global temporal fermentation feature of the currently input heterogeneous graph and the standard temporal fermentation feature, and quantifies the overall deviation degree of the current real-time fermentation state relative to the normal fermentation state. For example, the temporal fermentation feature is 128-dimensional, and the sum of squares of the differences of each dimension between the current temporal fermentation feature and the standard temporal fermentation feature is calculated, and then the square root is taken to obtain the feature deviation degree.

[0087] The output processing layer is internally provided with a first threshold D1 and a second threshold D2, where D1<D2. The output processing layer determines the fermentation state according to the threshold interval in which the feature deviation degree D falls: if D≤D1, the fermentation state is determined to be normal; if D1<D≤D2, it is determined that there is a potential deviation risk, and a first-level early warning is output; if D>D2, it is determined that there is a high probability of fermentation abnormality, and a second-level early warning is output. The first threshold and the second threshold are pre-calibrated according to the statistical distribution of the feature deviation degrees between the historical normal fermentation batches and the standard temporal fermentation features. For example, the 95th percentile of the deviation degrees of normal batches is taken as the first threshold, and the 99.5th percentile is taken as the second threshold, or they can be manually set according to actual production safety requirements.

[0088] In addition, the output processing layer extracts the normalized attention weights of each other node to the core node recorded by the last layer of the graph attention layer, sorts them in descending order of the weight value, intercepts a specified number of top-ranked candidate nodes and their weight proportions, and outputs them as the influence degree ranking of each other node on the core node. A higher attention weight indicates that the production entity corresponding to the node has a greater influence on the current fermentation state deviation. If the attention weight of a certain node is significantly higher than that of other nodes, it indicates that the abnormal state of the production entity corresponding to the node (such as a certain yeast batch or a certain device) may be a key factor leading to the current fermentation deviation.

[0089] The output processing layer formats and outputs the three types of content, namely the fermentation state label, the feature deviation degree and the influence degree ranking, according to a preset standardized template. The output content unifies the measurement unit, time format and expression paradigm, ensuring that the analysis results can be directly called by the downstream production system without secondary parsing.

[0090] Based on the above Figure 2The structure shown illustrates the following processing flow of the temporal graph neural network for the input heterogeneous graph: After inputting the heterogeneous graph instance into the temporal graph neural network, the preprocessing module extracts the sampled value sequence and corresponding sampled timestamps, historical event records and corresponding event timestamp sequences of each node from the heterogeneous graph instance. The sampled value sequence and historical event records are fed into the memory update network, while the sampled timestamps and event timestamps are fed into the time encoder. The time encoder encodes the timestamp set of each node into the time embedding vector of that node; the memory update network iteratively updates the internal memory state of each node step by step along the time dimension, using the internal memory state of the last time step as the node memory state vector of that node. The time embedding vector and the node memory state vector of the same node are fused to obtain the temporal state evolution information of each node. The multi-layer graph attention layer takes the temporal state evolution information of each node as input. In each graph attention sub-layer, it reads the pre-stored attention mask value and interaction strength upper limit value of each node in the directed edge attributes, and performs attention calculation and message passing accordingly, propagating the information of each node along the graph topology to the fermenter core node, and outputting the current temporal fermentation representation of the core node. The output processing layer compares the current time-series fermentation characterization with the pre-stored standard time-series fermentation features, calculates the feature deviation, and determines the fermentation state label. When the feature deviation exceeds the safe deviation range, it extracts the attention weights of other nodes in the last graph attention layer to the core node, sorts them from high to low weight, and outputs a specified number of candidate nodes that rank highly.

[0091] The following section explains the extraction of standard time-series fermentation features and the training process of the time-series graph neural network.

[0092] Phase 1: Pre-training the Temporal Graph Neural Network. Obtain historical heterogeneous graphs from multiple historical fermentation batches. Instances from normal fermentation batches are used as positive samples, and instances from abnormal fermentation batches are used as negative samples (negative samples are pre-labeled with abnormality type and root cause labels). These are then divided into training and validation sets. The parameters of the temporal graph neural network are randomly initialized. In each iteration, a historical heterogeneous graph instance from one batch is selected from the training set and input into the temporal graph neural network. Each instance undergoes a complete forward computation following the aforementioned temporal state evolution information extraction and graph attention aggregation process, outputting the temporal fermentation features of the core nodes corresponding to that batch. The contrastive loss between this feature and the center / standard features of similar samples in the current random projection space is calculated (e.g., using a contrastive learning strategy to bring similar samples closer together and dissimilar samples further apart in the feature space). Based on the loss value, the gradient of each trainable parameter in the temporal graph neural network is calculated using the backpropagation algorithm. Subsequently, the optimizer updates the parameter values ​​along the gradient descent direction according to the preset learning rate. After each round of traversal of the full training set data, the accuracy of the current temporal graph neural network is evaluated on the validation set. Repeat the above iterative process until the accuracy on the validation set reaches a preset threshold or when multiple rounds of training no longer significantly improve the accuracy. This will stop the pre-training process and enable the temporal graph neural network to distinguish between different fermentation states.

[0093] The second stage: Initial standard time-series fermentation feature extraction. The parameters of the time-series graph neural network obtained after the pre-training in the first stage are fixed. The historical heterogeneous graphs of each historical normal fermentation batch are input into the time-series graph neural network one by one. Following the aforementioned time-series state evolution information extraction and graph attention aggregation process, the time-series fermentation features of the core nodes corresponding to each historical normal fermentation batch are obtained. These time-series fermentation features, in the form of fixed-dimensional vectors, represent the comprehensive fermentation state of the historical normal fermentation batch within the complete production cycle. Based on the objective law that the time-series fermentation features of multiple heterogeneous graphs under the same fermentation state should cluster in a specific region in high-dimensional space, the time-series fermentation features of each historical normal fermentation batch are statistically summarized in each dimension. The statistical distribution features corresponding to each dimension of the time-series fermentation features are extracted, and the mean of each dimension is used as the value of the standard time-series fermentation feature in each dimension, thus obtaining the standard time-series fermentation feature. This standard time-series fermentation feature vector is stored in the output processing layer.

[0094] Phase 3: Fine-tuning of the Temporal Graph Neural Network (TMN) Parameters. The TMN parameters are restored to a trainable state. Using the current standard temporal fermentation features as a fixed benchmark, the TMN is fine-tuned during training. The training objective is to minimize the deviation between the temporal fermentation features output by normal batches and the standard temporal fermentation features, and maximize the deviation between the temporal fermentation features output by abnormal batches and the standard temporal fermentation features. After traversing the full training set data for a certain number of rounds, the standard temporal fermentation features are re-extracted based on the currently fine-tuned TMN, ensuring that the benchmark always matches the current state of the TMN. This iteration is repeated until the validation set accuracy reaches a preset threshold and the change in the standard features over multiple consecutive rounds is less than the preset threshold, at which point training stops.

[0095] After training, the standard time-series fermentation features extracted in the last round are used as the judgment benchmark for the actual inference stage. The standard time-series fermentation feature vector is a judgment benchmark for normal fermentation extracted based on historical normal fermentation batches. It is used as a comparison reference to measure whether the current fermentation batch deviates from the normal state in the real-time inference stage, and serves as a fixed comparison benchmark in subsequent real-time inference stages, which does not change due to the input of real-time data.

[0096] For example, the time-series fermentation feature is a 128-dimensional numerical array. For the time-series fermentation features of all normal batches, the average value is calculated at each dimension. For instance, the average value of all normal batches in the first dimension is used to obtain the first dimension value of the standard time-series fermentation feature, the average value in the second dimension is used to obtain the second dimension value of the standard time-series fermentation feature, and so on, finally obtaining a 128-dimensional average vector, which is the standard time-series fermentation feature.

[0097] After the temporal graph neural network is trained, all reusable results generated during the training process are solidified and saved to form a standardized analysis system. The solidified content includes: 1) The parameters of the trained temporal graph neural network, namely the linear transformation matrix of each graph attention layer in the temporal graph neural network, the parameters of the attention calculation network, the frequency and phase parameters of the time encoder, and the final values ​​of all trainable weights such as the gating weight parameters and bias parameters of the memory update network after training convergence; 2) Standard temporal fermentation features and corresponding thresholds, namely the standard temporal fermentation features extracted based on all normal batches, and the safety deviation range threshold and graded early warning boundary threshold determined based on the distribution of normal fermentation batches; 3) Fixed calculation process: the complete serial forward calculation logic from reading node information to outputting results.

[0098] All of the above content is exported in a structured file format and deployed to the online inference environment for real-time anomaly warning and intervention in the running fermenter during the real-time inference phase. In the subsequent real-time analysis phase, after loading this fixed file, all forward propagation calculations are performed based on the fixed parameters. The trainable parameters are locked and do not change due to the input of real-time data, thus ensuring that consistent judgment results are output for the same fermentation state at any time point and with any number of calls.

[0099] Figure 3 A flowchart illustrating an exemplary embodiment of this application is provided for a method for tracing the source of beer fermentation anomalies based on graph neural networks, as shown below. Figure 3 As shown, the method includes steps 31 to 35.

[0100] Step 31: Obtain real-time production data of the target fermenter. Real-time production data includes numerical process parameters, attribute-type material information, and event-type operation records.

[0101] Step 32: Using the target fermenter as the core node, construct a real-time heterogeneous graph based on real-time production data according to preset node types and relationship types. The real-time heterogeneous graph contains multiple nodes and directed edges between nodes. Nodes carry temporal state features, and directed edges are configured with biochemical mechanism association constraints. Temporal state features are used to characterize the trajectory of node attributes changing over time, and biochemical mechanism association constraints are used to limit the attention interaction paths between nodes that conform to the laws of fermentation biochemistry.

[0102] Step 33: Input the real-time heterogeneous graph into the temporal graph neural network. Aggregate the temporal state evolution information of each node in the real-time heterogeneous graph along the time dimension through time encoding and memory update mechanism. Based on the temporal state evolution information of each node, perform attention calculation and weighted aggregation with attention interaction path limited by biochemical mechanism association constraint to obtain the real-time temporal fermentation characterization, and calculate the feature deviation between the real-time temporal fermentation feature and the pre-stored standard temporal fermentation feature.

[0103] Step 34: When the feature deviation exceeds the safe deviation range, extract the attention weights of other nodes to the core node output by the temporal graph neural network during the inference process, perform counterfactual intervention on a specified number of candidate nodes with the highest attention weights, determine the causal effect value of each candidate node by comparing the change in feature deviation before and after the intervention, and identify the candidate nodes whose causal effect value exceeds the preset threshold as candidate abnormal root cause nodes.

[0104] Step 35: Perform production logic verification on the candidate abnormal root cause nodes, and determine the abnormal information of the production object corresponding to the verified candidate abnormal root cause nodes as the abnormal root cause of beer fermentation.

[0105] For the running fermenter, following the same data acquisition rules as the offline training phase, real-time process data from the SCADA system, work orders and feeding data from the MES system, raw material batch attribute data from the LIMS system, and status data from the equipment management system are acquired synchronously. Data cleaning and format standardization are then performed according to the same preprocessing rules. After preprocessing, following the same node definitions, relationship types, and edge creation rules as the offline phase, corresponding yeast batch nodes, wort batch nodes, equipment nodes (based on current equipment association information), and historical anomaly event nodes (based on the tank's historical anomaly records) are created, with the currently running target fermenter as the core node. Each node is connected to the core node according to predefined relationships. The preprocessed real-time data is then filled into each node according to the corresponding attribute fields, forming a real-time heterogeneous graph instance of the target fermenter. The real-time heterogeneous graph contains multiple nodes and directed edges between nodes. Nodes carry temporal state characteristics, and directed edges are configured with biochemical mechanism association constraints.

[0106] The completed real-time heterogeneous graph instance is input into the time-series graph neural network. The time-series graph neural network integrates the multi-source heterogeneous data of the current fermentation batch into a unified time-series fermentation characterization, and compares it with the pre-established standard time-series fermentation characteristics to quantitatively evaluate the overall deviation of the current fermentation state from the normal baseline.

[0107] The core idea of ​​the temporal graph neural network is to aggregate the temporal evolution trajectory of each node from the start of fermentation to the current moment through a learnable temporal encoding and memory update mechanism. Based on this, according to the pre-set attention interaction rules between nodes in the fermentation biochemical mechanism, the temporal evolution information of each related node is selectively propagated along the graph topology and aggregated to the core fermenter node, so that the final representation vector of the core node can comprehensively reflect all multi-source heterogeneous data and temporal evolution information of the current fermentation batch.

[0108] Specifically, the real-time heterogeneous graph is input into the temporal graph neural network to obtain the sampling timestamps and sampled values ​​corresponding to the temporal state features of each node, as well as the historical event records associated with each node and the corresponding event timestamp sequences. The sampling timestamps and event timestamps corresponding to each node are input into the temporal encoder and mapped into a unified temporal embedding vector through a learnable temporal position encoding function. The sampled values ​​and historical event records corresponding to each node are input into the memory update network in chronological order to update the internal memory state, resulting in a node memory state vector that integrates the numerical evolution trend and the influence of historical events. The temporal embedding vectors corresponding to each node are fused with the node memory state vectors to obtain the temporal state evolution information of each node. An attention mask matrix and attention weight coefficient constraints are generated based on biochemical mechanism association constraints. The attention mask matrix is ​​used to block attention interaction paths between node pairs that do not conform to the preset fermentation biochemical relationship, and the attention weight coefficient constraints are used to set corresponding upper limits for interaction intensity for node pairs with different relationship types. Using the temporal state evolution information of the core node as the query vector and the temporal state evolution information of other nodes as the key vector, the original attention scores of other nodes to the core node are calculated according to the attention interaction paths not blocked by the attention mask matrix. After limiting the interaction intensity of the original attention scores with the weight coefficient constraints, the attention weights of other nodes to the core node are obtained after normalization. The temporal state evolution information of other nodes is weighted and summed with the attention weights, and the weighted sum is used as the real-time temporal fermentation representation of the core node. The implementation of the temporal graph neural network can be referred to Figure 2 The content shown will not be repeated here.

[0109] Calculate the feature deviation between real-time time-series fermentation characteristics and pre-stored standard time-series fermentation characteristics. Feature deviation characterizes the overall degree of deviation of the current fermentation state from the normal fermentation baseline. The larger the value of this deviation, the further the current fermentation state deviates from the normal range.

[0110] The feature deviation is compared with the safe deviation range. When the feature deviation exceeds the safe deviation range, the fermentation state is determined to be abnormal. Then, based on the attention distribution information output by the temporal graph neural network during the inference process, the node with a greater impact on the current fermentation state is located from multiple heterogeneous nodes as the candidate abnormal root cause node.

[0111] The safe deviation range is predetermined based on the statistical distribution of deviations between the time-series fermentation characteristics of historical normal fermentation batches and the standard time-series fermentation characteristics. Specifically, the deviations between the time-series fermentation characteristics of multiple historical normal batches and the standard characteristics are calculated, and the maximum value is taken as the upper limit D1 of the safe deviation range, thereby determining the first threshold interval [0, D1]. When the feature deviation falls within the first threshold interval, the current fermentation state is output as normal, indicating that the fermentation state is within the normal fluctuation range. When the deviation exceeds the safe range, multiple threshold intervals are set to distinguish the level of abnormal risk. For example, a second threshold interval (D1, D2) and a third threshold interval (D2, D3) are set. When the feature deviation falls into the second threshold interval, a first-level warning is triggered, indicating that there is a potential deviation risk in the current fermentation state. When the feature deviation falls into the third threshold interval, a second-level warning is triggered, indicating that there is a high probability of an abnormality in the current fermentation state. The lower limit of the second threshold interval is greater than or equal to the upper limit of the first threshold interval, and the lower limit of the third threshold interval is greater than or equal to the upper limit of the second threshold interval. For example, if the maximum difference between multiple historical normal fermentation batches and the standard time-series fermentation characteristics is 15%, the second threshold boundary D2 is determined by scaling up D1 according to a preset ratio, for example, D2 = 2 × D1. Then the first threshold interval is [0, 15%], the second threshold interval is (15%, 30%), and the third threshold interval is (30%, +∞).

[0112] When a Level 1 or Level 2 warning is triggered, the root cause localization process is initiated. The attention weights of each node output during the inference process of the time-series graph neural network are extracted, and candidate nodes for anomalies are determined based on these attention weights. For example, the distribution of attention weights of other nodes to the core node in the output of the last layer of the time-series graph neural network is extracted. These attention weights characterize the contribution of the features of other nodes to the features of the core node. The other nodes are sorted from highest to lowest attention weight, and a specified number (e.g., the top N) of nodes with the highest attention weights are selected as candidate nodes, where N is an integer greater than or equal to 1. The level of attention weight directly reflects the influence of other nodes on the core node of the fermenter; a higher weight indicates a greater impact of the production entity corresponding to that node on the current fermentation state.

[0113] After identifying candidate nodes, counterfactual intervention verification is performed on each candidate node. Counterfactual intervention verification refers to changing the state of a candidate node and observing whether the degree of anomalousness in the fermentation state is significantly reduced as a result, thereby determining whether there is a real causal effect between the candidate node and the current anomaly.

[0114] The purpose of counterfactual intervention verification is to avoid misjudgments caused by directly identifying the root cause based solely on attention weight ranking. A high attention weight indicates a strong statistical correlation between the node and the current abnormal state, but this correlation may be related rather than causal. For example, a node may change synchronously with the abnormal state, but both are driven by a third factor. The node itself is not the cause of the abnormality. Directly identifying this node as the root cause would lead to incorrect intervention directions and waste the intervention window. Through counterfactual intervention verification, purely related but not causal confounding factors can be eliminated, improving the accuracy and reliability of root cause identification.

[0115] For example, for any candidate node, the temporal state features of the candidate node are replaced with the corresponding normal reference values, while the remaining nodes and directed edges remain unchanged, generating a first counterfactual heterogeneous graph. The candidate node and its associated directed edges are then removed from the real-time heterogeneous graph, while the remaining nodes and directed edges remain unchanged, generating a second counterfactual heterogeneous graph. The first and second counterfactual heterogeneous graphs are then re-input into the temporal graph neural network, and two new feature deviations are calculated using the same method. The larger of the two new feature deviations is taken as the post-intervention feature deviation corresponding to the candidate node. The difference between the pre-intervention feature deviation and the post-intervention feature deviation of the candidate node is calculated as the change in feature deviation corresponding to the candidate node.

[0116] The first counterfactual heterogeneous graph simulates a counterfactual scenario where "other conditions remain unchanged after the candidate node returns to normal." The feature deviation in this scenario reflects the remaining deviation of the current fermentation state relative to the normal baseline if the candidate node returns to normal. The second counterfactual heterogeneous graph simulates a counterfactual scenario where the candidate node is removed. The feature deviation in this scenario reflects the remaining deviation of the current fermentation state relative to the normal baseline after completely removing the influence of the candidate node. If the feature deviation in the counterfactual scenario decreases significantly compared to before intervention, it indicates that the change in the candidate node's state is the main cause of the current anomaly. These two counterfactual scenarios simulate the effect of intervention on the candidate node from different perspectives. The larger deviation represents a more conservative estimate. Using the larger deviation as the feature deviation after intervention avoids underestimating or overestimating the causal effect of the node due to estimation bias in a single scenario, making the calculation of subsequent causal effect values ​​more robust.

[0117] The change in feature deviation reflects the extent to which the overall deviation of the fermentation state is reduced after restoring the candidate node from its current anomalous state to a normal state; in other words, it reflects the actual contribution of the candidate node to the current anomalous state. The larger the change in feature deviation, the greater the causal contribution of the candidate node to the anomaly, and the more significant the effect of restoring it to normal on eliminating the anomaly.

[0118] The change in feature deviation is used as the causal effect value and compared with a preset threshold. If the causal effect value exceeds the preset threshold, the candidate node is confirmed as the true root cause node; if the causal effect value does not exceed the preset threshold, the candidate node is excluded, indicating that although the candidate node has a high attention weight, it does not have an actual causal effect on the anomaly.

[0119] By employing counterfactual intervention, candidate root cause nodes are selected from multiple candidate nodes. After identifying the candidate root cause nodes, they need to be verified one by one, considering the relationships between nodes and the fermentation production logic, to verify whether the candidate root cause nodes conform to the actual production logic. For each candidate root cause node, it is determined whether the characteristic behavior of the candidate root cause node and the actual behavior of the current fermentation state conform to the causal relationship in the production logic. If they conform to the causal relationship in the production logic and can explain the currently observed abnormal behavior of the fermentation state in the fermentation production logic, then the verification passes, and the production-level problem corresponding to the candidate root cause node is confirmed as the root cause of the anomaly. For example, if the candidate root cause node is a yeast batch node and its characteristic behavior is insufficient activity, while the real-time monitoring data shows a synchronous slowing trend in the fermentation progress, then the slowing fermentation progress and insufficient yeast activity have a direct causal relationship in the fermentation logic. The two match, the verification passes, and the "insufficient yeast batch activity" corresponding to the yeast batch node is confirmed as the root cause of the anomaly. If there is no logical causal relationship between the characteristic behavior of the candidate root cause node and the actual behavior of the current fermentation state, then the verification fails, and the anomaly corresponding to the candidate root cause node is not the root cause of the fermentation problem.

[0120] After verifying multiple candidate root cause nodes, one or more root causes can be identified. If multiple root causes exist, they can be further distinguished into core root causes and secondary contributing factors to guide a tiered intervention strategy in production, prioritizing the resolution of primary issues while addressing secondary factors simultaneously. For example, the root cause corresponding to the candidate root cause node with the highest attention weight among the verified candidate root cause nodes can be identified as the core root cause of the current anomaly. This root cause represents the factor that significantly contributes to the deviation of the current fermentation state in the time-series neural network determination, and is the dominant cause of the anomaly, thus serving as the primary target for priority handling. The root causes corresponding to the remaining verified candidate root cause nodes with lower attention weights are classified as secondary contributing factors. Although secondary contributing factors are not the main cause of the current anomaly, they have a certain degree of influence on the abnormal state and still have reference value for anomaly handling. Candidate root cause nodes that fail production logic verification are marked as invalid factors and removed, and are not output as root causes to ensure the accuracy of the analysis results.

[0121] After identifying the root cause of the anomaly, a standardized anomaly analysis report is generated based on the aforementioned root cause analysis process. This report includes: the root cause of the anomaly (including core root cause and secondary contributing factors), the degree of influence of each node on the result, and the warning level. Optionally, specific deviation information for each node can also be output. The core root cause and secondary contributing factors indicate the specific production object causing the current fermentation anomaly and its abnormal manifestations. Based on this, the corresponding root cause node can be located and linked to the actual production object. The final report also outputs secondary contributing factors, helping operators to comprehensively understand the various deviation factors of the current batch fermentation state and to consider them comprehensively when formulating intervention strategies. The warning level indicates the severity of the anomaly, including Level 1 or Level 2 warnings.

[0122] The degree of influence of each node on the result is used to characterize the magnitude of the impact of the abnormal root cause corresponding to each node on the current abnormal fermentation state. This degree of influence is determined by the attention weight ranking. Deviation information is used to characterize the degree of deviation of the real-time characteristics of the abnormal root cause node from the normal baseline.

[0123] When the status label output by the time sequence diagram neural network is a Level 1 or Level 2 warning, the system automatically triggers the corresponding level of warning. Simultaneously, a standardized anomaly analysis report is pushed to the production control platform for use by operators and the MES system.

[0124] The above method also includes: matching a pre-set standardized handling plan library according to the root cause of the anomaly and the warning level. The handling plan library pre-stores the correspondence between the root cause of the anomaly and the intervention strategy; converting the matched intervention strategy into a work order format that the manufacturing execution system can recognize, sending it to the manufacturing execution system through the interface, and sending the execution result back to complete the handling loop.

[0125] Optionally, a standardized handling plan library for fermentation anomalies can be pre-built in the offline phase. This library is derived from the factory's current standard operating procedures and historical successful handling cases. Corresponding handling actions are set according to the type of root cause of the anomaly and the warning level, forming a fixed anomaly root cause-intervention strategy matching rule. This ensures that an executable handling plan can be quickly generated after an anomaly occurs. For example, firstly, the corresponding implementable handling actions are defined for each type of root cause of the anomaly. For instance, for the root cause of "insufficient yeast activity," the handling action is "adding highly active yeast." Then, based on the handling actions, the handling intensity is divided according to the warning level. For example, a level one warning corresponds to routine interventions such as parameter fine-tuning or enhanced monitoring, while a level two warning corresponds to emergency interventions such as activating backup plans or immediately shutting down the machine for investigation. Through the hierarchical matching mechanism, it is ensured that the intervention strategy output by the system can accurately solve the root cause problem and match the severity of the anomaly, avoiding under- or over-handling.

[0126] During online reasoning, once the root cause type is determined, the system matches the corresponding standardized intervention strategy from the treatment plan library based on the root cause type and warning level. After feasibility verification in the current fermentation scenario, an executable intervention plan is output. Feasibility verification includes verifying whether the matched intervention strategy is executable under the current fermentation progress and process parameters, and verifying whether the intervention operation conflicts with currently effective work orders. After successful verification, the final intervention plan is output. Finally, the intervention plan is converted into a standardized work order that the MES system can recognize, synchronized to the MES system via an interface, and distributed to the corresponding execution positions. After receiving the execution results and backfilling, the entire process loop is completed.

[0127] Optionally, the standardized handling plan library is a dynamically updated database, which is regularly supplemented with new abnormal root cause-intervention strategy matching records based on the accumulation of historical successful handling cases; after the MES system completes the execution, the execution results are backfilled into the system, and the system stores the abnormal event, root cause location results, intervention strategies and execution effects in association for subsequent optimization and iteration of handling plans.

[0128] In summary, this application constructs a directed heterogeneous graph with the fermenter as the core node, including heterogeneous nodes such as yeast batches, wort batches, equipment, and historical abnormal events, as well as multiple business relationships. This unifies the multi-source heterogeneous data of the fermentation process into graph-structured data. Based on a temporal graph neural network, feature learning is performed on the directed heterogeneous graph to calculate the feature deviation between real-time temporal fermentation features and standard temporal fermentation features to achieve hierarchical early warning. The root cause node of the abnormality is located through attention weight distribution and counterfactual intervention, and is confirmed as the root cause of beer fermentation abnormality through production logic verification. Finally, the root cause is matched to a preset standardized handling solution library and an MES work order is generated, forming a full-process handling solution of offline standard setting, online real-time early warning, automatic root cause location, and closed-loop intervention.

[0129] The method provided in this application constructs a heterogeneous graph with the fermentation tank as the core, and uniformly represents multi-source heterogeneous data such as yeast batches, wort batches, equipment and historical abnormal events as a graph structure and inputs it into a graph attention network for fusion modeling. This achieves effective fusion of multiple types of data such as structured numerical values, unstructured attributes and equipment status, adapts to the actual scenario of multi-factor coupling in beer fermentation, reduces false alarms and missed alarms caused by independent judgment of single indicators, and improves the accuracy of anomaly monitoring.

[0130] By learning the temporal evolution patterns of multi-source heterogeneous data based on temporal graph neural networks, potential risks can be identified in advance when the fermentation parameters have not yet exceeded the limits but the trend of change is abnormal. This enables early warning before anomalies occur, avoiding the problems of passive over-limit alarms and lack of early warning capabilities.

[0131] After initially locating candidate nodes based on attention weights, counterfactual intervention is used to verify and eliminate purely related but non-causal interference items. Then, the fermentation production logic is combined for verification to finally determine the root cause of the anomaly. This improves the accuracy and reliability of root cause location and avoids misdiagnosis caused by relying solely on correlation judgments.

[0132] Temporal graph neural networks (TMNs) can model graph-structured data in beer fermentation scenarios with different fermentation tanks, batches, and process parameters. Their ability to fuse multi-source heterogeneous data and identify anomaly patterns surpasses traditional threshold alarms and manual experience-based judgment methods. They can be widely deployed in beer fermentation production control systems within an industrial internet environment. Based on anomaly root cause localization results, standardized intervention strategies are automatically matched and converted into production work orders recognizable by the MES system. These intervention strategies are then distributed to execution positions, and the execution results are fed back, achieving a closed-loop control process of "early warning-location-handling-feedback," reducing product scrap rates and production losses, and improving anomaly handling efficiency.

[0133] It should be noted that the execution subject of each step in the method provided in the above embodiments can be the same device, or the method can be executed by different devices. For example, the execution subject of steps 31 to 35 can be device E; or the execution subject of steps 31 and 34 can be device E, and the execution subject of step 35 can be device F, etc.

[0134] In some of the processes described in the above embodiments and accompanying drawings, multiple operations are included that appear in a specific order. However, it should be clearly understood that these operations may not be executed in the order they appear herein, or they may be executed in parallel. The sequence numbers of the operations are merely used to distinguish different operations and do not represent any execution order. Furthermore, these processes may include more or fewer operations, and these operations may be executed sequentially or in parallel. It should be noted that the descriptions such as "first," "second," etc., in this document are used to distinguish different messages, devices, modules, etc., and do not represent a sequential order, nor do they limit "first" and "second" to different types.

[0135] Furthermore, this application also provides a beer fermentation anomaly tracing device based on graph neural networks. The device includes: an acquisition module, a construction module, a calculation module, a filtering module, and an output module.

[0136] The acquisition module is used to acquire real-time production data of the target fermenter. The real-time production data includes numerical process parameters, attribute-type material information, and event-type operation records.

[0137] The construction module is used to build a real-time heterogeneous graph based on the target fermenter as the core node and according to the preset node type and relationship type based on real-time production data. The real-time heterogeneous graph contains multiple nodes and directed edges between nodes. Nodes carry temporal state features, and directed edges are configured with biochemical mechanism association constraints. Temporal state features are used to characterize the change trajectory of node attributes over time, and biochemical mechanism association constraints are used to limit the attention interaction paths between nodes that conform to the fermentation biochemical laws.

[0138] The computation module is used to input the real-time heterogeneous graph into the temporal graph neural network. Through time encoding and memory update mechanisms, it aggregates the temporal state evolution information of each node in the real-time heterogeneous graph along the time dimension. Based on the temporal state evolution information of each node, it performs attention calculation and weighted aggregation with attention interaction paths limited by biochemical mechanism association constraints to obtain the real-time temporal fermentation characterization and calculates the feature deviation between the real-time temporal fermentation features and the pre-stored standard temporal fermentation features.

[0139] The filtering module is used to extract the attention weights of other nodes to the core node in the output of the temporal graph neural network during the inference process when the feature deviation exceeds the safe deviation range. Counterfactual intervention is performed on a specified number of candidate nodes with the highest attention weights. The causal effect value of each candidate node is determined by comparing the change in feature deviation before and after the intervention. Candidate nodes with causal effect values ​​exceeding a preset threshold are identified as candidate abnormal root cause nodes.

[0140] The output module is used to perform production logic verification on candidate abnormal root cause nodes, and to determine the abnormal information of the production object corresponding to the verified candidate abnormal root cause nodes as the abnormal root cause of beer fermentation.

[0141] The detailed implementation methods and beneficial effects of each step in this embodiment have been described in detail in the foregoing embodiments, and will not be elaborated here.

[0142] Figure 4 This is a schematic diagram of the structure of a computing device provided in an embodiment of this application. Figure 4 As shown, the computing device includes a memory 41 and a processor 42.

[0143] Memory 41 is used to store computer programs and can be configured to store various other data to support operation on the computing platform. Examples of this data include instructions for any application or method operating on the computing platform, data structures, contact data, phone book data, messages, pictures, videos, etc.

[0144] The processor 42, coupled to the memory 41, is used to execute the computer program in the memory 41 to execute the aforementioned beer fermentation anomaly tracing method or model training method based on graph neural networks.

[0145] Furthermore, such as Figure 4 As shown, the computing device also includes: a communication component 43 and a power supply component 44.

[0146] The aforementioned memory 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 Read-Only Memory (PROM), Read-Only Memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.

[0147] Accordingly, embodiments of this application also provide a computer-readable storage medium storing a computer program, which, when executed by a processor, enables the processor to implement the steps in the above-described method embodiments. The computer-readable storage medium includes volatile or non-volatile components, or a combination thereof, and can be removable or non-removable. Examples of computer-readable storage media include, but are not limited to, phase-change random access memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random-access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), flash memory or other memory technologies, CD-ROM, digital video disc (DVD) or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transmission medium.

[0148] Accordingly, this application also provides a computer program product, which includes a computer program or instructions that, when executed by a processor, cause the processor to implement the steps in the above method embodiments. It should be understood that each step or combination of steps in the above method flow can be implemented by the computer program or instructions. Furthermore, these computer programs or instructions can be applied to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device, enabling the processor of the general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing device to function as an apparatus for implementing the corresponding functions in the above method embodiments.

[0149] As can be seen from the above description of the embodiments, those skilled in the art can clearly understand that this application can be implemented by means of software plus necessary hardware. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product, or it can be embodied in the process of data migration. The computer software product can be stored in a storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, mobile terminal, server, or network device, etc.) to execute the methods described in various embodiments or some parts of the embodiments of this application.

[0150] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.

[0151] The above are merely embodiments of this application and are not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.

Claims

1. A method for tracing the source of beer fermentation anomalies based on graph neural networks, characterized in that, include: Acquire real-time production data of the target fermenter, including numerical process parameters, attribute-type material information, and event-type operation records; Using the target fermenter as the core node, a real-time heterogeneous graph is constructed based on the real-time production data according to preset node types and relationship types. The real-time heterogeneous graph contains multiple nodes and directed edges between nodes. The nodes carry temporal state features, and the directed edges are configured with biochemical mechanism association constraints. The temporal state features are used to characterize the trajectory of node attributes changing over time, and the biochemical mechanism association constraints are used to limit the attention interaction paths between nodes that conform to the laws of fermentation biochemistry. The real-time heterogeneous graph is input into a time-series graph neural network. The temporal state evolution information of each node in the real-time heterogeneous graph is aggregated along the time dimension through time encoding and memory update mechanisms. Based on the temporal state evolution information of each node, attention calculation and weighted aggregation are performed using the attention interaction path defined by the biochemical mechanism association constraint to obtain the real-time time-series fermentation characterization. The feature deviation between the real-time time-series fermentation feature and the pre-stored standard time-series fermentation feature is calculated. When the feature deviation exceeds the safe deviation range, the attention weights of other nodes output by the temporal graph neural network during the inference process to the core node are extracted, and counterfactual intervention is performed on a specified number of candidate nodes with the highest attention weights. The causal effect value of each candidate node is determined by comparing the change in feature deviation before and after the intervention, and the candidate nodes whose causal effect value exceeds a preset threshold are identified as candidate abnormal root cause nodes. The candidate abnormal root cause nodes are verified by production logic, and the abnormal information of the production object corresponding to the verified candidate abnormal root cause nodes is determined as the abnormal root cause of beer fermentation.

2. The method according to claim 1, characterized in that, The temporal graph neural network includes a time encoder and a memory update network. The step of inputting the real-time heterogeneous graph into the temporal graph neural network and aggregating the temporal state evolution information of each node in the real-time heterogeneous graph along the time dimension through time encoding and memory update mechanisms includes: The real-time heterogeneous graph is input into the time-series graph neural network to obtain the sampling timestamps and sampling values ​​corresponding to the time-series state features of each node, as well as the historical event records associated with each node and the corresponding event timestamp sequences. The sampling timestamp and event timestamp corresponding to each node are input into the time encoder and mapped into a unified time embedding vector through a learnable temporal position encoding function; The sampled values ​​and historical event records corresponding to each node are input into the memory update network in chronological order to update the internal memory state, thereby obtaining a node memory state vector that integrates the numerical evolution trend and the influence of historical events. The temporal embedding vector corresponding to each node is fused with the node memory state vector to obtain the temporal state evolution information of each node.

3. The method according to claim 1, characterized in that, The time-series state evolution information based on each node is used to perform attention calculation and weighted aggregation through attention interaction paths defined by the biochemical mechanism association constraints, resulting in a real-time time-series fermentation characterization, including: An attention mask matrix and attention weight coefficient constraints are generated based on the biochemical mechanism association constraints. The attention mask matrix is ​​used to block the attention interaction paths between node pairs that do not conform to the preset fermentation biochemical relationship. The attention weight coefficient constraints are used to set corresponding upper limits for the interaction intensity of node pairs with different relationship types. Using the temporal state evolution information of the core node as the query vector and the temporal state evolution information of other nodes as the key vector, the original attention scores of the other nodes to the core node are calculated according to the attention interaction paths not masked by the attention mask matrix. After limiting the interaction intensity of the original attention score with the weight coefficients, the attention weights of the other nodes to the core node are obtained by normalization. The temporal state evolution information of the other nodes is weighted and summed using the attention weights, and the weighted summation result is used as the real-time temporal fermentation representation of the core node.

4. The method according to claim 1, characterized in that, The counterfactual intervention performed on a specified number of candidate nodes ranked high in attention weight includes: For any candidate node, the temporal state features of the candidate node are replaced with the corresponding normal reference values, while the remaining nodes and directed edges remain unchanged, generating a first counterfactual heterogeneous graph. Remove the candidate nodes and their associated directed edges from the real-time heterogeneous graph, while keeping the remaining nodes and directed edges unchanged, to generate a second counterfactual heterogeneous graph; The first counterfactual heterogeneous graph and the second counterfactual heterogeneous graph are re-input into the time-series graph neural network, and two new feature deviations are calculated in the same way. The larger of the two new feature deviations is taken as the feature deviation after intervention corresponding to the candidate node, and the difference between the feature deviation before intervention and the feature deviation after intervention corresponding to the candidate node is calculated as the change in feature deviation corresponding to the candidate node.

5. The method according to any one of claims 1-4, characterized in that, The preset node types include at least one of the following: fermenter node, yeast batch node, wort batch node, equipment node, and historical abnormal event node; the relationship types include at least one of the following: used, injected, connected to, and occurred. The process of constructing a real-time heterogeneous graph based on the target fermenter as the core node and according to preset node and relationship types based on the real-time production data includes: The target fermenter was selected as the core node; Based on the feeding records, a yeast batch node is established for each batch of yeast fed in, and then connected to the target fermenter node using an edge. Based on the feeding records, a wort batch node is established for the batch of wort fed, and connected to the target fermentation tank node through the injection edge; Based on the device association information of the equipment management system, device nodes are established for the sensors and actuators associated with the target fermenter, and connected to the target fermenter node by connecting to the edge; Based on the historical abnormal event records, historical abnormal event nodes are established for the abnormal events that have occurred in the target fermenter, and connected to the target fermenter node through the occurrence edges.

6. The method according to any one of claims 1-4, characterized in that, The upper limit of the safety deviation range is a first threshold value, and the method further includes: When the deviation of the feature does not exceed the first threshold, the fermentation status is output as normal; When the deviation of the feature exceeds the first threshold but does not exceed the second threshold, a first-level warning is output, indicating that there is a potential risk of deviation in the fermentation state. When the deviation of the feature exceeds the second threshold, a level 2 warning is output, indicating that there is a high probability of an abnormality in the fermentation state. Wherein, the second threshold is greater than the first threshold.

7. The method according to any one of claims 1-4, characterized in that, The method further includes: Based on the root cause of the anomaly, a pre-defined standardized treatment plan library is matched, wherein the treatment plan library stores the correspondence between the types of root causes of anomalies and intervention strategies. The matched intervention strategy is converted into a work order format that the Manufacturing Execution System (MES) can recognize, sent to the MES via an interface, and the execution result is returned to complete the closed-loop process.

8. The method according to any one of claims 1-4, characterized in that, The method further includes: After determining the root cause of the beer fermentation abnormality, an abnormality analysis report is output. The abnormality analysis report includes at least one of the following: at least one abnormal root cause, the degree of influence of each abnormal root cause on the abnormal fermentation state, and the warning level of the abnormal fermentation state.

9. A computing device, characterized in that, include: A memory and a processor; wherein the memory stores executable code, which, when executed by the processor, causes the processor to perform the method as described in any one of claims 1 to 8.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores executable code that, when executed by a processor of a computing device, causes the processor to perform the method as described in any one of claims 1 to 8.

Citation Information

Patent Citations

  • Outdoor unit of air-conditioning device and outdoor unit system provided with same

    WO2020250801A1

  • Method for producing trisaccharides

    WO2025080110A1