A Method and System for Identifying Abnormal States of Water Conservancy Facilities Based on Physical Constraint Embedding
By constructing a sensor topology map and calculating the deviation of physical conservation, and combining a multi-head graph attention network and a bidirectional LSTM model, the problem of distinguishing between sensor faults and structural anomalies was solved, achieving highly reliable anomaly identification and localization, and improving the safety monitoring effect of water conservancy facilities.
Patent Information
- Application Number
- CN202611022286.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-10
- Publication Date
- 2026-11-10
AI Technical Summary
Existing technologies struggle to distinguish between sensor malfunctions and actual structural anomalies, are unable to effectively identify anomaly types and locations, and employ a single method for embedding physical constraints, resulting in poor interpretability and a high false alarm rate in monitoring systems.
By constructing a sensor topology graph and calculating the physical conservation deviation, a multi-head graph attention network and a bidirectional LSTM model are used to aggregate the features of neighboring nodes. The deviation spatial pattern is combined to adaptively distinguish between sensor faults and structural anomalies, and the anomaly type and location are located through physical constraint inversion.
It enables explicit differentiation between sensor faults and structural anomalies, reduces false alarm rates, improves the reliability and accuracy of the monitoring system, has the ability to accurately locate anomaly types and locations, and enhances the safe operation and maintenance level of water conservancy facilities.
Smart Images

Figure CN123069104A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to a method and system for identifying abnormal states of water conservancy facilities based on physical constraint embedding. It belongs to the fields of water conservancy engineering safety monitoring and deep learning anomaly detection technology. It is applicable to real-time safety monitoring of water conservancy facilities such as dams, dikes, and water pipelines. It can effectively distinguish between sensor failures and actual structural anomalies, locate the anomaly type and location, and improve the accuracy and reliability of water conservancy facility safety assessment. Background Technology
[0002] Water conservancy facilities (such as dams, dikes, and long-distance water pipelines) may experience structural anomalies such as leakage, cracks, and deformation during long-term operation due to environmental loads, material aging, and geological changes. In severe cases, these anomalies can threaten the lives and property of people downstream. Therefore, real-time safety monitoring based on multiple sensors (piezometers, strain gauges, crack gauges, thermometers, water level gauges, flow meters, etc.) is crucial for early warning and operation and maintenance decisions for water conservancy facilities.
[0003] Currently, data-driven methods based on deep learning have been gradually applied to the field of anomaly detection in hydraulic facilities. For example, existing technologies use graph attention networks to detect anomalies in dam monitoring time-series data, but these methods are purely data-driven and do not utilize any prior physical knowledge. To incorporate physical laws, some existing technologies embed mechanical equations describing the behavior of hydraulic structures into the loss function of the prediction model as "soft constraints" to guide model training. However, these methods have the following significant limitations:
[0004] 1. Difficulty in distinguishing sensor malfunctions from actual structural anomalies: Sensor malfunctions (such as drift, sudden changes, or wire breaks) can also generate abnormal data. Traditional methods can only detect "data anomalies" but cannot determine the root cause of the anomaly. Some existing technologies use physical rules to filter out sensor malfunction data or use "fill-in-the-blank" methods to reconstruct virtual data to replace malfunction data. This approach directly discards or replaces malfunction data, resulting in information loss and an inability to distinguish between malfunctions and structural anomalies. This can easily lead to false alarms (sensor malfunctions are misjudged as structural anomalies) or missed alarms (structural anomalies are masked by sensor malfunctions), seriously affecting the reliability of the monitoring system.
[0005] 2. Limited Emulation of Physical Constraints: Existing methods for integrating physical constraints into deep learning often embed physical equations as penalty terms into the loss function, serving as "soft constraints." In this approach, physical constraints only indirectly affect model parameters; the model itself does not explicitly perceive the degree of physical deviation, leading to poor interpretability and difficulty in using spatial patterns of physical deviations for anomaly root cause analysis.
[0006] 3. Insufficient utilization of multi-sensor spatial correlation: Sensor data from different measuring points in water conservancy facilities exhibit clear spatial correlations. Although some existing methods employ graph attention networks, their goal is multimodal data fusion, which is not combined with physical constraints, and no spatial pattern matching mechanism is designed to address the propagation patterns of anomalies.
[0007] 4. Weak ability to identify anomaly types and locations: Existing methods mostly remain at the binary classification level of "whether it is abnormal", and cannot further identify the anomaly type (leakage, cracks, blockage, etc.) and the location of occurrence, which is not conducive to the rapid response of on-site maintenance personnel.
[0008] To address the aforementioned issues, there is an urgent need for a method and system for identifying abnormal states of water conservancy facilities that can use deviations from physical conservation laws as explicit input features, adaptively distinguish sensor faults from actual structural anomalies using the spatial propagation mode of the deviations, and locate the type and location of the anomalies. Summary of the Invention
[0009] The purpose of this invention is to address the shortcomings of existing technologies by providing a method and system for identifying abnormal states of water conservancy facilities based on physical constraint embedding.
[0010] The technical solution adopted in this invention is as follows: The method for identifying abnormal states of water conservancy facilities based on physical constraint embedding includes the following steps: S1. Acquire time-series monitoring data from multiple sensors on the water conservancy facility, preprocess the data, and construct a sensor topology map based on the spatial or hydraulic connectivity relationships between the sensors; S2. For the hydraulic physical process at the location of each sensor, establish at least one physical conservation constraint equation, and calculate the deviation of the physical conservation constraint equation at each sensor node at each time step based on the time-series monitoring data to obtain the conservation law deviation characteristics. S3. The raw monitoring data of each sensor is concatenated with the conservation law deviation features to form the initial feature vector of each node. The initial feature vector is input into the graph attention network, and the features of neighboring nodes are aggregated through the multi-head attention mechanism to output the enhanced features of each node. Then, the enhanced features of each node at multiple consecutive time steps are input into the bidirectional long short-term memory network (Bi-LSTM) to capture past and future information respectively. The last hidden state of the forward and backward directions is concatenated to obtain the spatiotemporally dependent abnormal feature vector. S4. Pass the abnormal feature vector of each node through a fully connected layer and a sigmoid activation function to output the abnormal probability of each node; S5. Differentiate sensor faults from structural anomalies based on anomaly probability and deviation characteristics of conservation laws; S6. Root cause localization; S7. Train and optimize the model.
[0011] In the above method, the sensor topology graph described in step S1 has nodes corresponding to sensors and edges corresponding to the relationships between sensors.
[0012] The physical conservation constraint equations described in step S2, based on the type of hydraulic facility and sensor, select one or more of the following physical constraints: (1) Darcy's Law: seepage velocity Where k is the permeability coefficient and i is the hydraulic gradient, for two piezometers upstream and downstream, the hydraulic gradient is... Theoretical seepage flow A is the area, and the measured seepage flow rate is... If the deviation from the theoretical value exceeds a threshold, a deviation amount is generated. ; (2) Bernoulli's law of conservation of energy: For two cross-sections in a water pipeline, the total head It should be conserved. For pressure, For fluid density, It is the acceleration due to gravity. For flow rate, deviation ; (3) Conservation of mass: For reservoirs or pipeline sections, inflow = outflow + rate of change of storage capacity, deviation amount , The total flow rate into the control body. The total flow rate out of the control body. To control the rate of change in the body's water storage; (4) Stress-strain constitutive relationship: Within the elastic range, stress and strain are directly proportional, and the deviation is... ,in, The strain value, Calculated from the load, It is the elastic modulus.
[0013] For each sensor node i, at each time step t, the corresponding physical constraint deviation is calculated based on its type and associated sensor data. For nodes with multiple physical constraints, the deviation vector can be calculated. , Normalize each deviation: , in , These represent the mean and standard deviation of the deviation under normal operating conditions.
[0014] In step S3, the initial feature construction occurs at time step t, where the initial feature vector of node i is: , in These are the normalized sensor monitoring values. This is the deviation after normalization. K represents the deviation dimension.
[0015] In step S3, a multi-head graph attention network (GAT) is used to aggregate spatial information. For the l-th layer, the feature update formula for node i is: , Where: M is the number of attention heads, Let i be a neighboring node of node i; Let be the learnable weight matrix for the m-th head; Attention Score: , in For attention parameter vectors, for transpose, The feature of the center node i after the head weight transformation is the m-th head. Let be the feature of neighbor node j after the head weight transformation of the m-th node, and k be any neighbor of node i.
[0016] To incorporate edge weights into the topological graph, a weighting factor is introduced into the attention coefficient calculation: After passing through L layers of GAT, the enhanced features of each node are obtained. .
[0017] In step S3, the enhanced feature sequence of each node i over T consecutive time steps is... The input is a bidirectional LSTM, which contains a forward LSTM and a backward LSTM to capture information from the past and future, respectively. , , By concatenating the last hidden states of the forward and backward directions, we obtain the spatiotemporal anomaly feature vector of node i: .
[0018] In step S5, when the anomaly probability of any node exceeds a preset threshold, the conservation law deviation features of the node and its neighboring nodes are extracted, and the spatial dispersion index of the deviation is calculated. If the deviation of the node shows an isolated spike feature and the deviations of the neighboring nodes are all very small, it is determined to be a sensor failure. If the deviations of the node and multiple spatially related neighboring nodes increase synchronously and the deviation pattern satisfies the preset physical propagation law template, it is determined to be a real structural anomaly.
[0019] The formula for calculating the spatial dispersion index of node i is: , in, Let be the normalized conservation law deviation vector for node i. Represents a vector Find the L2 norm. Let j be the set of neighboring nodes of node i, and j be the traversal variable, representing any neighboring node of node i. This is the smoothing coefficient.
[0020] when Greater than the high threshold When the deviation of node i is much greater than that of its neighbors, it exhibits the characteristic of an isolated spike.
[0021] In step S6, after determining that the anomaly is a real structural anomaly, the hydraulic element where the anomaly occurred is located using the physical constraint inversion method, and the specific location and type are output: First, a simplified forward physical model is established for the water conservancy facility, and the parameters to be inverted are defined. This makes the physical quantities of each node calculated by the forward model... Compared with measured values Minimize the deviation while simultaneously minimizing the deviation of physical constraints. Minimize, construct the objective function as: ; Optimize the solution.
[0022] Another objective of this invention is to provide a system for identifying abnormal states of water conservancy facilities based on physical constraint embedding, comprising a data acquisition and preprocessing module, a sensor topology map construction module, a physical constraint selection and deviation calculation module, a feature stitching module, a graph attention network enhancement module, a bidirectional long short-term memory network prediction and fusion module, an anomaly probability prediction module, an anomaly differentiation module, an anomaly root cause localization module, and a model training and optimization module. The data acquisition and preprocessing module is used to acquire and preprocess time-series monitoring data from multiple sensors on water conservancy facilities. The sensor topology construction module is used to construct a sensor topology map based on the spatial or hydraulic connectivity relationships between sensors. The physical constraint selection and deviation calculation module is used to establish at least one physical conservation constraint equation for the hydraulic physical process at each sensor location, and calculate the deviation of the physical conservation constraint equation at each sensor node at each time step based on time-series monitoring data, so as to obtain the conservation law deviation characteristics. The feature stitching module is used to stitch together the raw monitoring data of each sensor with the conservation law deviation features to form the initial feature vector of each node; The graph attention network enhancement module takes the initial feature vector as input, aggregates the features of neighboring nodes through a multi-head attention mechanism, and outputs the enhanced features of each node. The bidirectional long short-term memory network prediction fusion module takes the enhanced features of each node at multiple consecutive time steps as input, captures past and future information respectively, and concatenates the last hidden state of the forward and backward directions to obtain the fused spatiotemporal dependent abnormal feature vector. The anomaly probability prediction module is used to process the anomaly feature vector of each node through a fully connected layer and a sigmoid activation function, and output the anomaly probability of each node. An anomaly differentiation module is used to distinguish between sensor faults and structural anomalies based on anomaly probability and conservation law deviation characteristics. Anomaly root cause localization module, used for anomaly root cause localization; The model training optimization module is used for optimizing model training.
[0023] The beneficial effects of this invention are: 1. This invention, for the first time, uses the deviation of conservation laws as an explicit feature and utilizes the spatial propagation pattern of the deviation to distinguish the root causes of anomalies. This solves the problem of existing technologies being unable to distinguish between sensor faults and actual structural anomalies, and has the advantages of strong interpretability, low false alarm rate, and high engineering practical value. Unlike existing technologies that use physical equations as soft constraints as loss functions, this invention uses the deviation of conservation laws as an explicit feature input to the graph attention network. The explicit feature allows the model to directly perceive the degree of physical violation, resulting in strong interpretability, and the spatial pattern of the deviation can be directly used for anomaly root cause analysis.
[0024] 2. An adaptive differentiation mechanism for sensor faults and structural anomalies based on the spatial discreteness of deviation quantities is proposed, utilizing isolated spikes. With spatial continuous mode ( The difference (approximately 1.0) addresses the pain point of traditional methods failing to distinguish the root cause of anomalies. Unlike existing technologies that remove sensor fault data or reconstruct virtual data as a substitute, this approach retains and analyzes fault signals, significantly reducing false alarm rates and improving the reliability of the monitoring system.
[0025] 3. A physical propagation law template library unique to the water conservancy field was constructed, which explicitly encodes the spatial propagation laws of four types of anomalies: leakage, blockage, cracks, and settlement, so as to realize automatic matching and identification of anomaly types.
[0026] 4. Make full use of sensor topology and construct graph attention network based on the spatial proximity and hydraulic connectivity of water conservancy facilities to effectively model the complex spatial correlation between multiple sensors and improve the sensitivity and accuracy of anomaly detection.
[0027] 5. Possesses the ability to locate the root cause of anomalies, using physical constraint inversion methods to pinpoint the hydraulic unit where the anomaly occurred, and outputs the specific type and location, providing clear guidance for on-site maintenance.
[0028] 6. The project has high practical value and can be deployed in real-world scenarios such as dam safety monitoring, water pipeline leakage monitoring, and dike seepage monitoring. It is adaptable to various types of water conservancy facilities and environmental conditions, effectively improving the safety operation and maintenance level of water conservancy projects. Attached Figure Description
[0029] Figure 1 This is an overall flowchart of the method of the present invention; Figure 2 This is a diagram of the graph attention network and bidirectional long short-term memory network structure of the present invention. Detailed Implementation
[0030] The present invention will be further described below with reference to specific embodiments.
[0031] Example 1: A method for identifying abnormal states of water conservancy facilities based on physical constraint embedding, comprising the following steps: S1. Acquire time-series monitoring data from multiple sensors on the water conservancy facility, preprocess the data, and construct a sensor topology map based on the spatial or hydraulic connectivity relationships between the sensors.
[0032] (1) Data acquisition: Data is collected in real time by various sensors deployed on the water conservancy facilities, such as piezometers, strain gauges, crack gauges, thermometers, water level gauges, and flow meters. The data format is a time series matrix. ,in For time steps, This represents the total number of sensors.
[0033] (2) Data preprocessing: Perform preprocessing operations such as missing value imputation, gross error removal, normalization, and data augmentation on the original monitoring data.
[0034] (3) Sensor topology construction: Construct an undirected graph based on the spatial and hydraulic connectivity relationships between sensors. , where: node set Each node corresponds to one sensor. The edge set E is defined as follows: if the spatial Euclidean distance between two sensors is less than a threshold, or if they are located in the same hydraulic unit (such as the same dam section or the same pipeline section), then an edge is established. Edge weights... Taking the reciprocal of the spatial distance, the graph structure uses an adjacency matrix. storage.
[0035] S2. For the hydraulic physical process at the location of each sensor, establish at least one physical conservation constraint equation, and calculate the deviation of the physical conservation constraint equation at each sensor node at each time step based on the time-series monitoring data to obtain the conservation law deviation characteristics.
[0036] By utilizing the physical conservation laws in hydraulic engineering, the deviation of each sensor node from the conservation law at each time step is calculated and used as an explicit input model of physical prior features.
[0037] Based on the type of water conservancy facility and sensor type, select one or more of the following physical constraints: (1) Darcy's Law (applicable to piezometers): seepage velocity Where k is the permeability coefficient and i is the hydraulic gradient. For two piezometers upstream and downstream, the hydraulic gradient is... Theoretical seepage flow Where A is the area. If the measured seepage flow rate... If the deviation from the theoretical value exceeds a threshold, a deviation amount is generated. (2) Bernoulli's energy conservation (applicable to pipeline flow meters and pressure gauges): For two cross-sections in a water pipeline, the total head It should be conserved (losses should be ignored). For pressure, For fluid density, It is the acceleration due to gravity. Flow rate. Deviation. (3) Mass conservation (applicable to flow meters and water level gauges): For reservoirs or pipeline sections, inflow = outflow + rate of change of storage capacity. Deviation , The total flow rate into the control body. The total flow rate out of the control body. To control the rate of change of water storage in the body. (4) Stress-strain constitutive relationship (applicable to strain gauges and gap gauges): within the elastic range, stress and strain are proportional. Deviation amount ,in, The strain value, Calculated from the load, It is the elastic modulus.
[0038] The deviation is calculated and normalized as follows: For each sensor node i, at each time step t, the corresponding physical constraint deviation is calculated based on its type and associated sensor data. For nodes with multiple physical constraints, the deviation vector can be calculated. .
[0039] To eliminate the influence of dimensions, the deviations are normalized: , in , These represent the mean and standard deviation of deviations under normal operating conditions (obtained through statistical analysis of historical health data).
[0040] S3. The raw monitoring data of each sensor is concatenated with the conservation law deviation features to form the initial feature vector of each node. The initial feature vector is input into the graph attention network, and the features of neighboring nodes are aggregated through the multi-head attention mechanism to output the enhanced features of each node. Then, the enhanced features of each node at multiple consecutive time steps are input into the bidirectional long short-term memory network (Bi-LSTM) to capture past and future information respectively. The last hidden state of the forward and backward directions is concatenated to obtain the spatiotemporally dependent abnormal feature vector.
[0041] The raw monitoring data from the sensor is fused with the deviation from the physical constraint. Spatial neighbor information is aggregated through a graph attention network (GAT), and temporal dependence is extracted through a bidirectional LSTM to obtain the abnormal feature vector of each node with fused spatiotemporal features.
[0042] (1) Initial feature construction. At time step t, the initial feature vector of node i is: ,in These are the normalized sensor monitoring values. This is the deviation after normalization. (K represents the deviation dimension).
[0043] (2) Graph Attention Layer. A multi-head graph attention network (GAT) is used to aggregate spatial information. For the l-th layer, the feature update formula for node i is: , Where: M is the number of attention heads, Let i be a neighboring node of node i; Let be the learnable weight matrix for the m-th head; Attention Score: , in For attention parameter vectors, for transpose, The feature of the center node i after the head weight transformation is the m-th head. Let be the feature of neighbor node j after the head weight transformation of the m-th node, and k be any neighbor of node i.
[0044] To incorporate edge weights into the topological graph, a weighting factor can be introduced into the attention coefficient calculation: After L layers of GAT, the enhanced features of each node are obtained. .
[0045] (3) Bidirectional LSTM temporal coding. The enhanced feature sequence of each node i over T consecutive time steps... Input a bidirectional LSTM. A bidirectional LSTM consists of a forward LSTM and a backward LSTM, capturing past and future information respectively. , , By concatenating the last hidden states of the forward and backward directions, we obtain the spatiotemporal anomaly feature vector of node i: .
[0046] S4. Pass the abnormal feature vector of each node through a fully connected layer and a sigmoid activation function to output the abnormal probability of each node.
[0047] The spatiotemporal anomaly feature vector of each node Input a fully connected layer, output a scalar, and then map it to anomaly probability using the sigmoid function: , in , These are learnable parameters. This represents the probability that node i has an anomaly (including sensor failure or structural anomaly) at its current location and time.
[0048] S5. Differentiate sensor faults from structural anomalies based on anomaly probability and deviation characteristics from conservation laws: When the anomaly probability of any node When a preset threshold is exceeded, a differentiation logic is triggered, utilizing the spatial propagation characteristics of physical constraint deviations to determine the root cause of the anomaly. This mechanism is fundamentally different from existing technologies that directly discard sensor fault data or reconstruct virtual data as a substitute. This invention retains and analyzes the spatial patterns of deviations to achieve adaptive root cause differentiation.
[0049] (1) Extract the deviation space pattern. For trigger node i, extract the conservation law deviation vector at the current time and the two time steps before and after it. and its neighboring node set The synchronous deviation of all nodes in the middle.
[0050] (2) Calculate the spatial dispersion. Define the spatial dispersion index for the deviation of node i: , in, Let be the normalized conservation law deviation vector for node i. Represents a vector Find the L2 norm. Let j be the set of neighboring nodes of node i, and j be the traversal variable, representing any neighboring node of node i. This is the smoothing coefficient.
[0051] when Greater than the high threshold When the deviation of node i is much greater than that of its neighbors, it exhibits the characteristic of an isolated spike.
[0052] (3) Decision logic.
[0053] Sensor fault diagnosis: If Furthermore, the deviation of node i remains high for three consecutive time steps, while the deviations of neighboring nodes are all below the low threshold. If so, it is determined to be a sensor failure (typical mode: single sensor drift, sudden change, disconnection).
[0054] True structural anomaly determination: If the deviation of node i and its multiple spatially related neighbor nodes increases synchronously (i.e. Approaching 1.0, and the deviation of all involved nodes exceeds [a certain value]. If the spatial distribution of the deviation satisfies the preset physical propagation law template, then it is determined to be a true structural anomaly.
[0055] (4) Pre-set template for physical propagation law. Based on the mechanism of water conservancy projects, the following propagation law template is pre-set, as shown in Table 1.
[0056] Table 1 Exception types Propagation Laws Dam seepage The upstream dam foundation piezometer deviates first, followed by the downstream piezometer; the amount of deviation is positively correlated with the hydraulic gradient. Pipe blockage The upstream pressure deviation from the blockage point increases, while the downstream flow deviation decreases, with the deviation decreasing along the direction of water flow. Concrete cracks The strain deviations at adjacent crack measuring points exhibit a spatially continuous distribution, and the deviation directions are consistent. Uneven settlement of foundation The deviations at multiple settlement measurement points show a linear or planar trend, rather than isolated abrupt changes. .
[0057] When determining actual structural anomalies, the spatial distribution of the actual deviation is matched with the aforementioned template (using cosine similarity or dynamic time warping). If the matching degree is greater than a threshold, the anomaly type is confirmed. For example: the sensors are sorted along the seepage direction as follows... Define the ideal deviation template vector This indicates that the deviation decreases from upstream to downstream, and the actual deviation of each node is extracted. Calculate cosine similarity ,like This is then determined to be a leak.
[0058] S6. Anomaly Root Cause Location: Once a true structural anomaly is determined, this step uses the physical constraint inversion method to locate the hydraulic element where the anomaly occurred and outputs the specific location and type.
[0059] (1) Construction of forward physical model. A simplified forward physical model (such as hydraulic pipeline network model, finite element seepage model) is established for water conservancy facilities. Taking dam leakage as an example, a two-dimensional seepage finite element model is established, and the upstream water level, downstream water level, and each permeability coefficient zone are input to calculate the theoretical value of pore water pressure at each piezometer location.
[0060] (2) Definition of the inversion problem. Define the parameters to be inverted. (such as the location coordinates of the leakage area and the magnification factor of the permeability coefficient), so that the physical quantities of each node calculated by the forward model are... Compared with measured values Minimize the deviation while simultaneously minimizing the deviation of physical constraints. Minimize. The objective function is constructed as follows: .
[0061] (3) Optimization solution. The particle swarm optimization algorithm is used to solve the above inverse problem. The steps are as follows: Initialize 200 particles, each representing a potential anomaly location and intensity; Calculate the fitness (objective function value) of each particle; Iteratively update the particle velocity and position until convergence or the maximum number of iterations is reached; Output the anomaly location and type corresponding to the optimal particle.
[0062] (4) Output of results. The abnormal locations obtained by inversion are mapped onto the three-dimensional GIS map of water conservancy facilities, and a diagnostic report is output, which includes: the node ID determined to be a sensor failure and the recommended maintenance measures; the type (leakage / crack / blockage / settlement, etc.), location (dam section number / pipeline chainage), severity (deviation amplitude) and recommended treatment plan determined to be a real structural anomaly.
[0063] S7. Train and optimize the model.
[0064] (1) Training data preparation: Collect historical monitoring data of water conservancy facilities, including normal operating data (accounting for 80%), known real structural abnormal event data (abnormal periods are manually marked), and sensor fault simulation data generated by injecting step mutations / linear drifts, etc.
[0065] (2) Loss function: Binary cross-entropy loss is used. , in This indicates an anomaly (including sensor malfunctions and structural anomalies).
[0066] (3) Online deployment: Deploy the trained model on the monitoring center server. Collect sensor data in real time, execute steps 1 to 4 every hour, and execute steps 5 to 6 if the anomaly probability exceeds the threshold, and output a diagnostic report.
[0067] Example 2: A water conservancy facility anomaly identification system based on physical constraint embedding, including a data acquisition and preprocessing module, a sensor topology map construction module, a physical constraint selection and deviation calculation module, a feature stitching module, a graph attention network enhancement module, a bidirectional long short-term memory network prediction and fusion module, an anomaly probability prediction module, an anomaly differentiation module, an anomaly root cause localization module, and a model training and optimization module. The data acquisition and preprocessing module is used to acquire and preprocess time-series monitoring data from multiple sensors on water conservancy facilities. The sensor topology construction module is used to construct a sensor topology map based on the spatial or hydraulic connectivity relationships between sensors. The physical constraint selection and deviation calculation module is used to establish at least one physical conservation constraint equation for the hydraulic physical process at each sensor location, and calculate the deviation of the physical conservation constraint equation at each sensor node at each time step based on time-series monitoring data, so as to obtain the conservation law deviation characteristics. The feature stitching module is used to stitch together the raw monitoring data of each sensor with the conservation law deviation features to form the initial feature vector of each node; The graph attention network enhancement module takes the initial feature vector as input, aggregates the features of neighboring nodes through a multi-head attention mechanism, and outputs the enhanced features of each node. The bidirectional long short-term memory network prediction fusion module takes the enhanced features of each node at multiple consecutive time steps as input, captures past and future information respectively, and concatenates the last hidden state of the forward and backward directions to obtain the fused spatiotemporal dependent abnormal feature vector. The anomaly probability prediction module is used to process the anomaly feature vector of each node through a fully connected layer and a sigmoid activation function, and output the anomaly probability of each node. An anomaly differentiation module is used to distinguish between sensor faults and structural anomalies based on anomaly probability and conservation law deviation characteristics. Anomaly root cause localization module, used for anomaly root cause localization; The model training optimization module is used for optimizing model training.
[0068] The above is a further description of the present invention in conjunction with specific embodiments, and the scope of protection of the present invention is not limited thereto.
Claims
1. A method for identifying abnormal states of water conservancy facilities based on physical constraint embedding, characterized by: The steps include the following: S1. Acquire time-series monitoring data from multiple sensors on the water conservancy facility, preprocess the data, and construct a sensor topology map based on the spatial or hydraulic connectivity relationships between the sensors. S2. For the hydraulic physical process at the location of each sensor, establish at least one physical conservation constraint equation, and calculate the deviation of the physical conservation constraint equation at each sensor node at each time step based on the time-series monitoring data to obtain the conservation law deviation characteristics. S3. The raw monitoring data of each sensor is concatenated with the conservation law deviation features to form the initial feature vector of each node. The initial feature vector is then input into the graph attention network, and the features of neighboring nodes are aggregated through the multi-head attention mechanism to output the enhanced features of each node. Then, the enhanced features of each node at multiple consecutive time steps are input into a bidirectional long short-term memory network to capture information from the past and future respectively. The last hidden state of the forward and backward directions is concatenated to obtain an abnormal feature vector that integrates spatiotemporal dependencies. S4. Pass the abnormal feature vector of each node through a fully connected layer and a sigmoid activation function to output the abnormal probability of each node; S5. Differentiate sensor faults from structural anomalies based on anomaly probability and deviation characteristics of conservation laws; S6. Root cause localization; S7. Train and optimize the model.
2. The method for identifying abnormal states of water conservancy facilities based on physical constraint embedding according to claim 1, characterized in that, The physical conservation constraint equations described in step S2, based on the type of hydraulic facility and sensor type, select one or more of the following physical constraints: (1) Darcy's Law: seepage velocity Where k is the permeability coefficient and i is the hydraulic gradient, for two piezometers upstream and downstream, the hydraulic gradient is... Theoretical seepage flow A is the area, and the measured seepage flow rate is... If the deviation from the theoretical value exceeds a threshold, a deviation amount is generated. ; (2) Bernoulli's law of conservation of energy: For two cross-sections in a water pipeline, the total head It should be conserved. For pressure, For fluid density, It is the acceleration due to gravity. For flow rate, deviation ; (3) Conservation of mass: For reservoirs or pipeline sections, inflow = outflow + rate of change of storage capacity, deviation amount , The total flow rate into the control body. The total flow rate out of the control body. To control the rate of change in the body's water storage; (4) Stress-strain constitutive relationship: Within the elastic range, stress and strain are directly proportional, and the deviation is... ,in, The strain value, Calculated from the load, It is the elastic modulus.
3. The method for identifying abnormal states of water conservancy facilities based on physical constraint embedding according to claim 2, characterized in that, For each sensor node i, at each time step t, the corresponding physical constraint deviation is calculated based on its type and associated sensor data. For nodes with multiple physical constraints, calculate the deviation vector. ; Normalize each deviation: , in , These represent the mean and standard deviation of the deviation under normal operating conditions.
4. The method for identifying abnormal states of water conservancy facilities based on physical constraint embedding according to claim 1, characterized in that, In step S3, the initial feature construction occurs at time step t, where the initial feature vector of node i is: , in These are the normalized sensor monitoring values. This is the deviation after normalization. K represents the deviation dimension.
5. The method for identifying abnormal states of water conservancy facilities based on physical constraint embedding according to claim 1, characterized in that, In step S3, a multi-head graph attention network (GAT) is used to aggregate spatial information. For the l-th layer, the feature update formula for node i is: , Where: M is the number of attention heads, Let i be a neighboring node of node i; Let be the learnable weight matrix for the m-th head; Attention Score: , in For attention parameter vectors, for transpose, The feature of the center node i after the head weight transformation is the m-th head. Let be the feature of neighbor node j after the head weight transformation of the m-th node, and k be any neighbor of node i.
6. The method for identifying abnormal states of water conservancy facilities based on physical constraint embedding according to claim 1, characterized in that, In step S3, the enhanced feature sequence of each node i over T consecutive time steps is input into a bidirectional LSTM. The bidirectional LSTM consists of a forward LSTM and a backward LSTM, which capture past and future information respectively. , , By concatenating the last hidden states of the forward and backward directions, we obtain the spatiotemporal anomaly feature vector of node i: 。 7. The method for identifying abnormal states of water conservancy facilities based on physical constraint embedding according to claim 1, characterized in that, In step S5, when the anomaly probability of any node exceeds a preset threshold, the conservation law deviation features of the node and its neighboring nodes are extracted, and the spatial dispersion index of the deviation is calculated. If the deviation of the node shows an isolated spike feature and the deviations of the neighboring nodes are all very small, it is determined to be a sensor failure. If the deviations of the node and multiple spatially related neighboring nodes increase synchronously and the deviation pattern satisfies the preset physical propagation law template, it is determined to be a real structural anomaly.
8. The method for identifying abnormal states of water conservancy facilities based on physical constraint embedding according to claim 7, characterized in that, The formula for calculating the spatial dispersion index of node i is: , in, Let be the normalized conservation law deviation vector for node i. Represents a vector Find the L2 norm. Let j be the set of neighboring nodes of node i, and j be the traversal variable, representing any neighboring node of node i. For smoothing coefficients; when Greater than the high threshold When the deviation of node i is much greater than that of its neighbors, it exhibits the characteristic of an isolated spike.
9. The method for identifying abnormal states of water conservancy facilities based on physical constraint embedding according to claim 1, characterized in that, In step S6, after determining that the anomaly is a real structural anomaly, the hydraulic element where the anomaly occurred is located using the physical constraint inversion method, and the specific location and type are output: First, a simplified forward physical model is established for the water conservancy facility, and the parameters to be inverted are defined. This makes the physical quantities of each node calculated by the forward model... Compared with measured values Minimize the deviation while simultaneously minimizing the deviation of physical constraints. Minimize, construct the objective function as: ; Optimize the solution.
10. A water conservancy facility anomaly identification system based on physical constraint embedding, characterized in that, It includes modules for data acquisition and preprocessing, sensor topology map construction, physical constraint selection and deviation calculation, feature stitching, graph attention network enhancement, bidirectional long short-term memory network prediction and fusion, anomaly probability prediction, anomaly differentiation, anomaly root cause localization, and model training and optimization. The data acquisition and preprocessing module is used to acquire and preprocess time-series monitoring data from multiple sensors on water conservancy facilities. The sensor topology construction module is used to construct a sensor topology map based on the spatial or hydraulic connectivity relationships between sensors. The physical constraint selection and deviation calculation module is used to establish at least one physical conservation constraint equation for the hydraulic physical process at each sensor location, and calculate the deviation of the physical conservation constraint equation at each sensor node at each time step based on time-series monitoring data, so as to obtain the conservation law deviation characteristics. The feature stitching module is used to stitch together the raw monitoring data of each sensor with the conservation law deviation features to form the initial feature vector of each node; The graph attention network enhancement module takes the initial feature vector as input, aggregates the features of neighboring nodes through a multi-head attention mechanism, and outputs the enhanced features of each node. The bidirectional long short-term memory network prediction fusion module takes the enhanced features of each node at multiple consecutive time steps as input, captures past and future information respectively, and concatenates the last hidden state of the forward and backward directions to obtain the fused spatiotemporal dependent abnormal feature vector. The anomaly probability prediction module is used to process the anomaly feature vector of each node through a fully connected layer and a sigmoid activation function, and output the anomaly probability of each node. An anomaly differentiation module is used to distinguish between sensor faults and structural anomalies based on anomaly probability and conservation law deviation characteristics. Anomaly root cause localization module, used for anomaly root cause localization; The model training optimization module is used for optimizing model training.
