Method and device for constructing drilling leakage layer position prediction model
By encoding drilling leakage characteristic data and building a gradient-enhancing decision tree model, combining with grid search algorithm to tune hyperparameters, the empirical dependence and data error problems of drilling leakage layer position prediction in the existing technology are solved, and drilling is realized The safety and sustainability of the operation are improved.
Patent Information
- Application Number
- CN202411237570.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-04
- Publication Date
- 2025-02-14
AI Technical Summary
The existing drilling leak layer position prediction methods have problems such as strong empirical dependence, high testing costs, complex operations, and large data errors, making it difficult to achieve accurate prediction under complex geological conditions.
By encoding the leakage characteristic data of the target well, a gradient improvement decision tree model is built, and a grid search algorithm is used to tune hyperparameters to establish a drilling leakage layer position prediction model.
Accurate prediction of the location of the drilling leakage layer is achieved, which reduces the potential risk of well leakage and improves the safety and sustainability of drilling operations.
Smart Images

Figure CN119434947A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of petroleum engineering, and in particular to a method and a device for constructing a drilling leak layer position prediction model. Background Art
[0002] During the drilling process, the leakage of drilling fluid will not only increase the drilling cost, but also may cause dangerous accidents such as pipe sticking and blowout, which have a great impact on the safety and economic benefits of oil and gas field development. Therefore, accurately predicting the location of the drilling leakage layer is of great significance to ensure the safety of drilling projects and improve the efficiency of drilling operations.
[0003] The existing methods for determining the location of drilling leak layers mainly include empirical observation, hydrodynamic testing, instrumental analysis, etc. Among them, the empirical observation method mainly relies on the intuition of drilling engineers, with low accuracy and reliability, and it is difficult to cope with complex and changeable geological conditions; the hydrodynamic testing method often requires interrupting drilling operations, affecting the construction progress, and the testing process is relatively complicated and easily affected by the formation and wellbore structure; the instrumental analysis method uses instruments to scan and analyze the well wall and formation to obtain high-resolution images and data. Its equipment cost is high, the operation is complicated, and the reliability and accuracy of the instrument are easily affected by extreme environments such as high temperature and high pressure. Therefore, the traditional method of determining the location of drilling leak layers has problems such as strong empirical dependence, high testing cost, complex operation, and large data errors. Summary of the invention
[0004] The purpose of the embodiment of the present invention is to provide a method and device for constructing a prediction model for the location of a drilling leaky layer. The prediction model constructed by the method can accurately predict the location of the drilling leaky layer after leakage occurs.
[0005] In order to achieve the above object, an embodiment of the present invention provides a method for constructing a drilling leaky layer location prediction model, the method comprising:
[0006] Encoding the leakage characteristic data of the target well to obtain a first characteristic variable group, wherein the first characteristic variable group includes a plurality of characteristic variables;
[0007] According to the well depth at the time of leakage and the first characteristic variable group, a second characteristic variable group is obtained;
[0008] Constructing a gradient boosting decision tree model according to the second characteristic variable group and the well depth at the time of leakage;
[0009] The hyperparameters of the gradient boosting decision tree model are optimized according to the grid search algorithm to obtain a drilling leak layer location prediction model.
[0010] Optionally, encoding the leakage characteristic data of the target well to obtain a first characteristic variable group includes:
[0011] Deleting null values, eliminating abnormal data and normalizing the missing feature data;
[0012] Performing category coding on the character variables in the missing feature data to obtain numerical variables;
[0013] The leakage characteristic data include well number, well type, layer, lithology, formation structure, drilling pressure, rotation speed, torque, pump pressure, displacement, drilling fluid density, equivalent circulating density, hook load, mechanical drilling speed, drilling time, DC index, delay time, outlet flow, formation pressure gradient, formation fracture pressure gradient, theoretical maximum displacement, and displacement-to-pump ratio.
[0014] Optionally, determining the second characteristic variable group according to the correlation between the well depth at the time of lost circulation and the first characteristic variable group includes:
[0015] Performing a correlation analysis on the first characteristic variable group according to the well depth at the time of the leakage to obtain the importance of each characteristic variable;
[0016] The first characteristic variable group is screened according to the importance degree to obtain a second characteristic variable group.
[0017] Optionally, performing a correlation analysis on the first characteristic variable group according to the well depth at the time of leakage to obtain the importance of each characteristic variable includes:
[0018] Based on the normalized mutual information method, the correlation between each characteristic variable in the first characteristic variable group and the well depth during leakage is analyzed to obtain a normalized mutual information value, and the normalized mutual information value is the importance degree of the characteristic variable.
[0019] Optionally, constructing a gradient boosting decision tree model according to the second characteristic variable group and the well depth at the time of leakage includes:
[0020] Training a gradient boosting decision tree model according to the second feature variable group and the corresponding well depth at leakage, wherein the second feature variable group is an input variable of the gradient boosting decision tree model, and the well depth at leakage is an output variable of the gradient boosting decision tree model;
[0021] Obtain the predicted value of the gradient boosting decision tree model, and calculate the decision tree residual between the predicted value and the actual value;
[0022] Training a new decision tree based on the decision tree residuals, and fitting the decision tree residuals into the new decision tree; updating the gradient boosting decision tree model according to the new decision tree;
[0023] The above operation is repeated until the number of decision trees in the gradient boosting decision tree model meets the threshold range.
[0024] Optionally, the hyperparameters of the gradient boosting decision tree model are tuned according to a grid search algorithm to obtain a drilling leak layer location prediction model, including:
[0025] Obtaining hyperparameters of the gradient boosting decision tree model, wherein the hyperparameters include the number of decision trees in the gradient boosting decision tree model, the allowed growth depth, and the learning rate;
[0026] Traversing the gradient boosting decision tree model according to the hyperparameters to obtain all parameter combinations;
[0027] Sequentially evaluating the performance indicators of the gradient boosting decision tree model corresponding to the parameter combinations to obtain an optimal parameter combination, wherein the performance indicators include model accuracy and mean square error;
[0028] The preferred parameter combination is used in the gradient boosting decision tree model to obtain the drilling leak layer location prediction model.
[0029] On the other hand, the present invention also proposes a device for constructing a drilling leak layer location prediction model, the device comprising:
[0030] An acquisition module, used for encoding the leakage characteristic data of the target well to obtain a first characteristic variable group, wherein the first characteristic variable group includes a plurality of characteristic variables;
[0031] Determine a second characteristic variable group according to the correlation between the well depth at the time of leakage and the first characteristic variable group;
[0032] Constructing a gradient boosting decision tree model according to the second characteristic variable group and the well depth at the time of leakage;
[0033] The hyperparameters of the gradient boosting decision tree model are optimized according to the grid search algorithm to obtain a drilling leak layer location prediction model.
[0034] Optionally, determining the second characteristic variable group according to the correlation between the well depth at the time of lost circulation and the first characteristic variable group includes:
[0035] Performing a correlation analysis on the first characteristic variable group according to the well depth at the time of the leakage to obtain the importance of each characteristic variable;
[0036] Filtering the first characteristic variable group according to the importance degree to obtain a second characteristic variable group;
[0037] The step of performing a correlation analysis on the first characteristic variable group according to the well depth at the time of leakage to obtain the importance of each characteristic variable includes: performing a correlation analysis on each characteristic variable in the first characteristic variable group and the well depth at the time of leakage based on a normalized mutual information method to obtain a normalized mutual information value, wherein the normalized mutual information value is the importance of the characteristic variable.
[0038] Optionally, the hyperparameters of the gradient boosting decision tree model are tuned according to a grid search algorithm to obtain a drilling leak layer location prediction model, including:
[0039] Obtaining hyperparameters of the gradient boosting decision tree model, wherein the hyperparameters include the number of decision trees in the gradient boosting decision tree model, the allowed growth depth, and the learning rate;
[0040] Traversing the gradient boosting decision tree model according to the hyperparameters to obtain all parameter combinations;
[0041] Sequentially evaluating the performance indicators of the gradient boosting decision tree model corresponding to the parameter combinations to obtain an optimal parameter combination, wherein the performance indicators include model accuracy and mean square error;
[0042] The preferred parameter combination is used in the gradient boosting decision tree model to obtain the drilling leak layer location prediction model.
[0043] On the other hand, the present invention also provides a method for predicting the location of a drilling leaky layer, comprising:
[0044] Obtaining the leakage characteristic data of the well to be tested;
[0045] Substitute the leakage characteristic data of the well to be measured into the above-mentioned drilling leakage layer position prediction model to obtain the leakage layer position of the well to be measured.
[0046] The method for constructing a drilling leak layer position prediction model proposed by the present invention includes: encoding the leakage characteristic data of the target well to obtain a first characteristic variable group, wherein the first characteristic variable group includes multiple characteristic variables; determining a second characteristic variable group according to the correlation between the well depth at the time of leakage and the first characteristic variable group; constructing a gradient boosting decision tree model according to the second characteristic variable group and the well depth at the time of leakage; and optimizing the hyperparameters of the gradient boosting decision tree model according to the grid search algorithm to obtain a drilling leak layer position prediction model. The present invention applies the gradient boosting decision tree-grid search model (GBDT-GS model) to the prediction of the drilling leak layer position by analyzing the correlation between each characteristic variable and the drilling leak layer position, which not only realizes the accurate prediction of the leak layer position after the drilling leak occurs, but also reduces the potential risk of well leakage, and improves the safety and sustainability of drilling operations.
[0047] Other features and advantages of the embodiments of the present invention will be described in detail in the subsequent detailed description. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] The accompanying drawings are used to provide a further understanding of the embodiments of the present invention and constitute a part of the specification. Together with the following specific implementations, they are used to explain the embodiments of the present invention, but do not constitute a limitation on the embodiments of the present invention. In the accompanying drawings:
[0049] Figure 1 It is a flow chart of a method for constructing a drilling leak layer location prediction model according to the present invention;
[0050] Figure 2 It is a heat map for visualizing the correlation of each feature information of the present invention;
[0051] Figure 3 It is a schematic diagram of performance comparison of the model of the present invention in the training set;
[0052] Figure 4 It is a schematic diagram of the performance comparison of the model developed by the present invention in the validation set;
[0053] Figure 5 It is the fitting diagram of the predicted value and the true value when the GBDT-GS model is constructed and tuned;
[0054] Figure 6 This is a schematic diagram of the performance comparison of the GBDT-GS model in the test set;
[0055] Figure 7 It is the fitting diagram of the predicted value and the true value when the GBDT-GS model is applied;
[0056] Figure 8 It is the residual distribution diagram when the GBDT-GS model is applied. DETAILED DESCRIPTION
[0057] The specific implementation of the embodiment of the present invention is described in detail below in conjunction with the accompanying drawings. It should be understood that the specific implementation described here is only used to illustrate and explain the embodiment of the present invention, and is not used to limit the embodiment of the present invention.
[0058] Figure 1 FIG. 1 is a flow chart of a method for constructing a drilling leak layer location prediction model according to the present invention. Figure 1 As shown, an embodiment of the present invention provides a method for constructing a drilling leak layer location prediction model, the method comprising:
[0059] Step S101 is to encode the leakage characteristic data of the target well to obtain a first characteristic variable group, wherein the first characteristic variable group includes a plurality of characteristic variables. Specifically, the leakage characteristic data is obtained from the daily drilling report, logging data, well history documents and other materials of the target well.
[0060] According to a specific implementation, the encoding of the missing characteristic data of the target well to obtain the first characteristic variable group includes: deleting null values, eliminating abnormal data and normalizing the data of the missing characteristic data; and class encoding the character variables in the missing characteristic data to obtain numerical variables.
[0061] The leakage characteristic data include well number, well type, layer, lithology, formation structure, drilling pressure, rotation speed, torque, pump pressure, displacement, drilling fluid density, equivalent circulating density, hook load, mechanical drilling speed, drilling time, DC index, delay time, outlet flow, formation pressure gradient, formation fracture pressure gradient, theoretical maximum displacement, and displacement-to-pump ratio. Specifically, the well number is the identification of each well, which is convenient for management and tracking; the well type is the type of well drilled, such as exploration well, production well, water injection well, etc.; the stratigraphic position refers to the location and depth of the formation; the lithology is used to describe the rock type of the formation, such as sandstone, shale, carbonate rock, etc.; the stratigraphic structure refers to the structure and morphology of the formation, such as folds, faults, etc.; the drilling pressure is the pressure applied by the drill bit on the well wall; the rotation speed indicates the rotation speed of the drill bit; the pump pressure is the working pressure of the mud pump; the displacement refers to the flow rate of the mud pump, that is, the volume of mud pumped per unit time; the drilling fluid density indicates the density of the drilling fluid when leakage occurs; the equivalent circulating density (ECD) is used to evaluate the actual pressure and density of the drilling fluid in the wellbore. The hook load refers to the load when lifting or tightening the drill pipe; the mechanical penetration rate refers to the actual cutting speed of the drill bit; the drilling time refers to the drilling time of each section of the well during the drilling process; the DC index represents the drillability of the rock and is used to evaluate the complexity of drilling; the delay time refers to the difference between the actual time and the planned time of the drilling operation; the outlet flow rate is the flow rate of drilling mud flowing out of the wellhead; the formation pressure gradient refers to the rate at which the formation pressure changes with depth; the formation fracture pressure gradient is the rate at which the formation fracture pressure changes with depth; the theoretical maximum displacement is the maximum mud displacement calculated based on the pump performance and the wellbore size; the displacement-to-pump ratio refers to the ratio of the mud pump displacement to the drilling fluid demand.
[0062] Most of the lost circulation data obtained at the drilling site are unstructured data. Due to equipment reasons or human errors, the recorded values are abnormal. Therefore, the original data needs to be cleaned before modeling. Common processes include detecting and deleting null values, eliminating abnormal data, and normalizing data. This method can improve the accuracy of lost circulation feature data.
[0063] For example, we obtain the drilling logs, logging data, well history data and other documents of 7 wells drilled by a company in a certain period of time, and extract the feature data in the case of leakage, from which there are 98 groups of sample data and 23 columns of feature items. We use the data processing toolkits such as pandas and numpy in the python library to view the detailed information and distribution of the original data, and delete the null values and outliers.
[0064] Character-type special variables usually cannot be directly used as input parameters of artificial intelligence models, and need to be converted into numerical forms that are easy to calculate through coding. Therefore, the present invention performs factored integer coding on variables such as well number, well type, layer, lithology, and stratigraphic structure (factored integer coding is applicable to unordered categorical variables, only considering the uniqueness of the category, mapping each category to a unique integer code, and using the factorize() function of the pandas library to achieve this).
[0065] Step S102 determines a second characteristic variable group according to the correlation between the well depth at the time of leakage loss and the first characteristic variable group. The well depth at the time of leakage loss is the well depth when the leakage loss occurs (ie, the position of the leakage layer).
[0066] According to a specific implementation, determining the second characteristic variable group based on the correlation between the well depth at the time of leakage and the first characteristic variable group includes: performing a correlation analysis on the first characteristic variable group based on the well depth at the time of leakage to obtain the importance level of each characteristic variable; and screening the first characteristic variable group based on the importance level to obtain the second characteristic variable group.
[0067] The step of performing a correlation analysis on the first characteristic variable group according to the well depth at the time of leakage to obtain the importance of each characteristic variable includes: performing a correlation analysis on each characteristic variable in the first characteristic variable group and the well depth at the time of leakage based on a normalized mutual information method to obtain a normalized mutual information value, wherein the normalized mutual information value is the importance of the characteristic variable.
[0068] Specifically, the normalized mutual information value is used to capture the complex correlation between variables and is suitable for nonlinear relationship analysis of discrete and continuous variables. The closer the normalized mutual information value between two variables is to 1, the higher the correlation. After removing redundant features, displacement, formation fracture pressure gradient, ECD, rotation speed, drilling fluid density, formation pressure gradient, well number, layer, lithology, formation structure, and well type are selected as input variables of the subsequent model, and the well depth at the time of leakage is the output variable, such as Figure 2 As shown in the figure, the mutual information values between the input variables and the output variables are ranked as follows: displacement (0.85), formation fracture pressure gradient (0.72), ECD (0.66), rotation speed (0.64), drilling fluid density (0.63), formation pressure gradient (0.59), well number (0.53), layer position (0.49), lithology (0.47), formation structure (0.20), and well type (0.17). The figure reflects the influence of each feature on the location of the leaking layer.
[0069] Step S103 constructs a gradient boosting decision tree model according to the second characteristic variable group and the well depth at the time of leakage. The gradient boosting decision tree model (GBDT) is a strong learner that combines multiple weak learners (CART regression tree) based on the Boosting concept. Its core is to gradually build multiple decision trees, each tree fits the residual of the previous tree, and adds the prediction results of the new tree to the existing model for training, thereby continuously improving the performance of the model.
[0070] Specifically, the step of constructing a gradient boosting decision tree model according to the second feature variable group and the well depth at the time of leakage includes: training the gradient boosting decision tree model according to the second feature variable group and the corresponding well depth at the time of leakage, wherein the second feature variable group is the input variable of the gradient boosting decision tree model, and the well depth at the time of leakage is the output variable of the gradient boosting decision tree model; obtaining the predicted value of the gradient boosting decision tree model, and calculating the decision tree residual of the predicted value and the actual value; training a new decision tree based on the decision tree residual, and fitting the decision tree residual to the new decision tree; updating the gradient boosting decision tree model according to the new decision tree; and repeating the above operations until the number of decision trees in the gradient boosting decision tree model meets the threshold range.
[0071] All the missing data after cleaning are divided into, for example, 40% for training set, 30% for validation set, and 30% for test set. A GBDT model is built based on the training set and validation set, and grid search is used for hyperparameter tuning.
[0072] According to a specific implementation, the steps of implementing the GBDT model include:
[0073] Definition of loss function: In regression prediction, the mean square error (MSE) is usually used as the loss function of the model, denoted by y i is the actual value of the i-th sample, x i is the input variable of the i-th sample, F(x i ) is the predicted value of the i-th sample, then the loss function is defined as:
[0074]
[0075] Initialize the model: Initialize the model based on the mean of the target variable, L is the loss function, y i is the actual value, c is a constant value, then the initialization model F0(x) is defined as:
[0076]
[0077] Calculate the residual: For each sample, calculate the residual between the predicted value of the current model and the actual value, denoted by F m-1 (x i ) is the predicted value of m-1 trees, then the residual calculation formula of the mth tree is:
[0078]
[0079] Train a new tree: Train a new decision tree h based on the calculated residual m (x), the task of the new tree is to fit the residual, thereby making up for the shortcomings of the current model, N is the total number of samples, argmin h Represents finding the decision tree h that minimizes the objective function, (r i -h(x i )) 2 is the square of the difference between the residual of the i-th sample and the predicted value of the new tree, then the new decision tree h m The training process of (x) is expressed as:
[0080]
[0081] Update the model: First, introduce the learning rate v to control the contribution of the new tree to the model to prevent overfitting and ensure the stability of the model. is the predicted value on the i-th sample before the model is updated, h m (x i ) is the prediction value of the mth new decision tree on the i-th sample, then the prediction value of the updated model on the i-th sample is:
[0082]
[0083] Then add the prediction results of the new decision tree to the existing model to form a new model. is the predicted value of the current model, H m (x) is the set of prediction results of all trained decision trees, then the updated model prediction value applicable to all samples is expressed as:
[0084]
[0085] Repeat iteration: Repeat the above steps until the number of trees reaches a predetermined value or other stopping conditions.
[0086] Step S104 is to tune the hyperparameters of the gradient boosting decision tree model according to the grid search algorithm to obtain a drilling leak layer location prediction model. The grid search algorithm is usually used to perform systematic tuning of model parameters. The core idea is to first specify a parameter grid, traverse all possible parameter combinations, and then evaluate the performance of each combination to find the best parameter setting.
[0087] Specifically, the hyperparameters of the gradient boosting decision tree model are tuned according to the grid search algorithm to obtain the drilling leak layer location prediction model, including: obtaining the hyperparameters of the gradient boosting decision tree model, the hyperparameters including the number of decision trees in the gradient boosting decision tree model, the allowed growth depth and the learning rate; traversing the gradient boosting decision tree model according to the hyperparameters to obtain all parameter combinations; evaluating the performance indicators of the gradient boosting decision tree model corresponding to the parameter combinations in turn to obtain the preferred parameter combination, the performance indicators including the model accuracy and the mean square error; and applying the preferred parameter combination to the gradient boosting decision tree model to obtain the drilling leak layer location prediction model.
[0088] The steps of implementing the grid search algorithm include:
[0089] Define parameter grid: determine the model parameters that need to be tuned and their possible value ranges. For example, for the GBDT model, the key parameters that need to be tuned are learning_rate, max_depth, and n_estimators. The possible value ranges of each hyperparameter are set to learning_rate = [0.1, 0.2, 0.3], max_depth = [3, 4], and n_estimators = [50, 100, 150]. Among them, n_estimators is the number of decision trees constructed. Each tree gradually fits the residual of the previous tree according to the gradient to improve the model; max_depth is the maximum depth allowed for each decision tree to grow, which is used to control the degree of overfitting of the model; learning_rate is the learning rate contributed by each tree, that is, the weight of the prediction results of each tree in the final model. Generally, the learning rate is adjusted through cross-validation to obtain the best model performance.
[0090] Model performance evaluation: Using cross-validation to evaluate the performance of each parameter combination can avoid the problem of overfitting the model to a specific training set or test set. Common evaluation indicators include the model's R 2 Value (i.e. accuracy), mean square error, etc.
[0091] Grid search process: For a given parameter grid, the algorithm will try each parameter combination in turn and use cross-validation to calculate the performance indicators of the model under each combination.
[0092] Select the best parameter combination: Based on the results of the performance evaluation, select the best performing parameter combination as the final model hyperparameter value.
[0093] According to a specific implementation method, the normalized data is divided into a ratio of training set: validation set: test set = 6:2:2, and the corresponding data volume is 58 training sets, 20 validation sets, and 20 test sets. The GBDT model is established based on the training set and validation set, and hyperparameters are tuned, while the test set is used as the application data set of the model. Dividing the data set into training set, validation set, and test set is more conducive to the selection and optimization of the model, which can effectively prevent overfitting and ensure that the model has good generalization ability.
[0094] The GBDT model is established to predict the location of the drilling leak layer. The model performance under the default hyperparameters and grid search optimization is compared. The model performance of regression prediction is usually determined by the coefficient of determination (R 2 ) and root mean square error (RMSE). 2 The larger the value and the smaller the RMSE value, the better the model performance. The size of the RMSE value depends on the target variable. For ease of comparison, it can be replaced by the normalized RMSE (i.e., NRMSE). Figure 3 As shown in the figure, the R predicted by the GBDT model in the training set is 2 The values are 1.00 and 1.00 respectively, and the NRMSE values are 0.0006 and 0.0004 respectively; Figure 4 As shown, the R predicted by the GBDT model in the validation set 2 The values are 1.00 and 1.00 respectively, and the NRMSE values are 0.0102 and 0.0094 respectively. In summary, the NRMSE value of the model is reduced by 7.84% when the hyperparameters are tuned using grid search. Figure 5 As shown, it can be seen that the model prediction accuracy is very high and the error is very small. At this time, the key hyperparameter values of the GBDT model are: learning_rate=0.2, max_depth=3, n_estimators=100.
[0095] Application and verification of the optimal model based on the test set, such as Figure 6 and Figure 7 As shown in the figure, the data volume is 20 groups, the value predicted by the GBDT-GS model is 1.00, and the NRMSE value is 0.0010, which is basically consistent with the prediction results on the validation set. There is no overfitting phenomenon, and the model performs well. Figure 8 As shown in the figure, the residual of each observation point can be calculated based on the predicted value and actual value of the regression model. The residual of the established GBDT-GS model in predicting the location of the drilling leak layer basically conforms to the normal distribution, indicating that the model has a good overall fitting effect on the data and can be extended to the prediction of new data in the future.
[0096] The present invention mines and cleans the original data in daily drilling reports, logging data, and well history data, screens out data items related to drilling fluid loss, and pre-processes missing values and outliers; then, based on the category coding method, special variables such as character types are encoded and converted into data types that can be used as model input variables, and the importance of each characteristic variable and the leaking layer position is explained based on correlation analysis; finally, a GBDT model is established to predict the drilling leaking layer position, and the prediction effects of the model under the default hyperparameters and grid search tuning are compared, and the hyperparameter values that can improve the model accuracy are optimized, which not only achieves accurate prediction of the drilling leaking layer position, but also reduces the potential risk of well leakage, and improves the safety and sustainability of drilling operations.
[0097] The present invention also proposes a device for constructing a drilling leakage layer location prediction model, which includes: an acquisition module, used to encode the leakage characteristic data of the target well to obtain a first characteristic variable group, wherein the first characteristic variable group includes multiple characteristic variables; determining a second characteristic variable group based on the correlation between the well depth at the time of leakage and the first characteristic variable group; constructing a gradient boosting decision tree model based on the second characteristic variable group and the well depth at the time of leakage; and tuning the hyperparameters of the gradient boosting decision tree model according to a grid search algorithm to obtain a drilling leakage layer location prediction model.
[0098] The method of determining the second characteristic variable group according to the correlation between the well depth at the time of leakage and the first characteristic variable group includes: performing a correlation analysis on the first characteristic variable group according to the well depth at the time of leakage to obtain the importance level of each characteristic variable; screening the first characteristic variable group according to the importance level to obtain the second characteristic variable group; the method of performing a correlation analysis on the first characteristic variable group according to the well depth at the time of leakage to obtain the importance level of each characteristic variable includes: analyzing the correlation between each characteristic variable in the first characteristic variable group and the well depth at the time of leakage based on the normalized mutual information method to obtain a normalized mutual information value, and the normalized mutual information value is the importance level of the characteristic variable.
[0099] The method of tuning the hyperparameters of the gradient boosting decision tree model according to the grid search algorithm to obtain the drilling leak layer location prediction model includes: obtaining the hyperparameters of the gradient boosting decision tree model, the hyperparameters include the number of decision trees in the gradient boosting decision tree model, the allowed growth depth and the learning rate; traversing the gradient boosting decision tree model according to the hyperparameters to obtain all parameter combinations; sequentially evaluating the performance indicators of the gradient boosting decision tree model corresponding to the parameter combination to obtain the preferred parameter combination, the performance indicators include the model accuracy and the mean square error; applying the preferred parameter combination to the gradient boosting decision tree model to obtain the drilling leak layer location prediction model. The device not only realizes the accurate prediction of the drilling leak layer location, but also reduces the potential risk of well leakage, and improves the safety and sustainability of drilling operations.
[0100] On the other hand, the present invention also proposes a method for predicting the location of a drilling leaky layer, comprising: obtaining leaky characteristic data of a well to be measured; and substituting the leaky characteristic data of the well to be measured into the above-mentioned drilling leaky layer location prediction model to obtain the leaky layer location of the well to be measured. This method greatly improves the accuracy of predicting the location of a drilling leaky layer.
[0101] The method for constructing a drilling leak layer position prediction model proposed by the present invention includes: encoding the leakage characteristic data of the target well to obtain a first characteristic variable group, wherein the first characteristic variable group includes multiple characteristic variables; determining a second characteristic variable group according to the correlation between the well depth at the time of leakage and the first characteristic variable group; constructing a gradient boosting decision tree model according to the second characteristic variable group and the well depth at the time of leakage; and optimizing the hyperparameters of the gradient boosting decision tree model according to the grid search algorithm to obtain a drilling leak layer position prediction model. The present invention applies the gradient boosting decision tree model (GBDT-GS model) to the prediction of the drilling leak layer position by analyzing the correlation between each characteristic variable and the drilling leak layer position, which not only realizes the accurate prediction of the drilling leak layer position, but also reduces the potential risk of well leakage, and improves the safety and sustainability of drilling operations.
[0102] The optional implementation modes of the embodiments of the present invention are described in detail above in conjunction with the accompanying drawings. However, the embodiments of the present invention are not limited to the specific details in the above implementation modes. Within the technical concept of the embodiments of the present invention, various simple modifications can be made to the technical scheme of the embodiments of the present invention, and these simple modifications all belong to the protection scope of the embodiments of the present invention.
[0103] It should also be noted that the various specific technical features described in the above specific embodiments can be combined in any suitable manner without contradiction. To avoid unnecessary repetition, the embodiments of the present invention will not further describe various possible combinations.
[0104] Those skilled in the art can understand that all or part of the steps in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a program, and the program is stored in a storage medium, including a number of instructions to enable a single-chip microcomputer, a chip or a processor to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.
[0105] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included within the scope of the claims of the present application.
Claims
1. A method for constructing a prediction model for the location of a drilling leaky layer, characterized in that: The method includes: Encoding the leakage characteristic data of the target well to obtain a first characteristic variable group, wherein the first characteristic variable group includes a plurality of characteristic variables; Determine a second characteristic variable group according to the correlation between the well depth at the time of leakage and the first characteristic variable group; Constructing a gradient boosting decision tree model according to the second characteristic variable group and the well depth at the time of leakage; The hyperparameters of the gradient boosting decision tree model are optimized according to the grid search algorithm to obtain a drilling leak layer location prediction model.
2. The method according to claim 1, characterized in that The first characteristic variable group is obtained by encoding the leakage characteristic data of the target well, including: Deleting null values, eliminating abnormal data and normalizing the missing feature data; Performing category coding on the character variables in the missing feature data to obtain numerical variables; The leakage characteristic data include well number, well type, layer, lithology, formation structure, drilling pressure, rotation speed, torque, pump pressure, displacement, drilling fluid density, equivalent circulating density, hook load, mechanical drilling speed, drilling time, DC index, delay time, outlet flow, formation pressure gradient, formation fracture pressure gradient, theoretical maximum displacement, and displacement-to-pump ratio.
3. The method according to claim 1, characterized in that The determining of the second characteristic variable group according to the correlation between the well depth at the time of lost circulation and the first characteristic variable group includes: Performing a correlation analysis on the first characteristic variable group according to the well depth at the time of the leakage to obtain the importance of each characteristic variable; The first characteristic variable group is screened according to the importance degree to obtain a second characteristic variable group.
4. The method according to claim 3, characterized in that The correlation analysis of the first characteristic variable group according to the well depth at the time of leakage to obtain the importance of each characteristic variable includes: Based on the normalized mutual information method, the correlation between each characteristic variable in the first characteristic variable group and the well depth during leakage is analyzed to obtain a normalized mutual information value, and the normalized mutual information value is the importance degree of the characteristic variable.
5. The method according to claim 1, characterized in that The step of constructing a gradient boosting decision tree model according to the second characteristic variable group and the well depth at the time of leakage includes: Training a gradient boosting decision tree model according to the second feature variable group and the corresponding well depth at leakage, wherein the second feature variable group is an input variable of the gradient boosting decision tree model, and the well depth at leakage is an output variable of the gradient boosting decision tree model; Obtain the predicted value of the gradient boosting decision tree model, and calculate the decision tree residual between the predicted value and the actual value; Training a new decision tree based on the decision tree residuals, and fitting the decision tree residuals into the new decision tree; Update the gradient boosting decision tree model according to the new decision tree; The above operation is repeated until the number of decision trees in the gradient boosting decision tree model meets the threshold range.
6. The method according to claim 1, characterized in that The method of optimizing the hyperparameters of the gradient boosting decision tree model according to the grid search algorithm to obtain a drilling leak layer location prediction model includes: Obtaining hyperparameters of the gradient boosting decision tree model, wherein the hyperparameters include the number of decision trees in the gradient boosting decision tree model, the allowed growth depth, and the learning rate; Traversing the gradient boosting decision tree model according to the hyperparameters to obtain all parameter combinations; Sequentially evaluating the performance indicators of the gradient boosting decision tree model corresponding to the parameter combinations to obtain an optimal parameter combination, wherein the performance indicators include model accuracy and mean square error; The preferred parameter combination is used in the gradient boosting decision tree model to obtain the drilling leak layer location prediction model.
7. A device for constructing a prediction model for the location of a leaky layer in a well, characterized in that: The device includes: An acquisition module, used for encoding the leakage characteristic data of the target well to obtain a first characteristic variable group, wherein the first characteristic variable group includes a plurality of characteristic variables; Determine a second characteristic variable group according to the correlation between the well depth at the time of leakage and the first characteristic variable group; Constructing a gradient boosting decision tree model according to the second characteristic variable group and the well depth at the time of leakage; The hyperparameters of the gradient boosting decision tree model are optimized according to the grid search algorithm to obtain a drilling leak layer location prediction model.
8. The device according to claim 7, characterized in that The determining of the second characteristic variable group according to the correlation between the well depth at the time of lost circulation and the first characteristic variable group includes: Performing a correlation analysis on the first characteristic variable group according to the well depth at the time of the leakage to obtain the importance of each characteristic variable; Filtering the first characteristic variable group according to the importance degree to obtain a second characteristic variable group; The step of performing a correlation analysis on the first characteristic variable group according to the well depth at the time of leakage to obtain the importance of each characteristic variable includes: performing a correlation analysis on each characteristic variable in the first characteristic variable group and the well depth at the time of leakage based on a normalized mutual information method to obtain a normalized mutual information value, wherein the normalized mutual information value is the importance of the characteristic variable.
9. The device according to claim 7, characterized in that The method of optimizing the hyperparameters of the gradient boosting decision tree model according to the grid search algorithm to obtain a drilling leak layer location prediction model includes: Obtaining hyperparameters of the gradient boosting decision tree model, wherein the hyperparameters include the number of decision trees in the gradient boosting decision tree model, the allowed growth depth, and the learning rate; Traversing the gradient boosting decision tree model according to the hyperparameters to obtain all parameter combinations; Sequentially evaluating the performance indicators of the gradient boosting decision tree model corresponding to the parameter combinations to obtain an optimal parameter combination, wherein the performance indicators include model accuracy and mean square error; The preferred parameter combination is used in the gradient boosting decision tree model to obtain a drilling leaky layer location prediction model after a leak occurs.
10. A method for predicting the location of a drilling leaky layer, characterized in that: include: Obtaining the leakage characteristic data of the well to be tested; Substitute the leakage characteristic data of the well to be measured into the method for constructing a drilling leakage layer position prediction model described in any one of claims 1 to 6 to obtain a drilling leakage layer position prediction model to obtain the leakage layer position of the well to be measured.