Research on residual gas distribution based on dynamic fine-grained K-means recursive algorithm

Through the improved dynamic fine-grained K-means recursive algorithm, combined with grid master control factors and spatial parameters, the comprehensive evaluation problem of high-dimensional data of tight sandstone gas reservoirs is solved, and the fine characterization of residual gas types and the optimization of development solutions is achieved.

CN119167230BActive Publication Date: 2025-08-29SOUTHWEST PETROLEUM UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411209011.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-30
Publication Date
2025-08-29
Estimated Expiration
2044-08-30

AI Technical Summary

Technical Problem

Traditional numerical simulation and qualitative analysis methods cannot comprehensively evaluate the high-dimensional data of tight sandstone gas reservoirs, and the K-means algorithm cannot meet the requirements of forming various types of residual gas blocks, resulting in high development difficulty and low final recovery.

Method used

The improved dynamic fine-grained K-means recursive algorithm is used, combined with the main control factors and spatial parameters of the grid, and through normalization processing and iterative optimization, each grid is dynamically searched to form regional blocks with high residual gas, medium residual gas and low residual gas.

Benefits of technology

A comprehensive evaluation of high-dimensional data of tight sandstone gas reservoirs has been achieved, and the careful characterization of residual gas type distribution has been improved, and the theoretical basis for reservoir wells and strata has been provided, which has improved the accuracy and efficiency of development.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119167230B_ABST
    Figure CN119167230B_ABST
Patent Text Reader

Abstract

The present invention discloses a method for the distribution of residual gas types in tight sandstone reservoirs based on a dynamic fine-grained K-means recursive algorithm. The method obtains the main influencing factors affecting the residual gas of each grid at time t of the tight gas reservoir; takes the main influencing factors on all grids as input, uses K-means to perform unsupervised learning on all grids through the main controlling factors, and labels them; then uses a new algorithm, the dynamic fine-grained K-means recursive algorithm, to incorporate the spatial coordinate parameters of the grid, set a threshold, and dynamically recursively search for the area where the residual gas is formed in each grid, characterizing the area with high residual gas, the area with medium residual gas, and the area with low residual gas, and finally obtaining the residual gas type distribution of each layer. The new method for determining the residual gas distribution type proposed by the present invention can process multiple types of dynamic and static data, and can dynamically analyze the residual gas, perform unsupervised learning and recursion through the main controlling factors, solve the residual gas distribution type, and provide a basis for subsequent potential tapping measures.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of unconventional natural gas development and tight sandstone residual gas type distribution, and specifically provides a method for tight sandstone reservoir residual gas type distribution based on a dynamic fine-grained K-means recursive algorithm. Background Art

[0002] With the growth of global energy demand and the increasing depletion of conventional oil and gas resources, tight gas has become a key area for the development of unconventional natural gas resources. Widely distributed across major oil and gas basins worldwide, tight gas has, in recent years, become the primary source of global natural gas reserve and production growth. Tight sandstone gas reservoirs are characterized by poor physical properties and complex reservoir spaces, including low porosity and permeability and poor fracture development. This makes development challenging, ultimately leading to low recovery rates. Localized enrichment of residual gas is also difficult to characterize in detail. Traditional numerical simulation and qualitative analysis methods, when faced with large amounts of drilling, production, and development data, can only unilaterally evaluate residual gas using a subset of the data and are unable to comprehensively evaluate high-dimensional data. With the development of artificial intelligence, machine learning methods have demonstrated excellent nonlinearity, self-learning, adaptability, and fault tolerance. They can handle diverse, dynamic, and static data, quantitatively determine residual gas distribution types, and dynamically analyze residual gas, providing new approaches for determining residual gas distribution types.

[0003] The K-means algorithm is an iterative, unsupervised analysis algorithm. Its core concept is to divide n objects in a dataset into K clusters, minimizing the sum of the distances from each object to the center of its cluster. It iteratively optimizes the clustering results, ensuring that objects within each cluster are as close together as possible and objects in different clusters are as separate as possible. The advantages of this algorithm are its intuitive nature, fast computational speed, and ease of implementation. However, it also has some limitations, such as sensitivity to the choice of initial cluster centroids, the potential for falling into local optimal solutions, and the requirement to predetermine the number of clusters, K. Furthermore, the K-means algorithm cannot meet the requirements for forming various types of residual gas regional blocks.

[0004] Therefore, the K-means algorithm was improved and enhanced. After unsupervised learning using K-means, all grids were labeled. Then, the controlling factors and spatial parameters of each grid were incorporated, thresholds were set, and a dynamic recursive search was performed on each grid to form blocks with different residual gas types. These blocks were then delineated to identify areas with high, medium, and low residual gas content. Ultimately, the residual gas distribution patterns in tight sandstone gas reservoirs were determined. This provided a theoretical basis for later addition of wells and opening of reservoir layers. Summary of the Invention

[0005] Existing technologies either evaluate residual gas from a unilateral perspective, failing to achieve comprehensive evaluation of high-dimensional data, or failing to meet the requirements for forming regional blocks of various residual gas types. The present invention aims to provide a method for distributing residual gas types in tight sandstone reservoirs based on an improved K-means algorithm—a dynamic fine-grained K-means recursive algorithm. This method aims to address the problem of using factors influencing residual gas to form regional blocks of various residual gas types when faced with high-dimensional data from tight sandstone gas reservoirs.

[0006] In order to solve the above problems, the present invention specifically provides the following technical solutions:

[0007] The improved K-means algorithm—dynamic fine-grained K-means recursive algorithm—is applied to the distribution of remaining gas types in tight sandstone reservoirs. The implementation steps are as follows:

[0008] Step S1: Obtain the main controlling factors affecting the residual gas of each grid at time t, and construct a grid feature dataset; that is, given the grid dataset A at time t i ={x i ;y i ;z i ;h i ;p fi ;Ω gi ; G i}where the spatial parameter coordinate set is F i ={x i ;y i ;z i}, the main control factor set is M i ={h i ;p fi ;Ω gi ; G i}, then A i ={F i ;M i};

[0009] Where i is the i-th grid (i=1,2,...,n); x i is the x-axis coordinate of the i-th grid; y i is the y-axis coordinate of the i-th grid; z i is the z-axis coordinate of the i-th grid; h i is the effective thickness of the i-th grid (m); p fi is the formation pressure of the i-th grid (MPa); Ω gi is the abundance of the ith grid (m 3 / m 2 );G i is the residual gas of the ith grid (10 8 m 3 );

[0010] Step S2: take the main control factors on all grids as input and use K-means to cluster all grids by the main control factors; for a given dataset M of the i-th grid i ={h i ;p fi ;Ω gi ; G i} to perform normalization processing to improve the quality and stability of clustering results. The specific formula is as follows:

[0011]

[0012] Where, l i is the original data of a certain type of data in grid i; l i * is the normalized data of a certain type of data in grid i; l min is the minimum value of this type of data; l max The maximum value of this type of data;

[0013] Step S3: Divide all grids into k sets Calculate the center of each set Solve the following formula for the goal:

[0014]

[0015] Where, The minimum value of the sum of the distances from all data to their respective cluster centers;

[0016] Step S4: Calculate the distance between each grid and each cluster center, and assign each grid to the cluster center closest to it. i and cluster centers Distance, the specific formula is as follows:

[0017]

[0018] Step S5: Recalculate the cluster center of each cluster The specific formula is as follows:

[0019]

[0020] Where, is a cluster with p samples;

[0021] Step S6: Repeat steps S4 to S5 until the partitioning stops changing or the maximum number of iterations is reached, and the cluster is obtained. Different colors are assigned to grids in different clusters, denoted as Where i→j means that the i-th cluster corresponds to the j-th color;

[0022] Step S7: Add the coordinate set parameter F to the cluster obtained by clustering i ={x i ;y i ;z i Get a new dataset Continue recursively on this basis;

[0023] Step S8: Data set W i The categories within a certain distance of a grid in are counted, and the dataset W i Now there are n samples, each grid corresponds to a category The training data set W i It can be expressed as:

[0024]

[0025] p i =(x i ,y i ,z i )

[0026] The distance between any two points is:

[0027]

[0028] For any point p i Now, its ε neighborhood is defined as:

[0029] N ε ={p i ∈W i |dist<ε}

[0030] Where, dist<ε means the distance is less than ε;

[0031] Step S9: Data set W i Count the other grid categories in a grid area, and re-assign the grid category by checking whether the number of other categories in the grid area is ≥ 80%, until all grids are recursively completed;

[0032] Step S10: Divide the residual gas into three categories: reservoirs with high residual gas, reservoirs with medium residual gas, and reservoirs with low residual gas, and finally obtain the residual gas type distribution of each layer in the tight gas reservoir.

[0033] As a further description of the above technical solution:

[0034] The main controlling factors include: permeability, porosity, depth, formation pressure, gas saturation, gas mass density, remaining gas volume, reserve abundance and effective thickness.

[0035] As a further description of the above technical solution:

[0036] Two machine learning methods (XGBoost and Random Forest RF) and four statistical criteria were used for evaluation, and the importance ranking of factors affecting remaining gas was finally obtained. Through comprehensive analysis, reserve abundance, effective thickness and formation pressure were selected as the main controlling factors.

[0037] As a further description of the above technical solution:

[0038] The four statistical criteria include mean absolute error (MAE), mean relative error (MRE), root mean square error (RMSE) and coefficient of determination (R 2 ).

[0039] As a further description of the above technical solution:

[0040] The grid categories in step S9 also include grids without residual gas, so as to ensure that the number of grids within a certain distance of each grid is the same.

[0041] As a further description of the above technical solution:

[0042] The dataset W i The dataset is randomly divided into two parts: 80% training set and 20% test set.

[0043] As a further description of the above technical solution:

[0044] 80% of the training set is used to train XGBoost and Random Forest RF and determine their optimal hyperparameter values, while 20% of the test set is used to evaluate the stability and generalization ability of the constructed model in predicting data.

[0045] In summary, due to the adoption of the above technical solution, the present invention can achieve the following technical effects:

[0046] This method first identifies the primary factors influencing residual gas in each grid at time t, constructing a grid feature dataset. It then uses the primary influencing factors across all grids as input and clusters them using the K-means algorithm based on the primary controlling factors. Finally, using a new algorithm—a dynamic fine-grained K-means recursive algorithm—combined with the addition of spatial coordinate parameters to the grids, the residual gas is classified into three categories: high residual gas reservoirs, medium residual gas reservoirs, and low residual gas reservoirs. Ultimately, the residual gas type distribution for each layer in the tight gas reservoir is obtained. This method improves on the K-means algorithm by adding spatial coordinate parameters and recursively applying the algorithm to each grid within its neighborhood, increasing the rationality and interpretability of the results. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] Figure 1Flowchart of the present invention;

[0048] Figure 2 To invent and improve the K-means algorithm flowchart;

[0049] Figure 3 Fine-grained k-means clustering results (red, green, and blue correspond to high, medium, and low residual gas reservoirs);

[0050] Figure 4 Dynamic fine-grained K-means recursive result diagram (red, green, and blue correspond to high, medium, and low residual gas reservoirs);

[0051] Figure 5 Local magnified and enhanced contrast images of various locations on the third layer;

[0052] Figure 6 Local magnification and enhanced contrast images of various parts of the fourth layer. Specific implementation methods

[0053] In order to make the objectives, technical solutions and advantages of the present invention more clearly understood, the present invention is further illustrated below with reference to the accompanying drawings and embodiments. Obviously, the embodiments described are only some embodiments of the present invention, and the protection scope of the present invention is not limited to the specific embodiments disclosed below. For those skilled in the art, all other embodiments obtained without creative work are within the protection scope of the present invention.

[0054] A method based on the improved K-means algorithm - dynamic fine-grained K-means recursive algorithm applied to the distribution of remaining gas types in tight sandstone reservoirs, such as Figure 2 (Flowchart of the invented improved K-means algorithm), which includes the following steps:

[0055] Step S1: Obtain the main controlling factors affecting the residual gas of each grid at time t, and construct a grid feature dataset; that is, given the grid dataset A at time t i ={x i ;y i ;z i ;h i ;p fi ;Ω gi ; G i}where the spatial parameter coordinate set is F i ={x i ;y i ;z i}, the main control factor set is M i ={h i ;p fi ;Ω gi ; G i}, then Ai ={F i ;M i};

[0056] Where i is the i-th grid (i=1,2,...,n); x i is the x-axis coordinate of the i-th grid; y i is the y-axis coordinate of the i-th grid; z i is the z-axis coordinate of the i-th grid; h i is the effective thickness of the i-th grid (m); p fi is the formation pressure of the i-th grid (MPa); Ω gi is the abundance of the ith grid (m 3 / m 2 );G i is the residual gas of the ith grid (10 8 m 3 );

[0057] The main controlling factors include permeability, porosity, depth, formation pressure, gas saturation, gas mass density, remaining gas volume, reserve abundance and effective thickness. Two machine learning methods (XGBoost and random forest RF) and four statistical criteria (mean absolute error (MAE), mean relative error (MRE), root mean square error (RMSE) and coefficient of determination (R)) were used to predict the reservoir. 2 )) was evaluated and finally the importance ranking of factors affecting the remaining gas was obtained. Through comprehensive analysis, reserve abundance, effective thickness and formation pressure were selected as the main controlling factors.

[0058] Step S2: take the main control factors on all grids as input and use K-means to cluster all grids by the main control factors; for a given dataset M of the i-th grid i ={h i ;p fi ;Ω gi ; G i} to perform normalization processing to improve the quality and stability of clustering results. The specific formula is as follows:

[0059]

[0060] Where, l i is the original data of a certain type of data in grid i; l i * is the normalized data of a certain type of data in grid i; l min is the minimum value of this type of data; l max The maximum value of this type of data;

[0061] Step S3: Divide all grids into k sets Calculate the center of each set Solve the following formula for the goal:

[0062]

[0063] Where, The minimum value of the sum of the distances from all data to their respective cluster centers;

[0064] Step S4: Calculate the distance between each grid and each cluster center, and assign each grid to the cluster center closest to it. i and cluster centers Distance, the specific formula is as follows:

[0065]

[0066] Step S5: Recalculate the cluster center of each cluster The specific formula is as follows:

[0067]

[0068] Where, is a cluster with p samples;

[0069] Step S6: Repeat steps S4 to S5 until the partitioning stops changing or the maximum number of iterations is reached, and the cluster is obtained. Different colors are assigned to grids in different clusters, denoted as Where i→j means that the i-th cluster corresponds to the j-th color;

[0070] Step S7: Add the coordinate set parameter F to the cluster obtained by clustering i ={x i ;y i ;z i Get a new dataset Continue recursively on this basis;

[0071] Step S8: Data set W i The categories within a certain distance of a grid in are counted, and the dataset W i Now there are n samples, each grid corresponds to a category The training data set W i It can be expressed as:

[0072]

[0073] p i =(x i ,y i ,z i )

[0074] The distance between any two points is:

[0075]

[0076] For any point p i Now, its ε neighborhood is defined as:

[0077] N ε ={p i ∈W i |dist<ε}

[0078] Where, dist<ε means the distance is less than ε;

[0079] Step S9: Data set W i The other grid categories in a grid area are counted, and the grid category is reassigned according to whether the number of other categories in the grid area is ≥80% (the grid category also includes grids with no remaining gas to ensure that the number of grids within a certain distance of each grid is the same) until all grids are recursively completed; Dataset W i It is randomly divided into two parts: 80% training set and 20% test set, where 80% of the training set is used to train XGBoost and Random Forest RF and determine their optimal hyperparameter values, and 20% of the test set is used to evaluate the stability and generalization ability of the constructed model in predicting data.

[0080] Step S10: Divide the residual gas into three categories: reservoirs with high residual gas, reservoirs with medium residual gas, and reservoirs with low residual gas, and finally obtain the residual gas type distribution of each layer in the tight gas reservoir.

[0081] Example 1

[0082] This example uses a tight sandstone gas reservoir in a gas field as the implementation object. The reservoir is divided into six sub-layers, totaling 1.72 million effective grid cells. The main influencing factors of each grid cell: reserve abundance, effective thickness, and formation pressure are used as inputs. Combined with spatial coordinate parameters, the distribution of remaining gas types is recursively derived. These three characteristics are used as input parameters, and the output parameters are a map of the proportion of each reservoir type at each layer and the range of each main controlling factor (see Table 1):

[0083] Table 1 Grid coordinates and main control factors

[0084]

[0085] The dynamic fine-grained K-means recursive method is used to obtain the residual gas distribution type of each layer. First, all grids are divided into three sets Calculate the center of each set

[0086] Then use the formula:

[0087]

[0088] Calculate the distance from each grid to the center of each set and assign it to each set;

[0089] Then use the formula:

[0090]

[0091] Recalculate the center of the set Then, the grids are repeatedly allocated until the division no longer changes, that is, the minimum value of the following formula is obtained:

[0092]

[0093] And assign red, green and blue colors to the grids in the three sets.

[0094] Finally, each layer of the tight sandstone gas reservoir is divided into three categories: red, green, and blue. These are respectively for high remaining gas reservoirs: high reserve abundance, reservoir thickness, and slightly higher formation pressure; medium remaining gas reservoirs: medium reserve abundance, reservoir thickness, and medium formation pressure; and low remaining gas reservoirs: low reserve abundance, reservoir thickness, and slightly lower formation pressure. The results of clustering all grids by the main controlling factors are visualized as follows: Figure 3 ( Figure 3 The distribution of residual gas types in each layer is obtained using only the fine-grained K-means method. Although it can accurately determine the residual gas type, the fine-grained K-means method only labels each grid with a different color, and cannot form area labels in some areas.

[0095] The results show that after clustering the grid's main controlling factors using K-means, the remaining reserves of each layer are marked. The approximate distribution of remaining gas in each layer can be seen. The first and second layers are dominated by reservoirs with high remaining gas, while the remaining layers have a small number of reservoirs with low remaining gas. The third layer has a large number of reservoirs with high remaining gas, while the remaining reservoirs have a certain distribution. The fourth and fifth layers have almost no reservoirs with high remaining gas, and are dominated by reservoirs with medium remaining gas, with a small number of reservoirs with low remaining gas. The sixth layer has very little remaining gas.

[0096] On this basis, add the spatial coordinate parameters and use the formula:

[0097] N ε ={p i ∈W i |dist<ε}

[0098] Set the domain ε = 0.7m, count the number of grids of various colors in the grid domain, and if it is greater than or equal to 80% of the total number of grids in the domain, then assign it this color until all grids have completed the recursion. The result is as follows Figure 4 ( Figure 4 The dynamic fine-grained K-means recursive method, combined with the spatial coordinate parameters of each grid, can be used to show that the residual gas type results of each layer are clearer, and the location of the residual gas type can be better determined to facilitate the formulation of relevant potential tapping plans).

[0099] After dynamic fine-grained K-means recursion, the results are obviously clearer and more effective, and the location of residual gas can be accurately determined. The first and second layers are still dominated by high residual gas reservoirs, and the rest are a small number of low residual gas reservoirs with great development potential. They are areas that need to be developed. For the upper left area of ​​the first layer and the local areas of the second layer, there are more residual gas reserves, and more wells can be added, or for areas with large wells, this layer can be opened to increase the degree of exploitation. The third layer has more high residual gas reservoirs and medium residual gas reservoirs, with greater development potential. They are layers that can be developed. Wells can be added to the left middle and right middle positions of the third layer, and layers can be opened for other locations with more residual gas. The fourth and fifth layers are mostly medium-yield reservoirs, containing some low-yield reservoirs, with average development potential. Layers are mainly opened in places with medium residual gas, and there is no need to add wells. The sixth layer has very little residual gas, and basically no need to develop. The effect after recursion can be seen more clearly through the local enlarged comparison diagrams in the third and fourth layers (the results of comparing the three positions separately are shown as follows Figure 5 , compare the four positions separately and the results are as follows Figure 6 , Figure 5 and Figure 6 These are the magnified and enhanced comparison images of various locations in the third and fourth layers, which mainly classify the more dispersed remaining gas as a grid with no reserves during recursion, and recurse the grid based on the discrimination conditions. Finally, the average values ​​of each main controlling factor for the three types of remaining gas are obtained (see Table 2):

[0100] Table 2 Average values ​​of three types of residual gas

[0101]

[0102] The conclusion drawn through the fine-grained K-means recursive method is that the first and second layers have large remaining gas reserves and are the key reservoirs for development; the third layer has relatively large remaining gas reserves and needs to be developed in certain areas; the fourth and fifth layers have medium remaining gas reserves and have certain development value, and the sixth layer has no development value.

[0103] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.

Claims

1. A method for distributing remaining gas types in tight sandstone reservoirs based on a dynamic fine-grained K-means recursive algorithm is implemented as follows: Step S1: Obtain the main controlling factors affecting the residual gas of each grid at time t in dense gas, and construct a grid feature dataset; that is, given the grid dataset A at time t i ={x i ;y i ;z i ;h i ;p fi ;Ω gi ; G i }where the spatial parameter coordinate set is F i ={x i ;y i ;z i }, the main control factor set is M i ={h i ;p fi ;Ω gi ; G i }, then A i ={F i ;M i }; Where i is the i-th grid i=1,2,...,n; x i is the x-axis coordinate of the i-th grid; y i is the y-axis coordinate of the i-th grid; z i is the z-axis coordinate of the i-th grid; h i is the effective thickness m of the i-th grid; p fi is the formation pressure of the i-th grid in MPa; Ω gi is the abundance m of the i-th grid 3 / m 2 ; G i is the remaining gas of the i-th grid 10 8 m 3 ; Step S2: take the main control factors on all grids as input and use K-means to cluster all grids by the main control factors; for a given dataset M of the i-th grid i ={h i ;p fi ;Ω gi ; G i } to perform normalization processing to improve the quality and stability of clustering results. The specific formula is as follows: Where, l i is the original data of a certain type of data in grid i; l i * is the normalized data of a certain type of data in grid i; l min is the minimum value of this type of data; l max It is the maximum value of this type of data; Step S3: Divide all grids into k sets Calculate the center of each set Solve the following formula for the goal: Where, The minimum value of the sum of the distances from all data to their respective cluster centers; Step S4: Calculate the distance between each grid and each cluster center, and assign each grid to the cluster center closest to it. i and cluster centers Distance, the specific formula is as follows: Step S5: Recalculate the cluster center of each cluster The specific formula is as follows: Where, is a cluster with p samples; Step S6: Repeat steps S4 to S5 until the partitioning stops changing or the maximum number of iterations is reached, and the cluster is obtained. Different colors are assigned to grids in different clusters, denoted as Where i→j means that the i-th cluster corresponds to the j-th color; Step S7: Add the coordinate set parameter F to the cluster obtained by clustering i ={x i ;y i ;z i Get a new dataset Continue recursively on this basis; Step S8: Data set W i The categories within a certain distance of a grid in are counted, and the dataset W i Now there are n samples, each grid corresponds to a category The training data set W i Expressed as: p i =(x i ,y i ,z i ) The distance between any two points is: For any point p i Now, its ε neighborhood is defined as: N ε ={p i ∈W i |dist<ε} In the formula, dist<ε means the distance is less than ε; Step S9: Data set W i Count the other grid categories in a grid area, and re-assign the grid category by checking whether the number of other categories in the grid area is ≥ 80%, until all grids are recursively completed; Step S10: Divide the residual gas into three categories: reservoirs with high residual gas, reservoirs with medium residual gas, and reservoirs with low residual gas, and finally obtain the residual gas type distribution of each layer in the tight gas reservoir.

2. The method for distributing remaining gas types in tight sandstone reservoirs based on a dynamic fine-grained K-means recursive algorithm according to claim 1, characterized in that: The main controlling factors include: permeability, porosity, depth, formation pressure, gas saturation, gas mass density, remaining gas volume, reserve abundance and effective thickness.

3. The method for distributing remaining gas types in tight sandstone reservoirs based on a dynamic fine-grained K-means recursive algorithm according to claim 2, characterized in that: Two machine learning methods, XGBoost and Random Forest RF, and four statistical criteria were used for evaluation, and the importance ranking of factors affecting remaining gas was finally obtained. Through comprehensive analysis, reserve abundance, effective thickness and formation pressure were selected as the main controlling factors.

4. The method for distributing remaining gas types in tight sandstone reservoirs based on a dynamic fine-grained K-means recursive algorithm according to claim 3, characterized in that: The four statistical criteria include mean absolute error (MAE), mean relative error (MRE), root mean square error (RMSE), and coefficient of determination (R). 2 .

5. The method for distributing remaining gas types in tight sandstone reservoirs based on a dynamic fine-grained K-means recursive algorithm according to claim 1, characterized in that: The grid categories in step S9 also include grids without residual gas, so as to ensure that the number of grids within a certain distance of each grid is the same.

6. The method for distributing remaining gas types in tight sandstone reservoirs based on a dynamic fine-grained K-means recursive algorithm according to claim 5, characterized in that: The dataset W i The dataset is randomly divided into two parts: 80% training set and 20% test set.

7. The method for distributing remaining gas types in tight sandstone reservoirs based on a dynamic fine-grained K-means recursive algorithm according to claim 6, characterized in that: 80% of the training set is used to train XGBoost and Random Forest RF and determine their optimal hyperparameter values, while 20% of the test set is used to evaluate the stability and generalization ability of the constructed model in predicting data.