Comprehensive energy station hydrogen system safety monitoring gas leakage detection method

The problem of early detection and accurate location of hydrogen leaks in hydrogen systems was solved by using Multimodal Fusion Dynamic Graph Attention Network (MFDGAN), achieving high-sensitivity detection and rapid response for hydrogen systems.

CN121783448APending Publication Date: 2026-04-03CHONGQING UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-24
Publication Date
2026-04-03

AI Technical Summary

Technical Problem

Existing technologies are insufficient to effectively address the problems of early detection of hydrogen leaks in hydrogen systems, the spatiotemporal coupling characteristics of leak diffusion, the correlation changes of multimodal parameters, and the accurate location of leak sources. In particular, sensor signals are weak and susceptible to noise interference in complex environments, leading to frequent false alarms or missed alarms.

Method used

A multimodal fusion dynamic graph attention network (MFDGAN) is adopted. By constructing a learnable dynamic spatial weight matrix and a physical relationship weight matrix, and combining a trend encoder and a seasonal encoder, multi-dimensional sensor data features of the hydrogen system are extracted. Graph attention propagation is used for collaborative anomaly detection to achieve early warning and accurate location of hydrogen leaks.

Benefits of technology

It improves the ability to perform synergistic analysis of multi-dimensional parameters such as hydrogen concentration, pressure, and temperature, enhances the sensitivity of micro-leak detection, shortens the time for locating leak sources, and ensures high reliability and real-time performance under different environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121783448A_ABST
    Figure CN121783448A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of comprehensive energy station safety monitoring, in particular to a comprehensive energy station hydrogen system safety monitoring gas leakage detection method. The method comprises the following steps: acquiring physical quantities collected by sensor nodes to form a time sequence; decomposing the time sequence, and respectively extracting seasonal features and trend features by adopting a trend encoder and a seasonal encoder; constructing a learnable dynamic space weight matrix and a physical relation weight matrix reflecting a sensor node space relation; fusing the learnable dynamic space weight matrix and the physical relation weight matrix, and extracting spatial features; fusing the seasonal features, the trend features and the spatial features, and training a leakage detection model; inputting the seasonal characteristics and the trend characteristics of the new time sequence into the leakage detection model to complete data reconstruction; and judging whether gas leakage occurs or not. According to the method, a time sequence decomposition method is utilized, time-frequency domain characteristics and a dynamic graph attention network are combined, and leakage early recognition and leakage source positioning are carried out on multi-position and multi-mode coupled sensing data in a hydrogen system of the comprehensive energy station.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of integrated energy station safety monitoring technology, and in particular to a method for detecting gas leaks in the hydrogen system of an integrated energy station. Background Technology

[0002] Hydrogen, as a clean energy source, is widely used in integrated energy stations. However, its extremely small molecular diameter, high diffusion coefficient, and wide explosion limit range pose significant challenges to the safety monitoring of hydrogen systems. Large-scale wireless sensor networks deployed within integrated energy stations collect multi-dimensional and multi-modal data in real time, including pressure and temperature of hydrogen storage tanks, hydrogen concentration at key pipeline nodes, and environmental parameters. The following key technical challenges exist for the early detection of hydrogen leaks: 1. Weak signal and noise interference: The concentration changes caused by the initial trace leaks in the hydrogen system are often only on the order of one part per million, which are easily masked by environmental fluctuations and sensor noise. A single sensor is insufficient to distinguish between the actual leak signal and random noise.

[0003] 2. Spatiotemporal coupling characteristics of leakage diffusion: After a hydrogen leak, a complex diffusion pattern will form in space, and its concentration distribution will be affected by various factors such as wind direction, temperature gradient, and station structure. Sensor readings at different locations will show temporal sequence and spatial gradient changes, requiring collaborative analysis for accurate capture.

[0004] 3. Correlated changes in multimodal parameters: Micro-leakage not only manifests as a small change in hydrogen concentration, but also triggers a chain reaction such as pressure decay and slight temperature changes. These changes in multimodal parameters may not be significant in a single dimension, but synergistic analysis can significantly improve detection sensitivity.

[0005] 4. Blurred lines between normal and abnormal conditions: Hydrogen systems also experience pressure fluctuations and temperature changes during normal operation. These normal fluctuations are highly similar to early leakage characteristics, and traditional threshold methods are prone to generating a large number of false alarms or missed alarms.

[0006] 5. Difficulty in accurately locating the leak source: Even if an anomaly is detected, it is difficult to quickly determine the leak location. Especially in areas with dense pipelines, it is necessary to analyze the spatiotemporal correlation of data from multiple sensors to achieve accurate location.

[0007] Existing technologies mainly rely on single-sensor threshold alarms or simple rule-based judgments, which cannot effectively solve the aforementioned problems. Anomaly detection methods based on fixed models are ill-suited to the variable characteristics of hydrogen leaks under different environmental conditions and cannot fully utilize the collaborative information from multiple sensors in space. Therefore, there is an urgent need for a collaborative anomaly detection method that can integrate multi-point, multi-modal sensor data from hydrogen systems to capture the spatiotemporal characteristics of leaks, enabling early warning and precise location of hydrogen system leaks. Summary of the Invention

[0008] This invention discloses a gas leak detection method for safety monitoring of a hydrogen system in an integrated energy station. N sensor nodes are arranged in the hydrogen system of the integrated energy station. The sensor nodes are distributed in the hydrogen storage tank area, hydrogen dispenser, hydrogen delivery pipeline, hydrogen compressor, and key locations where hydrogen may accumulate. The gas leak detection method is as follows: The physical quantities collected by the sensor nodes are used to construct a time series. The time series is decomposed, and seasonality encoders are used to extract seasonal and trend features, respectively. Construct a learnable dynamic spatial weight matrix and a physical relation weight matrix that reflects the spatial relationships between sensor nodes; By fusing a learnable dynamic spatial weight matrix and a physical relation weight matrix, spatial features are extracted. A leak detection model is trained by integrating seasonal, trend, and spatial characteristics. The seasonal and trend characteristics of the new time series are input into the leak detection model to complete the data reconstruction and determine whether a gas leak has occurred.

[0009] Furthermore, the time series is decomposed, and the specific method is as follows: set up For each node Each mode Time series; Use a size of The original time series is subjected to convolution averaging within a sliding window, for each time point... The trend value, i.e., the trend component is calculated. The calculation formula is: in, At a certain point in time The original data values; The moving average window size is a hyperparameter; to handle sequence boundaries, a padding strategy using the first and last values ​​of the sequence is employed to ensure that the length of the decomposed sequence is the same as the length of the original sequence. Maintain consistency; Subtract the calculated trend component from the original sequence. The specific formula is as follows: Therefore, the original input Decomposed into trend components and seasonal components .

[0010] Furthermore, seasonal features are extracted, using the following specific methods: Use Discrete Fourier Transform to analyze each time series. Transform to the frequency domain to obtain its complex frequency domain representation. : in, It is a frequency index, a spectrum. The amplitude represents the frequency. The intensity of the periodic components; In the frequency domain, the complex spectrum Viewed as a sequence, it is transformed by a learnable linear transformation matrix. Will The mapping is to query Q, key K, and value V, and the specific formula is as follows: The correlation between different frequency components is evaluated by calculating the dot product of Q and K, and the attention weights are obtained by normalization using the Softmax function. The weighted value V is transformed back to the time domain using the inverse discrete Fourier transform, resulting in the time series representation after frequency domain attention enhancement: in, It is the dimension of the key vector, used for scaling to prevent the gradient from being too small; The specific methods for extracting trend features are as follows: For each sensor node Each mode Its trend sequence Flattened into a vector and input into an MLP containing several hidden layers, it is represented as: MLP (Multi-Level Processing) consists of multiple fully connected layers and non-linear activation functions (such as ReLU) stacked together. The MLP network learns from the input trend sequence to its low-dimensional latent representation. The mapping relationship.

[0011] Furthermore, a learnable dynamic space weight matrix is ​​constructed, as follows: In both the trend encoder and the seasonal encoder, after time feature extraction, they are connected to the MFDGAN module. Calculate the dynamic association weight matrix between nodes using the self-attention mechanism. , represented as: in, Is The node feature matrix at time step.

[0012] Furthermore, the physical relationship weight matrix is ​​constructed using the following method: Define matrix elements , For nodes and nodes The connection relationship between them; Virtual nodes are introduced. Virtual nodes do not correspond to any physical sensors, but represent a specific physical area or logical functional unit. node and nodes Internal relationships, nodes and nodes There are direct upstream and downstream relationships, as well as nodes, in the energy process flow path. Regional risks are represented by basic weights; Connect the real sensor nodes within the area with their corresponding virtual nodes.

[0013] Furthermore, spatial features are extracted, using the following specific methods: Learnable dynamic space weight matrix Weight matrix of predefined physical relationships Perform the Hadamard product to obtain the adjusted adjacency matrix. , is used to define neighbor relationships, and is represented as: Among them, the physical relationship weight matrix For a static graph structure constructed based on expert knowledge and prior physical information, describe The sensor nodes have fixed physical proximity relationships or direct functional associations; a learnable dynamic spatial weight matrix. This refers to the real-time correlation strength between nodes obtained through model learning; Through the adjusted adjacency matrix Output space characteristics.

[0014] Furthermore, by integrating seasonal, trend, and spatial characteristics, the specific methods are as follows: For each node After time feature extraction, the following was obtained The set of feature vectors of each modality ,in It is a node The The feature representation of each modality at the current time step. For feature dimensions; Introduce a learnable global modality query vector Extract and integrate information; Features of each modality Generate the corresponding bonds through independent linear transformations. Sum : in, and It is a learnable weight matrix used to map the original modal features to a space of keys and values; Global Modal Query Key to each mode Calculate the dot product to measure the degree of match between the query and the modality, and normalize it using the Softmax function to obtain the attention weights for each modality. : Weight This indicates that during the integration process, the first... Modal pairs of nodes The relative importance of the final feature representation; Fusion features It is the value of all modes. Weighted sum: After multimodal fusion, each node Feature representation from A collection of independent modal feature vectors is transformed into a single feature vector that integrates information from all modalities. ; The fused feature vectors will be used as input for subsequent Graph Attention Propagation (GAT) to aggregate spatial information. The fused features will still be denoted as... Its dimensions are from Become That is, the modal dimension is eliminated, and each node There is only one fused feature vector.

[0015] Furthermore, the propagation process of the leak detection model is as follows: eigenvectors of all nodes Apply a shared linear transformation through the weight matrix. To achieve this, map it to a higher-dimensional or same-dimensional feature space, as shown in the following formula: For nodes The model iterates through all its neighbors. ,Depend on definition; For each neighbor The model calculates a raw attention score through an attention mechanism. This score measures the neighbors Features of nodes The importance is shown in the following formula: in, This indicates the transformed node. and neighbors The feature vectors are concatenated so that the attention score calculation considers the features of both nodes simultaneously. LeakyReLU is a non-linear activation function. It is a learnable attention parameter vector; Use the Softmax function to optimize nodes. The attention scores of all neighbors are normalized to obtain the final attention weight. : After normalization, Weight Indicates updating the node When considering the characteristics, one should consult the neighbors. How much information to refer to; node New features Features after transformation of all its neighbors The weights are obtained by performing a weighted summation, and these weights are the attention weights that were just calculated. : in, It is a non-linear activation function.

[0016] Furthermore, the leakage detection model ultimately outputs a feature representation of the trend component. and seasonal components Feature representation; The components are reconstructed as follows: Addition fusion is: in, This is the final reconstructed data.

[0017] Furthermore, to determine whether a gas leak has occurred, the specific methods are as follows: Calculate input data and reconstructing data The reconstruction error between them is used as the outlier score; for Time Node modality : The specific formula for determining whether a gas leak has occurred is as follows: An anomaly score threshold is set by evaluating performance on the validation set. Finally, a label matrix with the same dimensions as the input data is output, and specific warning information is generated based on the location and modality of the anomalies.

[0018] Due to the adoption of the above technical solutions, this application has the following beneficial effects: 1. High-sensitivity detection of trace leaks: By using a multimodal fusion dynamic graph attention network (MFDGAN), the system can perform synergistic analysis of multi-dimensional parameters such as hydrogen concentration, pressure, and temperature, thereby improving the detection sensitivity of trace leaks.

[0019] 2. Precise Leak Source Location Capability: By using a dynamic spatial weight matrix to model the diffusion path of hydrogen leaks and combining it with prior physical knowledge, the leak source can be located in a short time after an anomaly is detected, thus shortening the emergency response time.

[0020] 3. Adaptive to environmental changes: The model can automatically adjust the detection strategy and focus based on changes in environmental parameters such as temperature, humidity and ventilation conditions within the station, ensuring high reliability in different seasons and at different times.

[0021] 4. Simple implementation and easy deployment: The core module is computationally efficient and can run in real time on the edge computing device of the energy station, meeting the real-time requirements of security monitoring.

[0022] Other advantages, objectives, and features of the invention will be set forth in part in the description which follows, and in part will be apparent to those skilled in the art from the following examination, or may be learned from practice of the invention. The objectives and other advantages of the invention can be realized and obtained through the following description. Attached Figure Description

[0023] The accompanying drawings of this invention are described below.

[0024] Figure 1 This is a schematic diagram of the sensor monitoring network for the hydrogen system of the integrated energy station.

[0025] Figure 2 This is a schematic diagram of the overall process for gas leak detection. Detailed Implementation

[0026] The present invention will be further described below with reference to the accompanying drawings and embodiments.

[0027] A hydrogen system for an integrated energy station, such as Figure 1 As shown, by It consists of several sensor nodes, which are distributed in key locations such as hydrogen storage tank areas, hydrogen refueling machines, hydrogen pipelines, hydrogen compressors, and risk areas where hydrogen may accumulate. Each node Capable of monitoring simultaneously These physical quantities include hydrogen concentration, pipeline pressure, ambient temperature, and equipment surface temperature.

[0028] A method for detecting gas leaks in a hydrogen system of an integrated energy station, such as... Figure 2 As shown, the specific steps are as follows: S1. Obtain the physical quantities collected by the sensor nodes to form a time series.

[0029] S2, Decompose the time series.

[0030] For each node Each mode time series Decomposition using moving averages includes: S21. Calculate trend components Use a size of The original sequence is subjected to convolution averaging within a sliding window. For each time point... The trend value is calculated using the following formula: in, At a certain point in time The original data values; This is the window size for the moving average, a hyperparameter. To handle sequence boundaries, a padding strategy using the first and last values ​​of the sequence is employed to ensure that the length of the decomposed sequence is the same as the length of the original sequence. Maintain consistency.

[0031] S22, Calculate the seasonal component Subtract the calculated trend component from the original sequence: After this step, the original input Decomposed into trend components and seasonal components .

[0032] S3. Use a seasonal encoder to extract seasonal features.

[0033] Seasonal components This reflects short-term fluctuations in the hydrogen system caused by periodic operations, such as timed hydrogen replenishment and equipment start-up and shutdown. This invention employs a frequency domain attention mechanism (FDAM) to encode the temporal dimension characteristics of this component. The core idea of ​​this mechanism is that periodic behavior under normal operating conditions manifests in the frequency domain as energy concentrated at a few dominant frequencies, while abnormal events such as minor hydrogen leaks typically exhibit non-periodic, instantaneous impacts, with energy dispersed across a wider frequency range.

[0034] FDAM utilizes a self-attention mechanism to automatically learn and identify anomalous changes in frequency domain distributions, thereby achieving sensitive detection of minute leaks. The specific steps are as follows: S31, Time-domain to frequency-domain conversion Use Discrete Fourier Transform to analyze each time series. Transform to the frequency domain to obtain its complex frequency domain representation. : in, It's a frequency index. Spectrum. The amplitude represents the frequency. The intensity of the periodic components.

[0035] S32, Frequency Domain Self-Attention Calculation In the frequency domain, the complex spectrum It is treated as a sequence, and a self-attention mechanism is applied to it. First, through a learnable linear transformation matrix... Will Mapped to query Q, key K, value V: Then, the correlation between different frequency components is evaluated by calculating the dot product of Q and K, and the attention weights are obtained by normalization using the Softmax function. This process enables the model to focus on those frequencies that contribute the most to the reconstruction of normal periodic patterns.

[0036] S33, Frequency Domain to Time Domain Conversion The weighted values ​​are then transformed back to the time domain using the inverse discrete Fourier transform to obtain the time series representation after frequency domain attention enhancement: in, It is the dimension of the key vector, used for scaling to prevent the gradient from becoming too small.

[0037] Through FDM processing, the seasonal encoder not only extracts temporal features but also denoises and enhances the signal in the frequency domain. This makes the encoded feature representation robust to normal periodic fluctuations, while showing significant differences for anomalous events that disrupt this periodicity, laying the foundation for subsequent anomaly detection.

[0038] S4. Use a trend encoder to extract trend features.

[0039] Trend Components This reflects a long-term trend of slow changes in sensor data. In hydrogen systems, this trend may originate from slow equipment leaks, gradual changes in pipeline pressure, or long-term variations in ambient temperature. In particular, minute hydrogen leaks typically manifest as a slow decrease in pressure or a gradual increase in concentration. Although these changes are small in magnitude, they are persistent and serve as important indicators of early leaks.

[0040] This embodiment uses a multilayer perceptron (MLP) network to process the trend component. The time dependence of MLP. Unlike models that deal with local fluctuations, MLP can directly handle the entire time window. The trend data within the model is taken as a whole input, capturing its global, non-linear evolution pattern. Furthermore, the trend components, after being smoothed by moving averages, exhibit relatively simple changes and do not contain high-frequency details. Using a simple MLP is sufficient to effectively model its dependencies, avoiding the overfitting risks and computational overhead that might arise from using more complex models.

[0041] Specifically, for each sensor node Each mode Its trend sequence It is flattened into a vector and input into an MLP containing several hidden layers, as follows: The MLP consists of multiple fully connected layers and ReLU stacked together. Through end-to-end training, the MLP network can learn from the input trend sequence to its low-dimensional latent representation. The mapping relationship. This latent representation encapsulates the core evolutionary information of the trend sequence, preparing for subsequent integration with seasonal characteristics and spatial correlation analysis.

[0042] S5. Construct a learnable dynamic space weight matrix.

[0043] In both trend encoders and seasonal encoders, after time feature extraction, they are connected to the MFDGAN module. Let a certain hidden layer be represented as... .

[0044] Calculate the dynamic association weight matrix between nodes using the self-attention mechanism. : in, Is The node feature matrix at time step.

[0045] S6. Construct the physical relationship weight matrix of the spatial relationship between the reaction sensor nodes.

[0046] To comprehensively and accurately characterize the complex spatial risk relationships in a hydrogen system, this embodiment proposes a hierarchical construction method combining virtual nodes and weighted edges to define the matrix. elements , Represents a node and nodes The connection relationships between them; the specific steps are as follows: S61. Introduce regional virtual nodes. To model critical risk convergence areas where sensors are not directly deployed, virtual nodes are first introduced. These virtual nodes do not correspond to any physical sensors but rather represent a specific physical area or logical functional unit. For example, This area represents the hydrogen refueling machine operating area, which is a high-risk area where hydrogen may accumulate after a leak. This represents the bottom area of ​​the hydrogen storage tank, which is the area where leaked hydrogen may accumulate under the influence of gravity. This area represents the intersection of pipelines, a high-risk zone for joint leaks.

[0047] S62. Risk Association within Subsystems Internal device association: If node and nodes When sensors are deployed on the same critical equipment, they are given a higher basic weight. For example, pressure sensors and temperature sensors installed on the same hydrogen storage tank are physically adjacent and their measurements are strongly correlated.

[0048] Process flow association: If nodes and nodes If there is a direct upstream-downstream relationship in the energy process flow path, it is assigned a medium weight. For example, the pressure sensor in the pipeline connecting the outlet of the hydrogen storage tank and the pressure sensor at the inlet of the hydrogen refueling machine have a fluid dynamic relationship.

[0049] High-risk area association: If nodes Areas located in predefined high-risk zones are assigned higher weights, reflecting the prior knowledge that these areas have a higher probability and risk of leakage.

[0050] S63, Association with Virtual Nodes By connecting real sensor nodes within a region to virtual nodes representing that region, the weights are related to the representativeness of each sensor in terms of the overall state of the region. The state of the virtual node then integrates information from all relevant sensors within the region, becoming a higher-level representation of the region's state. When a sensor malfunctions, the information is first aggregated to the virtual node, and then propagated to other sensors within the region through the virtual node, thereby more effectively capturing regional coordinated anomalies.

[0051] By introducing virtual nodes and weighted edges in this construction method, the physical adjacency matrix... It is a safety knowledge graph that encodes a multi-layered, multi-dimensional, risk-prioritized structure for the hydrogen system. This prior knowledge graph can more precisely guide the model. Edges with higher weights naturally have greater potential for information flow in subsequent graph attention propagation, enabling the model to prioritize high-risk associations. Through virtual nodes, the model can move from point-based monitoring to area-based monitoring, better understanding and judging regional and diffuse anomalies.

[0052] S7. Integrate the learnable dynamic spatial weight matrix and the physical relation weight matrix to extract spatial features.

[0053] The above dynamic weight matrix With the predefined physical adjacency matrix Perform the Hadamard product to obtain the adjusted adjacency matrix. Used to define neighbor relationships: Predefined physical adjacency matrix It is a static graph structure built based on expert knowledge and prior physical information, which describes the hydrogen system. The fixed, physical proximity or direct functional relationships between sensor nodes serve to provide a basic framework or constraint for dynamic graph topology adjustments. Dynamic weight matrix The real-time association strength between nodes is obtained through model learning, but this learning may introduce noise or unstable connections. By... and By performing Hadamard product, the association weights are dynamically adjusted only between node pairs that have physical or functional prior connections, making the construction of dynamic graphs more robust and physically interpretable, and avoiding the establishment of spurious connections between completely unrelated nodes.

[0054] S8 integrates seasonal, trend, and spatial characteristics.

[0055] This embodiment employs a cross-attention mechanism to achieve multimodal feature fusion. Its core idea is to allow the model to dynamically allocate attention weights during the fusion process based on the contribution of different modalities to the current node state. In a micro-hydrogen leak scenario, the sensitivity of different modalities to the leak signal varies with the leak location and leak rate. This adaptive fusion mechanism can maximize detection sensitivity. The specific steps are as follows: S81, Modal Feature Preparation For each node After time feature extraction, the following was obtained The set of feature vectors of each modality ,in It is a node The The feature representation of each modality at the current time step. For feature dimensions.

[0056] S82, Query Generation To fuse these modal features, a learnable global modality query vector is introduced. This query vector can be seen as the model learning and extracting the most critical and relevant fusion information from all modalities.

[0057] S83, Key and Value Generation Features of each modality Each will generate a corresponding bond through an independent linear transformation. Sum : in, and It is a learnable weight matrix used to map raw modal features to a space of keys and values.

[0058] S84, Attention Weight Calculation Global Modal Query Key to each mode Calculate the dot product to measure the degree of match between the query and the modality, and normalize it using the Softmax function to obtain the attention weights for each modality. : These weights This indicates that during the integration process, the first... Modal pairs of nodes The final feature representation represents the relative importance of different modalities. This mechanism allows the model to dynamically weigh the importance of different modalities based on the actual situation.

[0059] S85, Feature Fusion Generation Final fusion features It is the value of all modes. Weighted sum: After multimodal fusion, each node Feature representation from A collection of independent modal feature vectors is transformed into a single feature vector that integrates information from all modalities. This fused feature vector will serve as the input for subsequent Graph Attention Propagation (GAT), enabling GAT to make decisions based on richer and more comprehensive node state information when aggregating spatial information. For simplicity, this fused feature will still be denoted as... However, its dimensions have changed from Become That is, the modal dimension is eliminated, and each node There is only one fused feature vector.

[0060] S9. Train the leak detection model.

[0061] After obtaining the dynamically adjusted adjacency relationships Subsequently, the model employs the Graph Attention Network (GAT) mechanism to aggregate information from neighboring nodes, thereby updating the feature representation of each node. Unlike traditional Graph Convolutional Networks (GCNs) which assign fixed weights to all neighbors, GAT dynamically and adaptively calculates an attention weight for each neighbor, enabling the model to focus more on those neighbors that have the greatest impact on the state of the central node at the current moment. Its propagation process can be decomposed into the following steps: S91, Node Feature Transformation First, for the feature vectors of all nodes Apply a shared linear transformation (through the weight matrix) This is achieved by mapping the model to a higher-dimensional or same-dimensional feature space, aiming to enhance the model's expressive power.

[0062] S92. Calculate the raw attention score. For nodes The model will iterate through all its neighbors. (Depend on (Definition). For each neighbor The model calculates a raw attention score through an attention mechanism. This score measures the neighbors Features of nodes The importance of.

[0063] in, This indicates the transformed node. and neighbors The feature vectors are concatenated so that the attention score calculation considers the features of both nodes simultaneously. LeakyReLU is a non-linear activation function. It is a learnable attention parameter vector.

[0064] S93, Normalized Attention Weights raw fractions The sizes may vary, making direct comparison difficult. Therefore, the Softmax function is used to compare the nodes. The attention scores of all neighbors are normalized to obtain the final attention weight. : After normalization, Weight Indicates updating the node When considering the characteristics, one should consult the neighbors. How much information to refer to.

[0065] S94, Feature Aggregation and Update Finally, the node New features Features after transformation of all its neighbors The weights are obtained by performing a weighted summation, and these weights are the attention weights that were just calculated. .

[0066] in, It is a non-linear activation function, such as ReLU.

[0067] The essence of this process is nodes. The next state of a model is an adaptive weighted average of the current states of all its neighbors. The weights are data-driven, and the model learns to give higher attention to it under different circumstances, thereby achieving efficient and accurate dissemination and aggregation of information and improving the sensitivity and accuracy of collaborative anomaly detection.

[0068] S10. Input the seasonal and trend characteristics of the new time series into the leakage detection model to complete the data reconstruction.

[0069] The encoder ultimately outputs a feature representation of the trend component. and seasonal components The features are represented. Data reconstruction includes: Component reconstruction: Additive fusion: in, This is the final reconstructed data.

[0070] S11. Determine if a gas leak has occurred.

[0071] Calculate input data and reconstructing data The reconstruction error between the two values ​​is used as the outlier score. For Time Node modality : An anomaly score threshold is set by evaluating performance on the validation set. Finally, a label matrix with the same dimensions as the input data is output, and specific warning information is generated based on the location and modality of the anomalies.

[0072] The following example illustrates the gas leak detection method for safety monitoring of the hydrogen system in the integrated energy station described in this application: Consider a collaborative detection scenario for minute hydrogen leaks in the hydrogen storage tank area. The integrated energy station's hydrogen system is configured with [number of units]. There are 10-15 sensor nodes, with nodes 10-15 distributed around a high-pressure hydrogen storage tank. Each node monitors... The data consisted of three modes: Mode 1 (hydrogen concentration), Mode 2 (local pressure), and Mode 3 (ambient temperature). Data was acquired every 10 seconds, and the analysis time window was set accordingly. That is, 2 hours.

[0073] Suppose that at some point, a tiny gap appears at a flange connection at the bottom of the hydrogen storage tank, causing a slow leak of hydrogen. This leak manifests as: a slow increase in hydrogen concentration at node 12, closest to the leak point; a slight but continuous downward trend in pressure readings at nodes 10-15; and a slight decrease in temperature near node 12.

[0074] The specific tests are as follows: The system collected data from the most recent 120 minutes, including this anomalous time point, forming an input tensor of size [30, 3, 120]. Among them, the concentration sequence of node 12 It contains a slow upward trend, with a resistance sequence at nodes 10-15. It contains a small but persistent downward trend.

[0075] For input tensor Each time series in the dataset is decomposed. Take node 12, which is closest to the leak point, as an example.

[0076] hydrogen concentration sequence Decomposed into: trend components It presents a slowly rising sloping line; seasonal component It fluctuates around zero, with no obvious periodic anomalies.

[0077] pressure sequence Decomposed into: trend components It presents a slowly declining curve; seasonal component It presents a slowly declining curve.

[0078] The decomposed components are then fed into their respective encoders: Seasonal encoder: Seasonal component of hydrogen concentration at node 12 It is fed into the Frequency Domain Attention Mechanism (FDAM). Although the component itself has no obvious abnormalities, FDAM establishes a high-precision "normal" benchmark by learning the spectral characteristics under normal operating conditions, so that any deviation can be sensitively captured.

[0079] Trend encoder: Hydrogen concentration trend component at node 12 The input is fed into a multilayer perceptron (MLP). During training, the MLP learns the pattern of normal hydrogen concentration trends (basically stable). When the input shows a continuous upward trend, the latent features of its output will deviate significantly from the normal distribution and be marked as anomalies.

[0080] Multimodal feature fusion: At node 12, the "abnormal upward trend feature" from the hydrogen concentration mode and the "abnormal downward trend feature" from the pressure mode are input into the cross-attention module. This module learns to discover the strong correlation between these two anomalous features that should not occur simultaneously: hydrogen leakage leads to an increase in concentration and a decrease in pressure. It assigns these features high attention weights and ultimately fuses them into a single node feature vector, but with the anomalous signal significantly amplified. .

[0081] Dynamic graph topology adjustment: Due to the anomaly degree of the fusion feature of node 12 Extremely high, in calculating the dynamic correlation weight matrix At this time, its association weight with downwind nodes 13 and 14 will significantly increase, reflecting the directionality of hydrogen diffusion. This dynamic weight... With the predefined physical adjacency matrix Multiplying them together yields the final graph structure used for information dissemination. .

[0082] Graph attention propagation: In the GAT layer, the strong anomalous information carried by node 12 will propagate along the graph. The alarm is preferentially propagated to nodes 13 and 14 downwind. Simultaneously, since nodes 10-15 have high-weighted connections in the physical adjacency matrix, strong attentional associations also form among these nodes. Therefore, even if the hydrogen concentrations of nodes 13 and 14 individually are insufficient to trigger an alarm, after graph attention aggregation, their feature representations will significantly bias towards anomalies, creating a spatial synergistic effect.

[0083] The anomaly features processed by the encoder are fed into the decoder, which contains the multimodal anomaly features of node 12 and information about the propagation of the anomaly to its spatial neighbors. Because these feature patterns are never seen by the model in the normal training data, the decoder cannot accurately reconstruct them from the original input data.

[0084] Reconstructed hydrogen concentration The slow upward trend will not be reproducible; the reconstruction error will be concentrated in the last 60 time points. The reconstructed pressure... This will also make it impossible to reproduce that small but continuous decline, resulting in a large cumulative error. The reconstructed data for downwind nodes 13 and 14 will also be subject to measurable bias due to the influence of anomalous information.

[0085] Calculate the outlier score: The system calculates the original input. and reconstructing data The pointwise squared error between the parameters. At nodes 12-14, the error value is significantly higher than the normal level for hydrogen concentration and pressure modes.

[0086] Judgment and Alarm: Calculated Anomaly Score and All exceeded the threshold set by the validation set. .

[0087] Generate alarm information: The system determines that an anomaly has occurred and generates specific and interpretable warning information based on the location and mode of the anomaly, such as the hydrogen concentration and pressure at node 12.

[0088] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit it. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that modifications or equivalent substitutions can still be made to the specific implementation of the present invention. Any modifications or equivalent substitutions that do not depart from the spirit and scope of the present invention should be covered within the scope of protection of the claims of the present invention.

Claims

1. A method for detecting gas leaks in a hydrogen system of an integrated energy station, characterized in that, The integrated energy station's hydrogen system has N sensor nodes, which are distributed in the hydrogen storage tank area, hydrogen refueling machine, hydrogen transmission pipeline, hydrogen compressor, and other key locations where hydrogen may accumulate. The gas leak detection method is as follows: The physical quantities collected by the sensor nodes are used to construct a time series. The time series is decomposed, and seasonality encoders are used to extract seasonal and trend features, respectively. Construct a learnable dynamic spatial weight matrix and a physical relation weight matrix that reflects the spatial relationships between sensor nodes; By fusing a learnable dynamic spatial weight matrix and a physical relation weight matrix, spatial features are extracted. A leak detection model is trained by integrating seasonal, trend, and spatial characteristics. The seasonal and trend characteristics of the new time series are input into the leakage detection model to complete the data reconstruction; Determine if a gas leak has occurred.

2. The method for detecting gas leaks in a hydrogen system of an integrated energy station as described in claim 1, characterized in that, The specific method for decomposing time series is as follows: set up For each node Each mode Time series; Use a size of The original time series is subjected to convolution averaging within a sliding window, for each time point... The trend value, i.e., the trend component is calculated. The calculation formula is: in, At a certain point in time The original data values; The moving average window size is a hyperparameter; to handle sequence boundaries, a padding strategy using the first and last values ​​of the sequence is employed to ensure that the length of the decomposed sequence is the same as the length of the original sequence. Maintain consistency; Subtract the calculated trend component from the original sequence. The specific formula is as follows: Therefore, the original input Decomposed into trend components and seasonal components .

3. The method for detecting gas leaks in the hydrogen system of an integrated energy station as described in claim 2, characterized in that, The specific method for extracting seasonal features is as follows: Use Discrete Fourier Transform to analyze each time series. Transform to the frequency domain to obtain its complex frequency domain representation. : in, It is a frequency index, a spectrum. The amplitude represents the frequency. The intensity of the periodic components; In the frequency domain, the complex spectrum Viewed as a sequence, it is transformed by a learnable linear transformation matrix. Will The mapping is defined as query Q, key K, and value V, with the following formula: The correlation between different frequency components is evaluated by calculating the dot product of Q and K, and the attention weights are obtained by normalization using the Softmax function. The weighted value V is transformed back to the time domain using the inverse discrete Fourier transform, resulting in the time series representation after frequency domain attention enhancement: in, It is the dimension of the key vector, used for scaling to prevent the gradient from being too small; The specific methods for extracting trend features are as follows: For each sensor node Each mode Its trend sequence Flattened into a vector and input into an MLP containing several hidden layers, it is represented as: MLP consists of multiple fully connected layers and non-linear activation functions (such as ReLU) stacked together. The MLP network learns from the input trend sequence to its low-dimensional latent representation. The mapping relationship.

4. The method for detecting gas leaks in the hydrogen system of an integrated energy station as described in claim 1, characterized in that, The specific method for constructing a learnable dynamic space weight matrix is ​​as follows: In both the trend encoder and the seasonal encoder, after time feature extraction, they are connected to the MFDGAN module. Calculate the dynamic association weight matrix between nodes using the self-attention mechanism. , represented as: in, Is The node feature matrix at time step.

5. The method for detecting gas leaks in the hydrogen system of an integrated energy station as described in claim 4, characterized in that, The physical relationship weight matrix is ​​constructed using the following method: Define matrix elements , For nodes and nodes The connection relationship between them; Virtual nodes are introduced. Virtual nodes do not correspond to any physical sensors, but represent a specific physical area or logical functional unit. node and nodes Internal relationships, nodes and nodes There are direct upstream and downstream relationships, as well as nodes, in the energy process flow path. Regional risks are represented by basic weights; Connect the real sensor nodes within the area with their corresponding virtual nodes.

6. The method for detecting gas leaks in a hydrogen system of an integrated energy station as described in claim 5, characterized in that, The specific methods for extracting spatial features are as follows: Learnable dynamic space weight matrix Weight matrix of predefined physical relationships Perform the Hadamard product to obtain the adjusted adjacency matrix. , is used to define neighbor relationships, and is represented as: Among them, the physical relationship weight matrix For a static graph structure constructed based on expert knowledge and prior physical information, describe The sensor nodes have fixed physical proximity relationships or direct functional associations; a learnable dynamic spatial weight matrix. This refers to the real-time correlation strength between nodes obtained through model learning; Through the adjusted adjacency matrix Output space characteristics.

7. The method for detecting gas leaks in the hydrogen system of an integrated energy station as described in claim 1, characterized in that, The method of integrating seasonal, trend, and spatial characteristics is as follows: For each node After time feature extraction, the following was obtained The set of feature vectors of each modality ,in It is a node The The feature representation of each modality at the current time step. For feature dimensions; Introduce a learnable global modality query vector Extract and integrate information; Features of each modality Generate the corresponding bonds through independent linear transformations. Sum : in, and It is a learnable weight matrix used to map the original modal features to a space of keys and values; Global Modal Query Key to each mode Calculate the dot product to measure the degree of match between the query and the modality, and normalize it using the Softmax function to obtain the attention weights for each modality. : Weight This indicates that during the integration process, the first... Modal pairs of nodes The relative importance of the final feature representation; Fusion features It is the value of all modes. Weighted sum: After multimodal fusion, each node Feature representation from A collection of independent modal feature vectors is transformed into a single feature vector that integrates information from all modalities. ; The fused feature vectors will be used as input for subsequent Graph Attention Propagation (GAT) to aggregate spatial information. The fused features will still be denoted as... Its dimensions are from Become That is, the modal dimension is eliminated, and each node There is only one fused feature vector.

8. The method for detecting gas leaks in the hydrogen system of an integrated energy station as described in claim 7, characterized in that, The propagation process of the leak detection model is as follows: eigenvectors of all nodes Apply a shared linear transformation through the weight matrix. To achieve this, map it to a higher-dimensional or same-dimensional feature space, as shown in the following formula: For nodes The model iterates through all its neighbors. ,Depend on definition; For each neighbor The model calculates a raw attention score through an attention mechanism. This score measures the neighbors Features of nodes The importance is shown in the following formula: in, This indicates the transformed node. and neighbors The feature vectors are concatenated so that the attention score calculation considers the features of both nodes simultaneously. LeakyReLU is a non-linear activation function. It is a learnable attention parameter vector; Use the Softmax function to optimize nodes. The attention scores of all neighbors are normalized to obtain the final attention weight. : After normalization, Weight Indicates updating the node When considering the characteristics, one should consult the neighbors. How much information to refer to; node New features Features after transformation of all its neighbors The weights are obtained by performing a weighted summation, and these weights are the attention weights that were just calculated. : in, It is a non-linear activation function.

9. The method for detecting gas leaks in a hydrogen system of an integrated energy station as described in claim 8, characterized in that, The leakage detection model ultimately outputs a feature representation of the trend component. and seasonal components Feature representation; The components are reconstructed as follows: Addition fusion is: in, This is the final reconstructed data.

10. The method for detecting gas leaks in a hydrogen system of an integrated energy station as described in claim 9, characterized in that, The specific methods for determining whether a gas leak has occurred are as follows: Calculate input data and reconstructing data The reconstruction error between them is used as the outlier score; for Time Node modality : The specific formula for determining whether a gas leak has occurred is as follows: An anomaly score threshold is set by evaluating performance on the validation set. Finally, a label matrix with the same dimensions as the input data is output, and specific warning information is generated based on the location and modality of the anomalies.