Hook load and torque prediction method based on machine learning

By constructing a CNN-LSTM-Attention multi-dimensional temporal network model, combined with data preprocessing and hyperparameter optimization, the data quality and interpretability issues of drill string friction and torque prediction during drilling were solved, accurate prediction of hook load and torque and timely reference to abnormal problems were achieved, thereby improving drilling efficiency.

CN120597936APending Publication Date: 2025-09-05SOUTHWEST PETROLEUM UNIV
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202510686785.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-27
Publication Date
2025-09-05

AI Technical Summary

Technical Problem

When existing machine learning models are used to predict drill string friction and torque in drilling, data quality issues lead to reduced model training effectiveness and lack of interpretability, which limits their promotion and application in drilling sites.

Method used

The CNN-LSTM-Attention multi-dimensional temporal network model is used to combine time domain, non-time domain text and depth domain data to predict the load and torque of the hook. Through outlier processing, filtering and noise reduction, feature selection and normalization processing, the Bayesian hyperparameter optimization algorithm is used to optimize the model hyperparameters, and SHAP is used for interpretability analysis.

Benefits of technology

It achieves accurate prediction of hook load and torque, provides timely reference information for abnormal problems, and improves the efficiency of torsion-swing drilling operations. The model has good generalization ability and interpretability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120597936A_ABST
    Figure CN120597936A_ABST
Patent Text Reader

Abstract

The invention discloses a hook load and torque prediction method based on machine learning, and the method comprises the following steps: S1, collecting original data, and carrying out the preprocessing of the original data, and obtaining a sample data set; s2, constructing a CNN-LSTM-Attention multi-dimensional sequential network model, and setting hyper-parameters of the model; s3, training the CNN-LSTM-Attention multi-dimensional time sequence network model by adopting the sample data set, so as to obtain a trained CNN-LSTM-Attention multi-dimensional time sequence network model; and S4, predicting the load and the torque of the hook by adopting the trained CNN-LSTM-Attention multi-dimensional sequential network model. According to the method, the hook load and the torque can be accurately predicted, the CNN-LSTM-Attention multi-dimensional sequential network model adopted for prediction can be explained through the SHAP, reference information can be provided in time before abnormal problems occur, decision making can be assisted, and therefore the torsional pendulum drilling operation efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of oil and gas field development, and in particular to a method for predicting hook load and torque based on machine learning. Background Art

[0002] As oil and gas extraction continues to increase in depth, drilling technology faces more difficult challenges. One of the main challenges facing traditional horizontal well drilling methods is excessive drill string friction and torque, which often leads to problems such as stuck drill string and buckling, seriously affecting the transmission of drilling pressure and drilling safety. Accurately predicting drill string friction and torque can not only prevent complex downhole accidents such as stuck drill string and drill string buckling, but also optimize drilling parameters and improve drilling efficiency. However, although many scholars have achieved remarkable results in this field in recent years and have played a positive guiding role in field operations, current research still has the following problems and deficiencies:

[0003] First and foremost is the issue of data quality. The performance of machine learning models is highly dependent on both the quality and quantity of data. In actual drilling operations, mud logging data often contains noise, missing values, or outliers, which reduces the effectiveness of model training. Furthermore, inconsistencies in data sources also affect the model's generalization capabilities. While machine learning offers strong fitting capabilities, its "black box" nature makes the model's predictions lack interpretability. In engineering applications, it's difficult to clearly identify the causes and key influencing factors of prediction results, which, to a certain extent, limits its widespread application in drilling sites. Summary of the Invention

[0004] In response to the above problems, the present invention aims to provide a hook load and torque prediction method based on machine learning.

[0005] The technical solutions of the present invention are as follows:

[0006] A method for predicting hook load and torque based on machine learning, comprising the following steps:

[0007] S1: Collecting raw data and preprocessing the raw data to obtain a sample data set;

[0008] S2: Build a CNN-LSTM-Attention multi-dimensional temporal network model and set model hyperparameters;

[0009] S3: Using the sample data set to train the CNN-LSTM-Attention multi-dimensional temporal network model to obtain a trained CNN-LSTM-Attention multi-dimensional temporal network model;

[0010] S4: The trained CNN-LSTM-Attention multi-dimensional temporal network model is used to predict the hook load and torque.

[0011] Preferably, in step S1, the original data includes time domain data, non-time series text data and depth domain data;

[0012] The time domain data includes weight on bit, standpipe pressure, rotary table speed, total pump stroke, inlet temperature, outlet temperature, inlet conductance, outlet conductance, inlet density, outlet density, inlet flow rate, outlet flow rate, total pool volume, mechanical penetration rate, tool face angle, hook load and torque;

[0013] The non-time-series text data includes drilling fluid system and drilling tool assembly;

[0014] The depth domain data includes depth measurement, well inclination angle and azimuth angle.

[0015] Preferably, in step S1, the preprocessing includes outlier processing, filtering and noise reduction processing, feature selection, feature data normalization, sample construction and data set division.

[0016] Preferably, when performing feature selection, the correlation between different parameters and the hook load and torque is calculated, and then feature selection is performed based on the correlation calculation results.

[0017] Preferably, when the hook load needs to be predicted, the selected features include well depth, bit weight, standpipe pressure, rotary table speed, total pump stroke, outlet temperature, inlet density, inlet flow rate, total pool volume, drill string assembly, tool face angle, well inclination angle, azimuth angle and mechanical penetration rate;

[0018] When torque prediction is required, the selected features include well depth, weight on bit, rate of penetration, standpipe pressure, rotary table speed, total pump stroke, outlet temperature, inlet conductance, outlet flow rate, drill string assembly, and tool face angle.

[0019] Preferably, in step S2, the CNN-LSTM-Attention multi-dimensional temporal network model includes an input layer, a CNN layer, an activation function layer, an LSTM layer, an Attention layer, a fully connected layer and a discard layer connected in sequence.

[0020] Preferably, in step S3, during training, the step of optimizing the model hyperparameters is also included.

[0021] Preferably, the Bayesian hyperparameter optimization algorithm is used to optimize the model hyperparameters.

[0022] Preferably, in step S3, during training, any one or more of mean absolute error, root mean square error, and goodness of fit are used as prediction evaluation indicators.

[0023] Preferably, in step S3, after obtaining the trained CNN-LSTM-Attention multi-dimensional temporal network model, the step of performing interpretability analysis on it using SHAP is also included.

[0024] The beneficial effects of the present invention are:

[0025] The present invention can accurately predict hook load and torque, and the CNN-LSTM-Attention multidimensional temporal network model used in the prediction can be interpreted through SHAP, enabling the present invention to provide reference information in a timely manner before abnormal problems occur and assist in decision-making, thereby improving the efficiency of torsion pendulum drilling operations. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0027] Figure 1 This is a schematic diagram of the structure of the CNN-LSTM-Attention multi-dimensional temporal network model of the present invention;

[0028] Figure 2 This is a schematic diagram of the training process of the CNN-LSTM-Attention multi-dimensional temporal network model of the present invention;

[0029] Figure 3-Figure 6 They are all parameter change curves of the torsion pendulum section in a specific embodiment;

[0030] Figure 7 A heat map showing the correlation between parameters for predicting hook load in a specific embodiment;

[0031] Figure 8 A heat map showing correlations between various parameters of predicted torque in a specific embodiment;

[0032] Figure 9 A graph showing the predicted results of the hook load in a torsion-swing well section under different input parameter combination tests in a specific embodiment;

[0033] Figure 10 A schematic diagram of the hook load prediction results with different hyperparameter combinations in a specific embodiment;

[0034] Figure 11 A comparison diagram of the hook load prediction results before and after the hyperparameter optimization for the torsion swing well section test in a specific embodiment;

[0035] Figure 12This is a scatter cloud diagram of the hook load prediction of different models for testing the torsion swing well section in a specific embodiment;

[0036] Figure 13 A Taylor diagram showing the predicted hook load for different models in a torsion swing well section test in a specific embodiment;

[0037] Figure 14 A curve diagram showing torque prediction results of a torsion swing well section tested with different input parameter combinations in a specific embodiment;

[0038] Figure 15 A schematic diagram of torque prediction results for different hyperparameter combinations in a specific embodiment;

[0039] Figure 16 A comparison diagram of torque prediction results before and after hyperparameter optimization for a torsion swing well section test in a specific embodiment;

[0040] Figure 17 This is a scatter cloud diagram of torque predictions of different models for testing a torsion swing well section in a specific embodiment;

[0041] Figure 18 A Taylor diagram showing torque predictions for different models in a torsion swing well section test in a specific embodiment;

[0042] Figure 19 A schematic diagram of the microscopic interpretation of various parameters of the hook load prediction model in a specific embodiment;

[0043] Figure 20 Schematic diagram for explaining parameters of a torque prediction model in a specific embodiment. DETAILED DESCRIPTION

[0044] The present invention is further described below with reference to the accompanying drawings and examples. It should be noted that, in the absence of conflict, the embodiments in this application and the technical features in the embodiments can be combined with each other. It should be noted that, unless otherwise specified, all technical and scientific terms used in this application have the same meanings as those commonly understood by those of ordinary skill in the art to which this application belongs. The use of similar words such as "include" or "comprising" in the present invention means that the elements or objects appearing before the word cover the elements or objects listed after the word and their equivalents, without excluding other elements or objects.

[0045] The present invention provides a method for predicting hook load and torque based on machine learning, comprising the following steps:

[0046] S1: Collecting raw data and preprocessing the raw data to obtain a sample data set.

[0047] In a specific embodiment, the raw data is actual drilling data of the target well, including logging time database data, logging depth domain data, inclination survey data, drilling log text data, drill tool assembly text data, and mud property data. Based on the time series and data type of this data, it is divided into time domain data, non-time series text data, and depth domain data.

[0048] In a specific embodiment, the time domain data includes drilling pressure, standpipe pressure, rotary table speed, total pump stroke, inlet temperature, outlet temperature, inlet conductivity, outlet conductivity, inlet density, outlet density, inlet flow rate, outlet flow rate, total pool volume, mechanical penetration rate, tool face angle, hook load and torque; the non-time-series text data includes drilling fluid system and drill tool assembly; the depth domain data includes depth measurement, well inclination and azimuth.

[0049] In the above embodiment, the time domain data does not need to be converted into time series data. It only needs to extract the corresponding torsion and swing segment samples according to the drilling log to serve as a part of the input feature sample set.

[0050] For non-time-series text data, regular expressions in Python are used to extract textual information corresponding to the torsion-pendulum segment, thereby converting the drilling fluid system, drill tool assembly, and drill tool type into quantifiable data. When the drilling fluid system remains the same, it remains largely unchanged during the torsion-pendulum segment. Therefore, changes in the drilling fluid system can be ignored, and only the drill tool assembly is processed for the non-time-series text data. Furthermore, some parameters of the drill tool assembly corresponding to the torsion-pendulum segment remain unchanged, such as the drill bit diameter and bit type. Therefore, these can be removed, retaining only the parameters that change (the total length of the standard drill pipe (DP), the HWDP diameter, and the standard drill pipe diameter).

[0051] Linear interpolation is primarily used to process depth-domain data and convert it into time-domain data. Specifically, the inclination and azimuth angles corresponding to the wobble interval are extracted. Missing time intervals are then filled using linear interpolation of adjacent non-outlier values. Finally, data splicing is performed to obtain a data sample set under wobble conditions within the depth range.

[0052] In a specific embodiment, the preprocessing includes outlier processing, filtering and noise reduction processing, feature selection, feature data normalization, sample construction and data set division.

[0053] Outliers are often caused by human factors, equipment failure, data entry errors, or complex downhole conditions. They can severely impact the statistical results of a dataset and interfere with the accuracy of prediction models. Data quality can be improved through outlier processing.

[0054] Since the Median Absolute Deviation (MAD) method is not sensitive to samples and will not cause serious estimation deviations due to special outliers, in a specific embodiment, the MAD method is used to detect outliers.

[0055] After outliers are detected, in order to eliminate the influence of outliers, linear interpolation of adjacent non-outlier values ​​can be used to fill the outlier points.

[0056] Due to inherent errors in data measurement instruments and human error, raw logging data can be affected by noise. Using noisy data directly often prolongs machine learning model training time and reduces model prediction accuracy, leading to poor generalization. Therefore, to eliminate spurious data and retain reliable data, noise reduction filtering is necessary.

[0057] Considering that Kalman Filter is an algorithm that performs noise suppression and data fusion by estimating the state of the system, and that the algorithm can maintain the original variation characteristics of the data while removing noise, it is widely used in fields such as mud logging data processing and signal processing. Therefore, in a specific embodiment, the Kalman filter method is used to perform noise reduction on the mud logging data set.

[0058] In one specific embodiment, feature selection is performed by calculating the correlation between different parameters and hook load and torque, and then performing feature selection based on the correlation calculation results. Optionally, three correlation analysis methods, Pearson, Spearman, and Kendall, are used to analyze the linear and nonlinear correlations between hook load torque and characteristic parameters.

[0059] In a specific embodiment, when it is necessary to predict the hook load, the selected features include well depth, bit weight, standpipe pressure, rotary table speed, total pump stroke, outlet temperature, inlet density, inlet flow rate, total pool volume, drill string assembly, tool face angle, well inclination angle, azimuth angle, and mechanical penetration rate;

[0060] When torque prediction is required, the selected features include well depth, weight on bit, rate of penetration, standpipe pressure, rotary table speed, total pump stroke, outlet temperature, inlet conductance, outlet flow rate, drill string assembly, and tool face angle.

[0061] Normalization maps different types of feature data to a specific range, eliminating the impact of dimensionality without affecting the data's characteristics. This accelerates the processing of machine learning models and reduces training time. It should be noted that normalization typically only applies to input features and does not include label data. However, the present invention utilizes a multidimensional temporal network model, which also includes historical labels, namely hook load torque data, as input features. Therefore, hook load torque also requires normalization. In one specific embodiment, maximum-minimum normalization is used to map the feature data to the range [0, 1].

[0062] In order to obtain the response information of the feature data and label data sequence over time, in a specific embodiment, a sliding window method is used to construct samples. Since the sliding window can use useful information in long sequence data to train the model, it is widely used in time series analysis. The normalized data is organized into a matrix form, where the feature data on the left is used as input, representing the selected model input parameters, and the corresponding labels on the right are used as output, representing the hook torque corresponding to each parameter data point. The sliding window size, that is, the number of selected samples, is set, and a sample can be constructed by moving the sliding window one step along the time sequence direction. Considering that the hook torque is a time series task, in order to keep the features and labels continuous on the sequence samples, the sliding window step is set to 1.

[0063] In a specific embodiment, the training set and test set are divided into a ratio of 8:2. It should be noted that the division ratio is mainly determined by the number of samples in the dataset. As long as it can effectively balance the needs of training and evaluation, ensure that the model can fully learn the data pattern during training, and verify its generalization ability on the test set, any ratio is applicable to the present invention.

[0064] S2: Build a CNN-LSTM-Attention multi-dimensional temporal network model and set model hyperparameters.

[0065] In a specific embodiment, Figure 1 As shown in the figure, the CNN-LSTM-Attention multi-dimensional temporal network model includes an input layer, a CNN layer, an activation function layer, an LSTM layer, an Attention layer, a fully connected layer, and a dropout layer, which are connected in sequence. In this embodiment, in order to maintain the standard Attention calculation process and not affect the continuity and integrity of feature expression, the output part is directly entered after Attention(Q, K, V) = Softmax(), and there is no need to perform additional Softmax on the attention matrix.

[0066] In the above embodiment, the CNN-LSTM-Attention multi-dimensional temporal network model is capable of processing multiple feature time series data. In drilling operations, data such as weight on bit, rotary table speed, and standpipe pressure are all multi-dimensional time series, and these data may have complex interdependencies. The present invention utilizes the CNN-LSTM-Attention multi-dimensional temporal network model to learn how to predict future values ​​of hook torque from the historical relationships between these multiple features.

[0067] In the CNN-LSTM-Attention multi-dimensional time series network model, the CNN layer is used to process the local features of time series data, the LSTM layer is used to capture the temporal dependencies in the data, and the Attention layer is responsible for dynamically assigning weights to different parts of the input, helping the model focus on key features. The fully connected layer can help the model better process complex time series data. The CNN-LSTM-Attention multi-dimensional time series network model described in the present invention combines the advantages of CNN and LSTM, can comprehensively consider the complexity of time series and the relationship between multiple features, and provide accurate prediction results. It is particularly suitable for prediction tasks involving multi-dimensional features and complex time series dependencies.

[0068] In a specific embodiment, the activation function layer adopts the Relu activation function, and the drop layer size is set to 0.2, which means that 20% of the neurons are dropped each time the model is trained, so as to avoid the overfitting phenomenon of the model.

[0069] In a specific embodiment, the model hyperparameters are preset according to experience. The hyperparameters that need to be set include the number of hidden layer neurons (Hidden_size), convolution kernel size (Kernel_size), dropout rate (Dropout), sliding window size (Seq_length), number of linear layers (Num_layers), batch size (Batch_size), and learning rate size (Lr).

[0070] S3: Use the sample data set to train the CNN-LSTM-Attention multi-dimensional temporal network model to obtain a trained CNN-LSTM-Attention multi-dimensional temporal network model.

[0071] In a specific embodiment, the training process of the CNN-LSTM-Attention multi-dimensional temporal network model is as follows: Figure 2 As shown, it includes the following stages:

[0072] (1) Using Python's Pandas library to import processed time database data, a single-step sample set is constructed using a sliding window. The sample set includes features and labels. Features are fed into the model in batches, and labels are used to calculate errors with the model output.

[0073] (2) Load the sample set into the format of the adapted model through the DataLoader to complete the data preparation process;

[0074] (3) The input data passes through each layer of the model step by step. First, it passes through the CNN layer of the model to extract the local time step features of the predicted torsion pendulum hook torque, and uses the Relu activation function to help the model learn the nonlinear patterns in the data. Next, it passes through the LSTM layer to capture the mutual dependence between the previous and next time in the data. It further passes through the Attention layer to focus on key features. Then, the data is processed by the Softmax function to be within the range of [0,1], and the sum of the input weights of the previous layer is guaranteed to be 1. Then, it passes through the discard layer to make some neurons invalid to avoid overfitting of the model, and finally enters the fully connected layer to obtain the output value;

[0075] (4) Set the Adam optimizer to minimize the loss function, iteratively calculate the error between the model output value and the label, and calculate the gradient of the loss function with respect to the model parameters. Then, the optimizer is used to update the weights and bias terms of the model, and the training data is repeated multiple times until the training converges.

[0076] In a specific embodiment, the training also includes the step of optimizing the model hyperparameters.

[0077] Common hyperparameter optimization methods include grid search, random search, and orthogonal experimentation. Grid search is computationally expensive, inefficient, and wastes significant computing resources. It also struggles with large hyperparameter spaces. Random search can miss some hyperparameter combinations, potentially missing the optimal solution and resulting in unstable results. Orthogonal experimentation has a narrower applicability and requires that all parameter levels be set consistently, which is difficult to achieve with a large number of parameters.

[0078] In a specific embodiment, a Bayesian hyperparameter optimization algorithm is used to optimize the model hyperparameters. In this embodiment, the Bayesian hyperparameter optimization algorithm is an optimization method based on a probability model. By constructing a proxy model of the objective function, considering previous parameter information, and continuously updating the prior, it can efficiently explore and utilize the hyperparameter space and find the optimal solution in each iteration. The specific optimization steps of the Bayesian hyperparameter optimization algorithm are as follows:

[0079] (1) Define the objective function. Suppose there is an objective function f(x) that needs to be optimized.

[0080] (2) Select the hyperparameter search range and randomly select the initial hyperparameter point;

[0081] (3) Construct a Gaussian process (GP) and use it to fit the target function f(x), that is: f(x) ~ GP(m(x), k(x, x')), where m(x) is the mean function, usually set to 0, and k(x, x') is the covariance function, that is: where σ 2 is the variance hyperparameter, l is the length scale hyperparameter;

[0082] (4) Calculate the acquisition function α(x);

[0083] (5) Determine whether the termination condition is met. If not, select a new sampling point, evaluate the objective function, and update the data until the termination condition is met.

[0084] In a specific embodiment, during training, any one or more of mean absolute error, root mean square error, and goodness of fit are used as prediction evaluation indicators.

[0085] In a specific embodiment, after obtaining the trained CNN-LSTM-Attention multi-dimensional temporal network model, the step of performing interpretability analysis on it using SHAP is also included.

[0086] In the hook load torque prediction task, the SHAP method can reveal which features have the greatest impact on the model's prediction results and provide transparency into the model's decision-making process. The SHAP value calculates the contribution of each feature to the prediction by considering all possible permutations of the model's input features. Its core idea is to determine how to fairly distribute the contribution of each feature to the final prediction given a set of features. The Shapley value of each feature represents the contribution of that feature to that particular prediction, and its calculation formula is as follows:

[0087]

[0088] Where: f(S) is the model prediction value of the given feature set S; φ i (f) is the SHAP value of feature i, which indicates the contribution of the feature to the model output. The SHAP value can be positive or negative, indicating whether the feature promotes an increase or decrease in the prediction result. N is the set of all features; S is a subset of the feature set; |S| is the number of elements in set S; |N| is the number of elements in set N.

[0089] S4: The trained CNN-LSTM-Attention multi-dimensional temporal network model is used to predict the hook load and torque.

[0090] In a specific embodiment, taking Sichuan Z201H69-4 well as an example, the hook load and torque prediction method based on machine learning of the present invention is used to predict its hook load and torque. In this embodiment, the original data comes from the actual drilling data of the well, totaling about 2 million sample data, of which the time domain data is as follows. Figure 3 and Figure 4 As shown, the non-time series text data is as follows Figure 5 As shown, the depth domain data is interpolated as Figure 6 The sample data set variable statistics are shown in Table 1:

[0091] Table 1 Statistics of variables in the sample data set

[0092]

[0093] The outlier detection results are shown in Table 2:

[0094] Table 2 Outlier detection results

[0095]

[0096] The correlation calculation results are shown in Table 3 and Table 4:

[0097] Table 3 Correlation coefficients between hook load and characteristic parameters

[0098]

[0099]

[0100] Table 4 Correlation coefficients between torque and characteristic parameters

[0101]

[0102] The relationship between the size of the correlation coefficient and the correlation is shown in Table 5:

[0103] Table 5 Correlation level classification table

[0104]

[0105] As can be seen from Tables 3-5, hook load is positively correlated with parameters such as total pump stroke, inlet flow rate, and total pool volume, and negatively correlated with well depth, well inclination, azimuth, mechanical penetration rate, tool face angle, drill tool assembly type, bit pressure, standpipe pressure, rotary table speed, inlet temperature, outlet temperature, inlet density, and outlet density. It has a weak correlation with inlet conductance, outlet conductance, and outlet flow rate, with correlation coefficients less than or equal to 0.09. Torque is positively correlated with well depth, mechanical penetration rate, tool face angle, drill tool assembly type, bit pressure, standpipe pressure, rotary table speed, inlet temperature, and outlet temperature, and negatively correlated with total pump stroke, inlet conductance, outlet conductance, inlet flow rate, and outlet flow rate. It has a weak correlation with well inclination, azimuth, inlet density, outlet density, and total pool volume.

[0106] Hook load exhibits a strong correlation with weight on bit (WOB), with the absolute values ​​of the correlation coefficients calculated using all three methods exceeding 0.75. Torque, on the other hand, exhibits a strong correlation with rotary table speed. The order of correlation with hook load characteristics is: WOB > ROP > BHA type > well depth > inlet density > well inclination > standpipe pressure > rotary table speed > total pump stroke > inlet flow rate > outlet density > total pool volume > tool face angle > outlet temperature > azimuth > inlet temperature > outlet conductance > inlet conductance > outlet flow rate. The order of correlation with torque characteristics is: rotary table speed > well depth > BHA type > WOB > ROP > tool face angle > total pump stroke > inlet flow rate > inlet temperature > outlet temperature > outlet flow rate > inlet conductance > standpipe pressure > outlet conductance > outlet density > inlet density > azimuth > well inclination > total pool volume.

[0107] Based on the above data analysis results, the features with weak correlation were eliminated, and the physical model feature information was considered, and two sets of model input feature parameter sets were comprehensively determined for predicting the hook load and torque respectively. Figure 7 and Figure 8 As shown in the correlation heat map, 14 parameters, including well depth, bit weight, standpipe pressure, rotary table speed, total pump stroke, outlet temperature, inlet density, inlet flow rate, total pool volume, drill bit assembly, tool face angle, well inclination, azimuth and mechanical penetration rate, are used as model input parameters for predicting hook load; and 11 parameters, including well depth, bit weight, mechanical penetration rate, standpipe pressure, rotary table speed, total pump stroke, outlet temperature, inlet conductance, outlet flow rate, drill bit assembly and tool face angle, are used as model input parameters for predicting torque.

[0108] During training, the training set and test set are divided into 8:2 ratios, and the model hyperparameters are set as shown in Table 6:

[0109] Table 6 Model hyperparameters

[0110]

[0111] In order to analyze the influence of different characteristic parameter combinations on the predicted hook load, 10 different parameter combinations were designed according to the order of correlation coefficients. The prediction results of the hook load in the torsion swing section of each parameter combination are shown in Table 7 and Table 8. Figure 9 As shown:

[0112] Table 7 Prediction results of hook load in the torsion section under different input parameter combinations

[0113]

[0114] From Table 7 and Figure 9 It can be seen that: (1) the average absolute error of the hook load prediction under different input parameter combinations is between 11.16kN and 20.88kN, the root mean square error is between 13.90kN and 24.23kN, and the goodness of fit (R 2 ) is generally greater than 0.8; (2) The hook load prediction results of combination 9 are closest to the actual values ​​(mean absolute error, root mean square error and goodness of fit are 11.16kN, 13.90kN and 0.92 respectively), indicating that too few input parameters will cause the data-driven model to be unable to effectively learn the trend of hook load changes over time, and in the case of limited samples, the model may not converge, and the input collinearity characteristics (such as inlet flow and total pump stroke, mechanical drilling speed and inlet density) will interfere with the prediction accuracy of the model; (3) in the increasing When the drill string assembly, riser pressure, inclinometer data, and tool face angle were added as model inputs, model performance was significantly improved. The mean absolute error decreased by 1.25 kN, 2.08 kN, 0.13 kN, and 4.93 kN, respectively, compared to the previous group. The root mean square error decreased by 1.65 kN, 2.11 kN, 0.80 kN, and 5.74 kN, respectively. The goodness of fit improved by 3%, 3%, 1%, and 9%, respectively, indicating that the model learned key information for predicting hook load and assigned greater weight to these parameters. However, when all parameters were used as model inputs, that is, combination 10, the performance was the worst. This may be because the excessive number of input parameters increased the burden of model training, thereby reducing model performance.

[0115] After determining that the optimal input feature combination for the model is combination 9, the model hyperparameters are optimized. First, an objective function is constructed, whose input is the hyperparameter combination and whose output is the mean absolute error (MAE) of the corresponding model prediction. The objective function is then modeled using a Gaussian process regression model. Finally, the acquisition function guides the hyperparameter search. Due to the uncertainty factor of Bayesian optimization, selecting the hyperparameter combination most likely to improve model performance for experimentation can achieve efficient hyperparameter tuning. The value ranges of each hyperparameter are shown in Table 8:

[0116] Table 8 Model hyperparameter value range

[0117]

[0118] According to the value range of hyperparameters, 20 comparative experiments were conducted. Under the condition that the optimal input feature combination is determined to be combination 9, the CNN-LSTM-Attention multi-dimensional time series network model was trained using 20 different hyperparameter combinations, and the test torsion well section was predicted. The prediction results are shown in Table 9 and Figure 10-11 As shown:

[0119] Table 9 Prediction results of different model hyperparameter combinations

[0120]

[0121]

[0122] From Table 9 and Figure 10-11 It can be seen that: (1) the predicted hook loads with different values ​​of the hyperparameters have a mean absolute error (MAE) ranging from 3.45 kN to 17.68 kN; (2) the prediction effect of group 12 is the best, with a mean absolute error of 3.45 kN. Therefore, it is recommended to use a sliding window size (seq_length) of 5, a batch size (batch_size) of 64, a convolution kernel size (kernel_size) of 5, a number of hidden layer neurons (hidden_size) of 100, a dropout rate (dropout) of 0.2, and a learning rate (lr) of 1.46×10 -4 and the number of linear layers (num_layers) is 3; (3) Figure 11 The comparison curve before and after the hyperparameter optimization of the optimal input feature combination 9 shows that the Bayesian optimization hyperparameters further improve the model performance.

[0123] In addition, to compare and analyze the effectiveness of different machine learning models in predicting hook load, five single models were constructed: a multi-layer perceptron (MLP), a long short-term memory neural network (LSTM), a convolutional neural network (CNN), a gated recurrent unit (GRU), and a Transformer neural network with a self-attention mechanism. Four fusion models, including CNN-MLP, CNN-LSTM, CNN-GRU, and CNN-Transformer, were also constructed. The hook load for the torsion swing test section of the target well in this example was predicted and compared with the CNN-LSTM-Attention multidimensional temporal network model described in this invention.

[0124] In order to concisely and intuitively show the similarity between the prediction results of different models and the measured values, the results are presented in two forms: scatter cloud diagram and Taylor diagram. The scatter cloud diagram shows the degree of fit between the prediction values ​​of different models and the measured values. The results are as follows Figure 12 As shown; the color bar on the right represents the prediction error. Yellow represents the maximum deviation from the measured value, and dark blue represents the closest to the measured value. The Taylor diagram combines the three evaluation indicators of standard deviation, correlation coefficient, and root mean square error (RMSD) into a chart. The chart consists of a polar coordinate system, an origin, and a semicircular curve. The result is shown in the figure below. Figure 13 As shown; the red five-pointed star represents the observed value, and the other color symbols represent a model. The closer the position is to the red five-pointed star, the closer the predicted result is to the measured value.

[0125] Combine Figure 12 and Figure 13 It can be seen that the CNN-LSTM-Attention multidimensional time series network model of the present invention has the best hook load prediction effect, and the prediction goodness of fit (R 2 ) is 0.97, the standard deviation and root mean square error are 6.84 kN and 9.78 kN respectively, and the correlation coefficient is close to 0.99. Other models cannot achieve the accuracy that can be achieved by the present invention.

[0126] Referring to the above-mentioned data set ratio division for predicting hook load, 8 different input parameter combination experimental schemes were designed. The goal of each combination is to optimize the torque prediction model by combining different features. The torque prediction results of the torsion swing section of each parameter combination are shown in Tables 10 and Figure 14 As shown:

[0127] Table 10 Torque prediction results of the torsion swing well section tested with different input parameter combinations

[0128]

[0129] From Table 10 and Figure 14 It can be seen that: (1) the average absolute error of torque prediction under different input parameter combinations is 0.21kN·m~0.34kN·m, the root mean square error is 0.28kN·m~0.48kN·m, and the goodness of fit (R 2) are all greater than 0.8 except combination 1, indicating that most parameter combinations can fit the measured torque data well and achieve effective prediction; (2) Combination 4 has the best model performance, and the torque prediction results are closest to the measured values ​​(the average absolute error, root mean square error and goodness of fit are 0.21 kN·m, 0.28 kN·m and 0.91 respectively); (3) Combinations 2, 3 and 4 successively added mechanical drilling speed, tool face angle and total pump stroke parameters, which significantly improved the model performance, reduced the average absolute error by 0.13 kN·m, reduced the root mean square error by 0.20 kN·m, and increased the goodness of fit by 0.17. This shows that these three characteristic parameters play an important role in the torque prediction model, help the model learn more key information about torque, and further improve the prediction accuracy of the model; (4) In combinations 5 to 8, the addition of features such as outlet temperature, outlet flow, inlet conductivity and riser pressure did not significantly improve the model performance. In some cases, the model accuracy even showed a small decline. This may be related to the collinearity between these features, particularly the strong correlation between inlet conductance, outlet flow rate, and outlet temperature, which may have introduced redundant information and interfered with model training. These results suggest that these features do not provide additional valuable information in the current dataset and may even have a negative impact on model performance. Based on the above analysis, combination 4 is preferred as the optimal feature parameter combination for predicting torque. This combination not only effectively improves prediction accuracy but also maintains high computational efficiency while reducing redundant features, providing a more practical solution for practical applications.

[0130] Similarly, after determining that the optimal input feature combination of the model is combination 4, the model hyperparameters are optimized. The value ranges of each hyperparameter are shown in Table 11:

[0131] Table 11 Model hyperparameter value range

[0132]

[0133] The same 20 comparative experiments were conducted. The prediction results of each round are shown in Table 12 and Figure 15-16 As shown:

[0134] Table 12 Prediction results of different model hyperparameter combinations

[0135]

[0136] From Table 12 and Figure 15-16It can be seen that: (1) different hyperparameter combinations have a significant impact on the mean absolute error (MAE) of torque prediction, and the error range of the prediction results is between 0.09 kN·m and 0.48 kN·m, showing that the hyperparameters have a wide range of effects on the model performance; (2) among all the 20 hyperparameter combinations, the prediction effect of group 14 is the best, with a mean absolute error of 0.09 kN·m, which is significantly better than other combinations, showing the superior performance of this hyperparameter combination in predicting torque. Therefore, the optimal hyperparameter combination is recommended as follows: sliding window size (seq_length) of 3, batch size (batch_size) of 64, convolution kernel size (kernel_size) of 3, number of hidden layer neurons (hidden_size) of 150, dropout rate (dropout) of 0.2, and learning rate (lr) of 0.98×10 -4 and the number of linear layers (num_layers) is 3; (3) the mean absolute error (MAE) after optimization is reduced by 0.15 kN·m compared with that before optimization. The optimized model prediction is closer to the true value, and the error is significantly reduced, further proving the importance of hyperparameter optimization in improving model accuracy.

[0137] Similarly, five single models, including multi-layer perceptron (MLP), long short-term memory neural network (LSTM), convolutional neural network (CNN), gated recurrent unit (GRU), and Transformer neural network with self-attention mechanism, as well as four fusion models of CNN-MLP, CNN-LSTM, CNN-GRU and CNN-Transformer, were used to predict the torque of the torsional swing test section of the target well in this embodiment, and compared with the CNN-LSTM-Attention multi-dimensional temporal network model described in the present invention. The results are as follows: Figure 17 and Figure 18 shown.

[0138] from Figure 17 and Figure 18 It can be seen that the torque prediction effect of the CNN-LSTM-Attention multi-dimensional temporal network model of the present invention is the best, and the prediction goodness of fit (R 2 ) is 0.95, the standard deviation and root mean square error are 0.23 kN·m and 0.25 kN·m respectively, and the correlation coefficient is close to 0.97. Other models cannot achieve the accuracy achieved by the present invention.

[0139] In order to better explain the CNN-LSTM-Attention multidimensional temporal network model of the present invention and gain a deeper understanding of the influence of various input features on the load and torque of the hook, the SHAP method is used to explain the model. The calculation results are as follows: Figure 19 and Figure 20As shown in the figure, the red features of the beeswax graph make the predicted value larger, the blue features make the predicted value smaller, the purple features are close to the mean, and the positive and negative features represent the positive and negative contributions of the input features to the model.

[0140] from Figure 19 and Figure 20 It can be seen that: (1) using the CNN-LSTM-Attention multi-dimensional temporal network model described in the present invention, historical hook load and historical torque have the greatest impact on the prediction results, followed by drilling pressure and rotation speed. According to previous studies and the friction torque physical model, drilling pressure and rotation speed are the main factors affecting the hook load and torque. Therefore, it can be seen that the calculation results of the present invention are consistent with physical laws and engineering practice, indicating that the response of the input characteristics is basically in line with expectations; (2) The increase in the hook load is mainly contributed by the historical hook load, total pump stroke, inlet flow rate and azimuth angle, while drilling pressure and rotary table speed have an inhibitory effect on the hook load. The increase in torque is mainly contributed by historical torque, rotary table speed, drilling pressure and tool face angle, while the total pump stroke has an inhibitory effect on it.

[0141] In summary, the CNN-LSTM-Attention multidimensional temporal network model established in this invention can accurately predict hook load and torque. Compared with the existing technology, this invention has made significant progress.

[0142] The above description is merely a preferred embodiment of the present invention and does not constitute any form of limitation to the present invention. Although the present invention has been disclosed as a preferred embodiment as above, it is not intended to limit the present invention. Any technician familiar with this profession can make some changes or modifications to equivalent embodiments of the technical contents disclosed above without departing from the scope of the technical solution of the present invention. However, any simple modifications, equivalent changes and modifications made to the above embodiments based on the technical essence of the present invention without departing from the content of the technical solution of the present invention are still within the scope of the technical solution of the present invention.

Claims

1. A method for predicting hook load and torque based on machine learning, characterized in that: The following steps are involved: S1: Collecting raw data and preprocessing the raw data to obtain a sample data set; S2: Build a CNN-LSTM-Attention multi-dimensional temporal network model and set model hyperparameters; S3: Using the sample data set to train the CNN-LSTM-Attention multi-dimensional temporal network model to obtain a trained CNN-LSTM-Attention multi-dimensional temporal network model; S4: The trained CNN-LSTM-Attention multi-dimensional temporal network model is used to predict the hook load and torque.

2. The method for predicting hook load and torque based on machine learning according to claim 1, characterized in that: In step S1, the original data includes time domain data, non-time series text data and depth domain data; The time domain data includes weight on bit, standpipe pressure, rotary table speed, total pump stroke, inlet temperature, outlet temperature, inlet conductance, outlet conductance, inlet density, outlet density, inlet flow rate, outlet flow rate, total pool volume, mechanical penetration rate, tool face angle, hook load and torque; The non-time-series text data includes drilling fluid system and drilling tool assembly; The depth domain data includes depth measurement, well inclination angle and azimuth angle.

3. The method for predicting hook load and torque based on machine learning according to claim 2, characterized in that: In step S1, the preprocessing includes outlier processing, filtering and noise reduction processing, feature selection, feature data normalization, sample construction and data set division.

4. The method for predicting hook load and torque based on machine learning according to claim 3, characterized in that: When performing feature selection, the correlation between different parameters and the hook load and torque is calculated, and then feature selection is performed based on the correlation calculation results.

5. The method for predicting hook load and torque based on machine learning according to claim 4, characterized in that: When the hook load needs to be predicted, the selected features include well depth, bit weight, standpipe pressure, rotary table speed, total pump stroke, outlet temperature, inlet density, inlet flow rate, total pool volume, drilling tool assembly, tool face angle, well inclination, azimuth and mechanical penetration rate; When torque prediction is required, the selected features include well depth, weight on bit, rate of penetration, standpipe pressure, rotary table speed, total pump stroke, outlet temperature, inlet conductance, outlet flow rate, drill string assembly, and tool face angle.

6. The method for predicting hook load and torque based on machine learning according to any one of claims 1 to 5, characterized in that: In step S2, the CNN-LSTM-Attention multidimensional temporal network model includes an input layer, a CNN layer, an activation function layer, an LSTM layer, an Attention layer, a fully connected layer, and a discard layer connected in sequence.

7. The method for predicting hook load and torque based on machine learning according to claim 1, characterized in that: In step S3, when training, the step of optimizing the model hyperparameters is also included.

8. The method for predicting hook load and torque based on machine learning according to claim 6, characterized in that: The Bayesian hyperparameter optimization algorithm is used to optimize the model hyperparameters.

9. The method for predicting hook load and torque based on machine learning according to claim 1, characterized in that: In step S3, during training, any one or more of mean absolute error, root mean square error, and goodness of fit are used as prediction evaluation indicators.

10. The method for predicting hook load and torque based on machine learning according to any one of claims 1 to 9, characterized in that: In step S3, after obtaining the trained CNN-LSTM-Attention multi-dimensional temporal network model, a step of using SHAP to perform interpretability analysis on it is also included.

Citation Information

Cited By

  • Electricity utilization safety risk prediction method and device based on big data analysis

    CN121279785A