Method for extracting influence characteristics of well cementation quality of oil and gas well

By extracting and analyzing the influence characteristics of cementing quality of oil and gas wells, combining Pearson's correlation coefficient method and XGBoost algorithm, the problem of traditional cementing quality analysis being limited by artificial experience and geological conditions is solved, and a more accurate and efficient cementing quality evaluation is achieved.

CN119884715APending Publication Date: 2025-04-25SOUTHWEST PETROLEUM UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510039323.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-10
Publication Date
2025-04-25

AI Technical Summary

Technical Problem

Traditional analysis of factors affecting cementing quality is limited by artificial experience and different geological conditions, so it is difficult to establish an evaluation model with good correlation with oil and gas well cementing quality.

Method used

A cementing quality impact feature extraction method is used for oil and gas well cementing quality, including obtaining on-site cementing data, data preprocessing, Pearson correlation coefficient analysis and XGBoost algorithm to construct a cementing quality evaluation model to extract and analyze the characteristics that affect cementing quality.

Benefits of technology

This method visually explains the relationship between influencing factors, improves the accuracy and interpretability of cementing quality evaluation, and provides a more theoretical and efficient analysis solution.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119884715A_ABST
    Figure CN119884715A_ABST
Patent Text Reader

Abstract

The invention provides an oil and gas well cementation quality influence feature extraction method, which comprises the following steps of: obtaining influence factors of a well cementation project and a related data set of cementation quality of a second interface of well cementation, screening and preprocessing the obtained data set to obtain effective information which can be identified by a model, then Pearson correlation analysis is carried out on the data set, and the correlation of main control factors influencing the well cementation quality and the influence of well cementation characteristics on the second interface cementation quality is analyzed; according to the method, the Pearson correlation analysis is adopted to obtain correlation analysis and importance score sorting of the well cementation quality influence factors, the accuracy of the model and analysis of influence characteristics are better ensured by combining the dimension reduction method of the two score analysis influence factors, and meanwhile, the accuracy of the well cementation quality influence factors is improved. A traditional recognition method for well cementation quality influence factors is difficult to consider the relationship among the influence factors, but through Pearson correlation analysis, the influence factors are analyzed, and meanwhile, the mutual influence among the influence factors is also considered.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of oil and gas well cementing, and in particular relates to a method for extracting characteristics affecting the quality of oil and gas well cementing. Background Art

[0002] Cementing is a key link in the drilling process of oil and gas wells. Its purpose is to put a rigid casing into the drilled wellbore and replace cement slurry in the annular space between the casing and the formation. The solidified cement ring is bonded with the casing and the formation to isolate the underground oil, gas and water layers. The quality of cementing mainly depends on the bonding strength of the second interface (i.e. the interface between the cement ring and the formation).

[0003] The quality of cementing is affected by many factors, including geological factors, drilling factors and cementing factors. These factors are interrelated and restricted, making it difficult to establish a cementing quality evaluation system under multiple conditions. The traditional analysis of cementing influencing factors is mainly based on the long-term experience of experimenters, which is often limited by the limited amount of data and the impact of different geology on cementing results. In the complex and changeable underground environment, experience is difficult to effectively provide accurate improvement methods, and it will consume a lot of manpower, material and financial resources, making it difficult to accurately judge the factors affecting cementing.

[0004] Therefore, it is difficult to establish an evaluation model with good correlation with the cementing quality of oil and gas wells using existing methods. Summary of the invention

[0005] The purpose of the present invention is to solve the defects of the above-mentioned prior art and provide a method for extracting characteristics affecting the cementing quality of oil and gas wells, so as to solve the problem that the traditional analysis of factors affecting cementing quality is limited by traditional manual experience and the influence of different geological conditions.

[0006] The present invention adopts the following technical solution: A method for extracting characteristics affecting the cementing quality of oil and gas wells comprises the following steps: Step 1. Obtain the field cementing data set; Obtain the factors affecting cementing quality and the second interface bonding quality results of cementing; Step 2. Preprocess cementing data; Data encoding, data deletion and missing value filling are performed, and finally data standardization is performed; if the sample imbalance in the data set significantly affects the model construction, the random oversampling method is used to solve it; Step 3. Analyze the data set using the Pearson correlation coefficient method; (1) Determine the target variable to be analyzed and divide the data set into independent variables and dependent variables; (2) Calculate the Pearson correlation coefficient (r value) and significance level (p value) between each independent variable and the dependent variable, analyze the linear relationship between the independent variables, and draw the correlation coefficient matrix; Step 4. Correlation analysis between features (1) Based on the data set, the Pearson correlation coefficient and significance level are obtained, and the correlation coefficient matrix is ​​analyzed. Scatter plots and heat maps are used to comprehensively evaluate the correlation between features. (2) The Pearson correlation coefficient is used to represent the correlation between each feature and the target variable, and the significance level is used to measure the degree of correlation between the two. (3) Analyze the correlation between the characteristics that affect cementing quality. The correlation coefficients between the characteristics are visualized to obtain a heat map. The degree of correlation between different variables is intuitively represented by the depth and change of colors, making the complex data relationship clear at a glance. Step 5. Processing of relevant factors and feature extraction (1) A cementing quality evaluation model was constructed based on the XGBoost algorithm. The data set was divided into a training set and a validation set in a ratio of 8:2. The training set was used for model training, and the validation set was used to measure the model prediction effect. (2) The cementing quality is divided into three levels: "good cementation", "medium cementation" and "poor cementation", so it belongs to a three-classification problem.

[0007] (3) Through comprehensive analysis of the correlation between features, consider the dimensionality reduction of features. Assuming that feature 1 and feature 2 have a strong correlation, and the importance of feature 2 is greater than that of feature 1, three processing methods are considered: no processing, deleting feature 1, and deleting feature 1 and feature 2. By comparing the impact of the three methods on the accuracy of the model, we can get processing suggestions for similar data.

[0008] Furthermore, in step 2, the text data is converted into numerical data through data encoding, and samples with more missing feature data in the data set are deleted, and samples with less missing feature data are filled with samples from wells in the same block, and finally data standardization is performed.

[0009] Furthermore, the correlation coefficient matrix in step (2) of step three is calculated by the Pearson algorithm. By comprehensively analyzing the Pearson correlation coefficient and the significance level, the main controlling factors affecting the cementing quality characteristics are obtained, thereby performing key control over the cementing process.

[0010] Pearson correlation coefficient The value range is ,when When the value is greater than 0, it indicates that the increase of this feature has a promoting effect on the target variable; when When the value is less than 0, it indicates that the increase of this feature has an inhibitory effect on the target variable. At the same time, we must also consider The value is a measure of the relationship between the two. If the value is less than the preset significance level, the correlation coefficient is considered significant, otherwise it is considered that there is no significant correlation between the two. The value is calculated as follows: in and and Represent the influencing features and target variables respectively. All data are sample data. represents the sample covariance, express The sample standard deviation of represents the sample standard deviation of Y, represents the mean of the sample; The value is constructed by constructing a new statistic To measure, among which is the calculated Pearson correlation coefficient, is the number of samples, this statistic is shown to be consistent with the degrees of freedom of The distribution of Distribution to test the correlation; exist In the test, the null hypothesis is proposed and the alternative hypothesis , input the data to obtain the test value, and give a confidence level (usually 95%, or 90%, or 99%) according to the distribution of the data; if If the value is greater than the confidence level, then the null hypothesis is accepted at the confidence level; otherwise, the null hypothesis is rejected at the confidence level.

[0011] Furthermore, step (2) in step 5, combined with engineering practice, shows that appropriately increasing the density of the pre-fluid is beneficial to improving the displacement efficiency of the cement slurry for the drilling fluid, thereby improving the cementing quality, while too high a drilling fluid viscosity may affect the uniform distribution of the cement slurry in the annulus, thereby affecting the cementing quality.

[0012] Furthermore, in step (2) of step five, when establishing a cementing quality evaluation model using the XGBoost algorithm based on the model prediction accuracy, only two features with weak correlation need to be deleted, and the model accuracy is better. If all are deleted, the model accuracy is insufficient. When two features with strong correlation are used as model input at the same time, it will cause repeated use of variables and data redundancy, which increases the amount of calculation and also affects the accuracy.

[0013] Beneficial effects of the present invention: 1. The cementing quality influencing factor evaluation method of the present invention obtains, processes and analyzes cementing data, combined with Pearson correlation analysis, so as to visually interpret the influencing factors. Compared with the traditional cementing quality factor analysis method, this method has stronger theoretical and interpretability, and can better reveal the relationship between various factors through the quantitative expression of the relationship. At the same time, this method can also provide a reliable and efficient analysis solution for engineering practice.

[0014] 2. The present invention not only quantitatively expresses the relationship between the influencing factors and the cementing quality results, but also outputs the relationship between the influencing factors, which is suitable for the case where the data in the project is complex and the relationship is unclear. For the case where there is a strong correlation between the influencing factors in the engineering data set, the present invention also provides a more feasible processing solution, which can effectively improve the calculation efficiency and model accuracy.

[0015] 3. The present invention uses the XGBoost machine learning model to predict cementing quality and explores the problem of how to handle correlated features as model input, thereby ensuring the accuracy of the model without increasing the difficulty of calculation. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] Figure 1 The overall flow chart provided by the present invention; Figure 2 A Pearson correlation analysis diagram provided by an embodiment of the present invention; Figure 3 A Pearson correlation coefficient score graph provided by an embodiment of the present invention; Figure 4 A heat map of feature correlation analysis provided by an embodiment of the present invention; Figure 5 is the confusion matrix of the model when the features are not deleted provided by the embodiment of the present invention; Figure 6 is the confusion matrix of the model when two features are deleted provided by the embodiment of the present invention; Figure 7 It is the confusion matrix of the model when four features are deleted provided by the embodiment of the present invention. DETAILED DESCRIPTION

[0017] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention is described clearly and completely below. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0018] Example like Figure 1 As shown, a method for extracting characteristics affecting cementing quality of oil and gas wells of the present invention comprises the following steps: Step 1. Obtain field cementing dataset As shown in Table 1, this embodiment selects cementing data obtained from field construction of DG Oilfield from 2016 to 2021, with a total of 683 samples. The required 19 influencing factors and 1 cementing quality target variable are obtained from the samples. 19 is the influencing factor, F 20 is the target variable.

[0019] Table 1 List of factors affecting cementing quality The features in Table 1 have been strictly screened to ensure their criticality in the analysis of factors affecting cementing quality. The 19 features play a key role in affecting cementing quality and cover three aspects: geology, drilling, and cementing. They aim to enhance the interpretability of the features and make them more adaptable to complex and changing engineering environments. Quantitative analysis of the main controlling factors not only helps to better understand the factors affecting cementing quality, but also provides a reference for engineering.

[0020] Step 2. Preprocess cementing data The text data in cementing data are converted into numerical data, and then data deletion and filling operations are performed to delete samples with more missing values, and then fill them with the mean of the same well to maintain data integrity. Finally, the data is standardized to ensure that each feature has a unified measurement unit and value range to improve the readability and accuracy of the data set. After preprocessing the original data set, 11 abnormal samples were deleted, and 672 cementing data samples remained, of which 273 samples had a high-quality section rate greater than 85%, that is, 273 samples with good cementation, 192 samples with medium cementation, and 207 samples with poor cementation. The data distribution of the three categories is relatively uniform, so there is no need to oversample the data.

[0021] Step 3: Analyze the data set using the Pearson correlation coefficient method This invention , represents a data set containing N oil wells, Represents the feature vector corresponding to the i-th well ,in Corresponding to the characteristics listed in Table 1 , the cementing characteristics can be expressed as ,in represents the well data under the nth feature, Where n is the dimension of the feature vector. In this embodiment, it is necessary to calculate the feature and Pearson correlation coefficient and significance level between The correlation between them.

[0022] The calculation formula of Pearson correlation coefficient r is as follows: in in and , Represents the impact characteristics With the target variable , X represents the influencing feature, Y represents the target variable, and all data are sample data. represents the sample covariance, express The sample standard deviation of represents the sample standard deviation of Y, Represents the sample mean.

[0023] The value is constructed by constructing a new statistic To measure. is the calculated Pearson correlation coefficient, is the number of samples, this statistic is shown to be consistent with the degrees of freedom of The distribution of The corresponding Value, according to the sample size Each influencing feature can be calculated separately Value, where The value is used for hypothesis testing of the correlation coefficient and is calculated After the value is The cumulative distribution function of the distribution is calculated as value.

[0024] Step 4. Correlation analysis between features Based on the Pearson correlation results obtained from the data set analysis, we can Value and The correlation between the two values ​​is comprehensively analyzed, such as Figure 2 As shown. Through scatter plots and linear regression, we can clearly observe the relationship between each feature variable and the target variable, such as Figure 3 , visualize the correlation between feature variables and target variables. The "lollipop chart" can clearly show the features that are most closely related to the target variable, thus helping us analyze the feature variables. From the basic trend of the linear regression line, most features show a relatively gentle linear relationship with the target variable, that is, weak correlation. The absolute value of F4 is the largest. At the same time, the significance level of F4 feature The value is the smallest among all the features, which indicates that there is a strong positive correlation between the ratio of the pre-fluid volume to the sealing section volume and the target variable ( =0.142, <0.05), which means that appropriately increasing the amount of pre-fluid is beneficial to improving the displacement efficiency of cement slurry to drilling fluid, thereby improving the cementing quality. It is worth noting that the F9 feature is negatively correlated with the target variable ( =-0.077, <0.05), indicating that too high drilling fluid viscosity coefficient may affect the uniform distribution of cement slurry in the annulus, thereby reducing the cementing quality. Therefore, when configuring prefabricated fluid, it is necessary to consider the impact of viscosity on cementing quality from many aspects. In addition to the F4 feature, F9, F 16 、F 19 It also shows a relatively significant correlation, and the scatter plot also shows a relative clustering. Figure 3 , the correlation coefficient scores of these characteristics are also relatively high. Therefore, in engineering practice, the influence of these characteristics on cementing quality can be given priority.

[0025] like Figure 4 Considering the uncertainty among the factors affecting cementing engineering, the present invention also analyzes the correlation between characteristic variables. 10 The correlation between them reached 0.44, that is, there is a strong positive correlation between the viscosity coefficient of the drilling fluid before cementing and the dynamic shear force of the drilling fluid before cementing. Increasing the viscosity coefficient will lead to an increase in the viscosity of the drilling fluid, which will increase the internal resistance and may increase the dynamic shear force of the drilling fluid at the same time. Therefore, the dynamic shear force can be controlled by adjusting the viscosity of the drilling fluid during drilling operations. Feature F 12 and F 13The correlation is 0.35, that is, the maximum oil and gas rushing speed will be affected to a certain extent by the oil and gas rushing speed before cementing. The oil and gas rushing speed before cementing is also a speed indicator that needs special attention before cementing operations to ensure the smooth progress of cementing operations and the stability of the wellbore. Strict control of the speed can also be used to prevent the occurrence of complex situations such as well kicks and overflows. Feature F 17 and F 19 The correlation between them reached -0.43, that is, there is a certain negative correlation between the proportion of small-displacement displacement and the well depth. Due to the depth of deep oil and gas wells, the geological conditions are far more complicated than those on the ground. Many factors may lead to the deeper the well, the smaller the proportion of small-displacement displacement.

[0026] Step 5. Processing of relevant factors and feature extraction Comprehensive analysis of related factors, F9 and F 10 、F 17 With F 19 There is a strong correlation between F9 and F 19 The correlation with the target variable is stronger. Choose three ways to process these four features: ① Do not delete these four features. ② Delete F 10 and F 17 ③ Delete these four features, and the model confusion matrix corresponding to the three methods is as follows Figure 5-Figure 7 ,The accuracy is shown in Table 2, where “0” represents “good bonding”, “1” represents “medium bonding”, and “2” represents “poor bonding”.

[0027] Table 2 Model index parameters of three methods of processing features As shown in Table 2, the cementing quality evaluation model was established using the XGBoost algorithm. In this embodiment, all parameters used the default values. The highest prediction accuracy of the model reached 0.84, and the lowest was only 0.65. The two feature processing methods had a significant impact on the model prediction effect. At the same time, it can be seen that the model has the worst prediction effect for the "poor cementation" category, and the prediction effects of the "good cementation" and "medium cementation" categories are comparable. Figure 5-Figure 7 . When two features with weaker correlation are deleted, the model accuracy is the highest, and when all are deleted, the model accuracy drops sharply. It can be considered that when two features with strong correlation are used as model input at the same time, it may cause the reuse of variables and data redundancy. This process not only increases the amount of calculation, but also affects the accuracy of the model. Therefore, this embodiment believes that when extracting features from a data set, it is necessary to first consider deleting redundant features with weaker correlation. By iterating the features, the generalization ability of the model can be guaranteed while reducing the amount of calculation.

[0028] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for extracting characteristics affecting the cementing quality of oil and gas wells, characterized in that: The following steps are involved: Step 1. Obtain field cementing dataset Obtain the factors affecting cementing quality and the cementing quality results of the second interface of cementing; Step 2. Preprocess cementing data Carry out data coding, data deletion and missing value filling, and finally perform data standardization; If the sample imbalance in the data set significantly affects the model construction, the random oversampling method is used to solve it; Step 3. Analyze the data set using the Pearson correlation coefficient method (1) Determine the target variable to be analyzed and divide the data set into independent variables and dependent variables; (2) Calculate the Pearson correlation coefficient between each independent variable and the dependent variable Value and significance level Values, and analyze the linear relationship between each independent variable, and draw the correlation coefficient matrix; Step 4. Correlation analysis between features (1) Based on the data set, the corresponding Pearson correlation coefficient and significance level are obtained, and the correlation coefficient matrix is ​​analyzed. The correlation between features is comprehensively evaluated using scatter plots and heat maps; (2) The Pearson correlation coefficient is used to represent the correlation between each feature and the target variable, and the significance level is used to measure the degree of correlation between the two. (3) Analyze the correlation between the characteristics that affect cementing quality. The correlation coefficients between the characteristics are visualized to obtain a heat map. The depth and change of colors are used to intuitively represent the correlation between different variables, making the complex data relationship clear at a glance. Step 5. Processing of relevant factors and extraction of features (1) A cementing instruction evaluation model was constructed based on the XGBoost algorithm. The data set was divided into a training set and a validation set in a ratio of 8:

2. The training set was used for model training, and the validation set was used to measure the model prediction effect. (2) The cementing quality is divided into three levels according to the high-quality section rate: "good cementation", "medium cementation" and "poor cementation", so it belongs to a three-classification problem; (3) Through comprehensive analysis of the correlation between features, consider the dimensionality reduction of features. Assuming that feature 1 and feature 2 have a strong correlation, and the importance of feature 2 is greater than that of feature 1, three processing methods are considered: no processing, deleting feature 1, and deleting feature 1 and feature 2. Compare the effects of the three methods on the model accuracy to obtain processing suggestions for similar data.

2. The method according to claim 1, characterized in that In step 2, text data is converted into numerical data through data encoding, samples with more missing feature data in the data set are deleted, and samples with fewer missing features are filled with well samples from the same block, and finally data standardization is performed.

3. The method according to claim 1, characterized in that Step (2) in step three also includes: obtaining the main control factors affecting the cementing quality characteristics by comprehensively analyzing the Pearson correlation coefficient and the significance level, so as to perform key control on the cementing process; Pearson correlation coefficient The value range is ,when When the value is greater than 0, it indicates that the increase of this feature has a promoting effect on the target variable; when When the value is less than 0, it indicates that the increase of this feature has an inhibitory effect on the target variable. At the same time, we must also consider The value is a measure of the relationship between the two. If the value is less than the preset significance level, the correlation coefficient is considered significant, otherwise it is considered that there is no significant correlation between the two. The value is calculated as follows: in and and Represent the influencing features and target variables respectively. All data are sample data. represents the sample covariance, express The sample standard deviation of represents the sample standard deviation of Y, represents the mean of the sample; The value is constructed by constructing a new statistic To measure, among which is the calculated Pearson correlation coefficient, is the number of samples, this statistic is shown to be consistent with the degrees of freedom of The distribution of Distribution to test the correlation; exist In the test, the null hypothesis is proposed and the alternative hypothesis , bring in the data to get the test value, and give the confidence level according to the distribution of the data. If If the value is greater than the confidence level, then the null hypothesis is accepted at the confidence level; otherwise, the null hypothesis is rejected at the confidence level.

4. The method according to claim 1, characterized in that Step five also includes: when applied to actual engineering, appropriately increasing the density of the forefluid is beneficial to improving the displacement efficiency of cement slurry for drilling fluid, thereby improving the cementing quality; adjusting the viscosity of the drilling fluid so that its viscosity is not too high to avoid affecting the uniform distribution of cement slurry in the annulus, thereby affecting the cementing quality; when using the XGBoost algorithm to establish a cementing quality evaluation model, only two features with weak correlation need to be deleted, and the model accuracy is better. If all are deleted, the model accuracy is insufficient. When two features with strong correlation are used as model input at the same time, it will cause repeated use of variables and data redundancy, which increases the amount of calculation and also affects the accuracy.