A robust detection model training method and system that integrates production dynamics and well static characteristics
By integrating the production dynamics and static characteristics of shale gas wells, a highly robust detection model was constructed. This model solved the problems of poor adaptability and low intelligence level of fixed threshold rules in shale gas well anomaly detection, achieving efficient and accurate identification and early warning of liquid accumulation anomalies, and improving the robustness and adaptability of the model.
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-06-02
AI Technical Summary
Existing technologies for anomaly detection in shale gas wells suffer from poor adaptability to fixed threshold rules, insufficient data utilization, and low levels of intelligence, leading to frequent false alarms and missed alarms, inability to effectively identify fluid accumulation anomalies, and a lack of anti-interference capabilities.
A robust detection model that integrates production dynamics and well static features is adopted. By collecting and preprocessing production dynamics and well static data of shale gas wells, a multi-dimensional dynamic feature vector is constructed and encoded using Transformer. Combined with well static feature encoding, the model is trained using a multi-class cross-entropy loss function, and interference judgment constraints are introduced for model iterative optimization and reinforcement learning.
It significantly improved the accuracy and anti-interference ability of anomaly detection, reduced the false alarm rate, enabled early warning of fluid accumulation anomalies, shortened the resumption cycle, enhanced the generalization and adaptability of the model, and reduced the dependence on human experience.
Smart Images

Figure CN122133071A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to, but is not limited to, the field of shale gas well production anomaly detection technology, and particularly relates to a robust detection model training method and system that integrates production dynamics and well static characteristics. It is applicable to the construction of detection models for various types of production anomalies in shale gas wells, such as liquid accumulation and compressor shutdown. Background Technology
[0002] Shale gas, as a key unconventional natural gas resource in my country's energy structure transformation, holds significant strategic importance in maintaining energy security and reducing carbon emissions. However, with the advancement of large-scale shale gas well development, abnormal operating conditions such as liquid accumulation (liquid buildup) caused by long-term continuous production in wellbores pose a serious challenge to production capacity reduction. Taking the 2024 operating data of the Southwest Oil and Gas Field as an example, the average number of wells experiencing liquid accumulation failures reached 10 per day in this region, with an average recovery cycle of 2.5 days per well, resulting in a daily production reduction of approximately 15,000 cubic meters per well. The cumulative daily production reduction across the region was approximately 150,000 cubic meters, with an annual production loss exceeding 55 million cubic meters, highlighting the increasingly prominent issue of production capacity loss.
[0003] Currently, oil and gas fields primarily rely on distributed control systems (SCADA) and process control platforms (POC) for detecting and alarming abnormal operating conditions. These systems compare and judge single or limited production dynamic data such as oil pressure and casing pressure based on preset fixed threshold rules, and then combine this with human experience for verification and handling. However, this type of detection mechanism based on static threshold rules has significant shortcomings in complex application scenarios.
[0004] First, fixed threshold rules lack adaptability to well conditions, production cycles, and formation variations. Shale gas wells exhibit significant differences in the normal ranges of their dynamic production parameters across different production stages, geological conditions, and development models. However, fixed rules treat values under different conditions as equal, leading to low detection reliability and frequent false alarms and missed alarms. Related research indicates that the reliability of predicting fluid accumulation behavior using traditional threshold mechanisms is limited, while automated data-driven methods are still in the exploratory stage, and existing threshold-based judgments often fail to accurately reflect the dynamic characteristics of wellbore flow.
[0005] Secondly, existing technologies have limited depth in data utilization. Currently, SCADA systems are mainly used to collect and display dynamic production parameters, but they have not achieved effective integration and analysis between dynamic production data and the inherent attributes of gas wells. This results in a large number of static background variables not being fully utilized, the data value not being released, and the anomaly detection process failing to fully reflect the unique operational characteristics of the well.
[0006] Furthermore, traditional rule-based detection lacks intelligence and anti-interference capabilities. In actual wellbore operation, conditions such as machine shutdown, compressor shutdown, well shut-in, or gas lift operations can cause significant fluctuations in production dynamic data. However, existing fixed rules cannot effectively eliminate such interference signals, leading to numerous false alarms and delayed responses. In addition, abnormal responses mainly rely on manual experience for judgment and verification, which is time-consuming and cannot provide real-time early warning capabilities.
[0007] Therefore, how to achieve efficient, accurate, and interference-resistant anomaly detection based on dynamic production data, especially to solve the problems of poor adaptability of fixed threshold rules, insufficient data utilization, and low level of intelligence, is a technical problem that the industry urgently needs to solve. Summary of the Invention
[0008] To address the problems existing in the prior art, this invention provides a robust detection model training method and system that integrates production dynamics and well static characteristics, aiming to improve the robustness and intelligence level of anomaly detection in shale gas wells.
[0009] This invention is implemented as follows: a highly robust detection model training method that fuses production dynamics and well static features includes the following steps: S1, Data Acquisition: Acquire dynamic production data and static well data of shale gas wells; the dynamic production data is real-time time-series data, including oil pressure, casing pressure, instantaneous flow rate, post-valve pressure, wellhead temperature, metering instantaneous volume, and water cut; the static well data is non-time-series data, including well commissioning date, process type, formation energy level, and well depth.
[0010] S2, Data Preprocessing: The production dynamic data collected in step S1 is subjected to invalid and missing value detection, missing value imputation, and noise reduction and smoothing. The invalid and missing value detection is achieved by automatically scanning for NaN null values and verifying whether the data conforms to the measurement range of the measuring table. The missing value imputation adopts weighted nonlinear interpolation technology. The noise reduction and smoothing process adopts Gaussian time-shifting filter.
[0011] S3, Feature Engineering: Construct dynamic features from the preprocessed production dynamic data to obtain a 441-dimensional dynamic feature vector; the dynamic features include statistical features based on sliding windows (mean, standard deviation, stage maximum / minimum), time-series trend features based on first-order and second-order differences, and periodic features based on multi-period differences.
[0012] S4, Feature Encoding: The 441-dimensional dynamic feature vector is input into the Transformer Encoder layer for encoding to obtain the dynamic feature encoding vector; the static data is concatenated and input into the DNN layer for encoding to obtain the static feature encoding vector; the Transformer Encoder layer includes an attention layer, a feedforward neural network, and a ReLU layer, and the length of the Transformer's position encoding sequence is set to 100-1000.
[0013] S5, Feature Fusion: The dynamic feature encoding vector and the static feature encoding vector are fused element-wise to obtain the comprehensive state feature vector of the gas well.
[0014] S6, Model Training: Input the comprehensive state feature vector into the MLP layer, combine it with the output layer to build a multi-classification model, train the model with multi-class cross-entropy loss as the objective function, and introduce interference judgment constraint: when the probability of non-liquid accumulation condition exceeds 80%, it is judged that the liquid accumulation signal is interfered with, and the model does not output liquid accumulation anomaly.
[0015] S7, Model Iteration and Optimization: Regularly retrain the model using the latest historical production dynamic data; fine-tune the model training for gas wells with different process types and production cycles; and automatically fine-tune the model sensitivity for single wells using reinforcement learning based on user acceptance of the prediction results.
[0016] Furthermore, in step S1, the production dynamic data is collected by gas well sensors and transmitted to the backend database for standardized storage via the OPC interface.
[0017] Furthermore, in step S3, the sliding window adopts multiple size settings to cover the dynamic production data features across different time spans.
[0018] Furthermore, in step S3, multi-period difference is achieved by calculating the difference between the current data point and the data point before a fixed period, which is used to mine long-term correlation patterns in production dynamic data.
[0019] Furthermore, the output layer in step S6 contains 6 neurons, corresponding to liquid accumulation, compressor shutdown, data interruption, well shut-in, gas lift, and other operating conditions.
[0020] Furthermore, in step S6, during model training, rule-based preprocessing logic is also incorporated: data interruption and pipeline process switching are identified through time-series data matching algorithms, and the well shut-in signal probability is obtained by comparing casing pressure levels with empirical values, thus assisting in model training optimization.
[0021] Another objective of this invention is to provide a highly robust detection model training system that fuses production dynamics and well static characteristics, comprising: Data center storage module: Used to receive and store production dynamic data and static data transmitted via OPC interface, supporting high-frequency writing, historical archiving and fast retrieval.
[0022] Data preprocessing module: Used to perform the preprocessing operation in step S2.
[0023] Feature engineering calculation module: used to perform dynamic feature construction in step S3 and remove redundant features by ranking features by importance.
[0024] Time-series database storage module: Used to store the 441-dimensional dynamic feature vector output by the feature engineering calculation module, realizing decoupling from the inference module and feature reuse.
[0025] Model training module: used to perform feature encoding, feature fusion, and model training operations in steps S4-6.
[0026] Model Iteration Module: Used to perform model retraining, scenario-specific fine-tuning, and reinforcement learning self-fine-tuning operations in step S7.
[0027] Data visualization and feedback module: Provides a visual interface to display model training results, collects user feedback on prediction results, and provides feedback data for the model iteration module.
[0028] Another object of the present invention is to provide a computer device, the computer device including a memory and a processor, the memory storing a computer program, and when the computer program is executed by the processor, causing the processor to perform the steps of the high robust detection model training method for fusing production dynamics and well static features.
[0029] Another object of the present invention is to provide a computer-readable storage medium storing a computer program, which, when executed by a processor, causes the processor to perform the steps of the high robust detection model training method that integrates production dynamics and well static features.
[0030] Another objective of this invention is to provide an information data processing terminal, which includes the aforementioned robust detection model training system that fuses production dynamics and well static features.
[0031] 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: This invention provides a robust detection model training method and system that integrates production dynamics and well static characteristics, achieving the following objectives: improving the accuracy and anti-interference capability of anomaly detection, eliminating interference from machine failures and manual measures; enabling early warning of fluid accumulation anomalies and shortening the recovery cycle; enhancing the model's generalization ability to adapt to gas wells with different processes and cycles; reducing reliance on manual intervention and enabling automatic iterative optimization of the model; ensuring secure data reuse and improving model training efficiency.
[0032] (1) By integrating the Transformer multi-classification model with static and dynamic features and the 80% interference condition judgment constraint, interference such as compressor shutdown and well shut-in can be eliminated, the false alarm rate of liquid accumulation abnormal identification is significantly reduced, and the detection accuracy is improved compared with the traditional fixed threshold method.
[0033] (2) By utilizing the 441-dimensional dynamic features (including periodic features and time-series trend features) and the Transformer time-series modeling capabilities, an early warning can be issued 3 hours before the occurrence of liquid accumulation anomalies, shortening the single-well production recovery cycle to less than 1 day, thereby reducing the annual production loss of a single well.
[0034] (3) Through well static feature encoding and scenario-based fine-tuning training, the model can be adapted to gas wells with different process types and production cycles.
[0035] (4) Automatic feature engineering (441-dimensional dynamic feature generation) and reinforcement learning self-fine-tuning reduce the workload of manual parameter tuning and can achieve model optimization without relying on expert experience.
[0036] (5) By utilizing modular data storage (raw data + feature data) and high-concurrency read and write capabilities, the feature reuse rate and model retraining efficiency are improved.
[0037] Compared with existing anomaly detection methods that use fixed threshold rules or are based solely on single production dynamic data, this invention has significant technical advantages in terms of anomaly detection robustness, interference suppression capability, cross-well generalization performance, and continuous optimization capability, and each advantage is specifically implemented by the corresponding technical solution.
[0038] This invention significantly improves the robustness and anti-interference capability of anomaly detection. By fusing static well features with multi-dimensional dynamic production features and introducing a probability constraint mechanism for interference conditions during model training and inference, the model can effectively distinguish between liquid accumulation anomalies even in complex non-liquid accumulation conditions such as compressor shutdown, well shut-in, and gas lift. The corresponding technical solution is to use static features as a stability constraint benchmark to correct the distribution of dynamic features, and to suppress liquid accumulation judgment when the predicted probability of non-liquid accumulation conditions reaches a preset proportion threshold. Practical application verification shows that the false alarm rate for liquid accumulation anomalies is reduced from approximately 25% using traditional methods to below 6%, and the model's stability under strong interference scenarios is significantly enhanced.
[0039] This invention provides early warning capabilities for fluid accumulation anomalies. By temporally encoding dynamic features and combining multi-period differential feature mining to uncover long- and short-term trends in production data, the model can identify potential risk states before anomalies become apparent. The corresponding technical solution is dynamic feature temporal modeling based on a Transformer structure. Actual operational results show that this invention can issue warnings an average of 3 to 6 hours before anomalies occur, shortening the single-well recovery cycle from 2.5 days to less than 1 day, significantly reducing production losses.
[0040] This invention effectively enhances the model's cross-well generalization and scenario adaptability. By deeply encoding the static features of wells and combining different scenario-specific training strategies for different process types and production cycles, the model can adapt to the inherent differences of different gas wells, avoiding overfitting to single-well data. With the support of the corresponding technical solution, in data validation on a scale of thousands of wells, the model's generalization accuracy reached over 94%, overcoming the problem of significant performance degradation of traditional models when migrating between wells.
[0041] This invention supports continuous iterative optimization of the model, reducing reliance on human experience. Through a periodic retraining mechanism, a single-well adaptive fine-tuning strategy, and a user feedback loop, the model can continuously evolve as production conditions change. The corresponding technical solution improves the model's accuracy by 4 to 7 percentage points in each iteration, while reducing manual parameter tuning workload by approximately 80%.
[0042] This invention utilizes a feature engineering module and a time-series data storage mechanism to achieve pre-computation and reuse of dynamic features, thereby improving training efficiency. Model retraining time is reduced by approximately 60%, making it suitable for efficient processing of large-scale gas well data.
[0043] This invention overcomes the technical bottlenecks of traditional anomaly detection methods in terms of robustness, generalization, and interference suppression by fusing static and dynamic features and using a collaborative mechanism of temporal coding and interference constraints. It has outstanding engineering practical value and promising prospects for widespread application. Attached Figure Description
[0044] Figure 1 This is a flowchart of a training method for a highly robust detection model that fuses production dynamics and well static features, provided in an embodiment of the present invention.
[0045] Figure 2 This is a schematic diagram of a training method for a highly robust detection model that fuses production dynamics and well static features, provided in an embodiment of the present invention.
[0046] Figure 3 This is a structural diagram of a high-robustness detection model training system that integrates production dynamics and well static features, provided in an embodiment of the present invention.
[0047] Figure 4This is a schematic diagram of the static-dynamic fusion robustness mechanism provided in an embodiment of the present invention.
[0048] Figure 5 This is a schematic diagram of static and dynamic fusion correction for distribution drift provided in an embodiment of the present invention.
[0049] Figure 6 This is a feature distribution comparison (PCA / t-SNE) between dynamic features only and static-dynamic fusion provided in this embodiment of the invention.
[0050] Figure 7 This is a comparison chart of robustness indicators (false alarm rate / F1) provided in the embodiments of the present invention. Detailed Implementation
[0051] 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.
[0052] The robust detection model training system for fusion of production dynamics and well static characteristics described in this invention works by constructing a hierarchical modeling mechanism of dynamic behavior characterization, static attribute constraint, fusion correction, and constraint discrimination to achieve stable identification and anti-interference detection of complex operating conditions in shale gas wells. The system first uses a dynamic data acquisition module to collect multi-source time-series data generated during the gas well production process in real time, including gas production, casing pressure, oil pressure, temperature, gas lift parameters, and equipment operating signals. This data is accessed through sensors and transmitted to a backend database via an OPC interface for structured storage, thus forming a continuous production dynamic sequence. Simultaneously, a static data acquisition module acquires well static characteristic data reflecting the inherent geological properties and long-term operational differences of the gas well, such as reservoir parameters, completion methods, tubing structure, commissioning time, and historical stimulation information, to characterize the structural and basic condition differences between different gas wells.
[0053] In the feature modeling stage, the dynamic feature encoding module performs time-series modeling on the dynamic production time-series data. It extracts time-dependent features using a sliding window and time-step embedding method to generate dynamic feature representations that reflect trends and fluctuations in the process of changing operating conditions. The static feature encoding module performs non-time-series encoding on the static features of the wells, converting discrete or continuous attributes into structured static feature representations to describe the long-term stable properties of the gas wells. In the feature fusion stage, the system uses a normalization processing unit to perform scale consistency processing on the dynamic and static features, eliminating dimensional differences. Using the static feature representation as a stability constraint benchmark, it performs distribution correction on the dynamic feature representation, ensuring comparability and consistency of dynamic features across different wells. Finally, it generates comprehensive state features, thereby reducing the risk of model deviation caused by differences between wells.
[0054] During model training, a multi-classification operating condition detection model is trained based on comprehensive state features, outputting predicted probabilities for conditions such as liquid accumulation, compressor shutdown, data interruption, well shut-in, gas lift, and others. In the inference phase, the system further introduces a constraint judgment mechanism for interference conditions. When the predicted probability of a non-liquid accumulation condition exceeds a preset threshold, the results for the liquid accumulation condition are suppressed to avoid misjudgments caused by similar fluctuation characteristics. Furthermore, a rule-based preprocessing step is performed before model input, identifying data interruption states through time-series data matching and determining well shut-in conditions by combining casing pressure and empirical thresholds, providing auxiliary constraint information for the model. Through the above multi-level fusion and constraint mechanisms, this system achieves higher robustness and lower misjudgment rate in shale gas well operating condition detection under complex production environments.
[0055] like Figure 1 As shown in the figure, this embodiment of the invention provides a training method for a highly robust detection model that fuses production dynamics and well static features. The specific steps are as follows: S1, Data Acquisition.
[0056] Production dynamic data acquisition: Real-time data such as oil pressure, casing pressure, instantaneous flow rate, valve post-valve pressure, wellhead temperature, metering instantaneous quantity, and water cut are collected through gas wellhead and wellbore sensors. The data sampling frequency is set according to the gas field production needs (usually at the minute level) and transmitted to the data center storage module through the OPC interface for storage in standardized formats (such as JSON and CSV).
[0057] Static well data acquisition: The inherent attribute data of a single well is obtained through the gas field production management system, including the well commissioning date (accurate to the day), process type (such as horizontal well production, vertical well production), formation energy level (such as initial pressure value), and well depth (unit: meter). This type of data is collected once and stored in the data center storage module. If the process is adjusted or the well condition is updated, it will be updated synchronously.
[0058] S2, Data Preprocessing.
[0059] Invalid and missing value detection: Missing value detection: The isna() function of the Python Pandas library is used to automatically scan for "NaN" null values in the production dynamic data and to calculate the missing proportion of each type of parameter.
[0060] Invalid value detection: Based on the measurement range of each parameter (e.g., oil pressure range 0-100MPa, flow rate range 0-1 million cubic meters / day), invalid data entries that exceed the range or have incorrect format (e.g., text format values) are filtered out.
[0061] Missing value imputation: For parameters with a missing rate of less than 5%, weighted nonlinear interpolation (based on the weight allocation of adjacent valid data points) is used to imput them, avoiding the distortion of time series trends caused by linear interpolation; when the missing rate is higher than 5%, historical data distribution of similar wells is used to assist in imputation.
[0062] Noise reduction and smoothing: Gaussian time-shifting filter (window size set to 5-10 sampling points) is used to smooth the preprocessed dynamic data, filtering out noise caused by sensor fluctuations and electromagnetic interference, and retaining the true production trend.
[0063] S3, Feature Engineering.
[0064] Based on the preprocessed production dynamic data, a 441-dimensional dynamic feature vector is constructed, which includes three core feature types: Statistical characteristics (126 dimensions): Using three sliding window sizes (5 minutes, 30 minutes, and 1 hour), the mean, standard deviation, maximum value, minimum value, and median within the window are calculated for each type of dynamic parameter, resulting in a total of 7 types of parameters × 3 types of windows × 6 types of statistics = 126 dimensions.
[0065] Time series trend features (210 dimensions): For each type of dynamic parameter, calculate the first-order difference (gradient, reflecting the rate of parameter change) and the second-order difference (curvature, reflecting the acceleration of change), and calculate the difference results based on 3 time steps (1 step, 5 steps, 10 steps), for a total of 7 types of parameters × 3 time steps × 10 difference statistics = 210 dimensions.
[0066] Periodic characteristics (105 dimensions): For the periodicity of gas well production (such as 24-hour production cycle, 7-day operation cycle), calculate the difference between the current data point and the data points 1 cycle ago and 2 cycles ago, with a total of 7 types of parameters × 2 types of cycles × 7.5 types of period statistics = 105 dimensions.
[0067] The three types of features are concatenated to form a 441-dimensional dynamic feature vector. Redundant features with a contribution of less than 0.01 are removed by ranking the features by importance (such as random forest feature importance score), and the core features are retained for subsequent encoding.
[0068] S4, Feature Encoding.
[0069] Dynamic feature encoding: The 441-dimensional dynamic feature vector is input into the Transformer Encoder layer, which contains two attention heads, one feedforward neural network (256 hidden neurons), and a ReLU activation function; the position encoding uses sine and cosine encoding, and the sequence length is set to 100-1000 according to the time span of the training data (e.g., 100 sampling points correspond to 500 minutes of data). After encoding, a 256-dimensional dynamic feature encoding vector is output.
[0070] Static feature encoding: The static data of the well is numerically processed (e.g., the process type is encoded using One-Hot encoding, and the production date is converted into "production days"), and then concatenated into a 32-dimensional static feature vector. This vector is then input into a 1-layer DNN (64 hidden layer neurons, ReLU activation function) and the encoded output is a 64-dimensional static feature encoding vector.
[0071] S5, Feature Fusion.
[0072] The 256-dimensional dynamic feature encoding vector and the 64-dimensional static feature encoding vector are fused by element-level addition. Before fusion, the two types of vectors are normalized by the LayerNorm layer to ensure that the feature scale is consistent, and finally a 320-dimensional gas well comprehensive state feature vector is obtained.
[0073] S6, Model Training.
[0074] Model structure: The integrated state feature vector input is a 2-layer MLP (128 neurons in the first layer and 64 neurons in the second layer, both activated by ReLU). The output layer has 6 neurons and uses the Softmax activation function to output the probabilities of 6 operating conditions: "liquid accumulation", "compressor shutdown", "data interruption", "well shut-in", "gas lift" and "other".
[0075] Training parameters: Adam optimizer (learning rate 0.001), batch size 32, training epochs 50, multi-class cross-entropy loss as the objective function.
[0076] Interference constraint: During the training process, a logic judgment layer is added. If the sum of the probabilities of non-liquid conditions such as "compressor shutdown" and "well shut-off" exceeds 80%, the probability of "liquid accumulation" will be forcibly corrected to 0 to avoid false alarms caused by interference.
[0077] S7, Model Iterative Optimization.
[0078] Regular retraining: Every 3 months, the model is fully retrained using the production dynamic data of the past 3 months and the updated well static data (such as parameters after process adjustment), and the model parameters are updated.
[0079] Scenario-specific fine-tuning: For gas wells with different process types (horizontal wells, vertical wells) and different production cycles (within 1 year of production, 1-3 years, and more than 3 years), separate subset datasets were constructed. Transfer learning was used to fine-tune the basic model, with the fine-tuning learning rate reduced to 0.0001 and 20 training rounds.
[0080] Reinforcement learning self-fine-tuning: Based on user annotations (such as "false positives" and "false negatives") collected by the data display and feedback module, user approval is used as a reward signal, and the sensitivity parameters of the model (such as the liquid accumulation probability warning threshold) are adjusted through the Q-Learning algorithm to achieve personalized optimization of the single-well model.
[0081] like Figure 3 As shown, this embodiment of the invention provides a training system for a highly robust detection model that fuses production dynamics and well static features, comprising: Data center storage module: Used to receive and store production dynamic data and static data transmitted via OPC interface, supporting high-frequency writing, historical archiving and fast retrieval.
[0082] Data preprocessing module: Used to perform the preprocessing operation in step S2.
[0083] Feature engineering calculation module: used to perform dynamic feature construction in step S3 and remove redundant features by ranking features by importance.
[0084] Time-series database storage module: Used to store the 441-dimensional dynamic feature vector output by the feature engineering calculation module, realizing decoupling from the inference module and feature reuse.
[0085] Model training module: used to perform feature encoding, feature fusion, and model training operations in steps S4-6.
[0086] Model Iteration Module: Used to perform model retraining, scenario-specific fine-tuning, and reinforcement learning self-fine-tuning operations in step S7.
[0087] Data visualization and feedback module: Provides a visual interface to display model training results, collects user feedback on prediction results, and provides feedback data for the model iteration module.
[0088] The signal data processing of the system described in this embodiment of the invention forms a closed-loop process based on acquisition, cleaning, construction, encoding, training, and feedback. First, in the data acquisition phase, the gas well site sensors collect real-time production dynamic data such as gas production, oil pressure, casing pressure, temperature, current, voltage, and equipment start-up and shutdown signals, which are then transmitted to the data center storage module via the OPC interface. This module supports high-frequency writing and historical archiving mechanisms, aligning the original signals with timestamps and batch identification to ensure that multi-source data is managed under a unified timeline and to provide a traceable data foundation for subsequent processing.
[0089] The data then enters the preprocessing stage. The preprocessing module performs operations such as missing value imputation, outlier removal, sampling frequency standardization, time window slicing, and noise smoothing on the acquired raw signals, converting unstructured or noisy signals into computable, standardized time-series data. Simultaneously, the well static attribute data undergoes structured encoding, ensuring a unified data format and indexing system for both dynamic and static data.
[0090] During the feature engineering phase, the feature engineering calculation module constructs statistical features, trend features, fluctuation features, and correlation features from the preprocessed time series signal based on a sliding time window, forming a 441-dimensional dynamic feature vector. Simultaneously, a feature importance ranking algorithm is used to remove redundant or low-contribution features, reducing the risk of dimensional redundancy and overfitting. The generated high-dimensional dynamic features are written to the time series database storage module, achieving logical decoupling from the model inference end and feature reuse, thus improving system operating efficiency.
[0091] During the model training phase, the model training module encodes and fuses dynamic and static features, generates comprehensive state features through feature distribution correction, and trains the working condition detection model based on multi-classification objectives. The model iteration module performs retraining and fine-tuning based on historical prediction deviations, scenario differences, and user feedback, and can incorporate reinforcement learning mechanisms to achieve policy self-optimization. Finally, the data display and feedback module presents the prediction results in a visual manner and collects user confirmation information on anomaly identification results, forming feedback signals that are input into the model iteration module, achieving a continuously optimized closed-loop signal data processing mechanism.
[0092] This invention is primarily applied to training detection models for various production anomalies, such as fluid accumulation in shale gas wells and compressor shutdowns. It can also be extended to anomaly detection in similar time-series and static feature scenarios in conventional oil and gas fields and coalbed methane wells. Related products include: an intelligent anomaly detection platform for shale gas, an AI-powered operation and maintenance decision-making system, and embedded industrial detection model training tools, possessing broad market prospects.
[0093] To verify the actual technical effects of the embodiments of the present invention, a pilot deployment and test was conducted for nine months in a production area of a Southwest oil and gas field (covering 180 wells). The results, compared with the traditional rule-based approach plus a single dynamic model, are as follows (data recorded by the enterprise's monitoring system and audited by a third party): 1. Testing robustness and accuracy evidence The false alarm rate of traditional methods is 24.6% (higher under interference conditions); the present invention reduces the false alarm rate to 5.8% by static and dynamic fusion and interference constraints, improves the F1 score from 0.83 to 0.96, and achieves an early warning accuracy of 92%.
[0094] 2. Early warning and evidence of economic benefits The average advance warning time is 4.1 hours, the resumption cycle is shortened by 1.4 days, unplanned shutdowns are reduced by 62%, and the cumulative reduction in production losses over 9 months is approximately 34 million cubic meters.
[0095] 3. Evidence for generalization and iterative effects After fine-tuning across processes / cycles, the model achieved a balanced accuracy across different sub-scenarios (94-97%); after 5 rounds of reinforcement learning iterations, the overall accuracy improved by 6.5%.
[0096] The above data and charts fully demonstrate that the present invention has made significant progress in terms of robustness, early warning capability, generalization and iterative optimization.
[0097] like Figure 4 As shown, the method provided in this embodiment of the invention first collects multi-source dynamic time-series production data based on the shale gas well production process, including parameters such as oil pressure, casing pressure, gas production, flow rate, and post-valve pressure, through wellhead and downhole sensors. This data is then transmitted to a backend database for standardized storage via an OPC interface. For this dynamic data, a predefined time window is used for sliding segmentation to construct a dynamic feature set characterizing short-term changes in the gas well's operating state. The sliding window can be set to various sizes to cover production dynamic features across different time spans, such as minutes, hours, and days.
[0098] In the process of constructing dynamic features, multi-scale time series features are extracted through methods such as sliding statistics, trend slope, and periodic difference. Among them, multi-period difference is achieved by calculating the difference between the current data and the data points of a fixed period ago, which is used to mine long-term correlation patterns in the production process and provide more discriminative dynamic information for subsequent time series modeling.
[0099] Simultaneously, a set of static well characteristics is collected and constructed to describe the inherent properties and long-term operational differences of gas wells, including information such as production date, completion technology type, formation energy parameters, and well depth. These static well characteristics remain stable across multiple production cycles and do not fluctuate with short-term changes in operating conditions. For these static well characteristics, non-time-series coding methods such as numericalization and unique thermal coding are employed to obtain static feature representations reflecting the inherent differences of gas wells.
[0100] Subsequently, the dynamic feature set is input into a temporal coding network (such as a Transformer structure) to obtain a dynamic feature representation reflecting the dynamic changes in production; the static feature set of the well is then non-temporally encoded to obtain a static feature representation. For example... Figure 4 and Figure 5 As shown, dynamic and static feature representations are fused, and a comprehensive gas well state characteristic is formed through Layer Normalization or element-level fusion mechanisms. The static feature representation serves as a stability constraint benchmark, correcting for distribution drift in the dynamic feature representation over time or during production stages, thereby reducing the feature distribution differences between different gas wells and different production cycles.
[0101] like Figure 6 As shown, compared with the case of using only dynamic features, after introducing static feature fusion, the center distance of samples from different production cycles or stages in the feature space is significantly reduced, and the distribution consistency is significantly improved. This indicates that static features, as stable anchor points, can effectively suppress the cross-well and cross-cycle drift of dynamic features.
[0102] Based on this, a multi-class detection model is trained based on the comprehensive state features, and outputs the probability distribution corresponding to liquid accumulation, compressor shutdown, data interruption, well shut-in, gas lift and other operating conditions. The output layer is set with 6 neurons corresponding to the above operating condition types respectively.
[0103] During model training and inference, a constraint mechanism for interference conditions is introduced: when the prediction probability of non-liquid conditions (such as shutdown, well shut-in, or data interruption) exceeds a preset threshold, the prediction result for liquid accumulation is automatically suppressed, thereby reducing the risk of false alarms under complex conditions. In addition, combined with rule-based preprocessing logic, a time-series data matching algorithm is used to identify data interruptions and pipeline flow switching, and the well shut-in signal probability is generated by comparing the casing pressure level with an empirical threshold, which assists in model training and result correction.
[0104] like Figure 7 As shown, compared with the model that only uses dynamic features, the introduction of well static feature fusion significantly reduces the false alarm rate and significantly improves the F1 score, verifying that the method of the present invention has higher detection robustness and generalization ability under complex working conditions and long-term operation.
[0105] 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.
[0106] 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 robust detection model training method that fuses production dynamics and well static features, characterized in that, Includes the following steps: Acquire multi-source dynamic time-series data of shale gas well production during the production process, and construct a dynamic feature set based on a preset time window to characterize the short-term operating status changes of the gas well. Obtain a set of well static characteristics to describe the inherent properties of gas wells and the differences in long-term operation, wherein the well static characteristics remain unchanged over multiple production cycles with short-term operating conditions; The dynamic feature set is time-series encoded to obtain a dynamic feature representation that characterizes the dynamic evolution trend of production; The static feature set of the well is non-temporally encoded to obtain a static feature representation that characterizes the inherent differences of the gas well; The dynamic feature representation and the static feature representation are fused to generate a comprehensive gas well status feature, wherein the static feature representation serves as a stability constraint benchmark to correct the distribution offset of the dynamic feature representation under different gas wells and different production stages. The operating condition detection model is trained based on the comprehensive state characteristics and used to output prediction results corresponding to different gas well operating conditions.
2. The training method according to claim 1, characterized in that, The multi-source production dynamic time-series data includes at least one of oil pressure, casing pressure, gas production, flow rate, and valve downstream pressure.
3. The training method according to claim 1, characterized in that, The dynamic feature set is constructed using multiple time window sizes to cover dynamic changes in production over different time spans.
4. The training method according to claim 1, characterized in that, The dynamic feature set includes multi-period difference features, which are obtained by calculating the difference between the current time point data and the time point data before a fixed period, and are used to characterize the long-period change relationship in the production process.
5. A robust detection model training system that fuses production dynamics and well static characteristics, characterized in that, include: The dynamic data acquisition module is used to collect multi-source dynamic time-series data of shale gas well production during the production process; The static data acquisition module is used to acquire static characteristic data of gas wells that describe the inherent properties of the wells and the differences between them and their long-term operation. The dynamic feature encoding module is used to perform time-series encoding on the production dynamic time-series data to generate dynamic feature representations; The static feature encoding module is used to perform non-temporal encoding on the static feature data of the well to generate a static feature representation; The feature fusion module is used to fuse the dynamic feature representation with the static feature representation, and use the static feature representation as a stable constraint benchmark to perform distribution correction on the dynamic feature representation to generate comprehensive state features; The model training module is used to train the working condition detection model based on the comprehensive state features.
6. The training system according to claim 5, characterized in that, The dynamic data acquisition module collects production dynamic data through gas well sensors and transmits it to the backend database for storage via the OPC interface.
7. The training system according to claim 5, characterized in that, The feature fusion module includes a normalization processing unit, which is used to perform scale consistency processing on dynamic feature representation and static feature representation.
8. A robust training method for shale gas well condition monitoring, characterized in that, include: Based on the comprehensive state features obtained by the method described in claim 1, a multi-class detection model is trained to output the predicted probabilities corresponding to various gas well operating conditions. During model training or inference, interference condition constraints are applied to the predicted probability. When the predicted probability of non-liquid conditions exceeds a preset threshold, the prediction result of liquid conditions is suppressed.
9. The training method according to claim 8, characterized in that, The output of the multi-class detection model corresponds to liquid accumulation, compressor shutdown, data interruption, well shut-in, gas lift, and other operating conditions.
10. The training method according to claim 8, characterized in that, Before performing the interference condition constraint judgment, a rule-based preprocessing step is also included. The preprocessing step identifies the data interruption state by matching time-series data and obtains auxiliary judgment information on the shut-in condition by comparing the casing pressure data with a preset empirical threshold.