Physical and machine learning fused drilling overflow diagnosis method

Through the fusion of physics and machine learning methods, a pore pressure equivalent density prediction model and overflow machine learning diagnostic model are established, and adaptive weight fusion is carried out, which solves the complexity and dependence problems of traditional drilling overflow diagnosis methods and achieves efficient and accurate overflow diagnosis.

CN120124003APending Publication Date: 2025-06-10CHANGZHOU UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510041096.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-10
Publication Date
2025-06-10

AI Technical Summary

Technical Problem

Traditional drilling overflow diagnostic methods have problems such as complex calculations, poor versatility, time lag and experience-dependent, making it difficult to provide early diagnosis and effective utilization of drilling parameters.

Method used

Using a fusion method of physical and machine learning, a regression model for pore pressure equivalent density prediction and a machine learning diagnosis model for drilling overflow are established, and an adaptive weight fusion process is carried out to achieve overflow diagnosis.

Benefits of technology

It improves the efficiency and accuracy of overflow diagnosis, enhances the mechanism and interpretability of the model, and can deal with overflow risks in complex drilling processes while ensuring diagnostic efficiency and accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120124003A_ABST
    Figure CN120124003A_ABST
Patent Text Reader

Abstract

The invention provides a physical and machine learning fused well drilling overflow diagnosis method, which comprises the following steps: acquiring well drilling engineering parameter data of a plurality of drilled wells in the actual drilling process, and carrying out data preprocessing to obtain standard well drilling engineering parameter data, the preprocessing comprising overflow target feature setting, target feature coding and data cleaning processing; according to the relationship between the well depth and the pore pressure equivalent density in the standard drilling engineering parameter data corresponding to the current block, establishing a regression model for predicting the pore pressure equivalent density, and generating a first overflow diagnosis result; performing model training based on the feature analysis result of the standard drilling engineering parameter data to obtain a drilling overflow machine learning diagnosis model, and generating a second overflow diagnosis result; and carrying out analysis and adaptive weight fusion processing on the first overflow diagnosis result and the second overflow diagnosis result to obtain an overflow fusion diagnosis result. According to the method disclosed by the invention, the mechanism property and the interpretability are enhanced on the premise of ensuring the diagnosis efficiency and accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of drilling in oil and gas engineering, and particularly to a method for diagnosing drilling overflow by integrating physics and machine learning. Background Art

[0002] Drilling engineering is an extremely complex underground drilling operation, full of concealment and uncertainty. For oil and gas resources with complex geological environments, such as offshore and ultra-deep reservoirs, as the drilling depth increases, under complex conditions such as high temperature and high pressure, and narrow safety density windows, the well control risk is prominent, and downhole complex situations occur frequently, posing multiple challenges in terms of drilling efficiency, risk, and cost. Overflow is one of the common complex situations in the drilling process. During drilling, when the density of the drilling fluid is less than the density of the formation fluid and cannot balance the pressure of the formation fluid, it will cause the bottom hole pressure to be less than the formation pressure, and fluids such as oil, gas, and water in the formation will be pressed into the wellbore, resulting in overflow. Gas invasion will occur in the gas wellbore, and well kick will occur in the oil well. If not handled in time, it will further deteriorate into a severe blowout within 10 - 30 minutes, causing great losses. Therefore, it is necessary to timely and accurately diagnose the overflow risk during drilling.

[0003] However, traditional experience and physics-based overflow diagnosis methods are limited. For example, the calculation models of ECD or pore pressure have drawbacks such as complex calculation and derivation processes, poor generality, the need for continuous calibration, or the need to carefully consider different working conditions again. Although they have strong mechanism and do not rely on historical data, they are also difficult to cope with the increasingly complex drilling process. Traditional overflow detection methods need to monitor surface parameters or install more sensors on the drilling platform. These methods judge overflow through obvious changes in physical parameters and surface phenomena, etc. They generally have time lags, rely on the experience, responsibility, and awareness of monitoring personnel, do not effectively utilize prior drilling parameters, have great limitations, and cannot provide early diagnosis of overflow.

[0004] In order to avoid or reduce such drilling complexities caused by pressure, most current methods adopt managed pressure drilling technology. Managed pressure drilling technology controls the wellbore pressure and distribution by adjusting drilling parameters, basically ensuring that the bottom hole pressure is within the narrow density window range to achieve the purpose of safe drilling. However, managed pressure drilling cannot completely keep the bottom hole pressure within the narrow density window. Fortunately, it provides relatively rich and detailed managed pressure drilling data. Therefore, various fine drilling parameters brought by managed pressure drilling can be effectively utilized to diagnose overflow through machine learning algorithm models.

[0005] Compared with other methods, artificial intelligence and big data technologies have strong non-linear fitting and information mining capabilities, and have significant advantages in solving complex problems. Among them, machine learning algorithms can effectively learn the relationship between feature parameters and the target, have the advantages of high computational efficiency and accuracy, and are widely used in various fields. However, to a certain extent, they have the problems of weak mechanism and poor interpretability. In addition, there may also be problems such as inaccurate training data, poor model generalization ability, and limited prediction accuracy.

[0006] Therefore, the diagnostic efficiency and accuracy of physical models in the prior art are relatively low, while machine learning models, although having high computational efficiency and accuracy, have the problems of weak mechanism and poor interpretability. Summary of the Invention

[0007] In view of this, the present invention provides a drilling overflow diagnosis method that combines physics and machine learning to solve the above problems.

[0008] The present invention provides a drilling overflow diagnosis method that combines physics and machine learning, including: obtaining drilling engineering parameter data of several drilled wells during actual drilling; performing data preprocessing on the drilling engineering parameter data to obtain standard drilling engineering parameter data, and the preprocessing includes setting overflow target features, target feature encoding, and data cleaning; establishing a regression model for predicting the equivalent density of pore pressure based on the relationship between well depth and equivalent density of pore pressure in the standard drilling engineering parameter data corresponding to the current block, and generating a first overflow diagnosis result; performing model training based on the feature analysis result of the standard drilling engineering parameter data to obtain a drilling overflow machine learning diagnosis model, and generating a second overflow diagnosis result; analyzing and adaptively weight-fusing the first overflow diagnosis result and the second overflow diagnosis result to obtain an overflow fusion diagnosis result.

[0009] In another implementation manner of the present invention, the setting of the overflow target features includes: adding overflow target features and corresponding feature parameter values to the drilling engineering parameter data; according to the recorded information corresponding to the occurrence of overflow in the drilling history data and drilling complex working condition data, marking the feature parameter values in the drilling engineering parameter data corresponding to the well depth as overflow.

[0010] In another implementation manner of the present invention, the target feature encoding includes: after marking all the overflow data corresponding to the wells, calibrating the remaining unmarked feature parameter values as non-overflow; encoding the overflow and the non-overflow to obtain new drilling engineering parameter data including all the feature parameter values of the overflow target features.

[0011] In another implementation of the present invention, the data cleaning process includes: according to the data description of well history data and the actual data situation, deleting the overflow target features and corresponding feature parameter values in the new drilling engineering parameter data that are irrelevant to overflow, have poor accuracy mentioned in the data, have gaps or are all 0; using the three-sigma criterion to detect whether the remaining feature parameter values fall within the range of the mean (μ) ± 3 times the standard deviation (σ) of the corresponding overflow target feature. If not, the overflow target feature and the corresponding feature parameter values are excluded to obtain the standard drilling engineering parameter data.

[0012] In another implementation of the present invention, the three-sigma criterion is expressed as:

[0013] μ - 3σ ≤ x ≤ μ + 3σ

[0014] Where μ is the mean of the data set; σ is the standard deviation of the data set; and x is the numerical value of a certain feature parameter in the data set.

[0015] In another implementation of the present invention, establishing a regression model for pore pressure equivalent density prediction based on the relationship between well depth and pore pressure equivalent density in the standard drilling engineering parameter data corresponding to the current block, and generating a first overflow diagnosis result, includes: establishing a regression model for pore pressure equivalent density prediction based on the relationship between well depth and pore pressure equivalent density in the standard drilling engineering parameter data corresponding to the current block; calculating the equivalent circulation density according to the standard drilling engineering parameter data; comparing the result output by the regression model for pore pressure equivalent density prediction with the equivalent circulation density to obtain the first overflow diagnosis result.

[0016] In another implementation of the present invention, performing model training based on the feature analysis result of the standard drilling engineering parameter data to obtain a machine learning diagnosis model for drilling overflow, and generating a second overflow diagnosis result, includes: performing feature analysis on the standard drilling engineering parameter data using the Spearman rank correlation coefficient in the correlation analysis method to obtain a feature analysis result; combining the feature analysis result and the standard drilling engineering parameter data for model training to obtain a machine learning diagnosis model for drilling overflow; using the machine learning diagnosis model for drilling overflow for prediction to obtain the second overflow diagnosis result.

[0017] In another implementation of the present invention, the Spearman rank correlation coefficient is expressed as:

[0018]

[0019] Where ρ is the Spearman correlation coefficient; d i represents the difference in the rank values of the i-th data pair; and n is the total number of observed samples.

[0020] In another implementation of the present invention, the first overflow diagnosis result and the second overflow diagnosis result are analyzed and adaptively weighted and fused to obtain an overflow fusion diagnosis result, including: when the first overflow diagnosis result and the second overflow diagnosis result are consistent, the overflow fusion diagnosis result is directly obtained; when the first overflow diagnosis result and the second overflow diagnosis result are inconsistent, the first overflow diagnosis result and the second overflow diagnosis result are adaptively weighted and fused according to the diagnosis accuracy rates of the two models for the overflow condition in the test stage to obtain the overflow fusion diagnosis result.

[0021] In another implementation of the present invention, the first overflow diagnosis result and the second overflow diagnosis result are adaptively weighted and fused according to the diagnosis accuracy rates of the two models for the overflow condition in the test stage to obtain the overflow fusion diagnosis result, including: when the diagnosis result of the regression model for predicting the equivalent density of pore pressure is an overflow condition, while the diagnosis result of the machine learning diagnosis model for drilling overflow is a non-overflow condition, if the accuracy rate of the regression model for predicting the equivalent density of pore pressure for overflow diagnosis * 1 + the accuracy rate of the machine learning diagnosis model for drilling overflow for non-overflow diagnosis * (-1) > 0, the fusion diagnosis result is an overflow condition, otherwise it is a non-overflow condition; when the diagnosis result of the regression model for predicting the equivalent density of pore pressure is a non-overflow condition (0), while the diagnosis result of the machine learning diagnosis model for drilling overflow is an overflow condition (1), if the accuracy rate of the regression model for predicting the equivalent density of pore pressure for non-overflow diagnosis * (-1) + the accuracy rate of the machine learning diagnosis model for drilling overflow for overflow diagnosis * 1 > 0, the fusion result is an overflow condition, otherwise it is a non-overflow condition.

[0022] The physical and machine learning fusion-based drilling overflow diagnosis method of the present invention fuses the qualitative results of the regression model for predicting the equivalent density of pore pressure and the machine learning diagnosis model for drilling overflow to achieve drilling overflow diagnosis; and when the accuracy rate of one model is low and unreliable due to various reasons, the adaptively weighted fusion model will not be affected by it, and the drilling overflow diagnosis can still be achieved through the other model. Under the premise of ensuring the diagnosis efficiency and accuracy rate, the rationality and interpretability of the model and the diagnosis result are enhanced. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. By reading the detailed description of the following embodiments, the advantages and benefits in the solutions will become clear to those skilled in the art. The drawings are only used for the purpose of showing the preferred embodiments and are not considered to be a limitation of the present invention. In the drawings:

[0024] Figure 1Schematic diagram of the process of the physical and machine learning integrated drilling overflow diagnosis method according to an embodiment of the present invention.

[0025] Figure 2 Schematic diagram of the process of diagnosing drilling overflow by the physical model according to an embodiment of the present invention.

[0026] Figure 3 Schematic diagram of the process of diagnosing drilling overflow by the adaptive weight fusion of the physical model and the machine learning model according to an embodiment of the present invention.

[0027] Figure 4 Schematic diagram of the Spearman correlation analysis between the characteristic parameters and the overflow according to an embodiment of the present invention.

[0028] Figure 5 Schematic diagram of the 3rd-degree polynomial regression fitting of the well depth - equivalent density of pore pressure according to an embodiment of the present invention.

[0029] Figure 6 Schematic diagram of the prediction results of the equivalent density of pore pressure in the test set according to an embodiment of the present invention.

[0030] Figure 7 Schematic diagram of the comparison between the diagnosis result of the physical model and the actual result according to an embodiment of the present invention.

[0031] Figure 8 Schematic diagram of the confusion matrix of the physical model according to an embodiment of the present invention.

[0032] Figure 9 Schematic diagram of the ROC curve of the physical model according to an embodiment of the present invention.

[0033] Figure 10 Schematic diagram of the prediction of the equivalent density of pore pressure in the validation set according to an embodiment of the present invention.

[0034] Figure 11 Schematic diagram of the comparison between the diagnosis result of the physical model in the validation set and the actual result according to an embodiment of the present invention.

[0035] Figure 12(a) Schematic diagram of the diagnosis accuracy of the 30-iteration model according to an embodiment of the present invention.

[0036] Figure 12(b) Schematic diagram of the values of n_estimators for 30 iterations according to an embodiment of the present invention.

[0037] Figure 12(c) Schematic diagram of the values of learning_rate and subsample for 30 iterations according to an embodiment of the present invention.

[0038] Figure 12(d) is a schematic diagram showing the values of max_depth, min_samples_split, and min_samples_leaf for 30 iterations in an embodiment of the present invention.

[0039] Figure 13 Schematic diagram of the confusion matrix of the Bayesian optimization GBDT model test set in an embodiment of the present invention.

[0040] Figure 14 Schematic diagram of the ROC curve of the Bayesian optimization GBDT model test set in an embodiment of the present invention.

[0041] Figure 15 Schematic diagram comparing the overflow diagnosis results and actual results of the verification set machine learning model in an embodiment of the present invention.

[0042] Figure 16 Schematic diagram of the confusion matrix of the Bayesian optimization GBDT model verification set in an embodiment of the present invention.

[0043] Figure 17 Schematic diagram of the ROC curve of the Bayesian optimization GBDT model test set in an embodiment of the present invention.

[0044] Figure 18 Schematic diagram comparing the overflow diagnosis results and actual results of the adaptive weight fusion of the physical model and machine learning model in the verification set in an embodiment of the present invention. Detailed implementation manners

[0045] To enable those skilled in the art to better understand the technical solutions in the embodiments of the present invention, the following will clearly and detailedly describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments in the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art shall fall within the protection scope of the embodiments of the present invention.

[0046] Figure 1 Schematic diagram of the process of a drilling overflow diagnosis method that fuses physics and machine learning provided by an embodiment of the present invention. As Figure 1 shown, this embodiment mainly includes:

[0047] Obtain drilling engineering parameter data of several drilled wells during actual drilling.

[0048] Exemplarily, collect drilling engineering parameter data collected during actual drilling of several drilled wells, such as logging data or managed pressure drilling data, as well as the drilling history information and descriptions of drilling complex conditions of each well.

[0049] Among them, common drilling engineering parameters include but are not limited to the following parameters: well depth / m, drilling time / (min / m), weight on bit / kN, hook load / kN, rotary speed / (r / min), torque / (kN*m), pump strokes / spm, density of drilling fluid at outlet (g / cm 3 ). In the drilling well history data and drilling complex condition data, there should be records of overflow conditions.

[0050] Perform data preprocessing on the drilling engineering parameter data to obtain standard drilling engineering parameter data. The preprocessing includes setting overflow target features, target feature encoding, and data cleaning.

[0051] Based on the relationship between the well depth and the equivalent density of pore pressure in the standard drilling engineering parameter data corresponding to the current block, establish a regression model for predicting the equivalent density of pore pressure and generate a first overflow diagnosis result.

[0052] Based on the feature analysis result of the standard drilling engineering parameter data, perform model training to obtain a machine learning diagnosis model for drilling overflow and generate a second overflow diagnosis result.

[0053] Analyze and perform adaptive weight fusion processing on the first overflow diagnosis result and the second overflow diagnosis result to obtain an overflow fusion diagnosis result.

[0054] The drilling overflow diagnosis method that combines physics and machine learning in the present invention fuses the regression model for predicting the equivalent density of pore pressure with the qualitative result of the machine learning diagnosis model for drilling overflow to achieve drilling overflow diagnosis. And when the accuracy of one model is low and unreliable due to various reasons, the adaptive weight fusion model will not be affected by it, and can still achieve drilling overflow diagnosis through the other model. On the premise of ensuring the diagnosis efficiency and accuracy, the mechanism and interpretability are enhanced.

[0055] In another implementation manner of the present invention, the setting of the overflow target features includes: adding overflow target features and corresponding feature parameter values to the drilling engineering parameter data; according to the recorded information corresponding to the overflow in the drilling well history data and drilling complex condition data, label the feature parameter values in the drilling engineering parameter data corresponding to the well depth as overflow.

[0056] Exemplarily, through information such as the well depth, formation, time, and duration corresponding to the overflow in the drilling well history data and drilling complex condition data, perform labeling in the drilling engineering parameter data, and label the overflow feature parameter values in each drilling engineering parameter data corresponding to the well depth as overflow.

[0057] In another implementation manner of the present invention, the target feature encoding includes: after annotating the overflow data corresponding to all wells, calibrating the remaining unannotated feature parameter values as non-overflow; performing feature encoding on the overflow and the non-overflow to obtain new drilling engineering parameter data including all feature parameter values of the overflow target feature.

[0058] Exemplarily, when performing feature encoding on the overflow and the non-overflow, 0-1 encoding is adopted, and its target value takes 0 or 1. It is set that "0" represents no overflow, and "1" represents overflow.

[0059] In another implementation manner of the present invention, the data cleaning process includes: according to the data description of the well history data and the actual data situation, deleting the overflow target features and corresponding feature parameter values that are irrelevant to the overflow, have poor accuracy mentioned in the data, have vacancies or are all 0 in the new drilling engineering parameter data; using the three-sigma criterion to detect whether the remaining feature parameter values fall within the range of the mean (μ) ± 3 times the standard deviation (σ) of the corresponding overflow target feature. If not, the overflow target feature and the corresponding feature parameter values are removed to obtain standard drilling engineering parameter data.

[0060] Exemplarily, the data cleaning process is mainly the cleaning of feature parameter values and all abnormal data.

[0061] In another implementation manner of the present invention, the three-sigma criterion is expressed as:

[0062] μ - 3σ ≤ x ≤ μ + 3σ

[0063] Wherein, μ is the mean of the data set; σ is the standard deviation of the data set; x is the value of a certain feature parameter in the data set.

[0064] In another implementation manner of the present invention, establishing a regression model for predicting the equivalent density of pore pressure based on the relationship between the well depth and the equivalent density of pore pressure in the standard drilling engineering parameter data corresponding to the current block, and generating a first overflow diagnosis result includes: establishing a regression model for predicting the equivalent density of pore pressure based on the relationship between the well depth and the equivalent density of pore pressure in the standard drilling engineering parameter data corresponding to the current block; calculating the equivalent circulating density according to the standard drilling engineering parameter data; comparing the result output by the regression model for predicting the equivalent density of pore pressure with the equivalent circulating density to obtain a first overflow diagnosis result.

[0065] Exemplarily, such as Figure 2As shown in the figure, from the perspective that the equivalent density of pore pressure at the same well depth in adjacent wells of the same block is approximately the same, the measured values of the equivalent density of pore pressure in the formation of this block and the corresponding well depths are collected. Through the cubic polynomial regression algorithm model, the relationship between the well depth and the equivalent density of pore pressure in this block is learned, and a regression model for predicting the equivalent density of pore pressure (i.e., the physical model) is established.

[0066] The equivalent density of pore pressure obtained by regressing each piece of data is compared with the equivalent circulating density (ECD) calculated from the data or in the data. When the equivalent density of pore pressure in the formation is greater than the ECD, a kick is likely to occur, and the kick diagnosis result of the physical model is obtained accordingly.

[0067] Through Python code, the physical model for kick diagnosis can be written to achieve data-driven. After importing the data, the kick diagnosis situation of each piece of data can be obtained.

[0068] In another implementation manner of the present invention, the model training is performed based on the feature analysis result of the standard drilling engineering parameter data to obtain a machine learning diagnosis model for drilling kicks and generate a second kick diagnosis result, including: performing feature analysis on the standard drilling engineering parameter data by using the Spearman rank correlation coefficient in the correlation analysis method to obtain a feature analysis result; combining the feature analysis result and the standard drilling engineering parameter data for model training to obtain a machine learning diagnosis model for drilling kicks; using the machine learning diagnosis model for drilling kicks for prediction to obtain a second kick diagnosis result.

[0069] Exemplarily, as shown in Table 1, in combination with the kick mechanism of drilling and the phenomena or changes of characteristic parameters before and after the occurrence of kick accidents, the characteristic phenomena or changes related to the kick mechanism are sorted out.

[0070] Table 1 Characteristic phenomena or changes related to the kick mechanism

[0071]

[0072]

[0073] For the machine learning model, the Spearman algorithm in the correlation analysis method is used for feature analysis. As Figure 3 shown, the GBDT algorithm in ensemble learning is used to establish a machine learning diagnosis model for drilling kicks (i.e., the machine learning model), and during the establishment process, the hyperparameters of the GBDT algorithm are optimized through five-fold cross-validation and the Bayesian optimization algorithm, and finally, a variety of model evaluation methods are selected for evaluation.

[0074] In another implementation manner of the present invention, the Spearman rank correlation coefficient is expressed as:

[0075]

[0076] where ρ is the Spearman correlation coefficient; d i represents the difference in the rank values of the i-th data pair; n is the total number of observed samples.

[0077] In another implementation manner of the present invention, the first overflow diagnosis result and the second overflow diagnosis result are analyzed and adaptively weighted and fused to obtain an overflow fusion diagnosis result, including: when the first overflow diagnosis result and the second overflow diagnosis result are consistent, the overflow fusion diagnosis result is directly obtained; when the first overflow diagnosis result and the second overflow diagnosis result are inconsistent, the first overflow diagnosis result and the second overflow diagnosis result are adaptively weighted and fused according to the diagnosis accuracies of the two models for the overflow condition in the test stage to obtain the overflow fusion diagnosis result.

[0078] In another implementation manner of the present invention, the first overflow diagnosis result and the second overflow diagnosis result are adaptively weighted and fused according to the diagnosis accuracies of the two models for the overflow condition in the test stage to obtain the overflow fusion diagnosis result, including: when the diagnosis result of the regression model for predicting the equivalent density of pore pressure is an overflow condition, while the diagnosis result of the machine learning diagnosis model for drilling overflow is a non-overflow condition, if the accuracy of the regression model for predicting the equivalent density of pore pressure for overflow diagnosis * 1 + the accuracy of the machine learning diagnosis model for drilling overflow for non-overflow diagnosis * (-1) > 0, the fusion diagnosis result is an overflow condition, otherwise it is a non-overflow condition; when the diagnosis result of the regression model for predicting the equivalent density of pore pressure is a non-overflow condition (0), while the diagnosis result of the machine learning diagnosis model for drilling overflow is an overflow condition (1), if the accuracy of the regression model for predicting the equivalent density of pore pressure for non-overflow diagnosis * (-1) + the accuracy of the machine learning diagnosis model for drilling overflow for overflow diagnosis * 1 > 0, the fusion result is an overflow condition, otherwise it is a non-overflow condition.

[0079] Exemplarily, as shown in Table 2, the model fusion method analyzes the diagnosis results and adaptively weights and fuses them based on the similarities and differences between the physical model and the machine learning model diagnosis results.

[0080] Table 2 Adaptive Weight Fusion Diagnosis Method for Physical Model and Machine Learning Model

[0081]

[0082] where 0 represents that the model diagnosis result is a non-overflow condition; 1 represents that the model diagnosis result is an overflow condition; P WL0 is the accuracy of the physical model for diagnosing non-overflow conditions; P WL1 is the accuracy of the physical model for diagnosing overflow conditions; P ML0The accuracy rate of the machine learning model in diagnosing non-overflow conditions, P ML1 The accuracy rate of the machine learning model in diagnosing overflow conditions.

[0083] The adaptive weight of the physical model. Before actually applying the fusion model, a complete dataset containing target feature overflow data is tested through Python code. Through qualitative judgment and result comparison, the accuracy rate of the physical model in overflow diagnosis is obtained.

[0084] The adaptive weight of the machine learning model. Before actually applying the fusion model, the model is trained with a training dataset containing target feature overflow data. After the machine learning model is trained, it is predicted through a test set to obtain the accuracy rate of the machine learning model in overflow diagnosis.

[0085] It should be understood that in actual applications, after importing drilling data, the equivalent density of pore pressure corresponding to each data is predicted by calling the regression model for pore pressure equivalent density prediction, and it is compared with ECD to determine whether there is an overflow risk situation, and the qualitative diagnosis result of the physical model is obtained; the qualitative diagnosis result of the machine learning model is obtained by calling the machine learning diagnosis model for drilling overflow. The accuracy rates of the two models in overflow diagnosis are automatically obtained through the fusion model, and adaptive weight fusion is performed to finally obtain the overflow fusion diagnosis result of the physical model and the machine learning model. Among them, the set weight is not limited to the accuracy rate of the model in overflow diagnosis during the test stage, and the percentage of the two models in the fusion result can also be set artificially.

[0086] Example 1

[0087] (1) Data collection and processing

[0088] The pressure control drilling data collected during the actual drilling of several pressure control wells with frequent overflows in a certain block is used. By consulting the drilling history and complex conditions in the data, in order to prepare for subsequent feature analysis and model training prediction, data preprocessing methods such as target feature encoding, data cleaning, and undersampling are adopted before model establishment to form a preliminary excel data table.

[0089] Target feature encoding processing, that is, an additional column "overflow" is added to the data. According to the complex working condition records in the well history data, the overflow situation corresponding to each data is determined, and 0-1 encoding is adopted. Its target value takes 0 or 1, and it is stipulated that "0" represents no overflow and "1" represents overflow.

[0090] Data cleaning mainly focuses on cleaning features and abnormal data. According to the data description in well history materials and the actual data situation, feature columns irrelevant to overflow are initially deleted, followed by deleting uncollected feature columns and those with poor precision. Subsequently, data cleaning is used to remove data with blanks or all zeros, and the three-sigma criterion is adopted to detect and process abnormal data.

[0091] Considering the balance of target categories, data under-sampling is performed on the data. Data samples with a relatively long time from the overflow occurrence section are removed, and it is ensured that the ratio of overflow and non-overflow data is not less than 1:4.

[0092] Finally, through data record description and data preprocessing, 7388 pieces of data are obtained. Among them, the ratio of overflow and non-overflow data is 4491:2897, and each piece of data has 31 features. In addition, 400 pieces of data are additionally selected as the final fusion test data, and the ratio of its overflow and non-overflow data is 200:200.

[0093] (2) Feature analysis

[0094] Such as Figure 4 shown, to ensure the correlation between features and the target overflow, Spearman correlation analysis is performed on all 7388 pieces of data after data preprocessing, and a correlation graph between features and overflow is obtained. Through Figure 4 it can be clearly seen the correlation magnitudes between 31 features and overflow. To improve the model generalization ability and avoid the influence of feature redundancy on the model complexity and prediction accuracy, with a correlation coefficient of 0.1 as the boundary, features with relatively small correlations and duplicates are discarded.

[0095] Finally, after feature analysis, the eleven main features affecting overflow are: mud spillage (m 3 ), hook load (kN), drilling time (min / m), standpipe pressure (MPa), inlet temperature (°C), PWD annulus pressure (MPa), outlet density (g / cc), bit ECD (g / cc), measured back pressure (MPa), back pressure pump flow rate (L / s), outlet flow rate (L / s).

[0096] (3) Physical model diagnosis of drilling overflow diagnosis

[0097] By consulting the well history data of this well, it was found that each well had only a very small amount (2 - 3 items) of pore pressure equivalent density obtained from on-site tests, which could not meet the requirements of physical model tests. Therefore, the well history data of six additional wells in the block were investigated and consulted, and more than twenty items of data on well depth and pore pressure equivalent density were collected. Since managed pressure drilling is often used in deep well sections, to ensure that the regression model can better learn the relationship between well depth and pore pressure equivalent density and ensure that the regression model can adapt to the data section used by the fusion model, the data around 4000 m - 6500 m were retained after screening. Through the cubic polynomial regression algorithm, the function formula of well depth and pore pressure equivalent density was obtained:

[0098] y = 0.4941 + 2.9747 * 10 -4 x - 4.2514 * 10 -8 x 2 + 2.1443 * 10 -12 x 3

[0099] In the formula, x is the well depth, with the unit of m; y is the pore pressure equivalent density, with the unit of g / cm 3 .

[0100] As Figure 5 shown, it is the fitting situation of the data. By calling the cubic polynomial regression model for predicting the pore pressure equivalent density, the pore pressure equivalent density of 7388 pieces of data for the training and testing of the fusion model was predicted, and the test samples and the predicted results of the pore pressure equivalent density as shown in Figure 6 were obtained, which were used for the test and evaluation of the next physical diagnosis model.

[0101] Among the 7388 pieces of data for the training and testing of the fusion model, through the overflow physical diagnosis model shown in the following formula, the pore pressure equivalent density obtained from the regression prediction was compared with the bit ECD (g / cc) calculated by on-site experts in the data, and the diagnostic results of the drilling overflow physical model corresponding to each sample could be obtained.

[0102] 0.4941 + 2.9747 * 10 -4 x - 4.2514 * 10 -8 x 2 + 2.1443 * 10 -12 x 3 > ECD

[0103] By comparing with the actual overflow situation corresponding to the data, it was obtained that the diagnostic accuracy rate of the drilling overflow physical diagnosis model was 62.11%. The comparison situation between the diagnostic results of the drilling overflow physical diagnosis model and the actual overflow situation corresponding to the data is as shown in Figure 7 .

[0104] As shown in Table 3, the test results of the physical model were evaluated, and an evaluation report of the model was obtained. It can be found that the three evaluation indicators of precision, recall, and f1-score, like accuracy, have low values. The diagnostic effect for 0 (non-overflow) is average, and the diagnostic effect for 1 (overflow) is very poor. In addition, as Figure 9 the confusion matrix of the model and Figure 10 the ROC curve of

[0105] Table 3 Physical Model Evaluation Report

[0106]

[0107] On the original dataset, some of the outputs when the physical model diagnosed the result as overflow are as follows:

[0108] At a well depth of 6989.39m, the equivalent density of formation pore pressure is greater than ECD, and overflow may occur.

[0109] At a well depth of 6989.421m, the equivalent density of formation pore pressure is greater than ECD, and overflow may occur.

[0110] At a well depth of 6989.449m, the equivalent density of formation pore pressure is greater than ECD, and overflow may occur.

[0111] At a well depth of 6989.467m, the equivalent density of formation pore pressure is greater than ECD, and overflow may occur.

[0112] At a well depth of 6989.467m, the equivalent density of formation pore pressure is greater than ECD, and overflow may occur.

[0113] At a well depth of 6989.484m, the equivalent density of formation pore pressure is greater than ECD, and overflow may occur.

[0114] It can be seen that the physical model directly outputs at what well depths overflow may occur.

[0115] Through the established physical diagnosis model for drilling overflow, 400 data in the validation set were diagnosed. First, the equivalent density of pore pressure was predicted through a cubic regression polynomial, and the prediction result graph of the equivalent density of pore pressure as shown in Figure 11 was obtained.

[0116] As Figure 11As shown, the equivalent density of pore pressure obtained from 400 pieces of data in the validation set is compared with the ECD in the data to obtain the physical model overflow diagnosis results for each sample. Then, physical model overflow diagnosis and result comparison are carried out, and the sample overflow diagnosis results are compared with the actual results.

[0117] It can be seen that on the validation set, all the results of the physical model overflow diagnosis are non-overflow conditions. Although the accuracy of the model diagnosis is 50% at this time and it is not effective in diagnosing overflow conditions, it still has a certain effect in diagnosing non-overflow conditions.

[0118] (4) Machine learning model for diagnosing drilling overflow

[0119] A GBDT model is established using the sklearn.ensemble library in the Python programming language. The feature matrix and target imported into the model are selected through feature names. 70% of the processed data is used as training data, and 30% is used as test data, and the random seed random_state = 42 is set.

[0120] Combined with the characteristics of the GBDT algorithm and prior knowledge, the optimal hyperparameters are searched through the Bayesian optimization algorithm. As shown in Table 4, a dictionary search_space is defined as the hyperparameter search space of the Bayesian algorithm. Each key in the dictionary represents a hyperparameter name, and the corresponding value includes the range of possible values of the hyperparameter and the sampling method.

[0121] Table 4 Bayesian optimization GBDT hyperparameter dictionary

[0122]

[0123] Furthermore, using the defined search space, a BayesSearchCV object opt is created. When creating the object, the following parameters are specified:

[0124] model: The model to be optimized, GradientBoostingClassifier().

[0125] search_space: The hyperparameter search space, that is, the search space of the six hyperparameters defined above.

[0126] n_iter: The number of iterations, that is, how many groups of hyperparameter combinations the algorithm has to try, set to 30.

[0127] cv: The number of cross-validation folds, set to 5.

[0128] scoring: The evaluation metric, using accuracy.

[0129] random_state: Random seed, set to 42.

[0130] Optimize the hyperparameter combinations by executing the fit() method and apply them to the trained model for accuracy testing to find better hyperparameter combinations. Finally, obtain the optimized hyperparameter values in Table 4 and establish a machine learning diagnosis model for drilling fluid overflow that optimizes the GBDT model using the Bayesian optimization algorithm.

[0131] To observe the hyperparameter combinations and corresponding accuracies and determine whether there is a local optimum in the iterative optimization process, a double y-axis plot of the values of each hyperparameter in 30 iterations and the average test accuracy of five-fold cross-validation is plotted as Figures 12(a) to 12(d) shown. Since the value ranges of max_depth, min_samples_split, and min_samples_leaf, as well as learning_rate and subsample, are close, they are placed in one figure respectively.

[0132] It can be found that the selection of hyperparameters comes from the 4th iteration of optimization, at which time the model achieved the highest average test accuracy of 98.88%.

[0133] Table 5 Evaluation Report of the Bayesian Optimization GBDT Model on the Test Set

[0134]

[0135] As shown in Table 5, the model is evaluated to obtain the evaluation report of the model. It can be found that the three evaluation indicators of precision, recall, and f1-score have high values like accuracy, and the classification effect on 0 (non-overflow) and 1 (overflow) is very good. The diagnostic precision rate of the model for non-overflow conditions is 99.17%, and for overflow conditions is 98.76%. The above accuracies are used as the weights of the subsequent fusion model for diagnosing overflow and non-overflow conditions by the machine learning model. Combining the confusion matrix of the model as Figure 13 shown and Figure 14 the ROC curve shown, compared with before optimization, the accuracy of the GBDT algorithm model for overflow diagnosis has increased by 1.05%.

[0136] In the test set, for the misdiagnosis of overflow conditions, the number of samples is reduced from 22 to 11; for the misdiagnosis of non-overflow conditions, the number of samples is reduced from 26 to 11. The overall number of misdiagnosed samples is reduced by 26, nearly halved. The ROC curve approaches an isosceles right triangle, and the AUC also reaches a good result of 0.9897. Thus, it can be seen the necessity of optimizing the model hyperparameters, which once again proves the good effect achieved after the model is optimized by hyperparameters.

[0137] As Figure 15 shown, the machine learning diagnosis model of drilling overflow that optimizes the GBDT model through the established Bayesian optimization algorithm diagnoses the overflow conditions of 400 pieces of data in the validation set, and compares the diagnosis results with the actual results to obtain the comparison between the sample overflow diagnosis results and the actual results.

[0138] It can be seen that on the validation set, the diagnosis results of the machine learning model are relatively good. Further evaluate the diagnosis results of the model, and the diagnosis accuracy of the machine learning model is 94.25%. Then, through the confusion matrix Figure 16 it can be found that 26 overflow samples are misdiagnosed, and the misdiagnosed samples are relatively concentrated. From Figure 17 it can be seen that the ROC curve also has a good effect, the abscissa error rate is small, and the AUC value is 0.9425.

[0139] (5) Diagnosis of drilling overflow by adaptive weight fusion of physical model and machine learning model

[0140] Through the overflow diagnosis results of the physical model of drilling overflow on the validation set and the overflow diagnosis results of the machine learning model on the validation set, further analyze and fuse the diagnosis results of the two models to establish a drilling overflow diagnosis model that fuses the physical model and the machine learning model.

[0141] It should be understood that the tests of the physical model on the original dataset and the validation set show that the physical model has a certain effect in diagnosing non-overflow conditions, and in the actual drilling process, on-site drilling staff are more willing to believe the diagnosis results of the physical model because it is more direct and has relatively strong mechanism and interpretability. Therefore, when the diagnosis results of the machine learning model and the physical model are inconsistent, for the diagnosis accuracy of the physical model, on the basis of adopting adaptive weight fusion, an additional 10% weight is given to the physical model and 10% weight of the machine learning model is reduced.

[0142] First, adaptively load the accuracy weights of the physical model and the machine learning model on the test set through code, as follows: the accuracies of the physical model in diagnosing non-overflow conditions and overflow conditions are wl_accuracy_0 = 0.6625 and wl_accuracy_1 = 0.3377 respectively, and the accuracies of the machine learning model in diagnosing non-overflow conditions and overflow conditions are ml_accuracy_0 = 0.9917 and ml_accuracy_1 = 0.9876 respectively.

[0143] When the diagnostic results of the two models are consistent, the result is directly obtained; when they are inconsistent, the method of adaptive weight fusion in Table 6 is used for diagnosis. When the adaptive weight result is greater than 0, the diagnostic result is overflow; otherwise, the diagnostic result is non-overflow. In summary, the overflow diagnostic result of the adaptive weight fusion model of the physical model and the machine learning model can be obtained.

[0144] Table 6 Adaptive Weight Fusion Diagnosis of Physical Model and Machine Learning Model

[0145]

[0146] As Figure 18 shown, by testing 400 pieces of data in the validation set, the comparison between the overflow diagnostic result of the adaptive weight fusion of the physical model and the machine learning model and the actual result is obtained.

[0147] It can be seen that on the validation set, the overflow diagnostic result of the adaptive weight fusion model of the physical model and the machine learning model is the same as that of the machine learning model, and relatively good diagnostic results are obtained.

[0148] Compared with the overflow diagnosis of the existing machine learning model, on the basis of the machine learning model, the fusion model uses the on-site calculated data ECD and the model-predicted data pore pressure equivalent density, which enhances the mechanism and interpretability of the model and the diagnostic result. When overflow is diagnosed, it is of great help to on-site engineers to adjust parameters, analyze and solve the overflow risk problem. Moreover, through the validation set test, the diagnostic accuracy of the fusion model for the overflow risk reaches more than 98%, and the application accuracy also reaches 94.25%.

[0149] On the other hand, the electronic device of the present invention includes: a processor, a memory, and a communication bus and a communication interface.

[0150] Among them:

[0151] The processor, the memory, and the communication interface complete the communication with each other through the communication bus.

[0152] The communication interface is used to communicate with other electronic devices or servers.

[0153] The processor is used to execute a program, and specifically can execute the steps of any one of the above-mentioned drilling overflow diagnosis methods for physical and machine learning fusion.

[0154] Specifically, the program may include program code, and the program code includes computer operation instructions.

[0155] The processor may be a central processing unit (CPU), or an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present application. One or more processors included in the intelligent device may be of the same type, such as one or more CPUs; or may be of different types, such as one or more CPUs and one or more ASICs.

[0156] A memory for storing programs. The memory may include high-speed RAM memory and may also include non-volatile memory, such as at least one disk memory.

[0157] Specifically, the program can be used to cause the processor to execute steps to implement any of the physical and machine learning integrated drilling overflow diagnosis methods described in the embodiments. For the specific implementation of each step in the program, reference can be made to the corresponding descriptions in the steps and units executed by any of the physical and machine learning integrated drilling overflow diagnosis methods described above, which will not be elaborated here. Those skilled in the art can clearly understand that for the convenience and brevity of description, the specific working processes of the devices and modules described above can refer to the corresponding process descriptions in the foregoing method embodiments.

[0158] The method according to the embodiment of the present invention can be implemented in a server equipped with a central processing unit (CPU) and an image processing unit (GPU).

[0159] So far, specific embodiments of the present invention have been described. Other embodiments are within the scope of the appended claims. In some cases, the actions recited in the claims can be performed in a different order and still achieve the desired result. Additionally, the processes depicted in the figures do not necessarily require the particular order or sequential order shown to achieve the desired result.

[0160] It should be noted that all directional indications (such as up, down, left, right, back, etc.) in the embodiments of the present invention are only used to explain the relative positional relationship between components in a specific order (as shown in the drawings). If the specific order changes, the directional indications will change accordingly.

[0161] In the description of the present invention, the terms "first" and "second" are only used for the convenience of describing different components or names, and cannot be understood as indicating or implying an order relationship, relative importance, or implicitly indicating the quantity of the indicated technical features. Thus, the features defined with "first" and "second" may explicitly or implicitly include at least one of such features.

[0162] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs. The terms used in the description of the present invention herein are for the purpose of describing specific embodiments only and are not intended to limit the present invention.

[0163] It should be noted that although the specific embodiments of the present invention have been described in detail in conjunction with the accompanying drawings, it should not be construed as a limitation on the protection scope of the present invention. Within the scope described in the claims, various modifications and variations that can be made by those skilled in the art without creative work still fall within the protection scope of the present invention.

[0164] The examples of the embodiments of the present invention are intended to briefly illustrate the technical features of the embodiments of the present invention, so that those skilled in the art can intuitively understand the technical features of the embodiments of the present invention, and are not intended as an improper limitation of the embodiments of the present invention.

[0165] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions described in the foregoing embodiments or equivalently replace some of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A drilling overflow diagnosis method integrating physics and machine learning, characterized in that: include: Obtain drilling engineering parameter data of several wells that have been drilled during the actual drilling process; Performing data preprocessing on the drilling engineering parameter data to obtain standard drilling engineering parameter data, wherein the preprocessing includes setting overflow target characteristics, target characteristic coding and data cleaning processing; According to the relationship between the well depth and the pore pressure equivalent density in the standard drilling engineering parameter data corresponding to the current block, a regression model for predicting the pore pressure equivalent density is established, and a first overflow diagnosis result is generated; Performing model training based on the characteristic analysis results of the standard drilling engineering parameter data to obtain a drilling overflow machine learning diagnosis model and generate a second overflow diagnosis result; The first overflow diagnosis result and the second overflow diagnosis result are analyzed and adaptively weighted fused to obtain an overflow fusion diagnosis result.

2. The method according to claim 1, characterized in that The overflow target feature setting includes: Adding overflow target features and corresponding feature parameter values ​​to the drilling engineering parameter data; According to the corresponding record information when overflow occurs in the drilling history data and the drilling complex working condition data, the characteristic parameter value in the drilling engineering parameter data corresponding to the well depth is marked as overflow.

3. The method according to claim 2, characterized in that The target feature encoding includes: After marking the overflow data corresponding to all wells, the remaining unmarked characteristic parameter values ​​are marked as non-overflow; The overflow and the non-overflow are feature-coded to obtain new drilling engineering parameter data containing all feature parameter values ​​of the overflow target feature.

4. The method according to claim 3, characterized in that The data cleaning process includes: According to the data description and actual data of the well history data, the overflow target features and corresponding feature parameter values ​​that are irrelevant to overflow, have poor accuracy mentioned in the data, are missing or are all zero are deleted from the new drilling engineering parameter data; The three-times-σ criterion is used to detect whether the remaining characteristic parameter values ​​fall within the range of the mean (μ) ±3 times the standard deviation (σ) of the corresponding overflow target characteristic. If not within this range, the overflow target characteristic and the corresponding characteristic parameter value are eliminated to obtain the standard drilling engineering parameter data.

5. The method according to claim 4, characterized in that The triple σ criterion is expressed as: μ-3σ≤x≤μ+3σ Among them, μ is the mean of the data set; σ is the standard deviation of the data set; x is the value of a feature parameter in the data set.

6. The method according to claim 1, characterized in that The method of establishing a regression model for predicting pore pressure equivalent density based on the relationship between well depth and pore pressure equivalent density in the standard drilling engineering parameter data corresponding to the current block and generating a first overflow diagnosis result includes: According to the relationship between well depth and pore pressure equivalent density in the standard drilling engineering parameter data corresponding to the current block, a regression model for pore pressure equivalent density prediction is established; Calculating equivalent circulating density according to the standard drilling engineering parameter data; The result output by the regression model for predicting the pore pressure equivalent density is compared with the equivalent circulating density to obtain a first overflow diagnosis result.

7. The method according to claim 1, characterized in that The model training is performed based on the characteristic analysis results of the standard drilling engineering parameter data to obtain a drilling overflow machine learning diagnosis model, and generate a second overflow diagnosis result, including: Using the Spearman rank correlation coefficient in the correlation analysis method to perform feature analysis on the standard drilling engineering parameter data to obtain feature analysis results; Combining the characteristic analysis results with the standard drilling engineering parameter data to perform model training, to obtain a drilling overflow machine learning diagnosis model; The drilling overflow machine learning diagnostic model is used to perform predictions to obtain a second overflow diagnostic result.

8. The method according to claim 1, characterized in that The Spearman rank correlation coefficient is expressed as: Where ρ is the Spearman correlation coefficient; d i It is expressed as the difference in the rank values ​​of the i-th data pair; n is the total number of observed samples.

9. The method according to claim 1, characterized in that: The first overflow diagnosis result and the second overflow diagnosis result are analyzed and adaptively weighted fused to obtain an overflow fusion diagnosis result, including: When the first overflow diagnosis result and the second overflow diagnosis result are consistent, an overflow fusion diagnosis result is directly obtained; When the first overflow diagnosis result and the second overflow diagnosis result are inconsistent, the first overflow diagnosis result and the second overflow diagnosis result are adaptively weighted fused according to the diagnostic accuracy of the overflow condition of the two models in the test phase to obtain an overflow fusion diagnosis result.

10. The method according to claim 9, characterized in that According to the diagnostic accuracy of the overflow condition in the test phase of the two models, the first overflow diagnostic result and the second overflow diagnostic result are adaptively weighted and fused to obtain an overflow fusion diagnostic result, including: When the diagnostic result of the regression model for pore pressure equivalent density prediction is an overflow condition, and the diagnostic result of the drilling overflow machine learning diagnostic model is a non-overflow condition, if the accuracy of overflow diagnosis of the regression model for pore pressure equivalent density prediction*1+the accuracy of non-overflow diagnosis of the drilling overflow machine learning diagnostic model*(-1)>0, the fusion diagnostic result is an overflow condition, otherwise it is a non-overflow condition; When the diagnostic result of the regression model for pore pressure equivalent density prediction is a non-overflow condition (0), and the diagnostic result of the drilling overflow machine learning diagnostic model is an overflow condition (1), if the accuracy of the non-overflow diagnosis of the regression model for pore pressure equivalent density prediction*(-1)+the accuracy of the overflow diagnosis of the drilling overflow machine learning diagnostic model*1>0, the fusion result is an overflow condition, otherwise it is a non-overflow condition.