SF6 gas leakage detection method based on PatchTST-ALSTM
The SF6 gas pressure data is cut and characterized by the PatchTST-ALSTM method, combined with the global attention mechanism and LSTM to capture long-term and short-term dependencies, the problem of low detection accuracy of SF6 gas leakage is solved, and accurate prediction of gas pressure changes and real-time monitoring of equipment status is achieved.
Patent Information
- Application Number
- CN202510241641.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-03
- Publication Date
- 2025-07-18
AI Technical Summary
In the prior art, SF6 gas leakage detection accuracy is low and has poor timeliness, making it difficult to meet the requirements of modern power systems for real-time and accuracy.
Using a PatchTST-ALSTM-based method, the SF6 gas pressure data is preprocessed, and the tilting processing and feature mapping is used to use PatchTST to capture long-term and short-term dependencies, and the gas pressure prediction results are output.
It improves the accuracy and agingness of SF6 gas leakage detection, can accurately predict the change trend of gas pressure, and achieve effective monitoring and early warning of the status of GIS equipment.
Smart Images

Figure CN120336906A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of power equipment detection, and particularly relates to an SF6 gas leakage detection method based on PatchTST-ALSTM. Background Art
[0002] Gas-insulated switchgear (GIS) is an important part of modern power systems. By sealing the key components of power equipment in a metal enclosure filled with sulfur hexafluoride gas (SF6), excellent electrical insulation and arc extinguishing performance can be achieved. However, the gas has a significant greenhouse effect, and its leakage not only has a serious impact on the environment but may also weaken the electrical insulation performance inside the equipment, thus affecting the safety and stability of the equipment. Therefore, in order to maintain the safe operation of the power system, it is necessary to accurately predict the gas pressure in GIS equipment to timely warn of potential leakage risks and take appropriate preventive measures to ensure the normal operation of the equipment and the reliability of the system.
[0003] With the rapid development of deep learning, the long short-term memory network (LSTM), as a special type of recurrent neural network (RNN), has been widely used in time series prediction because it can effectively capture the dependencies in long time series data. For example, the Chinese Patent Office published a patent on January 15, 2021: CN112232597A, a security prediction method based on multi-variable long short-term memory network remote detection. First, a long short-term memory neural network is established, and then an intermediate prediction result is obtained through calculation, and a final prediction result is obtained by establishing a single-layer neural network. Finally, it is judged whether the output data is abnormal. It can predict the SF6 gas pressure value within a certain period in advance, facilitating the prediction of the change trend and taking preventive measures in the operation and maintenance work. However, although LSTM performs excellently in processing long data sequence data, its performance highly depends on a large amount of historical data. In the case of insufficient or low-quality SF6 data in the power industry, the prediction effect will be greatly reduced.
[0004] In the prior art, there is also an SF6 gas pressure prediction method that combines CNN and LSTM. The powerful feature extraction ability of CNN is used to capture short-term fluctuations and periodic changes in the data, and then the LSTM model is used to process the long-term and short-term dependencies in the data and further model the dynamic changes of the time series. Although CNN can effectively extract local features, it still has deficiencies in capturing global information and may miss some key global features, affecting the prediction effect. The simple combination of CNN and LSTM models can, to a certain extent, make up for their respective deficiencies, but still lacks the comprehensive processing ability for complex time series data. Especially in the face of long-term dependencies and multi-dimensional data, there is still room for improvement in the prediction effect of the model. Summary of the Invention
[0005] The object of the present invention is to solve the problems of low detection accuracy and poor timeliness of SF6 gas leakage in the prior art, and provide an SF6 gas leakage detection method based on PatchTST-ALSTM. By using a deep learning model to train historical gas pressure data, it can accurately predict the future pressure change trend of SF6 gas and improve the accuracy of prediction.
[0006] To achieve the above object, the present invention adopts the following technical solutions: An SF6 gas leakage detection method based on PatchTST-ALSTM, comprising the following steps: S1: Collect SF6 gas pressure data, preprocess and time-align the pressure data to obtain a time series; S2: Use PatchTST to perform chunking processing and feature mapping on the time series, and extract local and global features simultaneously; S3: Use global attention to dynamically weight the features of different time chunks; S4: Use LSTM to capture the long-term and short-term dependencies in the time series and output the SF6 gas pressure prediction result; S5: Analyze the prediction result to determine whether the SF6 gas leaks.
[0007] The present invention uses PatchTST to divide the time series into multiple small chunks (patches), and extracts local and global features simultaneously; integrates the attention mechanism to dynamically weight the features of different time periods, making PatchTST more flexible and accurate in capturing global information and avoiding model overfitting; as the time series progresses, LSTM can capture the long-term and short-term dependency information in the time series, accurately predict the future gas pressure change trend, improve the accuracy of prediction, and realize the effective monitoring and early warning of the GIS device status.
[0008] Preferably, the S4 includes: at each time step, LSTM sequentially updates the states of the forget gate, input gate, and output gate, and gradually updates the memory unit and hidden state; takes the output result of the global attention as the input of LSTM, and calculates the hidden state output by LSTM at the time step; maps the hidden state of the last time step to the final output to obtain the prediction result.
[0009] Preferably, the global attention is implemented through the self-attention mechanism in PatchTST: extracts features for each time chunk to capture the local features of the time chunk; calculates the dependency relationship between each time chunk to obtain the global features.
[0010] Preferably, the S3 includes: each head in the multi-head attention converts the feature mapping result of each time block into query, key, and value vectors; calculates the dot product between the query and key vectors to evaluate the correlation weights between time blocks; applies the correlation weights to the corresponding value vectors to perform weighted combination of the local features of each time block to capture global features; concatenates the results of all heads to obtain a time block sequence after being processed by the multi-head attention; uses the feature mapping result of the time block and the time block sequence as inputs for residual connection, where the output of the global residual connection serves as intermediate features.
[0011] Preferably, the input gate generates a new memory candidate unit, and updates the memory unit by using the forget gate and the memory unit of the previous moment, and the combination of the input gate and the new memory candidate unit.
[0012] Preferably, the S2 includes: dividing the time series into time blocks of a fixed size; using a linear projection matrix and a position encoding matrix to transform and map each time block into a Transformer latent representation space with a dimension of D to obtain the feature mapping result of each time block.
[0013] Preferably, the S1 includes: taking each variable in the multivariate time series as an independent channel and separately inputting them into the Backbone model of the Transformer to separately extract the features of each channel.
[0014] Preferably, the hidden state of the last time step is mapped to the final output through a fully connected layer, and the prediction result is the product of the hidden state of the last time step and the weight matrix of the fully connected layer plus the bias of the fully connected layer.
[0015] Preferably, the analysis of the prediction result includes: calculating the pressure value at the target temperature of the SF6 gas, calculating the deviation value between the prediction result and the pressure value at the target temperature, and if the deviation value is greater than a preset standard value, an alarm is issued.
[0016] Preferably, the data of the GIS room where SF6 gas leakage has occurred is selected as an actual case, and the missing data is filled by linear interpolation and random forest interpolation methods; the unevenly distributed time series features are merged and sorted according to the t time accuracy, and converted into a standard form suitable for the input of PatchTST.
[0017] Therefore, the present invention has the following beneficial effects: PatchTST is used to divide the time series into multiple small pieces (patches), while extracting local and global features; the integrated attention mechanism dynamically weights the features in different time periods, making PatchTST more flexible and accurate in capturing global information and avoiding overfitting of the PatchTST-ALSTM model; as the time series progresses, LSTM can capture the long-term and short-term dependence information in the time series, and can accurately predict the change trend of future gas pressure, improving the SF6 leakage detection accuracy. Description of the Drawings
[0018] Figure 1 It is the overall step flow chart of the SF6 gas leakage detection method based on PatchTST-ALSTM in the first embodiment.
[0019] Figure 2 It is the comparison chart of the predicted value and the true value based on PatchTST-ALSTM in the second embodiment. Detailed Embodiments
[0020] The present invention will be further described in detail below in conjunction with the drawings and the detailed embodiments: Embodiment 1: This embodiment provides an SF6 gas leakage detection method based on PatchTST-ALSTM. As Figure 1 shown, its operation process is as follows: Step 1, collect SF6 gas pressure data, preprocess and time merge the pressure data to obtain a time series; Step 2, use PatchTST to perform block processing and feature mapping on the time series, while extracting local and global features; Step 3, use global attention to dynamically weight the features of different time blocks; Step 4, use LSTM to capture the long-term and short-term dependence relationships in the time series, and output the SF6 gas pressure prediction result; Step 5, analyze the prediction result to determine whether the SF6 gas leaks.
[0021] PatchTST is a model based on the Transformer architecture, specifically used to process time series data. ALSTM is a long short-term memory network combined with an attention mechanism. The SF6 gas leakage detection method based on PatchTST-ALSTM provided in this embodiment uses PatchTST to divide the time series into multiple small pieces (patches), while extracting local and global features; the integrated attention mechanism dynamically weights the features in different time periods, making PatchTST more flexible and accurate in capturing global information and avoiding model overfitting; as the time series progresses, LSTM can capture the long-term and short-term dependence information in the time series, and can accurately predict the change trend of future SF6 gas pressure.
[0022] Next, through specific examples and specific application scenarios, the technical solutions and technical effects of the present invention will be further described. The following examples are explanations of the present invention, and the present invention is not limited to the following examples.
[0023] Specifically, as Figure 1 shown, a method for detecting SF6 gas leakage based on PatchTST-ALSTM specifically includes the following steps: The first step: Collect SF6 gas pressure data, preprocess and time merge the pressure data to obtain a time series.
[0024] Preprocessing and time merging the collected SF6 gas pressure data includes: collecting historical SF6 gas pressure data, filling in missing data through linear interpolation and random forest interpolation methods. Then, the unevenly distributed time series features are merged and sorted according to the t-time precision, and transformed into a standard form suitable for the input of the PatchTST-ALSTM model.
[0025] Construct a PatchTST-ALSTM model, divide the historical data after preprocessing and time merging into a training set, a test set, and a validation set according to a ratio of 7:2:1, and train the constructed model. Use the trained model to predict the SF6 pressure data based on the collected real-time data, and predict the SF6 change trend to determine whether the SF6 gas leaks. Among them, the input of the PatchTST-ALSTM model includes the collected SF6 gas pressure data, and the output is the predicted SF6 gas pressure data.
[0026] Next, the working process of the constructed PatchTST-ALSTM model will be further described.
[0027] The second step: Use PatchTST to perform chunking processing and feature mapping on the time series, and extract local and global features at the same time.
[0028] In traditional time series models, the data at each time step is directly input into the model. However, the PatchTST adopted in this embodiment introduces a chunk (patch) mechanism, which divides the time series into time chunks of a fixed size.
[0029] The specific process is as follows: Given a set of time series samples X∈R of length L L×D :(X1, X2,..., X L ), each time step contains D-dimensional features and is first divided into N equally long patch chunks. The calculation formula is:
[0030] Wherein, P represents the chunk length, and S represents the non-overlapping region between two consecutive patches.
[0031] During the chunking process, a patch sequence: x p (i) , x p (i) ∈R P×N , i = 1, ..., N.
[0032] Each patch is regarded as a token and is transformed through a trainable linear projection matrix W p (W p ∈R D×P ) and a learnable position encoding matrix W pos (W pos ∈R D×N ) to map the token transformation into the Transformer latent representation space with dimension D, obtaining the feature mapping result x d (i) , denoted as: x d (i) = W p x p (i) + W pos .
[0033] Among them, the main function of W p is to perform feature mapping or transformation, converting the sliced patch data into a form more suitable for Transformer processing; W pos is used to capture the temporal order information between patches.
[0034] Next, in the way of Channel-independence, each variable in the multivariate time series is processed as an independent channel. The data of each channel only contains a single-variable time series and is respectively input into the Backbone model of the Transformer to extract the features of each channel separately. This independent processing method can fully capture the feature differences between different dimensions, avoid mutual interference between dimensions, and thus more accurately extract the local and global information in each channel. By processing the data of each channel separately, the model's need to model the complex interaction relationships between channels can be reduced, thereby reducing the risk of overfitting. At the same time, by avoiding mixing the data of multiple channels, the computational complexity and memory usage of the model are reduced. With the patch operation, the number of tokens input into the Transformer architecture is reduced from L to L / S, while reducing memory usage and computational complexity.
[0035] Step 3: Dynamically weight the features of different time blocks using global attention.
[0036] The global attention mechanism can be implemented through the self-attention mechanism in PatchTST, including the introduction of a multi-head self-attention mechanism across patches and a global residual connection.
[0037] The model first extracts features from each block to capture its local features, and then obtains global information by calculating the dependencies between blocks. This process enables the model to not only consider the short-term fluctuations of SF6 gas temperature and pressure but also capture the long-term change trends.
[0038] (1) Multi-head self-attention mechanism.
[0039] For each head h = 1,..., H in the multi-head attention, the mapping results of the local patch features are transformed into query vectors, key vectors, and value vectors. The transformation process is as follows: Q h (i) =(x d (i) ) T W h Q , K h (i) =(x d (i) ) T W h K , V h (i) =(x d (i) ) T W h V .
[0040] Among them, is the h-th Q transformation matrix, is the h-th K transformation matrix, is the h-th V transformation matrix, is the output projection matrix, d k is the feature dimension of each head, and T is the matrix transpose operation.
[0041] By calculating the dot product between the query vector and the key vector, the model evaluates the correlation weights between each patch. Subsequently, the weights are applied to the corresponding value vectors to weightedly combine the local information of each patch, ultimately capturing the features in the global context.
[0042] The output of each head in the multi-head attention after processing the Patch sequence is P h (i) :
[0043] Concatenate the results of all heads to obtain the output P of the Patch sequence data after multi-head self-attention processing (i) : P (i) = Concat(P1 (i) , P2 (i) ,..., P h (i) )W O .
[0044] Among them, is a linear projection matrix that matches the dimension of the model to the feature dimension required for the downstream task
[0045] (2) Global residual connection
[0046] The global residual connection further enhances the stability and expressive power of the model. During the feature extraction process, by making a residual connection between the local features and the global information, the model can not only retain the details of the local information but also integrate the multi-scale change trends in the global context. Take the result x d (i) (i.e., the feature map result of each time block) mapped to the Transformer latent representation space and the sequence P (i) processed by the multi-head self-attention mechanism as inputs for residual connection, ensuring that the model does not solely rely on the output of self-attention but can also fully utilize the information of the original input features and maintain the integrity of the local feature information
[0047] The output of the global residual connection is used as the intermediate feature: Hidden global = x d (i) + P (i) .
[0048] The introduction of the global attention mechanism enhances the model's ability to model complex time series, thereby improving the accuracy and reliability of prediction
[0049] Step 4: Use LSTM to capture the long-term and short-term dependencies in the time series and output the SF6 gas pressure prediction result
[0050] At each time step t = (1, 2,..., T), LSTM sequentially updates the states of the forget gate, input gate, and output gate, and gradually updates the memory cell and hidden state. As the time series progresses, LSTM can capture the long-term and short-term dependency information in the time series
[0051] Take the output result of the global attention as the input of LSTM, and calculate the hidden state hi t: hi t = LSTM(Hidden global ).
[0052] The specific calculation process is as follows: (a) Forget gate.
[0053] The forget gate determines which information in the input data at the current moment no longer needs to be retained. The calculation formula is as follows: f t = σ(W f · [hi t-1 , Hidden glocal_t + b f ).
[0054] In the formula, f t is the output of the forget gate (f t ∈ [0, 1]), hi t-1 is the hidden state of the previous moment, Hidden global_t is the output from the global attention mechanism at the current moment, W f represents the weight matrix of the forget gate; b f represents the bias of the forget gate, and σ is the sigmoid activation function.
[0055] (b) Input gate.
[0056] The input gate determines which new data is added to the memory cell at the current moment. The calculation method is as follows: i t = σ(W i · [hi t-1 , Hidden global_t + b i ).
[0057] Among them, i t is the output value of the input gate, W i represents the weight matrix of the input gate, and b i represents the bias of the input gate.
[0058] At the same time, new candidate memory cell information New candidate memory cell information is as follows:
[0059] In the formula, W C represents the weight matrix for generating candidates for memory, and b C represents the bias for generating candidates for memory. Tanh, that is, the hyperbolic tangent function, is used as the activation function in this embodiment.
[0060] Update the memory cell.
[0061] Update the memory cell C through the combination of the forget gate and the input gate t , the updated memory cell is the sum of the product of the output value of the forget gate and the memory cell at the previous moment and the product of the output value of the input gate and the information of the new candidate memory cell, expressed as:
[0062] (d) Output gate.
[0063] The output gate is based on the current memory cell C t to generate the output, which determines the hidden state hi at the current moment t , and the calculation formula is as follows, where W o , b o are the weight matrix and bias of the output gate: o t =σ(W o ·[hi t-1 , Hidden global_t +b o ), hi t =o t ·tanh(C t ).
[0064] Map the hidden state hi at the last time step to the final output through the fully connected layer, that is, the predicted value of the SF6 gas pressure. That is: the predicted value of the SF6 gas pressure is the sum of the hidden state at the last time step and the weight matrix of the fully connected layer plus the bias of the fully connected layer: T In the formula,
[0065] where is the final predicted value of the SF6 gas pressure, W is the weight matrix of the fully connected layer, and b is the bias of the fully connected layer.
[0066] Step 5: Analyze the prediction results to determine whether the SF6 gas leaks.
[0067] When performing SF6 leakage analysis, the adiabatic equation of the gas is used to calculate the pressure value at the target temperature:
[0068] where P1 is the standard pressure of SF6 gas at 20°C; T1 is 20°C, which is converted to 293.15K; T2 is the target temperature; R is the SF6 gas constant, taking an approximate value of 0.000828 KJ / (kg·K); C p is the value of the specific heat capacity at normal pressure. For SF6 gas, an approximate value of 0.930 KJ / (kg·K) is taken.
[0069] Take the SF6 gas pressure value solved by the adiabatic equation as the standard reference data. At this time, the deviation of the SF6 gas pressure can be expressed as:
[0070] If the deviation of the SF6 gas pressure exceeds the preset standard value, it indicates that there may be gas leakage or other problems and an alarm needs to be issued.
[0071] Embodiment 2: This embodiment provides an SF6 gas leakage detection method for GIS equipment based on PatchTST-ALSTM, and applies it to a specific application scenario for SF6 gas leakage detection in GIS equipment.
[0072] Gas-insulated switchgear (GIS) is an important part of modern power systems. By sealing the key components of power equipment in a metal enclosure filled with sulfur hexafluoride gas (SF6), excellent electrical insulation and arc extinguishing performance are achieved. Sulfur hexafluoride is the key gas used in GIS equipment to provide insulation and arc extinguishing functions, and its stability directly affects the safety of power systems. Accurately predicting the SF6 pressure can timely warn of potential leakage risks, prevent equipment failures, and ensure the stable operation of power systems.
[0073] How to accurately predict the change of SF6 gas pressure and timely warn of potential leakage risks is still an important challenge for ensuring the safe operation of power systems. Traditional SF6 gas leakage detection mainly relies on the detection of physical sensors and regular maintenance inspections. However, these methods have lag and limitations, and it is difficult to fully meet the requirements of modern power systems for real-time and accuracy. Existing SF6 gas leakage detection methods not only have low detection accuracy but also lack the ability to comprehensively process complex time-series data. Therefore, the project team decided to adopt an SF6 gas leakage detection method based on PatchTST-ALSTM. For the SF6 gas leakage problem in GIS equipment, a deep learning model is used to train historical gas pressure data, combined with PatchTST, global attention mechanism, and LSTM, to accurately predict the future change trend of gas pressure. By introducing memory units, LSTM overcomes the problems of gradient disappearance and gradient explosion existing in traditional RNNs in long-sequence data and can better handle the complex changes of SF6 gas pressure in GIS equipment.
[0074] Specifically, for the SF6 gas leakage detection method based on PatchTST-ALSTM provided in this embodiment, the overall algorithm process of the model is as follows: Step 1: Collect SF6 gas pressure data, preprocess and time-align the pressure data to obtain a time series.
[0075] In this embodiment, the data of the GIS room where SF6 gas leakage occurred in a certain substation is selected as an actual case, and the missing data is filled by linear interpolation and random forest interpolation methods. Subsequently, the unevenly distributed time series features are merged and sorted according to the hourly accuracy, and transformed into a standard form suitable for the input of the PatchTST-ALSTM model, so as to train the model and use the model for subsequent SF6 gas pressure prediction.
[0076] When training the PatchTST-ALSTM model, it includes: loading the training data from the segmented training set file, and the data in the training set consists of two columns, namely time and SF6 pressure data; setting the hyperparameters of the PatchTST-ALSTM model and enabling CUDA to accelerate the training; after the training is completed, the PatchTST-ALSTM model will be saved to the specified output directory for subsequent loading and use.
[0077] Step 2: PatchTST performs chunking processing and feature mapping, and extracts local and global features simultaneously.
[0078] The PatchTST model regards each sequence in the multivariate sequence as an independent sample, inputs the univariate sequence into the model backbone (Transformer encoder), learns the temporal dependence relationship through the attention mechanism, and finally concatenates the outputs of different variables. The PatchTST model extracts features through the Transformer backbone and uses channel independence to process the multivariate time series, enabling each variable to be predicted independently.
[0079] Step 3: The global attention mechanism dynamically weights the features in different time periods, making PatchTST more flexible and accurate in capturing global information and avoiding model overfitting.
[0080] Step 4: LSTM captures long-term and short-term dependence relationships.
[0081] Step 5: The fully connected layer outputs the prediction result.
[0082] Step 6: SF6 leakage analysis. According to the empirical rule, if the SF6 gas pressure deviation (the absolute value of the difference between the predicted value and the standard reference data) exceeds 0.02 MPa (the predicted value is higher or lower than the standard reference data), it may indicate that there is air leakage or other problems in the GIS equipment.
[0083] In this embodiment, the Beattie-Bridgeman empirical formula is used to calculate the SF6 gas state parameters. Beattie-Bridgeman is a modification based on the ideal gas state equation and may more accurately describe the behavior of non-ideal gases.
[0084] A method for detecting SF6 gas leakage based on PatchTST-ALSTM provided by this embodiment has the following beneficial effects: PatchTST is used to divide the time series into multiple small pieces (patches), and local and global features are extracted simultaneously; an integrated attention mechanism is used to dynamically weight the features in different time periods, making PatchTST more flexible and accurate in capturing global information and avoiding model overfitting; as the time series progresses, LSTM can capture long-term and short-term dependence information in the time series, which can improve the accuracy of SF6 gas pressure prediction.
[0085] In this embodiment, the predicted value based on PatchTST-ALSTM is compared with the true value as Figure 2 shown. It can be seen that the change trends of the predicted value and the true value are basically the same, and the deviation between the predicted value and the true value is basically within 0.05, and the prediction is relatively accurate.
[0086] This embodiment also provides a system for detecting SF6 gas leakage based on PatchTST-ALSTM, including: a data acquisition module, a data processing module, a pressure prediction module, a gas leakage analysis module, and a client terminal. The data acquisition module is connected to the data processing module, the data processing module is connected to the pressure prediction module, the pressure prediction module is connected to the gas leakage analysis module, and the gas leakage analysis module is connected to the client terminal through wireless communication.
[0087] Specifically: The data acquisition module is used to collect real-time SF6 gas pressure data and GIS room data where SF6 gas leakage has occurred in a certain substation. The data acquisition module includes an SF6 pressure gauge.
[0088] The data processing module preprocesses the data collected by the data acquisition module, including filling in the missing data by linear interpolation and random forest interpolation methods. The time series features with uneven distribution are merged and sorted according to the hourly accuracy, and are transformed into a standard form suitable for input into the prediction model in the pressure prediction module.
[0089] The pressure prediction module establishes and trains a PatchTST-ALSTM model, and uses the PatchTST-ALSTM model to predict the SF6 pressure in the future. The PatchTST-ALSTM model includes PatchTST, a global attention mechanism, and LSTM.
[0090] The air leakage analysis module compares the prediction result of the pressure prediction module with the pressure value at the target temperature of the SF6 gas to determine whether SF6 air leakage occurs. When air leakage occurs, it sends an alarm message to the customer terminal. The alarm message includes the current time, the SF6 pressure data collected at the current time, the predicted SF6 pressure value, and the air leakage analysis result. If no SF6 air leakage occurs, the air leakage analysis module sends the current time and the SF6 pressure data collected at the current time to the customer terminal.
[0091] The customer terminal is used to receive the alarm message and the SF6 pressure data from the air leakage analysis module, and simultaneously draw the SF6 pressure change curve.
[0092] The above-described embodiments are only a preferred solution of the present invention and do not impose any form of limitation on the present invention. There are other variations and modifications without exceeding the technical solutions described in the claims.
Claims
1. A method for detecting SF6 gas leakage based on PatchTST-ALSTM, characterized in that, Including: S1: Collect SF6 gas pressure data, preprocess the pressure data and perform time merging to obtain a time series; S2: Use PatchTST to perform chunking processing and feature mapping on the time series, and extract local features and global features simultaneously; S3: Use global attention to dynamically weight the features of different time chunks; S4: Use LSTM to capture long-term and short-term dependencies in the time series and output the SF6 gas pressure prediction result; S5: Analyze the prediction result to determine whether the SF6 gas leaks.
2. The SF6 gas leakage detection method based on PatchTST-ALSTM according to claim 1, wherein The S4 includes: At each time step, LSTM sequentially updates the states of the forget gate, input gate, and output gate, and gradually updates the memory cell and hidden state; uses the output result of global attention as the input of LSTM, and calculates the hidden state output by LSTM at the time step; maps the hidden state of the last time step to the final output to obtain the prediction result.
3. A method for detecting SF6 gas leakage based on PatchTST-ALSTM according to claim 1, characterized in that, Global attention is implemented through the self-attention mechanism in PatchTST: Extract features for each time chunk to capture the local features of the time chunk; calculate the dependencies between time chunks to obtain global features.
4. A method for detecting SF6 gas leakage based on PatchTST-ALSTM according to claim 1 or 2 or 3, characterized in that The S3 includes: Each head in the multi-head attention converts the feature mapping result of each time chunk into a query vector, key vector, and value vector; calculates the dot product between the query vector and the key vector to evaluate the correlation weights between time chunks; applies the correlation weights to the corresponding value vectors to perform weighted combination of the local features of each time chunk to capture global features; concatenates the results of all heads to obtain a time chunk sequence after multi-head attention processing; uses the feature mapping result of the time chunk and the time chunk sequence as inputs for residual connection, and the output of the global residual connection is used as the intermediate feature.
5. The SF6 gas leakage detection method based on PatchTST-ALSTM according to claim 2, characterized in that, The input gate generates a new memory candidate unit, and uses the combination of the forget gate, the memory unit at the previous moment, the input gate, and the new memory candidate unit to update the memory unit.
6. A method for detecting SF6 gas leakage based on PatchTST-ALSTM according to claim 1 or 2 or 3 or 5, characterized in that, The S2 includes: Divide the time series into time chunks of a fixed size; use a linear projection matrix and a position encoding matrix to transform and map each time chunk into a Transformer latent representation space with a dimension of D to obtain the feature mapping result of each time chunk.
7. A method for detecting SF6 gas leakage based on PatchTST-ALSTM according to claim 2 or 5, characterized in that, Map the hidden state of the last time step to the final output through a fully connected layer, and the prediction result is the product of the hidden state of the last time step and the weight matrix of the fully connected layer plus the bias of the fully connected layer.
8. A method for detecting SF6 gas leakage based on PatchTST-ALSTM according to claim 1 or 2 or 3 or 5, characterized in that, Analyzing the prediction result includes: Calculating the pressure value at the target temperature of the SF6 gas, calculating the deviation value between the prediction result and the pressure value at the target temperature, and if the deviation value is greater than the preset standard value, an alarm is issued.
9. A method for detecting SF6 gas leakage based on PatchTST-ALSTM according to claim 1 or 2 or 3 or 5, characterized in that The S1 includes: Take each variable in the multivariate time series as an independent channel and input them into the Backbone model of Transformer separately to extract the features of each channel.
10. A method for detecting SF6 gas leakage based on PatchTST-ALSTM according to claim 1 or 2 or 3 or 5, characterized in that Select the data of the GIS room where SF6 gas leakage has occurred, and fill in the missing data by linear interpolation and random forest interpolation methods; merge and organize the unevenly distributed time series features according to the t-time precision, and convert them into the standard form suitable for the input of PatchTST.
Citation Information
Patent Citations
Security prediction method based on multivariable long-term and short-term memory network remote detection
CN112232597A