Mechanical drilling speed real-time prediction method and device and model training method and device
By using the model of the use of sliding windows and two -way long short -term memory networks during the drilling process, the problem of low diamond speed prediction accuracy caused by the non -stable diamond speed prediction caused by the non -stability of the logging data is solved, and the more efficient and secure drilling process is achieved.
Patent Information
- Application Number
- CN202310913266.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-24
- Publication Date
- 2025-01-24
AI Technical Summary
During the drilling process, the acquired well recording data environment shows obvious non-stationarity, resulting in a decrease in the accuracy of mechanical drilling speed prediction, affecting drilling efficiency and cost.
Use the sliding window method to obtain real -time well -recording data, and perform real -time prediction and parameter update through a two -way long short -term memory network and attention mechanism. The optimization model prediction accuracy is optimized.
It improves the accuracy and real time of mechanical diamond speed prediction, shorten the drilling cycle, reduce the drill cost, and enhance the safety and controllability of drilling.
Smart Images

Figure CN119357760A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the field of oil drilling, and in particular to a real-time prediction method for mechanical drilling speed, a model training method and a device. Background Art
[0002] In the modern industrial revolution, energy has become an important part of human life. Oil resources are called "the blood of industry". They are not only a non-renewable resource, but also an indispensable strategic resource for national survival and development. They are the economic lifeline of countries in the world today. With the rapid development of the economy and society, the demand for the use of natural resources such as oil and natural gas has increased sharply. The exploration of oil from land to sea, from shallow to medium and then to deep layers to meet the daily needs of life. In drilling engineering, the speed at which the drill bit drills through the rock and deepens the borehole is called mechanical drilling speed. Mechanical drilling speed is a key indicator reflecting drilling efficiency. It is affected and restricted by many factors such as drill bit size, drilling parameters, rock lithology, etc. It is directly related to mining cost and mining time. Drilling speed prediction is necessary for determining drilling parameters and optimizing drilling costs. Accurate prediction of drilling mechanical drilling speed can effectively estimate the drilling cycle, thereby optimizing resource allocation according to the prediction results, reducing drilling and mining costs, and increasing oil production. This is of great significance for enterprises to reduce drilling construction costs, reduce drilling risks, and for the country to solve the problem of energy shortage.
[0003] In the current drilling process, the construction situation is extremely complex, the working conditions vary, the logging data environment obtained shows obvious non-stationarity, the mechanical drilling speed prediction accuracy is reduced, making it difficult for engineers to determine the appropriate drilling parameters, and the cost of obtaining logging parameters manually is expensive, and there are many influencing factors that are difficult to consider completely, which seriously affects the drilling efficiency. Therefore, how to improve drilling efficiency and increase drilling speed is a hot topic of research at home and abroad today.
[0004] With the rapid development of big data technology and the rapid growth of data size, the use of machine learning methods to mine data and apply it to the drilling process has significantly improved the prediction accuracy of mechanical drilling speed compared with the method based on physical models. The mechanical drilling speed prediction model established by intelligent algorithms can predict the drilling speed results more quickly and with better quality, thereby helping to shorten the drilling cycle, reduce drilling costs, improve drilling quality and drilling efficiency, enhance the safety and controllability of drilling, and make the drilling process more efficient and safe. Summary of the invention
[0005] In order to better realize mechanical penetration rate prediction, the inventor proposes the present invention to provide a real-time prediction method, model training method and device for mechanical penetration rate that overcomes the above problems or at least partially solves the above problems.
[0006] In order to achieve real-time prediction of mechanical drilling speed, an embodiment of the present application provides a real-time prediction method for mechanical drilling speed.
[0007] In a first aspect, an embodiment of the present application provides a method for real-time prediction of mechanical drilling speed, the method comprising:
[0008] Slide the preset sliding window according to the preset step length to obtain real-time logging data;
[0009] Inputting the real-time logging data into a real-time drilling speed prediction model to obtain a mechanical drilling speed prediction result, and updating parameters of the real-time drilling speed prediction model to obtain an updated real-time drilling speed prediction model;
[0010] The real-time prediction model is obtained in the following way:
[0011] Slide the acquired historical logging data with a preset sliding window according to a preset step length to obtain a training data set;
[0012] Inputting the training data set into a pre-built drilling speed prediction model to obtain a prediction result; wherein the pre-built drilling speed prediction model is constructed using a bidirectional long short-term memory network and an attention mechanism;
[0013] Adjusting the parameters of the trained drilling speed prediction model according to the prediction result to obtain the trained drilling speed prediction model;
[0014] The above model training process is repeated until the real-time drilling speed prediction model that meets the preset conditions is obtained.
[0015] In one or some optional implementations of the embodiments of the present application, the real-time logging data is input into a real-time drilling speed prediction model to obtain a mechanical drilling speed prediction result, and the parameters of the real-time drilling speed prediction model are updated to obtain an updated real-time drilling speed prediction model, including:
[0016] Inputting the real-time logging data into the real-time drilling speed prediction model to obtain a drilling speed prediction result;
[0017] The parameters of the real-time drilling speed prediction model are updated according to the actual drilling speed result in the real-time logging data and the logging data at the last moment to obtain an updated real-time drilling speed prediction model.
[0018] In one or some optional embodiments, the method further comprises:
[0019] The updated real-time prediction model is parameter updated according to the actual drilling speed result in the real-time logging data acquired at the next moment and the real-time logging data to obtain a new updated real-time prediction model.
[0020] In one or some optional embodiments, the pre-built drilling speed prediction model includes an embedding layer, a bidirectional long short-term memory network layer, and an attention layer;
[0021] The step of inputting the training data set into a pre-built drilling speed prediction model to obtain a prediction result includes:
[0022] The pre-built drilling speed prediction model includes an embedding layer, a bidirectional long short-term memory network layer, and an attention layer;
[0023] Input the training data set into the embedding layer, perform vector space mapping on the input sequence, and obtain a first hidden vector;
[0024] Inputting the first hidden vector into the bidirectional long short-term memory network layer to perform parameter calculation to obtain a second hidden vector;
[0025] The second hidden vector is input into the attention layer, and the second hidden vector is weighted summed according to a predetermined attention weight vector to obtain a prediction result.
[0026] In one or some optional embodiments, adjusting the parameters of the drilling speed prediction model according to the prediction result to obtain a trained drilling speed prediction model includes:
[0027] According to the actual drilling speed results of the training data set and the predicted results, the model parameters are adjusted to obtain the trained drilling speed prediction model.
[0028] In one or some optional embodiments, the method further includes obtaining the attention weight vector in the following manner:
[0029] The second hidden vector at the historical moment is input into the attention layer to obtain the attention weight vector.
[0030] In one or some optional implementations of the embodiment of the present application, before the real-time logging data is input into the real-time prediction model, the method further includes:
[0031] The real-time logging data is preprocessed to obtain processed real-time logging data; the real-time logging data includes well depth, drilling time, drilling pressure, hanging weight, drilling speed, torque and displacement data.
[0032] In one or some optional embodiments, the preprocessing of the real-time logging data to obtain processed real-time logging data includes:
[0033] Performing data judgment on the real-time logging data in the time domain to determine whether it is real real-time data;
[0034] If so, the real-time logging data is smoothed and filled with data by linear interpolation;
[0035] Correcting and / or removing abnormal values from the real-time logging data; removing abnormal fluctuation values from the real-time logging data; and,
[0036] The real-time logging data is normalized to obtain processed real-time logging data.
[0037] In a second aspect, an embodiment of the present application provides a training method for a real-time prediction model of mechanical drilling speed, the method comprising:
[0038] Slide the acquired historical logging data with a preset sliding window according to a preset step length to obtain a training data set;
[0039] Inputting the training data set into a pre-built drilling speed prediction model to obtain a prediction result; wherein the pre-built drilling speed prediction model is constructed using a bidirectional long short-term memory network and an attention mechanism;
[0040] Adjusting the parameters of the trained drilling speed prediction model according to the prediction result to obtain the trained drilling speed prediction model;
[0041] Repeat the above model training process until a real-time drilling speed prediction model that meets the preset conditions is obtained.
[0042] In a third aspect, an embodiment of the present application provides a real-time prediction device for mechanical drilling speed, the device comprising:
[0043] A model acquisition module is used to obtain a real-time drilling speed prediction model;
[0044] The real-time drilling speed prediction model is trained in the following way:
[0045] Slide the acquired historical logging data with a preset sliding window according to a preset step length to obtain a training data set;
[0046] Inputting the training data set into a pre-built drilling speed prediction model to obtain a prediction result; wherein the pre-built drilling speed prediction model is constructed using a bidirectional long short-term memory network and an attention mechanism;
[0047] Adjusting the parameters of the trained drilling speed prediction model according to the prediction result to obtain the trained drilling speed prediction model;
[0048] Repeat the above model training process until the real-time drilling speed prediction model that meets the preset conditions is obtained;
[0049] A data acquisition module, used to obtain real-time logging data by sliding a preset sliding window according to a preset step length;
[0050] The real-time prediction updating module is used to input the real-time logging data into the real-time drilling speed prediction model to obtain the drilling speed prediction result, and to update the parameters of the real-time prediction model to obtain the updated real-time prediction model.
[0051] In a fourth aspect, an embodiment of the present application provides a real-time prediction model training device for mechanical drilling speed, the device comprising:
[0052] A preprocessing module is used to slide the acquired historical logging data with a preset sliding window according to a preset step length to obtain a training data set;
[0053] A forward training module, used for inputting the training data set into the trained drilling speed prediction model to obtain a prediction result; the model is constructed using a bidirectional long short-term memory network and an attention mechanism;
[0054] The reverse training module adjusts the parameters of the trained drilling speed prediction model according to the prediction results to obtain the trained drilling speed prediction model; and repeats the above model training process until a real-time drilling speed prediction model that meets the preset conditions is obtained.
[0055] In a fifth aspect, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the real-time prediction method for mechanical drilling speed as described above.
[0056] In a sixth aspect, an embodiment of the present application provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above-mentioned method for real-time prediction of mechanical drilling speed when executing the computer program.
[0057] In a seventh aspect, an embodiment of the present application provides a computer program product comprising instructions, which, when executed on a computer device, enables the computer device to execute the real-time prediction method for mechanical drilling speed as described above.
[0058] In an eighth aspect, an embodiment of the present application provides a chip, the chip including a processor and a communication interface, the communication interface and the processor are coupled, and the processor is used to run a computer program or instruction to implement the real-time prediction method of mechanical drilling speed as described above.
[0059] The beneficial effects of the above technical solution provided by the embodiment of the present application include at least:
[0060] The real-time prediction method for mechanical drilling speed provided by the embodiment of the present application obtains the real-time logging data and inputs the real-time drilling speed prediction model to obtain the mechanical drilling speed prediction result, and obtains the updated real-time drilling speed prediction model. The real-time drilling speed prediction model is obtained by training the historical logging data, and the model parameters are updated according to the real-time logging data, so as to continuously optimize the model and improve the accuracy of the model prediction. The real-time input logging is used as the training data to realize online learning so that the model parameters are updated in real time. In the process of model training and parameter updating, the time series of the logging data is maintained by the sliding window. When a new data sample is obtained, the preset sliding window slides a fixed step length to the latest data, so that the model maintains the adaptability to the latest data, better adapts to the transformation of data features, and realizes the real-time update and optimization adjustment of the model to the data. The model can adapt to the real-time drilling situation and predict the results. The drilling speed prediction model is constructed by using a bidirectional long short-term memory network and an attention mechanism. For the data input to the model, it is not necessary to consider the underlying logging data and the interpretation data that need to be measured after drilling, but only the logging data that can be obtained in real time is used as the data input of the model, which reduces the amount of training data, so that the model construction is relatively simple, the depth is shallow, and the prediction delay is low. It improves the accuracy of drilling speed prediction, can help shorten the drilling cycle, is beneficial to improving drilling quality and drilling efficiency, reducing drilling risks, enhancing drilling safety and controllability, making the drilling process more efficient and safe, and reducing drilling costs.
[0061] Other features and advantages of the present invention will be described in the following description, and partly become apparent from the description, or understood by practicing the present invention. The purpose and other advantages of the present invention can be realized and obtained by the structures particularly pointed out in the written description, claims, and drawings.
[0062] The technical solution of the present invention is further described in detail below through the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0063] The accompanying drawings are used to provide a further understanding of the present invention and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the present invention and do not constitute a limitation of the present invention. In the accompanying drawings:
[0064] Figure 1 A schematic diagram of the steps of the real-time prediction method for mechanical drilling speed provided in an embodiment of the present application;
[0065] Figure 2 A structural diagram of a bidirectional long short-term memory neural network model provided in an embodiment of the present application;
[0066] Figure 3 A structural diagram of the attention layer in the network model provided in an embodiment of the present application;
[0067] Figure 4 A schematic diagram of the steps of a training method for a real-time prediction model of mechanical drilling speed provided in an embodiment of the present application;
[0068] Figure 5 A schematic diagram of the structure of a real-time prediction device for mechanical drilling speed provided in an embodiment of the present application;
[0069] Figure 6 A schematic diagram of the structure of a real-time prediction model training device for mechanical drilling speed provided in an embodiment of the present application. DETAILED DESCRIPTION
[0070] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.
[0071] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or combinations thereof.
[0072] It should also be understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0073] As used in the specification and appended claims of this application, the term "if" can be interpreted as "when" or "uponce" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "uponce it is determined" or "in response to determining" or "uponce [described condition or event] is detected" or "in response to detecting [described condition or event]", depending on the context.
[0074] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.
[0075] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.
[0076] It should be understood that the size of the serial numbers of the steps in the following embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0077] In order to illustrate the technical solution of the present application, a specific embodiment is provided below for illustration.
[0078] The inventors found that in the prior art, the method of using a recurrent neural network or related variants to predict the mechanical drilling speed of a well can accurately predict the mechanical drilling speed, but it does not take into account the problem that the model cannot be corrected in time according to the on-site conditions due to the long training time caused by the parameters in actual applications. Secondly, in order to ensure a certain degree of mapping accuracy and versatility, the neural network requires a large amount of data and a deeper network structure to ensure that the model can learn enough data knowledge, and the real-time performance is poor. In actual application, it is impossible to dynamically adjust and update the real-time data in real time, so that the model cannot make corresponding parameter changes according to the changing conditions such as the formation and on-site construction, and cannot cope with the real-time changes in the drilling process. Therefore, there is an urgent need for a method for real-time prediction of mechanical drilling speed to meet the real-time update requirements of the model required in actual applications and overcome the defects of the prior art. Based on this, the inventors have made the present invention after further research and development, providing a real-time prediction method for mechanical drilling speed, a model training method and a device.
[0079] Embodiment 1
[0080] The present invention provides a method for real-time prediction of mechanical drilling speed during drilling. Figure 1 As shown, the method includes:
[0081] S101: Sliding a preset sliding window according to a preset step length to obtain real-time logging data.
[0082] In the embodiment of the present application, the sliding window method in which the preset sliding window used in the above step S101 slides according to the preset step length is to realize the sliding entry of input information by specifying a window of a specific size and scrolling. For time-series data such as logging data, the sliding window can realize the time-series data sliding input from the far end of the timeline to the near end of the timeline. In this embodiment, the sliding window range is set to 50, and the step length is the common default value of 1, which means that the sliding window moves one data point each time. When the latest logging data is added to the sliding window after data preprocessing, the oldest data point in the sliding window will be deleted to keep the window size unchanged.
[0083] In one embodiment, before executing the above step S101 to obtain real-time logging data by sliding the preset sliding window according to the preset step length, the method further includes:
[0084] The real-time logging data is preprocessed to obtain processed real-time logging data; wherein the real-time logging data may include well depth, drilling time, drilling pressure, hanging weight, drilling speed, torque and displacement data.
[0085] In a specific embodiment, the data preprocessing of the real-time logging data to obtain the processed real-time logging data specifically includes:
[0086] Performing data judgment on the real-time logging data in the time domain to determine whether it is real real-time data;
[0087] If so, the real-time logging data is smoothed and filled with data by linear interpolation;
[0088] Correcting and / or removing abnormal values from the real-time logging data; removing abnormal fluctuation values from the real-time logging data; and,
[0089] The real-time logging data is normalized to obtain processed real-time logging data.
[0090] In the embodiment of the present application, a data preprocessing method is firstly selected to process the initial real-time logging data, including outlier removal, missing data item completion, etc., to form a complete well history-logging data processing flow, establish a complete database, and perform data set division, data normalization and other operations.
[0091] In the embodiment of the present application, in order to enable the intelligent model of mechanical drilling speed to optimize and update the model as the time domain data changes, the logging engineering data obtained in real time during drilling, that is, the logging data representing the real-time drilling status of well depth, drilling time, drilling pressure, hanging weight, rotation speed, torque, and displacement, is used to perform data judgment on the logging engineering data in the time domain, and the judgment is performed in combination with various working conditions to ensure that the data is real-time drilling data during the drilling process. At the same time, in order to ensure data quality, the processed time domain data is processed for data outliers, mainly including data filling of missing data items through linear interpolation, mutual logical judgment of data, removal of abnormal fluctuation values and other data processing operations to clean the data.
[0092] Among them, linear interpolation is a data filling method, which estimates the value of missing data points through the linear relationship between known data points. The specific steps are: determine the location of the missing data points and the missing features; find the known data points before and after the missing data points. These known data points should be adjacent to the missing data points on the same feature; calculate the slope (i.e., the rate of change) between the known data points. For continuous time series features, use methods such as linear regression to estimate the slope; use the slope between the known data points to estimate the value of the missing data points. For missing data points, the following formula is used for calculation: the value of the missing data point = the value of the previous known data point + (the value of the next known data point - the value of the previous known data point) * interpolation ratio. Mutual logical judgment of data means that when there is a logical relationship between the data, a logical judgment method can be used to fill in the missing data. Through statistical analysis methods, abnormal fluctuation values in the data are identified and eliminated. The present invention does not limit the specific anomaly detection method used here.
[0093] After the above data preprocessing, the processed real-time logging data is finally obtained as the input of the real-time drilling speed prediction model.
[0094] In the embodiment of the present application, after data preprocessing, the processed real-time logging data is slid according to the step size in a preset sliding window to obtain real-time logging data.
[0095] S102: inputting the real-time logging data into a real-time drilling speed prediction model to obtain a mechanical drilling speed prediction result, and updating parameters of the real-time drilling speed prediction model to obtain an updated real-time drilling speed prediction model;
[0096] The real-time drilling speed prediction model is obtained in the following way:
[0097] Slide the acquired historical logging data with a preset sliding window according to a preset step length to obtain a training data set;
[0098] Inputting the training data set into a pre-built drilling speed prediction model to obtain a prediction result;
[0099] Wherein, the pre-built drilling speed prediction model is constructed using a bidirectional long short-term memory network and an attention mechanism;
[0100] Adjusting the parameters of the drilling speed prediction model according to the prediction result to obtain a trained drilling speed prediction model;
[0101] The above model training process is repeated until the real-time drilling speed prediction model that meets the preset conditions is obtained.
[0102] In the embodiment of the present application, in the above step S102, the data obtained by the sliding window from the far end of the timeline to the near end of the timeline is input into the real-time drilling rate prediction model to obtain the mechanical drilling rate prediction result, and the model parameters are updated in a rolling manner through the sliding input information, so that the model parameters are adjusted as the input data changes over time, thereby realizing the update of the model and realizing the real-time update and optimization adjustment of the model to the time series data.
[0103] In the above step S102, the real-time logging data is input into the real-time drilling speed prediction model to obtain a mechanical drilling speed prediction result, and the parameters of the real-time drilling speed prediction model are updated to obtain an updated real-time drilling speed prediction model, which specifically includes:
[0104] Inputting the real-time logging data into the real-time drilling speed prediction model to obtain a drilling speed prediction result;
[0105] The parameters of the real-time drilling speed prediction model are updated according to the actual drilling speed result in the real-time logging data and the logging data at the last moment to obtain an updated real-time drilling speed prediction model.
[0106] Since in the embodiment of the present application, the real-time drilling speed prediction model is updated in real time, after obtaining the real drilling speed result in the real-time logging data at the next moment, the method may further include:
[0107] The updated real-time prediction model is parameter updated according to the actual drilling speed result in the real-time logging data acquired at the next moment and the real-time logging data to obtain a new updated real-time prediction model.
[0108] In the embodiment of the present application, the drilling speed prediction model constructed by using the bidirectional long short-term memory network and the attention mechanism includes an embedding layer, a bidirectional long short-term memory network layer and an attention layer; the real-time drilling speed prediction model described in the above step S102 is specifically obtained by the following method:
[0109] Slide the acquired historical logging data with a preset sliding window according to a preset step length to obtain a training data set;
[0110] Input the training data set into the embedding layer, perform vector space mapping on the input sequence, and obtain a first hidden vector;
[0111] Inputting the first hidden vector into the bidirectional long short-term memory network layer to perform parameter calculation to obtain a second hidden vector;
[0112] Inputting the second hidden vector at the historical moment into the attention layer to obtain the attention weight vector;
[0113] Inputting the second hidden vector into the attention layer, performing weighted summation on the second hidden vector according to a predetermined attention weight vector, and obtaining a prediction result;
[0114] According to the actual drilling speed results of the training data set and the predicted results, the model parameters are adjusted to obtain a trained drilling speed prediction model;
[0115] Repeat the above model training process until a real-time drilling speed prediction model that meets the preset conditions is obtained.
[0116] In an embodiment of the present application, the machine learning implements the mechanical drilling speed prediction method, and the prediction method also includes the use of random forest models, XGBoost models, support vector machine models and other neural network models. After comparison, it was found that the long short-term memory neural network model performed best in the problem of time-series drilling speed prediction. Due to its unique gated design structure, the long short-term memory neural network model is suitable for processing and predicting important events with very long intervals and delays in time series, and is suitable for application in drilling processes with time series and severe data fluctuations. On the basis of the long short-term memory neural network, the bidirectional long short-term memory neural network inputs the time series data in both the forward and backward directions into two independent long short-term memory network layers, and connects their outputs, so that the bidirectional long short-term memory neural network not only takes into account the context information before the current time step, but also takes into account the context information after the current time step, thereby obtaining a more comprehensive and rich context representation.
[0117] Construct a bidirectional long short-term memory neural network model, which includes an input layer, a hidden layer, and an output layer. The structure diagram of the bidirectional long short-term memory neural network model is as follows Figure 2 As shown in the figure, the hidden layer includes an embedding layer, a Bi-LSTM layer consisting of two LSTM layers, and an attention layer. The hidden layers in the network are described below.
[0118] First, the model performs vector space mapping on the input vector through the embedding layer, maps the discrete input features into a continuous vector space, and maps each discrete feature into a dense vector, which can better capture the correlation between features. Through the Embedding layer, the model can more effectively learn the representation of the input features and output the first hidden vector to the subsequent hidden layer for further calculation.
[0119] The first hidden vector is input into the Bi-LSTM layer to obtain the second hidden vector. The Bi-LSTM layer is a bidirectional long short-term memory layer, which consists of two LSTM layers in opposite directions. The two LSTM layers perform forward inference and reverse inference respectively. In Bi-LSTM, the hidden state and the memory state are two important intermediate variables used to capture the contextual information and long-term dependencies of the input sequence.
[0120] The hidden state is the state output by the Bi-LSTM network at each time step, which contains the input of the current time step and the information of the previous time step. The hidden state is one of the main outputs of the network and can be used for subsequent tasks or further processing. The memory state is the state maintained by the Bi-LSTM network at each time step, which is used to store and transmit long-term dependency information. The update of the memory state is controlled by the input gate, forget gate and output gate. It has the property of memory, can selectively retain or forget previous information, and update its own value in combination with the current input information.
[0121] Bi-LSTM contains three gating mechanisms, namely input gate, forget gate, and output gate. These gating mechanisms allow the network to selectively control the flow of information. The Bi-LSTM calculation process is as follows: First, define an input sequence as X = (x1, x2, ..., x n ), where x i is the i-th element of the input sequence. The Bi-LSTM network consists of two parts, the forward part and the backward part. The forward inference part calculates the hidden state h i and memory state c i :
[0122] Input gate: The input gate determines the degree of influence of the current input on the memory state. Its function is to selectively update the memory state to allow important information to enter the memory state. The input gate uses the sigmoid function to take the current input and the hidden state of the previous moment as input and output a value between 0 and 1. The closer the value is to 1, the more important the current input information is and should be retained in the memory state. The calculation formula is as follows:
[0123] i i =σ(W ix xi +W ih h i-1 +b i )
[0124] W, b in the formula represent the weight matrix and bias vector, σ is the sigmoid function, i i Represents the output value of the input gate at the i-th time step.
[0125] Forget gate: The forget gate determines the degree of influence of the memory state of the previous moment on the current moment. By using the sigmoid function, the input of the current moment and the hidden state of the previous moment are used as input, and a value between 0 and 1 is output. The closer the value is to 0, the more information in the memory state of the previous moment should be forgotten. The role of the forget gate is to allow the network to selectively discard unimportant information in order to better adapt to the current context. The calculation formula is as follows:
[0126] f i =σ(W ex x i +W eh h i-1 +b e )
[0127] W, b in the formula represent the weight matrix and bias vector, σ is the sigmoid function, and f i Represents the output value of the forget gate at the i-th time step.
[0128] Memory state update: The memory state is updated based on the results of the forget gate and the input gate, combined with the current input information. This gating mechanism enables the Bi-LSTM network to selectively retain or forget previous information and update the memory state in combination with the important information of the current input. The calculation formula is as follows:
[0129] c i =f i ⊙c i-1 +i i ⊙tanh(Wc x x i +Wc h h i-1 +b c )
[0130] Among them, f i Represents the output value of the forget gate at the i-th time step, i i represents the output value of the input gate at the i-th time step, ⊙ represents element-by-element multiplication, tanh is the hyperbolic tangent function, W in the formula, b represents the weight matrix and bias vector, x i is the input at the current moment, h i-1 is the hidden state at the previous moment, ci-1 It is the memory state of the previous moment.
[0131] Output gate: The output gate determines the degree of influence of the current memory state on the hidden state. By using the sigmoid function, the input of the current moment and the hidden state of the previous moment are used as input, and a value between 0 and 1 is output. This value indicates the importance of the current memory state to the hidden state. Then, the memory state is transformed by using the hyperbolic tangent function, mapped to a value between -1 and 1, and multiplied by the result of the output gate to obtain the final hidden state. The role of the output gate is to control the range and amplitude of the hidden state to adapt to different task requirements.
[0132] o i =σ(W ox x i +W oh h i-1 +b o )
[0133] h i =o i ⊙tanh(c i )
[0134] Among them, i represents the output value of the output gate at the i-th time step, ⊙ represents element-by-element multiplication, tanh is the hyperbolic tangent function, W in the formula, b represents the weight matrix and bias vector, x i is the input at the current moment, h i-1 is the hidden state at the previous moment, c i It is the memory state at the current moment.
[0135] The backward inference part is similar to the forward inference part, except that it is calculated in reverse order in time. For the input sequence X=(x1,x2,...,x n ), the backward calculation is from x n Starting from the last time step of the sequence, the hidden state and gradient are calculated in reverse order, the memory state and parameters are updated, and the updated hidden state and parameters are used to perform inference step by step in the reverse order.
[0136] The second hidden vector at the historical moment is input into the attention layer, and the attention mechanism is used to establish a self-attention relationship between the second hidden vector at the historical moment and the second hidden vector at the latest moment, that is, to establish a weight relationship between each input feature, realize mutual attention between each feature, and obtain an attention weight vector. The importance of the input feature is identified by the attention weight vector, so as to strengthen the learning of the nonlinear relationship between the logging data and the predicted drilling speed, and between the logging data, reduce or even filter out the attention of other information, and improve the efficiency and accuracy of the model. The structural diagram of the attention layer is shown in the figure below: Figure 3 As shown. Among them, H t is the hidden state input item obtained by Bi-LSTM at time t, W h , W c , W o is the weight value of the attention mechanism, and the input item H t By connecting with W h , W c Calculate, activate through tanh activation function, obtain the calculation results of each time item through softmax, and compare with W o Calculate and output the result. t The output of the attention layer at time t is represented. That is, the second hidden vector is input into the attention layer, and the second hidden vector is weighted and summed according to the predetermined attention weight vector to obtain the drilling speed prediction result of the current input logging data.
[0137] As described above, a real-time drilling speed prediction model combining the attention mechanism and the bidirectional long short-term memory neural network is constructed. The real-time logging engineering data is input into the model using the sliding window method. Based on the sliding window, the sequence data is divided into windows of fixed size, and then the entire sequence is gradually traversed by the sliding window. The specific steps are: define the window size, determine the number of samples included to be 50, including logging data and corresponding drilling speeds for 50 consecutive moments; initialize the window position, set the starting position of the window to the starting position of the sequence, that is, the starting moment of the sequence; process the window data, starting from the starting position, input the data in the window into the real-time drilling speed prediction model for training; slide the window, slide the window forward one moment; repeat the steps to process the window data and the sliding window until the window slides to the end of the sequence data, that is, the latest moment.
[0138] In the embodiment of the present application, the network input sequence X = (x1, x2, ..., x n), which are preset input parameters that affect the mechanical speed. The model is trained and tested by entering data sliding from the far end of the timeline to the near end of the timeline. The model parameters are adjusted according to the actual drilling speed results and predicted drilling speed results of the training data set. The model parameters are adjusted according to the changes in time series data. The specific hyperparameters and function settings of the model training are determined, and the activation function of the real-time drilling speed prediction model is set to the ReLU activation function. The optimizer used is the Adam optimization algorithm, the learning rate is 0.001, the sliding window range is set to 50, and the loss function of the model is the mean square error MSE. The real-time drilling speed prediction model after training is obtained.
[0139] In the embodiment of the present application, the mechanical drilling speed prediction model has been trained to obtain a real-time prediction model of mechanical drilling speed after training. The real-time data is preprocessed and then input into the model for online learning, and the logging data and the real drilling speed at the current moment are obtained. The logging data at the previous moment and the real drilling speed at the current moment are used as input, so that the sliding window contains its data as the latest moment data, and the real-time drilling speed prediction model after training is input to perform iterative update of the model. At the same time, the logging data at the current moment is input into the real-time drilling speed prediction model after training, and the mechanical drilling speed at the next moment is predicted, and the real mechanical drilling speed actually obtained at the next moment is used as input and added to the sliding window. In the above manner, the training iterative update of the model is performed, thereby realizing real-time self-update of the model. This method is called online learning, which is a method of gradually updating the model, which allows the model to learn and adjust in real time when receiving new data. The model uses time series data to update parameters to maintain adaptability to new data.
[0140] Embodiment 2
[0141] Based on the same inventive concept, the present application embodiment also provides a training method for a real-time prediction model of mechanical drilling speed, referring to Figure 4 As shown, the method includes:
[0142] S201: Sliding the acquired historical logging data with a preset sliding window according to a preset step length to obtain a training data set;
[0143] S202: Inputting the training data set into a pre-built drilling speed prediction model to obtain a prediction result; wherein the pre-built drilling speed prediction model is constructed using a bidirectional long short-term memory network and an attention mechanism;
[0144] S203: adjusting the parameters of the trained drilling speed prediction model according to the prediction result to obtain the trained drilling speed prediction model, and repeating the above model training process until the real-time drilling speed prediction model that meets the preset conditions is obtained.
[0145] Embodiment 3
[0146] Based on the same inventive concept, the present application also provides a real-time prediction device for mechanical drilling speed, referring to Figure 5 As shown, the device comprises:
[0147] A model acquisition module 101 is used to acquire a real-time drilling speed prediction model;
[0148] The real-time drilling speed prediction model is trained in the following way:
[0149] Slide the acquired historical logging data with a preset sliding window according to a preset step length to obtain a training data set;
[0150] Inputting the training data set into a pre-built drilling speed prediction model to obtain a prediction result; wherein the pre-built drilling speed prediction model is constructed using a bidirectional long short-term memory network and an attention mechanism;
[0151] Adjusting the parameters of the trained drilling speed prediction model according to the prediction result to obtain the trained drilling speed prediction model;
[0152] Repeat the above model training process until the real-time drilling speed prediction model that meets the preset conditions is obtained;
[0153] The data acquisition module 102 is used to obtain real-time logging data by sliding a preset sliding window according to a preset step length;
[0154] The real-time prediction updating module 103 is used to input the real-time logging data into the real-time drilling speed prediction model to obtain a drilling speed prediction result, and to update the parameters of the real-time prediction model to obtain an updated real-time prediction model.
[0155] Embodiment 4
[0156] Based on the same inventive concept, the present application also provides a real-time prediction model training device for mechanical drilling speed, referring to Figure 6 As shown, the device comprises:
[0157] A preprocessing module 201 is used to slide the acquired historical logging data with a preset sliding window according to a preset step length to obtain a training data set;
[0158] A forward training module 202 is used to input the training data set into the trained drilling speed prediction model to obtain a prediction result; the model is constructed using a bidirectional long short-term memory network and an attention mechanism;
[0159] The reverse training module 203 adjusts the parameters of the trained drilling speed prediction model according to the prediction results to obtain the trained drilling speed prediction model; and repeats the above model training process until a real-time drilling speed prediction model that meets the preset conditions is obtained.
[0160] Embodiment 5
[0161] Based on the same inventive concept, an embodiment of the present application also provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, it implements the real-time prediction method for mechanical drilling speed as described in the above embodiment one, and / or the training method for the real-time prediction model for mechanical drilling speed as described in the above embodiment two.
[0162] Embodiment 6
[0163] Based on the same inventive concept, an embodiment of the present application also provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the real-time prediction method for mechanical drilling speed described in the above-mentioned embodiment 1 and / or the training method for the real-time prediction model for mechanical drilling speed described in the above-mentioned embodiment 2 are implemented.
[0164] Embodiment 7
[0165] Based on the same inventive concept, an embodiment of the present application also provides a computer program product comprising instructions. When the computer program product is run on a computer device, the computer device executes the real-time prediction method for mechanical drilling speed as described in the above embodiment 1, and / or the training method for the real-time prediction model for mechanical drilling speed as described in the above embodiment 2.
[0166] Embodiment 8
[0167] Based on the same inventive concept, an embodiment of the present application also provides a chip, the chip includes a processor and a communication interface, the communication interface and the processor are coupled, and the processor is used to run a computer program or instruction to implement the real-time prediction method of mechanical drilling speed as described in the above embodiment 1, and / or the training method of the real-time prediction model of mechanical drilling speed as described in the above embodiment 2.
[0168] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage and optical storage, etc.) containing computer-usable program code.
[0169] The present invention is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0170] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0171] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0172] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.
Claims
1. A real-time prediction method for mechanical drilling rate, characterized in that: include: Slide the preset sliding window according to the preset step length to obtain real-time logging data; Inputting the real-time logging data into a real-time drilling speed prediction model to obtain a mechanical drilling speed prediction result, and updating parameters of the real-time drilling speed prediction model to obtain an updated real-time drilling speed prediction model; The real-time drilling speed prediction model is obtained in the following way: Slide the acquired historical logging data with a preset sliding window according to a preset step length to obtain a training data set; Inputting the training data set into a pre-built drilling speed prediction model to obtain a prediction result; wherein the pre-built drilling speed prediction model is constructed using a bidirectional long short-term memory network and an attention mechanism; Adjusting the parameters of the drilling speed prediction model according to the prediction result to obtain a trained drilling speed prediction model; The above model training process is repeated until the real-time drilling speed prediction model that meets the preset conditions is obtained.
2. The real-time prediction method for mechanical drilling speed according to claim 1, characterized in that: The real-time logging data is input into a real-time drilling speed prediction model to obtain a mechanical drilling speed prediction result, and the parameters of the real-time drilling speed prediction model are updated to obtain an updated real-time drilling speed prediction model, including: Inputting the real-time logging data into the real-time drilling speed prediction model to obtain a drilling speed prediction result; The parameters of the real-time drilling speed prediction model are updated according to the actual drilling speed result in the real-time logging data and the logging data at the last moment to obtain an updated real-time drilling speed prediction model.
3. The real-time prediction method for mechanical drilling speed according to claim 2, characterized in that: Also includes: The updated real-time prediction model is parameter updated according to the actual drilling speed result in the real-time logging data acquired at the next moment and the real-time logging data to obtain a new updated real-time prediction model.
4. The real-time prediction method for mechanical drilling rate according to claim 1, characterized in that: The pre-built drilling speed prediction model includes an embedding layer, a bidirectional long short-term memory network layer, and an attention layer; The step of inputting the training data set into a pre-built drilling speed prediction model to obtain a prediction result includes: Input the training data set into the embedding layer, perform vector space mapping on the input sequence, and obtain a first hidden vector; Inputting the first hidden vector into the bidirectional long short-term memory network layer to perform parameter calculation to obtain a second hidden vector; The second hidden vector is input into the attention layer, and the second hidden vector is weighted summed according to a predetermined attention weight vector to obtain a prediction result.
5. The real-time prediction method for mechanical drilling rate according to claim 4, characterized in that: Also included is obtaining the attention weight vector in the following manner: The second hidden vector at the historical moment is input into the attention layer to obtain the attention weight vector.
6. The real-time prediction method for mechanical drilling speed according to claim 4, characterized in that: The step of adjusting the parameters of the drilling speed prediction model according to the prediction result to obtain a trained drilling speed prediction model includes: According to the actual drilling speed results of the training data set and the predicted results, the model parameters are adjusted to obtain the trained drilling speed prediction model.
7. The method according to claim 1, characterized in that Before the real-time logging data is fed into the real-time prediction model, it also includes: Performing data preprocessing on the real-time logging data to obtain processed real-time logging data; The real-time logging data includes well depth, drilling time, drilling pressure, hanging weight, drilling speed, torque and displacement data.
8. The method according to claim 7, characterized in that The method of preprocessing the real-time logging data to obtain processed real-time logging data includes: Performing data judgment on the real-time logging data in the time domain to determine whether it is real real-time data; If so, the real-time logging data is smoothed and filled with data by linear interpolation; Correcting and / or removing outliers from the real-time logging data; Eliminating abnormal fluctuation values in the real-time logging data; and, The real-time logging data is normalized to obtain processed real-time logging data.
9. A training method for a real-time prediction model of mechanical drilling speed, characterized in that: include: Slide the acquired historical logging data with a preset sliding window according to a preset step length to obtain a training data set; Inputting the training data set into a pre-built drilling speed prediction model to obtain a prediction result; wherein the pre-built drilling speed prediction model is constructed using a bidirectional long short-term memory network and an attention mechanism; Adjusting the parameters of the trained drilling speed prediction model according to the prediction result to obtain the trained drilling speed prediction model; Repeat the above model training process until a real-time drilling speed prediction model that meets the preset conditions is obtained.
10. A real-time prediction device for mechanical drilling speed, characterized in that: include: A model acquisition module is used to obtain a real-time drilling speed prediction model; The real-time drilling speed prediction model is trained in the following way: Slide the acquired historical logging data with a preset sliding window according to a preset step length to obtain a training data set; Inputting the training data set into a pre-built drilling speed prediction model to obtain a prediction result; wherein the pre-built drilling speed prediction model is constructed using a bidirectional long short-term memory network and an attention mechanism; Adjusting the parameters of the trained drilling speed prediction model according to the prediction result to obtain the trained drilling speed prediction model; Repeat the above model training process until the real-time drilling speed prediction model that meets the preset conditions is obtained; A data acquisition module, used to obtain real-time logging data by sliding a preset sliding window according to a preset step length; The real-time prediction updating module is used to input the real-time logging data into the real-time drilling speed prediction model to obtain the drilling speed prediction result, and to update the parameters of the real-time prediction model to obtain the updated real-time prediction model.
11. A real-time prediction model training device for mechanical drilling speed, characterized in that: include: A preprocessing module is used to slide the acquired historical logging data with a preset sliding window according to a preset step length to obtain a training data set; A forward training module, used for inputting the training data set into the trained drilling speed prediction model to obtain a prediction result; the model is constructed using a bidirectional long short-term memory network and an attention mechanism; The reverse training module adjusts the parameters of the trained drilling speed prediction model according to the prediction results to obtain the trained drilling speed prediction model; and repeats the above model training process until a real-time drilling speed prediction model that meets the preset conditions is obtained.
12. A computer-readable storage medium, in which instructions are stored. When the instructions are executed on a terminal, the terminal executes the real-time prediction method for mechanical drilling speed according to any one of claims 1 to 8, and / or the training method for the real-time prediction model according to claim 9.
13. A computer device, characterized in that: The method comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the method for real-time prediction of mechanical drilling speed according to any one of claims 1 to 8 and / or the method for training a real-time prediction model according to claim 9 is implemented.
14. A computer program product comprising instructions, which, when executed on a computer device, enables the computer device to execute the method for real-time prediction of mechanical drilling rate according to any one of claims 1 to 8, and / or the method for training a real-time prediction model according to claim 9.
15. A chip, comprising a processor and a communication interface, wherein the communication interface and the processor are coupled, and the processor is used to run a computer program or instruction to implement the real-time prediction method for mechanical drilling speed according to any one of claims 1 to 8, and / or the real-time prediction model training method according to claim 9.
Citation Information
Cited By
Well drilling risk prediction method and device
CN121235446A
Model parameter online updating method and device, equipment, medium and program product
CN122087313A