Method and system for detecting anomalies in compressed air energy storage systems
By constructing an anomaly detection model based on transformer and graph neural network, the problem of compressed air energy storage system being unable to fully detect system-level anomalies is solved, enabling rapid identification and accurate response, and improving the safety and reliability of the system.
Patent Information
- Application Number
- CN202411342278.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-25
- Publication Date
- 2025-11-28
- Estimated Expiration
- 2044-09-25
AI Technical Summary
Existing methods for detecting anomalies in compressed air energy storage systems rely on sensor signals and human experience, which cannot comprehensively detect system-level anomalies, have slow response times, and are difficult to quickly identify potential problems.
An anomaly detection model based on transformer neural networks and graph neural networks is constructed. The model is trained by running data over time, and long-term dependencies are extracted using a self-attention mechanism. Graph neural networks capture component interactions, multi-head attention mechanism extracts features, and data differences are evaluated using a streaming model to update model parameters to improve detection accuracy.
It improves the sensitivity and response speed of compressed air energy storage systems to abnormal conditions, enabling more accurate identification of system anomalies and enhancing system safety and reliability.
Smart Images

Figure CN118934591B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of compressed air energy storage systems, in particular to a compressed air energy storage system anomaly detection method and system. BACKGROUND
[0002] Compressed air energy storage (CAES) systems play a key role in promoting the efficient use of renewable energy and balancing grid load. Due to its complex multi-device coupling structure and the involvement of multiple energy forms, especially under high temperature and high pressure operating conditions, once a failure occurs, it may cause serious damage to personnel safety, environment and assets. Therefore, it is crucial to ensure the reliability and safety of the system.
[0003] Currently, the operation monitoring of compressed air energy storage systems mainly relies on signals collected by sensors, such as temperature, pressure and flow parameters, and real-time monitoring and control is carried out through logic controllers; traditional monitoring methods focus on single device anomaly detection and fail to fully consider system-level abnormal states, and if the sensing module of a single device fails, it may trigger a system-level state anomaly; on the other hand, existing anomaly detection methods rely on a large amount of device data processing and manual experience judgment, which not only increases the response time of the system, but also limits the ability to quickly identify and respond to potential problems. Based on this, a compressed air energy storage system anomaly detection method and system are proposed. SUMMARY
[0004] In order to solve the technical problems of insufficient anomaly state sensing ability and slow response speed of compressed air energy storage systems, the purpose of the present application is to provide a compressed air energy storage system anomaly detection method and system, and the technical solution adopted is as follows:
[0005] The first aspect of the technical solution is a compressed air energy storage system anomaly detection method, which comprises:
[0006] Obtaining and preprocessing the operation data of each stage of the compressed air energy storage system to obtain time series operation data;
[0007] Building an anomaly detection model and training the anomaly detection model using time series operation data;
[0008] Building an evaluation model to evaluate the difference between the reconstructed data of the anomaly detection model and the time series operation data and updating the trained anomaly detection model;
[0009] Using the updated anomaly detection model to output anomaly detection results.
[0010] Further, obtaining and preprocessing the operation data of each stage of the compressed air energy storage system to obtain time series operation data comprises:
[0011] For each stage operation data, the average value and the standard deviation are calculated respectively;
[0012] Based on the average value and the standard deviation, the normalization processing is performed on the operation data of each stage.
[0013] Further, the expression for performing the normalization processing on the operation data of each stage is:
[0014]
[0015] In the formula, z i represents the normalization result of the i-th data point; x i represents the i-th data point; and N represents the number of data samples.
[0016] Further, the abnormality detection model is constructed, and the abnormality detection model is trained by using the time series operation data, including:
[0017] The abnormality detection model is constructed based on a transformer neural network and a graph neural network.
[0018] Further, the abnormality detection model is constructed based on a transformer neural network and a graph neural network, including:
[0019] The long-term dependency relationship in the operation time series data is extracted by using the self-attention mechanism in the transformer architecture.
[0020] The interaction relationship between each component of the compressed air energy storage system is extracted by using the graph neural network.
[0021] The features are extracted from the operation time series data by using the multi-head attention mechanism.
[0022] Further, the expression for extracting the long-term dependency relationship in the operation time series data by using the self-attention mechanism in the transformer architecture is:
[0023]
[0024] In the formula, Q h represents a query matrix; K h represents a key matrix; and V h represents a value matrix; d k represents the dimension of the key vector; softmax represents an activation function; Q h K h T represents the dot product between the query vector and the key vector, reflecting the similarity between the query vector and the key vector.
[0025] Further, the expression for extracting the interaction relationship between each component of the compressed air energy storage system by using the graph neural network is:
[0026]
[0027] wherein, represents the result of the aggregation of node v in the l-th layer; represents the set of neighbor nodes of node v; A uv represents the element in the adjacency matrix; represents the node feature of neighbor node u in the (l-1)-th layer.
[0028] Further, the expression for extracting features from the run-time series data using the multi-head attention mechanism is:
[0029] MultiHead(Q,K,V)=Concat(head1,…,head H )W O
[0030] wherein, MultiHead represents the output of the multi-head attention structure; head1 represents the output of the first attention head; H represents the number of attention heads; W O represents the output projection matrix; and Concat represents the concatenation operation.
[0031] Further, the evaluation of the difference between the reconstructed data and the run-time series data and the updating of the trained anomaly detection model include:
[0032] The flow model is used in combination with a logarithmic loss function to measure the difference between the reconstructed data and the actual data.
[0033] The second aspect technical solution is a compressed air energy storage system anomaly detection system, which comprises the compressed air energy storage system anomaly detection system of the first aspect technical solution, and the system comprises:
[0034] A data acquisition module configured to acquire and pre-process the run-time series data of each stage of the compressed air energy storage system.
[0035] An anomaly detection model training module configured to train the anomaly detection model using the run-time series data.
[0036] An anomaly detection model evaluation module configured to evaluate the difference between the reconstructed data and the run-time series data of the anomaly detection model and update the trained anomaly detection model.
[0037] An anomaly detection module configured to output an anomaly detection result using the updated anomaly detection model.
[0038] The present application has the following beneficial effects:
[0039] The compressed air energy storage system anomaly detection method and system provided by the application, through time sequence operation data training anomaly detection model, complex features are extracted from multi-dimensional time sequence data, the sensitivity of the model to abnormal state is improved; the difference between reconstructed data and actual data is detected by constructing an evaluation model, and the trained anomaly detection model is updated, the updated anomaly detection model can more accurately output the anomaly detection result, the model performance is continuously evaluated and the model parameters are updated, so that the model can continuously adapt to new data changes, thereby improving the response speed. BRIEF DESCRIPTION OF DRAWINGS
[0040] In order to more clearly illustrate the technical solutions and advantages of the embodiments of the present application or the prior art, the drawings needed to be used in the embodiments or the prior art description will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present application, and those skilled in the art can also obtain other drawings according to these drawings without creative labor.
[0041] Figure 1 The method flow chart of the compressed air energy storage system anomaly detection method provided by an embodiment of the present application;
[0042] Figure 2 The structural schematic diagram of the compressed air energy storage system anomaly detection system provided by an embodiment of the present application;
[0043] Figure 3 The flow chart of the compressed air energy storage system anomaly detection method provided by an embodiment of the present application. DETAILED DESCRIPTION
[0044] In order to further illustrate the technical means and effects adopted by the present application to achieve the predetermined invention purpose, the specific implementation, structure, features and effects of the compressed air energy storage system anomaly detection method and system according to the present application are described in detail as follows by combining with the drawings and preferred embodiments. In the following description, different "one embodiment" or "another embodiment" do not necessarily refer to the same embodiment. In addition, the specific features, structures or characteristics in one or more embodiments can be combined in any suitable form.
[0045] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which the present application belongs.
[0046] The specific scheme of the compressed air energy storage system anomaly detection method and system provided by the present application is specifically described below in combination with the drawings.
[0047] Please refer to Figure 1 , Figure 3FIG. 1 shows a flow chart of a method for detecting anomalies in a compressed air energy storage system according to an embodiment of the present application, the method comprising:
[0048] Step S100: Obtain and preprocess the operating data of each stage of the compressed air energy storage system to obtain time-series operating data; Specifically, temperature and pressure sensors are installed on key parts of the compressed air energy storage system, such as compressors, gas storage tanks, heat exchangers, etc., to record the operating data of the compressed air energy storage system under different operating conditions, including but not limited to:
[0049] Device state data: multi-stage compressor speed, cold oil tank height, hot oil tank height;
[0050] Temperature state data: ambient temperature, multi-stage compressor outlet temperature, gas storage temperature, cold oil tank temperature, hot oil tank temperature;
[0051] Pressure state data: ambient pressure, multi-stage compressor outlet pressure, gas storage pressure;
[0052] To ensure the quality of the above data, the preprocessing of the above data includes but is not limited to: confirming whether the data of each sensor is complete and whether there are missing values; If missing values are found, filling strategies such as forward filling, backward filling or interpolation method can be selected for filling; Filtering methods can also be used to remove noise in sensor readings; Statistical methods such as box plots, Z-scores, etc. can also be used to identify and process outliers;
[0053] In actual application, the corresponding operating data can be collected by setting external environmental conditions (such as temperature, humidity) and operating time, the collected operating data is divided into normal operating data and abnormal operating data, in order to simulate abnormal conditions, harmonic signals or step signals are input into the system to simulate the abnormal operating state of the system under certain conditions, and the abnormal data generated by simulation is labeled for model performance testing; For example, periodic fluctuations that may occur in the system, such as frequency fluctuations or vibrations, are simulated by harmonic signals; sudden large changes in the system, such as sudden changes in pressure or temperature, are simulated by step signals;
[0054] Step S100 specifically includes:
[0055] Step S110: For each stage of operating data, calculate the average and standard deviation; For each type of state data (such as device state, temperature state, pressure state), calculate the average and standard deviation thereof respectively;
[0056] Step S120: based on the mean and standard deviation, the running data of each stage is normalized, the compressed air energy storage system operation data is composed of multiple types of data, and the dimensions are not unified. Using dimensionally inconsistent data to train the model will reduce the model accuracy and convergence speed. A standardization method is defined to convert the existing data into a distribution with a mean of 0 and a variance of 1, and its expression is:
[0057]
[0058] In the formula, z i represents the normalized result of the i-th data point; x i represents the i-th data point; N represents the number of data samples;
[0059] Then, the normalized data set is divided into training set, validation set and test set according to a certain proportion. For each type of state data, use the sliding window method to divide the data. From the first time point of the data set, the window is slid to the end of the data set, and a new data window is generated each time the time step is moved. For each generated window, assign a label according to the actual situation. If all the data in the window come from normal running data, it is marked as "normal"; if the window contains abnormal data, it is marked as "abnormal".
[0060] Step S200: build an anomaly detection model, and train the anomaly detection model using time series running data;
[0061] Step S200 specifically includes:
[0062] Step S210: build an anomaly detection model based on transformer neural network and graph neural network; specifically,
[0063] Step S210 specifically includes:
[0064] Step S211: use the self-attention mechanism in the transformer architecture to extract the long-term dependence relationship in the running time series data, use the transformer to build a feature extraction module, and directly calculate the dependence between any two points in the sequence through the self-attention mechanism. It can more effectively capture the long-term dependence relationship of time series data, and its expression is:
[0065]
[0066] In the formula, Q h represents the query matrix; K h represents the key matrix; V h represents the value matrix; d k represents the dimension of the key vector; softmax represents the activation function; Q h Kh T denotes the dot product between the query vector and the key vector, reflecting the similarity between the query vector and the key vector; specifically, the time series running data is mapped into three different representations: Query (Q), Key (K) and Value (V), which can be obtained through linear transformation (full connection layer); for the query vector Q h of each position, the dot product between it and the key vector K h of all other positions is calculated, thereby reflecting the similarity between the query vector and the key vector; in order to avoid the saturation of the softmax function caused by a large dot product, it is divided by the square root of the dimension d k of the key vector; the softmax function is applied to the scaled dot product to convert it into a probability distribution, representing the importance weight of each position, and the value vector is weighted and summed using these weights to obtain the attention output; in the training process, dropout technology can also be applied to prevent overfitting, i.e. randomly turning off a part of the neurons to increase the generalization ability of the model;
[0067] Step S212: Use a graph neural network to extract the interaction relationship between each component of the compressed air energy storage system. In order to further capture the complex relationship and feature dependence between nodes, a graph neural network is used to construct a graph structure learning module. The graph neural network establishes a node feature graph and a corresponding adjacency matrix, and updates the state of the node through iteration to capture the relationship and structure information between nodes. The information transmission between different nodes is realized by aggregating neighbor information, and its expression is:
[0068]
[0069] In the formula, denotes the result of the l-th layer aggregation of node v; denotes the neighbor node set of node v; A uv denotes the element in the adjacency matrix; The node features of neighbor node u at the (l-1)-th layer are represented; specifically, an adjacency matrix A is initialized to represent the connection relationship between nodes, in a compressed air energy storage system, each component (such as a compressor, a gas tank, a turbine, etc.) can be regarded as a node in the graph, a long short-term memory network (LSTM) is used to process the time series data of the compressed air energy storage system, the LSTM can capture the long-term dependencies in the time series data. In addition, an attention mechanism is added to enhance the model's ability to focus on important information in the sequence. By adding a linear transformation layer to the LSTM structure to generate attention weights, and applying these weights to the output of the LSTM, the output of the LSTM unit will be combined with the generated attention weights, so that the model can more effectively identify and utilize key features; in the GNN module, during the forward propagation process, the adjacency matrix A is multiplied with the node features h to obtain the neighbor information of each node, then the information is transformed through a linear layer, and the combined features are processed through an activation function, and finally the updated node features are output. Through the graph neural network, the complex interaction relationship between the internal components of the compressed air energy storage system can be effectively captured, and by combining the graph structure with the time series features, the model can better understand and represent the behavior patterns of the system, thereby improving the accuracy of anomaly detection.
[0070] Step S213: features are extracted from the runtime sequence data using a multi-head attention mechanism, and the multi-head attention structure extracts complex features from multi-dimensional time series data, each attention head can independently learn different features and patterns in the multi-dimensional data, and the expression is:
[0071] MultiHead(Q,K,V)=Concat(head1,…,head H )W O
[0072] In the formula, MultiHead represents the output of the multi-head attention structure; head1 represents the output of the first attention head; H represents the number of attention heads; W O represents the output projection matrix; Concat represents the concatenation operation; specifically, in order to capture the information in different subspaces, the query matrix, the key matrix and the value matrix are each split into H different parts, that is, Q i ,K i ,V i , where i=1,2,…,H; for each split part, the attention score is calculated separately, and the attention mechanism is applied, each head can focus on different aspects of the data; then the output results of all attention heads are concatenated to form a multi-dimensional vector, and then a linear transformation (output projection matrix W O) to the desired dimension, obtaining the final multi-head attention output; integrate the features extracted by the multi-head attention mechanism into the overall anomaly detection model, which can be used together with other types of features obtained in the previous steps to train the model to identify normal and abnormal operation modes, train the model using a dataset containing normal and abnormal samples, and evaluate the model performance through test data; step S213 can more comprehensively and meticulously extract features from the runtime data of the compressed air energy storage system through the application of the multi-head attention mechanism, thereby improving the effect of anomaly detection.
[0073] Step S300: Construct an evaluation model to evaluate the difference between the reconstructed data and the time series operation data and update the trained anomaly detection model;
[0074] Step S300 specifically includes:
[0075] Step S310: Use the flow model to measure the difference between the reconstructed data and the actual data by combining the log loss function; specifically, the runtime data of the compressed air energy storage system is input into the flow model for a series of transformations, and the transformed data is obtained, which is expressed as:
[0076] Y=f(X)
[0077] In the formula, X represents the runtime data; Y represents the reconstructed data; f represents a reversible function;
[0078]
[0079] In the formula, J represents the Jacobian matrix;
[0080] p(Y)=p(X)|J| -1
[0081] In the formula, p(Y) represents the probability density of the reconstructed data; p(X) represents the probability density of the runtime data;
[0082] After each transformation, the absolute value of the logarithm of the Jacobian determinant is calculated, because during the transformation process, the volume change factor, i.e. the Jacobian determinant, needs to be considered, which guarantees the reversibility of the transformation and correctly adjusts the probability density during the transformation process, so that the model can accurately learn and generate the data distribution;
[0083] Using the transformed data, calculate its log probability under a simple base distribution (such as a standard normal distribution), and add the sum of the log probability of the base distribution and the absolute value of the log Jacobian determinant to obtain the total log probability, which is expressed as:
[0084] p(X)'=exp(log(p Z (X))+|log(J(X))|)
[0085] L = -log(p(X'))
[0086] where p(X') represents the total log probability; p Z (X) represents the probability density of the runtime sequence data under the base distribution;
[0087] The difference between the reconstructed data and the actual data is measured using a log loss function, which is expressed as:
[0088] L = -log(p(X'))
[0089] where L represents the difference between the reconstructed data and the true data; by minimizing this loss function, the reconstructed data is as close to the original data as possible, so that the flow model can better fit the true distribution of the data; the model parameters are updated using the backpropagation algorithm;
[0090] In summary, through the log loss function, the anomaly detection model can more accurately learn the data distribution and perform better in the face of data imbalance; the calculation of the Jacobian determinant ensures the reversibility in the transformation process, so that the anomaly detection model can not only learn the data distribution, but also generate new data samples; since the flow model can capture the subtle features of the data, it can better identify abnormal situations that do not conform to the normal operation mode; the compression air energy storage system anomaly detection method provided by the present application constructs an effective and robust compression air energy storage system anomaly detection model, which can automatically identify abnormal behaviors in the system and improve the safety and reliability of the system; the combination of Transformer and graph neural network can capture the complex interactions and dependencies within the system, thereby improving the accuracy of anomaly detection.
[0091] Step S400: output the anomaly detection result using the updated anomaly detection model; specifically, the updated anomaly detection model outputs the anomaly score or probability of each time point, and the higher the score, the more likely it is that the data at that time point is abnormal; normal data and abnormal data can be distinguished by setting a threshold value, and when an anomaly is detected, the corresponding alarm mechanism should also be triggered to notify the maintenance personnel or the automated system to take appropriate measures, such as stopping the system operation, starting the backup system, etc.
[0092] Please refer to Figure 2 , the second aspect technical solution is a compression air energy storage system anomaly detection system, including the compression air energy storage system anomaly detection system of the first aspect technical solution, the system includes:
[0093] a data acquisition module configured to acquire and preprocess the runtime data of each stage of the compression air energy storage system to obtain time sequence runtime data;
[0094] an abnormality detection model training module configured to train an abnormality detection model by using the time-series operation data;
[0095] an abnormality detection model evaluation module configured to evaluate a difference between the reconstructed data and the time-series operation data and update the trained abnormality detection model;
[0096] an abnormality detection module configured to output an abnormality detection result by using the updated abnormality detection model.
[0097] It should be noted that the above-mentioned sequence of the embodiments of the present application is only for description, and does not represent the advantages and disadvantages of the embodiments. The processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multi-task processing and parallel processing are also possible or can be advantageous.
[0098] Each of the embodiments in the specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other. Each embodiment mainly describes the difference from other embodiments.
Claims
1. A method for detecting anomalies in a compressed air energy storage system, characterized in that, The method includes: The operation data of the compressed air energy storage system at each stage is acquired and preprocessed to obtain time-series operation data. Constructing an anomaly detection model and training it using time-series runtime data includes: Anomaly detection models are built based on transformer neural networks and graph neural networks, including: Utilize the self-attention mechanism in the transformer architecture to extract long-term dependencies in runtime sequence data; Graph neural networks are used to extract the interaction relationships between various components of a compressed air energy storage system. Features are extracted from runtime sequence data using a multi-head attention mechanism; Construct an evaluation model to assess the differences between the reconstructed data and the time-series running data of the anomaly detection model, and update the trained anomaly detection model, including: A streaming model combined with a logarithmic loss function is used to measure the difference between the reconstructed data and the actual data; the model parameters are updated using the backpropagation algorithm by minimizing the loss function. The updated anomaly detection model is used to output anomaly detection results, and the updated anomaly detection model outputs anomaly scores or probabilities at each time point.
2. The anomaly detection method for a compressed air energy storage system as described in claim 1, characterized in that, The compressed air energy storage system's operational data at each stage is acquired and preprocessed to obtain time-series operational data, including: For the operational data at each stage, calculate the mean and standard deviation respectively; The operational data for each stage are normalized based on the mean and standard deviation.
3. The anomaly detection method for a compressed air energy storage system as described in claim 2, characterized in that, The expression for normalizing the operational data at each stage is as follows: In the formula, Indicates the first Normalized results for each data point; Indicates the first One data point; Indicates the number of data samples.
4. The anomaly detection method for a compressed air energy storage system as described in claim 1, characterized in that, The expression for extracting long-term dependencies from runtime sequence data using the self-attention mechanism in the transformer architecture is as follows: In the formula, Represents the query matrix; Represents the key matrix; Represents a value matrix; Indicates the dimension of the key vector; Indicates the activation function; This represents the dot product between the query vector and the key vector, reflecting the similarity between them.
5. The anomaly detection method for a compressed air energy storage system as described in claim 4, characterized in that, The expression for extracting the interaction relationships between the various components of a compressed air energy storage system using a graph neural network is as follows: In the formula, Represents a node In the The result of layer aggregation; Represents a node The set of neighboring nodes; Represents the elements in the adjacency matrix; Representing neighboring nodes In the Layer node characteristics.
6. The anomaly detection method for a compressed air energy storage system as described in claim 5, characterized in that, The expression for extracting features from runtime sequence data using a multi-head attention mechanism is as follows: In the formula, This represents the output of the multi-head attention structure; This represents the output of the first attention head; Indicates the number of heads of attention; Indicates the output projection matrix; This indicates a splicing operation.
7. An anomaly detection system for a compressed air energy storage system, characterized in that, The compressed air energy storage system anomaly detection system according to any one of claims 1 to 6, the system comprising: The data acquisition module is configured to acquire and preprocess the operating data of the compressed air energy storage system at each stage to obtain time-series operating data. The anomaly detection model training module is configured to train the anomaly detection model using time-series runtime data. The anomaly detection model evaluation module is configured to evaluate the difference between the reconstructed data and the time-series running data of the anomaly detection model and update the trained anomaly detection model. The anomaly detection module is configured to output anomaly detection results using the updated anomaly detection model.
Citation Information
Patent Citations
Anomaly detection systems and methods
CA3212533A1
Device and method for correcting abnormal data
KR102635946B1