Well condition self-adaptive method and system for intelligent foam scrubbing and dosing

By using the intelligent foaming dosing method, and utilizing LSTM network and dual-delay depth deterministic strategy gradient model, real-time assessment of wellbore status and adaptive optimization of dosing parameters are achieved. This solves the problems of existing technologies where dosing strategies rely on human experience and automated systems lack closed-loop optimization, thus ensuring stable gas well production and reagent efficiency.

CN121803205APending Publication Date: 2026-04-07CHINA PETROLEUM & CHEMICAL CORP +2
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-02
Publication Date
2026-04-07

AI Technical Summary

Technical Problem

Existing foam dosing methods lack well condition response capabilities and system autonomy. They rely on manual experience for setting and cannot accurately identify the state and type of liquid accumulation in the wellbore, resulting in excessive or insufficient dosing, which affects the foam liquid carrying efficiency. Furthermore, automated dosing systems lack real-time evaluation and strategy backtracking optimization capabilities, leading to a mismatch between the dosing regime and the actual well conditions, making it difficult to continuously ensure stable gas well production.

Method used

An intelligent bubble-drain dosing method for well conditions is adopted. By collecting well condition characteristic parameters in real time, an LSTM time-series network is constructed, and a dual-delay depth deterministic strategy gradient model is trained to achieve the optimal mapping of dosing parameters in the continuous action space. The dosing operation is executed through a PLC system, and closed-loop optimization is performed by combining a multi-objective evaluation function. An experience pool is constructed for adaptive adjustment.

Benefits of technology

It enables precise capture of the dynamic characteristics of the wellbore, generates reliable chemical dosing strategies, ensures stable gas well production, reduces chemical waste, optimizes production costs, improves foam liquid carrying efficiency, and adapts to dynamic well condition changes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121803205A_ABST
    Figure CN121803205A_ABST
Patent Text Reader

Abstract

The invention discloses a well condition self-adaptive method and system for intelligent foam scrubbing and dosing, and the method comprises the steps: collecting well condition characteristic parameters of a target gas well in real time, synchronously obtaining historical dosing data, and constructing a characteristic set representing a wellbore state and a dosing effect based on an LSTM sequential network; based on the feature set, training a double-delay depth deterministic strategy gradient model as a decision maker, learning a mapping relation from well condition features to dosing parameters through an Actor-Critic architecture, outputting an optimal concentration-duration combined dosing scheme, executing foam scrubbing agent injection by a PLC control system, continuously monitoring the change trend and amplitude of well condition feature parameters, and determining the optimal concentration-duration combined dosing scheme according to the change trend and amplitude of the well condition feature parameters. The effect is quantified through a multi-objective evaluation function; the dosing scheme, the real-time characteristics and the evaluation result are used as new samples to be stored in an experience pool, TD3 network parameters are updated, an Actor strategy is optimized through the value gradient of the Critic network, and self-adaptive adjustment of the decision model on working condition drifting is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of shale gas field development technology, and in particular to an intelligent bubble drainage and chemical dosing well condition adaptive method and system. Background Technology

[0002] In shale gas field development, foam-drainage dosing is a key technology for controlling wellbore fluid accumulation. The accuracy and adaptability of its dosing strategy directly affect gas well production and development economic benefits. Especially under dynamically changing well conditions, achieving intelligent optimization of reagent type, concentration, and dosing timing has become a core challenge in promoting digital management and efficient development of gas fields. Current foam-drainage dosing methods still have significant shortcomings in terms of well condition response capability and system autonomy, specifically: existing dosing systems largely rely on manual experience, dosing based on fixed cycles or simple liquid level thresholds, failing to integrate multi-source sensor data such as wellhead pressure and flow rate, and thus unable to accurately identify the state and type of wellbore fluid accumulation. Particularly in wells with large fluctuations in gas production and changes in the liquid-to-gas ratio, experience-based dosing can lead to excessive or insufficient reagents, not only wasting reagents but also potentially exacerbating the decline in foam carrying efficiency. Although some new dosing devices have introduced automated control units, existing automated dosing systems mostly adopt "set-execute" open-loop control. Their decision-making logic still relies on presets, enabling automatic dosing, mixing, and injection, but lacking real-time evaluation of dosing effects and strategy backtracking optimization mechanisms. Adjustments to dosing parameters depend on manual intervention, making it impossible to track gas well production dynamics. This leads to a mismatch between the dosing regime and actual well conditions, resulting in a gradual degradation of dosing effectiveness and making it difficult to sustain stable gas well production. Summary of the Invention

[0003] To address the aforementioned technical problems, this invention provides an intelligent foam drainage and chemical dosing method and system adapted to well conditions, applicable to foam drainage under dynamic mining conditions, to solve: The problem of relying on manual experience for chemical dosing strategies and being unable to accurately respond to dynamic well conditions: Existing methods are based on fixed cycles or simple liquid level thresholds for chemical dosing, which fail to effectively integrate multi-source sensor data such as wellhead pressure and flow rate. This results in the inability to accurately identify the state and type of liquid accumulation in the wellbore. In wells with large fluctuations in gas production and changes in liquid-gas ratio, it is easy to cause excessive or insufficient dosing, which wastes dosing and affects the efficiency of foam liquid carrying. The existing automated chemical dosing systems suffer from low intelligence and lack of closed-loop optimization capabilities: Current systems mostly adopt an open-loop control mode of "set-execute", and their decision-making logic relies on preset parameters. They cannot evaluate the dosing effect in real time or optimize the strategy backtracking. The adjustment of dosing parameters still relies on manual intervention, which leads to a mismatch between the dosing system and the actual production dynamics, resulting in the degradation of the effect in the later stage and making it difficult to continuously ensure the stable production of gas wells.

[0004] This invention is achieved using the following technical solution: Firstly, an intelligent bubble-drainage chemical dosing method adaptive to well conditions includes the following steps: Step S1: Real-time acquisition of well condition characteristic parameters of the target gas well, synchronous acquisition of historical chemical dosing data, use LSTM time series network to mine dynamic features of well condition, construct a feature set representing wellbore status and chemical dosing effect, and perform feature normalization preprocessing. Step S2: Based on the feature set constructed in Step S1, train a dual-delay deep deterministic strategy gradient model as a decision maker; the dual-delay deep deterministic strategy gradient model learns the mapping relationship between well condition features and dosing parameters through the Actor-Critic architecture, and outputs the optimal concentration-duration combination dosing scheme in the continuous action space. Step S3: Based on the dosing plan output in step S2, use the PLC control system to execute the foaming agent injection operation; after the dosing is completed, continuously monitor the changing trend and amplitude of well condition characteristic parameters, and collect dynamic indicators such as pressure change rate and gas-liquid ratio fluctuation value. Step S4: Analyze the response data monitored in Step S3, and quantify the effects of improved drainage efficiency and optimized reagent costs through a multi-objective evaluation function; Step S5: Store the dosing plan, real-time features, and evaluation results as new samples in the experience pool. Update the TD3 network parameters based on sample priority. Optimize the Actor strategy through the value gradient of the Critic network to achieve adaptive adjustment of the decision model to the operating condition drift.

[0005] Specifically, step S1 includes: Step S11: Real-time oil pressure data is collected using well site sensors. , sleeve pressure Simultaneous monitoring of gas production With liquid production Data is uploaded to edge computing nodes at preset intervals to construct a four-dimensional time series matrix: ; Step S12: Integrate historical chemical dosing data, including concentration, duration, and corresponding well condition changes before and after dosing. Extract dosing records from the production database and store them in a structured format. ; By correlating well condition data from 72 hours before and after chemical dosing, a historical sample set is constructed as follows: ; in, This refers to the start time of medication administration. Historical number of times medication was administered; Step S13: Apply a long short-term memory network to perform in-depth time-series analysis of well condition parameters and extract pressure fluctuation rate. Gradient of production change State transition continuity The three core dynamic features are represented as follows: ; ; ; Step S14: Perform Z-score normalization on the extracted feature set to construct a feature vector space representing the wellbore state and the dosing effect, represented as: ; in, The mean of the features within the window. The standard deviation is denoted as .

[0006] Specifically, step S2 includes the following sub-steps: Step S21: Convert the feature vector Corresponding drug administration actions Construct a set of time-stamped state-action sample pairs, aligned by time. Step S22: An Actor-Critic dual-network architecture is adopted, in which the Actor network learns the mapping strategy from state features to drug administration actions, and the Critic network evaluates the value of actions. The robustness of the strategy is optimized through a dual-delay update mechanism. Step S23: Perform cross-validation on the historical dataset and compute the policy reward function, expressed as: ; in, =0.7, β=0.3 are the weights. The baseline gas production rate; Step S24: Input the current well condition feature vector into the trained Actor network and output the optimal dosing parameters in the continuous action space.

[0007] Specifically, in step S22, the Actor network adopts a 3-layer fully connected network, and the output layer uses the Sigmoid function to constrain the action range, as shown below: ; in, σ is the Sigmoid function; The Critic network has a dual-network structure, with input... Output scalar value, the objective function is expressed as: ; in, =0.99 is the discount factor. For target network parameters; The dual-delay update mechanism delays the update of the Actor after every two Crilic updates, as follows: .

[0008] Specifically, step S3 includes: Step S31: Precise dosing execution control; the PLC system executes the dosing based on the output optimal dosing parameters. The concentration and error of the foaming agent are controlled by a metering pump, and the timing accuracy of the dosing time is ensured to the second level. Step S32: Real-time dynamic monitoring of well conditions, continuously collecting raw data on oil pressure, casing pressure, gas production, and fluid production at a sampling cycle of 5 minutes. After chemical dosing, 72-hour enhanced monitoring is initiated, with the sensor sampling cycle increased to 1 minute, and a monitoring matrix is ​​constructed. ; Step S33: Key indicator analysis and calculation. Based on monitoring data, calculate the pressure change rate and gas-liquid ratio fluctuation value in real time. The unit of the pressure change rate is... , is represented as: ; The gas-liquid ratio fluctuation value is expressed as: .

[0009] Specifically, the evaluation in step S4 includes: Multi-parameter monitoring data, including core parameters such as oil pressure, casing pressure, gas production, and liquid production collected continuously after chemical dosing, are time-aligned and cleaned to form a complete evaluation dataset; The calculation of core performance indicators includes gas production increment rate, pressure recovery index, unit reagent yield, comprehensive effect score, and effect grading and feedback.

[0010] Specifically, the calculation of the core performance indicators is as follows: Gas production increment rate: ; Stress Recovery Index: ; Unit drug yield: ; in, Pump displacement, L / h; The price is the unit price of natural gas, in yuan / m³. This is the unit price of the medicine, in yuan / kg; Dynamic weight adjustment: ; During the period of increased production: Stable production period: ; Classification threshold: Indicates superior efficacy. S<0.5 indicates that the condition is valid, and S<0.5 indicates that the condition is invalid.

[0011] Specifically, step S5 includes the following sub-steps: Step S51: Full-cycle experience accumulation, integrating key parameters of successful chemical dosing programs, dynamic well condition characteristics, and effect evaluation results into knowledge units, and storing them in the cloud experience pool; the knowledge unit is represented as: ; Where t = time segment, , ; Step S52: Intelligent sample screening prioritizes learning effective strategies under extreme conditions; ineffective solutions undergo in-depth inversion analysis to extract failure features; boundary condition samples are automatically marked with red warning labels. Step S53: Dynamic evolution of the decision model, value network evaluation, cross-validation of strategy merits and demerits through dual evaluators, and identification of potential decision biases; Step S54: Optimize the policy network and update the dosing decision rules based on the value assessment results; control the policy update magnitude through a safe iteration mechanism; when the features are detected to be continuously deviating from the historical distribution, initiate a hot restart of the model and retain the core experience.

[0012] On the other hand, an intelligent well condition adaptive system for foam-drainage chemical dosing includes: Data acquisition and feature extraction module: Based on well site sensors and production database, it collects parameters of oil pressure, casing pressure, gas production and liquid production of the target gas well, as well as historical dosing data including concentration, duration and corresponding changes in well conditions before and after dosing; Initial intelligent dosing scheme generation module: Constructs a dual-delay deep deterministic strategy gradient model decision-maker, and learns and outputs the optimal concentration-duration combination scheme based on the Critic architecture; Chemical dosing execution and effect monitoring module: Set up and connect to the PLC control system to execute chemical injection operations and monitor well condition characteristic parameters and dynamic indicators; The drug administration effect quantitative evaluation module: configures multi-objective evaluation functions to comprehensively evaluate the optimization effect of multiple indicators; Iteration and Strategy Optimization Module: Set up an experience pool to store dosing plans, real-time features and evaluation results and update them, while configuring optimization strategies for adaptive adjustment.

[0013] The beneficial effects of this invention are as follows: (1) Real-time fusion of multi-source sensor data such as oil pressure, casing pressure, and gas / liquid production to accurately capture the dynamic characteristics of the wellbore and overcome the lag of human experience judgment. Construct a feature set that integrates historical chemical dosing effects to realize the quantitative correlation between wellbore status and chemical response, providing high-dimensional information support for intelligent decision-making.

[0014] (2) Based on the Actor-Critic architecture of the dual-delay depth deterministic strategy gradient model (TD3), the continuous spatial optimal mapping from well condition characteristics to concentration-duration combination is realized, breaking through the limitations of human experience, and generating reliable dosing strategies in minutes under well conditions with large fluctuations in gas production and changes in liquid-gas ratio.

[0015] (3) The "execution-monitoring-evaluation-optimization" closed-loop system quantifies the dosing effect through a multi-objective evaluation function and dynamically optimizes the Actor strategy based on the Critic network value gradient to achieve adaptive adjustment of dosing parameters and eliminate the degradation of later effects caused by the dependence on preset parameters.

[0016] (4) The priority experience pool storage mechanism and 24-hour autonomous iterative update enable the decision model to continuously match the dynamic changes in production, significantly reduce the risk of strategy mismatch, ensure long-term stable production of gas wells, and optimize the production cost per ton of gas through unit reagent yield feedback. Attached Figure Description

[0017] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the structures shown in these drawings without creative effort.

[0018] Figure 1 This is a basic flowchart of the intelligent foaming and dosing method for well condition adaptation of the present invention. Detailed Implementation

[0019] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. The components of the embodiments of the present invention described and shown in the accompanying drawings can generally be arranged and designed in various different configurations.

[0020] It should be noted that similar labels and letters in the following figures indicate similar items. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures.

[0021] The following is in conjunction with the appendix Figure 1 The following describes some embodiments of the present invention in detail. Unless otherwise specified, the following embodiments and features can be combined with each other.

[0022] This invention proposes an intelligent well condition adaptive method and system for foam-drainage chemical dosing. In a preferred embodiment, the well condition adaptive method is as follows: Figure 1 As shown, the detailed processing method for each step is as follows: S1 Data Acquisition and Feature Extraction: Real-time acquisition of oil pressure, casing pressure, gas production, and fluid production parameters of the target gas well, simultaneously acquiring historical chemical dosing data, including concentration, duration, and corresponding well condition changes before and after dosing. An LSTM time-series network is used to mine dynamic well condition features, constructing a feature set characterizing wellbore condition and dosing effect, and performing feature normalization preprocessing. Specifically, data acquisition and feature extraction include: Real-time well condition parameter acquisition: Real-time acquisition of four-dimensional time-series data streams of oil pressure, casing pressure, gas production, and fluid production through well site sensors; Historical dosing data integration: Extract the chemical concentration and dosing duration parameters from historical dosing records, and correlate them with the corresponding well condition status change dataset for 72 hours before and after dosing; LSTM dynamic feature mining: Long Short-Term Memory network is applied to perform in-depth time series analysis of well condition parameters to extract three core dynamic features: pressure fluctuation rate, production change gradient, and state transition continuity. Feature engineering processing: The extracted feature set is normalized by Z-score to construct a feature vector space representing the wellbore state and the effect of chemical dosing.

[0023] In one specific embodiment, it includes: (1) Real-time well condition parameter acquisition: Real-time acquisition of oil pressure Po and casing pressure Pc, synchronous monitoring of gas production Qg and fluid production Ql, data are uploaded to the edge computing node at 5-minute intervals to construct a four-dimensional time series matrix: ; (2) Integration of historical dosing data: Extract the pesticide application records from the production database for the past year and store them in a structured format as follows: , in This refers to the start time of medication administration; By correlating well condition data from 72 hours before and after chemical injection, a historical sample set was constructed. ; Where M represents the number of historical drug administrations, and the time window is 144 hours (including 8640 sampling points).

[0024] (3) LSTM dynamic feature mining: Construct a three-layer LSTM network (128 hidden units), input 72 hours of time-series data (step size n=864), and connect the output layer to three feature extraction heads: Pressure fluctuation rate: the mean of the absolute values ​​of the second-order differences between oil pressure and casing pressure, expressed as: ; Production variation gradient: The maximum slope of gas production within the dosing window, expressed as: ; State transition continuity: The standard deviation of the Euclidean distance between well condition vectors at adjacent time points is expressed as: ; (4) Feature engineering processing: Sliding window Z-score normalization was used, with a window size representing 30 days of historical data. ; in: The mean of the features within the window. The standard deviation is denoted as .

[0025] S2 Initial Intelligent Dosing Scheme Generation: Based on the feature set constructed in S1, a dual-delay deep deterministic strategy gradient model is trained as the decision-maker. This model learns the mapping relationship between well condition features and dosing parameters through an Actor-Critic architecture, outputs the optimal concentration-duration combination scheme in the continuous action space, and verifies the reliability of the strategy using historical data. Specifically, the initial intelligent dosing scheme generation includes: Historical Feature-Solution Dataset Construction: Based on the feature vector space generated by S1, associate the corresponding historical drug concentration and duration parameters to construct a set of state-action sample pairs with timestamps; TD3 decision model training: adopts an Actor-Critic dual network architecture, in which the Actor network learns the mapping strategy from state features to drug administration actions, and the Critic network evaluates the value of actions. The robustness of the strategy is optimized through a dual-delay update mechanism. Dynamic policy validation: Perform cross-validation on historical datasets and compute the policy reward function; Real-time scheme generation: Input the current well condition feature vector into the trained Actor network, and output the optimal dosing parameters in the continuous action space.

[0026] In one specific embodiment, it includes: (1) Construction of historical feature-scheme dataset: constructing feature vectors Corresponding drug administration actions The dataset was divided into training set (70%), validation set (15%), and test set (15%) according to time alignment, and the samples were shuffled.

[0027] (2) Training of TD3 decision model: Actor network elements: a 3-layer fully connected network (256-128-64), with the output layer using the Sigmoid function to constrain the range of actions. ; in σ is the Sigmoid function; Critic Network Dual network structure, input Output scalar value: The objective function is: ; in: =0.99 is the discount factor. For target network parameters; Path Update: Delayed update of Actors every 2 Crilic updates: .

[0028] 3. Dynamic strategy verification: Calculate the strategy return rate on the test set: ; in =0.7.β=0.3 is the weight. This is the baseline gas production rate.

[0029] S3 Dosing Execution and Effect Monitoring: Based on the dosing plan generated in S2, the PLC control system executes the foaming agent injection operation. After dosing, the changes in oil pressure, casing pressure, gas production, and liquid production are continuously monitored, with a focus on collecting dynamic indicators such as the pressure change rate and gas-liquid ratio fluctuation. Specifically, dosing execution and effect monitoring includes: Precise dosing execution control: The PLC system uses the metering pump to control the concentration of the foaming agent and error based on the optimal dosing parameters output by S2, and ensures the timing accuracy of the dosing time down to the second level; Real-time monitoring of well conditions: Continuously collect raw data on oil pressure, casing pressure, gas production, and fluid production at a sampling cycle of 5 minutes; Key indicator analysis and calculation: The pressure change rate and gas-liquid ratio fluctuation value are calculated in real time based on monitoring data.

[0030] In one specific embodiment, it includes: (1) Precision dosing execution control: PLC system receives The metering pump is driven to inject foaming agent at the set concentration, and PID backflow control is used to ensure concentration error. ; (2) Real-time monitoring of well conditions: Enhanced monitoring is initiated for 72 hours after chemical dosing, with the sensor sampling cycle increased to 1 minute. A monitoring matrix is ​​constructed: ; (3) Key indicator analysis: Pressure change rate: the degree of pressure recovery per unit time. ; Gas-liquid ratio fluctuation: standard deviation and stability of the quantity: .

[0031] S4 Chemical Dosing Effect Quantitative Evaluation: Response data from S3 monitoring is analyzed, and the effects of improved drainage efficiency and optimized chemical costs are quantified using a multi-objective evaluation function. Evaluation indicators include gas production increase rate, pressure recovery index, and unit chemical yield. Specifically, the quantitative evaluation of chemical dosing effect includes: Multi-parameter monitoring data integration: The core parameters such as oil pressure, casing pressure, gas production, and liquid production collected continuously after chemical dosing are time-aligned and cleaned to form a complete evaluation dataset; Core performance indicators calculation: Gas production increase rate: Calculate the percentage increase in production during the dosing cycle by comparing the baseline gas production level before dosing. Pressure recovery index: quantifies the degree of wellbore energy recovery by integrating the pressure curve, reflecting the unblocking effect of the foaming agent; Unit reagent yield: The input-output ratio is calculated based on the economic value of increased gas production and reagent consumption costs. Overall Performance Score: The weights of the three indicators are dynamically adjusted according to the goals of the gas well development stages (focusing on the increase in gas production during the production enhancement period and on economic benefits during the stable production period), and a quantitative score is generated by weighted fusion. Effectiveness rating and feedback: Based on the scoring range, the system is divided into three levels: excellent, effective, and ineffective. Ineffective results automatically trigger the process of re-optimizing the dosing plan.

[0032] In one specific embodiment, it includes: (1) Calculation of core performance indicators: Gas production increment rate: ; Pressure recovery index: integral gain of the pressure curve ; Unit drug yield: ; in Pump displacement (L / h) The price is the unit price of natural gas (yuan / m³). Price per unit of drug (yuan / kg).

[0033] (2) Comprehensive scoring and grading: Dynamic weight adjustment: Increased production period: Stable production period: ; ; Graded threshold: (Highly effective) (Valid), S<0.5 (Invalid).

[0034] S5 Knowledge Base Iteration and Strategy Optimization: Dosing plans, real-time features, and evaluation results are stored as new samples in the experience pool. TD3 network parameters are updated based on sample priority. The Actor strategy is optimized through the value gradient of the Critic network to achieve adaptive adjustment of the decision model to operating condition drift. Specifically, knowledge base iteration and strategy optimization include: Full-cycle experience accumulation: Key parameters of successful chemical dosing programs, dynamic characteristics of well conditions, and effect evaluation results are integrated into knowledge units and stored in the cloud experience pool; Intelligent sample screening mechanism: Prioritizes learning effective strategies under extreme conditions (such as high pressure fluctuations and low liquid production); performs in-depth inversion analysis on ineffective solutions and extracts failure features; automatically marks boundary condition samples with red warning labels; Dynamic Evolution of Decision Models: Value Network Evaluation: Cross-validating the merits of strategies through dual evaluators to identify potential decision biases; Strategy network optimization: Based on the value assessment results, the dosing decision rules are updated in a gradient manner; Safe iteration mechanism: Controls the magnitude of policy updates to avoid the risk of sudden decision changes; Adaptive operating condition drift: When a feature is detected to be continuously deviating from its historical distribution, the model is restarted while retaining core experience.

[0035] (1) Accumulation of experience throughout the entire lifecycle: Constructing knowledge units: ; Where: t = time cutoff, , .

[0036] (2) Intelligent sample screening: Priority calculation: ; The inversion analysis module performs decision path regression on the S0.5 sample to identify failure feature patterns.

[0037] (3) Dynamic evolution of decision-making models: Parameter update: Sample batches from the experience pool according to priority The TD3 network is updated online every 24 hours. Hot restart mechanism: When feature distribution drift is detected ( At that time, the Critlic network was frozen and the Actor network was fine-tuned using data from the most recent 30 days (the learning rate was reduced to 10%), while retaining high-value experiences (S>0.7 samples).

[0038] This invention also proposes a smart well condition adaptive system for foaming and dosing chemical treatment based on method flow configuration, comprising: Data acquisition and feature extraction module: Based on well site sensors and production database, it collects parameters of oil pressure, casing pressure, gas production and liquid production of the target gas well, as well as historical dosing data including concentration, duration and corresponding changes in well conditions before and after dosing; Initial intelligent dosing scheme generation module: Constructs a dual-delay deep deterministic strategy gradient model decision-maker, and learns and outputs the optimal concentration-duration combination scheme based on the Critic architecture; Chemical dosing execution and effect monitoring module: Set up and connect to the PLC control system to execute chemical injection operations and monitor well condition characteristic parameters and dynamic indicators; The drug administration effect quantitative evaluation module: configures multi-objective evaluation functions to comprehensively evaluate the optimization effect of multiple indicators; Iteration and Strategy Optimization Module: Set up an experience pool to store dosing plans, real-time features and evaluation results and update them, while configuring optimization strategies for adaptive adjustment.

[0039] For the foregoing embodiments, in order to simplify the description, they are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, because according to this application, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions involved are not necessarily essential to this application.

[0040] The above embodiments describe the basic principles, main features, and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited to the above embodiments. The embodiments and descriptions in the specification are merely illustrative of the principles of the invention. Modifications and variations made by those skilled in the art without departing from the spirit and scope of the invention should be within the protection scope of the appended claims.

Claims

1. A well condition adaptive method for intelligent foam-flushing and chemical dosing, characterized in that, Includes the following steps: Step S1: Real-time acquisition of well condition characteristic parameters of the target gas well, synchronous acquisition of historical chemical dosing data, use LSTM time series network to mine dynamic features of well condition, construct a feature set representing wellbore status and chemical dosing effect, and perform feature normalization preprocessing. Step S2: Based on the feature set constructed in Step S1, train a dual-delay deep deterministic strategy gradient model as a decision maker; the dual-delay deep deterministic strategy gradient model learns the mapping relationship between well condition features and dosing parameters through the Actor-Critic architecture, and outputs the optimal concentration-duration combination dosing scheme in the continuous action space. Step S3: Based on the dosing plan output in step S2, use the PLC control system to execute the foaming agent injection operation; after the dosing is completed, continuously monitor the changing trend and amplitude of well condition characteristic parameters, and collect dynamic indicators such as pressure change rate and gas-liquid ratio fluctuation value. Step S4: Analyze the response data monitored in Step S3, and quantify the effects of improved drainage efficiency and optimized reagent costs through a multi-objective evaluation function; Step S5: Store the dosing plan, real-time features, and evaluation results as new samples in the experience pool. Update the TD3 network parameters based on sample priority. Optimize the Actor strategy through the value gradient of the Critic network to achieve adaptive adjustment of the decision model to the operating condition drift.

2. The intelligent foam-drainage chemical dosing method for well condition adaptation as described in claim 1, characterized in that, Step S1 specifically includes: Step S11: Real-time oil pressure data is collected using well site sensors. , sleeve pressure Simultaneous monitoring of gas production With liquid production Data is uploaded to edge computing nodes at preset intervals to construct a four-dimensional time series matrix: ; Step S12: Integrate historical chemical dosing data, including concentration, duration, and corresponding well condition changes before and after dosing. Extract dosing records from the production database and store them in a structured format. ; By correlating well condition data from 72 hours before and after chemical dosing, a historical sample set is constructed as follows: ; in, This refers to the start time of medication administration. Historical number of times medication was administered; Step S13: Apply a long short-term memory network to perform in-depth time-series analysis of well condition parameters and extract pressure fluctuation rate. Gradient of production change State transition continuity The three core dynamic features are represented as follows: ; ; ; Step S14: Perform Z-score normalization on the extracted feature set to construct a feature vector space representing the wellbore state and the dosing effect, represented as: ; in, The mean of the features within the window. The standard deviation is denoted as .

3. The intelligent foam-drainage chemical dosing method for well condition adaptation as described in claim 2, characterized in that, Step S2 includes the following sub-steps: Step S21: Convert the feature vector Corresponding drug administration actions Construct a set of state-action sample pairs with timestamps, aligned by time. Step S22: An Actor-Critic dual-network architecture is adopted, in which the Actor network learns the mapping strategy from state features to drug administration actions, and the Critic network evaluates the value of actions. The robustness of the strategy is optimized through a dual-delay update mechanism. Step S23: Perform cross-validation on the historical dataset and compute the policy reward function, expressed as: ; in, =0.7, β=0.3 are the weights. Based on the baseline gas production rate; Step S24: Input the current well condition feature vector into the trained Actor network and output the optimal dosing parameters in the continuous action space.

4. The intelligent foam-drainage chemical dosing method for well condition adaptation as described in claim 3, characterized in that, In step S22, the Actor network adopts a 3-layer fully connected network, and the output layer uses the Sigmoid function to constrain the action range, as shown below: ; in, σ is the Sigmoid function; The Critic network has a dual-network structure, with input... Output scalar value, the objective function is expressed as: ; in, =0.99 is the discount factor. For target network parameters; The dual-delay update mechanism delays the update of the Actor after every two Crilic updates, as follows: 。 5. The intelligent foam-drainage chemical dosing method for well condition adaptation as described in claim 4, characterized in that, Step S3 specifically includes: Step S31: Precise dosing execution control; the PLC system executes the dosing based on the output optimal dosing parameters. The concentration and error of the foaming agent are controlled by a metering pump, and the timing accuracy of the dosing time is ensured to the second level. Step S32: Real-time dynamic monitoring of well conditions, continuously collecting raw data on oil pressure, casing pressure, gas production, and fluid production at a sampling cycle of 5 minutes. After chemical dosing, 72-hour enhanced monitoring is initiated, with the sensor sampling cycle increased to 1 minute, and a monitoring matrix is ​​constructed. ; Step S33: Key indicator analysis and calculation. Based on monitoring data, calculate the pressure change rate and gas-liquid ratio fluctuation value in real time. The unit of the pressure change rate is... , is represented as: ; The gas-liquid ratio fluctuation value is expressed as: 。 6. The intelligent foam-drainage chemical dosing method for well condition adaptation as described in claim 5, characterized in that, The evaluation in step S4 specifically includes: Multi-parameter monitoring data, including core parameters such as oil pressure, casing pressure, gas production, and liquid production collected continuously after chemical dosing, are time-aligned and cleaned to form a complete evaluation dataset; The calculation of core performance indicators includes gas production increment rate, pressure recovery index, unit reagent yield, comprehensive effect score, and effect grading and feedback.

7. The intelligent foam-drainage chemical dosing method for well condition adaptation as described in claim 6, characterized in that, The core performance indicators are calculated as follows: Gas production increment rate: ; Stress Recovery Index: ; Unit drug yield: ; in, Pump displacement, L / h; The price is the unit price of natural gas, in yuan / m³. This is the unit price of the medicine, in yuan / kg; Dynamic weight adjustment: ; During the period of increased production: Stable production period: ; Classification threshold: Indicates superior efficacy. S<0.5 indicates that the condition is valid, and S<0.5 indicates that the condition is invalid.

8. The intelligent foam-drainage chemical dosing method for well condition adaptation as described in claim 7, characterized in that, Step S5 includes the following sub-steps: Step S51: Accumulate full-cycle experience, integrate the key parameters of successful chemical dosing schemes, dynamic characteristics of well conditions and effect evaluation results into knowledge units and store them in the cloud experience pool; Knowledge units are represented as: ; Where t = time segment, , ; Step S52: Intelligent sample screening prioritizes learning effective strategies under extreme conditions; ineffective solutions undergo in-depth inversion analysis to extract failure features; boundary condition samples are automatically marked with red warning labels. Step S53: Dynamic evolution of the decision model, value network evaluation, cross-validation of strategy merits and demerits through dual evaluators, and identification of potential decision biases; Step S54: Optimize the policy network and update the dosing decision rules based on the value assessment results; control the policy update magnitude through a safe iteration mechanism; when the features are detected to be continuously deviating from the historical distribution, initiate a hot restart of the model and retain the core experience.

9. A smart well condition adaptive system for foam-drain dosing, applied to the smart well condition adaptive method for foam-drain dosing as described in any one of claims 1 to 8, characterized in that, include: Data acquisition and feature extraction module: Based on well site sensors and production database, it collects parameters of oil pressure, casing pressure, gas production and liquid production of the target gas well, as well as historical dosing data including concentration, duration and corresponding changes in well conditions before and after dosing; Initial intelligent dosing scheme generation module: Constructs a dual-delay deep deterministic strategy gradient model decision-maker, and learns and outputs the optimal concentration-duration combination scheme based on the Critic architecture; Chemical dosing execution and effect monitoring module: Set up and connect to the PLC control system to execute chemical injection operations and monitor well condition characteristic parameters and dynamic indicators; The drug administration effect quantitative evaluation module: configures multi-objective evaluation functions to comprehensively evaluate the optimization effect of multiple indicators; Iteration and Strategy Optimization Module: Set up an experience pool to store dosing plans, real-time features and evaluation results and update them, while configuring optimization strategies for adaptive adjustment.