Gas well borehole liquid accumulation division method, device and medium thereof

By adaptively adjusting the profile coefficient and using dual clustering criteria, the problem of quantitatively classifying the degree of liquid accumulation in gas wellbore was solved, improving the accuracy of liquid accumulation and clustering accuracy. This provides a scientific basis for drainage and gas production measures, enhancing the pertinence and efficiency of these measures.

CN122169794APending Publication Date: 2026-06-09CHANGZHOU UNIV

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
CHANGZHOU UNIV
Filing Date
2026-04-28
Publication Date
2026-06-09

AI Technical Summary

Technical Problem

Existing technologies lack quantitative standards for classifying the degree of liquid accumulation in gas wellbores, resulting in a high degree of subjectivity in judging the degree of liquid accumulation. This makes it difficult to achieve accurate and quantitative differentiation, affecting the pertinence and efficiency of drainage and gas production measures.

Method used

A method for classifying wellbore fluid accumulation is adopted. By acquiring oil pressure data, casing pressure data, and daily gas production data, the oil-casing pressure difference is calculated to construct a dataset. The optimal number of clusters K is determined by adaptive adjustment based on the profile coefficient of the critical fluid-carrying flow rate sample. Cluster analysis is performed, and secondary clustering is combined with daily gas production to establish a dual classification standard for the degree of wellbore fluid accumulation.

Benefits of technology

It improved the accuracy and efficiency of liquid accumulation degree classification, with a clustering accuracy rate of 94.6%, realizing a leap from qualitative experience judgment to quantitative data-driven approach, and providing a scientific basis for optimizing drainage and gas extraction measures.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122169794A_ABST
    Figure CN122169794A_ABST
Patent Text Reader

Abstract

This invention relates to the field of petroleum and natural gas engineering technology, and particularly to a method, equipment, and medium for classifying fluid accumulation in gas wells. The method includes: acquiring oil pressure data, casing pressure data, and daily gas production data of the gas well; calculating the oil-casing pressure difference based on the oil pressure data and casing pressure data; preprocessing the daily gas production data and all calculated oil-casing pressure difference data, and constructing a dataset; adaptively adjusting the original profile coefficient of each data in the dataset based on the profile coefficient of the critical fluid-carrying flow rate sample to determine the optimal number of clusters K; performing cluster analysis on the oil-casing pressure difference data in the dataset based on the optimal number of clusters to obtain a preliminary quantitative classification standard for wellbore fluid accumulation levels; and performing secondary clustering based on the daily gas production within the preliminary quantitative classification standard for wellbore fluid accumulation levels to obtain a refined quantitative classification standard for the degree of wellbore fluid accumulation, thus completing the quantitative analysis of the degree of fluid accumulation in the gas wellbore and improving the accuracy and efficiency of fluid accumulation level classification.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of petroleum and natural gas engineering technology, and in particular to a method, equipment and medium for dividing liquid accumulation in a gas wellbore. Background Technology

[0002] In the later stages of gas well production, formation energy decays, and the fluid velocity in the wellbore decreases. Its fluid-carrying capacity is insufficient to completely remove the fluid from the wellhead, leading to fluid accumulation within the wellbore—a condition known as wellbore liquid accumulation. Liquid accumulation increases wellbore back pressure, inhibits gas production, and in severe cases, can cause water flooding and production shutdown. Accurately assessing the degree of wellbore liquid accumulation is crucial for optimizing production management and improving efficiency. Currently, the assessment of wellbore liquid accumulation primarily relies on traditional techniques such as critical fluid-carrying flow rate models and pressure gradient curve analysis. However, these methods have significant limitations; most can only determine whether liquid accumulation has occurred in the wellbore, but cannot accurately and quantitatively differentiate the severity of the accumulation.

[0003] In actual field production practice, operators typically rely on a single parameter such as the oil-casing pressure differential, combined with their accumulated experience, to roughly classify the degree of fluid accumulation in the wellbore into three levels: light, moderate, and severe. However, this classification method has many drawbacks. It is too subjective; different operators may have vastly different judgments on the degree of fluid accumulation in the same gas well due to differences in experience, lacking a unified and objective standard. Moreover, a single parameter cannot comprehensively and accurately reflect the complexity of the wellbore condition. Within the same oil-casing pressure differential range, the daily gas production of a gas well may vary significantly, which can easily lead to misjudgments of the degree of fluid accumulation. Consequently, subsequent drainage and gas production measures lack specificity and fail to effectively solve the actual problem.

[0004] In recent years, with the rapid development of data science, some researchers have attempted to introduce data-driven methods to solve the problem of identifying the degree of liquid accumulation in gas wellbores. However, gas well production data is characterized by high noise and complex distribution. Traditional K-means clustering algorithms face problems such as high noise interference and low accuracy in selecting K values ​​when processing gas well production data. This directly leads to poor stability of the clustering results, making it difficult to meet the needs of accurate identification in actual production.

[0005] Due to the lack of quantitative classification standards, decisions on drainage and gas production measures often rely solely on experience. This results in an effectiveness rate of only 68.3%, with fluctuating results that make it difficult to guarantee stable production benefits. Furthermore, it leads to low cost-effectiveness and increases the operating costs of gas well production. Summary of the Invention

[0006] The technical problem to be solved by this invention is: to address the lack of a quantitative standard for classifying the degree of liquid accumulation in gas wells in existing technologies, this invention provides a method for classifying liquid accumulation in gas wells, which can form a quantitative standard for classifying the degree of liquid accumulation in wells, thereby improving the accuracy and efficiency of liquid accumulation degree classification.

[0007] The technical solution adopted by this invention to solve its technical problem is: a method for classifying liquid accumulation in a gas wellbore, the method comprising the following steps: S1, acquires oil pressure data, casing pressure data and daily gas production data of gas wells; S2, calculate the oil-casing pressure difference based on the oil pressure data and the casing pressure data, preprocess the daily gas production data and all the calculated oil-casing pressure difference data, and construct a dataset; S3, using the profile coefficient of the critical liquid-carrying flow rate sample as a benchmark, adaptively adjust the original profile coefficient of each data in the dataset to determine the optimal number of clusters K; S4. Based on the optimal cluster number K, perform cluster analysis on the oil casing pressure difference data in the dataset to obtain a preliminary quantitative classification standard for wellbore fluid accumulation level; S5. Using the daily gas production within the preliminary quantitative classification standard of wellbore fluid accumulation level as a feature, a second clustering is performed to obtain a refined quantitative classification standard for the degree of wellbore fluid accumulation, thus completing the quantitative analysis of the degree of fluid accumulation.

[0008] This invention adaptively adjusts the profile coefficient using critical liquid-carrying flow rate samples, significantly suppressing noise interference and overcoming the problem of poor adaptability of traditional methods to complex gas well production data. It achieves a K-value selection accuracy of 94.6%, improving the precision of liquid accumulation classification. Furthermore, by integrating the oil-casing pressure difference and daily gas production through dual classification standards, a quantitative classification framework for wellbore liquid accumulation is established. This represents a leap from qualitative experience-based judgment to quantitative data-driven approaches, solving the problem of insufficient targeted measures due to the lack of unified standards in the field. It provides a scientific basis for the precise optimization of subsequent drainage and gas production measures.

[0009] Furthermore, specifically, step S3 includes the following steps: S31, Obtain the critical liquid-carrying flow rate sample, including the oil-casing pressure difference threshold, the daily gas production threshold, and the corresponding profile coefficient; S32, Compare the oil-casing pressure difference data and daily gas production data in the dataset with the critical liquid-carrying flow rate sample. If the oil-casing pressure difference in the dataset is less than the oil-casing pressure difference threshold, or the daily gas production is less than the daily gas production threshold, then the original profile coefficient of each data in the dataset is adaptively adjusted to obtain the adjusted profile coefficient z(i) of each data. Then, the optimal number of clusters K is determined based on the adjusted profile coefficient z(i) of each data.

[0010] Furthermore, specifically, the original silhouette coefficients of each data point in the dataset are adaptively adjusted to obtain the adjusted silhouette coefficients z(i) for each data point. The optimal number of clusters K is then determined based on these adjusted silhouette coefficients z(i). This process includes the following steps: S321, calculate the original silhouette coefficient E(i) and initial mean t for each data point in the dataset; S322, calculate the adjustment coefficient for each data point in the dataset based on the profile coefficient of the critical liquid-carrying flow rate sample; S323, calculate the corresponding adjusted profile coefficient z(i) based on the adjustment coefficient of each data point; S324, calculate the mean S(t) of all adjusted profile coefficients z(i), and select the value that maximizes the value of S(t) as the optimal number of clusters K.

[0011] Furthermore, specifically, step S4 includes the following steps: S41, Obtain the optimal clustering number K; S42, Select K data points from the dataset as initial cluster centers and input them into the clustering algorithm module; S43, calculate the Euclidean distance from each data point in the dataset to each of the initial cluster centers, and assign the data points to the corresponding clusters according to the shortest distance criterion; S44 continuously updates the cluster center coordinates through multiple iterative calculations until the preset convergence conditions are met, thus obtaining the preliminary quantitative classification standard for wellbore fluid accumulation levels.

[0012] Furthermore, specifically, the wellbore fluid accumulation levels include: no fluid accumulation, slight fluid accumulation, moderate fluid accumulation, and severe fluid accumulation.

[0013] Furthermore, specifically, step S5 includes the following steps: The daily gas production data within the preliminary quantitative classification standard for wellbore fluid accumulation level are smoothed and Z-score standardized. The number of clusters is set, and the processed daily gas production data is input into the clustering algorithm module for secondary clustering. The position of the cluster center is continuously optimized through iterative calculation until the preset convergence condition is met, and the daily gas production data is distributed to each cluster. The fine quantitative classification standard of wellbore fluid accumulation degree is determined, and mild, moderate and severe fluid accumulation are each divided into two subclasses, resulting in six fine subclasses. The six fine subclasses are mild fluid accumulation class I, mild fluid accumulation class II, moderate fluid accumulation class I, moderate fluid accumulation class II, severe fluid accumulation class I and severe fluid accumulation class II. Furthermore, specifically, the method further includes: Based on a precise quantitative classification standard for the degree of fluid accumulation in the wellbore, and combined with the built-in measures knowledge base, drainage and gas production measures and process parameters are recommended.

[0014] Furthermore, specifically, the preprocessing of all the oil-casing pressure difference data and daily gas production data in step S2 includes outlier removal, missing value imputation, noise reduction, and Z-score standardization.

[0015] A computer device, comprising: processor; Memory, used to store executable instructions; The processor is configured to read the executable instructions from the memory and execute the executable instructions to implement the gas wellbore liquid partitioning method as described above.

[0016] A computer-readable storage medium storing a computer program that, when executed by a processor, causes the processor to implement the gas wellbore fluid partitioning method described above. The beneficial effects of this invention are that the gas wellbore liquid accumulation classification method of this invention adaptively adjusts the profile coefficient using critical liquid-carrying flow rate samples, significantly suppressing noise interference and overcoming the problem of poor adaptability of traditional methods to complex gas well production data. This results in a K-value selection accuracy rate of 94.6%, improving the precision of liquid accumulation degree classification. In addition, by using dual classification standards and integrating oil-casing pressure difference and daily gas production, a quantitative classification framework for wellbore liquid accumulation degree is established, realizing a leap from qualitative experience judgment to quantitative data-driven approach. This solves the problem of insufficient targeted measures due to the lack of unified standards in the field, and provides a scientific basis for the precise optimization of subsequent drainage and gas production measures. Attached Figure Description

[0017] The present invention will be further described below with reference to the accompanying drawings and embodiments.

[0018] Figure 1 This is a schematic diagram of the method flow of Embodiment 1 of the present invention.

[0019] Figure 2 This is a scatter plot of the oil-casing pressure difference and daily gas production in Embodiment 1 of the present invention.

[0020] Figure 3 This is a schematic diagram comparing the clustering accuracy under different methods in Embodiment 1 of the present invention.

[0021] Figure 4 This is a schematic diagram comparing the contour coefficients under different K values ​​in Embodiment 1 of the present invention.

[0022] Figure 5 This is a schematic diagram comparing the accuracy of contour coefficient calculation using traditional methods with that of contour coefficient calculation in this embodiment of the present invention.

[0023] Figure 6 This is a schematic diagram of the computer hardware device structure according to Embodiment 2 of the present invention.

[0024] In the diagram, 10 is a computer device; 1002 is a processor; 1004 is a memory; and 1006 is a transmission device. Detailed Implementation

[0025] The present invention will now be described in further detail with reference to the accompanying drawings. These drawings are simplified schematic diagrams, illustrating only the basic structure of the invention, and therefore only show the components relevant to the invention.

[0026] Example 1: This invention provides a method for classifying liquid accumulation in a gas wellbore, such as... Figure 1 As shown, the method includes the following steps: S1, acquire oil pressure data, casing pressure data and daily gas production data of the gas well; for example, acquire oil pressure data, casing pressure data and daily gas production data from pressure sensors and flow meters installed in the gas well through the set data acquisition module.

[0027] S2, calculate the oil-casing pressure difference based on oil pressure data and casing pressure data, preprocess the daily gas production data and all calculated oil-casing pressure difference data, and construct a dataset; where, oil-casing pressure difference = oil pressure - casing pressure.

[0028] S3, using the profile coefficient of the critical liquid-carrying flow rate sample as a benchmark, adaptively adjusts the original profile coefficient of each data in the dataset to determine the optimal number of clusters K; S4. Based on the optimal cluster number K, cluster analysis is performed on the oil casing pressure difference data in the dataset to obtain a preliminary quantitative classification standard for wellbore fluid accumulation level. S5 uses the daily gas production within the preliminary quantitative classification standard of wellbore fluid accumulation level as a feature to perform secondary clustering, and then performs a fine quantitative classification standard of wellbore fluid accumulation degree to obtain multiple fine subclasses, thus completing the quantitative analysis of the degree of wellbore fluid accumulation in gas wells.

[0029] In this embodiment, step S2 preprocesses all oil-casing pressure differential data and daily gas production data, including outlier removal, missing value imputation, noise reduction, and Z-score standardization, which effectively improves data quality and provides reliable support for accurate liquid accumulation classification and measure optimization.

[0030] Specifically, outlier removal uses a box plot method combined with the 3σ criterion to avoid erroneous deletion of real production fluctuations; missing value imputation uses time series adaptive processing, with linear interpolation used to fill in data that is missing for no more than 3 consecutive days, and the entire segment is removed if it exceeds 3 days, balancing data integrity and reliability. The noise reduction process is implemented in stages. For example, the oil-jacket pressure difference is smoothed by using a moving average to smooth short-term fluctuations, and the daily gas production is smoothed by Gaussian kernel regression to retain local features. The first and last data are ensured to be complete by using the reflection expansion method. The formula for calculating the moving average is:

[0031] in, For the first One sample point; It is a moving average, dimensionless. W This represents the number of windows.

[0032] The Gaussian kernel function is expressed as:

[0033] in, x For prediction points; For the first i One sample point; This is a dimensionless bandwidth parameter. It controls the radial range of the kernel function and determines the rate at which the influence of data points decays. The larger the value, the smoother the kernel function; conversely, the smaller the value, the sharper the kernel function.

[0034] Z-score normalization independently normalizes the oil-casing pressure difference and daily gas production, eliminating dimensional differences and ensuring a balanced weighting of the two parameters in clustering. The Z-score normalization formula is: x' = (x - μ) / σ, Where μ is the characteristic mean, σ is the standard deviation, x is the original characteristic data (including oil-casing pressure difference data and daily gas production data), μ is the overall mean of the characteristic parameter, σ is the overall standard deviation of the characteristic parameter, and x' is the standardized data; the mean and standard deviation of the two sets of data, oil-casing pressure difference and daily gas production, are calculated independently and standardized to eliminate the difference in dimensions and numerical magnitudes and ensure the accuracy of the two parameters.

[0035] In this embodiment, step S3 specifically includes the following steps: S31, obtain the critical liquid-carrying flow rate sample, including the oil-casing pressure difference threshold, daily gas production threshold and the corresponding profile coefficient. It should be noted that the profile coefficient corresponding to the critical liquid carrying flow rate sample in this embodiment was calculated using existing methods.

[0036] S32 compares the oil-casing pressure differential data and daily gas production data in the dataset with the critical liquid-carrying flow rate sample. If the oil-casing pressure difference in the dataset is greater than or equal to the oil-casing pressure difference threshold, or the daily gas production is greater than or equal to the daily gas production threshold, then no adjustment will be made.

[0037] If the oil-casing pressure difference in the dataset is less than the oil-casing pressure difference threshold, or the daily gas production is less than the daily gas production threshold, then the original profile coefficient of each data in the dataset is adaptively adjusted to obtain the adjusted profile coefficient z(i) of each data. Then, the optimal number of clusters K is determined based on the adjusted profile coefficient z(i) of each data.

[0038] In this embodiment, the original silhouette coefficients of each data point in the dataset are adaptively adjusted to obtain the adjusted silhouette coefficients z(i) for each data point. The optimal number of clusters K is then determined based on the adjusted silhouette coefficients z(i). Specifically, this includes the following steps: S321, calculate the original silhouette coefficient E(i) and initial mean t for each data point in the dataset. The formula for calculating the initial mean t is: .

[0039] S322, Calculate the adjustment coefficient for each data point in the dataset based on the profile coefficient of the critical liquid-carrying flow rate sample. The calculation formula is as follows: K(i)=E(i) / r Where r is the profile coefficient of the critical liquid carrying flow rate sample.

[0040] S323, calculate the corresponding adjusted profile coefficient z(i) based on the adjustment factor for each data point. The calculation formula is as follows: z(i) = K(i) × t.

[0041] S324, calculate the mean S(t) of all adjusted silhouette coefficients z(i) to determine the optimal number of clusters K. The formula for calculating the mean S(t) is:

[0042] In this embodiment, the value that maximizes S(t) is selected as the optimal number of clusters, thus achieving accurate selection of the number of clusters. The maximum value of the mean S(t) is selected as the optimal number of clusters, solving the problem of low accuracy in selecting the K value in traditional methods.

[0043] In this embodiment, step S4 specifically includes the following steps: S41, obtain the optimal number of clusters K; S42, Select K data points from the dataset as initial cluster centers and input them into the clustering algorithm module; S43, calculate the Euclidean distance from each data point in the dataset to each initial cluster center, and assign the data points to the corresponding clusters according to the shortest distance criterion. S44, through multiple iterative calculations, continuously updates the cluster center coordinates until the preset convergence condition is met, thus obtaining a preliminary quantitative classification standard for wellbore fluid accumulation levels. These levels include: no fluid accumulation, mild fluid accumulation, moderate fluid accumulation, and severe fluid accumulation.

[0044] In this embodiment, step S5 specifically includes the following steps: S51. The daily gas production data within the preliminary quantitative classification criteria for wellbore fluid accumulation levels are smoothed and Z-score standardized. Since the impact of the two datasets on the classification results differs, smoothing and Z-score standardization of the daily gas production data within the preliminary quantitative classification criteria for wellbore fluid accumulation levels meets the requirements for fine classification, further improving the accuracy of the classification results.

[0045] S52, set the number of clusters, input the processed daily gas production data into the clustering algorithm module for secondary clustering, and continuously optimize the position of the cluster centers through iterative calculations until the preset convergence conditions are met, completing the allocation of daily gas production data to each cluster and determining the fine quantitative classification standard for the degree of wellbore fluid accumulation. That is, light fluid accumulation, moderate fluid accumulation, and severe fluid accumulation are each divided into two subclasses, resulting in six fine subclasses, namely, light fluid accumulation class I, light fluid accumulation class II, moderate fluid accumulation class I, moderate fluid accumulation class II, severe fluid accumulation class I, and severe fluid accumulation class II.

[0046] It should be noted that the convergence condition preset in steps S44 and S52 is that the cluster partitioning no longer changes, or the degree of change is extremely small. In this embodiment, the method further includes: based on a refined quantitative classification standard for the degree of fluid accumulation in the wellbore, and combined with a built-in measures knowledge base, recommending drainage and gas production measures and process parameters. These measures include: foaming agent injection regime, velocity string depth, and gas lift valve configuration. Furthermore, 86 water-producing gas wells from a certain gas field were selected. All wells were completed using casing perforation, and the producing formation was a carbonate reservoir with depths ranging from 2,800 to 3,500 m. The bottom-hole static temperature was 75–80 ℃, and the bottom-hole pressure was approximately 20 MPa. The produced liquid was primarily formation water, with a water-to-gas ratio between (2–5) m. 3 / 10 4 m 3 Between. Taking the collection of oil pressure, casing pressure, and daily gas production data for a production year, collected once daily, resulting in a total of 31,390 raw data points, as an example, the embodiment of the present invention will be further described in detail: To ensure data quality and reliability, a rigorous quality control process was adopted: First, outlier detection and processing were performed. Box plots and the 3σ criterion were used to identify outlier data points, and outliers that significantly deviated from production patterns (such as sudden pressure fluctuations caused by instrument malfunctions) were removed. A total of 427 outliers were removed, leaving 30,963 valid data points, with a data validity rate of 98.6%. Second, missing data processing was performed. For individual data gaps caused by instrument maintenance, data transmission interruptions, etc., time-series linear interpolation was used to fill in the gaps; data segments with more than 3 consecutive days of missing data were directly removed to ensure data continuity. Finally, a complete time-series dataset was formed. Considering the dimensional differences in production data, the oil-casing pressure difference and daily gas production data were processed using the Z-score standardization method before cluster analysis.

[0047] A gas well in a critical fluid-carrying state was selected as a reference well with a casing pressure difference of 2.0 MPa and a daily gas production of 13,800 m³ / d. Its profile coefficient r = 0.85 was calculated. Using the profile coefficient of the critical fluid-carrying flow rate sample as a benchmark, the original profile coefficient of each data point in the dataset was adaptively adjusted to determine the optimal number of clusters. The calculation results showed that S(4) = 0.89 reached its maximum value when K = 4. Therefore, the optimal number of clusters K = 4 was determined, and the accuracy of K value selection was improved from 64.8% to 94.6% compared with the traditional profile coefficient method.

[0048] Using the standardized oil-casing pressure difference as the feature data, and setting K=4, a clustering algorithm module was used for clustering. The algorithm converged after 15 iterations. Based on the clustering results, a preliminary quantitative classification standard for wellbore fluid accumulation was determined, as shown in Table 1. Table 1. Preliminary quantitative classification results of wellbore fluid accumulation levels

[0049] The data distribution shows that gas wells with slight liquid accumulation accounted for the highest proportion at 39.9%, which is consistent with the actual pattern that gas wells are in a state of slight liquid accumulation for most of the production process. Wells with no liquid accumulation accounted for 27.6%, mainly corresponding to the initial production stage or the production stage after intervention measures. Moderate and severe liquid accumulation accounted for 25.4% and 7.1% respectively, indicating that some gas wells have serious liquid accumulation problems and require timely intervention.

[0050] However, the application of this single parameter standard has revealed significant limitations. As shown in Table 2, within the same mild liquid accumulation range, the daily gas production of gas wells varies significantly. This indicates that the oil-casing pressure difference alone cannot fully characterize the complexity of the wellbore condition, potentially leading to biased decision-making. For example, for gas wells with a pressure of around 3.0 MPa, if the daily gas production is high (>1.2×10⁴ m³), ​​it still has some liquid-carrying capacity and may only require auxiliary drainage measures; however, if the daily gas production is low (<0.6×10⁴ m³), ​​stronger intervention measures are needed. If the same measures are applied based solely on the oil-casing pressure difference classification, it is difficult to achieve optimal effectiveness and economy.

[0051] Table 2. Example of the relationship between oil-casing pressure difference and daily gas production in wells with mild fluid accumulation.

[0052] Further analysis revealed a significant nonlinear relationship between the oil-casing pressure differential and daily gas production. For example... Figure 2 As shown, within the same oil-casing pressure differential range, daily gas production can be distributed over a relatively wide range. This variability reveals the inadequacy of the single-parameter classification method, indicating the need to introduce a second parameter to more accurately characterize the fluid accumulation state in the wellbore. Therefore, within each initially classified level, secondary clustering is performed using standardized daily gas production as a characteristic, with K=2. The preliminary quantitative classification criteria for wellbore fluid accumulation levels and the refined quantitative classification criteria for wellbore fluid accumulation degrees are shown in Table 3.

[0053] Table 3. Detailed Quantitative Classification Standards for Wellbore Fluid Accumulation

[0054] As shown in Table 3, this standard sets clear boundaries for oil-casing pressure differential and daily gas production for each subclass, achieving quantitative and refined judgment of the degree of fluid accumulation and effectively eliminating the ambiguity in traditional classifications. Its six subclasses cover the entire process of gas wells from normal production to severe fluid accumulation, and the data distribution for each subclass is relatively balanced, ensuring the scientific and rational nature of the classification. Physically, an increase in oil-casing pressure differential or a decrease in daily gas production corresponds to a more severe degree of fluid accumulation. Within the same oil-casing pressure differential range, subclasses with lower daily gas production (such as mild Class II, moderate Class II, and severe Class II) often indicate weaker wellbore lifting capacity and a more significant impact from fluid accumulation, requiring priority to be given to more effective drainage measures. At the application level, this standard can provide precise guidance for the selection of drainage and gas production processes and parameter optimization. Specifically, for mild Class I, intermittent foaming drainage is used, with 50 kg of foaming agent added every 3 days; for mild Class II, continuous foaming drainage is used, with a foaming agent injection rate of 30 kg / day; for moderate Class I, high-efficiency foaming drainage or vortex tools are used; for moderate Class II, velocity tubing is used to a depth of up to 2800 m; for severe Class I, air lift drainage is used, with a three-stage air lift valve configuration and an injection pressure of 8 MPa; for severe Class II, a combined process is used for wellbore purification.

[0055] To verify the effectiveness of this standard, historical production data from 86 wells with fluid accumulation in an oilfield were used for retrospective analysis. The results show that, as... Figure 3 As shown, when classifying the degree of liquid accumulation based solely on the oil-casing pressure difference, only 54 out of 86 gas wells were correctly identified, with an accuracy rate of 62.7%. However, after adopting a detailed classification standard that integrates the oil-casing pressure difference and daily gas production, the number of correct wells increased to 76, and the accuracy rate improved to 88.4%.

[0056] Figure 4 The figure shows a comparison of silhouette coefficients at different K values. Generally, the higher the silhouette coefficient (the standard maximum silhouette coefficient is 1; the calculation formula for the silhouette coefficient in this embodiment changes the value range, and the maximum value exceeds 1), the better the clustering effect. In the figure, the vertical dashed lines indicate the optimal K values ​​for each method. Both methods achieve their maximum value at K=4, which matches the four cluster centers preset in the simulated data. The traditional method maintains a high level at K=3, 5, and 6, forming multiple local peaks; while the peak at K=4 in this embodiment is more prominent, and the difference from other K values ​​increases significantly. This comparison shows that the weighted adjustment in this embodiment enhances the identification of the true optimal K value and reduces the risk of misselecting K values ​​due to interference from local peaks.

[0057] Figure 5The accuracy of clustering after determining the K value using the traditional profile coefficient calculation and the profile coefficient calculation of this embodiment is shown. The results show that the profile coefficient calculation of this embodiment improves the clustering accuracy from 64.8% of the traditional method to 94.6%, further proving the effectiveness of this method in processing gas well production data and providing a reliable basis for the accurate formulation of subsequent drainage and gas production measures.

[0058] In summary, the wellbore fluid accumulation classification method of this invention adaptively adjusts the profile coefficient using critical fluid-carrying flow rate samples, significantly suppressing noise interference and overcoming the problem of poor adaptability of traditional methods to complex gas well production data. This achieves a K-value selection accuracy of 94.6%, improving the precision of fluid accumulation classification. Furthermore, by integrating the oil-casing pressure difference and daily gas production through dual classification standards, a quantitative classification framework for wellbore fluid accumulation is established, achieving a leap from qualitative experience-based judgment to quantitative data-driven approaches. This solves the problem of insufficient targeted measures due to the lack of unified standards in the field, providing a scientific basis for the precise optimization of subsequent drainage and gas production measures.

[0059] Example 2: This application provides a computer device including a processor and a memory. The memory stores at least one instruction or at least one program, which is loaded and executed by the processor to implement a gas wellbore liquid partitioning method as provided in the above method embodiments.

[0060] Figure 6 A schematic diagram of the hardware structure of an apparatus for implementing a gas wellbore liquid separation method provided in the embodiments of this application is shown. The apparatus can constitute or include the device or system provided in the embodiments of this application. Figure 6 As shown, the computer device 10 may include one or more processors 1002 (the processor may include, but is not limited to, a microprocessor MCU or a programmable logic device FPGA, etc.), a memory 1004 for storing data, and a transmission device 1006 for communication functions. In addition, it may also include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of the I / O interface), a network interface, a power supply, and / or a camera. Those skilled in the art will understand that... Figure 6 The structure shown is for illustrative purposes only and does not limit the structure of the aforementioned electronic device. For example, computer device 10 may also include... Figure 6 The more or fewer components shown, or having the same Figure 6 The different configurations shown.

[0061] It should be noted that the aforementioned one or more processors and / or other data processing circuits are generally referred to herein as "data processing circuits". These data processing circuits may be embodied, in whole or in part, in software, hardware, firmware, or any other combination thereof. Furthermore, the data processing circuit may be a single, independent processing module, or may be integrated, in whole or in part, into any other element within the computer device 10 (or mobile device). As involved in the embodiments of this application, the data processing circuit serves as a processor control mechanism (e.g., selection of a variable resistor termination path connected to an interface).

[0062] The memory 1004 can be used to store software programs and modules for application software, such as the program instructions / data storage device corresponding to a gas wellbore liquid classification method in this embodiment of the application. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory 1004, thereby implementing the aforementioned method. The memory 1004 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 1004 may further include memory remotely located relative to the processor, and these remote memories can be connected to the computer device 10 via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.

[0063] The transmission device 1006 is used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by the communication provider of the computer device 10. In one example, the transmission device 1006 includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission device 1006 may be a Radio Frequency (RF) module, used for wireless communication with the Internet.

[0064] The display may be, for example, a touchscreen liquid crystal display (LCD) that allows the user to interact with the user interface of the computer device 10 (or mobile device).

[0065] Example 3: This application embodiment also provides a computer-readable storage medium, which can be disposed in a server to store at least one instruction or at least one program related to implementing a gas wellbore liquid accumulating method in the method embodiment. The at least one instruction or the at least one program is loaded and executed by the processor to implement the gas wellbore liquid accumulating method provided in the above method embodiment.

[0066] Optionally, in this embodiment, the storage medium may be located at at least one of the multiple network servers in a computer network. Optionally, in this embodiment, the storage medium may include, but is not limited to, various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.

[0067] Example 4: This invention also provides a computer program product or computer program, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform a gas wellbore liquid separation method provided in the various optional embodiments described above.

[0068] It should be noted that the order of the embodiments described above is merely for descriptive purposes and does not represent the superiority or inferiority of the embodiments. Furthermore, the above description focuses on specific embodiments of this application. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps described in the claims can be performed in a different order than that shown in the embodiments and still achieve the desired results. Additionally, the processes depicted in the drawings do not necessarily require a specific or sequential order to achieve the desired results. In some implementations, multitasking and parallel processing are also possible or may be advantageous.

[0069] The various embodiments in this application are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the device, equipment, and storage medium embodiments are basically similar to the method embodiments, so the descriptions are relatively simple; relevant parts can be referred to the descriptions of the method embodiments.

[0070] Those skilled in the art will understand that all or part of the steps of the above embodiments can be implemented by hardware or by a program instructing related hardware. The program can be stored in a computer-readable storage medium, such as a read-only memory, a disk, or an optical disk.

[0071] Based on the above-described preferred embodiments of the present invention, and through the foregoing description, those skilled in the art can make various changes and modifications without departing from the inventive concept. The technical scope of this invention is not limited to the contents of the specification, but must be determined according to the scope of the claims.

Claims

1. A method for classifying liquid accumulation in a gas wellbore, characterized in that, The method includes the following steps: S1, acquires oil pressure data, casing pressure data and daily gas production data of gas wells; S2, calculate the oil-casing pressure difference based on the oil pressure data and the casing pressure data, preprocess the daily gas production data and all the calculated oil-casing pressure difference data, and construct a dataset; S3, using the profile coefficient of the critical liquid-carrying flow rate sample as a benchmark, adaptively adjust the original profile coefficient of each data in the dataset to determine the optimal number of clusters K; S4. Based on the optimal cluster number K, perform cluster analysis on the oil casing pressure difference data in the dataset to obtain a preliminary quantitative classification standard for wellbore fluid accumulation level; S5. Using the daily gas production within the preliminary quantitative classification standard of wellbore liquid accumulation level as a feature, a second clustering is performed to obtain a refined quantitative classification standard of wellbore liquid accumulation degree, thus completing the quantitative analysis of the wellbore liquid accumulation degree of the gas well.

2. The method for classifying liquid accumulation in a gas wellbore according to claim 1, characterized in that, Step S3 specifically includes the following steps: S31, obtain the critical liquid-carrying flow rate sample, including the oil-casing pressure difference threshold, the daily gas production threshold and the corresponding profile coefficient. S32, compare the oil-casing pressure difference data and daily gas production data in the dataset with the critical liquid-carrying flow rate sample; If the oil-casing pressure difference in the dataset is less than the oil-casing pressure difference threshold, or the daily gas production is less than the daily gas production threshold, then the original profile coefficient of each data in the dataset is adaptively adjusted to obtain the adjusted profile coefficient z(i) of each data. Then, the optimal number of clusters K is determined based on the adjusted profile coefficient z(i) of each data.

3. The method for classifying liquid accumulation in a gas wellbore according to claim 1, characterized in that, The process of adaptively adjusting the original silhouette coefficients of each data point in the dataset to obtain the adjusted silhouette coefficients z(i) for each data point, and then determining the optimal number of clusters K based on the adjusted silhouette coefficients z(i) for each data point, specifically includes the following steps: S321, calculate the original silhouette coefficient E(i) and initial mean t for each data point in the dataset; S322, calculate the adjustment coefficient for each data point in the dataset based on the profile coefficient of the critical liquid-carrying flow rate sample; S323, calculate the corresponding adjusted profile coefficient z(i) based on the adjustment coefficient of each data point; S324, calculate the mean S(t) of all adjusted profile coefficients z(i), and select the value that maximizes the value of S(t) as the optimal number of clusters K.

4. The method for classifying liquid accumulation in a gas wellbore according to claim 1, characterized in that, Step S4 specifically includes the following steps: S41, Obtain the optimal clustering number K; S42, Select K data points from the dataset as initial cluster centers and input them into the clustering algorithm module; S43, calculate the Euclidean distance from each data point in the dataset to each of the initial cluster centers, and assign the data points to the corresponding clusters according to the shortest distance criterion; S44 continuously updates the cluster center coordinates through multiple iterative calculations until the preset convergence conditions are met, thus obtaining the preliminary quantitative classification standard for wellbore fluid accumulation levels.

5. The method for classifying liquid accumulation in a gas wellbore according to claim 4, characterized in that, The wellbore fluid accumulation levels include: no fluid accumulation, slight fluid accumulation, moderate fluid accumulation, and severe fluid accumulation.

6. The method for classifying liquid accumulation in a gas wellbore according to claim 5, characterized in that, Step S5 specifically includes the following steps: The daily gas production data within the preliminary quantitative classification standard for wellbore fluid accumulation level are smoothed and Z-score standardized. The number of clusters is set, and the processed daily gas production data is input into the clustering algorithm module for secondary clustering. The position of the cluster center is continuously optimized through iterative calculation until the preset convergence condition is met, and the daily gas production data is distributed to each cluster. The fine quantitative classification standard of wellbore fluid accumulation degree is determined, and mild, moderate and severe fluid accumulation are each divided into two subclasses, resulting in six fine subclasses. The six fine subclasses are mild fluid accumulation class I, mild fluid accumulation class II, moderate fluid accumulation class I, moderate fluid accumulation class II, severe fluid accumulation class I and severe fluid accumulation class II.

7. The method for classifying liquid accumulation in a gas wellbore according to claim 1, characterized in that, The method further includes: Based on a precise quantitative classification standard for the degree of fluid accumulation in the wellbore, and combined with the built-in measures knowledge base, drainage and gas production measures and process parameters are recommended.

8. The method for classifying liquid accumulation in a gas wellbore according to claim 1, characterized in that, In step S2, the preprocessing of all the oil-casing pressure difference data and daily gas production data includes outlier removal, missing value imputation, noise reduction, and Z-score standardization.

9. A computer device, characterized in that, include: processor; Memory, used to store executable instructions; The processor is configured to read the executable instructions from the memory and execute the executable instructions to implement the gas wellbore liquid partitioning method as described in any one of claims 1 to 8.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, causes the processor to implement the gas wellbore liquid partitioning method as described in any one of claims 1 to 8.