Abnormality detection method for hydrate blockage

By constructing a deep learning model based on variational autoencoder, combining Transformer and LSTM architectures, the non-uniform weight adjustment method is adopted to solve the accuracy and generalization of hydrate blockage detection, and the early warning and dynamic update capabilities of hydrate blockage are achieved.

CN120214208APending Publication Date: 2025-06-27BEIHANG UNIV +1
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202510118639.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-24
Publication Date
2025-06-27

AI Technical Summary

Technical Problem

The prior art is difficult to accurately predict and detect hydrate blockages, especially in deep water energy development. Traditional methods lack generalization and scalability and rely on high-quality data annotations.

Method used

Using an abnormality detection model based on a variational autoencoder, combined with a Transformer encoder and an LSTM decoder, a deep learning model that can predict hydrate blockage in a multivariable, high-dimensional nonlinear environment is constructed through a non-uniform weight adjustment method.

Benefits of technology

It realizes the early warning function of hydrate blockage, improves the generalization performance and real-time performance of the model, can provide reliable prediction results in different actual production environments, and supports dynamic updates and incremental learning.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120214208A_ABST
    Figure CN120214208A_ABST
Patent Text Reader

Abstract

The invention discloses an anomaly detection method for hydrate blockage, and belongs to the crossing field of the energy chemical industry field and the artificial intelligence field. The method specifically comprises the following steps: firstly, constructing an anomaly detection model TLV based on a variational auto-encoder VAE; then, acquiring loop pipeline data, performing preprocessing of serialization, standardization and position embedding, inputting a VAE encoder of a model TLV, realizing data compression and dimension reduction, then performing re-parameterization on the encoded data, decoding a re-parameterization hidden space through a VAE decoder, and restoring data distribution; and finally, calculating a reconstruction error by using the decoded data, and adjusting the reconstruction error by using a non-uniform weight division method. Setting a threshold value by using the adjusted reconstruction error, and dividing abnormal point data for abnormal detection and early warning of blockage in advance; according to the method, high efficiency, accuracy and generalization of hydrate blockage prediction are realized, higher learning ability is achieved, and the practicability and application potential of the model are remarkably improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the cross - field of the energy chemical industry and the artificial intelligence field, and specifically relates to an anomaly detection method for hydrate blockage. Background Art

[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 deep - water energy development, hydrates have become a thorny problem due to their rapid formation (which can occur within a few hours) and the huge hazards they bring, such as production interruption, equipment damage, casualties, and oil spills.

[0004] In shallow - water production, the strategy of completely avoiding hydrate formation is usually achieved by injecting thermodynamic hydrate inhibitors (THIs) to change the phase equilibrium conditions of hydrates. However, in the absence of a flow assurance monitoring and intelligent decision - making support system, many areas of the energy development system are 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 production is huge (up to 60% by volume), resulting in a sharp increase in economic costs (about $750,000 per day) and more serious ecological threats.

[0005] In recent years, the control strategy for hydrate blockage has gradually shifted from "complete avoidance" to "risk management", that is, allowing hydrates to exist but avoiding blockages. The key to implementing this strategy lies in accurately quantifying the operational risks within the hydrate formation area. Therefore, the development of a flow assurance monitoring and intelligent decision - making system has become an urgent need for information - based deep - water energy development.

[0006] The phase change of hydrates occurring in a multiphase flow environment is essentially a multi - variable, high - dimensional non - linear problem, which makes it extremely difficult to establish an accurate mathematical model. Some studies have attempted to use data - driven machine learning methods to predict hydrate blockage, defining it as a classification problem and solving it through supervised learning. However, the performance of supervised learning depends severely on the quality of data annotation, and in actual production, it is often very difficult to accurately and timely annotate data.

[0007] In contrast, unsupervised learning methods do not rely on data labels but learn based on the inherent laws of data. Usually, during normal transportation, flow parameters are relatively stable, while hydrate blockage is a cumulative process involving particle generation, aggregation, and deposition, and develops step by step in a time - series manner.

[0008] Therefore, defining hydrate plugging prediction as a time series anomaly detection problem is a reasonable solution. Summary of the Invention

[0009] Most of the current traditional methods for hydrate plugging detection apply supervised classification models for detection, which cannot adapt to the differences between laboratory data and on-site working conditions and do not have good generalization and scalability. To address the above problems, the present invention proposes an anomaly detection method for hydrate plugging; by constructing an anomaly detection model based on a variational autoencoder, two uneven weight adjustment methods are proposed to achieve the early warning function of hydrate plugging.

[0010] The anomaly detection method for hydrate plugging is as follows:

[0011] Step 1: Construct an anomaly detection model TLV based on the variational autoencoder VAE;

[0012] The model TLV includes a VAE encoder and a VAE decoder;

[0013] The encoder of the VAE selects a Transformer Encoder, which contains 2 linearly stacked Transformer Blocks. For each Transformer Block, the data sequentially passes through the Multihead Attention layer, the Add&Norm layer, the Feed Forward layer, and the Add&Norm layer; after passing through 2 Transformer Blocks, it then passes through the last linear layer of the encoder for data compression and dimensionality reduction;

[0014] The decoder of the VAE selects an LSTM Decoder, which contains 2 linearly stacked LSTM Blocks. Each LSTM Block consists of a memory unit and three "gate" structures. After the reparameterized data passes through the LSTM Decoder, the decoded data is obtained.

[0015] Step 2: Obtain loop pipeline data;

[0016] According to the different ratios of oil, gas, and water, as well as external conditions such as subcooling degree, data is screened; the data includes differential pressure, pipeline outlet temperature, inlet temperature, and volume flow rate.

[0017] Step 3: Preprocess the pipeline data by serialization, standardization, and positional embedding, and input it into the model TLV;

[0018] First, serialize the pipeline data and divide the time slices according to the set time_steps size.

[0019] After that, the data with time slices divided is standardized using the general 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] Among them, pos is the position of the element in the sequence, i is the dimension index in the encoding vector, and d model is the dimension of the embedding vector. For odd and even dimensions, sine and cosine encoding methods are used respectively.

[0024] Step 4: Implement the encoding of the preprocessed data through the VAE encoder of the model TLV;

[0025] After the VAE encoder compresses and reduces the dimension of the data, the mean and variance of the latent space are obtained, denoted as and

[0026] Step 5: Reparameterize the encoded data;

[0027] The probability distribution representation of the latent space generated by the encoder is reparameterized, and the formula is as follows:

[0028]

[0029] Among them, ε is a random variable conforming to the standard normal distribution, and ⊙ is the bitwise multiplication operation.

[0030] Step 6: Decode the reparameterized latent space through the decoder of the VAE 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 set time slice, d is the feature dimension, y i,j is the preprocessed data, is the decoded data.

[0035] The non-uniform weight partitioning method means: adopting two methods of linear partitioning and quadratic partitioning;

[0036] First, uniformly sample t points in sequence 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] Obtain the weight W before normalization. For linear partitioning, take n = 1, and for quadratic partitioning, take n = 2. Next, to maintain consistency in magnitude, it is necessary to normalize W:

[0040]

[0041]

[0042] Use the normalized weight to recalculate the reconstruction error. The formula is as follows:

[0043]

[0044] Step Eight: Set a threshold using the adjusted reconstruction error and partition the outlier data for anomaly detection to give early warning of blockages;

[0045] The threshold is obtained from the following formula:

[0046]

[0047] where percentile is a function for calculating the percentile, represents the sequence composed of the reconstruction errors, and percent is a hyperparameter representing the percentage set manually.

[0048] Data higher than this threshold is classified as outlier data, and data lower than this threshold is classified as normal data.

[0049] Furthermore, the anomaly detection method for hydrate blockage according to the present invention is applied to an online learning module. Its brief process is as follows:

[0050] First, after the pipeline data is collected on-site by sensors and delivered to the model TLV to output the prediction result, the model TLV temporarily stores the input data and the output result in a structured form in the background MySQL database for subsequent processing use;

[0051] If the user finds that the prediction result needs to be adjusted, correct the temporarily stored data and update the modified data to the database. On this basis, the user can also actively trigger the model TLV update operation and fine-tune the model TLV using the data in the temporary database. Or when the temporarily stored data reaches the time limit or quantity threshold, the model TLV update process is automatically triggered.

[0052] During the update, not only the training parameters of the model TLV will be 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 will be updated.

[0053] The advantages of the present invention are as follows;

[0054] 1) An anomaly detection method for hydrate blockage according to the present invention adopts a deep learning method and proposes an anomaly detection model based on the variational autoencoder framework for hydrate blockage prediction; the model has approximately 100K learnable parameters. While maintaining lightweight and meeting real-time requirements, compared with traditional machine learning models, it has a stronger learning ability for complex data patterns.

[0055] 2) An anomaly detection method for hydrate blockage according to the present invention is supported by a high-quality, large-scale training dataset and uses an unsupervised training method. The proposed TLV model demonstrates stronger prediction ability and better generalization performance than traditional machine learning methods. This means that even in different actual production environments, the model can provide reliable prediction results.

[0056] 3) An anomaly detection method for hydrate blockage according to the present invention adopts two non-uniform weight adjustment methods (linear and quadratic), improves the model by increasing the weights of the later points within the time slice, and gives an early warning of the impending blockage. This enables the model to identify potential risks earlier and enhances its practicality in on-site real-time working conditions.

[0057] 4) An anomaly detection method for hydrate blockage according to the present invention constructs a model that supports dynamic update. By continuously adjusting and optimizing the threshold parameters during the running process, it continuously adapts to the new data distribution until it stabilizes. This mechanism not only enhances the adaptability of the model to environmental changes but also facilitates incremental learning, that is, gradually learning the features and patterns in new data without having to retrain the entire model, thereby improving the long-term practicality and flexibility of the model.

[0058] 5) The abnormal detection method for hydrate blockage in the present invention realizes the efficiency, accuracy, and generalization of hydrate blockage prediction by designing a deep learning abnormal detection model based on variational autoencoders, significantly improves the practicability and application potential of the model, and provides a reliable solution for the current field. Description of the Drawings

[0059] Figure 1 is a flowchart of the abnormal detection method for hydrate blockage in the present invention;

[0060] Figure 2 is an architecture diagram of the abnormal detection model based on the variational autoencoder framework in the present invention;

[0061] Figure 3 is an architecture diagram of the Transformer encoder module in the abnormal detection model proposed in the present invention;

[0062] Figure 4 is an architecture diagram of the LSTM decoder module in the abnormal detection model proposed in the present invention;

[0063] Figure 5 is a flowchart of the online learning module proposed in the present invention. Detailed Embodiment

[0064] The present invention will be further described in detail below with reference to the drawings and embodiments.

[0065] In view of the limitations of the current methods for hydrate blockage detection, the present invention proposes a deep learning-based abnormal detection method for hydrate blockage in deep-sea oil and gas pipelines. The core is to construct an abnormal detection model (Transformer-LSTM-VAE, hereinafter referred to as TLV) based on variational autoencoders (Variation Auto-Encoder, hereinafter referred to as VAE). The Transformer architecture is selected for the encoder, and the LSTM architecture is selected for the decoder. Further, two uneven weight adjustment (Uneven Weight Adjustment, hereinafter referred to as UWA) methods are proposed to achieve the early warning function of hydrate blockage.

[0066] Furthermore, the present invention designs an online learning module to support the stable operation of the model under on-site working conditions.

[0067] The abnormal detection method for hydrate blockage, as Figure 1 shown, the specific steps are as follows:

[0068] Step 1: Construct an abnormal detection model TLV based on variational autoencoder VAE;

[0069] The overall model architecture is as shown in Figure 2 Figure Figure 2 , including a VAE encoder and a VAE decoder;

[0070] The encoder of the VAE selects a Transformer Encoder, which contains 2 linearly stacked Transformer Blocks. For each Transformer Block, the data sequentially passes through the Multihead Attention layer, the Add&Norm layer, the Feed Forward layer, and the Add&Norm layer. After passing through 2 Transformer Blocks, it then passes through the last linear layer of the encoder to compress and reduce the dimensionality of the input data into a latent space, realizing the encoding of the data.

[0071] The decoder of the VAE selects an LSTM Decoder, which contains 2 linearly stacked LSTM Blocks. Each LSTM Block consists of a memory unit and three "gate" structures. After the reparameterized data passes through the LSTM Decoder, the decoded data is obtained.

[0072] Step 2: Obtain the loop pipeline data;

[0073] According to the different ratios of oil, gas, and water, as well as external conditions such as subcooling degree, the data is screened. The data includes differential pressure, pipeline outlet temperature, inlet temperature, and volume flow rate.

[0074] Step 3: Perform preprocessing of serialization, standardization, and positional embedding on the pipeline data, and input it into the model TLV;

[0075] First, the pipeline data is serialized, and time slices are divided according to the set size of time_steps.

[0076] After that, the data with divided time slices is standardized using the general Z-Score method;

[0077] Finally, for the standardized data, the trigonometric function positional encoding method is used for positional embedding; and the data after positional embedding is used as the input of the VAE encoder of the model TLV.

[0078] The trigonometric function positional encoding method is as follows:

[0079]

[0080] Among them, pos is the position of the element in the sequence, i is the dimension index in the encoding vector, d modelis the dimension of the embedding vector. For odd and even dimensions, sine and cosine encoding methods are used respectively. The reason for this is that they have the ability to generalize to positions not seen during training, enabling the model to learn the periodicity of the sequence.

[0081] Step 4: Encode the preprocessed data through the VAE encoder of the model TLV to achieve data encoding;

[0082] After the VAE encoder compresses and reduces the dimension of the data, the mean and variance of the latent space are obtained, denoted as and Achieve data encoding.

[0083] Step 5: Reparameterize the encoded data;

[0084] For calculating the loss function and making the entire training process differentiable, reparameterization is required. The probability distribution representation of the latent space generated by the encoder is For the distribution N(μ,σ 2 ), the formula is as follows:

[0085]

[0086] where ε is a random variable conforming to the standard normal distribution, and ⊙ is the element-wise multiplication operation.

[0087] This transformation not only keeps the distribution characteristics of z unchanged, but also enables direct control of the distribution of z by adjusting μ and σ, while allowing the gradient to flow smoothly through this random node.

[0088] Step 6: Decode the reparameterized latent space through the decoder of the VAE 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 set time slice, d is the feature dimension, y i,j is the preprocessed data, is the decoded data.

[0093] The non-uniform weight partitioning method means: adopting two methods of linear partitioning and quadratic partitioning;

[0094] First, uniformly sample t points in sequence between 0 and 1:

[0095] W = {s1n , 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] The weight W before normalization is obtained. For linear partitioning, take n = 1, and for quadratic partitioning, take n = 2. Then, to maintain consistency in magnitude, W needs to be normalized:

[0098]

[0099]

[0100] Use the normalized weight to recalculate the reconstruction error. The formula is as follows:

[0101]

[0102] Step Eight: Set a threshold using the adjusted reconstruction error and partition the outlier data for anomaly detection to give an early warning of blockage;

[0103] The threshold is obtained from the following formula:

[0104]

[0105] where percentile is the function for calculating the percentile, represents the sequence composed of the reconstruction errors, and percent is a hyperparameter representing the percentage set manually.

[0106] Data above this threshold is classified as abnormal data, and data below this threshold is classified as normal data.

[0107] Furthermore, the anomaly detection method for hydrate blockage according to the present invention is applied to an online learning module. Its brief process is as follows:

[0108] First, data collection. After the pipeline data is collected on-site by sensors and delivered to the model TLV for outputting the prediction result, the model TLV temporarily stores the input data and the output result 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 result needs to be adjusted, the temporarily stored data is corrected and the modified data is updated to the database to ensure data accuracy. On this basis, the user can also actively trigger the model TLV update operation, and use the data in the temporary database to fine-tune and update the model TLV, so that the model can better adapt to the current working conditions. To further enhance the automation of the system, even if the user does not perform manual operations, when the temporarily stored data reaches the time limit or quantity threshold, the model TLV update process is automatically triggered.

[0110] During the update, not only the training parameters of the model TLV are 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 always maintain the adaptability to dynamic working conditions.

[0111] Embodiment:

[0112] The present invention designs an online learning module to continuously adjust and optimize the threshold parameters during the operation of the model, so that it continuously adapts to the new data distribution until it stabilizes. Next, it will be described from three stages: model construction, model training, and model operation.

[0113] Stage 1: TLV model construction scheme

[0114] Step 1: Obtain loop pipeline data

[0115] The data used in the present invention is from the multiphase gas transmission pipeline experimental device of the Key Laboratory of Ocean Energy Utilization and Energy Conservation of the Ministry of Education. According to the different ratios of oil, gas and water, as well as external conditions such as subcooling degree, a total of more than 500,000 pieces of data are screened out in the data used in the present invention. The data includes multiple physical parameters, and the present invention selects four main physical parameters of differential pressure, pipeline outlet temperature, inlet temperature, and volume flow rate as the input of the model.

[0116] Step 2: Serialization, standardization and positional embedding of data

[0117] Step 3: Pass the preprocessed data through the encoder of VAE to compress and reduce the dimension of the data

[0118] The Transformer architecture currently shows powerful capabilities in the field of deep learning. It can well model the dependencies of long time series while improving the computational efficiency through parallel data processing. At the same time, it also has many excellent capabilities such as strong generality and support for capturing global information.

[0119] In the present invention, the encoder part of VAE selects the native Transformer Encoder, and its structure includes several Transformer Blocks, and its structure is as Figure 3As shown. After the data enters the Transformer Encoder, it first passes through the Multihead Attention layer, and the formula is as follows:

[0120]

[0121] Among them, Q, K, and V respectively represent three groups of vectors, namely query (Q), key (K), and value (V). Softmax represents the Softmax activation function. is a scaling factor used to control the size of the dot product.

[0122] Multi-head attention enables the model to simultaneously focus on elements at different positions in the sequence, thereby capturing various types of dependencies such as long-range dependencies and local dependencies.

[0123] After that, the data will pass through an Add&Norm layer, that is, first perform a residual connection with the input and then perform normalization. The obtained data will pass through a feed-forward neural network. This layer contains two fully connected layers, with an activation function interspersed in the middle. In this model, ReLU is selected as the activation function, and the formula is as follows:

[0124] FFN(x) = ReLU(xW1+b1)·W2+b2 (8)

[0125] Among them, FFN represents the feed-forward 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] So far, the data has experienced a complete Transformer Block. In the present invention, according to the experimental results, the data will experience two Blocks and then end the encoding process.

[0127] Step Four: Reparameterize the encoded data

[0128] The latent space probability distribution representation generated by the encoder hopes to make this distribution approximate the true prior probability distribution, the standard normal distribution. To calculate the loss function, it is necessary to sample the probability distribution of the latent space. However, if sampled directly, the sampling process is not differentiable, which means that standard gradient-based methods cannot be directly used to update the parameters. Therefore, reparameterization is required.

[0129] Step Five: Decode the reparameterized latent space using VAE to restore the data distribution

[0130] This model selects LSTM as the decoder, and its structure is as Figure 4 shown.

[0131] LSTM has currently achieved remarkable results in the field of time series prediction and is widely used in various tasks related to time series. LSTM evolved from RNN, inheriting the recursive structure of RNN, but solving the problems of vanishing gradients and exploding gradients that occur during the training process of standard RNN on long sequences.

[0132] LSTM consists of many memory cells (cell state) and three "gate" structures. These structures enable the network to automatically learn when to add information to the memory, when to forget irrelevant information, and when to read information from the memory, and together calculate the hidden state at each moment, overcoming the long-term dependence problem in traditional RNN.

[0133] LSTM can learn the sequential properties and changing trends of sensor data and has a powerful sequence generation ability. It is suitable for predicting anomalies related to hydrates in the present invention and can excellently reconstruct the low-dimensional latent space into the data space.

[0134] Step 6: For the decoded data obtained, calculate the reconstruction error and use the non-uniform weight division method to adjust the reconstruction error;

[0135] Different from traditional classification problems, the VAE architecture model cannot give classification results, but only the error situation between the reconstructed result of each group of data and the true value. After the model training is completed, the present invention inputs the calculated threshold set into the model to obtain a group of and tries to find a threshold such that the data above this threshold is classified as abnormal data, while the data below this threshold is classified as normal data.

[0136] The present invention uses the percentile of the error list as the standard for threshold division. This method usually sets the percentage to 80% - 95% to ensure that the identification of abnormal data is both sensitive and robust. In this way, the model will be more sensitive to the data at the later time points, thus playing a role in early warning.

[0137] In the actual industrial environment, misjudging a blockage as unblocked may lead to serious consequences, such as catastrophic events like pipeline explosions, while the cost of misjudging an unblocked situation as blocked is relatively low, usually only involving on-site inspections by engineers. Therefore, there is an urgent need for an effective early warning mechanism. In view of the inherent variation law of the hydrate blockage task and the innovative transformation of this research on the anomaly detection task, the present invention proposes a non-uniform weight division method to improve the recognition accuracy of the model for blockages.

[0138] The calculation method of traditional prediction is to evenly divide the weights for each time slice. If the time slice division contains t time points, then the same weight is set for each time point, and the error calculation method for each time slice is the same as that of formula x

[0139] The present invention improves the way of setting weights, and gives greater weights to the later time points when calculating errors within a time slice, so as to capture the occurrence of abnormal situations as early as possible by means of error amplification.

[0140] Phase II: TLV model training method

[0141] Due to the particularity of the anomaly detection task, the present invention divides the entire data set into a training set, a calculation threshold set, and a test set. First, two sets of extreme working conditions are taken out, and all the data are used for testing to verify the overall generalization of the model. For the training set and the calculation threshold set in the data of other working conditions, only normal data needs to be taken, and they are divided according to the ratio of 8:2 and a five-fold cross-validation method. All the abnormal data and the extreme working conditions are used as the test set.

[0142] After the model construction and data set division preprocessing, the training set is input into the model for training for a specified number of rounds, then the model parameters are frozen, the calculation threshold set is input, the threshold is calculated according to the percentile, and finally the test set is brought in. The errors are calculated using the standard weight, linear weight, and quadratic weight respectively, and the evaluation indexes are statistically analyzed.

[0143] The experiment of the present invention uses the TensorFlow deep learning framework for training and tuning. Two Transformer Blocks are stacked inside the Transformer Encoder, and two LSTM Layers are stacked in the LSTM Decoder. The hidden layer dimension is uniformly set to 16, the latent space dimension is set to 2, the Adam optimizer is adopted, the learning rate is set to 1e-3, the number of training rounds epoch is set to 15, the early stopping strategy is used, the weight_decay is set to 0.01, the time_step is set to 64, and through experiments, the threshold percentile perc of the reconstruction error is set to 90. In terms of hardware, this example uses an Nvidia 1650Ti graphics card for model training, inference, and backend deployment.

[0144] Phase III: Design of the online learning module during the operation of the TLV model

[0145] The present invention designs an online learning module for the operation requirements of the TLV model under actual on-site working conditions to dynamically adapt to the changes in on-site data and improve the prediction performance of the model. The process is as Figure 5 shown.

[0146] The specific process is as follows:

[0147] Step 1: Data acquisition. When the pipeline is running, the system obtains multivariate time series data in real time through data acquisition devices such as sensors. After preprocessing, these data are input into the model to generate corresponding prediction results. At the same time, this newly acquired data and prediction results will be stored in a MySQL database for subsequent processing.

[0148] Step 2: Model update. If the user finds that the prediction results need to be adjusted, the temporarily stored data can be corrected, and the system will update the modified data to the database to ensure data accuracy. On this basis, the user can also actively trigger the model update operation. At this time, the system will use the data in the temporary database to fine-tune and update the model so that the model can better adapt to the current working conditions. To further enhance the automation of the system, even if the user does not perform manual operations, when the temporarily stored data reaches the time limit or quantity threshold, the system will also automatically trigger the model update process. During the update, not only the model training parameters will be 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 will be updated.

[0149] In this way, the model can always maintain its adaptability to dynamic working conditions, ensuring the accuracy and reliability of the prediction results; in this way, the generalization and practicality of the present invention are greatly enhanced, providing reliable support for on-site applications.

[0150] The content not described in detail in the specification of the present invention belongs to the prior art well-known to those skilled in the art. It is hereby indicated that the above description helps those skilled in the art to understand the present invention, but does not limit the protection scope of the present invention. Any implementation that makes equivalent substitutions, modifications and improvements, and / or simplifies the above description without departing from the essence of the present invention falls within the protection scope of the present invention.

Claims

1. A method for detecting abnormality of hydrate blockage, characterized in that: The specific steps are as follows: Step 1: Build an anomaly detection model TLV based on variational autoencoder VAE; The model TLV includes a VAE encoder and a VAE decoder; Step 2: Obtain loop pipeline data, perform serialization, standardization and position embedding preprocessing on the pipeline data, and input the data into the model TLV; Step 3: Pass the preprocessed data through the VAE encoder of the model TLV to realize data encoding; After the VAE encoder compresses and reduces the dimension of the data, the mean and variance of the latent space are obtained, which are recorded as and Step 4: re-parameterize the encoded data; Latent space probability distribution representation generated by the encoder , the reparameterization formula is as follows: Where ε is a random variable that conforms to the standard normal distribution, and ⊙ is a bitwise multiplication operation; Step 5: Decode the re-parameterized latent space through the VAE decoder to restore the data distribution; Step 6: Calculate the reconstruction error using the decoded data, and adjust the reconstruction error using a non-uniform weight partitioning method; First, the reconstruction error is calculated for a set of data, and a set of Where T is the time slice set, d is the feature dimension, and y i,j For the preprocessed data, is the decoded data; The non-uniform weight division method refers to: using two methods: linear division and quadratic division; First, uniformly sample t points between 0 and 1: <h2 style=";text-align:left;direction:ltr">W = {s1<h2 style=";text-align:left;direction:ltr"> n <h2 style=";text-align:left;direction:ltr"> ,s2<h2 style=";text-align:left;direction:ltr"> n <h2 style=";text-align:left;direction:ltr"> ,s3<h2 style=";text-align:left;direction:ltr"> n <h2 style=";text-align:left;direction:ltr"> …s<h2 style=";text-align:left;direction:ltr"> t <h2 style=";text-align:left;direction:ltr"> n <h2 style=";text-align:left;direction:ltr">}={w1,w2,w3…w<h2 style=";text-align:left;direction:ltr"> t <h2 style=";text-align:left;direction:ltr">} Where s1=0,s t =1,s k+1 -s k =s k -s k-1 Get the weight W before normalization. For linear partitioning, take n=1, and for quadratic partitioning, take n=2. Then, in order to keep the order of magnitude consistent, W needs to be normalized: The reconstruction error is recalculated using the normalized weights, and the formula is as follows: Step 7: Use the adjusted reconstruction error to set the threshold and divide the abnormal point data for abnormality detection and early warning of congestion; Data above the threshold is classified as abnormal data, and data below the threshold is classified as normal data.

2. The abnormality detection method for hydrate blockage according to claim 1, characterized in that: In the step 1, the VAE encoder uses a Transformer Encoder, which includes two linearly stacked Transformer Blocks. For each Transformer Block, the data passes through the Multihead Attention layer, the Add&Norm layer, the Feed Forward layer, and the 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 dimension of the data; The decoder of VAE uses LSTM Decoder, which contains two linearly stacked LSTM Blocks. Each LSTMBlock consists of a memory unit and three "gate" structures. After the re-parameterized data passes through the LSTM Decoder, the decoded data is obtained.

3. The abnormality detection method for hydrate blockage according to claim 1, characterized in that: In the step 2, data are screened according to different ratios of oil, gas and water, as well as external conditions such as supercooling; the data include pressure difference, pipeline outlet temperature, inlet temperature and volume flow rate.

4. The abnormality detection method for hydrate blockage according to claim 1, characterized in that: In the step 2, first, the pipeline data is serialized and divided into time slices according to the set time_steps size; Afterwards, the data divided into time slices were standardized using the common Z-Score method; Finally, for the standardized data, the trigonometric function position encoding method is used to perform position embedding; The trigonometric function position encoding method is as follows: Where pos is the position of the element in the sequence, i is the dimension index in the encoded vector, and d model is the dimension of the embedding vector; for odd and even dimensions, sine and cosine encoding are used respectively.

5. The abnormality detection method for hydrate blockage according to claim 1, characterized in that: In step 7, the threshold is obtained by the following formula: Where percentile is a function that calculates percentiles. Represents a sequence of reconstruction errors, and percent is a hyperparameter representing a manually set percentage.

6. The abnormality detection method for hydrate blockage according to claim 1, characterized in that: This method is applied to online learning modules, and its brief process is as follows: First, after collecting pipeline data through sensors on site and delivering them to the model TLV to output prediction results, the model TLV temporarily stores the input data and output results in a structured form in the background MySQL database for subsequent processing; When the user finds that the prediction results need to be adjusted, the temporarily stored data is corrected and the modified data is updated to the database; On this basis, the user actively triggers the model TLV update operation and uses the data in the temporary database to fine-tune and update the model TLV; or when the temporary data reaches a time limit or quantity threshold, the model TLV update process is automatically triggered.

7. The abnormality detection method for hydrate blockage according to claim 6, characterized in that: When updating, not only the training parameters of the model TLV are updated, but also the distribution parameters of the input data: mean and variance; and the first-order and second-order 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

  • Unsupervised generator bearing fault detection method based on variational auto-encoder

    CN118310746A