Anomaly detection method for hydrate plug
Patent Information
- Application Number
- CN202510118639.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-24
- Publication Date
- 2026-10-09
- Estimated Expiration
- 2045-01-24
AI Technical Summary
但是,监督学习的性能严重依赖于数据标注的质量,而在实际生产中,准确且及时地标注数据往往十分困难
[0054] 1) This invention provides an anomaly detection method for hydrate blockage. It adopts a deep learning approach and proposes an anomaly detection model based on a variational autoencoder framework for hydrate blockage prediction. The model has approximately 100K learnable parameters. While maintaining lightweight performance and meeting real-time requirements, it has a stronger learning ability for complex data patterns compared to traditional machine learning models.
Smart Images

Figure CN120214208B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the interdisciplinary field of energy and chemical engineering and artificial intelligence, specifically a method for detecting anomalies caused by hydrate blockage. Background Technology
[0002] Natural gas hydrate is a crystalline compound formed by natural gas molecules and water molecules under low temperature and high pressure conditions.
[0003] In deepwater energy development, hydrates have become a thorny problem due to their rapid formation (which can occur within hours) and the enormous hazards they cause, such as production disruptions, equipment damage, casualties, and oil spills.
[0004] In shallow water extraction, the injection of thermodynamic hydrate inhibitors (THIs) is typically used to alter the phase equilibrium conditions of hydrates, thereby achieving a strategy to completely avoid hydrate formation. However, in the absence of flow assurance monitoring and intelligent decision support systems, many areas of the energy development system remain in a "black box" state, making it difficult to determine the amount and location of hydrate formation. This THI-based complete avoidance strategy is not practical in deep water development, and the demand for THIs in deep water extraction is enormous (up to 60% by volume), leading to a surge in economic costs (approximately US$750,000 per day) and posing a more severe ecological threat.
[0005] In recent years, the control strategy for hydrate blockage has gradually shifted from "complete avoidance" to "risk management," which means allowing the presence of hydrates but preventing them from causing blockage. The key to achieving this strategy lies in accurately quantifying the operational risks within the hydrate formation area. Therefore, developing flow assurance monitoring and intelligent decision-making systems has become an urgent need for realizing information-based deepwater energy development.
[0006] Hydrate phase transitions in multiphase flow environments are inherently multivariable, high-dimensional, and nonlinear problems, making the development of accurate mathematical models extremely difficult. Some studies have attempted to predict hydrate blockage using data-driven machine learning methods, defining it as a classification problem and solving it through supervised learning. However, the performance of supervised learning heavily depends on the quality of data annotation, which is often very difficult to achieve accurately and promptly in actual production.
[0007] In contrast, unsupervised learning methods do not rely on data labels but learn based on the inherent patterns in the data. Typically, during normal transport, flow parameters are relatively stable, while hydrate blockage is a cumulative process involving particle generation, aggregation, and deposition, developing gradually over time.
[0008] Therefore, defining hydrate blockage prediction as a time series anomaly detection problem is a reasonable solution. Summary of the Invention
[0009] Current traditional methods for detecting hydrate blockage mostly employ supervised classification models, which cannot adapt to the differences between laboratory data and field conditions, and lack good generalization and scalability. To address these issues, this invention proposes an anomaly detection method for hydrate blockage. By constructing an anomaly detection model based on a variational autoencoder, two non-uniform weight adjustment methods are proposed to achieve early warning of hydrate blockage.
[0010] The specific steps of the anomaly detection method for hydrate blockage are as follows:
[0011] Step 1: Construct an anomaly detection model TLV based on variational autoencoder (VAE);
[0012] The model TLV includes a VAE encoder and a VAE decoder;
[0013] The VAE encoder uses a Transformer Encoder, which contains two linearly stacked Transformer Blocks. For each Transformer Block, the data passes through the Multihead Attention layer, Add&Norm layer, Feed Forward layer, and Add&Norm layer in sequence. After passing through the two Transformer Blocks, the data passes through the last linear layer of the encoder for compression and dimensionality reduction.
[0014] VAE's decoder uses an LSTM decoder, which contains two linearly stacked LSTM blocks. Each LSTM block consists of a memory unit and three "gate" structures. The reparameterized data is passed through the LSTM decoder to obtain the decoded data.
[0015] Step 2: Obtain loop piping data;
[0016] Data is selected based on different ratios of oil, gas, and water, as well as external conditions such as subcooling; the data includes differential pressure, pipeline outlet temperature, inlet temperature, and volumetric flow rate.
[0017] Step 3: Perform serialization, standardization, and location embedding preprocessing on the pipeline data, and input it into the TLV model;
[0018] First, the pipeline data is serialized and divided into time slices according to the set time_steps size.
[0019] Then, the data divided into time slices was standardized using the common Z-Score method;
[0020] Finally, for the standardized data, the trigonometric function position encoding method is used for position embedding;
[0021] The trigonometric function position encoding method is as follows:
[0022]
[0023] Where pos is the position of the element in the sequence, i is the dimension index in the encoding vector, and d model This refers to the dimension of the embedded vector. For odd-numbered dimensions and even-numbered dimensions, sine and cosine encoding methods are used respectively.
[0024] Step 4: Encode the preprocessed data using the VAE encoder of the TLV model;
[0025] After data compression and dimensionality reduction, the VAE encoder obtains the mean and variance of the latent space, denoted as . and
[0026] Step 5: Reparameterize the encoded data;
[0027] The latent space probability distribution representation generated by the encoder Its reparameterization is shown in the following formula:
[0028]
[0029] Where ε is a random variable that follows a standard normal distribution, and ⊙ represents the digit-wise multiplication operation.
[0030] Step 6: Decode the reparameterized latent space using the VAE decoder to restore the data distribution;
[0031] Step 7: Calculate the reconstruction error using the decoded data, and adjust the reconstruction error using the non-uniform weight partitioning method;
[0032] First, for a set of data, calculate the reconstruction error to obtain a set of...
[0033]
[0034] Where T is the time slice, d is the feature dimension, and y is the time slice. i,j For preprocessed data, This is the decoded data.
[0035] The non-uniform weighting method refers to the use of two methods: linear partitioning and quadratic partitioning.
[0036] First, sample t points sequentially and uniformly between 0 and 1:
[0037] W = {s1} n ,s2 n ,s3 n …s t n}={w1,w2,w3…w t}
[0038] Where s1=0, s t =1,s k+1 -s k =s k -s k-1 .
[0039] We obtain the unnormalized weights W. For linear partitions, we take n=1; for quadratic partitions, we take n=2. Next, to maintain consistency in magnitude, we need to normalize W:
[0040]
[0041]
[0042] The reconstruction error is recalculated using the normalized weights, as shown in the following formula:
[0043]
[0044] Step 8: Set a threshold using the adjusted reconstruction error and segment outlier data for anomaly detection and early warning of congestion;
[0045] The threshold is obtained by the following formula:
[0046]
[0047] Where percentile is the function for calculating percentiles. The sequence representing the reconstruction error is denoted by percent, which is a hyperparameter representing a manually set percentage.
[0048] Data above this threshold is classified as anomalous data, and data below this threshold is classified as normal data.
[0049] Furthermore, the anomaly detection method for hydrate blockage described in this invention is applied to an online learning module, and its simplified process is as follows:
[0050] First, the pipeline data is collected on-site by sensors and delivered to the model TLV to output prediction results. The model TLV then temporarily stores the input data and output results in a structured form in the background MySQL database for subsequent processing.
[0051] If a user finds that the prediction results need adjustment, they can correct the temporarily stored data and update the database with the modified data. Furthermore, users can proactively trigger a model TLV update operation, using data from the temporarily stored database to fine-tune and update the model TLV. Alternatively, the model TLV update process can be automatically triggered when the temporarily stored data reaches a time limit or quantity threshold.
[0052] During the update, not only are the training parameters of the model's TLV updated, but also the distribution parameters (mean and variance) of the input data and the first and second moments of the parameters stored in the optimizer are updated.
[0053] The advantages of this invention are as follows:
[0054] 1) This invention provides an anomaly detection method for hydrate blockage. It adopts a deep learning approach and proposes an anomaly detection model based on a variational autoencoder framework for hydrate blockage prediction. The model has approximately 100K learnable parameters. While maintaining lightweight performance and meeting real-time requirements, it has a stronger learning ability for complex data patterns compared to traditional machine learning models.
[0055] 2) This invention presents an anomaly detection method for hydrate blockage. Based on a high-quality, large-scale training dataset and using unsupervised training, the proposed TLV model demonstrates stronger predictive power and better generalization performance than traditional machine learning methods. This means that the model can provide reliable prediction results even in different real-world production environments.
[0056] 3) This invention provides an anomaly detection method for hydrate blockage, employing two non-uniform weight adjustment methods (linear and quadratic). By increasing the weight of later points within a time slice, the model is improved, providing early warning of impending blockage. This enables the model to identify potential risks earlier, enhancing its practicality in real-time field conditions.
[0057] 4) This invention provides an anomaly detection method for hydrate blockage. The constructed model supports dynamic updates, continuously adjusting and optimizing threshold parameters during operation to adapt to new data distributions until it stabilizes. This mechanism not only enhances the model's adaptability to environmental changes but also facilitates incremental learning, allowing it to gradually learn features and patterns in new data without retraining the entire model, thereby improving the model's long-term usability and flexibility.
[0058] 5) This invention provides an anomaly detection method for hydrate blockage. By designing a deep learning anomaly detection model based on variational autoencoders, it achieves high efficiency, accuracy, and generalization in hydrate blockage prediction, significantly improving the model's practicality and application potential, and providing a reliable solution for the current field. Attached Figure Description
[0059] Figure 1 This is a flowchart of an anomaly detection method for hydrate blockage according to the present invention;
[0060] Figure 2 This is an architecture diagram of the anomaly detection model based on the variational autoencoder framework of the present invention;
[0061] Figure 3 This is an architecture diagram of the Transformer encoder module within the anomaly detection model proposed in this invention;
[0062] Figure 4 This is an architecture diagram of the LSTM decoder module within the anomaly detection model proposed in this invention;
[0063] Figure 5 This is a flowchart of the online learning module proposed in this invention. Detailed Implementation
[0064] The present invention will now be described in further detail with reference to the accompanying drawings and embodiments.
[0065] To address the limitations of current hydrate blockage detection methods, this invention proposes a deep learning-based anomaly detection method for hydrate blockage in deep-sea oil and gas pipelines. The core of this method involves constructing an anomaly detection model (Transformer-LSTM-VAE, TLV) based on a Variation Auto-Encoder (VAE). The encoder uses a Transformer architecture, and the decoder uses an LSTM architecture. Furthermore, two Uneven Weight Adjustment (UWA) methods are proposed to achieve early warning of hydrate blockage.
[0066] Furthermore, this invention designs an online learning module to support the stable operation of the model under field working conditions.
[0067] The aforementioned anomaly detection method for hydrate blockage, such as Figure 1 As shown, the specific steps are as follows:
[0068] Step 1: Construct an anomaly detection model TLV based on variational autoencoder (VAE);
[0069] Overall model architecture as follows Figure 2 As shown, it includes a VAE encoder and a VAE decoder;
[0070] VAE's encoder uses a Transformer Encoder, which contains two linearly stacked Transformer Blocks. For each Transformer Block, the data passes through the Multihead Attention layer, Add&Norm layer, Feed Forward layer, and Add&Norm layer in sequence. After passing through the two Transformer Blocks, the data passes through the last linear layer of the encoder to compress and reduce the dimensionality of the input data to a latent space, thus achieving data encoding.
[0071] VAE's decoder uses an LSTM decoder, which contains two linearly stacked LSTM blocks. Each LSTM block consists of a memory unit and three "gate" structures. The reparameterized data is passed through the LSTM decoder to obtain the decoded data.
[0072] Step 2: Obtain loop piping data;
[0073] Data is selected based on different ratios of oil, gas, and water, as well as external conditions such as subcooling; the data includes differential pressure, pipeline outlet temperature, inlet temperature, and volumetric flow rate.
[0074] Step 3: Perform serialization, standardization, and location embedding preprocessing on the pipeline data, and input it into the TLV model;
[0075] First, the pipeline data is serialized and divided into time slices according to the set time_steps size.
[0076] Then, the data divided into time slices was standardized using the common Z-Score method;
[0077] Finally, for the standardized data, the trigonometric function position encoding method is used for position embedding; and the position-embedded data is used as the input of the VAE encoder of the TLV model.
[0078] The trigonometric function position encoding method is as follows:
[0079]
[0080] Where pos is the position of the element in the sequence, i is the dimension index in the encoding vector, and d modelThis refers to the dimension of the embedding vector. For odd-numbered dimensions and even-numbered dimensions, sine and cosine encoding methods are used respectively. This is done because they have the ability to generalize to positions not seen during training, allowing the model to learn the periodicity of the sequence.
[0081] Step 4: Encode the preprocessed data using the VAE encoder of the TLV model;
[0082] After data compression and dimensionality reduction, the VAE encoder obtains the mean and variance of the latent space, denoted as . and Implement data encoding.
[0083] Step 5: Reparameterize the encoded data;
[0084] To compute the loss function and make the entire training process differentiable, reparameterization is required, whereby the latent space probability distribution generated by the encoder is represented... For the distribution N(μ,σ) 2 The formula is as follows:
[0085]
[0086] Where ε is a random variable that follows a standard normal distribution, and ⊙ represents the digit-wise multiplication operation.
[0087] This transformation not only preserves the distribution characteristics of z, but also allows the distribution of z to be controlled directly by adjusting μ and σ, while allowing the gradient to flow smoothly through this random node.
[0088] Step 6: Decode the reparameterized latent space using the VAE decoder to restore the data distribution;
[0089] Step 7: Calculate the reconstruction error using the decoded data, and adjust the reconstruction error using the non-uniform weight partitioning method;
[0090] First, for a set of data, calculate the reconstruction error to obtain a set of...
[0091]
[0092] Where T is the time slice, d is the feature dimension, and y is the time slice. i,j For preprocessed data, This is the decoded data.
[0093] The non-uniform weighting method refers to the use of two methods: linear partitioning and quadratic partitioning.
[0094] First, sample t points sequentially and uniformly between 0 and 1:
[0095] W = {s1}n ,s2 n ,s3 n …s t n}={w1,w2,w3…w t}
[0096] Where s1=0, s t =1,s k+1 -s k =s k -s k-1 .
[0097] We obtain the unnormalized weights W. For linear partitions, we take n=1; for quadratic partitions, we take n=2. Next, to maintain consistency in magnitude, we need to normalize W:
[0098]
[0099]
[0100] The reconstruction error is recalculated using the normalized weights, as shown in the following formula:
[0101]
[0102] Step 8: Set a threshold using the adjusted reconstruction error and segment outlier data for anomaly detection and early warning of congestion;
[0103] The threshold is obtained by the following formula:
[0104]
[0105] Where percentile is the function for calculating percentiles. The sequence representing the reconstruction error is denoted by percent, which is a hyperparameter representing a manually set percentage.
[0106] Data above this threshold is classified as anomalous data, and data below this threshold is classified as normal data.
[0107] Furthermore, the anomaly detection method for hydrate blockage described in this invention is applied to an online learning module, and its simplified process is as follows:
[0108] First, data acquisition. On-site, pipeline data is collected by sensors and delivered to the model TLV to output prediction results. The model TLV then temporarily stores the input data and output results in a structured form in the background MySQL database for subsequent processing.
[0109] Then, the model is updated. If the user finds that the prediction results need adjustment, the temporary data is corrected, and the modified data is updated to the database to ensure data accuracy. Furthermore, users can also proactively trigger the model TLV update operation, using data in the temporary database to fine-tune and update the model TLV, enabling the model to better adapt to current operating conditions. To further enhance the system's automation capabilities, even without manual user intervention, the model TLV update process is automatically triggered when the temporary data reaches a time limit or quantity threshold.
[0110] During the update, not only are the training parameters of the model's TLV updated, but also the distribution parameters (mean and variance) of the input data and the first and second moments of the parameters stored in the optimizer are updated to maintain the ability to adapt to dynamic operating conditions.
[0111] Example:
[0112] This invention designs an online learning module that enables the model to continuously adjust and optimize threshold parameters during operation, allowing it to adapt to new data distributions until it stabilizes. The following sections will describe the process in three stages: model building, model training, and model execution.
[0113] Phase 1: TLV Model Construction Scheme
[0114] Step 1: Obtain loop piping data
[0115] The data used in this invention comes from the multiphase gas pipeline experimental device of the Key Laboratory of Marine Energy Utilization and Energy Conservation, Ministry of Education. Based on different oil, gas, and water ratios, as well as external conditions such as subcooling, over 500,000 data points were selected for this invention. The data includes multiple physical parameters; this invention selects four main physical parameters—pressure difference, pipeline outlet temperature, inlet temperature, and volumetric flow rate—as input to the model.
[0116] Step 2: Data serialization, standardization, and location embedding
[0117] Step 3: The preprocessed data is passed through the VAE encoder to compress and reduce its dimensionality.
[0118] The Transformer architecture has demonstrated powerful capabilities in the field of deep learning. It can effectively model the dependencies of long-term sequences while improving computational efficiency through parallel data processing. It also has many excellent capabilities such as strong versatility and support for capturing global information.
[0119] In this invention, the encoder portion of the VAE uses a native Transformer Encoder, whose structure includes several Transformer Blocks, as shown in the figure below. Figure 3As shown. After the data enters the Transformer Encoder, it first passes through the Multihead Attention layer, as shown in the following formula:
[0120]
[0121] Where Q, K, and V represent three sets of vectors, namely query (Q), key (K), and value (V), respectively, and softmax represents the Softmax activation function. It is a scaling factor used to control the size of the dot product.
[0122] Multi-head attention enables the model to focus on elements at different positions in a sequence simultaneously, thereby capturing various types of dependencies such as long-distance dependencies and local dependencies.
[0123] The data then passes through an Add&Norm layer, where it is first connected to the input via a residual connection and then standardized. The resulting data then passes through a feedforward neural network, which contains two fully connected layers interspersed with an activation function. In this model, ReLU is chosen as the activation function, as shown in the following formula:
[0124] FFN(x) = ReLU(xW1+b1)·W2+b2 (8)
[0125] In this context, FFN represents a latent neural network, W1 and b1 represent the weights and biases of the first fully connected layer, and W2 and b2 represent the weights and biases of the second fully connected layer.
[0126] The data has now gone through a complete Transformer Block. In this invention, based on experimental results, the data will go through two blocks before the encoding process ends.
[0127] Step 4: Reparameterize the encoded data
[0128] The latent space probability distribution representation generated by the encoder The goal is to approximate the true prior probability distribution, the standard normal distribution. To compute the loss function, the probability distribution in the latent space needs to be sampled. However, direct sampling is non-differentiable, meaning standard gradient-based methods cannot be used to update the parameters. Therefore, reparameterization is necessary.
[0129] Step 5: Decode the reparameterized latent space using VAE to reconstruct the data distribution.
[0130] This model uses LSTM as the decoder, and its structure is as follows: Figure 4 As shown.
[0131] LSTM has achieved remarkable results in the field of time series prediction and is widely used in various time series-related tasks. LSTM evolved from RNN and inherits the recursive structure of RNN, but it solves the gradient vanishing and gradient exploding problems that occur in the training of standard RNN on long sequences.
[0132] LSTM consists of numerous memory units (cell states) and three "gate" structures. These structures enable the network to automatically learn when to add information to memory, when to forget irrelevant information, and when to retrieve information from memory, together calculating the hidden state at each moment, thus overcoming the long-term dependency problem in traditional RNNs.
[0133] LSTM can learn the sequence properties and trends of sensor data and has a powerful sequence generation capability, making it suitable for predicting hydrate-related anomalies in this invention. It can also reconstruct the low-level latent space into the data space very well.
[0134] Step 6: Calculate the reconstruction error from the decoded data and adjust the reconstruction error using a non-uniform weighting method;
[0135] Unlike traditional classification problems, VAE architecture models cannot provide classification results; they can only provide the error between the reconstructed result and the true value for each data set. After model training, this invention calculates a threshold set and inputs it into the model to obtain a set of... It attempts to find a threshold such that data above the threshold is classified as anomalous data, while data below the threshold is classified as normal data.
[0136] This invention uses percentiles of the error list as the threshold criterion. This method typically sets the percentage to 80%–95% to ensure both sensitivity and robustness in identifying outliers. This makes the model more sensitive to data from later time points, thus providing early warning.
[0137] In real-world industrial environments, misclassifying a blockage as non-blockage can lead to serious consequences, such as catastrophic events like pipeline explosions, while misclassifying a non-blockage as a blockage has relatively low costs, typically involving only on-site inspections by engineers. Therefore, an effective early warning mechanism is urgently needed. Considering the inherent variation patterns of hydrate blockage tasks and the innovative transformation of this research into anomaly detection tasks, this invention proposes a non-uniform weighting method to improve the model's accuracy in identifying blockages.
[0138] Traditional forecasting methods involve uniformly assigning weights to each time slice. If a time slice contains t time points, then each time point is assigned an equal weight. The weights are then calculated using the same method as formula x for each time slice.
[0139] This invention improves the weighting method by giving greater weight to the calculation error of later time points within a time slice, so as to capture the occurrence of anomalies as early as possible through error amplification.
[0140] Phase Two: TLV Model Training Method
[0141] Due to the specific nature of anomaly detection tasks, this invention divides the entire dataset into a training set, a threshold calculation set, and a test set. First, two extreme scenarios are extracted, with all data from these scenarios used for testing to verify the overall generalization ability of the model. For the other scenarios, only normal data is used for the training and threshold calculation sets, divided according to an 8:2 ratio and subjected to five-fold cross-validation. All anomaly data, along with the extreme scenarios, serves as the test set.
[0142] After model building and dataset partitioning preprocessing, the training set is input into the model for a specified number of training rounds. Then, the model parameters are frozen, the threshold set is input, the threshold is calculated based on percentiles, and finally, the test set is input, and the error is calculated using standard weights, linear weights, and quadratic weights respectively. Evaluation metrics are then calculated.
[0143] This invention utilizes the Tensorflow deep learning framework for training and optimization. The Transformer Encoder contains two stacked Transformer Blocks, and the LSTM Decoder contains two stacked LSTM Layers. The hidden layer dimension is uniformly set to 16, and the latent space dimension is set to 2. The Adam optimizer is employed, with a learning rate of 1e-3 and 15 training epochs. An early stopping strategy is used, with weight_decay set to 0.01 and time_step set to 64. Experiments have verified that the percentile threshold (perc) for reconstruction error is set to 90. For hardware, this example uses an Nvidia 1650Ti graphics card for model training, inference, and backend deployment.
[0144] Phase 3: Design of the online learning module for TLV model runtime
[0145] This invention addresses the operational requirements of TLV models under real-world field conditions by designing an online learning module to dynamically adapt to changes in field data and improve the model's predictive performance. The process is as follows: Figure 5 As shown.
[0146] The specific process is as follows:
[0147] Step 1: Data Acquisition. While the pipeline is running, the system acquires multivariate time-series data in real time through data acquisition devices such as sensors. This data, after preprocessing, is input into the model to generate corresponding prediction results. Simultaneously, this newly acquired data and prediction results are stored in a MySQL database for subsequent processing.
[0148] Step Two: Model Update. If the user finds that the prediction results need adjustment, they can correct the temporarily stored data. The system will then update the modified data in the database to ensure data accuracy. Furthermore, the user can also actively trigger a model update operation. In this case, the system will use data from the temporarily stored database to fine-tune the model, allowing it to better adapt to the current working conditions. To further enhance the system's automation capabilities, even without manual user intervention, the system will automatically trigger the model update process when the temporarily stored data reaches a certain time limit or quantity threshold. During the update, not only are the model training parameters updated, but also the distribution parameters (mean and variance) of the input data and the first and second moments of the parameters stored in the optimizer are updated.
[0149] In this way, the model can always maintain its adaptability to dynamic operating conditions, ensuring the accuracy and reliability of the prediction results; in this way, the generalizability and practicality of the invention are greatly enhanced, providing reliable support for field applications.
[0150] Contents not described in detail in this specification are prior art known to those skilled in the art. It is hereby indicated that the above description is intended to help those skilled in the art understand this invention, but does not limit the scope of protection of this invention. Any equivalent substitutions, modifications, improvements, and / or simplifications of the above descriptions that do not depart from the essential content of this invention fall within the scope of protection of this invention.
Claims
1. An anomaly detection method for hydrate blockage, characterized in that, The specific steps are as follows: Step 1: Construct an anomaly detection model TLV based on variational autoencoder (VAE); The model TLV includes a VAE encoder and a VAE decoder; VAE's encoder uses a Transformer Encoder, which contains two linearly stacked Transformer Blocks. For each Transformer Block, the data passes through the Multihead Attention layer, Add & Norm layer, Feed Forward layer, and Add & Norm layer in sequence. After passing through the two Transformer Blocks, the data passes through the last linear layer of the encoder for compression and dimensionality reduction. VAE's decoder uses an LSTM decoder, which contains two linearly stacked LSTM blocks. Each LSTM block consists of a memory unit and three "gate" structures. The reparameterized data is passed through the LSTM decoder to obtain the decoded data. Step 2: Obtain loop pipeline data, and perform preprocessing such as serialization, standardization, and location embedding on the pipeline data before inputting it into the TLV model; First, the pipeline data is serialized and divided into time slices according to the set time_steps size; Then, the data divided into time slices was standardized using the common Z-Score method; Finally, for the standardized data, the trigonometric function position encoding method is used for position embedding; The trigonometric function position encoding method is as follows: Where pos is the position of an element in the sequence, and i is the dimension index in the encoding vector. It represents the dimension of the embedded vector; for odd-numbered dimensions and even-numbered dimensions, sine and cosine encoding methods are used respectively; Step 3: Encode the preprocessed data using the VAE encoder of the TLV model; After data compression and dimensionality reduction, the VAE encoder obtains the mean and variance of the latent space, denoted as . ; Step 4: Reparameterize the encoded data; The latent space probability distribution representation generated by the encoder The reparameterization formula is as follows: in For random variables that conform to a standard normal distribution, This is a bitwise multiplication operation; Step 5: Decode the reparameterized latent space using the VAE decoder to restore the data distribution; Step 6: Calculate the reconstruction error using the decoded data, and adjust the reconstruction error using the non-uniform weight partitioning method; First, the reconstruction error is calculated for a set of data, resulting in a set of... : Where T is the set time slice and d is the feature dimension. For preprocessed data, This is the decoded data; The non-uniform weighting method refers to the use of two methods: linear partitioning and quadratic partitioning. First, sample t points sequentially and uniformly between 0 and 1: We obtain the unnormalized weights W. For linear partitions, we take n=1, and for quadratic partitions, we take n=2. Next, to maintain consistency in magnitude, we need to normalize W. The reconstruction error is recalculated using the normalized weights, as shown in the following formula: Step 7: Set a threshold using the adjusted reconstruction error and divide the data into outlier points for anomaly detection and early warning of congestion; The threshold is obtained by the following formula: in It is a function for calculating percentiles. The sequence representing the reconstruction error is denoted by percent, which is a hyperparameter representing a manually set percentage. Data above this threshold is classified as anomalous data, and data below this threshold is classified as normal data.
2. The anomaly detection method for hydrate blockage as described in claim 1, characterized in that, In step two, data is screened based on different ratios of oil, gas and water, as well as external conditions such as subcooling; the data includes pressure difference, pipeline outlet temperature, inlet temperature and volumetric flow rate.
3. The anomaly detection method for hydrate blockage as described in claim 1, characterized in that, This method is applied to the online learning module, and its brief process is as follows: First, the pipeline data is collected on-site by sensors and delivered to the model TLV to output prediction results. The model TLV then temporarily stores the input data and output results in a structured form in the background MySQL database for subsequent processing. When users find that the prediction results need to be adjusted, the temporarily stored data is corrected and the modified data is updated in the database; Based on this, users can actively trigger the model TLV update operation to fine-tune and update the model TLV using data in the temporary database; or the model TLV update process can be automatically triggered when the temporary data reaches the time limit or quantity threshold.
4. The anomaly detection method for hydrate blockage as described in claim 3, characterized in that, During the update, not only are the training parameters of the model's TLV updated, but also the distribution parameters of the input data: mean and variance; and the first and second moments of the parameters stored in the optimizer.
Citation Information
Patent Citations
Process parameter-driven natural gas water dew point online prediction method
CN113051828A
Abnormality detection method, firewall, electronic equipment and storage medium
CN117749436A