A method and system for early warning of a stuck pipe incident
By constructing a dataset of stuck drill pipe and normal logging and using a random forest classification model to screen important correlation parameters, a stuck drill pipe accident early warning model was established. This solved the problem that stuck drill pipe early warning in existing technologies relies on human experience, and achieved early warning and accurate early warning during the drilling process.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CHINA PETROLEUM & CHEMICAL CORP
- Filing Date
- 2024-12-03
- Publication Date
- 2026-06-05
AI Technical Summary
In existing technologies, early warning methods for stuck drill accidents rely on human experience, have poor scalability, and the early warning time is close to the time of the accident, so they cannot achieve true early warning.
By collecting historical logging data, a dataset of stuck drill pipe and normal state logging is constructed. A random forest classification model is used for training, important correlation parameters are selected, and a stuck drill pipe accident early warning model is established. Real-time logging data is used for early warning.
The generalization ability of the stuck pipe accident early warning model has been improved, enabling early warning during the drilling process, reducing the false alarm rate, and improving the accuracy of the early warning.
Smart Images

Figure CN122153666A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of oil drilling engineering technology, and in particular to a method and system for early warning of stuck drill bit accidents. Background Technology
[0002] Drilling is a concealed underground engineering project, and also a high-risk operation influenced by multiple factors. During drilling, serious accidents such as stuck pipe, lost circulation, and well collapse can severely hinder the process. Among these, stuck pipe accidents are the most frequent, most complex to handle, and longest to resolve. Once they occur, they extend the drilling cycle, increasing drilling costs. Improper handling can also lead to well collapse, wellbore abandonment, and other significant economic losses. Therefore, early prediction of stuck pipe accidents is crucial.
[0003] Currently, early prediction of stuck drill accidents in engineering mainly relies on manual methods. This involves using a comprehensive logging instrument to collect downhole data in real time and manually setting thresholds for stuck drill parameters. When the real-time parameters exceed the thresholds, a stuck drill warning is issued.
[0004] However, since the threshold values of various parameters differ in different formations, this method is highly dependent on the operator's experience and is not widely applicable. Furthermore, this early warning method provides almost no difference between the warning of a stuck drill and the actual time of the incident. In most cases, by the time the warning appears, the stuck drill accident has already occurred, so it is not a true early warning. Summary of the Invention
[0005] The purpose of this invention is to provide a solution that can provide early warning of stuck pipe accidents during the drilling process.
[0006] To address the aforementioned technical problems, this invention provides a method for early warning of stuck drilling accidents, comprising: collecting historical logging data from drilled wells to construct a stuck drilling and normal drilling logging dataset containing logging data with distinct change characteristics under stuck drilling and normal drilling conditions; training and testing a random forest classification model based on the stuck drilling and normal drilling logging dataset to obtain a stuck drilling accident early warning model; during actual drilling, collecting real-time logging data from the drilling well and extracting important stuck drilling correlation parameters, and using the stuck drilling accident early warning model based on the important stuck drilling correlation parameters to complete the stuck drilling early warning.
[0007] Preferably, the step of constructing the stuck pipe and normal logging dataset includes: establishing a stuck pipe data sample set and a normal data sample set based on the historical logging data; preprocessing the stuck pipe data sample set and the normal data sample set; filtering multiple logging parameters that have a significant impact on stuck pipe accidents from the preprocessed sample set to obtain multiple important stuck pipe correlation parameters; extracting the data of multiple important stuck pipe correlation parameters from the preprocessed sample set, and obtaining the stuck pipe and normal logging dataset through time-domain feature analysis.
[0008] Preferably, the stuck drill data sample set and the normal data sample set are preprocessed according to the following steps: based on the 3δ principle, abnormal data in the sample set are removed; based on the sample set with removed abnormal data, the mean method is used to fill in the outlier positions in the sample set with removed abnormal data.
[0009] Preferably, the step of screening multiple logging parameters that have a significant impact on stuck pipe accidents from the preprocessed sample set to obtain multiple important stuck pipe correlation parameters includes: calculating the contribution score of each logging parameter to the stuck pipe accident based on each logging parameter in the preprocessed sample set using the random forest algorithm; sorting the contribution scores of each logging parameter in descending order and selecting the logging parameter items corresponding to the top k contribution scores after descending order to obtain the key stuck pipe correlation parameters; and screening multiple important stuck pipe correlation parameters from the key stuck pipe correlation parameters by analyzing the correlation between the parameters in the key stuck pipe correlation parameters, including: using the Pearson correlation analysis method to calculate the correlation between any two parameters based on the data of the key stuck pipe correlation parameters extracted from the preprocessed sample set, and retaining only one parameter with strong correlation, thereby removing the strongly correlated parameters from the key stuck pipe correlation parameters to obtain the multiple important stuck pipe correlation parameters.
[0010] Preferably, the step of extracting multiple important stuck-pipe correlation parameters from the preprocessed sample set and obtaining the stuck-pipe and normal-state logging dataset through time-domain feature analysis includes: performing time-domain feature analysis on the data of multiple important stuck-pipe correlation parameters extracted from the preprocessed sample set; selecting multiple logging periods where the time-domain features under stuck-pipe conditions and the time-domain features under normal drilling conditions are significantly different; and forming the stuck-pipe and normal-state logging dataset based on the various important stuck-pipe correlation parameter data corresponding to the multiple logging periods extracted from the preprocessed sample set. The time-domain features include, but are not limited to: mean, root mean square, standard deviation, variance, coefficient of variation, third center distance, fourth center distance, and crest coefficient.
[0011] Preferably, the step of calculating the temporal features of each key stuck drill correlation parameter data includes: presetting a sliding window and a calculation method; calculating the data sequence in the sliding window captured during the window sliding process based on the data sequence of each key stuck drill correlation parameter in the preprocessed normal sample set, to obtain the temporal features corresponding to the data sequence of each key stuck drill correlation parameter in the preprocessed normal sample set; and calculating the data sequence in the sliding window captured during the window sliding process based on the data sequence of each key stuck drill correlation parameter in the preprocessed stuck drill sample set, to obtain the temporal features corresponding to the data sequence of each key stuck drill correlation parameter in the preprocessed stuck drill sample set.
[0012] Preferably, the step of establishing a stuck pipe data sample set and a normal data sample set based on the historical logging data includes: extracting historical logging data under normal drilling conditions from the logging instrument and marking it with operating conditions based on the drilling daily report information and the stuck pipe accident records in the well completion report, to form the normal data sample set; and extracting historical logging data under stuck pipe accident conditions from the logging instrument and marking it with operating conditions based on the drilling daily report information and the stuck pipe accident records in the well completion report, to form the stuck pipe data sample set.
[0013] Preferably, the step of forming the stuck pipe and normal state logging dataset based on the stuck pipe important correlation parameter data corresponding to the multiple logging time periods extracted from the preprocessed sample set includes: normalizing the stuck pipe important correlation parameter data corresponding to the multiple logging time periods extracted from the preprocessed sample set, so as to construct the stuck pipe and normal state logging dataset using the current normalized data.
[0014] Preferably, the step of training and testing a random forest classification model based on the stuck drill and normal logging datasets to obtain a stuck drill accident early warning model includes:
[0015] S1: Based on the stuck drill and normal logging datasets, divide them according to a preset ratio to obtain training datasets and test datasets;
[0016] S2: Based on the training dataset, a subset of training data is obtained using a method with replacement;
[0017] S3: For each decision tree, the optimal partitioning feature is obtained by partitioning based on the subset of training data;
[0018] S4: Repeat S2 and S3 until the preset number of times is met to complete the training of the random forest classification model, wherein the preset number of times is set based on the number of decision trees in the random forest;
[0019] S5: Using the test dataset, determine the configuration parameters in the trained random forest classification model to obtain the drilling accident early warning model.
[0020] Preferably, the configuration parameters include, but are not limited to: the maximum number of features for feature partitioning, the number of decision trees, the maximum depth of the decision tree, and the minimum number of samples per leaf node. The step of determining the configuration parameters in the trained random forest classification model using the test dataset to obtain the stuck drill accident early warning model includes: inputting each data sequence in the test dataset into the trained random forest classification model under different configuration parameters to obtain the classification results of different data sequences in the test dataset; obtaining evaluation metrics for different configuration parameters based on the classification results of different data sequences in the test dataset; and obtaining the configuration parameters in the random forest classification model based on the evaluation metrics for different configuration parameters. The evaluation metrics include: classification accuracy, recall, false alarm rate, and precision.
[0021] Preferably, the steps of collecting real-time logging data during drilling and extracting key stuck pipe correlation parameters, and using the stuck pipe accident early warning model based on the key stuck pipe correlation parameters to complete the stuck pipe accident early warning include: continuously collecting each piece of real-time logging data and obtaining the corresponding key stuck pipe correlation parameter data; sequentially inputting each piece of key stuck pipe correlation parameter data into the stuck pipe accident early warning model to obtain the operating condition label corresponding to each input data, so as to carry out the stuck pipe accident early warning based on each operating condition label, wherein a stuck pipe accident early warning is issued when a preset number of operating condition labels are stuck pipe conditions.
[0022] On the other hand, embodiments of the present invention provide a system for early warning of stuck drilling accidents, comprising: a specific dataset establishment module, configured to collect historical logging data of drilled wells and construct a stuck drilling and normal state logging dataset containing logging data with obvious change characteristics under stuck drilling and normal drilling conditions; an early warning model generation module, configured to train and test a random forest classification model based on the stuck drilling and normal state logging dataset to obtain a stuck drilling accident early warning model; and a drilling early warning module, configured to collect real-time logging data of the drilling well during the drilling process and extract important stuck drilling correlation parameters therein, and complete the stuck drilling early warning using the stuck drilling accident early warning model based on the important stuck drilling correlation parameters.
[0023] Compared with the prior art, one or more embodiments of the above solutions may have the following advantages or beneficial effects:
[0024] This invention discloses a method and system for early warning of stuck drilling accidents. The method and system collect historical drilling data from drilled wells, construct a normal sample set and a stuck drilling sample set, and preprocess the data within the sample sets to improve data quality. Then, the temporal features of the parameters are filtered using the feature importance scoring mechanism inherent in the random forest algorithm and by setting a time window, resulting in stuck drilling and normal logging data. These stuck drilling and normal logging data are then used as input to a model to train and test the random forest classification model, obtaining a stuck drilling accident early warning model and improving the model's generalization ability. Finally, based on the stuck drilling accident early warning model, early warnings are issued for stuck drilling accidents during the drilling process. Therefore, this invention effectively reduces false alarms caused by data anomalies or other interference, can select multiple real-time logging data for stuck drilling early warning, improves the generalization ability of the stuck drilling accident early warning model, and achieves early warning of stuck drilling accidents during the drilling process.
[0025] Other features and advantages of the invention will be set forth in the description which follows, and will be apparent in part from the description, or may be learned by practicing the invention. The objects and other advantages of the invention may be realized and obtained by means of the structures particularly pointed out in the description, claims, and drawings. Attached Figure Description
[0026] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used in conjunction with the embodiments of the invention to explain the invention and do not constitute a limitation thereof. In the drawings:
[0027] Figure 1 This is a schematic diagram of the steps of a method for early warning of stuck drill accidents according to an embodiment of this application.
[0028] Figure 2 This is a schematic diagram illustrating the prediction principle of the random forest classification model in the method for early warning of stuck drill accidents according to an embodiment of this application.
[0029] Figure 3 This is a schematic diagram of the system for early warning of stuck drill accidents according to an embodiment of this application. Detailed Implementation
[0030] The embodiments of the present invention will be described in detail below with reference to the accompanying drawings and examples, so that the process of how the present invention uses technical means to solve technical problems and achieve technical effects can be fully understood and implemented accordingly. It should be noted that, as long as there is no conflict, the various embodiments and features in the various embodiments of the present invention can be combined with each other, and the resulting technical solutions are all within the protection scope of the present invention.
[0031] Furthermore, the steps illustrated in the flowcharts of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Also, although a logical order is shown in the flowcharts, in some cases the steps shown or described may be performed in a different order than that shown here.
[0032] The terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the exemplary embodiments. Unless the context clearly indicates otherwise, the singular forms “a” and “an” as used herein are also intended to include the plural. It should also be understood that the terms “comprising” and / or “including” as used herein specify the presence of the stated features, integers, steps, operations, units, and / or components, without excluding the presence or addition of one or more other features, integers, steps, operations, units, components, and / or combinations thereof.
[0033] Drilling is a concealed underground engineering project, and also a high-risk operation influenced by multiple factors. During drilling, serious accidents such as stuck pipe, lost circulation, and well collapse can severely hinder the process. Among these, stuck pipe accidents are the most frequent, most complex to handle, and longest to resolve. Once they occur, they extend the drilling cycle, increasing drilling costs. Improper handling can also lead to well collapse, wellbore abandonment, and other significant economic losses. Therefore, early prediction of stuck pipe accidents is crucial.
[0034] Currently, early prediction of stuck pipe accidents in engineering mainly relies on manual methods. This involves using integrated logging tools to collect downhole data in real time and manually setting thresholds for relevant stuck pipe parameters. When these parameters exceed the thresholds, a stuck pipe warning is issued. However, because the thresholds for each parameter vary across different formations, this method is highly dependent on the operator's experience, has limited applicability, and the warning time is almost identical to the actual occurrence of the stuck pipe accident. In most cases, by the time the warning appears, the stuck pipe accident has already occurred, making it not a true early warning.
[0035] Figure 1 This is a schematic diagram illustrating the steps of a method for early warning of stuck drill bit accidents according to an embodiment of this application. The following refers to... Figure 1 The specific steps and flow of the method for early warning of stuck drill accidents described in the embodiments of the present invention will be explained.
[0036] Step S110: Collect historical logging data of drilled wells and construct a logging dataset containing logging data with obvious changes in stuck and normal drilling conditions.
[0037] Historical drilling data from drilled wells is collected using a logging tool. The variation characteristics of logging data under stuck drilling conditions and normal drilling conditions are analyzed. Then, a logging dataset containing the variation characteristics of logging data under stuck drilling conditions and normal drilling conditions is constructed.
[0038] Optionally, to ensure that the constructed stuck pipe and normal logging datasets can more accurately reflect the impact of different parameters on stuck pipe incidents, the following steps are taken during the construction of the stuck pipe and normal logging datasets: first, a stuck pipe sample set and a normal data sample set are established using historical logging data; then, multiple logging data that have a significant impact on stuck pipe incidents are selected to obtain multiple important stuck pipe correlation parameters; and finally, time-domain feature analysis is performed on the data of multiple important stuck pipe correlation parameters to obtain the stuck pipe and normal logging datasets. Specifically, step S110 includes the following sub-steps A1-A4:
[0039] Sub-step A1: Based on historical logging data, establish a stuck drill data sample set and a normal data sample set.
[0040] Sub-step A2 involves preprocessing the stuck drill data sample set and the normal data sample set.
[0041] Sub-step A3 involves screening multiple logging parameters that have a significant impact on stuck pipe accidents from the pre-processed sample set, thereby obtaining multiple important correlation parameters for stuck pipe accidents.
[0042] Sub-step A4 extracts data on several key parameters related to stuck pipe from the preprocessed sample set, and obtains stuck pipe and normal logging datasets through time-domain feature analysis.
[0043] Optionally, in sub-step A1, firstly, the logging data collected at different logging times for each drilled well is acquired. In practical applications, real-time logging data is acquired through a comprehensive logging instrument at the drilling site. Real-time logging data consists of data bars corresponding to 72 features, including drilling pressure, rotational speed, and drilling rate, collected in real-time at the drilling site. Then, stuck pipe incident records are obtained from the daily drilling report and completion report. Based on these stuck pipe incident records, data under normal drilling conditions is extracted from historical logging data to form a normal data sample set. Furthermore, historical data under stuck pipe incident conditions is extracted from historical logging data to form a stuck pipe data sample set. Specifically, sub-step A1 includes the following steps A11-A12:
[0044] Step A11: Based on the drilling daily report information and the stuck pipe accident record in the completion report, extract historical logging data under normal drilling conditions from the logging instrument and mark it with working conditions to form a normal data sample set.
[0045] Step A12: Based on the drilling daily report information and the stuck pipe accident records in the completion report, extract the historical logging data under the stuck pipe accident state from the logging instrument and mark the working conditions to form a stuck pipe data sample set.
[0046] In step A11, after obtaining historical logging data under normal drilling conditions, the label can be set to 0; in step A12, after obtaining historical logging data under stuck drilling conditions, the label can be set to 1 to distinguish between normal data and stuck drilling data.
[0047] Furthermore, during the acquisition of the sample set, measurement anomalies may occur due to sensor measurements or other reasons. Therefore, it is necessary to preprocess the data in the sample set to remove the anomalies. Specifically, sub-step A2 includes the following steps A21-A22:
[0048] Step A21: Based on the 3δ principle, remove outlier data from the sample set.
[0049] Step A22: Based on the sample set with outliers removed, use the mean method to fill in the outlier positions in the sample set with outliers removed.
[0050] In step A21, the 3δ principle considers the confidence interval of normal data to be [μ-3δ, μ+3δ], where μ represents the mean of the data for the same parameter and δ represents the standard deviation of the data for the same parameter.
[0051] In one embodiment, assume there are m i-dimensional data points, such as:
[0052] If it exists Make Then it is believed These are outliers and should be removed.
[0053] In step A22, the eliminated values are filled in using the mean method, and the filled data is calculated using the following expression:
[0054]
[0055] In the above formula, This indicates the data to be filled. and All data are located near the abnormal data.
[0056] Furthermore, the feature importance scores inherent in the random forest algorithm are used to filter the contribution scores of each logging parameter to the stuck pipe incident. Then, the top-ranked logging parameters are extracted as key stuck pipe correlation parameters, and important stuck pipe correlation parameters are obtained based on these key stuck pipe correlation parameters. Specifically, sub-step A3 includes the following steps A31-A33:
[0057] Step A31: Based on each logging parameter in the preprocessed sample set, calculate the contribution score of each logging parameter to the stuck pipe incident using the random forest algorithm.
[0058] Step A32: Sort the contribution scores of each logging parameter in descending order, and select the logging parameter items corresponding to the top k contribution scores after descending order to obtain the key correlation parameters of stuck pipe.
[0059] Step A33 involves analyzing the correlation between various parameters in the key stuck drill correlation parameters to select multiple important stuck drill correlation parameters from the key stuck drill correlation parameters.
[0060] In step A31, the contribution score of each logging parameter to the stuck pipe incident is mainly calculated using the Gini index.
[0061] In one embodiment, the Gini index is based on the following principle: assuming there are m parameters X1, X2, ..., X... m We need to calculate the importance scores of m parameters, where the parameter importance scores are replaced by VIM.
[0062] (1) Statistics The Gini index represents the average change in node splitting impurity across all trees in the random forest for the j-th parameter. m The formula for calculating ) is:
[0063]
[0064] In the above formula, K represents the number of categories in the self-service sample set. This represents the conceptual estimate of whether the sample at node m belongs to the k-th class.
[0065] Specifically, when the sample is binary data, i.e., K=2, the Gini index of node m is:
[0066]
[0067] In the above formula, This represents the probability estimate that a sample belongs to any class at node m.
[0068] (2) Parameter X j The importance of node m, i.e., the change in the Gini index before and after node m branches, is as follows:
[0069]
[0070] In the above formula, GI m and GI r Let Gini exponents be the two new nodes split from node m.
[0071] (3) If parameter X j If X appears M times in the i-th tree, then the parameter X... j The importance of the i-th tree is:
[0072]
[0073] (4) Parameter X j Gini importance in random forests is defined as follows:
[0074]
[0075] In the above formula, n represents the number of classification trees in the random forest.
[0076] In step A32, in order to make the obtained key correlation parameters of the stuck drill more in line with the actual application requirements, the value of k can be preferably 10.
[0077] Furthermore, in step A33, after obtaining the key stuck drill correlation parameters, the correlation between the parameters is analyzed to eliminate parameters with strong correlations. Then, based on the eliminated key stuck drill correlation parameters, several important stuck drill correlation parameters are obtained. Specifically, step A33 includes:
[0078] Based on the data of key stuck drill correlation parameters extracted from the preprocessed sample set, Pearson correlation analysis is used to calculate the correlation between any two parameters and retain only one parameter with strong correlation. Thus, based on the key stuck drill correlation parameters, several important stuck drill correlation parameters are obtained by removing the strongly correlated parameters.
[0079] Specifically, if the correlation coefficient is higher than a preset threshold, the two parameters are determined to be strongly correlated. The preset threshold is 0.8.
[0080] Pearson correlation analysis is a statistical indicator that expresses the degree and direction of linear correlation between two variables. The Pearson correlation coefficient between any two parameters can be calculated using the following expression:
[0081]
[0082] In the above formula, X and Y represent two related parameters in the key correlation parameters of stuck drill bit, l XYLet l represent the sum of the cross products of the deviations from the mean of X and Y. XX Let l represent the sum of squared discrete differences of X. YY Let Y represent the sum of squared discrete differences.
[0083] Furthermore, after obtaining several key parameters related to stuck pipe, time-domain characteristic analysis is performed based on the data of these parameters to obtain both stuck pipe and normal logging data. Specifically, sub-step A4 includes the following step A41:
[0084] Step A41 involves performing time-domain feature analysis on the data of multiple important stuck-pipe correlation parameters extracted from the preprocessed sample set. For multiple logging periods where the time-domain features under stuck-pipe conditions are significantly different from those under normal drilling conditions, a stuck-pipe and normal state logging dataset is formed based on the data of various important stuck-pipe correlation parameters corresponding to the multiple logging periods extracted from the preprocessed sample set.
[0085] In step A41, the time-domain features include, but are not limited to: mean, root mean square, standard deviation, variance, coefficient of variation, third center distance, fourth center distance, and crest coefficient.
[0086] Among them, there is no limit to the specific judgment method for the time domain characteristics under stuck drill conditions that are significantly different from those under normal drilling conditions, and a reasonable selection can be made according to the actual application requirements.
[0087] For example, the variance in the time-domain characteristics can be considered to be very stable under normal operating conditions, but fluctuates greatly under stuck drilling conditions, indicating a significant difference in the time-domain characteristics. Alternatively, the coefficient of variation in the time-domain characteristics can be considered to be positively increasing under normal operating conditions, but negatively increasing under stuck drilling conditions, indicating a significant difference in the time-domain characteristics.
[0088] Furthermore, in the process of calculating time-domain features, a sliding window can be used to extract data sequences from the sample set for calculation. Specifically, step A41 includes:
[0089] Preset sliding window and calculation method;
[0090] Based on the data sequence of each key stuck drill correlation parameter in the preprocessed normal sample set, the data sequence in the sliding window intercepted during the window sliding process is calculated to obtain the temporal features corresponding to the data sequence of each key stuck drill correlation parameter in the preprocessed normal sample set.
[0091] Based on the data sequence of each key stuck drill correlation parameter in the preprocessed stuck drill sample set, the data sequence in the sliding window captured during the window sliding process is calculated to obtain the temporal features corresponding to the data sequence of each key stuck drill correlation parameter in the preprocessed stuck drill sample set.
[0092] The specific size of the sliding window is not limited and can be selected reasonably according to the actual application needs.
[0093] The calculation methods for different time-domain features are as follows:
[0094] (1) Mean:
[0095] (2) Root mean square:
[0096] (3) Standard deviation:
[0097] (4) Variance:
[0098] (5) Coefficient of variation:
[0099] (6) Third center distance:
[0100] (7) Fourth center distance:
[0101] (8) Crest coefficient:
[0102] Furthermore, when training the model based on the stuck pipe and normal logging datasets, in order to eliminate the influence of the dimensions of various parameters on the model training and improve the convergence speed of the model, the important correlation parameters of the stuck pipe can be normalized to obtain the stuck pipe and normal logging data. Specifically, step A41 may include:
[0103] The data of various important stuck pipe correlation parameters extracted from multiple logging periods in the preprocessed sample set will be normalized to construct the stuck pipe and normal state logging dataset using the current normalized data.
[0104] The normalization process can be performed based on the following expression:
[0105]
[0106] In the above formula, x′ represents the normalized data sequence, x represents the original data, and x min Let x represent the minimum value of this data sequence. max This represents the maximum value of the data sequence.
[0107] Step S120: Based on the stuck drill and normal logging datasets, train and test the random forest classification model to obtain a stuck drill accident early warning model.
[0108] refer to Figure 2 Random forest is a collection of different decision trees. Its construction is relatively simple and can be regarded as a multi-way classifier. Each tree in it can be used as a classifier. Therefore, when building a stuck drill accident early warning model, the random forest classification model can be trained and tested based on the stuck drill and normal logging datasets.
[0109] Optionally, in obtaining the stuck pipe accident early warning model, the stuck pipe accident data set and the normal logging data set can be divided first to obtain a training dataset and a test dataset. Then, the model is trained and tested based on the principle of a random forest classification model to obtain the stuck pipe accident early warning model. Specifically, step S120 includes the following steps S1-S5:
[0110] Step S1: Based on the stuck drill and normal logging datasets, divide them according to a preset ratio to obtain training datasets and test datasets.
[0111] Step S2: Based on the training dataset, a subset of training data is obtained using a method with replacement.
[0112] Step S3: For each decision tree, divide it based on a subset of the training data to obtain the optimal partitioning features.
[0113] Step S4: Repeat S2 and S3 until the preset number of times is met to complete the training of the random forest classification model. The preset number of times is based on the number of decision trees in the random forest.
[0114] Step S5: Using the test dataset, determine the configuration parameters in the trained random forest classification model to obtain the drilling accident early warning model.
[0115] In step S1, in order to make the divided training dataset and test dataset more in line with the actual application requirements, the preset ratio of the training dataset and test dataset can be preferably 8:2.
[0116] Furthermore, in step S5, the configuration parameters include, but are not limited to: the maximum number of features for feature partitioning, the number of decision trees, the maximum depth of the decision trees, and the minimum number of samples per leaf node. The maximum number of features for feature partitioning represents the maximum number of features a random forest can have in a single tree; the number of decision trees represents the number of trees built using maximum voting, and setting the number of decision trees affects the model's prediction performance and running speed; the minimum number of samples per leaf node is generally greater than 1 to improve the model's generalization ability.
[0117] Furthermore, when determining the configuration parameters in the trained random forest classification model using the test dataset, the test dataset can be input into the model to obtain the classification results, and then the configuration parameters can be determined based on the classification results. Specifically, step S5 includes the following sub-steps B1-B3:
[0118] Sub-step B1 involves inputting each data sequence from the test dataset into a trained random forest classification model with different configuration parameters to obtain the classification results of different data sequences in the test dataset.
[0119] Sub-step B2: Based on the classification results of different data sequences in the test dataset, obtain evaluation metrics for different configuration parameters.
[0120] Sub-step B3: Based on the evaluation metrics of different configuration parameters, obtain the configuration parameters in the random forest classification model.
[0121] In sub-step B2, the evaluation metrics include: classification accuracy, recall, false alarm rate, and precision. Classification accuracy represents the probability that normal data and stuck data are correctly classified. Recall represents the probability that normal data is identified. False alarm rate represents the probability that stuck data is incorrectly classified as normal data. Precision represents the degree of authenticity of the classification result being normal data.
[0122] In step B3, the configuration parameter that has the highest classification accuracy, recall, and precision and the lowest false alarm rate among the evaluation metrics obtained from different configuration parameters is determined as the configuration parameter in the random forest classification model.
[0123] In one embodiment, the configuration parameters in the random forest classification model can be obtained using an exhaustive method. Evaluation metrics are established, including classification accuracy, recall, false alarm rate, and precision. These metrics are calculated based on the confusion matrix, and the most suitable configuration parameters are selected according to the confusion matrix.
[0124] The confusion matrix is used to evaluate the accuracy of supervised learning models. Each column of the matrix represents a predicted instance of a class, and each row represents an actual instance of a class. In the binary classification problem of drilling prediction described in this embodiment, the confusion matrix obtained based on the test dataset and the random forest classification model is shown in Table 1:
[0125] Table 1 Confusion Matrix
[0126]
[0127] In Table 1, P represents the number of positive samples, N represents the number of negative samples, TP represents the number of correctly predicted positive samples, FP represents the number of negative samples predicted as positive samples, FN represents the number of positive samples predicted as negative samples, and TN represents the number of correctly predicted negative samples.
[0128] Based on the confusion matrix, the evaluation index can be calculated using the following expression:
[0129] (1) Classification accuracy:
[0130] (2) Recall rate:
[0131] (3) False alarm rate:
[0132] (4) Accuracy:
[0133] Step S130: During the actual drilling process, real-time logging data of the drilling well is collected and important stuck pipe related parameters are extracted. Based on the important stuck pipe related parameters, a stuck pipe accident early warning model is used to complete the stuck pipe early warning.
[0134] After obtaining the stuck pipe accident early warning model, real-time logging data can be collected during actual drilling. Then, the real-time logging data is processed to obtain important stuck pipe correlation parameters. Finally, the data is classified based on the important stuck pipe correlation parameters and the stuck pipe accident early warning model, and a stuck pipe early warning is completed based on the classification results.
[0135] Optionally, when issuing a stuck drill warning, the following sub-steps C1-C2 may be included:
[0136] Sub-step C1 involves continuously collecting each real-time logging data and obtaining the corresponding key parameters related to the stuck drill bit.
[0137] Sub-step C2 involves sequentially inputting each key related parameter data of stuck drill bit into the stuck drill bit accident early warning model to obtain the working condition label corresponding to each input data, so as to carry out stuck drill bit early warning based on each working condition label.
[0138] In this embodiment of the invention, sub-step C1 directly extracts logging data of multiple important stuck-pipe related parameters from each real-time logging data.
[0139] In order to reduce the false alarm rate of the model due to data anomalies, in sub-step C2, a stuck drill warning can be issued when a preset number of working condition labels are stuck drill conditions.
[0140] Optionally, the specific value of the preset quantity is not limited and can be reasonably selected according to actual application needs. For example, it can be 10 items.
[0141] Based on the above-described method for early warning of stuck drill pipe accidents, the present invention also provides a system for early warning of stuck drill pipe accidents. This system for early warning of stuck drill pipe accidents implements the method for early warning of stuck drill pipe accidents as described above.
[0142] Figure 3 This is a schematic diagram of a system for early warning of stuck drill accidents according to an embodiment of this application. Figure 3 As shown, the system for early warning of stuck drill accidents according to the embodiments of the present invention includes: a specific dataset establishment module 301, an early warning model generation module 302, and a real drilling early warning module 303.
[0143] Specifically, the specific dataset establishment module 301 is implemented according to the method described in step S110 above, and is configured to collect historical logging data of drilled wells to construct a stuck and normal state logging dataset containing logging data with obvious change characteristics under stuck drilling conditions and normal drilling conditions; the early warning model generation module 302 is implemented according to the method described in step S120 above, and is configured to train and test a random forest classification model based on the stuck and normal state logging datasets to obtain a stuck drilling accident early warning model; the actual drilling early warning module 303 is implemented according to the method described in step S130 above, and is configured to collect real-time logging data of the drilling well during the actual drilling process and extract important stuck drilling correlation parameters from it, and complete the stuck drilling early warning using the stuck drilling accident early warning model based on the important stuck drilling correlation parameters.
[0144] This invention discloses a method and system for early warning of stuck drilling accidents. The method and system collect historical drilling data from drilled wells, construct a normal sample set and a stuck drilling sample set, and preprocess the data within the sample sets to improve data quality. Then, the temporal features of the parameters are filtered using the feature importance scoring mechanism inherent in the random forest algorithm and by setting a time window, resulting in stuck drilling and normal logging data. These stuck drilling and normal logging data are then used as input to a model to train and test the random forest classification model, obtaining a stuck drilling accident early warning model and improving the model's generalization ability. Finally, based on the stuck drilling accident early warning model, early warnings are issued for stuck drilling accidents during the drilling process. Therefore, this invention effectively reduces false alarms caused by data anomalies or other interference, can select multiple real-time logging data for stuck drilling early warning, improves the generalization ability of the stuck drilling accident early warning model, and achieves early warning of stuck drilling accidents during the drilling process.
[0145] The above description is merely a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
[0146] In the description of this invention, unless otherwise stated, "a plurality of" means two or more; the terms "upper," "lower," "left," "right," "inner," "outer," "front end," "rear end," "head," "tail," etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings, and are only for the convenience of describing the invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of the invention. Furthermore, the terms "first," "second," "third," etc., are used for descriptive purposes only and should not be construed as indicating or implying relative importance.
[0147] In the description of this invention, it should be noted that, unless otherwise explicitly specified and limited, the terms "connected" and "linked" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium. Those skilled in the art can understand the specific meaning of the above terms in this invention based on the specific circumstances.
[0148] It should be understood that the embodiments disclosed herein are not limited to the specific structures, processing steps, or materials disclosed herein, but should be extended to equivalent substitutions of these features as understood by those skilled in the art. It should also be understood that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting.
[0149] The phrase "an embodiment" or "an embodiment" used in this specification means that a particular feature, structure, or characteristic described in connection with the embodiment is included in at least one embodiment of the invention. Therefore, the phrase "an embodiment" or "an embodiment" appearing in various places throughout the specification does not necessarily refer to the same embodiment.
[0150] The embodiments of the present invention are given for illustrative and descriptive purposes only, and are not intended to be exhaustive or to limit the invention to the forms disclosed. Many modifications and variations will be apparent to those skilled in the art. The embodiments were chosen and described in order to better illustrate the principles and practical application of the invention, and to enable those skilled in the art to understand the invention and to design various embodiments with various modifications suitable for a particular purpose.
[0151] While the embodiments disclosed in this invention are as described above, the content is merely for the purpose of facilitating understanding of the invention and is not intended to limit the invention. Any person skilled in the art to which this invention pertains may make any modifications and changes in form and detail of the implementation without departing from the spirit and scope disclosed herein; however, the scope of patent protection of this invention shall still be determined by the scope defined in the appended claims.
Claims
1. A method for early warning of stuck drill bit accidents, characterized in that, include: Collect historical logging data from drilled wells and construct logging datasets for stuck and normal conditions that clearly show the characteristics of changes in logging data under stuck and normal drilling conditions; Based on the stuck drill and normal logging datasets, a random forest classification model was trained and tested to obtain a stuck drill accident early warning model. During actual drilling, real-time logging data of the drilling well is collected and key stuck pipe parameters are extracted. Based on these key stuck pipe parameters, the stuck pipe accident early warning model is used to complete the stuck pipe early warning.
2. The method according to claim 1, characterized in that, The steps for constructing the stuck drill and normal logging dataset include: Based on the historical logging data, establish a stuck drill data sample set and a normal data sample set; The stuck drill data sample set and the normal data sample set are preprocessed; Multiple logging parameters that have a significant impact on stuck pipe accidents were screened from the preprocessed sample set, and several important stuck pipe correlation parameters were obtained. Data on several key parameters related to stuck pipe are extracted from the preprocessed sample set, and the stuck pipe and normal logging datasets are obtained through time-domain feature analysis.
3. The method according to claim 2, characterized in that, The stuck drill data sample set and the normal data sample set were preprocessed according to the following steps: Based on the 3δ principle, outlier data in the sample set were removed; Based on the sample set with outliers removed, the mean method is used to fill in the outlier positions in the sample set.
4. The method according to claim 2 or 3, characterized in that, The steps of screening multiple logging parameters that have a significant impact on stuck pipe accidents from the preprocessed sample set to obtain multiple important correlation parameters of stuck pipe include: Based on each logging parameter in the preprocessed sample set, the contribution score of each logging parameter to the stuck pipe incident is calculated according to the random forest algorithm. The contribution scores of each logging parameter are sorted in descending order, and the logging parameter items corresponding to the top k contribution scores after descending order are selected to obtain the key stuck pipe correlation parameters. By analyzing the correlations among the various parameters in the key stuck drill correlation parameters, multiple important stuck drill correlation parameters are selected from the key stuck drill correlation parameters, including: Based on the data of the key stuck drill correlation parameters extracted from the preprocessed sample set, the Pearson correlation analysis method is used to calculate the correlation between any two parameters and retain only one parameter with strong correlation. Thus, based on the key stuck drill correlation parameters, the multiple key stuck drill correlation parameters are obtained by removing the strongly correlated parameters.
5. The method according to any one of claims 2 to 4, characterized in that, The steps of extracting multiple key parameters related to stuck pipe from the preprocessed sample set and obtaining the stuck pipe and normal logging datasets through time-domain feature analysis include: Temporal feature analysis is performed on the data of multiple important stuck-pipe correlation parameters extracted from the preprocessed sample set. For multiple logging periods where the temporal features under stuck-pipe conditions differ significantly from those under normal drilling conditions, a stuck-pipe and normal-state logging dataset is formed based on the key stuck-pipe correlation parameters extracted from the preprocessed sample set for each of these logging periods. The time-domain features include, but are not limited to: mean, root mean square, standard deviation, variance, coefficient of variation, third center distance, fourth center distance, and crest coefficient.
6. The method according to claim 5, characterized in that, in, The steps for calculating the time-domain characteristics of each key stuck drill correlation parameter data include: Preset sliding window and calculation method; Based on the data sequence of each key stuck drill correlation parameter in the preprocessed normal sample set, the data sequence in the sliding window intercepted during the window sliding process is calculated to obtain the temporal features corresponding to the data sequence of each key stuck drill correlation parameter in the preprocessed normal sample set. Based on the data sequence of each key stuck drill correlation parameter in the preprocessed stuck drill sample set, the data sequence in the sliding window captured during the window sliding process is calculated to obtain the temporal features corresponding to the data sequence of each key stuck drill correlation parameter in the preprocessed stuck drill sample set.
7. The method according to any one of claims 2 to 6, characterized in that, The step of establishing a stuck drill data sample set and a normal data sample set based on the historical logging data includes: Based on the drilling daily report information and the stuck pipe accident records in the completion report, historical logging data under normal drilling conditions are extracted from the logging instrument and marked with operating conditions to form the normal data sample set; Based on the drilling daily report information and the stuck pipe accident records in the completion report, historical logging data under the stuck pipe accident state is extracted from the logging instrument and marked with the working condition to form the stuck pipe data sample set.
8. The method according to claim 5 or 6, characterized in that, The step of forming the stuck pipe and normal state logging dataset based on the stuck pipe important correlation parameter data corresponding to the multiple logging time periods extracted from the preprocessed sample set includes: The data of various important stuck pipe correlation parameters corresponding to the multiple logging periods extracted from the preprocessed sample set are normalized to construct the stuck pipe and normal state logging dataset using the current normalized data.
9. The method according to any one of claims 1 to 8, characterized in that, The steps of training and testing a random forest classification model based on the stuck drill and normal logging datasets to obtain a stuck drill accident early warning model include: S1: Based on the stuck drill and normal logging datasets, divide them according to a preset ratio to obtain training datasets and test datasets; S2: Based on the training dataset, a subset of training data is obtained using a method with replacement; S3: For each decision tree, the optimal partitioning feature is obtained by partitioning based on the subset of training data; S4: Repeat S2 and S3 until the preset number of times is met to complete the training of the random forest classification model, wherein the preset number of times is set based on the number of decision trees in the random forest; S5: Using the test dataset, determine the configuration parameters in the trained random forest classification model to obtain the drilling accident early warning model.
10. The method according to claim 9, characterized in that, The configuration parameters include, but are not limited to: the maximum number of features for feature partitioning, the number of decision trees, the maximum depth of the decision trees, and the minimum number of samples per leaf node. The step of determining the configuration parameters in the trained random forest classification model using the test dataset to obtain the stuck drill accident early warning model includes: Each data sequence in the test dataset is input into a trained random forest classification model with different configuration parameters to obtain the classification results of different data sequences in the test dataset. Based on the classification results of different data sequences in the test dataset, evaluation metrics for different configuration parameters are obtained. Based on evaluation metrics for different configuration parameters, the configuration parameters in the random forest classification model are obtained, among which, The evaluation metrics include: classification accuracy, recall, false alarm rate, and precision.
11. The method according to any one of claims 1 to 10, characterized in that, The steps of acquiring real-time logging data during drilling and extracting key stuck pipe correlation parameters, and then using the stuck pipe accident early warning model based on these parameters to complete the stuck pipe early warning process, include: Continuously collect each real-time logging data and obtain the corresponding key parameters related to stuck drill bit; Each key parameter related to the stuck drill bit is sequentially input into the stuck drill bit accident early warning model to obtain the operating condition label corresponding to each input data point. Stuck drill bit early warning is then generated based on each operating condition label. When a preset number of working condition labels are consecutively set to "stuck drill condition", a stuck drill warning will be issued.
12. A system for early warning of stuck drill accidents, characterized in that, include: The specific dataset creation module is configured to collect historical logging data from drilled wells and construct logging datasets containing obvious changes in logging data under stuck drilling and normal drilling conditions. The early warning model generation module is configured to train and test the random forest classification model based on the stuck drill and normal logging datasets to obtain a stuck drill accident early warning model. The actual drilling early warning module is configured to collect real-time logging data of the drilling process and extract important stuck pipe related parameters from it, and to complete the stuck pipe early warning based on the stuck pipe accident early warning model according to the important stuck pipe related parameters.