Shale gas hydrops early warning method and system based on anti-interference multi-classification technology
By employing an early warning method based on anti-interference multi-classification technology, combined with data acquisition, preprocessing, and the Transformer model, the problems of false alarms and lag in early warning of liquid accumulation in shale gas wells have been solved. This enables rapid and accurate diagnosis and early warning of liquid accumulation status, thereby improving the stability of shale gas well production and the level of intelligent management.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CHENGDU XINYAO TIANHE TECHNOLOGY CO LTD
- Filing Date
- 2026-03-02
- Publication Date
- 2026-05-26
Smart Images

Figure CN122087619A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to, but is not limited to, the field of shale gas liquid accumulation early warning technology, and particularly relates to a shale gas liquid accumulation early warning method and system based on anti-interference multi-classification technology. Background Technology
[0002] With the efficient development of unconventional oil and gas resources becoming an important direction for the energy industry, shale gas well production management technology has received widespread attention. Shale gas wells are prone to wellbore liquid loading problems at the end of the production phase, leading to increased bottomhole pressure, decreased production, and even well shutdown, severely impacting resource recovery efficiency and oil and gas field production stability. Therefore, rapid and accurate diagnosis and early warning of shale gas well liquid loading has become a research hotspot in the industry. Shale gas is characterized by low permeability, high complexity, and multiphase flow. Its wellbore liquid loading behavior is not only affected by downhole fluid flow characteristics but also constrained by factors such as wellbore structure, production rate, and changes in operating conditions, making liquid loading assessment significantly more difficult than in conventional gas wells.
[0003] Traditional gas well liquid accumulation early warning methods are mostly based on reservoir engineering and wellbore rheological models. For example, they use the relationship between bottomhole flow pressure, gas-liquid ratio, and production to construct early warning charts and derive liquid accumulation judgment values by fitting IPR curves. These methods rely on empirical relationships between downhole pressure and production, making it difficult to effectively cope with the complex multiphase flow and real-time dynamic characteristics of shale gas wells and varying production conditions. They are also sensitive to noise data and cannot meet the real-time analysis needs of high-frequency field data. In addition, traditional prediction models often use single-variable or physical empirical formulas, which are insufficient to fully capture the nonlinear correlations and time-dependent changes between multiple production parameters.
[0004] To overcome the limitations of traditional experience-based early warning methods, some literature has proposed liquid accumulation prediction models based on machine learning. For example, neural networks or data-driven algorithms are used to classify and predict liquid accumulation states, achieving some improvement in real-time performance and generalization ability. However, existing research mainly focuses on single model building or error optimization, without systematically modeling and anti-interference discrimination for common non-liquid accumulation interference problems in production sites, nor providing a complete joint condition screening and multi-class probability constraint mechanism. This makes these methods susceptible to non-liquid accumulation anomalies such as data interruption, well shut-in, and compressor shutdown in actual operating conditions. The high probability of liquid accumulation in their predicted output is prone to false alarms or delayed judgments without an effective condition constraint mechanism, thus failing to meet the real-time and robust requirements of refined early warning in shale gas well production sites.
[0005] Therefore, existing technologies lack a method for early warning of fluid accumulation in shale gas wells that can simultaneously achieve dynamic feature modeling of multi-source time-series data, prior screening of regularized working conditions, and joint determination of anti-interference probability. Especially in production sites where interference conditions frequently occur, fluid accumulation risk assessment still suffers from technical pain points such as high false positive rates, weak anti-interference capabilities, and delayed response. These pain points are the core technical problems directly addressed by this invention through the introduction of regularized working condition screening, a multi-classification time-series coding model, and a joint constraint decision-making mechanism. Summary of the Invention
[0006] To address the problems existing in the prior art, this invention provides a shale gas liquid accumulation early warning method and system based on anti-interference multi-classification technology.
[0007] This invention is implemented as follows: a shale gas liquid accumulation early warning method based on anti-interference multi-classification technology, characterized in that the shale gas liquid accumulation early warning method based on anti-interference multi-classification technology specifically includes: S1: Data acquisition. Real-time data such as oil pressure, casing pressure, instantaneous flow rate, and post-valve pressure are collected from sensors in each well. The data is transmitted to the back-end database for standardized storage via the OPC interface.
[0008] S2: Data preprocessing, which involves cleaning, denoising, and imputing missing values in the raw data.
[0009] S3: Feature engineering computation uses multiple feature generation strategies to generate multi-dimensional time-series features based on expert knowledge and window statistics, and uses methods such as importance ranking for feature selection.
[0010] S4: Rule-based preprocessing performs preliminary screening of wellbore production data according to rules, dynamically outputs whether there is data interruption or pipeline process reversal in the current wellbore through time-series data matching algorithm, statistically analyzes key gas well parameters such as casing pressure level, compares them with empirical values, and obtains predicted probability values for signals such as "well shut-in".
[0011] S5: Feature encoding uses a Transformer-based multi-classification model to encode dynamic production data and feature-engineered data to obtain dynamic feature vectors. Static gas well data read from the data center is concatenated and input into a DNN layer to obtain static feature vectors. The static feature vectors are combined with the dynamic feature vectors to obtain a feature representation of the current comprehensive state of the gas well.
[0012] S6: Model inference, which integrates the outputs of S4 and S5 to provide an inference on whether there is abnormal liquid accumulation in the current gas well, and provides an early warning based on the output probability value.
[0013] Furthermore, in step S2, the raw data undergoes the following processing flow: (1) Invalid and missing value detection: Locate and quantify missing data in the dataset by automatically scanning and counting “NaN” standard null values, verify the validity of the data according to the measurement table range, and find invalid entries that do not conform to business logic.
[0014] (2) Interpolation / filling missing values: Weighted nonlinear interpolation filling technology is used to ensure the temporal smoothness of the filled data.
[0015] (3) Noise reduction and smoothing: Gaussian time-shifting filter is used.
[0016] Furthermore, step S3, the feature engineering calculation step, includes: (1) Short-term trend capture: Calculate gradient and curvature to measure the instantaneous trend of data change.
[0017] (2) Sliding window feature extraction: Use different sliding window sizes and take the mean, standard deviation, and maximum / minimum values of the data in the window.
[0018] (3) Change trend feature encoding: The change trend is constructed using the first-order difference and second-order difference of production data.
[0019] (4) Long-term and short-term feature extraction: Multi-period difference is added to feature engineering to calculate the difference between the current data point and the data point before a fixed period, which helps to discover periodic patterns or correlations across time steps in the data.
[0020] (5) The processed data has a dimension of 441, which is used as the input to the neural network model.
[0021] Furthermore, the structure of the multi-classification model based on Transformer in S5 is as follows: (1) Input layer: Input the 441-dimensional feature data after feature engineering into the network.
[0022] (2) Position coding layer: The sequence length is set to 100-1000.
[0023] (3) Dynamic data Encoder layer: that is, the Encoder layer in Transformer, which includes attention layer, feedforward neural network, ReLU layer, to encode dynamic data and feature-engineered data to obtain dynamic feature vectors.
[0024] (4) Static data Encoder layer: Use the static data of gas wells read from the data center, such as production date, process type, formation energy level, gas well depth, etc., to perform feature splicing and input into a DNN layer to obtain static feature vectors.
[0025] (5) Feature fusion layer: Combine static feature vectors with dynamic feature vectors to obtain the feature representation of the current comprehensive state of the gas well.
[0026] (6) MLP layer: The general feature vector of the gas well is mapped using a multilayer perceptron.
[0027] (7) Output layer: 6 neurons, corresponding to the probability values of the states of “liquid accumulation”, “compressor shutdown”, “data interruption”, “well shut-in”, “gas lift” and “other” respectively.
[0028] Furthermore, in step S6, the inference module outputs a relatively smoothly changing probability value and sets step-wise thresholds A and B. When the probability of liquid accumulation exceeds threshold A, an early warning prediction is made. If it exceeds threshold B, it indicates that liquid accumulation has occurred. If the probability of other working conditions besides liquid accumulation is too high, exceeding 80%, it is considered that the current liquid accumulation signal is interfered with by other abnormal working conditions and no liquid accumulation actually occurs.
[0029] Another objective of this invention is to provide a shale gas liquid accumulation early warning system based on anti-interference multi-classification technology, the system specifically comprising: Data center storage module: Used to receive and store raw production data from the OPC / SCADA system.
[0030] Data preprocessing module: Used to periodically retrieve raw data from the data center for a certain period of time, and perform preprocessing operations such as cleaning, noise reduction, missing value imputation, feature construction and dimensionality enhancement on the raw data.
[0031] Feature engineering calculation module: It uses a variety of feature generation strategies to generate multi-dimensional time-series features based on expert knowledge and window statistics, and uses methods such as importance ranking for feature selection.
[0032] Time-series database storage module: Stores the multi-dimensional time-series features obtained from feature engineering into the time-series database, decoupling it from the inference module so that features calculated in the past can be reused.
[0033] Inference module: Obtains static data of gas wells from the data center, classifies gas wells according to their process type, life cycle, and other information, and uses the Transformer architecture to detect and predict abnormal states such as liquid accumulation and compressor shutdown in real time.
[0034] Data visualization and model sensitivity fine-tuning module: This module provides a visual interface for users to view abnormal results and fine-tunes the model's sensitivity to detection based on user acceptance of the prediction results.
[0035] Based on the above technical solutions and the technical problems solved, the advantages and positive effects of the technical solution to be protected by this invention are as follows: Compared with existing shale gas well liquid accumulation early warning methods based on fixed threshold rules and single anomaly judgment, this invention achieves significant improvements in anti-interference capability, early warning accuracy, advance warning capability, generalization capability, and system engineering adaptability. This invention introduces a rule-based preprocessing mechanism at the model front end to automatically identify and mask non-liquidity-related interference conditions such as data interruption, well shut-in probability, compressor shutdown, and gas lift. Combined with a multi-classification model to output six types of condition probabilities and setting an 80% interference masking constraint, this effectively eliminates abnormal signal interference unrelated to liquid accumulation at the source, significantly reducing false alarms caused by changes in operating conditions in traditional methods. This results in a significantly lower false alarm rate and a marked improvement in overall accuracy for liquid accumulation early warning.
[0036] Meanwhile, by introducing a Transformer-based temporal coding structure and constructing a 441-dimensional dynamic feature system including sliding window statistical features, differential features, and periodic features, this invention can simultaneously capture the short-term fluctuations and long-term evolution trends of wellhead parameters, thereby enabling early identification before the fluid accumulation anomaly becomes fully apparent. Furthermore, by setting early warning thresholds and confirmation alarm thresholds to form a graded response mechanism, the early warning is transformed from passive triggering to active intervention, effectively shortening the anomaly handling cycle and reducing production losses.
[0037] Furthermore, this invention encodes static well conditions and process characteristics through a deep neural network and integrates them with dynamic time-series characteristics, enabling the model to adapt to the differences in data distribution under different well types, production systems, and process conditions. This results in good cross-well generalization ability and the ability to jointly identify and distinguish between fluid accumulation anomalies and various operating conditions such as compressor shutdown and well shut-in, avoiding the problem of poor applicability of single anomaly judgment methods in complex production environments.
[0038] At the system implementation level, this invention achieves feature pre-computation and reuse through a feature engineering module and a time-series database. It also reduces online inference load through module decoupling and asynchronous calling mechanisms, thereby reducing redundant computational overhead while ensuring high-frequency real-time early warning capabilities. Furthermore, by combining a cloud-edge collaborative deployment architecture, basic feature calculation and preliminary inference are completed at edge nodes, while model management and global optimization are performed in the cloud. This allows the system to maintain its early warning function even under conditions of communication interruption or network instability, significantly improving system reliability and engineering adaptability. With the addition of visualization and human feedback mechanisms, this invention also forms a closed loop for continuous model optimization and operation and maintenance, enabling system performance to iteratively improve with actual operation. Overall, it overcomes the problems of high false alarms, strong lag, and weak generalization ability of traditional methods, demonstrating outstanding engineering practical value and promising prospects for industrial promotion.
[0039] (1) The expected benefits and commercial value of the technical solution of this invention after transformation are as follows: After deployment, this invention can reduce the false alarm rate of fluid accumulation by more than 75%, provide early warnings, and shorten the recovery cycle by 1.3 days. Based on an average of 10 wells with fluid accumulation per day, this translates to an annual reduction in production loss of over 35 million cubic meters, equivalent to hundreds of millions of yuan in economic benefits. The system is compatible with existing SCADA platforms, supports distributed deployment, and possesses extremely high industrialization potential and promotional value.
[0040] (2) The technical solution of this invention fills a technical gap in the industry both domestically and internationally: While existing technologies include physical models or single-liquid accumulation prediction, a systematic solution that fully integrates "441-dimensional dynamic features + Transformer encoding + static fusion + rule preprocessing + 6-class multi-classification + 80% interference shielding + dual-threshold grading" is still lacking, especially in the case of shale gas with multiple disturbances, where anti-interference multi-classification early warning is not implemented. This invention proposes a complete anti-interference early warning framework for the first time, filling a technological gap in this field.
[0041] (3) The technical solution of the present invention solves a technical problem that people have long wanted to solve but have never been able to solve successfully: Shale gas liquid accumulation early warning has long faced challenges such as high false alarm rates due to interference, poor predictability, and difficulty in jointly distinguishing multiple operating conditions. The industry has hoped to achieve multi-classification anti-interference through rule-based assistance and deep learning, but has been limited by bottlenecks such as temporal feature construction, automatic interference masking, and effective fusion of static and dynamic data, and has not yet succeeded. This invention successfully solves this industry pain point through rule preprocessing, Transformer fusion, and probabilistic constraint mechanisms.
[0042] (4) The technical solution of the present invention overcomes technical bias: Existing technologies generally suffer from biases such as "liquid accumulation early warning only requires a single threshold or physical model," "deep learning is not suitable for industrial scenarios with multiple interferences," and "multi-classification increases the risk of false alarms." This invention overcomes these biases, proving that Transformer can achieve 95% accuracy with 441-dimensional feature support, effectively reduce false alarms with 85% masking constraints, and enhance joint recognition capabilities through multi-classification, thus successfully achieving highly robust early warning. Attached Figure Description
[0043] Figure 1 This is a flowchart of the shale gas liquid accumulation early warning method based on anti-interference multi-classification technology provided in the embodiments of the present invention.
[0044] Figure 2 This is a module diagram of a shale gas liquid accumulation early warning system based on anti-interference multi-classification technology provided in an embodiment of the present invention.
[0045] Figure 3 This is a time-series verification diagram for early warning of shale gas accumulation risk in a single well, provided in an embodiment of the present invention.
[0046] Figure 4This is a comparison chart of the performance of liquid accumulation early warning before and after the introduction of the anti-interference mechanism provided in the embodiments of the present invention.
[0047] Figure 5 This is a schematic diagram of the anti-interference decision-making mechanism provided in the embodiments of the present invention.
[0048] Figure 6 This is a probability conflict and shielding curve provided in an embodiment of the present invention.
[0049] Figure 7 This is the interference condition vs. liquid accumulation probability conflict + shielding logic provided in the embodiments of the present invention.
[0050] Figure 8 This is a performance comparison before and after the introduction of anti-interference constraints provided in the embodiments of the present invention.
[0051] In the diagram: 1. Data center storage module; 2. Data preprocessing module; 3. Feature engineering calculation module; 4. Time series database storage module; 5. Inference module; 6. Data display and model sensitivity fine-tuning module. Detailed Implementation
[0052] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.
[0053] like Figure 1 As shown, this embodiment of the invention provides a shale gas liquid accumulation early warning method based on anti-interference multi-classification technology. The method specifically includes: S1: Data acquisition. Real-time data such as oil pressure, casing pressure, instantaneous flow rate, and post-valve pressure are collected from sensors in each well. The data is transmitted to the back-end database for standardized storage via the OPC interface.
[0054] S2: Data preprocessing, which involves cleaning, denoising, and imputing missing values in the raw data.
[0055] S3: Feature engineering computation uses multiple feature generation strategies to generate multi-dimensional time-series features based on expert knowledge and window statistics, and uses methods such as importance ranking for feature selection.
[0056] S4: Rule-based preprocessing performs preliminary screening of wellbore production data according to rules, dynamically outputs whether there is data interruption or pipeline process reversal in the current wellbore through time-series data matching algorithm, statistically analyzes key gas well parameters such as casing pressure level, compares them with empirical values, and obtains predicted probability values for signals such as "well shut-in".
[0057] S5: Feature encoding uses a Transformer-based multi-classification model to encode dynamic production data and feature-engineered data to obtain dynamic feature vectors. Static gas well data read from the data center is used to concatenate features and input into a DNN layer to obtain static feature vectors. The static feature vectors are combined with the dynamic feature vectors to obtain a feature representation of the current comprehensive state of the gas well.
[0058] S6: Model inference, which integrates the outputs of S4 and S5 to provide an inference on whether there is abnormal liquid accumulation in the current gas well, and provides an early warning based on the output probability value.
[0059] This invention addresses the common problems in shale gas well production and operation, such as difficulty in monitoring liquid accumulation, strong data interference, and large on-site judgment errors. It proposes a shale gas liquid accumulation early warning method and system based on anti-interference multi-classification technology, which realizes accurate identification and real-time early warning under complex operating conditions.
[0060] This invention solves the technical problem of unstable liquid accumulation identification caused by multi-source heterogeneity and severe temporal fluctuations in sensor data during shale gas production. A standardized data acquisition and preprocessing workflow is established through steps S1 to S2, normalizing and synchronizing multi-channel signals such as oil pressure, casing pressure, flow rate, and downstream valve pressure from the OPC / SCADA system. Gaussian moving average filtering and weighted interpolation strategies are used to smooth the temporal signals, ensuring the continuity and validity of the model input data and suppressing noise interference at its source.
[0061] This invention solves the technical problem of the difficulty in quantitatively modeling the dynamic behavior of gas wells. In step S3, feature engineering mechanisms such as gradient, curvature, multi-scale sliding window, and periodic difference are designed. By constructing a high-dimensional production state space through difference and statistical description at multiple time scales, a fine characterization of wellbore pressure fluctuations, gas production stability, and energy recovery processes is achieved. After the generated 441-dimensional time-series features are sorted and filtered by importance, the computational redundancy of the model can be reduced while maintaining discriminative ability.
[0062] This invention addresses the shortcomings of traditional single-model-based liquid accumulation early warning systems, which are susceptible to abnormal disturbances such as compressor shutdowns and well shut-ins under complex operating conditions. It proposes a rule-based preprocessing module (S4). This module utilizes a time-series matching algorithm to detect data interruptions and process reversal events. By comparing parameter thresholds with an empirical database, it dynamically outputs the prior probability of the wellbore state, thus achieving interference filtering before entering model calculations and forming the first layer of protection against model disturbances.
[0063] This invention addresses the technical challenge of fusing dynamic and static features using a Transformer multi-classification architecture. In S5, a self-attention mechanism is employed to extract the temporal dependencies of dynamic features. This is then combined with a DNN network to encode static features such as well depth, formation energy, and production time into static vectors. These two vectors are then fused through a feature fusion layer to form a comprehensive feature representation of the gas well. This fusion method can simultaneously express the dynamic evolution of the wellbore and static geological conditions, providing a unified representation space for complex state identification.
[0064] The model inference mechanism of this invention achieves logical hierarchy and probabilistic smoothing at the anti-interference decision-making level. In S6, by setting thresholds A and B, the liquid accumulation risk is divided into three intervals: early warning, alarm, and false alarm shielding. This allows the model to generate a smooth and continuous response during the probability transition phase, avoiding false alarms caused by instantaneous fluctuations. Simultaneously, when the probability of other abnormal categories (such as compressor shutdown, gas lift, etc.) exceeds 80%, the model automatically determines that the liquid accumulation signal is affected by disturbances, thereby reducing the false alarm rate.
[0065] At the system level, a complete anti-interference liquid accumulation early warning closed loop is constructed through the distributed collaboration of data center, feature computation, inference, and display modules. Feature engineering results are stored in a time-series database for rapid recall and iterative reuse in subsequent models; the inference module monitors wellbore conditions in real time and outputs multi-class probability distributions; the user interface visualizes prediction results and supports sensitivity adjustment to achieve adaptive optimization of the model. In industrial deployments, the overall system can achieve millisecond-level status recognition and stable early warning, significantly improving the intelligent management level of shale gas well production.
[0066] This invention provides a shale gas liquid accumulation early warning method based on anti-interference multi-classification technology, used for real-time identification and early warning of gas well liquid accumulation risk under complex operating conditions and noise interference, thereby improving the reliability and accuracy of monitoring. The method includes the following steps.
[0067] First, step S1 is executed to collect data. Real-time production operation sequence data, such as oil pressure, casing pressure, instantaneous flow rate, and downstream valve pressure, are collected from sensors deployed at each gas well. This data is transmitted to the backend data center via an OPC interface and stored in a standardized format to provide a reliable data foundation for subsequent analysis.
[0068] Then, step S2 is executed to preprocess the collected raw data. The preprocessing includes cleaning outliers and duplicate values, smoothing or filtering high-frequency noise, and interpolating or completing missing data, thereby improving the continuity, consistency, and usability of the data and reducing the interference of noise and collection anomalies on the model's judgment.
[0069] Next, step S3 is executed to perform feature engineering calculations. By combining expert experience rules and sliding window statistical methods, multi-dimensional production dynamic features are constructed from the original time series data, including trend features, fluctuation features, and relative change features. The generated candidate features are evaluated and ranked in importance, and a set of features that contributes more to the identification of working conditions is selected to reduce the computational complexity and overfitting risk caused by redundant features.
[0070] Then, step S4 is executed for rule-based preprocessing. Based on pre-set production operation rules and experience thresholds, the wellbore time series data is initially screened. The time series matching algorithm dynamically determines whether there are data interruptions, process reversals, abnormal jumps, etc. At the same time, key parameters such as casing pressure and oil pressure are statistically analyzed and compared with experience intervals to obtain predicted probability values representing states such as "well shut-in" and "condition switching". These values are used to constrain and assist subsequent model inferences.
[0071] Next, step S5 is performed to encode features. A Transformer-based multi-classification model is used to encode the production dynamic time-series data and the feature-engineered data to obtain a dynamic feature vector representing the current dynamic behavior of the wellbore. Simultaneously, static attribute data of the gas well is read from the data center and encoded through a fully connected neural network layer to obtain a static feature vector. The dynamic feature vector and the static feature vector are then concatenated or fused to form a feature representation of the gas well's current comprehensive operating status.
[0072] Finally, step S6 is executed to perform model inference and early warning output. Combining the rule prediction results output in step S4 and the comprehensive state characteristics output in step S5, a multi-classification inference model is used to determine whether there is an abnormality of liquid accumulation in the current gas well, and the corresponding risk probability value is output. When the risk probability exceeds a preset threshold, a liquid accumulation early warning is triggered, thereby realizing real-time and reliable monitoring and early warning of the liquid accumulation condition of shale gas wells.
[0073] Through the above method, this invention achieves stable identification of liquid accumulation anomalies in complex production scenarios by introducing an anti-interference multi-classification framework that combines rule constraints with deep learning models, effectively reducing the probability of false alarms and false negatives, and improving the production safety and intelligent operation management level of shale gas wells.
[0074] In step S2, the raw data undergoes the following processing flow: (1) Invalid and missing value detection: First, the missing data in the dataset is located and quantified by automatically scanning and counting the standard "NaN" null values. Then, the validity of the data is verified according to the measurement table range, such as data type, value range, and format, so as to find invalid entries that do not conform to the business logic.
[0075] (2) Interpolation / filling missing values: Weighted nonlinear interpolation filling technology is used to ensure the temporal smoothness of the filled data.
[0076] (3) Noise reduction and smoothing: Gaussian time-shifting filter is used.
[0077] The S3 feature engineering calculation step includes: (1) Short-term trend capture: Calculate the gradient and curvature to measure the instantaneous trend of data change. The gradient is the first-order difference and the curvature is the second-order difference.
[0078] (2) Sliding window feature extraction: Use different sliding window sizes and take the mean, standard deviation, and maximum / minimum values of the data in the window.
[0079] (3) Change trend feature encoding: The change trend is constructed using the first-order difference and second-order difference of production data.
[0080] (4) Long-term and short-term feature extraction: Due to the limitation of the Transformer sequence length, it is impossible to capture the correlation of long-term sequences. Therefore, multi-period difference is added to the feature engineering to calculate the difference between the current data point and the data point a fixed period ago, which helps to discover periodic patterns or correlations across time steps in the data.
[0081] (5) The processed data has a dimension of 441, which is used as the input to the neural network model.
[0082] The structure of the multi-classification model based on Transformer in S5 is as follows: (1) Input layer: Input the 441-dimensional feature data after feature engineering into the network.
[0083] (2) Position coding layer: The sequence length is set to 100-1000.
[0084] (3) Dynamic data Encoder layer: that is, the Encoder layer in Transformer, which includes attention layer, feedforward neural network, ReLU layer, to encode dynamic data and feature-engineered data to obtain dynamic feature vectors.
[0085] (4) Static data Encoder layer: Use the static data of gas wells read from the data center, such as production date, process type, formation energy level, gas well depth, etc., to perform feature splicing and input into a DNN layer to obtain static feature vectors.
[0086] (5) Feature fusion layer: Combine static feature vectors with dynamic feature vectors to obtain the feature representation of the current comprehensive state of the gas well.
[0087] (6) MLP layer: The general feature vector of the gas well is mapped using a multilayer perceptron.
[0088] (7) Output layer: 6 neurons, corresponding to the probability values of the states of “liquid accumulation”, “compressor shutdown”, “data interruption”, “well shut-in”, “gas lift” and “other” respectively.
[0089] In step S6, the inference module outputs a relatively smooth probability value and sets step-wise thresholds A and B. When the probability of liquid accumulation exceeds threshold A, an early warning prediction is made. If it exceeds threshold B, it indicates that liquid accumulation has occurred. If the probability of other working conditions besides liquid accumulation is too high, exceeding 80%, it is considered that the current liquid accumulation signal is interfered with by other abnormal working conditions and no liquid accumulation actually occurs.
[0090] like Figure 2 As shown, the shale gas liquid accumulation early warning system based on anti-interference multi-classification technology provided by this embodiment of the invention specifically includes: Data Center Storage Module 1: Used to receive and store raw production data from the OPC / SCADA system, supporting high-frequency writing, historical archiving, and fast retrieval.
[0091] Data preprocessing module 2: This module is used to periodically retrieve raw data from the data center for a certain period of time and perform preprocessing operations such as cleaning, denoising, missing value imputation, feature construction, and dimensionality enhancement on the raw data.
[0092] Feature Engineering Calculation Module 3: Uses multiple feature generation strategies to generate multi-dimensional time-series features based on expert knowledge and window statistics, and uses methods such as importance ranking for feature selection.
[0093] Time series database storage module 4: Stores the multi-dimensional time series features obtained from feature engineering into the time series database, decoupling it from the inference module so that features calculated in the past can be reused, reducing inference latency.
[0094] Inference Module 5: Obtain static data of gas wells from the data center, classify gas wells according to their process type, life cycle, and other information, and use the Transformer architecture to detect and predict abnormal states such as liquid accumulation and compressor shutdown in real time.
[0095] Data visualization and model sensitivity fine-tuning module 6: This module provides a visual interface for users to view abnormal results and fine-tunes the sensitivity of the model detection based on the user's acceptance of the prediction results.
[0096] The system supports a continuous iterative optimization mechanism. Due to well aging and process changes, the model will be retrained periodically. The model will be fine-tuned and trained for wells with different processes and different cycles to populate the model library. Based on customer feedback, reinforcement learning will be used to automatically fine-tune the model sensitivity for each well.
[0097] The shale gas liquid accumulation early warning system based on anti-interference multi-classification technology provided in this invention operates on a closed-loop mechanism encompassing data acquisition, feature construction, decoupled storage, intelligent reasoning, and feedback optimization. First, the data center storage module 1 receives high-frequency raw production data from the OPC / SCADA system, including wellhead pressure, casing pressure, oil pressure, gas production, water cut, temperature, and compressor operating status. This data is stored in a standardized manner, archived historically, and retrieved quickly, providing a stable data foundation for subsequent analysis. Then, the data preprocessing module 2 extracts continuous time-period data from module 1 according to a set time window. Abnormal fluctuations and random noise are filtered and smoothed, missing data is interpolated, and derived features such as trend change rate, fluctuation intensity, and pressure gradient are constructed to improve data quality and anti-interference capabilities from the source.
[0098] After basic cleaning, feature engineering calculation module 3 combines expert experience rules and statistical window methods to generate multi-scale, multi-dimensional time-series features. It then optimizes feature combinations through feature importance ranking and redundancy filtering mechanisms, improving the ability to identify complex operating conditions. The multi-dimensional time-series features generated by module 3 are written into the time-series database storage module 4, achieving structural decoupling between feature calculation and inference processes. This allows historical features to be reused, significantly reducing real-time inference latency and improving system response speed.
[0099] The inference module 5 acquires static attribute data of gas wells, such as process type, production stage, and life cycle information, from the data center storage module 1 to classify well types. Simultaneously, it reads feature sequences from the time-series database storage module 4 and establishes a multi-classification anti-interference model based on the Transformer architecture to perform real-time detection and trend prediction of abnormal states such as liquid accumulation and compressor shutdown. The model identifies gradual abnormal evolution processes through its long-sequence dependency capture capability, thereby achieving early warning.
[0100] Finally, the data visualization and model sensitivity fine-tuning module 6 presents the prediction results to the user, who can adjust the sensitivity of anomaly detection based on field experience. User feedback is incorporated into the reinforcement learning optimization mechanism, adaptively updating the single-well threshold and discrimination boundary. The system combines a periodic retraining strategy with a well-specific model library management mechanism to achieve continuous iterative optimization of the model, forming a dynamic, adaptive, and interference-resistant intelligent early warning closed-loop system for shale gas liquid accumulation.
[0101] Example 1: Overall implementation of a liquid accumulation early warning method based on anti-interference multi-classification.
[0102] Sensors were deployed on 40 gas wells in a shale gas block in the Sichuan Basin to collect real-time data such as oil pressure, casing pressure, instantaneous flow rate, and post-valve pressure. The data was connected to a backend database via an OPC interface, and the system automatically calibrated and standardized the data according to timestamps. Subsequently, a data preprocessing module denoised and filled in missing values, using a Gaussian moving average filter to eliminate random disturbances and generate a continuous, smooth time-series signal.
[0103] The feature engineering module extracts multi-dimensional time-series features, which are then input into the Transformer multi-classification model. The model outputs the probability distribution of the liquid accumulation state. Thresholds A=0.6 and B=0.85 are set. When the probability of liquid accumulation exceeds 0.6, an early warning is triggered; when it exceeds 0.85, an alarm signal is issued. Through three months of continuous monitoring, the model accurately identified liquid accumulation conditions 22 times, with a false alarm rate of less than 5%.
[0104] Example 2: Implementation of data preprocessing process.
[0105] A production data sample from the second quarter of 2024 was selected from a well, in which 12% of the data was missing due to sensor signal interference. The system first performed invalid value detection to remove abnormal peak points. Then, weighted interpolation was applied to interpolate missing points in adjacent valid intervals to maintain the continuity of the time series trend. Gaussian filtering was performed on abrupt signals using a data window of length 20 to eliminate spike noise.
[0106] After preprocessing, the signal waveform tends to stabilize, and the data integrity is improved to 99.8%. After the model is trained on this dataset, its validation set accuracy is improved by about 11% compared with the unprocessed dataset, indicating that the data smoothness and effectiveness are significantly enhanced, supporting the technical effect of claim 2.
[0107] Example 3: Multi-timescale feature engineering calculation.
[0108] Oil pressure and casing pressure data for 1000 consecutive hours were extracted from the gas well production log. First-order and second-order rates of change were calculated for each time point to capture short-term fluctuation trends. The mean, standard deviation, and extreme value difference were then calculated over 5-hour, 24-hour, and 72-hour windows. Periodic difference features were introduced to describe the periodic correlation of pressure changes.
[0109] All features are combined to form a 441-dimensional feature vector, and the top 120 key features are selected using a feature importance algorithm. This feature vector, when used as input to the model, can clearly distinguish between three states: liquid accumulation, gas lift, and well shut-in, verifying the feasibility of the feature engineering mechanism described in claims 3 and 4.
[0110] Example 4: Feature selection and dimensionality reduction verification.
[0111] In the multi-well joint dataset, feature importance was ranked using a random forest model, and the top 441 features were retained for model input. Principal component analysis was used to reduce the dimensionality of the feature matrix to eliminate collinearity. Cross-validation revealed that the model with the 441-dimensional structure performed best; further dimensionality reduction led to a decrease in recall.
[0112] This process demonstrates that there is an optimal balance between the number of features and model performance. The 441-dimensional feature space retains key physical parameter information while controlling training complexity, supporting the rationality of the feature dimension limitation in claim 4.
[0113] Example 5: Application of Transformer feature encoding structure.
[0114] A feature encoding network based on the Transformer architecture is deployed in the gas well monitoring system. The input layer receives a 441-dimensional feature vector, the position encoding layer processes time series with a sequence length of 500, and the dynamic encoding layer consists of four attention modules to capture temporal dependencies. The static encoding layer processes static attributes such as well depth, formation pressure, and production time, and generates static feature vectors through a fully connected neural network.
[0115] The fusion layer concatenates dynamic and static features, activates them using ReLU, and then feeds them into a multilayer perceptron, ultimately outputting probability distributions for six different operating conditions. Results show that the model achieves a 93% accuracy rate in identifying liquid accumulation and maintains stable output even under complex conditions, supporting the model structure design of claims 5 and 6.
[0116] Example 6: Multi-class output mechanism test.
[0117] Historical data from 10 gas wells in a shale gas field were selected for training and validation. The model's output layer contains 6 neurons, corresponding to six states: fluid accumulation, compressor shutdown, data interruption, well shut-in, gas lift, and others. The output probability values are normalized using the softmax function. Experiments show that this output structure can maintain class separation even under multiple coexisting anomalies, avoiding false alarms from a single class.
[0118] During the on-site trial operation, the system successfully identified multiple compressor shutdowns and air-lift conditions and distinguished them from liquid accumulation anomalies, verifying the anti-interference performance of the multi-classification structure of the output layer and supporting the actual effect of claim 6.
[0119] Example 7: Anti-interference reasoning mechanism based on probability threshold.
[0120] To address the persistent false alarms related to fluid accumulation in a certain well, the system employs a dual-threshold strategy for probability control. When the model outputs the probability of fluid accumulation, a time-smoothing algorithm is used to suppress instantaneous jumps, and then thresholds A=0.6 and B=0.85 are used to determine whether a warning or alarm is triggered. When the probability of compressor shutdown exceeds 80%, the system automatically disables the fluid accumulation alarm to avoid false alarms.
[0121] During the 6-month operation period, the accuracy of the liquid accumulation alarm improved from 82% to 95%. The results show that the probability grading and shielding logic can effectively counteract external abnormal interference, fully verifying the technical principle of claim 7.
[0122] Example 8: System integration and application.
[0123] A complete liquid accumulation early warning system is deployed in the production control center. The system includes a data center storage module, a feature calculation module, an inference module, and a visualization module. Data is transmitted from the wellhead in real time at 1-minute intervals, processed by edge computing nodes, and then aggregated to the cloud. The inference module makes predictions every 5 minutes and displays the results on the control screen in real time.
[0124] When the risk of fluid accumulation increases, the system displays a color-coded warning on the interface and sends an alert to maintenance personnel via SMS. Multi-well joint testing shows that the system's overall response time is less than 10 seconds, fully meeting the real-time requirements of the field and supporting the system architecture of claim 8.
[0125] Example 9: Module decoupling and feature reuse.
[0126] In large-scale cluster deployments, the system employs an asynchronous data access mechanism to reduce inference latency. Feature engineering results are stored in a time-series database, and the inference module reads the latest available features from the database through task scheduling, eliminating the need to repeatedly calculate historical features.
[0127] This mechanism improves model inference efficiency by approximately 40% and enables different algorithm models to share the same feature data, thereby enhancing the system's scalability and maintainability and supporting the module decoupling design of claim 9.
[0128] Example 10: Distributed deployment and cloud-edge collaboration.
[0129] Edge computing units are set up in shale gas production areas for local data acquisition and preliminary feature extraction. Each node uploads the generated feature vectors to the cloud center for model inference and centralized management. The cloud can dynamically distribute model parameters according to the characteristics of different well groups, achieving regional adaptive optimization.
[0130] This deployment method effectively reduces data transmission volume and latency, while maintaining local predictive capabilities even during communication interruptions. Practical application demonstrates that the cloud-edge collaborative architecture significantly enhances system reliability and maintainability, supporting the industrial application feasibility of claim 10.
[0131] To verify the practical technical effectiveness of this invention, a pilot deployment and test was conducted for eight months in a shale gas producing area (covering 160 wells) in a Southwest oil and gas field, with an average daily data processing volume exceeding 600,000 records. The test employed a before-and-after comparison method: performance indicators were evaluated before the introduction of the anti-interference mechanism (stage 3, mainly relying on the basic multi-classification model) and after its introduction (stage 4, complete rule preprocessing + 80% interference shielding + static and dynamic fusion). The results are as follows (data recorded by the company's internal monitoring system and audited by a third party): The accuracy of early warning and the ability to resist interference have been significantly improved: Before the introduction of the anti-interference mechanism, the model accuracy was 60% and the recall rate was 80%, with a high false alarm rate under interference conditions; after the introduction, through rule preprocessing (data interruption, well shut-in identification) + multi-class probability constraints, the accuracy was improved to 85% and the recall rate was improved to 95%, and the false alarm rate of liquid accumulation was reduced from 27% to 6.5%, effectively shielding non-liquid accumulation interference such as compressor shutdown and gas lift.
[0132] The early warning time and response efficiency have been greatly improved: before the anti-interference, the average early warning time was about 2 hours; after the anti-interference, by using Transformer time-series coding + 441-dimensional dynamic features + static and dynamic fusion, the average early warning time has been extended to 3 hours (more than 12 hours in some cases), the single well production cycle has been shortened by 1.3 days, unplanned shutdown events have been reduced by 58%, and the cumulative reduction in production loss in 4 months is about 20 million cubic meters.
[0133] Enhanced generalization ability and multi-condition recognition performance: After testing across wells with different processes / cycles, the generalization F1 score of the model after anti-interference reached over 0.9, and the proportion of correct identification of interference conditions in multi-class output was 93%, which is significantly better than the joint discrimination ability before anti-interference.
[0134] Real-time performance and system efficiency optimization: After module decoupling and feature reuse, the latency of a single inference is stabilized within 0.6 seconds, supporting 160 wells of concurrent response, and reducing the overall system load by 40%.
[0135] like Figure 3The figure shows the time-series verification results of liquid accumulation early warning during single-well shale gas production. The figure uses approximately a 10-day time period, with the horizontal axis representing the time series and the vertical axis representing gas volume, pressure parameters, and the probability of liquid accumulation risk, respectively. Multiple curves simultaneously demonstrate the correspondence between wellhead operating conditions and model output. Specifically, the green curve represents the gas volume change trend, the blue and orange curves represent the changes in pressure-related parameters, and the red curve represents the probability of liquid accumulation risk output by the model. The figure clearly shows that even before a significant drop in gas volume and pressure anomalies occur at the wellhead, the probability of liquid accumulation risk output by the model has already begun to rise continuously. An early warning signal is triggered when the risk probability first significantly increases. There is an approximately 12-hour lead time between this moment and the subsequent actual occurrence of liquid accumulation (i.e., when gas volume significantly decreases and enters a low steady-state phase). The figure clearly marks the "prediction window of 12 hours," which intuitively shows that the anti-interference multi-classification model constructed by this invention can identify potential risks before the liquid accumulation becomes fully apparent, realizing the transformation from traditional post-event judgment to pre-event prediction. This allows maintenance personnel sufficient time for manual intervention and process adjustment, avoiding passive well shutdowns and production losses caused by liquid accumulation.
[0136] like Figure 4 The figure shows a comparison of model performance before and after the introduction of the anti-interference mechanism. The horizontal axis represents the model iteration stage, where stage 3 represents the baseline model before the introduction of anti-interference rules and multi-class constraints, and stage 4 represents the improved model after the introduction of rule preprocessing, interference shielding constraints, and multi-class output. The three sets of bars correspond to the three core indicators of accuracy, recall, and early warning time, respectively, and their specific values are marked in the figure: under stage 3 conditions, the accuracy is 60%, the recall is 80%, and the early warning time is 2 hours; under stage 4 conditions, the accuracy increases to 85%, the recall increases to 95%, and the early warning time is extended to 3 hours. It can be seen that after the introduction of the anti-interference mechanism, the accuracy is improved by about 41.7%, the recall increases by about 18.75%, and the early warning time is extended by about 50%. All three indicators show a significant improvement trend, indicating that rule preprocessing and interference shielding mechanisms can effectively reduce the interference of non-liquid conditions such as well shut-in, compressor shutdown, and gas lift on the model's judgment, thereby significantly reducing false alarms and false negatives, and improving the model's sensitivity and stability to real liquid anomalies.
[0137] comprehensive Figure 3 and Figure 4The verification results show that the present invention, by constructing a rule preprocessing and multi-classification anti-interference mechanism and combining it with time series modeling to achieve early risk identification, not only achieves stable early warning of fluid accumulation anomalies at the single well level, but also significantly outperforms traditional methods based on fixed thresholds and single judgment logic in overall performance. It demonstrates outstanding substantive features and significant technological progress in terms of accuracy, anti-interference ability, early warning, and system robustness, and has good engineering application value and industrial promotion prospects.
[0138] like Figure 5 As shown, this invention proposes an overall framework for a shale gas liquid accumulation early warning method based on anti-interference multi-classification technology. This method uses multi-source time-series data from the shale gas well production process as input, and through regularized chemical condition screening, multi-classification time-series modeling, and a joint constraint decision-making mechanism, achieves accurate judgment and early warning of wellbore liquid accumulation risk under complex interference conditions.
[0139] The multi-source time-series data includes, but is not limited to, continuous monitoring data reflecting the wellbore operating status, such as oil pressure, casing pressure, gas production flow rate, and post-well pressure. First, the collected multi-source time-series data undergoes preprocessing and feature engineering. Through time window encoding, rate of change extraction, and time-series alignment, a feature set describing the dynamic characteristics of wellbore operation is formed, providing a unified input for subsequent multi-classification modeling.
[0140] Meanwhile, to address common non-liquid-accumulation interference conditions during on-site production, such as data interruption, well shut-in, and compressor shutdown, this invention introduces a rule-based working condition screening module. This module identifies the working conditions of the multi-source time-series data based on time-series matching relationships and parameter range judgment rules, generating prior information indicating whether the wellbore is in a state of data interruption, well shut-in, compressor shutdown, or other non-liquid-accumulation interference, and outputs the confidence level of the corresponding working condition in probabilistic form.
[0141] In the specific data processing, the collected multi-source time-series data, including oil pressure, casing pressure, gas production flow rate, and post-well pressure, are first aligned to a unified time base. Data with different sampling frequencies are resampled, and fixed-length time-series segments are constructed using a sliding time window. Subsequently, outlier removal and noise suppression are performed on the raw data, employing a combination of median filtering and exponential smoothing to eliminate abrupt changes. For missing data, linear interpolation or local regression methods are used to fill in gaps based on the trends of previous and subsequent time points to ensure sequence continuity. Based on this, statistical features such as first- and second-order rates of change, local fluctuation intensity, mean and standard deviation, peak-to-valley difference, and trend slope are extracted, and cross-features are constructed by combining the correlations between multiple variables to achieve a multi-dimensional representation of the wellbore operating status. Simultaneously, the time window is positionally encoded to enhance the model's ability to identify periodic changes and long-term dependencies.
[0142] After feature construction is completed, the feature set is input into the rule-based working condition screening module. Through threshold interval matching, logical rule judgment, and time-series continuity constraints, it identifies interfering working conditions such as data interruption, well shutdown, and compressor stoppage, and calculates the probability of occurrence of each condition. Ultimately, a unified data vector containing structured time-series features and prior probabilities of working conditions is formed, providing high-quality input for the stable training and anti-interference identification of subsequent multi-classification models.
[0143] like Figure 6 As shown, in the multi-class time series modeling stage, this invention inputs the dynamic feature set into a multi-class time series coding model, preferably using a Transformer-based multi-class model, to jointly model the multivariate time series features and output probability distribution results corresponding to various wellbore operating conditions, including at least the probability of fluid accumulation and the probabilities of various non-fluid accumulation disturbance conditions. Therefore, the changing trends of fluid accumulation risk and disturbance intensity can be simultaneously characterized at the same time series point.
[0144] like Figure 6 As shown, the horizontal axis represents the time series sampling points t1 to t24, and the vertical axis represents the predicted probability value (0-1) for each operating condition. The blue curve represents the probability Pliq of the liquid accumulation condition, and the green curve represents the probability Pintf of the non-liquid accumulation interference condition. Two decision threshold lines are set in the figure, where the gray dashed line is the warning threshold A, and the blue dashed line is the interference shielding threshold, used to distinguish between the effective liquid accumulation risk and the false high probability interval caused by interference. By simultaneously displaying the two types of probability curves on the same time axis, the dynamic coupling relationship between liquid accumulation risk and interference intensity can be intuitively reflected.
[0145] During stages t1 to t10, both Pliq and Pintf are at low levels, significantly below their respective thresholds, indicating normal production status. From t11 onwards, Pintf rises rapidly, peaking between t13 and t15, while Pliq also rises and approaches the warning threshold A. This stage typically corresponds to interference scenarios such as compressor shutdown, momentary well shutdown, or data fluctuations. The shaded area in the diagram indicates the interference shielding interval. When Pintf is above the shielding threshold, even if Pliq reaches or slightly exceeds the warning threshold A, the system will not trigger a liquid accumulation alarm based on the joint constraint decision-making mechanism, effectively suppressing false alarms.
[0146] As time progresses to t16, Pintf gradually decreases and falls below the shielding threshold, while Pliq remains at a high level and continues to approach or exceed the threshold A. At this point, the influence of interference factors weakens, and the model's output probability of fluid accumulation becomes more realistic. The system initiates an early warning or confirmation alarm process based on joint constraint rules. Through comprehensive analysis of the probability distribution change trend, threshold position, and interference shielding interval, the system can accurately identify the risk escalation process caused by the actual evolution of fluid accumulation, rather than false fluctuations caused by instantaneous interference. The attached figure fully demonstrates the synergistic effect of multi-class time-series modeling and anti-interference decision-making mechanisms, achieving stable judgment and refined early warning of fluid accumulation risk under complex wellbore conditions.
[0147] like Figure 7 As shown, this invention constructs an anti-interference liquid accumulation risk judgment logic by jointly constraining the prior information of the working conditions obtained from regular working condition screening with the probability distribution output by the multi-classification model. Specifically, when the probability of a non-liquid accumulation interference condition exceeds a preset interference threshold, the wellbore is determined to be in a strong interference state at the current moment, and the liquid accumulation warning result is automatically suppressed; when the interference probability is lower than the interference threshold, the liquid accumulation confirmation warning, liquid accumulation early warning, or normal operation judgment result are output according to the relationship between the liquid accumulation probability and different preset risk thresholds, thereby avoiding false triggering of liquid accumulation alarms when interference is dominant.
[0148] like Figure 7 As shown, this invention introduces a joint constraint judgment mechanism of "regular chemical condition screening results + multi-classification model probability output" in the liquid accumulation early warning decision-making stage, forming a liquid accumulation risk judgment process with a clear logical path and anti-interference capability. The system first receives multi-source time-series data such as oil pressure, casing pressure, gas production flow rate, and post-well pressure as input. After the preprocessing module completes cleaning, interpolation, and filtering operations, the data is simultaneously sent to the feature engineering module to construct multi-scale time-series features and to the regular chemical condition screening module.
[0149] In the rule-based operating condition screening module, based on threshold range judgment, state persistence constraints, and variable combination relationships, operating condition identification is performed on time-series data to determine whether typical non-liquid-accumulation interference situations exist, such as data interruption, well shut-in, compressor shutdown or switching, and the probability of occurrence of the corresponding interference category is output. This module further extracts the maximum probability of the interference category as the interference intensity index Pintf, which is used to characterize the degree of influence of the non-liquid-accumulation operating condition on the judgment result at the current moment.
[0150] Meanwhile, the time-series features, after feature engineering, are input into the multi-class classification model. A Transformer structure is preferably used to model long-term dependencies, outputting a multi-class probability distribution including the liquid accumulation condition, where the liquid accumulation probability is denoted as Pliq. Subsequently, the system enters the joint constraint decision layer, first determining whether Pliq is greater than or equal to a preset interference threshold (e.g., 0.80). If this condition is met, the wellbore is considered to be in a state dominated by strong interference at the current moment. Even if the liquid accumulation probability output by the multi-class model is high, it is directly judged as "affected by interference," and the liquid accumulation alarm is masked, fundamentally avoiding false alarms caused by well shutdown, machine stoppage, or data anomalies.
[0151] When Pintf is below the interference threshold, the system considers the impact of the interference factor to be limited and instead performs a more refined judgment based on the relationship between the fluid accumulation probability Pliq and the multi-level risk thresholds. Specifically, when Pliq is greater than or equal to the higher risk threshold B, a "fluid accumulation alarm confirmation" result is output; when Pliq is between the early warning threshold A and threshold B, an "early warning of fluid accumulation" is output, indicating that there is a fluid accumulation trend in the wellbore; when Pliq is below threshold A, it is judged to be in a "normal / observation" state, and no alarm is triggered. Through the above-mentioned graded judgment logic, a layered response to fluid accumulation risk is achieved.
[0152] This joint constraint decision-making mechanism prioritizes interference, effectively suppressing misjudgments in interference-dominated scenarios while ensuring the sensitivity of liquid accumulation identification. This significantly improves the stability and engineering usability of liquid accumulation early warning results under complex working conditions of shale gas wells.
[0153] like Figure 8 As shown, by introducing the anti-interference joint constraint mechanism into the liquid accumulation early warning decision layer, the false alarm rate of liquid accumulation can be significantly reduced compared with the model stage without enabling anti-interference constraints. At the same time, while ensuring the accuracy of the early warning, the effective early identification of liquid accumulation anomalies is achieved, which verifies the stability and practicality of the method of the present invention under complex working conditions.
[0154] The embodiments of this invention achieve anti-interference early warning of liquid accumulation risk under complex interference conditions in shale gas wells by combining regular chemical condition screening, multi-class probabilistic modeling and joint constraint decision-making. It has good engineering adaptability and promotion value.
[0155] It should be noted that embodiments of the present invention can be implemented in hardware, software, or a combination of both. The hardware portion can be implemented using dedicated logic; the software portion can be stored in memory and executed by a suitable instruction execution system, such as a microprocessor or dedicated-design hardware. Those skilled in the art will understand that the above-described devices and methods can be implemented using computer-executable instructions and / or included in processor control code, for example, such code provided on a carrier medium such as a disk, CD, or DVD-ROM, a programmable memory such as read-only memory (firmware), or a data carrier such as an optical or electronic signal carrier. The devices and modules of the present invention can be implemented by hardware circuitry such as very large-scale integrated circuits or gate arrays, semiconductors such as logic chips, transistors, or programmable hardware devices such as field-programmable gate arrays, programmable logic devices, etc., or by software executed by various types of processors, or by a combination of the above-described hardware circuitry and software, such as firmware.
[0156] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any modifications, equivalent substitutions, and improvements made by those skilled in the art within the scope of the technology disclosed in the present invention, and within the spirit and principles of the present invention, should be covered within the scope of protection of the present invention.
Claims
1. A shale gas liquid accumulation early warning method based on anti-interference multi-classification technology, characterized in that, Includes the following steps: S1: Collect multi-source time-series data on the production process of shale gas wells and construct a dynamic feature set to characterize changes in wellbore operating status; S2: Perform rule-based chemical condition screening on the multi-source time series data, and generate prior information of non-liquid accumulation interference conditions by judging the time series matching relationship and parameter range, and express it as interference probability in probabilistic form; S3: Input the dynamic feature set into the multi-class temporal coding model and output a probability distribution containing the probability of liquid accumulation condition and the probability of various non-liquid accumulation interference conditions; S4: Extract the probability of the maximum non-liquid accumulation interference condition from the probability distribution as the interference intensity index Pintf; S5: When Pintf is greater than or equal to the preset interference threshold of 0.80, suppress the liquid accumulation warning signal; S6: When Pintf is less than the interference threshold, output the liquid accumulation confirmation warning, liquid accumulation early warning or normal operation judgment result according to the relationship between the liquid accumulation condition probability Pliq and the risk threshold A and risk threshold B.
2. The method as described in claim 1, characterized in that, The rule-based working condition screening includes identifying data interruption status, well shut-in status, and compressor shutdown status, and calculating the probability of the corresponding working condition based on the duration of the status and the range of the variable interval.
3. The method as described in claim 1, characterized in that, The multi-class temporal coding model adopts a Transformer structure based on a self-attention mechanism to encode the feature sequence within a time window of length N and output the probability value of each working condition category.
4. The method as described in claim 1, characterized in that, When the risk threshold A is less than the risk threshold B, a liquid accumulation confirmation warning is output when Pliq is greater than or equal to the risk threshold B; an early liquid accumulation warning is output when Pliq is less than the risk threshold B but greater than or equal to the risk threshold A; and a normal operation judgment is output when Pliq is less than the risk threshold A.
5. The method as described in claim 1, characterized in that, The interference intensity index Pintf is the maximum value among the non-liquid interference category probabilities output by the multi-classification model, or a weighted sum of the probabilities of multiple interference categories.
6. An anti-interference multi-classification system for early warning of shale gas liquid accumulation, characterized in that, include: The data acquisition module is used to collect multi-source time-series data on oil pressure, casing pressure, gas production flow rate, and post-well pressure. The data preprocessing module is used to perform time alignment, resampling, filtering, and missing value imputation on the multi-source time-series data; The feature construction module is used to calculate multi-scale dynamic features and form high-dimensional feature vectors. The rule screening module is used to identify non-liquid accumulation interference conditions and output the interference probability; A multi-class reasoning module is used to perform temporal encoding on the high-dimensional feature vector and output the probability distribution of each working condition. The joint constraint decision module is used to determine the anti-interference risk based on the interference probability and the liquid accumulation probability and output an early warning signal.
7. The system as described in claim 6, characterized in that, The first-order rate of change calculated by the feature construction module is the difference between the current time point value and the previous time point value divided by the previous time point value, and the second-order rate of change is the difference between adjacent first-order rates of change.
8. The system as described in claim 6, characterized in that, The multi-scale dynamic features include the mean, standard deviation, range, and trend slope calculated over multiple sliding time windows.
9. The system as described in claim 6, characterized in that, The feature construction module selects some features as model input based on feature contribution ranking, and limits the final feature vector dimension to 441 dimensions.
10. The system as described in claim 6, characterized in that, The joint constraint decision module blocks the liquid accumulation warning signal when the interference probability is greater than or equal to 0.80, and outputs graded warnings based on the liquid accumulation probability and the preset graded threshold when the interference probability is less than 0.80.