A method and system for intelligent prediction and decision-making regarding wellbore fluid accumulation during shale gas well production.
By constructing a time calibration method for fluid accumulation events based on a fixed quantile threshold and a multi-scale temporal convolutional network, the problems of lag and insufficient generalization ability in the prediction of fluid accumulation in shale gas wellbores are solved, achieving accurate and timely prediction of fluid accumulation in wellbores and improving the reliability and cross-well applicability of the prediction.
Patent Information
- Application Number
- CN202611408527.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-11
- Publication Date
- 2026-11-17
AI Technical Summary
Existing technologies cannot directly, in advance, or accurately predict the timing of wellbore fluid accumulation in shale gas wells. The reliance on future information for tag structures and the insufficient generalization ability across wells lead to prediction lag and uncertainty.
A time calibration method for effusion events based on a fixed quantile threshold is constructed. It adopts variable-level independent linear embedding and a shared-weight multi-scale dilated temporal convolutional network, combined with time-aware contrastive learning and remaining time regression, and constructs a joint loss function for end-to-end training to output the predicted remaining effusion time and the expected effusion start time.
It enables accurate and timely prediction of wellbore fluid accumulation, avoids future information leakage, improves cross-well generalization ability and prediction reliability, and ensures consistency between online prediction and offline assessment.
Smart Images

Figure CN123117464A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the intersection of shale gas development engineering technology and artificial intelligence time series prediction, specifically relating to an intelligent prediction and decision-making method and system for wellbore fluid accumulation during shale gas well production. Background Technology
[0002] Shale gas, as a crucial strategic resource for my country's energy structure transformation and energy security, plays a vital role in stabilizing domestic natural gas supply and reducing dependence on imports through its efficient development. During shale gas well production, as formation energy depletes, the gas-carrying capacity gradually decreases, and the accumulated liquid column within the wellbore cannot be completely carried out by the gas flow, resulting in wellbore liquid accumulation. Wellbore liquid accumulation significantly increases bottomhole back pressure, inhibits gas production capacity, leads to a rapid decline in output, and in severe cases, can even cause well shutdown or flooding. This is one of the major production problems faced in the mid-to-late stages of shale gas well production. Timely and accurate prediction of the occurrence time of wellbore liquid accumulation is crucial for optimizing drainage and gas production measures, rationally arranging production systems, and ensuring continuous and stable production of gas wells.
[0003] Existing methods for identifying and predicting wellbore fluid accumulation can be broadly categorized into two types: threshold-based engineering judgment methods and data-driven methods. Threshold-based engineering judgment methods typically utilize thresholds for single or a few indicators, such as sudden drops in differential pressure, sudden drops in production, and fluctuations in casing pressure. While simple and intuitive, these methods suffer from significant lag, often only identifying fluid accumulation after it has severely impacted production. This results in high false alarm and false negative rates, and the thresholds rely on manual experience, making them difficult to adapt to varying well conditions and production stages. Numerical simulation methods based on multiphase flow theory require detailed parameters such as wellbore structure, fluid properties, and gas-liquid two-phase distribution. These methods are complex to model, computationally expensive, and difficult to implement in real-time online applications in gas fields.
[0004] With the development of artificial intelligence technology, data-driven methods, leveraging their end-to-end feature learning capabilities, are gradually being introduced into the field of gas well production management. Existing data-driven methods typically directly predict future oil pressure, casing pressure, or production curves, and then indirectly identify fluid accumulation through curve morphology. This approach suffers from three core shortcomings: First, it lacks event-level labels, failing to clearly define the core event of fluid accumulation occurrence time, making it difficult to generate direct supervised learning signals. Second, the sample construction process is prone to introducing future information leakage; for example, using intra-event normalization or event-relative benchmark features dependent on the fluid accumulation start time leads to inflated offline evaluation performance and significant performance degradation during online deployment. Third, the models are mostly trained on a single well or within the same well, lacking sufficient generalization ability across wells and events, and failing to directly model the core issue of how long until fluid accumulation occurs, thus failing to output a predicted fluid accumulation start time with clear engineering implications. Therefore, existing technologies struggle to meet the engineering needs for early, accurate, and reliable prediction of fluid accumulation occurrence time in the field. Summary of the Invention
[0005] To address the shortcomings of existing technologies, the present invention aims to provide a method and system for intelligent prediction and decision-making regarding wellbore fluid accumulation during shale gas well production. This method solves the problems of existing technologies, such as difficulty in directly, in advance, and accurately predicting the timing of fluid accumulation, reliance on future information for tag construction, and weak cross-well generalization ability. It improves the accuracy, timeliness, and reliability of intelligent prediction of wellbore fluid accumulation.
[0006] To achieve the above objectives, the present invention provides the following technical solution: A method for intelligent prediction and decision-making regarding wellbore fluid accumulation during shale gas well production, the method comprising the following steps: S100: Construct a dynamic dataset of shale gas well production and perform preprocessing; calibrate the event time of historical liquid accumulation events based on a fixed quantile threshold, generate supervision labels for the start time of liquid accumulation, and construct supervised learning samples; S200: Construct an intelligent prediction model for liquid accumulation, perform variable-level independent linear embedding on the input production time series, extract multi-scale time series features of each variable through a shared weight multi-scale dilated temporal convolutional network, generate a comprehensive liquid accumulation evolution representation through cross-variable dynamic gating fusion, and construct a time-aware contrastive learning branch and a remaining time regression branch based on the comprehensive liquid accumulation evolution representation; S300: Construct a joint loss function that includes residual time regression loss, time-aware contrast loss, and time-ranking constraint loss, and perform end-to-end training and optimization of the liquid accumulation intelligent prediction model; S400: Receives current and historical production data of the shale gas well to be predicted, inputs the trained intelligent liquid accumulation prediction model, outputs the predicted remaining liquid accumulation time, and calculates the expected liquid accumulation start time based on the current prediction time. S500: Based on the predicted remaining liquid accumulation time, determine the near-term state and make decisions on the state of the liquid accumulation event, and output the prediction results.
[0007] Preferably, in step S100, the dataset construction, preprocessing, and event time calibration are achieved through the following steps: S101: Collect minute-level continuous production data of shale gas wells from multiple production platforms in the same block. The production data includes casing pressure, oil pressure, valve post-pressure, instantaneous production, oil-casing pressure difference, and temperature. The oil-casing pressure difference is calculated from the difference between casing pressure and oil pressure. S102: Perform time alignment and unit unification processing on the raw production data, retain the zero-value measurement results corresponding to the well shut-in or production stop status, and do not delete them as missing values; S103: Divide the training set, validation set and test set according to the well location to ensure that all events and samples of the same well belong to the same dataset; S104: Obtain the on-site log and the expert's initial judgment time of historical liquid accumulation events observed by experts based on the dynamic curves of casing pressure, production, and oil-casing pressure difference. Backtrack the set time before the expert's initial judgment time of each historical liquid accumulation event, extract the original production data of relevant parameters, and use it for historical event time calibration. S105: Calculate the fixed quantile threshold of each event calibration parameter using normal production data from the training well, wherein the normal production data is in an effective production state and does not fall within the influence range of any historical liquid accumulation event. S106: Based on the fixed quantile threshold, perform bilateral anomaly determination on the calibration parameters of each event, and calculate the multi-parameter joint anomaly index; S107: Based on the continuous confirmation of the joint anomaly indicators, determine the effusion start time and effusion confirmation time of each historical effusion event; S108: Align the event time of each historical effusion event with the effusion start time as the time zero point, and construct supervised learning samples within the pre-effusion study window according to the set historical input length and sliding step size.
[0008] Preferably, in step S200, the intelligent prediction model for fluid accumulation is constructed through the following steps: S201: Embed each physical variable in the input production timeline using an independent linear mapping to map different physical variables to a unified channel dimension; S202: Construct a shared-weight multi-scale dilated temporal convolutional network, using parallel temporal convolutional branches with different dilation rates on the same input sequence. Each branch uses causal convolution and residual connections to extract multi-scale temporal features covering different receptive fields. S203: The multi-scale temporal features of each variable are fused, and the dynamic gating weights of each variable are generated based on the current window state. The weighted fusion is then used to obtain the comprehensive liquid accumulation evolution representation. S204: Construct a time-aware contrastive learning branch, map the comprehensive fluid accumulation evolution representation to the contrastive learning space, construct continuous time similarity weights based on the proximity of the actual remaining fluid accumulation time between samples, and construct a time-aware contrastive loss. S205: Construct a residual time regression branch, and output the prediction of residual liquid time by mapping the comprehensive liquid evolution representation.
[0009] Preferably, in step S300, the construction of the joint loss function and the model training are achieved through the following steps: S301: Construct the total loss function, which is a weighted sum of the remaining time regression loss, the time-aware contrast loss, and the time ranking constraint loss; S302: Construct a residual time regression loss and use Huber loss to calculate the error between the predicted residual effusion time and the actual residual effusion time; S303: Construct a time-ordering constraint loss. For sample pairs whose actual remaining fluid times meet the set time difference condition and are located in the same training batch, constrain their predicted remaining fluid times to maintain a consistent ordering relationship with the actual remaining fluid times. S304: Freeze the standardized parameters and event quantile thresholds before training, use an optimizer and early stopping strategy to train the model end-to-end, and select the optimal model based on the performance on the validation set.
[0010] Preferably, in steps S400 and S500, the online rolling prediction and result output are achieved through the following steps: S401: During online operation, after each new complete data segment is obtained, the system data arrival delay is taken into account, and the latest available time after delay correction is used as the end point of the input window to extract a historical production data sequence of a set length from the production database. S402: Calculate dynamic features based on current and historical data, standardize using standardized parameters frozen during the training phase, input the liquid accumulation intelligent prediction model, and output the predicted remaining liquid accumulation time. S403: Calculate the expected start time of liquid accumulation based on the predicted remaining liquid accumulation time and the current predicted time; S501: When the predicted remaining liquid accumulation time is not greater than the near-term warning threshold configured in the engineering, the system is determined to enter the near-term liquid accumulation state; S502: Employs the same joint anomaly determination and continuous confirmation logic as historical event time calibration to make online liquid accumulation event status decisions on current and subsequent production data; S503: Outputs the predicted remaining liquid accumulation time, the estimated liquid accumulation start time, the current status, and the liquid accumulation event confirmation status.
[0011] This disclosure also provides an intelligent prediction and decision-making device for wellbore fluid accumulation during shale gas well production, the device comprising: The data preprocessing module is used to collect dynamic production data from shale gas wells, perform time alignment, unit unification and zero value retention processing, and divide the dataset by well location; The event labeling module is used to perform bilateral anomaly detection, joint anomaly calculation and persistence confirmation on historical effusion events based on fixed quantile thresholds, generate effusion start time supervision labels and construct supervised learning samples; The model building module is used to build a liquid accumulation intelligent prediction model that includes variable-level independent linear embedding, shared-weight multi-scale dilated temporal convolutional network, cross-variable dynamic gating, time-aware contrastive learning branch and residual time regression branch. The model training module is used to construct a joint loss function that includes residual time regression loss, time-aware contrast loss, and time-ranking constraint loss, and to perform end-to-end training and optimization of the liquid accumulation intelligent prediction model. The prediction execution module is used to receive the current and historical production data of the gas well to be predicted, input the trained liquid accumulation intelligent prediction model, and output the predicted remaining liquid accumulation time and the expected liquid accumulation start time. The results output module is used to determine the near-term state and make decisions on the state of the effluent event based on the predicted remaining effluent time, and output the prediction results.
[0012] This disclosure also provides an intelligent prediction and decision-making system for wellbore fluid accumulation during shale gas well production, the system comprising: The data input module is used to receive current and historical production data and predicted configuration parameters from shale gas wells; The feature calculation module is used to calculate dynamic features based on current and historical data, and to perform standardization processing using standardized parameters frozen during the training phase. The prediction calculation module is used to call the trained intelligent effusion prediction model to perform prediction calculations and output the predicted remaining effusion time and the expected effusion start time. The results output module is used to output the predicted remaining liquid accumulation time, the estimated liquid accumulation start time, the current status, and the confirmation status of the liquid accumulation event. It supports visualization and data export.
[0013] This disclosure also provides an electronic device, the electronic device comprising: Memory, processor, and computer programs stored in memory and executable on the processor, wherein, When the processor executes the program, it implements any of the methods described above.
[0014] This disclosure also provides a computer storage medium storing computer-executable instructions for performing any of the methods described above.
[0015] Compared with the prior art, the beneficial effects of this invention are as follows: (1) This application directly uses the remaining time before the liquid accumulation occurs as the target to perform residual time regression modeling, and outputs the predicted remaining liquid accumulation time and the expected liquid accumulation start time with clear engineering meaning, thus avoiding the lag and uncertainty of indirect judgment through the prediction of the production curve; (2) The historical liquid accumulation event time calibration method based on fixed quantile threshold in this application adopts two-sided anomaly judgment, multi-parameter joint anomaly and persistence confirmation, without presupposing the one-way assumption that the casing pressure will definitely increase or the oil-casing pressure difference will definitely increase. The calibration is objective, consistent and reproducible. Moreover, the quantile threshold is calculated and frozen once on the normal data of the training well, avoiding the change of the threshold due to the event itself during the label construction process. (3) All feature construction and label generation in this application rely only on current and historical data. Standardized parameters, event labeling thresholds and model parameters are determined and frozen during the training phase to prevent future information leakage and ensure that online prediction performance is consistent with offline evaluation performance. (4) This application adopts a variable-level independent linear embedding and a shared weight multi-scale dilatational temporal convolutional network, which takes into account both the individuality of variables and the scale of parameters. The multi-scale dilatation rate covers short-term disturbances, medium-term changes and long-term trends. Combined with cross-variable dynamic gating, it realizes the adaptive selection of which variable and its change mode are more important in the current liquid evolution stage. The model size is controllable and the interpretability at the variable level is preserved. (5) This application constructs a time-aware contrastive learning branch and uses the similarity of continuous remaining time to guide the model to learn the common fluid accumulation evolution pattern across wells and across events, thereby improving the cross-well generalization ability under small sample fluid accumulation event conditions. (6) This application adopts joint training of Huber regression loss, time-aware contrast loss and time ranking constraint loss, which is robust to label time bias and ensures that the prediction results meet the time monotonicity. (7) This application divides the dataset by well location and supplements it with cross-validation with one well left. The evaluation results truly reflect the cross-well generalization performance. Furthermore, by defining the maximum effective prediction lead time, the reliable prediction range of the model is clearly defined, which facilitates field engineering applications. Attached Figure Description
[0016] Figure 1 This is a flowchart of an embodiment of the intelligent prediction and decision-making method for wellbore fluid accumulation in shale gas well production process provided in this application; Figure 2 This is a schematic diagram of the overall architecture of the intelligent prediction model for fluid accumulation provided in another embodiment of this application; Figure 3 This is a schematic diagram of the liquid accumulation event time calibration process provided in another embodiment of this application; Figure 4 This is a schematic diagram of the structure of a multi-scale dilated temporal convolutional network provided in another embodiment of this application; Figure 5 This is a schematic diagram of the structure of a cross-variable dynamic gating system provided in another embodiment of this application; Figure 6 This is a schematic diagram of an online rolling prediction process provided in another embodiment of this application. Detailed Implementation
[0017] Specific embodiments of this application will now be described in detail with reference to the accompanying drawings. While specific embodiments of this application are shown in the drawings, it should be understood that this application can be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided to enable a more thorough understanding of this application and to fully convey the scope of this application to those skilled in the art.
[0018] It should be noted that certain terms are used in the specification and claims to refer to specific components. Those skilled in the art will understand that different terms may be used to refer to the same component. This specification and claims do not distinguish components based on differences in terminology, but rather on differences in function. The terms "comprising" or "including" used throughout the specification and claims are open-ended and should be interpreted as "comprising but not limited to." The following descriptions in the specification are preferred embodiments for carrying out this application; however, these descriptions are for the purpose of understanding the general principles of the specification and are not intended to limit the scope of this application. The scope of protection of this application shall be determined by the appended claims.
[0019] To facilitate understanding of the embodiments of this application, the following will provide further explanation and description with reference to the accompanying drawings and specific embodiments, and the accompanying drawings do not constitute a limitation on the embodiments of this application.
[0020] In one embodiment, this embodiment provides an intelligent prediction and decision-making method for wellbore fluid accumulation during shale gas well production. This method addresses only one problem: at the current production moment, using only current and historically obtained production data, predicting how much time remains before the next fluid accumulation "start time," i.e., predicting the remaining fluid accumulation time. The model does not predict future oil pressure, casing pressure, or production curves, nor does it use the severity of fluid accumulation as the final output. The actual remaining fluid accumulation time is defined as... ,in The model outputs the predicted remaining time of effusion, where t is the label-corrected start time from historical events; t is the current prediction time. And further calculate the expected start time of fluid accumulation. The specific steps are as follows: S100: Construct and preprocess a dynamic dataset of shale gas well production, and calibrate the event time of historical liquid accumulation events based on a fixed quantile threshold.
[0021] S101: Data Acquisition: Minute-level production data for approximately one year was collected from 20 typical horizontal wells in the CN shale gas demonstration area of China. The data is largely continuous with very few missing values; zero values corresponding to well shut-in or production stoppage are the actual instrument measurements and are not deleted as missing values. Six production parameters—casing pressure, oil pressure, post-valve pressure, instantaneous production, casing-oil pressure differential, and temperature—were selected as input variables. The original 5-minute data was permanently retained; during modeling, the 5-minute data was converted to a 30-minute baseline time step, used only for model input and dynamic feature calculations, and the original data was not overwritten.
[0022] S102: Data Preprocessing: Time alignment, unit unification, and anomaly / missing value checks are performed on the raw production data; zero values are retained, and missing value interpolation is not performed; if a production / shutdown status field already exists, the status is used as an auxiliary mask channel; if no explicit status field exists, a valid production status mask is generated from the existing production status determination rules. For windows that are clearly in a non-predictable production state, no master prediction sample is constructed.
[0023] S103: Dataset Partitioning: The training, validation, and test sets are partitioned by well location. Each well contains multiple events, and training, validation, and testing partitioning must be done by well location. It is prohibited to split different events or sliding windows from the same well into different datasets. The main experiment uses 14 training wells, 3 validation wells, and 3 test wells. Test wells are selected based on high, medium, and low event frequency. To obtain more stable cross-well generalization evaluation, an additional 20 rounds of "one well reserved for validation" are added: one well is reserved for testing in each round, and the remaining 19 wells are used for training and validation.
[0024] S104: Initial Expert Judgment Time Acquisition: Based on on-site records and expert observations of dynamic curves such as casing pressure, production, and oil-casing pressure differential, the initial expert judgment time for each fluid accumulation event is first obtained. This timeframe is used to narrow down the scope of historical events, but it is not directly used as the final supervised learning label.
[0025] S105: Event Retrospection: Retrospectively analyze 72 hours before the initial expert assessment time for each historical event, i.e. Extract 5-minute data points for casing pressure, instantaneous production, and oil-casing pressure differential. This backtracking process is used only for historical label correction, allowing the use of complete historical event information, and is not used as input for online prediction.
[0026] S106: Fixed Quantile Threshold Calculation: To eliminate the "reference sample undefined" problem in label calibration, the 95th percentile threshold is uniformly calculated from historical normal production data of training wells during the model development phase and is consistently used in subsequent verification, testing, and online prediction phases. A normal reference sample meets the following criteria: it is in an effective production state and does not fall within the influence range of any historical fluid accumulation event. The event influence range is determined by the initial expert assessment time and on-site recovery information, thus avoiding the use of the final fluid accumulation start time to define the normal distribution in reverse. Parameters used for event calibration... ,calculate and Each parameter is calculated only once for Q05 and Q95 to obtain a fixed threshold, preventing the threshold from changing due to the event itself during the label construction process.
[0027] S107: Bilateral Anomaly Detection: Since historical data does not yet support a unified directional assumption of "casing pressure will definitely increase" or "oil-casing pressure differential will definitely increase," label calibration adopts bilateral anomaly detection instead of arbitrarily specifying a single direction. For the event calibration parameter j, define... Among them, abnormal casing pressure Pc indicates that the casing pressure deviates from the normal fluctuation range, abnormal production Q indicates that the production rate deviates from the normal fluctuation range, and abnormal oil-casing pressure difference ΔP indicates that the oil-casing pressure difference deviates from the normal coupling state.
[0028] S108: Three-parameter joint anomaly determination: Defining joint anomaly indicators ,when When candidate fluid accumulation anomalies are formed, the default is... This means that at least two of the three indicators simultaneously exceed their respective normal ranges. This is because Pc and ΔP have an algebraic relationship. The “joint” here does not assume that the three physical quantities are statistically independent, but rather uses the coupling indicators of casing pressure, production and pressure to jointly provide engineering confirmation information. ΔP is equivalent to supplementing the oil pressure-related changes in the joint determination.
[0029] S109: Continuous Confirmation and Dual Time Definition: A single 5-minute anomaly may originate from instrument fluctuations; therefore, continuous confirmation is added to candidate anomalies. Definition For "the first time forming k consecutive 5-minute sampling points, and each point satisfies..." The start time of the "abnormal sequence", i.e. ,in Let k be the starting point of the first outlier sequence that satisfies the condition of k consecutive points; define This is the moment when the continuous abnormal sequence is confirmed. Both are determined by the scan results, without using simple fixed formulas to handle intermittent anomalies. (Default Implementation) This involves continuous confirmation for 25 minutes; additionally, sensitivity analyses with k=3, 5, and 10 are used to evaluate label time shift and stability. The model supervision labels always use... ,and This is used only for historical label quality control and online event status confirmation. If no continuous abnormal sequence satisfying the conditions m and k exists within the 72-hour backtracking window, the event is marked as "no stable statistical trigger label formed" and will not be included in the main regression training set; Expert Time Reserved for incident quality review.
[0030] S110: Event Time Alignment and Study Window: All historical effusion events are aligned to their respective timelines. Using zero point as the time, a unified relative time coordinate is formed. The current stage uses the 10 days prior to the fluid accumulation as the sample range for event evolution analysis and candidate prediction, i.e. Event alignment is only used for historical research, tag generation, and offline pattern analysis, and depends on... Only computationally calculable event features relative to the baseline must not be used as input to the online model.
[0031] S111: Supervised Learning Sample Construction: The original data is at the 5-minute level, and the model's base time step is uniformly set to 30 minutes. The initial implementation uses a 10-day historical input window, corresponding to... Each time step is 30 minutes; the initial sliding step size is 2 hours, corresponding to... A 30-minute step. Define the sample. ,Label Each historical fluid accumulation event can generate multiple training samples, with the sample input containing only... and previous data, Used only for calculating historical tags Online predictions do not require knowing the future. .
[0032] S200: Constructing an intelligent prediction model for fluid accumulation. The model adopts an overall structure of "variable-level shared temporal coding - multi-scale dilated temporal convolutional network - cross-variable dynamic gating - time-aware comparative learning - residual time regression". The model parameters are controllable in scale, the time scale is fully covered, and it emphasizes the learning of fluid accumulation evolution representation across wells and events.
[0033] S201: Feature Standardization and Dynamic Feature Construction: The model input is uniformly standardized using the global Z-score of the training set statistics. ,in , Calculated from training well data and frozen during training, validation, testing, and online phases. Simultaneously, dynamic features are constructed that rely solely on current and historical data, including: the original state (Pc, Pt, Pv, Q, ΔP, T, and state mask), the first-order difference X(t)−X(t−1), the rate of change [X(t)−X(t−k)] / X(t−k), the rolling mean (mean of the past w time steps), the rolling standard deviation (standard deviation of the past w time steps), and the rolling slope (slope of the linear fit of the past w time steps). All rolling features employ causal windows, using only data from the current time and prior, and prohibiting the use of future windows, events relative to a baseline, or data requiring prior knowledge. Locational characteristics.
[0034] S202: Variable-level Independent Linear Embedding: Independent linear mappings are applied to each of the six variables to map different physical variables to a unified channel dimension. j=1,…,6. A shared temporal convolution kernel is then used for temporal pattern extraction. This design balances variable individuality and parameter scale: variables have independent input projections, and the temporal encoder is shared among the six variables. A global Z-score further eliminates dimensional and scale differences.
[0035] S203: Shared-weight multi-scale dilated temporal convolutional network: Instead of explicitly splitting into multiple patches, multi-scale convolutions employ parallel temporal convolutional branches with different dilation rates on the same input sequence. Default kernel size. expansion rate Each branch has a different temporal receptive field, covering short-term disturbances, medium-term changes, and longer-term trends, respectively. The output of each branch... = ( ), obtained through fusion Each TCN branch employs residual connections and causal convolutions to ensure that the output does not use future data at any given time.
[0036] S204: Transvariable Dynamic Gating: After obtaining independent representations F1…F6 from six variables, six dynamic gating weights are generated based on the current window state to answer the question, "Which variable and its change pattern are more important in the current liquid accumulation evolution stage?" Global pooling context is calculated. Generate gate weights The weighted fusion yields a comprehensive fluid accumulation evolution representation. This architecture does not use a large-scale multi-head Transformer, but instead employs lightweight variable-level dynamic gating to control model size and preserve interpretability at the variable level.
[0037] S205: Time-Aware Contrastive Learning Branch: Maps the comprehensive fluid accumulation evolution representation F to the contrastive learning space z, enabling samples with similar time points to the fluid accumulation to have similar latent representations, and making samples at significantly different stages of fluid accumulation evolution more distinguishable. (Computation) Similarity Continuous-time similarity is defined as... ,in Controlling the rate of temporal similarity decay: the closer the remaining times, The larger the difference, the greater the remaining time. The smaller the value, the less discrete the liquid level label is used.
[0038] S206: Contrastive Learning Sampling Rule: Prioritize constructing sample pairs from different wells and different fluid accumulation events to enable the model to learn common evolutionary patterns across wells and events; within the same event, if the actual time interval between two samples is less than... In this case, the sample pair is neither considered a positive nor a negative sample, thus avoiding false similarity or false negative samples caused by highly overlapping windows; samples from different events in the same well can be used when the cross-event candidate pool is insufficient, but are still calculated according to the time difference. During mini-batch training, each anchor prioritizes sampling several recent time samples across events as high-weighted front-end pairs, and then samples the remaining time samples from more distant events as the contrasting background. The time-aware contrast loss is... , where τ is the comparison temperature parameter, and the summation range only covers the legal sample pairs filtered by the sampling rules.
[0039] S207: Remaining Time Regression Branch: The comprehensive fluid accumulation evolution representation F is mapped and output to predict the remaining fluid accumulation time. .
[0040] S300: Construct a joint loss function and perform end-to-end training optimization of the model.
[0041] S301: Remaining Time Regression Loss: The Huber loss is used to calculate the error between the predicted remaining effusion time and the actual remaining effusion time. Huber loss is more robust than simple squared loss for a small number of events with large label time errors, and is suitable for situations where there may still be a small amount of time bias in the initial judgment by human experts and statistical correction.
[0042] S302: Time-ordering constraint loss: For a pair of valid samples (i,j), if the actual remaining time satisfies If the predicted results are in the same order, then the order should be maintained. During training, ordered sample pairs with sufficient time difference are randomly selected within the mini-batch to avoid imposing meaningless ranking constraints on nearly identical labels. The ranking loss is... ,in The sorting interval is used. The sorting loss only applies to valid time pairs within a batch and is not calculated across batches.
[0043] S303: Joint Loss Function: Total Loss ,in and The training weights are determined by the validation set. During the model inference phase, only the encoder and regression heads are retained; contrastive and ranking losses do not need to be calculated.
[0044] S304: Training and Model Selection Process, specifically including: Step 1, calculating all input features using normal production data from training wells. and Step 1: Calculate the Q05 / Q95 thresholds for Pc, Q, and ΔP using normal production data from the training well, and freeze the label correction thresholds; Step 2: Apply the same fixed thresholds to historical events. Correction, forming supervision labels; Step 4, with Step 5: Construct training / validation / test event samples for time zero; Step 6: Generate dynamic features using only current and historical data and perform global Z-score normalization; Step 7: Input a multi-scale dilated temporal convolutional network and variable-level dynamic gating to obtain a comprehensive fluid evolution representation; Step 8: Calculate time-aware contrastive loss, Huber regression loss, and time ranking loss; Step 9: Perform early stopping and hyperparameter selection based on validation set performance, and save the optimal model on the validation set; Step 10: Perform final evaluation on a fixed test set and leave-one-well validation. In this embodiment, the Adam optimizer is used with an initial learning rate of 0.0006, a batch size of 32, and an early stopping policy patience of 10, and training is completed on a CPU server.
[0045] S400: Online rolling forecast.
[0046] S401: During online operation, after obtaining a new complete 30-minute data segment, a historical sequence of length L=10d is extracted from the production database, with the most recent available time t* as the window endpoint. If there is a data arrival delay in the system... The input window endpoint is then used. Ensure that the data within the window is complete.
[0047] S402: Read the six-parameter production sequence [t*−L, t*], compute the currently available dynamic features, and use the frozen training set. , Standardization is performed, and the input to the fluid accumulation intelligent prediction model is processed through a multi-scale dilated temporal convolutional network, variable-level dynamic gating, and a regression head to output the predicted remaining fluid accumulation time. .
[0048] S403: Calculate the estimated start time of fluid accumulation This serves as the core output for on-site time-point early warning.
[0049] S500: Prediction result output.
[0050] S501: Proximity State Determination: When At that time, the system transitions from "time prediction" to "liquid accumulation approaching" state. The parameters for engineering configuration can be determined based on the error distribution of the validation set and the lead time for on-site handling, and are not forcibly fixed to a single value at the algorithm layer.
[0051] S502: Online Event Status Confirmation: Employing the same logic as the historical label correction module, if the current and subsequent data satisfy the joint anomaly of the m parameters and are confirmed at k consecutive points, then it enters the liquid accumulation confirmation state. The model's time prediction output still uses... With the core as the core.
[0052] S503: The final output includes four items: predicted remaining time. Answer "How long until the fluid accumulates?"; estimated onset time of fluid accumulation. This generates on-site time-point early warnings; near-term status ( This triggers manual attention / preparation for handling; the event status is confirmed (meeting the criteria of joint anomaly + continuous k points), completing online status confirmation. The model's final core output is only "estimated time of liquid accumulation"; risk level, future production curve, and control measures are not included as additional outputs of this model.
[0053] The initial implementation values of the key parameters in this embodiment are shown in Table 1.
[0054] Table 1 Initial Implementation Values of Key Parameters The above embodiments are only for illustrating the technical concept and features of this application, and are intended to enable those skilled in the art to understand the content of this application and implement it accordingly. They should not be construed as limiting the scope of protection of this application. All equivalent changes or modifications made in accordance with the spirit and essence of this application should be included within the scope of protection of this application.
Claims
1. A method for intelligent prediction and decision-making regarding wellbore fluid accumulation during shale gas well production, characterized in that, The method includes the following steps: S100: Construct a dynamic dataset of shale gas well production and preprocess it; calibrate the event time of historical liquid accumulation events based on a fixed quantile threshold; generate a supervision label for the start time of liquid accumulation; and construct supervised learning samples. S200: Construct an intelligent prediction model for liquid accumulation, perform variable-level independent linear embedding on the input production time series, extract multi-scale time series features of each variable through a shared weight multi-scale dilated temporal convolutional network, generate a comprehensive liquid accumulation evolution representation through cross-variable dynamic gating fusion, and construct a time-aware contrastive learning branch and a remaining time regression branch based on the comprehensive liquid accumulation evolution representation; S300: Construct a joint loss function that includes residual time regression loss, time-aware contrast loss, and time-ranking constraint loss, and perform end-to-end training and optimization of the liquid accumulation intelligent prediction model; S400: Receives current and historical production data of the shale gas well to be predicted, inputs the trained intelligent liquid accumulation prediction model, outputs the predicted remaining liquid accumulation time, and calculates the expected liquid accumulation start time based on the current prediction time. S500: Based on the predicted remaining liquid accumulation time, determine the near-term state and make decisions on the state of the liquid accumulation event, and output the prediction results.
2. The intelligent prediction and decision-making method for wellbore fluid accumulation during shale gas well production process according to claim 1, characterized in that, In step S100, the dataset construction, preprocessing, and event time calibration are achieved through the following steps: S101: Collect minute-level continuous production data of shale gas wells from multiple production platforms in the same block. The production data includes casing pressure, oil pressure, valve post-pressure, instantaneous production, oil-casing pressure difference, and temperature. The oil-casing pressure difference is calculated from the difference between casing pressure and oil pressure. S102: Perform time alignment and unit unification processing on the raw production data, retain the zero-value measurement results corresponding to the well shut-in or production stop status, and do not delete them as missing values; S103: Divide the training set, validation set and test set according to the well location to ensure that all events and samples of the same well belong to the same dataset; S104: Obtain the on-site log and the expert's initial judgment time of historical liquid accumulation events observed by experts based on the dynamic curves of casing pressure, production, and oil-casing pressure difference. Backtrack the set time before the expert's initial judgment time of each historical liquid accumulation event, extract the original production data of relevant parameters, and use it for historical event time calibration. S105: Calculate the fixed quantile threshold of each event calibration parameter using normal production data from the training well, wherein the normal production data is in an effective production state and does not fall within the influence range of any historical liquid accumulation event. S106: Based on the fixed quantile threshold, perform bilateral anomaly determination on the calibration parameters of each event, and calculate the multi-parameter joint anomaly index; S107: Based on the continuous confirmation of the joint anomaly indicators, determine the effusion start time and effusion confirmation time of each historical effusion event; S108: Align the event time of each historical effusion event with the effusion start time as the time zero point, and construct supervised learning samples within the pre-effusion study window according to the set historical input length and sliding step size.
3. The intelligent prediction and decision-making method for wellbore fluid accumulation during shale gas well production process according to claim 1, characterized in that, In step S200, the liquid accumulation intelligent prediction model is constructed through the following steps: S201: Embed each physical variable in the input production timeline using an independent linear mapping to map different physical variables to a unified channel dimension; S202: Construct a shared-weight multi-scale dilated temporal convolutional network, using parallel temporal convolutional branches with different dilation rates on the same input sequence. Each branch uses causal convolution and residual connections to extract multi-scale temporal features covering different receptive fields. S203: The multi-scale temporal features of each variable are fused, and the dynamic gating weights of each variable are generated based on the current window state. The weighted fusion is then used to obtain the comprehensive liquid accumulation evolution representation. S204: Construct a time-aware contrastive learning branch, map the comprehensive fluid accumulation evolution representation to the contrastive learning space, construct continuous time similarity weights based on the proximity of the actual remaining fluid accumulation time between samples, and construct a time-aware contrastive loss. S205: Construct a residual time regression branch, and output the prediction of residual liquid time by mapping the comprehensive liquid evolution representation.
4. The intelligent prediction and decision-making method for wellbore fluid accumulation during shale gas well production process according to claim 1, characterized in that, In step S300, the construction of the joint loss function and model training are achieved through the following steps: S301: Construct the total loss function, which is a weighted sum of the remaining time regression loss, the time-aware contrast loss, and the time ranking constraint loss; S302: Construct a residual time regression loss and use Huber loss to calculate the error between the predicted residual effusion time and the actual residual effusion time; S303: Construct a time-ordering constraint loss. For sample pairs whose actual remaining fluid times meet the set time difference condition and are located in the same training batch, constrain their predicted remaining fluid times to maintain a consistent ordering relationship with the actual remaining fluid times. S304: Freeze the standardized parameters and event quantile thresholds before training, use an optimizer and early stopping strategy to train the model end-to-end, and select the optimal model based on the performance on the validation set.
5. The intelligent prediction and decision-making method for wellbore fluid accumulation during shale gas well production process according to claim 1, characterized in that, In steps S400 and S500, the online rolling prediction and result output are achieved through the following steps: S401: During online operation, after each new complete data segment is obtained, the system data arrival delay is taken into account, and the latest available time after delay correction is used as the end point of the input window to extract a historical production data sequence of a set length from the production database. S402: Calculate dynamic features based on current and historical data, standardize using standardized parameters frozen during the training phase, input the liquid accumulation intelligent prediction model, and output the predicted remaining liquid accumulation time. S403: Calculate the expected start time of liquid accumulation based on the predicted remaining liquid accumulation time and the current predicted time; S501: When the predicted remaining liquid accumulation time is not greater than the near-term warning threshold configured in the engineering, the system is determined to enter the near-term liquid accumulation state; S502: Employs the same joint anomaly determination and continuous confirmation logic as historical event time calibration to make online liquid accumulation event status decisions on current and subsequent production data; S503: Outputs the predicted remaining liquid accumulation time, the estimated liquid accumulation start time, the current status, and the liquid accumulation event confirmation status.
6. A smart prediction and decision-making device for wellbore fluid accumulation in shale gas well production process based on the method of claim 1, characterized in that, include: The data preprocessing module is used to collect dynamic production data from shale gas wells, perform time alignment, unit unification and zero value retention processing, and divide the dataset by well location; The event labeling module is used to perform bilateral anomaly detection, joint anomaly calculation and persistence confirmation on historical effusion events based on fixed quantile thresholds, generate effusion start time supervision labels and construct supervised learning samples; The model building module is used to build a liquid accumulation intelligent prediction model that includes variable-level independent linear embedding, shared-weight multi-scale dilated temporal convolutional network, cross-variable dynamic gating, time-aware contrastive learning branch and residual time regression branch. The model training module is used to construct a joint loss function that includes residual time regression loss, time-aware contrast loss, and time-ranking constraint loss, and to perform end-to-end training and optimization of the liquid accumulation intelligent prediction model. The prediction execution module is used to receive the current and historical production data of the gas well to be predicted, input the trained liquid accumulation intelligent prediction model, and output the predicted remaining liquid accumulation time and the expected liquid accumulation start time. The results output module is used to determine the near-term state and make decisions on the state of the effluent event based on the predicted remaining effluent time, and output the prediction results.
7. A smart prediction and decision-making system for wellbore fluid accumulation in shale gas well production process based on the method of claim 1, characterized in that, include: The data input module is used to receive current and historical production data and predicted configuration parameters from shale gas wells; The feature calculation module is used to calculate dynamic features based on current and historical data, and to perform standardization processing using standardized parameters frozen during the training phase. The prediction calculation module is used to call the trained intelligent effusion prediction model to perform prediction calculations and output the predicted remaining effusion time and the expected effusion start time. The results output module is used to output the predicted remaining liquid accumulation time, the estimated liquid accumulation start time, the current status, and the confirmation status of the liquid accumulation event. It supports visualization and data export.
8. An electronic device based on the method of claim 1, characterized in that: include: Memory, processor, and computer programs stored in memory and executable on the processor, wherein, When the processor executes the program, it implements the method according to any one of claims 1 to 5.
9. A computer storage medium based on the method of claim 1, characterized in that, The computer storage medium stores computer-executable instructions for performing the method according to any one of claims 1 to 5.
