Drainage gas recovery intelligent dynamic scheduling method and system based on digital twinning
By processing surface pressure data using a digital twin model, determining the flow characteristics at the bottom of the well, generating well opening decisions, and adaptively updating parameters, the problem of misjudging the timing of well opening caused by unstable flow at the bottom of the well is solved, and the intelligent scheduling effect of drainage and gas production processes is improved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- BEIJING JIBEI ENERGY TECHNOLOGY CO LTD
- Filing Date
- 2026-03-17
- Publication Date
- 2026-06-05
AI Technical Summary
In existing drainage gas production processes, the unstable flow at the bottom of the well leads to inaccurate determination of the well opening timing, making it difficult to achieve intelligent scheduling and resulting in reduced gas well production or equipment damage risks.
By constructing a digital twin model, the dynamic and resistance characteristic values are determined using ground pressure data processing, generating well opening decision results, and adaptively updating the preset resistance weight coefficients based on actual operating data, thus forming a closed-loop intelligent scheduling system.
It enables quantitative calculation of the flow characteristics at the bottom of the well, accurately identifies high-risk flow patterns, reduces the probability of liquid backflow and process failure, and improves the success rate and operational efficiency of drainage and gas production processes.
Smart Images

Figure CN122148256A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of digital twin technology, specifically to a method and system for intelligent dynamic scheduling of drainage and gas extraction based on digital twins. Background Technology
[0002] In the field of natural gas extraction technology, as gas well production enters the middle and late stages, formation energy gradually depletes, leading to increasingly prominent issues of fluid accumulation at the bottom of the well, severely restricting gas well production and even causing shutdowns. To maintain normal gas well production, intermittent drainage and gas production processes are typically employed. This involves periodically shutting in the well to allow formation energy to recover. Once the bottom pressure has accumulated to a sufficient level, the well is reopened, using formation energy to lift the accumulated fluid to the surface. The core of this process lies in the precise timing of well reopening. Reopening too early results in insufficient formation energy to overcome the fluid column resistance, leading to lift failure; reopening too late, while ensuring successful lift, wastes valuable production time and may cause equipment damage due to excessively high wellhead pressure.
[0003] Currently, the commonly used scheduling methods in the field are mainly based on determining well opening time intervals. However, due to the complex gas-liquid two-phase flow state of the fluid at the bottom of the well during the accumulation process, this unstable flow state will cause drastic fluctuations in surface pressure data. In the absence of real-time downhole monitoring methods, existing methods are difficult to accurately identify the actual working conditions at the bottom of the well, resulting in insufficient accuracy in determining the timing of well opening and ultimately leading to poor overall performance of intelligent scheduling of drainage and gas production processes. Summary of the Invention
[0004] To address the technical problem of inaccurate well opening timing in current drainage and gas production processes, the present invention aims to provide an intelligent dynamic scheduling method and system for drainage and gas production based on digital twins. The specific technical solution adopted is as follows: Firstly, a digital twin-based intelligent dynamic scheduling method for drainage and gas production is provided. This method includes: collecting surface pressure data during well shut-in; constructing a digital twin model to characterize the bottom-hole flow regime based on the surface pressure data, including casing pressure data and tubing pressure data; processing the surface pressure data using the digital twin model to determine dynamic and resistance characteristic values, whereby the dynamic characteristic value characterizes the relative rate of gas energy accumulation and the resistance characteristic value characterizes the relative rate of increase in bottom-hole fluid resistance; determining a first and a second indicator based on the statistical characteristics of the dynamic and resistance characteristic values, whereby the first indicator characterizes the comprehensive comparative relationship between gas energy and fluid resistance, and the second indicator characterizes the degree of bottom-hole flow regime disturbance; generating a well-opening decision result based on the first and second indicators and a preset resistance weighting coefficient, whereby the preset resistance weighting coefficient balances the influence of dynamics and resistance in the well-opening decision; and executing the well-opening operation when the well-opening decision result indicates that the well-opening conditions are met, and adaptively updating the preset resistance weighting coefficient based on actual operating data after well opening.
[0005] In one possible design, surface pressure data is processed using a digital twin model to determine dynamic and drag characteristic values. This includes: collecting surface pressure data at a first sampling interval during a first preset time period after the well shut-in initiation time; collecting surface pressure data at a second sampling interval after the first preset time period, where the second sampling interval is greater than the first sampling interval; fitting a baseline pressure change rate based on the casing pressure data during the first preset time period after the well shut-in initiation time, where the baseline pressure change rate is used to characterize the formation's gas supply potential; determining the dynamic characteristic value for each sampling time based on the casing pressure data collected at each sampling time after the first preset time period and the baseline pressure change rate; and determining the drag characteristic value for each sampling time based on the surface pressure data collected at each sampling time after the first preset time period and the baseline pressure change rate.
[0006] In one possible design, a baseline pressure change rate is obtained by fitting casing pressure data within a first preset time period after the well shut-in start time. This includes: continuously collecting casing pressure data at a first sampling interval within the first preset time period to obtain a casing pressure data sequence; fitting the casing pressure data sequence using a linear regression algorithm to obtain the slope of the fitted line; and determining the maximum value between the slope of the line and the preset minimum change rate as the baseline pressure change rate.
[0007] In one possible design, the dynamic characteristic value of each sampling moment is determined based on the casing pressure data collected at each sampling moment after the first preset time period and the reference pressure change rate. This includes: for each sampling moment after the first preset time period, determining the casing pressure change rate at the sampling moment based on the casing pressure data at the sampling moment, the casing pressure data at the previous sampling moment, and the second sampling interval; determining the initial dynamic characteristic value based on the casing pressure change rate and the reference pressure change rate; and determining the minimum value between the initial dynamic characteristic value and the preset characteristic threshold as the dynamic characteristic value at the sampling moment.
[0008] In one possible design, the resistance characteristic value for each sampling moment is determined based on the ground pressure data collected at each sampling moment after the first preset time period and the reference pressure change rate. This includes: for each sampling moment after the first preset time period, determining the casing-oil pressure difference at the sampling moment based on the casing pressure data and tubing pressure data at the sampling moment; determining the casing-oil pressure difference change rate at the sampling moment based on the casing-oil pressure difference at the sampling moment, the casing-oil pressure difference at the previous sampling moment, and the second sampling interval; determining the initial resistance characteristic value based on the casing-oil pressure difference change rate and the reference pressure change rate; and determining the minimum value between the initial resistance characteristic value and the preset characteristic threshold as the resistance characteristic value at the sampling moment.
[0009] In one possible design, based on the statistical characteristics of the dynamic and drag characteristics, the first and second indices are determined, including: using the dynamic and drag characteristics at each sampling moment within a second preset time period as coordinate points, mapping them to a two-dimensional coordinate system with the dynamic characteristics as the horizontal axis and the drag characteristics as the vertical axis to obtain a two-dimensional point set; determining the geometric centroid coordinates of the two-dimensional point set, and using the geometric centroid coordinates as the first indices; centering the two-dimensional point set to obtain a detrended point set, and using the minimum covering circle algorithm to determine the radius of the minimum covering circle containing all points in the detrended point set, and using the radius as the second indices.
[0010] In one possible design, a well-opening decision result is generated based on a first indicator, a second indicator, and a preset resistance weighting coefficient. This includes: determining well-opening suitability based on the first indicator, the second indicator, and the preset resistance weighting coefficient; generating a well-opening decision result indicating that the well-opening conditions are met when the well-opening suitability is greater than or equal to zero and the second indicator is less than a preset safety threshold; and generating a well-opening decision result indicating that the well-opening conditions are not met when the well-opening suitability is less than zero or the second indicator is greater than or equal to the preset safety threshold.
[0011] In one possible design, the preset resistance weight coefficient is adaptively updated based on the actual operating data after well opening. This includes: obtaining the actual arrival time of the plunger at the wellhead after well opening; determining the time deviation factor based on the actual arrival time and the preset design time; obtaining the second indicator at the well opening time and the preset sensitivity constant to determine the confidence weight, wherein the second indicator and the confidence weight are negatively correlated; and updating the preset resistance weight coefficient based on the time deviation factor and the confidence weight to obtain the updated preset resistance weight coefficient.
[0012] In one possible design, the aforementioned intelligent dynamic scheduling method for drainage and gas production based on digital twins further includes: monitoring the duration of well shut-in; when the duration of well shut-in reaches the preset maximum shut-in time limit and no well opening decision result indicating that the well opening conditions are met is generated, a well opening command for executing the well opening operation is generated, and the well opening is marked as a forced protection mode.
[0013] Secondly, a digital twin-based intelligent dynamic scheduling system for drainage and gas production is provided, comprising: a data acquisition unit for acquiring surface pressure data during well shut-in, including casing pressure data and tubing pressure data; a model building unit for constructing a digital twin model representing the bottom-hole flow regime based on the surface pressure data; a feature extraction unit for processing the surface pressure data through the digital twin model to determine dynamic and resistance characteristic values, wherein the dynamic characteristic value represents the relative rate of gas energy accumulation, and the resistance characteristic value represents the relative rate of increase in bottom-hole fluid resistance; an index determination unit for determining a first index and a second index based on the statistical characteristics of the dynamic and resistance characteristic values, wherein the first index represents the comprehensive comparative relationship between gas energy and fluid resistance, and the second index represents the degree of bottom-hole flow disturbance; and a decision generation unit for generating a well opening decision based on the first index, the second index, and a preset resistance weighting coefficient, wherein the preset resistance weighting coefficient is used to balance the influence of dynamics and resistance in the well opening decision. The execution and update unit is used to execute the well opening operation when the well opening decision result indicates that the well opening conditions are met, and to adaptively update the preset resistance weight coefficient based on the actual operating data after well opening.
[0014] The present invention has the following beneficial effects: In the intelligent dynamic scheduling method for drainage and gas production based on digital twins provided by this invention, a digital twin model is constructed to characterize the flow state at the bottom of the well. This model is then used to process surface pressure data to determine dynamic and resistance characteristic values. Based on the statistical characteristics of these characteristic values, a first index is determined to characterize the comprehensive comparison relationship between gas energy and accumulated fluid resistance, and a second index is determined to characterize the degree of flow state disturbance at the bottom of the well. Finally, a well opening decision is generated by combining preset resistance weight coefficients, and well opening operations are executed when conditions are met, while the preset resistance weight coefficients are adaptively updated, forming a complete closed-loop intelligent scheduling system. This transforms the previously difficult-to-observe flow state characteristics at the bottom of the well into quantifiable geometric indicators. By introducing a second index characterizing the degree of flow state disturbance, the system can accurately identify high-risk flow states such as bottom-hole slug flow and gas-liquid slippage hidden behind fluctuations in surface pressure data. This allows for explicit avoidance of periods of severe flow state disturbance during the decision-making process, executing well opening operations only under the dual conditions of sufficient energy and flow state convergence. This fundamentally solves the misjudgment problem caused by the inability of traditional methods to distinguish between effective energy accumulation and ineffective gas-liquid disturbance, significantly reducing the probability of fluid fallback and process failure. Meanwhile, the preset resistance weight coefficient is adaptively updated based on the actual operating effect after well opening. During the update process, a confidence weight based on the second indicator at the well opening time is introduced, which makes the parameter correction range positively correlated with data quality. This not only utilizes high-quality and stable data to continuously optimize decision parameters to adapt to the long-term trend of formation energy decay and liquid accumulation, but also avoids parameter drift caused by random disturbances when the flow is unstable. This achieves unmanned intelligent monitoring and self-optimization operation of the drainage and gas production process throughout its entire life cycle, effectively improving the overall success rate and operating efficiency of the process. Attached Figure Description
[0015] To more clearly illustrate the technical solutions and advantages 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 these drawings without creative effort.
[0016] Figure 1 This is a schematic diagram of the structure of a digital twin-based intelligent dynamic scheduling system for drainage and gas extraction, provided in one embodiment of the present invention. Figure 2 This is a flowchart illustrating an intelligent dynamic scheduling method for drainage and gas extraction based on digital twins, provided as an embodiment of the present invention. Detailed Implementation
[0017] To further illustrate the technical means and effects adopted by the present invention to achieve its intended purpose, the following, in conjunction with the accompanying drawings and preferred embodiments, details the specific implementation, structure, features, and effects of a digital twin-based intelligent dynamic scheduling method and system for drainage and gas extraction proposed according to the present invention. In the following description, different "one embodiment" or "another embodiment" do not necessarily refer to the same embodiment. Furthermore, specific features, structures, or characteristics in one or more embodiments can be combined in any suitable form.
[0018] In embodiments of the present invention, the terms "exemplary" or "for example" are used to indicate that something is an example, illustration, or description. Any embodiment or design described as "exemplary" or "for example" in embodiments of the present invention should not be construed as being more preferred or advantageous than other embodiments or designs. Specifically, the use of the terms "exemplary" or "for example" is intended to present the relevant concepts in a specific manner.
[0019] In the description of this invention, unless otherwise stated, " / " means "or". For example, A / B can mean A or B. The term "and / or" in this document is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, and B alone. Furthermore, "at least one" and "more than one" refer to two or more. The terms "first," "second," etc., do not limit the quantity or order of execution, and "first," "second," etc., do not necessarily imply differences.
[0020] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains.
[0021] The following description, in conjunction with the accompanying drawings, details the specific scheme of the intelligent dynamic scheduling method and system for drainage and gas extraction based on digital twins provided by this invention.
[0022] Please see Figure 1 This illustrates a schematic diagram of the structure of a digital twin-based intelligent dynamic scheduling system for drainage and gas extraction provided in an embodiment of the present invention, as shown below. Figure 1 As shown, the intelligent dynamic scheduling system 10 for drainage and gas extraction based on digital twins includes a data acquisition unit 11, a model building unit 12, a feature extraction unit 13, an indicator determination unit 14, a decision generation unit 15, and an execution and update unit 16.
[0023] The data acquisition unit 11 is used to acquire surface pressure data during the well shut-in period, including casing pressure data and tubing pressure data.
[0024] In some embodiments, during a first preset time period after the well shut-in start time, the data acquisition unit 11 continuously acquires casing pressure data at a first sampling interval to obtain a casing pressure data sequence for fitting a reference pressure change rate. After the first preset time period, the data acquisition unit 11 continues to acquire casing pressure data and tubing pressure data at a second sampling interval, wherein the second sampling interval is greater than the first sampling interval, thereby reducing the system's computational burden while ensuring data accuracy. The raw surface pressure data acquired by the data acquisition unit 11 is transmitted to the model building unit 12 and the feature extraction unit 13 as the basis for subsequent processing.
[0025] Model building unit 12 is used to build a digital twin model to characterize the flow state at the bottom of the well based on surface pressure data.
[0026] In some embodiments, the model building unit 12 constructs a digital twin model to characterize the flow state at the bottom of the well based on the surface pressure data collected by the data acquisition unit 11. Relying on the virtual-real mapping technology of digital twins, the model building unit 12 uses the surface pressure data transmitted by the data acquisition unit 11 as the core input to accurately map the actual production conditions during the well shut-in stage and build a digital twin model that can dynamically reflect the gas-liquid two-phase flow state at the bottom of the well. The model can realize real-time interaction and synchronization between the actual pressure data at the well site and the data inside the model, and will dynamically update the characterization information of the flow state at the bottom of the well based on the real-time collected pressure data. The digital twin model constructed by the model building unit 12 will serve as the data processing carrier of the feature extraction unit 13. The feature extraction unit 13 will carry out the processing of surface pressure data and the determination of feature values based on the digital twin model throughout the process.
[0027] The feature extraction unit 13 is used to process the surface pressure data through a digital twin model to determine the dynamic feature value and the resistance feature value. The dynamic feature value is used to characterize the relative rate of gas energy accumulation, and the resistance feature value is used to characterize the relative rate of increase in the resistance of the liquid accumulation at the bottom of the well.
[0028] In some embodiments, the feature extraction unit 13 first obtains synchronous ground pressure data from the digital twin model, extracts casing pressure data within a first preset time period, fits it using a linear regression algorithm to obtain the slope of a straight line, and then determines the maximum value of the slope and the preset minimum change rate as the benchmark pressure change rate characterizing the formation gas supply potential. Subsequently, for the pressure data at each sampling time after the first preset time period, the casing pressure change rate and the oil-casing pressure difference change rate are calculated respectively in combination with the benchmark pressure change rate, thereby determining the initial dynamic characteristic value and the initial resistance characteristic value. Finally, the initial dynamic characteristic value and the initial resistance characteristic value are determined by the minimum value of the preset characteristic thresholds as the final dynamic characteristic value and resistance characteristic value at each sampling time. The dynamic characteristic value and resistance characteristic value determined by this unit are transmitted to the index determination unit 14 in real time as the core data basis for the subsequent determination of the first and second indicators.
[0029] The index determination unit 14 is used to determine the first index and the second index based on the statistical characteristics of the dynamic characteristic value and the resistance characteristic value. The first index is used to characterize the comprehensive comparison relationship between gas energy and liquid resistance, and the second index is used to characterize the degree of flow disturbance at the bottom of the well.
[0030] In some embodiments, the index determination unit 14 uses the dynamic characteristic value and resistance characteristic value at each sampling moment within a second preset time period as coordinate points, mapping them to a two-dimensional coordinate system with the dynamic characteristic as the horizontal axis and the resistance characteristic as the vertical axis, to obtain a two-dimensional point set. Subsequently, the index determination unit 14 calculates the geometric centroid coordinates of the two-dimensional point set and determines these geometric centroid coordinates as the first index. Simultaneously, the index determination unit 14 performs centering processing on the two-dimensional point set to obtain a detrended point set, and uses the minimum covering circle algorithm to determine the radius of the minimum covering circle containing all points in the detrended point set, determining this radius as the second index. Through the above geometric quantization processing, the index determination unit 14 makes the implicit bottom hole flow characteristics explicit into computable indices, where the first index reflects the current average comparison state of energy and resistance, and the second index quantifies the degree of fluid disturbance. The first and second indices determined by the index determination unit 14 are transmitted to the decision generation unit 15 as the basis for well opening decisions.
[0031] The decision generation unit is used to generate well opening decision results based on the first indicator, the second indicator, and the preset resistance weight coefficient. The preset resistance weight coefficient is used to balance the influence of power and resistance in the well opening decision.
[0032] In some embodiments, the decision generation unit 15 determines the well opening suitability based on a first indicator, a second indicator, and a preset resistance weighting coefficient. If the well opening suitability is greater than or equal to zero and the second indicator is less than a preset safety threshold, the decision generation unit 15 generates a well opening decision indicating that the well opening conditions are met. If the well opening suitability is less than zero, or the second indicator is greater than or equal to the preset safety threshold, the decision generation unit 15 generates a well opening decision indicating that the well opening conditions are not met. Through this dual-threshold decision mechanism, the decision generation unit 15 ensures that well opening is triggered only when energy accumulation is sufficient and the flow convergence is achieved, effectively avoiding the risk of misjudgment caused by flow disturbances. The well opening decision generated by the decision generation unit 15 is transmitted to the execution and update unit 16 for controlling the field execution mechanism.
[0033] The execution and update unit is used to execute the well opening operation when the well opening decision result indicates that the well opening conditions are met, and to adaptively update the preset resistance weight coefficient based on the actual operating data after well opening.
[0034] In some embodiments, when a well-opening decision result meeting the well-opening conditions is received, the execution and update unit 16 sends a control command to the wellhead valve to execute the well-opening operation. Simultaneously, the execution and update unit 16 obtains the actual arrival time of the plunger at the wellhead after well-opening and determines a time deviation factor based on the ratio of this actual arrival time to the preset design time. The execution and update unit 16 also obtains a second indicator for the well-opening time from the indicator determination unit 14 and determines a confidence weight based on the second indicator and a preset sensitivity constant. The second indicator and the confidence weight are negatively correlated; that is, the more stable the flow and the smaller the second indicator, the greater the confidence weight. Finally, the execution and update unit 16 updates the preset resistance weight coefficient based on the time deviation factor and the confidence weight, obtaining the updated preset resistance weight coefficient. This updated preset resistance weight coefficient is stored and used for decisions in subsequent well-opening cycles, thereby achieving adaptive optimization of the system throughout its entire lifecycle.
[0035] Please see Figure 2 The diagram illustrates a flowchart of an intelligent dynamic scheduling method for drainage and gas extraction based on digital twins, provided by an embodiment of the present invention, including the following steps S201-S205.
[0036] S201. Collect surface pressure data during well shut-in and construct a digital twin model to characterize the bottom hole flow based on the surface pressure data.
[0037] The ground pressure data includes casing pressure data and tubing pressure data.
[0038] One possible implementation is to monitor the wellhead valve status in real time, and when a valve closing action is detected, mark that moment as the well shut-in start time, denoted as . From the start time of well shut-in Starting from the beginning, the system enters a first preset time period (e.g., 60 seconds). During this first time period, casing pressure data is continuously collected at a first sampling interval (e.g., once per second, i.e., a sampling frequency of 1Hz) to obtain a casing pressure data sequence. ,in, The sampling time is indicated. High-frequency acquisition during the first preset time period aims to capture subtle changes in formation pressure recovery during the initial well shut-in period, providing sufficient data density for subsequent baseline parameter fitting.
[0039] Furthermore, after the first preset time period ends, sampling is performed according to the second sampling interval (denoted as...). (e.g., data collected every 10 seconds) for casing pressure data And oil pipe pressure data Continuous data acquisition is performed, with the second sampling interval being greater than the first sampling interval, and all acquired casing pressure data... And oil pipe pressure data All data is uploaded to the data storage module in real time for synchronous storage.
[0040] Furthermore, based on the real-time acquisition and storage of casing pressure data And oil pipe pressure data This method integrates actual physical parameters of the gas well site, such as wellbore depth, wellbore diameter, and formation gas supply characteristics. Using digital twin mapping and dynamic modeling, a digital twin model is constructed based on the actual gas well production conditions. This digital twin model serves as a virtual simulation model to characterize the bottom-hole flow regime, enabling real-time interaction and dynamic synchronization between actual surface pressure data and virtual pressure data within the model. A bottom-hole flow regime characterization module is built within the digital twin model to represent surface casing pressure data. And oil pipe pressure data The dynamic changes are accurately mapped to the dynamic evolution of the gas-liquid two-phase flow state at the bottom of the well, realizing the explicit representation of the bottom flow state from surface pressure data to the virtual model.
[0041] S202. Process the ground pressure data using a digital twin model to determine the dynamic and drag characteristic values.
[0042] Among them, the dynamic characteristic value is used to characterize the relative rate of gas energy accumulation, and the resistance characteristic value is used to characterize the relative rate of increase in the resistance of fluid accumulation at the bottom of the well.
[0043] As one possible approach, a baseline pressure change rate is first obtained by fitting the casing pressure data during a first preset period after the well shut-in start time. This baseline pressure change rate is used to characterize the formation gas supply potential.
[0044] In some embodiments, a linear regression algorithm (such as the least squares method) is used to analyze the casing pressure data sequence. A fitting process is performed to obtain a straight line reflecting the pressure change trend over time. The slope of this line is denoted as the initial pressure change rate. This initial pressure change rate characterizes the average rate of formation gas supply during the initial well shut-in period. To prevent the fitting slope from becoming too small or even zero due to extremely low formation energy or sensor malfunctions (which would cause overflow in subsequent division operations), a minimum value protection mechanism is introduced: a preset minimum change rate is set. (For example, 0.001 MPa / min) is used as the lower limit, and the slope of the fitted line is taken as... The larger value in the range is used as the reference pressure change rate. ,Right now The rate of change of the benchmark pressure. It quantifies the formation gas supply potential of the current gas well during the shut-in period and is one of the basic parameters of the digital twin model.
[0045] Furthermore, based on the casing pressure data collected at each sampling time after the first preset time period and the reference pressure change rate, the dynamic characteristic value at each sampling time is determined.
[0046] In some embodiments, for each sampling time after the first preset time period According to the current sampling time casing pressure data Previous sampling time casing pressure data and the second sampling interval The rate of change of casing pressure at the sampling time is determined by the following formula: The casing pressure change rate reflects the instantaneous rate at which the casing pressure rises at the current sampling moment.
[0047] The calculated casing pressure change rate is then compared with the baseline pressure change rate stored in the digital twin model. The comparison is performed, and the current sampling time is obtained through division. initial dynamic eigenvalues ,Right now This dimensionless ratio characterizes the relative rate of gas energy accumulation at the current moment. A value close to or greater than 1 indicates that the current formation gas supply capacity is comparable to or stronger than that at the initial stage of well shut-in, and the dynamics are accumulating rapidly; if A significant decrease indicates that the liquid resistance has severely hindered the entry of gas.
[0048] It should be noted that, to prevent the influence of the reference pressure change rate... If the initial dynamic eigenvalue is too small, it will result in an abnormally large calculated value, thus compressing the effective range of subsequent geometric analysis. Therefore, a numerical clamping protection mechanism is introduced. Optionally, the digital twin model stores a preset feature threshold, denoted as... (For example, 10.0). This leads to the initial dynamic characteristic value. With preset feature threshold The two values are compared, and the smaller value is taken as the final dynamic characteristic value. This ensures that the dynamic characteristic values are always within a controllable range.
[0049] Furthermore, based on the ground pressure data collected at each sampling time after the first preset time period and the baseline pressure change rate, the resistance characteristic value at each sampling time is determined.
[0050] In some embodiments, for each sampling time after the first preset time period According to the current sampling time casing pressure data And oil pipe pressure data Determine the current sampling time The oil-casing pressure difference is expressed by the formula: The pressure difference between the oil casing and the casing indirectly reflects the height of the fluid accumulation at the bottom of the well. The greater the pressure difference, the more fluid is usually accumulated.
[0051] Subsequently, based on the current sampling time oil jacket pressure difference Previous sampling time oil jacket pressure difference The current sampling time is calculated. The increment of the oil-casing pressure difference is expressed by the formula: Considering that rising air bubbles or temperature changes may cause a momentary decrease in differential pressure, and only an increase in resistance (i.e., an increase in differential pressure) poses a substantial threat to lifting, a non-negative approach is introduced. The increment of the oil-sleeve differential pressure is compared with zero, and the larger of the two values is taken as the effective increment of the oil-sleeve differential pressure. This operation filters out noisy data indicating decreasing resistance, focusing only on the trend of increasing resistance. Then, the current sampling time is... The increase in oil-casing pressure differential divided by the second sampling interval To obtain the current sampling time The rate of change of oil-casing pressure differential is expressed by the formula: The rate of change of oil-casing pressure differential characterizes the instantaneous rate of increase in fluid accumulation resistance.
[0052] Finally, the current sampling time The rate of change of oil-casing pressure differential and the rate of change of reference pressure stored in the digital twin model The comparison is performed, and the current sampling time is obtained through division. initial resistance characteristic value ,Right now This dimensionless ratio characterizes the relative rate of increase in bottom hole fluid resistance at the current moment. A large value indicates that the pressure difference between the oil and casing is rapidly increasing, meaning that the amount of fluid at the bottom of the well is accumulating rapidly or the gas-liquid slippage is intensifying, and the resistance of the fluid accumulation to gas flow is rapidly increasing; if A smaller value indicates that the pressure differential between the oil casing and casing is expanding slowly or is in a stable state, meaning that the fluid accumulation resistance has not increased significantly. In this case, the flow at the bottom of the well is relatively stable, posing less of a threat to subsequent well lifting. Furthermore, similar to the treatment of dynamic characteristic values, a numerical clamping protection mechanism is also used to protect the initial resistance characteristic value. With preset feature threshold The two values are compared, and the smaller value is taken as the final resistance characteristic value. This ensures that the resistance characteristic value remains within a controllable range.
[0053] Through the above processing, the feature extraction unit 13 outputs a set of standardized feature pairs at each sampling time. Among them, dynamic eigenvalues It quantifies the degree of gas energy accumulation and drag characteristic values. The increase in fluid accumulation resistance was quantified.
[0054] S203. Based on the statistical characteristics of the dynamic characteristic value and the resistance characteristic value, determine the first index and the second index.
[0055] The first indicator is used to characterize the comprehensive comparison between gas energy and liquid resistance, while the second indicator is used to characterize the degree of flow disturbance at the bottom of the well.
[0056] As one possible implementation, based on the dynamic characteristic values determined in real time in step S202 above. and resistance characteristic value Within the digital twin model, a first-in, first-out (FIFO) data queue is maintained. This queue corresponds to the continuously acquired feature data within a second preset time period. The length of the second preset time period is pre-set based on the response speed of the flow regime change at the bottom of the well, for example, 300 seconds. This is combined with the second sampling interval. (For example, 10 seconds), the length of the queue is preset to... (For example ), used to store the most recent Features at each sampling time Whenever a new set of feature pairs is output... Then, push the set of data to the tail of the queue and remove the oldest data from the head of the queue, thus ensuring that the queue always contains the latest data. Groups of samples constitute the current sampling time. Data sets .
[0057] To make the implicit bottom-hole flow characteristics explicit into computable indicators, the dataset is first... Each pair of features in the diagram is considered as a coordinate point in a two-dimensional coordinate system, where the horizontal axis... Represents dynamic characteristics, longitudinal axis Represents resistance characteristics, thus... It is mapped to a two-dimensional point set.
[0058] During the well shutdown and recovery period, the pressure data generally shows an increasing trend over time. This macroscopic trend causes the data point set to drift upwards and to the right in the coordinate system. To extract the microscopic discrete features caused purely by fluid disturbance, this macroscopic drift needs to be removed. Therefore, the geometric centroid coordinates of the two-dimensional point set within the current second preset time period are first calculated. The geometric centroid coordinates are determined as the primary index, and the formula for calculating the geometric centroid coordinates is as follows: In the formula, The length of the data queue corresponding to the second preset time period. For the first in the queue Dynamic characteristic values at each sampling time. For the first in the queue The drag characteristic value at each sampling time. The geometric centroid coordinates. It reflects the average level of dynamic and drag characteristics within the current second preset time period, that is, the comprehensive comparison relationship between gas energy and liquid resistance.
[0059] To further quantify the dispersion of the data, i.e., the degree of disturbance of the flow regime at the bottom of the well, the original two-dimensional point set is centered. Specifically, the set is... Subtracting the geometric centroid coordinates of each point in the set from the coordinates of the point set yields the detrended point set. Geometrically, this operation is equivalent to shifting the data point cluster to the vicinity of the origin. At this point, the distance of the data point relative to the origin only reflects its fluctuation around the average state within the second preset time period, and no longer includes the overall upward trend.
[0060] Subsequently, the minimum covering circle algorithm is used to calculate the set of points that can contain detrended points. The minimum covering circle algorithm finds the radius of the minimum covering circle for all points in the set through recursive iteration. The algorithm first randomly selects points from the set and gradually constructs covering circles. For each newly added point, it checks if it is inside an existing circle. If it is, the existing circle remains unchanged; if it is outside, the point must be on the boundary of the new minimum covering circle, and the algorithm recalculates the new circle passing through the point and previous boundary points. After all points have been processed, the algorithm outputs the radius of the final determined minimum covering circle, denoted as the data distribution radius. .
[0061] When the fluid at the bottom of the well is in a stable laminar flow state, the pressure change rate is stable, and the data points are densely distributed within the second preset time period, resulting in the calculated... The values are extremely small; when slug flow or gas-liquid slip occurs at the bottom of the well, the pressure change rate fluctuates drastically, and the data points show a divergent distribution within the second preset time period, resulting in the calculated values. The value increases significantly. Therefore, this radius... The degree of disturbance of the flow state at the bottom of the well was quantified, and the radius was then determined as the second indicator.
[0062] Through the above processing, the index determination unit 14 outputs a set of index pairs at each sampling time. Among them, the first indicator This reflects the average comparison between gas energy and liquid resistance within the current second preset time period; the second indicator. The degree of disturbance of the bottom flow state during the current second preset time period was quantified.
[0063] S204. Generate well opening decision results based on the first indicator, the second indicator, and the preset resistance weighting coefficient.
[0064] As one possible implementation, a preset resistance weighting coefficient is loaded from the memory, and the well opening suitability is determined by combining the first and second indicators determined in step S203 above.
[0065] It should be noted that the preset resistance weighting coefficient is denoted as... The preset resistance weighting coefficient is a key parameter used to balance the influence of dynamics and resistance in well opening decisions. The larger the value, the greater the focus on resistance and the more stringent the well drilling requirements. In addition, the memory also has a preset distribution radius coefficient. and preset security threshold The distribution radius coefficient This is used to adjust the penalty for decision-making based on flow risk; an empirical value of 2.0 can be used, with a preset safety threshold. The value used to determine whether the flow regime has converged to the allowable range can be empirically set to 0.05.
[0066] In some embodiments, based on the physical principle that well opening operations should ensure that the power gains cover the costs of resistance consumption and flow risk, a calculation formula for determining the suitability of well opening is constructed, as exemplified below: In the formula, The current sampling time The suitability of well opening The current sampling time The dynamic component in the first indicator within the corresponding second preset time period represents the average level of dynamic characteristics within the current second preset time period, i.e., the average rate of gas energy accumulation. This item is positive; the larger the value, the stronger the formation's gas supply capacity, which is more favorable for well drilling. The current sampling time The resistance component in the first indicator within the corresponding second preset time period represents the average level of the resistance characteristics within the current second preset time period, i.e., the average rate of increase in liquid accumulation resistance. Used to adjust the sensitivity to resistance factors. The term is the weighted resistance consumption term. This term is negative, indicating that the increase in fluid resistance will offset part of the power gain. The current sampling time The corresponding second index within the second preset time period represents the degree of disturbance of the bottom flow state within the current second preset time period. This is a preset constant used to quantify the additional risk and cost caused by flow instability. The term is a flow risk penalty term, which is always negative, and The larger the volume (the more turbulent the flow), the greater the penalty, leading to... The value decreased significantly.
[0067] Based on the above formula, well opening suitability... This comprehensively reflects the overall benefits of well opening at the current moment. Only when the positive dynamic benefits are large enough to offset both resistance consumption and flow risk penalties can the benefits be realized. Only then is it considered positive.
[0068] Furthermore, a dual-threshold decision mechanism is adopted to generate well opening decision results.
[0069] In some embodiments, it is determined whether the following two conditions are met simultaneously: Condition 1: Energy surplus condition, i.e., well opening suitability. This condition indicates that the current gas energy accumulation has exceeded the sum of resistance consumption and flow risk, thus providing the material basis for well opening.
[0070] Condition 2: Flow convergence condition, i.e., the second index ,in A preset safety threshold is set (e.g., a value of 0.05). This condition serves as a hard safety constraint, ensuring that the flow state at the bottom of the well has recovered from severe disturbance to a stable state. Even if the energy surplus condition is met (e.g., extremely strong power), if at this time... If the flow rate is too high (indicating that the well bottom is in a slug flow or gas-liquid slippage stage), the system will still force the system to wait until the flow fluctuations converge to the allowable range, thereby effectively avoiding liquid backflow accidents caused by opening the well when the gas and liquid are violently churning.
[0071] When both of the above conditions are met simultaneously at the same sampling time, a well-opening decision result is generated to indicate that the well-opening conditions are met; conversely, if either condition is not met, a well-opening decision result is generated to indicate that the well-opening conditions are not met. By repeating the above calculation and judgment process at each sampling time, dynamic and intelligent decision-making on the timing of well opening is achieved.
[0072] S205. If the well opening decision result indicates that the well opening conditions are met, execute the well opening operation and adaptively update the preset resistance weight coefficient based on the actual operating data after well opening.
[0073] As one possible implementation, if the well opening decision indicates that the well opening conditions are met, the well opening operation is performed, a timer is started, and the movement status of the plunger is monitored by an arrival sensor installed at the wellhead.
[0074] After well opening, the plunger, propelled by gas energy, carries the accumulated fluid upwards towards the wellhead. When the plunger reaches the wellhead, a arrival sensor generates a trigger signal. The time from the well opening time to the generation of this trigger signal is recorded as the actual arrival time. The actual arrival time reflects the actual effect of this well opening and lifting operation. If the well opening is timely and the gas energy and liquid resistance are properly matched, the plunger will reach the wellhead smoothly within the expected time. If the well is opened too early, the gas energy is insufficient, the plunger will run slowly or even fail to reach the wellhead. If the well is opened too late, there is excess energy, and the plunger will run too fast.
[0075] To quantify the degree of deviation in well opening timing, the preset design time is obtained, denoted as... The preset design time is the theoretical arrival time calculated based on the wellbore depth and the standard upward speed recommended by the plunger process. For example, the wellbore depth divided by the standard upward speed (usually 3-5 m / s). Then, the ratio of the actual arrival time to the preset design time is calculated to obtain the time deviation factor. , .
[0076] Furthermore, if This indicates that the plunger actually operated faster than designed, meaning that there was an excess of gas dynamics relative to the fluid resistance during this well opening, i.e., the model had previously overestimated the impact of resistance. (Too large), leading to delayed well drilling; if Or the plunger has not reached (at this time) Take one that is much larger than The maximum value (e.g., 100 seconds) indicates that the plunger is running slower than expected, meaning that the gas dynamics are insufficient to overcome the actual resistance, i.e., the model previously underestimated the effect of resistance. The size was too small, which led to the well being opened too early.
[0077] Due to relying solely on the time deviation factor Parameter adjustments are susceptible to random factors. For example, if the flow at the wellhead is highly unstable at the time of well opening, the time deviation may be primarily caused by fluid disturbance rather than an error in the parameters themselves. Therefore, a correction mechanism based on flow confidence is introduced. Specifically, a second indicator for the well opening time is obtained from step S203 above. And combined with a preset sensitivity constant (For example, a value of 0.05) Calculate the confidence weight. Its formula is expressed as In the formula, the confidence weight is... The value of is positively correlated with the flow stability at the time of well opening. As the denominator approaches 0 (the flow state is extremely stable), the denominator decreases. A value close to 1 indicates high data confidence, allowing for significant parameter adjustments; when... When the flow disturbance increases, the denominator increases. A rapid decrease indicates low data confidence, and the system will suppress the magnitude of parameter correction to prevent being misled by noise.
[0078] Finally, based on the time deviation factor and confidence weight Preset resistance weighting coefficient The system is updated by calculating the updated preset resistance weight coefficient using a preset adaptive update rule. .
[0079] In some embodiments, the formula for calculating the updated preset resistance weight coefficient using a preset adaptive update rule is as follows: In the formula, The base step size factor (e.g., 0.1) is used to control the maximum magnitude of each correction.
[0080] This adaptive update rule enables intelligent bidirectional adjustment; when the plunger runs too fast ( And the data is reliable. When it is relatively large, Negative, leading to Less than Reducing the resistance weighting coefficient means that the system pays less attention to resistance in the next cycle, thus allowing for earlier well opening when resistance is slightly higher, and adjusting the well opening timing accordingly. When the plunger runs too slowly ( And the data is reliable. When it is relatively large, If positive, it will lead to Greater than Increasing the resistance weighting coefficient means that the system pays more attention to resistance in the next cycle, thus delaying well opening until sufficient power is accumulated, and postponing the well opening time. When the flow is unstable ( When it is close to 0, regardless of The values and correction ranges are significantly suppressed to avoid parameter drift caused by noisy data.
[0081] Furthermore, the calculated The updated coefficients are written to non-volatile memory, overwriting the old values. These updated coefficients will be loaded and used in the next shut-in cycle, thus completing the closed-loop control of the entire scheduling system and enabling the model to automatically evolve as gas well conditions change.
[0082] In some embodiments, while executing the dual threshold decision, a mandatory protection mechanism for real-time monitoring of well shut-in duration is simultaneously activated from the start of well shut-in. Start timing and continuously monitor the actual shut-in duration of the gas well. And compare it with the preset maximum shut-in time limit stored in the model parameter library. (For example, 24 hours) Real-time comparison is performed. If the actual well shut-in duration... Reaching the preset maximum shut-in time limit Furthermore, no well-opening decision result indicating that the well-opening conditions are met has yet been generated. To avoid the extreme condition of system deadlock, the well-opening suitability index will be ignored. Compared with the second indicator The judgment result forces the generation of well opening decision results for the execution of well opening operations, and marks this well opening operation as a forced protection mode in the decision log library. After the well opening decision results in this mode are synchronized to the execution and update unit, the subsequent parameter update shielding mechanism will be triggered to prevent the use of abnormal data to pollute the model parameters, and to ensure that the system still has basic backup operation capabilities in extreme cases.
[0083] Understandably, in the intelligent dynamic scheduling method for drainage and gas production based on digital twins provided in this embodiment of the invention, a digital twin model is constructed to characterize the flow state at the bottom of the well. This model is then used to process surface pressure data to determine dynamic characteristic values and resistance characteristic values. Based on the statistical characteristics of these characteristic values, a first index is determined to characterize the comprehensive comparison relationship between gas energy and liquid resistance, and a second index is determined to characterize the degree of flow disturbance at the bottom of the well. Finally, a well opening decision result is generated by combining the preset resistance weight coefficient, and the well opening operation is executed when the conditions are met, and the preset resistance weight coefficient is adaptively updated, forming a complete closed-loop intelligent scheduling system. By transforming previously difficult-to-observe bottom-hole flow characteristics into quantifiable geometric indices and introducing a second index characterizing the degree of flow disturbance, the system can accurately identify high-risk flow patterns such as bottom-hole slug flow and gas-liquid slippage hidden behind fluctuations in surface pressure data. This allows for explicit avoidance of periods of severe flow disturbance during decision-making, ensuring well opening operations are only performed under the dual conditions of sufficient energy and flow convergence. This fundamentally solves the misjudgment problem caused by the inability of traditional methods to distinguish between effective energy accumulation and ineffective gas-liquid disturbances, significantly reducing the probability of fluid fallback and process failure. Simultaneously, the system adaptively updates the preset resistance weight coefficient based on the actual operational results after well opening, incorporating a confidence weight based on the second index at the well opening time. This ensures that the parameter correction magnitude is positively correlated with data quality. It not only utilizes high-quality, stable data to continuously optimize decision parameters to adapt to long-term trends in formation energy decay and fluid accumulation but also avoids parameter drift errors caused by random disturbances during flow instability. This achieves unmanned intelligent monitoring and self-optimization throughout the entire lifecycle of the drainage and gas production process, effectively improving the overall success rate and operational efficiency of the process.
[0084] It should be noted that the order of the above embodiments of the present invention is merely for descriptive purposes and does not represent the superiority or inferiority of the embodiments. The processes depicted in the accompanying drawings do not necessarily require a specific or sequential order to achieve the desired result. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0085] The various embodiments in this specification are described in a progressive manner. The same or similar parts between the various embodiments can be referred to each other. Each embodiment focuses on describing the differences from other embodiments.
Claims
1. A method for intelligent dynamic scheduling of drainage and gas extraction based on digital twins, characterized in that, The method includes: Collect surface pressure data during the well shut-in period and construct a digital twin model to characterize the bottom hole flow based on the surface pressure data, which includes casing pressure data and tubing pressure data. The surface pressure data is processed using the digital twin model to determine dynamic and resistance characteristic values. The dynamic characteristic values characterize the relative rate of gas energy accumulation, and the resistance characteristic values characterize the relative rate of increase in resistance due to fluid accumulation at the bottom of the well. Based on the statistical characteristics of the dynamic characteristic value and the resistance characteristic value, a first index and a second index are determined. The first index is used to characterize the comprehensive comparison relationship between gas energy and liquid accumulation resistance, and the second index is used to characterize the degree of flow disturbance at the bottom of the well. Based on the first indicator, the second indicator, and the preset resistance weighting coefficient, a well opening decision result is generated. The preset resistance weighting coefficient is used to balance the influence of power and resistance in the well opening decision. If the well-opening decision result indicates that the well-opening conditions are met, the well-opening operation is performed, and the preset resistance weighting coefficient is adaptively updated based on the actual operating data after well-opening.
2. The intelligent dynamic scheduling method for drainage and gas extraction based on digital twins according to claim 1, characterized in that, The ground pressure data is processed using the digital twin model to determine dynamic and drag characteristic values, including: The surface pressure data is collected at a first sampling interval during a first preset time period after the well shut-in start time, and the surface pressure data is collected at a second sampling interval after the first preset time period, wherein the second sampling interval is greater than the first sampling interval. Based on the casing pressure data during the first preset time period after the well shut-in start time, a baseline pressure change rate is fitted, which is used to characterize the formation gas supply potential. Based on the casing pressure data collected at each sampling time after the first preset time period and the reference pressure change rate, the dynamic characteristic value at each sampling time is determined. The resistance characteristic value for each sampling moment is determined based on the ground pressure data collected at each sampling moment after the first preset time period and the reference pressure change rate.
3. The intelligent dynamic scheduling method for drainage and gas extraction based on digital twins according to claim 2, characterized in that, Based on the casing pressure data during the first preset time period after the well shut-in start time, a baseline pressure change rate is fitted, including: Based on continuously collecting casing pressure data at a first sampling interval within the first preset time period, a casing pressure data sequence is obtained; The casing pressure data sequence was fitted using a linear regression algorithm to obtain the slope of the fitted line; The maximum value between the slope of the straight line and the preset minimum rate of change is determined as the reference pressure rate of change.
4. The intelligent dynamic scheduling method for drainage and gas extraction based on digital twins according to claim 2, characterized in that, Based on the casing pressure data collected at each sampling time after the first preset time period and the reference pressure change rate, the dynamic characteristic value at each sampling time is determined, including: For each sampling time after the first preset time period, the casing pressure change rate at the sampling time is determined based on the casing pressure data at the sampling time, the casing pressure data at the previous sampling time, and the second sampling interval. The initial dynamic characteristic value is determined based on the casing pressure change rate and the reference pressure change rate; The minimum value between the initial dynamic characteristic value and the preset characteristic threshold is determined as the dynamic characteristic value at the sampling time.
5. The intelligent dynamic scheduling method for drainage and gas extraction based on digital twins according to claim 2, characterized in that, Based on the ground pressure data collected at each sampling time after the first preset time period and the reference pressure change rate, the drag characteristic value at each sampling time is determined, including: For each sampling time after the first preset time period, the casing pressure data and tubing pressure data at the sampling time are used to determine the casing pressure difference at the sampling time. The rate of change of oil-casing pressure difference at the sampling time is determined based on the oil-casing pressure difference at the previous sampling time, the oil-casing pressure difference at the second sampling interval, and the oil-casing pressure difference at the sampling time. The initial resistance characteristic value is determined based on the oil-casing pressure difference change rate and the reference pressure change rate. The minimum value between the initial resistance feature value and the preset feature threshold is determined as the resistance feature value at the sampling time.
6. The intelligent dynamic scheduling method for drainage and gas extraction based on digital twins according to claim 1, characterized in that, Based on the statistical characteristics of the dynamic characteristic value and the resistance characteristic value, the first index and the second index are determined, including: The dynamic characteristic value and drag characteristic value of each sampling time within the second preset time period are used as coordinate points and mapped to a two-dimensional coordinate system with dynamic characteristics as the horizontal axis and drag characteristics as the vertical axis to obtain a two-dimensional point set. Determine the geometric centroid coordinates of the two-dimensional point set, and use the geometric centroid coordinates as the first index; The two-dimensional point set is centered to obtain a detrended point set, and the radius of the minimum covering circle containing all points in the detrended point set is determined by the minimum covering circle algorithm. The radius is then determined as the second index.
7. The intelligent dynamic scheduling method for drainage and gas extraction based on digital twins according to claim 1, characterized in that, Based on the first indicator, the second indicator, and the preset resistance weighting coefficient, a well-opening decision is generated, including: The suitability for well opening is determined based on the first indicator, the second indicator, and the preset resistance weighting coefficient. When the well opening suitability is greater than or equal to zero and the second index is less than a preset safety threshold, a well opening decision result is generated to indicate that the well opening conditions are met. If the well opening suitability is less than zero, or if the second indicator is greater than or equal to the preset safety threshold, a well opening decision result is generated to indicate that the well opening conditions are not met.
8. The intelligent dynamic scheduling method for drainage and gas extraction based on digital twins according to claim 1, characterized in that, The preset resistance weighting coefficient is adaptively updated based on actual operating data after well opening, including: Obtain the actual arrival time of the plunger at the wellhead after well opening; The time deviation factor is determined based on the actual arrival time and the preset design time. The second indicator at the well opening time and the preset sensitivity constant are obtained, and the confidence weight is determined. The second indicator and the confidence weight are negatively correlated. The preset resistance weight coefficient is updated based on the time deviation factor and the confidence weight to obtain the updated preset resistance weight coefficient.
9. The intelligent dynamic scheduling method for drainage and gas extraction based on digital twins according to claim 1, characterized in that, The method further includes: Monitor the duration of well shut-in; If the shut-in duration reaches the preset maximum shut-in time limit and no well opening decision result indicating that the well opening conditions are met is generated, a well opening command is generated to perform the well opening operation, and the well opening is marked as a forced protection mode.
10. A smart dynamic scheduling system for drainage and gas extraction based on digital twins, characterized in that, include: The data acquisition unit is used to collect surface pressure data during the well shut-in period of the gas well, including casing pressure data and tubing pressure data. The model building unit is used to build a digital twin model to characterize the flow state at the bottom of the well based on the surface pressure data. The feature extraction unit is used to process the surface pressure data through the digital twin model to determine dynamic feature values and resistance feature values. The dynamic feature values are used to characterize the relative rate of gas energy accumulation, and the resistance feature values are used to characterize the relative rate of increase in fluid accumulation resistance at the bottom of the well. The index determination unit is used to determine a first index and a second index based on the statistical characteristics of the dynamic characteristic value and the resistance characteristic value. The first index is used to characterize the comprehensive comparison relationship between gas energy and liquid accumulation resistance, and the second index is used to characterize the degree of flow disturbance at the bottom of the well. The decision generation unit is used to generate well opening decision results based on the first indicator, the second indicator and the preset resistance weight coefficient, wherein the preset resistance weight coefficient is used to balance the influence of power and resistance in the well opening decision. The execution and update unit is used to execute the well opening operation when the well opening decision result indicates that the well opening conditions are met, and to adaptively update the preset resistance weight coefficient based on the actual operating data after well opening.