Gas concentration anomaly detection method and system, electronic equipment and storage medium
By incorporating a bidirectional gated cyclic unit autoencoder model with an embedded attention mechanism, combined with historical data and squared error analysis, gas concentration anomalies are identified. This solves the problems of complex variation patterns and sensor errors in existing technologies, and achieves highly accurate gas concentration anomaly detection.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HUAAN XINGCHEN (BEIJING) SENSING TECHNOLOGY CO LTD
- Filing Date
- 2025-12-12
- Publication Date
- 2026-05-08
AI Technical Summary
Existing gas concentration detection methods cannot effectively identify anomalies in complex change patterns and simple trend anomalies, and have failed to effectively reduce detection errors caused by random sensor malfunctions.
A bidirectional gated cyclic unit autoencoder model with an embedded attention mechanism is used. By combining historical gas concentration data and squared error data, the model identifies abnormalities in gas concentration magnitude, trend, and pattern through sequence reconstruction and anomaly detection algorithms, and issues an alarm when the abnormality ratio reaches a threshold.
It effectively reduces errors caused by random sensor malfunctions, improves the accuracy and reliability of gas concentration anomaly detection, and can comprehensively identify gas concentration anomalies.
Smart Images

Figure CN121995001A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of gas concentration detection technology, and in particular to a method, system, electronic device, and storage medium for detecting abnormal gas concentrations. Background Technology
[0002] In the field of gas concentration detection, time-series anomaly detection technology plays a crucial role. This technology learns the changing patterns of historical time-series data to determine whether there are anomalies in the current sequence. However, existing detection methods have two main drawbacks: First, statistical discrimination methods can only detect significant anomalies in gas concentration magnitude and simple trends, failing to identify anomalies in complex changing patterns. Second, while deep learning methods excel at capturing complex patterns, they often fail to accurately detect simple trend anomalies. Furthermore, most existing methods discriminate based on gas concentration at a single moment, ignoring detection errors that may be caused by random sensor malfunctions, which reduces the reliability of the algorithms.
[0003] Therefore, there is an urgent need to provide a technical solution to address the above problems. Summary of the Invention
[0004] To address the aforementioned technical problems, this invention provides a method, system, electronic device, and storage medium for detecting abnormal gas concentrations.
[0005] In a first aspect, the present invention provides a method for detecting abnormal gas concentrations, the technical solution of which is as follows: Obtain the current gas concentration sequence of the target area; Based on the historical gas concentration data of the target area, anomalies in the gas concentration at each moment in the current gas concentration sequence are detected; Based on the historical gas concentration change trend data of the target area, anomalies in the gas concentration change trend at each moment in the current gas concentration sequence are detected. An autoencoder model with a bidirectional gated recurrent unit embedded with an attention mechanism is used to reconstruct the current gas concentration sequence to obtain a reconstructed sequence. Calculate the squared error sequence between the reconstructed sequence and the current gas concentration sequence, the squared error sequence containing the squared error at each time step; Based on the historical squared error data of the target area, anomalies in the gas concentration change patterns in the squared error sequence are detected. The number of abnormal moments in the current gas concentration sequence is counted; wherein, if any moment in the current gas concentration sequence is determined to have at least one of the following: abnormal gas concentration magnitude, abnormal gas concentration change trend, or abnormal gas concentration change pattern, then that moment is counted as an abnormal moment. An alarm is triggered when the proportion of the number of abnormal moments in the total number of moments in the current gas concentration sequence exceeds a preset alarm threshold.
[0006] The beneficial effects of the gas concentration anomaly detection method of the present invention are as follows: The method of the present invention can effectively reduce the error caused by random sensor failures and improve the accuracy and reliability of gas concentration anomaly detection.
[0007] Based on the above scheme, the gas concentration anomaly detection method of the present invention can be further improved as follows.
[0008] In one alternative approach, the step of detecting anomalies in gas concentration at each moment in the current gas concentration sequence based on historical gas concentration data of the target area includes: Determine whether any moment in the current gas concentration sequence meets a first preset condition; if so, determine that there is an anomaly in gas concentration at that moment; wherein, the first preset condition is: or ; Indicates the first in the current gas concentration sequence The actual gas concentration value at any given time. This represents the average concentration calculated based on the historical gas concentration data. This represents the standard deviation of the concentration calculated based on the historical gas concentration data; Repeat the step of determining whether the first preset condition is met at any time in the current gas concentration sequence until the detection of abnormal gas concentration at each time in the current gas concentration sequence is completed.
[0009] In one optional approach, the step of detecting anomalies in the gas concentration change trend at each moment in the current gas concentration sequence based on historical gas concentration change trend data of the target area includes: Calculate the gas concentration change trend value at any time in the current gas concentration sequence, and determine whether the gas concentration change trend value at that time meets a second preset condition. If so, determine that there is an abnormal gas concentration change trend at that time; wherein, the second preset condition is: or ; Indicates the first in the current gas concentration sequence The trend of gas concentration change at any given time. ; This represents the average value of the change trend calculated based on the historical gas concentration change trend data. This represents the standard deviation of the change trend calculated based on the historical gas concentration change trend data; Repeat the steps of calculating the gas concentration change trend value at any time in the current gas concentration sequence and determining whether the gas concentration change trend value at that time meets the second preset condition, until the detection of abnormal gas concentration change trends at each time in the current gas concentration sequence is completed.
[0010] In one alternative approach, the step of reconstructing the current gas concentration sequence using an autoencoder model employing an embedded attention mechanism and a bidirectional gated recurrent unit to obtain a reconstructed sequence includes: The current gas concentration sequence is processed by the bidirectional gated loop unit in the encoder of the autoencoder model to obtain the hidden state of the encoder at all times; The hidden state of the decoder of the autoencoder model at the previous time step is used as the query, and the hidden states of the encoder at all time steps are used as the key. The attention weights are calculated through the attention mechanism in the autoencoder model. The hidden states of the encoder at all times are weighted based on the attention weights to generate a context vector; The hidden states of the decoder at all times are obtained by processing the context vector and the hidden state of the encoder through the bidirectional gated loop unit in the decoder. The reconstructed sequence is obtained by processing the hidden states of the decoder at all times using a multilayer perceptron in the autoencoder model.
[0011] In one alternative approach, the step of calculating the squared error sequence between the reconstructed sequence and the current gas concentration sequence includes: The square of the difference between the reconstructed gas concentration value at any moment in the reconstructed sequence and the actual gas concentration value at that moment in the current gas concentration sequence is calculated as the squared error at that moment. Repeat the step of calculating the square of the difference between the reconstructed gas concentration value at any time in the reconstructed sequence and the actual gas concentration value at that time in the current gas concentration sequence, as the square error at that time, until the square error at each time is obtained; Arrange the squared errors at all times in chronological order to form the squared error sequence.
[0012] In one alternative approach, the step of detecting anomalous gas concentration change patterns in the squared error sequence based on historical squared error data of the target region includes: Determine whether the squared error at any moment in the squared error sequence satisfies a third preset condition. If so, determine that there is an abnormal gas concentration change pattern at that moment. The third preset condition is: or ; Represents the first in the squared error sequence The squared error at time , This represents the mean of the squared errors calculated based on the historical squared error data. This represents the standard deviation of the squared error calculated based on the historical squared error data; Repeat the step of determining whether the square error at any time in the square error sequence meets the third preset condition until the abnormal gas concentration change pattern at each time in the square error sequence is detected.
[0013] In one optional approach, the step of triggering an alarm when the proportion of the number of abnormal moments in the total number of moments in the current gas concentration sequence exceeds a preset alarm threshold includes: Calculate the ratio of the number of abnormal moments to the total number of moments in the current gas concentration sequence to obtain the current abnormality ratio; When the current abnormality ratio is greater than the preset alarm threshold, an alarm signal is generated and output; wherein, the current gas concentration sequence is a continuously collected monitoring data sequence of a fixed time length.
[0014] Secondly, the present invention provides a gas concentration anomaly detection system, the technical solution of which is as follows: It includes: a data acquisition module, a first detection module, a second detection module, a reconstruction module, a calculation module, a third detection module, a statistics module, and an early warning module; The acquisition module is used to: acquire the current gas concentration sequence of the target area; The first detection module is used to: detect anomalies in the gas concentration at each moment in the current gas concentration sequence based on historical gas concentration data of the target area; The second detection module is used to: detect abnormalities in the gas concentration change trend at each moment in the current gas concentration sequence based on the historical gas concentration change trend data of the target area; The reconstruction module is used to: reconstruct the current gas concentration sequence using a bidirectional gated recurrent unit autoencoder model with an embedded attention mechanism to obtain a reconstructed sequence; The calculation module is used to: calculate the squared error sequence between the reconstructed sequence and the current gas concentration sequence, wherein the squared error sequence contains the squared error at each time step; The third detection module is used to: detect abnormal gas concentration change patterns in the square error sequence based on historical square error data of the target area; The statistics module is used to: count the number of abnormal moments in the current gas concentration sequence; wherein, if any moment in the current gas concentration sequence is determined to have at least one of the following: abnormal gas concentration magnitude, abnormal gas concentration change trend, or abnormal gas concentration change pattern, then that moment is counted as an abnormal moment. The early warning module is used to issue an alarm when the proportion of the number of abnormal moments in the total number of moments in the current gas concentration sequence exceeds a preset alarm threshold.
[0015] The beneficial effects of the gas concentration anomaly detection system of the present invention are as follows: The system of this invention can effectively reduce errors caused by random sensor failures and improve the accuracy and reliability of gas concentration anomaly detection.
[0016] Thirdly, the technical solution of an electronic device according to the present invention is as follows: The invention includes a memory, a processor, and a program stored in the memory and running on the processor, wherein the processor executes the program to implement the steps of the gas concentration anomaly detection method of the present invention.
[0017] Fourthly, the technical solution of a computer-readable storage medium provided by the present invention is as follows: The computer-readable storage medium stores instructions that, when read, cause the computer-readable storage medium to perform the steps of the gas concentration anomaly detection method of the present invention.
[0018] The above description is merely an overview of the technical solution of the present invention. In order to better understand the technical means of the present invention and to implement it in accordance with the contents of the specification, and in order to make the above and other objects, features and advantages of the present invention more apparent and understandable, specific embodiments of the present invention are described below. Attached Figure Description
[0019] The accompanying drawings are for illustrative purposes only and are not intended to limit the invention. Furthermore, the same reference numerals denote the same parts throughout the drawings. In the drawings: Figure 1 This is a schematic flowchart of an embodiment of a gas concentration anomaly detection method of the present invention; Figure 2 This is a schematic diagram of the structure of an autoencoder model; Figure 3 This is a schematic diagram of an embodiment of a gas concentration anomaly detection system according to the present invention; Figure 4 This is a schematic diagram of an embodiment of an electronic device according to the present invention. Detailed Implementation
[0020] Exemplary embodiments of the invention will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of the invention are shown in the drawings, it should be understood that the invention can be implemented in various forms and should not be limited to the embodiments set forth herein.
[0021] Figure 1 This diagram illustrates a flowchart of an embodiment of a gas concentration anomaly detection method provided by the present invention. This method can be executed by an electronic device such as a terminal device or a server. The terminal device can be any fixed or mobile terminal, such as a user equipment (UE), mobile device, user terminal, terminal, cellular phone, cordless phone, personal digital assistant (PDA), handheld device, computing device, in-vehicle device, or wearable device. The server can be a single server or a server cluster consisting of multiple servers. Any electronic device can implement the gas concentration anomaly detection method by having its processor call computer-readable instructions stored in its memory. Figure 1 As shown, it includes the following steps: S1. Obtain the current gas concentration sequence of the target area.
[0022] The target area refers to the specific spatial range for gas concentration monitoring; for example, the interior space of a civil defense project is the target area. The current gas concentration sequence refers to a set of the latest gas concentration measurements collected continuously in chronological order within the target area; for example, radon concentration values collected once per second over the past 60 seconds are arranged in chronological order to form a current gas concentration sequence.
[0023] S2. Based on the historical gas concentration data of the target area, detect anomalies in the gas concentration at each moment in the current gas concentration sequence.
[0024] Historical gas concentration data refers to the collection and storage of gas concentration measurements over a past period in the target area; for example, a database of radon concentration values collected every minute in the civil defense project over the past three months. Anomalies in gas concentration magnitude refer to situations where the current gas concentration value deviates significantly from the historical average; for example, the current radon concentration value suddenly exceeds three standard deviations of the historical average.
[0025] S3. Based on the historical gas concentration change trend data of the target area, detect abnormalities in the gas concentration change trend at each moment in the current gas concentration sequence.
[0026] Historical gas concentration trend data refers to statistical information on the concentration difference between adjacent moments calculated based on historical gas concentration data; for example, the mean and standard deviation of the minute-by-minute change in radon concentration over the past three months. An abnormal gas concentration trend refers to a significant difference between the current rate of change and historical patterns; for example, the current change in radon concentration within one second exceeds three times the standard deviation of historical changes.
[0027] S4. An autoencoder model with a bidirectional gated recurrent unit embedded with an attention mechanism is used to reconstruct the current gas concentration sequence to obtain a reconstructed sequence.
[0028] The attention mechanism refers to a weighted calculation module in a neural network used to highlight important features of the input sequence; for example, when processing a 60-second radon concentration sequence, this attention mechanism can automatically increase the weight of the concentration mutation point at the 30th second. The bidirectional gated recurrent unit refers to a recurrent neural network unit capable of learning time-series features simultaneously from both forward and backward directions; for example, a recurrent neural network unit can be used to simultaneously analyze the variation patterns of the radon concentration sequence from beginning to end and from end to beginning. The autoencoder model refers to a neural network model that compresses the input sequence features through an encoder and then reconstructs the output through a decoder; for example, a neural network structure that compresses a 60-second radon concentration sequence into a feature vector and then restores it to 60 reconstructed values. The reconstructed sequence refers to a simulated gas concentration sequence generated by the autoencoder model based on the learned normal pattern; for example, a sequence consisting of 60 simulated concentration values generated by the autoencoder model based on a normal radon concentration pattern.
[0029] S5. Calculate the squared error sequence between the reconstructed sequence and the current gas concentration sequence, wherein the squared error sequence contains the squared error at each time step.
[0030] The squared error sequence refers to a sequence formed by arranging the squares of the differences between the reconstructed sequence and the current gas concentration sequence at each time point in chronological order; for example, the squares of the differences between the reconstructed and actual radon concentration values at each of the 60 time points are arranged in chronological order. The squared error refers to the square of the difference between the reconstructed and actual gas concentration values at a given time point; for example, the reconstructed radon concentration value at second 30 is 150 Bq / m³. 3 The actual value is 180 Bq / m 3 At that time, the squared error is 900.
[0031] S6. Based on the historical squared error data of the target area, detect abnormal gas concentration change patterns in the squared error sequence.
[0032] Historical squared error data refers to the statistical information of the squared errors generated when the autoencoder model is trained on historical normal data; for example, the mean and standard deviation of the squared errors generated when the autoencoder model is trained on historical normal radon data. Anomaly in gas concentration variation patterns refers to a significant deviation between the variation pattern of the gas concentration sequence and the learned normal pattern; for example, radon concentration exhibiting unusual fluctuations not seen in the past.
[0033] S7. Count the number of abnormal moments in the current gas concentration sequence; wherein, if any moment in the current gas concentration sequence is determined to have at least one of the following: abnormal gas concentration magnitude, abnormal gas concentration change trend, or abnormal gas concentration change pattern, then that moment is counted as an abnormal moment.
[0034] The number of anomalous moments refers to the total number of moments identified as anomalous in the current gas concentration sequence; for example, 15 moments in a 60-second radon concentration sequence are marked as anomalous. The total number of moments in the current gas concentration sequence refers to the total number of sampling points included in the current gas concentration sequence; for example, a 60-second radon concentration sequence, sampled once per second, contains 60 moments.
[0035] S8. When the proportion of the number of abnormal moments in the total number of moments in the current gas concentration sequence exceeds a preset alarm threshold, an alarm is triggered.
[0036] The preset alarm threshold refers to the lower limit of the abnormal proportion required to trigger an alarm; for example, setting an alarm to be triggered when the abnormal proportion exceeds 25%.
[0037] The technical solution of this embodiment can effectively reduce the error caused by random sensor failures and improve the accuracy and reliability of gas concentration anomaly detection.
[0038] In one alternative approach, S2 specifically includes: Determine whether any moment in the current gas concentration sequence meets the first preset condition; if so, determine that there is an abnormal gas concentration at that moment.
[0039] The first preset condition is: or ; Indicates the first in the current gas concentration sequence The actual gas concentration value at any given time. This represents the average concentration calculated based on the historical gas concentration data. This represents the standard deviation of the concentration calculated based on the historical gas concentration data.
[0040] Repeat the step of determining whether the first preset condition is met at any time in the current gas concentration sequence until the detection of abnormal gas concentration at each time in the current gas concentration sequence is completed.
[0041] Among the above-mentioned optional methods, the detection accuracy of abnormal gas concentration has been further optimized. By using the mean and standard deviation of historical gas concentration data and a judgment condition of 3 times the standard deviation, gas concentration values that deviate from the normal range can be effectively identified, reducing the false alarm rate.
[0042] In one alternative approach, S3 specifically includes: Calculate the gas concentration change trend value at any time in the current gas concentration sequence, and determine whether the gas concentration change trend value at that time meets the second preset condition. If so, it is determined that there is an abnormal gas concentration change trend at that time.
[0043] The second preset condition is: or ; Indicates the first in the current gas concentration sequence The trend of gas concentration change at any given time. ; This represents the average value of the change trend calculated based on the historical gas concentration change trend data. This represents the standard deviation of the change trend calculated based on the historical gas concentration change trend data.
[0044] Repeat the steps of calculating the gas concentration change trend value at any time in the current gas concentration sequence and determining whether the gas concentration change trend value at that time meets the second preset condition, until the detection of abnormal gas concentration change trends at each time in the current gas concentration sequence is completed.
[0045] Among the above-mentioned optional methods, the ability to detect abnormal gas concentration change trends is further improved. The mean and standard deviation are calculated based on historical gas concentration change trend data to accurately determine whether the current gas concentration change trend is abnormal, thereby enhancing the early warning effect of concentration mutations.
[0046] In one alternative approach, S4 specifically includes: The current gas concentration sequence is processed by the bidirectional gated loop unit in the encoder of the autoencoder model to obtain the hidden state of the encoder at all times.
[0047] In this context, the encoder in an autoencoder model refers to the neural network portion that converts the input sequence into a feature representation; for example, a bidirectional gated recurrent unit network that converts 60 radon concentration values into a 128-dimensional feature vector. The hidden states of the encoder at all times refer to the intermediate feature representations generated at each time step as the encoder processes the input sequence; for example, the 128-dimensional feature vector generated per second as the encoder processes a 60-second radon concentration sequence.
[0048] The hidden state of the decoder in the previous time step is used as the query, and the hidden states of the encoder at all time steps are used as the key. Attention weights are calculated through the attention mechanism in the autoencoder model.
[0049] In this context, the decoder of the autoencoder model refers to the neural network part of the autoencoder that reconstructs the output sequence based on feature representations; for example, a bidirectional gated recurrent unit network that restores a 128-dimensional feature vector to 60 radon concentration values. The hidden state of the decoder at the previous time step refers to the internal state information retained by the decoder when generating the output from the previous time step; for example, the 128-dimensional state vector generated when the decoder generates the reconstructed radon concentration value at time 29. Attention weights are coefficients representing the importance of the hidden states of the encoder at each time step to the current decoding; for example, the different weight coefficients assigned to the 60 hidden states of the encoder when decoding at time 30.
[0050] The hidden states of the encoder at all times are weighted based on the attention weights to generate a context vector.
[0051] The context vector refers to the feature vector obtained by weighting and summing the hidden states of the encoder according to the attention weights; for example, the 128-dimensional feature vector obtained by weighting and fusing the hidden states of the encoder at 60 time steps.
[0052] The hidden states of the decoder at all times are obtained by processing the context vector and the hidden state of the encoder through the bidirectional gated loop unit in the decoder.
[0053] The hidden state of the decoder at all times refers to the intermediate feature representation generated at each time step when the decoder generates the reconstructed sequence; for example, the 128-dimensional state vector generated per second when the decoder generates the 60-second radon concentration reconstructed sequence.
[0054] The reconstructed sequence is obtained by processing the hidden states of the decoder at all times using a multilayer perceptron in the autoencoder model.
[0055] Among them, a multilayer perceptron refers to a neural network structure consisting of fully connected layers and activation functions; for example, a three-layer fully connected network that maps the state of a 128-dimensional decoder to a one-dimensional gas concentration value.
[0056] Specifically, the anomaly detection of gas concentration change patterns employs a bidirectional gated recurrent unit autoencoder model with an embedded attention mechanism to reconstruct the current gas concentration sequence, and identifies anomalies by comparing the differences between the reconstructed sequence and the current gas concentration sequence. For example... Figure 2 As shown, the autoencoder model consists of three main parts: an encoder, an attention mechanism, and a decoder. The encoder section employs a bidirectional gated cyclic unit to process the current gas concentration sequence and extract temporal features. Specifically, for the forward sequence, at time... Update Gate Through formula The calculation is performed, and for the reverse sequence, at time... Update Gate Through formula Calculation. Meanwhile, the forward sequence at time... Reset door Through formula Calculate the reverse sequence at time [time]. Reset door Through formula Calculation. Based on the update gate and reset gate, the forward sequence at time... Hidden state Through formula Calculate the reverse sequence at time [time]. Hidden state Through formula Calculations. In these formulas, subscripts... Represents the computed variables of the encoder. All are learnable parameters. This represents the input features at the current moment. Representing contextual features, symbols This represents the vector concatenation operation, with the symbol... This indicates element-wise multiplication.
[0057] The attention mechanism uses the decoder's hidden state from the previous time step as the query and the encoder's hidden states from all time steps as the keys to calculate the attention weights. Specifically, the forward query vector... Through formula Calculate the reverse lookup vector Through formula Calculate; forward bond vector Through formula Calculate the reverse key vector Through formula Calculation. Next, the attention weights are calculated using dot product, resulting in the positive attention weight matrix. Through formula Calculate the reverse attention weight matrix. Through formula Calculation. Based on attention weights, positive context vector. Through formula Calculate the inverse context vector. Through formula calculate. The computed variables of the decoder, It is the hidden state of the decoder in the previous moment. It represents the hidden state of the encoder at all times. It is the dimension of the vector. These are learnable parameters.
[0058] The decoder combines the context vector and the encoder's hidden state to reconstruct the sequence using a bidirectional gated recurrent unit. Specifically, the forward decoder's hidden state... Through formula Calculate the hidden state of the inverse decoder Through formula Calculation. Finally, the decoder's hidden state is processed through a multilayer perceptron, and the output time step is determined. Gas concentration reconstruction value Through formula The computation is performed, where MLP stands for Multilayer Perceptron Network.
[0059] Through the above calculation process, the autoencoder model can learn the normal variation pattern of the gas concentration sequence and generate a reconstructed sequence corresponding to the current gas concentration sequence.
[0060] Among the above-mentioned optional methods, the accuracy of gas concentration sequence reconstruction is further enhanced by adopting a bidirectional gated recurrent unit autoencoder model with embedded attention mechanism to fully explore the characteristics of gas concentration sequence and generate a reconstruction sequence that is closer to the real situation, providing a reliable basis for subsequent anomaly detection.
[0061] In one alternative approach, S5 specifically includes: The square of the difference between the reconstructed gas concentration value at any moment in the reconstructed sequence and the actual gas concentration value at that moment in the current gas concentration sequence is calculated as the squared error at that moment.
[0062] The reconstructed gas concentration value refers to the gas concentration estimate output by the autoencoder model; for example, the model's estimate of 155 Bq / m³ for radon concentration at the 30th second. 3 The actual gas concentration value refers to the gas concentration value actually measured by the sensor; for example, the radon concentration actually measured at 30 seconds is 180 Bq / m³. 3 .
[0063] Repeat the step of calculating the squared difference between the reconstructed gas concentration value at any time in the reconstructed sequence and the actual gas concentration value at that time in the current gas concentration sequence, as the squared error at that time, until the squared error at each time is obtained.
[0064] Arrange the squared errors at all times in chronological order to form the squared error sequence.
[0065] Among the above-mentioned optional methods, the efficiency and accuracy of squared error sequence calculation are further improved. The values of the reconstructed sequence and the current gas concentration sequence at each time point are compared one by one, the squared difference is calculated and arranged in chronological order to form a complete squared error sequence, providing fine data support for anomaly pattern detection.
[0066] In one alternative embodiment, S6 specifically includes: Determine whether the squared error at any moment in the squared error sequence meets the third preset condition. If so, determine that there is an abnormal gas concentration change pattern at that moment.
[0067] The third preset condition is: or ; Represents the first in the squared error sequence The squared error at time , This represents the mean of the squared errors calculated based on the historical squared error data. This represents the standard deviation of the squared error calculated based on the historical squared error data.
[0068] Repeat the step of determining whether the square error at any time in the square error sequence meets the third preset condition until the abnormal gas concentration change pattern at each time in the square error sequence is detected.
[0069] Among the above-mentioned optional methods, the detection effect of gas concentration change anomalies has been further optimized. Based on the mean and standard deviation of historical squared error data, anomalies in the squared error sequence are accurately identified, and special fluctuation patterns of gas concentration changes are effectively discovered, thereby improving the comprehensiveness of anomaly detection.
[0070] In one alternative approach, S8 specifically includes: The ratio of the number of abnormal moments to the total number of moments in the current gas concentration sequence is calculated to obtain the current abnormality ratio.
[0071] The current anomaly ratio refers to the percentage of anomaly moments in the total number of moments in the current gas concentration sequence; for example, a 25% anomaly ratio corresponding to 15 anomaly moments in a 60-second sequence.
[0072] When the current abnormality ratio is greater than the preset alarm threshold, an alarm signal is generated and output.
[0073] The current gas concentration sequence is a continuously collected monitoring data sequence of a fixed time length. An alarm signal refers to an abnormal alarm indication; for example, displaying a red warning sign and emitting a buzzer sound on the monitoring interface.
[0074] Among the above-mentioned optional methods, the statistical and alarm mechanism for anomaly detection has been further improved. The number of abnormal moments is accurately counted, the anomaly ratio is calculated and compared with the preset alarm threshold, and alarm signals are generated in a timely manner to ensure that a warning is issued quickly when the abnormal proportion of gas concentration exceeds the standard, thus protecting the safety of the monitoring area.
[0075] It should be noted that the gas concentration anomaly detection method in this embodiment demonstrates significant technical effectiveness in gas concentration anomaly detection by comprehensively utilizing statistical discriminant and deep learning techniques. As shown in Table 1, simulated anomaly experiments were conducted on 14 gases, including radon, oxygen, and chlorine, verifying the advantages of this method in terms of detection accuracy, reliability, and practicality.
[0076] Table 1: During testing, concentration data for 14 gases were collected using sensors, and a randomized incrementing method was used to simulate 10% of the sequences exhibiting anomalies to verify the overall performance of the method. Experimental results show that the method achieves comprehensive identification of gas concentration anomalies while maintaining a low misleading rate. Specifically, the method achieved a 100% recognition rate for anomalous sequences in all tested gases, meaning it completely identified all simulated anomalies, demonstrating excellent anomaly detection capabilities.
[0077] In terms of reliability, the method of this embodiment exhibits a low misleading rate. Test data shows that the misleading rate for each gas ranges from 0.0028 to 0.0259, indicating that the method of this embodiment can effectively distinguish between normal and abnormal sequences, keeping the probability of misclassifying normal sequences as abnormal at a low level. This characteristic improves the reliability of anomaly alerts and avoids resource waste and operational interference caused by false alarms.
[0078] To better illustrate the technical solution of this embodiment, the following example is used for complete explanation: S10. Obtain the internal space of the civil defense project as the target area, and continuously collect radon concentration data for 60 seconds using a gas sensor to form the current gas concentration sequence; S20. Calculate the average radon concentration based on the historical radon concentration data of the civil defense project over the past three months. and concentration standard deviation The radon concentration value at each moment in the current gas concentration sequence is detected, and the concentration value at any moment is... satisfy or At that moment, it was determined that there was an anomaly in the gas concentration. S30. Calculate the average value of radon concentration changes based on historical data of the past three months for this civil defense project. and trend standard deviation Calculate the trend value of the change at each time step for the current gas concentration sequence. When the trend value at any given time satisfies or At that time, it was determined that there was an abnormal trend in the change of gas concentration. S40. The current gas concentration sequence is reconstructed using a bidirectional gated recurrent unit autoencoder model with an embedded attention mechanism. First, the sequence is processed by the bidirectional gated recurrent unit in the encoder to obtain the encoder hidden state. Then, the attention weights are calculated and the context vector is generated through the attention mechanism. Finally, the reconstructed sequence is obtained by processing the bidirectional gated recurrent unit in the decoder in combination with the context vector. S50. Calculate the squared error sequence between the reconstructed sequence and the current gas concentration sequence. Calculate the square of the difference between the reconstructed gas concentration value and the real gas concentration value at each time step, and arrange them in chronological order to form the squared error sequence. S60. Calculate the mean square error based on the statistical information of the squared error generated when training the autoencoder model using historical normal data of the civil defense project. Sum of squared errors and standard deviation The squared error value at each time step in the squared error sequence is detected. When the squared error value at any time step... satisfy or At that moment, it was determined that there was an abnormal pattern of gas concentration change. S70. Count the number of abnormal moments in the current gas concentration sequence. If any moment is determined to have at least one of the following: abnormal gas concentration magnitude, abnormal gas concentration change trend, or abnormal gas concentration change pattern, then that moment is counted as an abnormal moment. S80. Calculate the ratio of the number of abnormal moments to the total number of moments in the current gas concentration sequence to obtain the current abnormality ratio. When the current abnormality ratio is greater than the preset alarm threshold of 25%, generate an alarm signal and display a red warning sign on the monitoring system interface while emitting a buzzer sound.
[0079] Figure 3 A schematic diagram of an embodiment of a gas concentration anomaly detection system 200 provided by the present invention is shown. Figure 3As shown, the gas concentration anomaly detection system 200 includes: a data acquisition module 201, a first detection module 202, a second detection module 203, a reconstruction module 204, a calculation module 205, a third detection module 206, a statistics module 207, and an early warning module 208. The acquisition module 201 is used to: acquire the current gas concentration sequence of the target area; The first detection module 202 is used to: detect abnormalities in the gas concentration at each moment in the current gas concentration sequence based on the historical gas concentration data of the target area; The second detection module 203 is used to: detect abnormal gas concentration change trends at each moment in the current gas concentration sequence based on historical gas concentration change trend data of the target area; The reconstruction module 204 is used to: reconstruct the current gas concentration sequence using a bidirectional gated cyclic unit autoencoder model with an embedded attention mechanism to obtain a reconstructed sequence; The calculation module 205 is used to: calculate the squared error sequence between the reconstructed sequence and the current gas concentration sequence, wherein the squared error sequence contains the squared error at each time step; The third detection module 206 is used to: detect abnormal gas concentration change patterns in the square error sequence based on historical square error data of the target area; The statistics module 207 is used to: count the number of abnormal moments in the current gas concentration sequence; wherein, if any moment in the current gas concentration sequence is determined to have at least one of the following: abnormal gas concentration magnitude, abnormal gas concentration change trend, or abnormal gas concentration change pattern, then that moment is counted as an abnormal moment. The early warning module 208 is used to issue an alarm when the proportion of the number of abnormal moments in the total number of moments in the current gas concentration sequence exceeds a preset alarm threshold.
[0080] In one alternative embodiment, the first detection module 202 is specifically used for: Determine whether any moment in the current gas concentration sequence meets a first preset condition; if so, determine that there is an anomaly in gas concentration at that moment; wherein, the first preset condition is: or ; Indicates the first in the current gas concentration sequence The actual gas concentration value at any given time. This represents the average concentration calculated based on the historical gas concentration data. This represents the standard deviation of the concentration calculated based on the historical gas concentration data; Repeat the step of determining whether the first preset condition is met at any time in the current gas concentration sequence until the detection of abnormal gas concentration at each time in the current gas concentration sequence is completed.
[0081] In one alternative embodiment, the second detection module 203 is specifically used for: Calculate the gas concentration change trend value at any time in the current gas concentration sequence, and determine whether the gas concentration change trend value at that time meets a second preset condition. If so, determine that there is an abnormal gas concentration change trend at that time; wherein, the second preset condition is: or ; Indicates the first in the current gas concentration sequence The trend of gas concentration change at any given time. ; This represents the average value of the change trend calculated based on the historical gas concentration change trend data. This represents the standard deviation of the change trend calculated based on the historical gas concentration change trend data; Repeat the steps of calculating the gas concentration change trend value at any time in the current gas concentration sequence and determining whether the gas concentration change trend value at that time meets the second preset condition, until the detection of abnormal gas concentration change trends at each time in the current gas concentration sequence is completed.
[0082] In an alternative embodiment, the reconstruction module 204 is specifically used for: The current gas concentration sequence is processed by the bidirectional gated loop unit in the encoder of the autoencoder model to obtain the hidden state of the encoder at all times; The hidden state of the decoder of the autoencoder model at the previous time step is used as the query, and the hidden states of the encoder at all time steps are used as the key. The attention weights are calculated through the attention mechanism in the autoencoder model. The hidden states of the encoder at all times are weighted based on the attention weights to generate a context vector; The hidden states of the decoder at all times are obtained by processing the context vector and the hidden state of the encoder through the bidirectional gated loop unit in the decoder. The reconstructed sequence is obtained by processing the hidden states of the decoder at all times using a multilayer perceptron in the autoencoder model.
[0083] In an alternative embodiment, the computing module 205 is specifically used for: The square of the difference between the reconstructed gas concentration value at any moment in the reconstructed sequence and the actual gas concentration value at that moment in the current gas concentration sequence is calculated as the squared error at that moment. Repeat the step of calculating the square of the difference between the reconstructed gas concentration value at any time in the reconstructed sequence and the actual gas concentration value at that time in the current gas concentration sequence, as the square error at that time, until the square error at each time is obtained; Arrange the squared errors at all times in chronological order to form the squared error sequence.
[0084] In one alternative embodiment, the third detection module 206 is specifically used for: Determine whether the squared error at any moment in the squared error sequence satisfies a third preset condition. If so, determine that there is an abnormal gas concentration change pattern at that moment. The third preset condition is: or ; Represents the first in the squared error sequence The squared error at time , This represents the mean of the squared errors calculated based on the historical squared error data. This represents the standard deviation of the squared error calculated based on the historical squared error data; Repeat the step of determining whether the square error at any time in the square error sequence meets the third preset condition until the abnormal gas concentration change pattern at each time in the square error sequence is detected.
[0085] In one alternative embodiment, the early warning module 208 is specifically used for: Calculate the ratio of the number of abnormal moments to the total number of moments in the current gas concentration sequence to obtain the current abnormality ratio; When the current abnormality ratio is greater than the preset alarm threshold, an alarm signal is generated and output; wherein, the current gas concentration sequence is a continuously collected monitoring data sequence of a fixed time length.
[0086] It should be noted that the beneficial effects of the gas concentration anomaly detection system 200 provided in the above embodiments are the same as those of the gas concentration anomaly detection method described above, and will not be repeated here. Furthermore, the system provided in the above embodiments is only illustrated by the division of the above functional modules. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the system can be divided into different functional modules according to the actual situation to complete all or part of the functions described above. In addition, the system and method embodiments provided in the above embodiments belong to the same concept, and their specific implementation process is detailed in the method embodiments, and will not be repeated here.
[0087] The gas concentration anomaly detection system 200 of the present invention can be a computer program (including program code) running on a computer device. For example, the gas concentration anomaly detection system 200 of the present invention is an application software that can be used to execute the corresponding steps in the gas concentration anomaly detection method of the present invention.
[0088] In some embodiments, the gas concentration anomaly detection system 200 of the present invention can be implemented in a combination of hardware and software. As an example, the gas concentration anomaly detection system 200 of the present invention can be a processor in the form of a hardware decoding processor, which is programmed to execute the gas concentration anomaly detection method of the present invention. For example, the processor in the form of a hardware decoding processor can be one or more application specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field-programmable gate arrays (FPGAs), or other electronic components.
[0089] The modules described in the embodiments of this invention can be implemented in software or hardware. The names of the modules are not, in some cases, limiting the scope of the module itself.
[0090] An electronic device according to an embodiment of the present invention includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements any of the above-described methods for detecting abnormal gas concentration. That is, an electronic device according to an embodiment of the present invention may include, but is not limited to: a processor and a memory; the memory is used to store the computer program; the processor is used to execute the method for detecting abnormal gas concentration shown in any embodiment of the present invention by calling the computer program.
[0091] In one alternative embodiment, an electronic device is provided, such as Figure 4 As shown, Figure 4The illustrated electronic device 4000 includes a processor 4001 and a memory 4003. The processor 4001 and the memory 4003 are connected, for example, via a bus 4002. Optionally, the electronic device 4000 may further include a transceiver 4004, which can be used for data interaction between the electronic device and other electronic devices, such as sending and / or receiving data. It should be noted that in practical applications, the transceiver 4004 is not limited to one type, and the structure of the electronic device 4000 does not constitute a limitation on the embodiments of the present invention.
[0092] Processor 4001 may be a CPU (Central Processing Unit), a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It can implement or execute the various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of this invention. Processor 4001 may also be a combination that implements computational functions, such as including one or more microprocessor combinations, a combination of a DSP and a microprocessor, etc.
[0093] Bus 4002 may include a path for transmitting information between the aforementioned components. Bus 4002 may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus, etc. Bus 4002 can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 4 The bus 4002 is represented by only one thick line, but this does not mean that there is only one bus or one type of bus.
[0094] The memory 4003 may be ROM (Read Only Memory) or other types of static storage devices capable of storing static information and instructions, RAM (Random Access Memory) or other types of dynamic storage devices capable of storing information and instructions, or EEPROM (Electrically Erasable Programmable Read Only Memory), CD-ROM (Compact Disc Read Only Memory) or other optical disc storage, optical disc storage (including compressed optical discs, laser discs, optical discs, digital universal optical discs, Blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium capable of carrying or storing desired program code in the form of instructions or data structures and accessible by a computer, but not limited thereto.
[0095] The memory 4003 stores application code (computer program) for executing the present invention, and its execution is controlled by the processor 4001. The processor 4001 executes the application code stored in the memory 4003 to implement the content shown in the foregoing method embodiments.
[0096] Among them, electronic devices can also be terminal devices. A terminal device can be any terminal device that can install applications and access web pages through applications, including at least one of smartphones, tablets, laptops, desktop computers, smart speakers, smartwatches, smart TVs, and smart in-vehicle devices.
[0097] It should be noted that, Figure 4 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of use of the embodiments of the present invention.
[0098] An embodiment of the present invention provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements any of the above-described methods for detecting abnormal gas concentrations.
[0099] Alternatively, the computer-readable storage medium may be a read-only memory (ROM), a random access memory (RAM), a compact disc read-only memory (CD-ROM), magnetic tape, a floppy disk, and an optical data storage device, etc.
[0100] In an exemplary embodiment, a computer program product or computer program is also provided, which includes computer instructions stored in a computer-readable storage medium. A processor of an electronic device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the electronic device to perform the aforementioned gas concentration anomaly detection method.
[0101] Computer program code for performing the operations of this invention can be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, and C++, and conventional procedural programming languages such as C or similar languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0102] It should be understood that the flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of methods and computer program products according to various embodiments of the present invention. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0103] The computer-readable storage medium provided in this invention can be, but is not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this invention, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
[0104] The aforementioned computer-readable storage medium carries one or more programs, which, when executed by the electronic device, cause the electronic device to perform the method shown in the above embodiments.
[0105] The above description is merely a preferred embodiment of the present invention and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of disclosure in this invention is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above-disclosed concept. For example, technical solutions formed by substituting the above features with (but not limited to) technical features with similar functions disclosed in this invention.
[0106] It should be noted that the terms "first," "second," etc., used in the specification and claims of this application are used to distinguish similar objects and represent a limitation on a specific order or sequence. Where appropriate, the order of use for similar objects can be interchanged so that the embodiments of this application described herein can be implemented in an order other than that shown or described.
[0107] Those skilled in the art will recognize that this invention can be implemented as a system, method, or computer program product. Therefore, this invention can be specifically implemented in the following forms: it can be entirely hardware, entirely software (including firmware, resident software, microcode, etc.), or a combination of hardware and software, generally referred to herein as a "circuit," "module," or "system." Furthermore, in some embodiments, this invention can also be implemented as a computer program product contained in one or more computer-readable media, which includes computer-readable program code.
[0108] Although embodiments of the present invention have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present invention. Those skilled in the art can make changes, modifications, substitutions and variations to the above embodiments within the scope of the present invention.
Claims
1. A method for detecting abnormal gas concentration, characterized in that, include: Obtain the current gas concentration sequence of the target area; Based on the historical gas concentration data of the target area, anomalies in the gas concentration at each moment in the current gas concentration sequence are detected; Based on the historical gas concentration change trend data of the target area, anomalies in the gas concentration change trend at each moment in the current gas concentration sequence are detected. An autoencoder model with a bidirectional gated recurrent unit embedded with an attention mechanism is used to reconstruct the current gas concentration sequence to obtain a reconstructed sequence. Calculate the squared error sequence between the reconstructed sequence and the current gas concentration sequence, the squared error sequence containing the squared error at each time step; Based on the historical squared error data of the target area, anomalies in the gas concentration change patterns in the squared error sequence are detected. The number of abnormal moments in the current gas concentration sequence is counted; wherein, if any moment in the current gas concentration sequence is determined to have at least one of the following: abnormal gas concentration magnitude, abnormal gas concentration change trend, or abnormal gas concentration change pattern, then that moment is counted as an abnormal moment. An alarm is triggered when the proportion of the number of abnormal moments in the total number of moments in the current gas concentration sequence exceeds a preset alarm threshold.
2. The gas concentration anomaly detection method according to claim 1, characterized in that, The step of detecting anomalies in gas concentration at each moment in the current gas concentration sequence based on historical gas concentration data of the target area includes: Determine whether any moment in the current gas concentration sequence meets a first preset condition; if so, determine that there is an anomaly in gas concentration at that moment; wherein, the first preset condition is: or ; Indicates the first in the current gas concentration sequence The actual gas concentration value at any given time. This represents the average concentration calculated based on the historical gas concentration data. This represents the standard deviation of the concentration calculated based on the historical gas concentration data; Repeat the step of determining whether the first preset condition is met at any time in the current gas concentration sequence until the detection of abnormal gas concentration at each time in the current gas concentration sequence is completed.
3. The gas concentration anomaly detection method according to claim 2, characterized in that, The step of detecting abnormal gas concentration change trends at each moment in the current gas concentration sequence based on historical gas concentration change trend data of the target area includes: Calculate the gas concentration change trend value at any time in the current gas concentration sequence, and determine whether the gas concentration change trend value at that time meets a second preset condition. If so, determine that there is an abnormal gas concentration change trend at that time; wherein, the second preset condition is: or ; Indicates the first in the current gas concentration sequence The trend of gas concentration change at time t. ; This represents the average value of the change trend calculated based on the historical gas concentration change trend data. This represents the standard deviation of the trend calculated based on the historical gas concentration change trend data; Repeat the steps of calculating the gas concentration change trend value at any time in the current gas concentration sequence and determining whether the gas concentration change trend value at that time meets the second preset condition, until the detection of abnormal gas concentration change trends at each time in the current gas concentration sequence is completed.
4. The gas concentration anomaly detection method according to claim 1, characterized in that, The autoencoder model employing an embedded attention mechanism and a bidirectional gated recurrent unit reconstructs the current gas concentration sequence to obtain the reconstructed sequence, including the following steps: The current gas concentration sequence is processed by the bidirectional gated loop unit in the encoder of the autoencoder model to obtain the hidden state of the encoder at all times; The hidden state of the decoder of the autoencoder model at the previous time step is used as the query, and the hidden states of the encoder at all time steps are used as the key. The attention weights are calculated through the attention mechanism in the autoencoder model. The hidden states of the encoder at all times are weighted based on the attention weights to generate a context vector; The hidden states of the decoder at all times are obtained by processing the context vector and the hidden state of the encoder through the bidirectional gated loop unit in the decoder. The reconstructed sequence is obtained by processing the hidden states of the decoder at all times using a multilayer perceptron in the autoencoder model.
5. The gas concentration anomaly detection method according to claim 3, characterized in that, The step of calculating the squared error sequence between the reconstructed sequence and the current gas concentration sequence includes: The square of the difference between the reconstructed gas concentration value at any moment in the reconstructed sequence and the actual gas concentration value at that moment in the current gas concentration sequence is calculated as the squared error at that moment. Repeat the step of calculating the square of the difference between the reconstructed gas concentration value at any time in the reconstructed sequence and the actual gas concentration value at that time in the current gas concentration sequence, as the square error at that time, until the square error at each time is obtained; Arrange the squared errors at all times in chronological order to form the squared error sequence.
6. The gas concentration anomaly detection method according to claim 5, characterized in that, The step of detecting abnormal gas concentration change patterns in the squared error sequence based on historical squared error data of the target region includes: Determine whether the squared error at any moment in the squared error sequence satisfies a third preset condition. If so, determine that there is an abnormal gas concentration change pattern at that moment. The third preset condition is: or ; Represents the first in the squared error sequence The squared error at time , This represents the mean of the squared errors calculated based on the historical squared error data. This represents the standard deviation of the squared error calculated based on the historical squared error data; Repeat the step of determining whether the square error at any time in the square error sequence meets the third preset condition until the abnormal gas concentration change pattern at each time in the square error sequence is detected.
7. The gas concentration anomaly detection method according to any one of claims 1 to 6, characterized in that, The step of triggering an alarm when the proportion of the number of abnormal moments in the total number of moments in the current gas concentration sequence exceeds a preset alarm threshold includes: Calculate the ratio of the number of abnormal moments to the total number of moments in the current gas concentration sequence to obtain the current abnormality ratio; When the current abnormality ratio is greater than the preset alarm threshold, an alarm signal is generated and output; wherein, the current gas concentration sequence is a continuously collected monitoring data sequence of a fixed time length.
8. A gas concentration anomaly detection system, characterized in that, include: The system comprises an acquisition module, a first detection module, a second detection module, a reconstruction module, a calculation module, a third detection module, a statistics module, and an early warning module. The acquisition module is used to: acquire the current gas concentration sequence of the target area; The first detection module is used to: detect anomalies in the gas concentration at each moment in the current gas concentration sequence based on historical gas concentration data of the target area; The second detection module is used to: detect abnormalities in the gas concentration change trend at each moment in the current gas concentration sequence based on the historical gas concentration change trend data of the target area; The reconstruction module is used to: reconstruct the current gas concentration sequence using a bidirectional gated recurrent unit autoencoder model with an embedded attention mechanism to obtain a reconstructed sequence; The calculation module is used to: calculate the squared error sequence between the reconstructed sequence and the current gas concentration sequence, wherein the squared error sequence contains the squared error at each time step; The third detection module is used to: detect abnormal gas concentration change patterns in the square error sequence based on historical square error data of the target area; The statistics module is used to: count the number of abnormal moments in the current gas concentration sequence; wherein, if any moment in the current gas concentration sequence is determined to have at least one of the following: abnormal gas concentration magnitude, abnormal gas concentration change trend, or abnormal gas concentration change pattern, then that moment is counted as an abnormal moment. The early warning module is used to issue an alarm when the proportion of the number of abnormal moments in the total number of moments in the current gas concentration sequence exceeds a preset alarm threshold.
9. An electronic device, characterized in that, The electronic device includes a processor coupled to a memory storing at least one computer program, which is loaded and executed by the processor to enable the electronic device to implement the gas concentration anomaly detection method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores at least one computer program, which, when executed by a processor, implements the gas concentration anomaly detection method as described in any one of claims 1 to 7.