Real-time data stream processing method suitable for drilling speed prediction and optimization
By combining sliding windows and abnormal processing and sliding filtering algorithms, the problem that the existing technology cannot remove abnormal data in real-time well recording data streams is solved, real-time support for drilling speed prediction and optimization is achieved, and drilling efficiency is improved.
Patent Information
- Application Number
- CN202411907570.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-24
- Publication Date
- 2025-04-22
AI Technical Summary
The existing drilling speed prediction and optimization models cannot remove non-drilling states and abnormal data in real-time well recording data streams, resulting in the constraints on the real-time effects of drilling speed intelligent prediction and parameter optimization.
A real-time data stream processing method is designed, combining sliding windows, exception processing and sliding filtering algorithms, and through isolated forest anomaly detection algorithm and SG sliding filtering algorithm, real-time well recording data is filtered, detected and smoothed, real-time processing of data streams is realized.
This method can actively perform drilling data screening, abnormal detection, and data smoothing processing, help real-time data flow downstream drilling speed prediction and optimization, and improve drilling efficiency.
Smart Images

Figure CN119862513A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to a real-time data stream processing method suitable for drilling speed prediction and optimization, and particularly belongs to the field of drilling. Background Art
[0002] Drilling rate prediction and optimization is one of the key technologies for reducing costs and improving efficiency in oil drilling operations. In recent years, drilling rate prediction and optimization models based on big data and intelligent algorithms have become the main research direction of this technology. Due to objective factors such as data acquisition technology, equipment, and environment, the real-time logging data stream contains various non-drilling conditions and abnormal data. However, when performing intelligent prediction of drilling rate and parameter optimization, only the normal data of drilling status needs to be considered. The existence of outliers in the data set will interfere with the accuracy of the model. Therefore, real-time processing of logging data is a crucial task to ensure the effect of drilling rate prediction and optimization.
[0003] The statistical anomaly detection method uses the distribution of data to observe outliers, such as the 3σ principle. Based on the normal distribution assumption, it is assumed that the data follows the normal distribution, and the data points near the mean value are considered normal, while the data points far from the mean value are considered outliers. Box plot is also a commonly used method for abnormal data detection. Generally, 1.5 times the quartile (IQR) of the box plot is used as the standard. Values greater than "upper quartile + 1.5*IQR" or less than "lower quartile - 1.5*IQR" are considered outliers. However, these anomaly detection methods have large detection errors when facing high-dimensional real-time logging data.
[0004] Some anomaly detection methods based on machine learning often have better results, such as isolation forests, clustering algorithms, and neural networks. In 2019, Yin Zhiming and others used the K-means clustering algorithm to propose an outlier detection algorithm for drilling data applications. They found that after removing the outliers, the training obtained a better model effect, laying the foundation for the practical application of drilling data. In 2022, Li Chunsheng and others proposed a method for processing abnormal logging data based on the BP neural network. Experimental verification shows that the BP neural network model can detect abnormal logging data, and the accuracy of detecting abnormal points is higher than that of similar algorithms such as the Grubbs method and the K-means clustering algorithm. The results of processing abnormal points are credible and can effectively solve the problems caused by abnormal point data.
[0005] Although a lot of research has been done in China on the processing methods for logging data, most of the existing models are for logging data that has been drilled, without considering the dynamic mechanism of real-time logging data streams, and cannot remove non-drilling states and abnormal data in the data stream in real time, which restricts the real-time effect of intelligent prediction of drilling speed and parameter optimization. It is urgent to establish a real-time data stream processing method for drilling speed prediction and optimization, actively perform drilling data screening and anomaly detection, data smoothing and other processing, to help predict and optimize drilling speed under real-time data streams and improve drilling efficiency. Summary of the invention
[0006] The present invention designs and develops a real-time data stream processing method suitable for drilling speed prediction and optimization. Based on the dynamic mechanism of real-time logging data stream, the sliding window and exception processing and sliding filtering algorithms are combined to realize the prediction and optimization of drilling speed under real-time data stream and improve drilling efficiency.
[0007] The technical solution provided by the present invention is:
[0008] A real-time data stream processing method suitable for drilling rate prediction and optimization, comprising:
[0009] Step 1: Establish a drilling speed prediction model and an optimization model, and obtain drilling parameter data of adjacent wells and target wells through well site sensors according to the sampling period;
[0010] Step 2: judging the drilling status data and saving the drilling status data;
[0011] Step 3: When the length of the collected drilling status data is equal to the length of the sliding window, the abnormal data is removed by using the isolation forest anomaly detection algorithm;
[0012] Step 4: Smoothing the normal data in the data window based on the SG sliding filter algorithm;
[0013] Step 5: When the continuously received data reaches the update step of the data window, the data is updated by sliding, and the process returns to step 2 until all data points are processed, thus completing the data processing of the path data stream.
[0014] Preferably, the drilling status judgment standard in step 2 is:
[0015] The drill bit depth is equal to the well depth; and
[0016] The three parameters of drilling pressure, rotation speed and displacement are non-negative and greater than the set threshold value at the same time.
[0017] Preferably, the drilling pressure is greater than 5KN, the rotation speed is greater than 0RPM, and the displacement is greater than 0L / s.
[0018] Preferably, the step three comprises:
[0019] Randomly select a set of features and random cut values from the data space to be processed to build a binary tree;
[0020] For each sample, starting from the root node, according to the comparison result between the feature and the cut value, the sample is assigned to the left subtree or the right subtree (what kind of sample is assigned to the left subtree, what kind of sample is assigned to the right subtree), until the sample reaches the leaf node;
[0021] Build multiple trees and record the path length of each tree;
[0022] For a new sample, traverse each tree and calculate the average length of the path that the sample takes to reach the leaf node;
[0023] If the average value is less than the set threshold, the sample is judged as an abnormal sample;
[0024] If the average value is greater than or equal to the set threshold, the sample is judged as a normal sample.
[0025] Preferably, the step 4 comprises:
[0026] SG filtering processes the data signal based on a sliding window, and sets the window size to an odd number;
[0027] The data points in the current window are fitted by the least square method to obtain a fitting polynomial;
[0028] Use the fitting polynomial to calculate the smoothed value of the central data point in the current window;
[0029] The window slides forward one data point, and fitting and smoothing continue until all data points have been processed.
[0030] Preferably, in step three, the length of the sliding window is 30m.
[0031] Preferably, in step five, the window update step is 5m.
[0032] The beneficial effects described in the present invention are as follows: the real-time data stream processing method suitable for drilling speed prediction and optimization provided by the present invention first sets drilling status screening conditions for real-time logging data to obtain drilling status data; sets a fixed data window and update step size, and when the saved logging data stream meets the data window, uses isolation forest and sliding average filtering methods in turn to perform abnormality detection and smoothing on the real-time data in the data window, and then gradually updates and returns the processed data to the drilling speed prediction and optimization model, thereby realizing data processing of the logging data stream.
[0033] This method can actively perform drilling data screening, anomaly detection, and data smoothing, which can help predict and optimize the drilling speed under real-time data flow and improve drilling efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] Figure 1 The present invention is a flowchart of the real-time data stream processing method for drilling speed prediction and optimization.
[0035] Figure 2 This is a diagram showing the effect of data outlier detection based on isolated trees as described in the present invention.
[0036] FIG3( a ) is a comparison diagram of the main drilling parameter “drilling time” according to the present invention before and after data anomaly processing based on isolation forest.
[0037] FIG3( b ) is a comparison diagram of the main drilling parameter “biting pressure” described in the present invention before and after data anomaly processing based on isolation forest.
[0038] FIG3( c ) is a comparison diagram of the main drilling parameter “torque” described in the present invention before and after data anomaly processing based on isolation forest.
[0039] FIG3( d ) is a comparison diagram of the main drilling parameter “standpipe pressure” described in the present invention before and after data anomaly processing based on isolation forest.
[0040] FIG3( e ) is a comparison diagram of the main drilling parameter “Dc index” described in the present invention before and after data anomaly processing based on isolation forest. DETAILED DESCRIPTION
[0041] The present invention is further described in detail below in conjunction with the accompanying drawings so that those skilled in the art can implement the invention with reference to the description.
[0042] like Figure 1 -3, the present invention provides a real-time data stream processing method suitable for drilling speed prediction and optimization. Based on the dynamic mechanism of real-time logging data stream, the sliding window and exception processing and sliding filtering algorithms are combined to realize the prediction and optimization of drilling speed under real-time data stream and improve drilling efficiency. The method is realized by sequentially transmitting data: a data collection module, a drilling state judgment module, an abnormal value processing module, a data smoothing module, and a sliding update module, and specifically includes:
[0043] Step 1: Establish a drilling speed prediction model and an optimization model. In the data collection module, obtain the drilling parameter data of the adjacent wells and the target well through the well site sensors according to the sampling period;
[0044] Step 2: In the drilling status identification module, the drilling status data is judged by comprehensively considering the well depth and drilling parameters, and the drilling status data is saved;
[0045] Step 3: In the outlier processing module, when the length of the collected drilling status data is equal to the sliding window length, the outlier data is removed by using the isolation forest anomaly detection algorithm;
[0046] Step 4: In the data smoothing module, the normal data in the data window is smoothed based on the SG sliding filter algorithm to obtain and retain the main features and trends of the logging data;
[0047] Step 5: In the sliding update module, when the continuously received data reaches the update step of the data window, the data is updated by sliding, and the process returns to step 2 until all data points are processed, thus completing the data processing of the path data stream.
[0048] Among them, the drilling status judgment standard in step 2 is that the drill bit depth is equal to the well depth, and the three parameters of drilling pressure, drilling speed, and displacement are non-negative and greater than the set threshold at the same time. The threshold size needs to be set in advance according to the field data collection standard, and the setting range is 30 to 60m.
[0049] In the present invention, as a preference, the drilling pressure is set to be greater than 5KN, the rotation speed is greater than 0RPM, and the displacement is greater than 0L / s.
[0050] The isolation forest algorithm is used as an anomaly discrimination model, including:
[0051] Randomly select a set of features and random cut values from the data space to be processed to build a binary tree to increase the diversity of the tree;
[0052] For each sample, starting from the root node, according to the comparison result between the feature and the cut value, if the feature value is less than the cut value, the sample is assigned to the left subtree, and if the feature value is greater than the cut value, the sample is assigned to the right subtree, until the sample reaches the leaf node;
[0053] Construct multiple trees and record the path length of each tree, that is, the number of splits that the sample goes through to reach the leaf node. A shorter path length indicates that the sample is more likely to be considered an abnormal sample.
[0054] For a new sample, traverse each tree and calculate the path length that the sample takes to reach the leaf node, that is, the number of splits from the root node to the leaf node. If the average value is less than the set threshold, the sample is judged as an abnormal sample.
[0055] If not, it is considered a normal sample.
[0056] In the present invention, as a preferred embodiment, the SG filtering algorithm is selected to smooth the data. The SG filtering algorithm can better retain the local features and has the advantages of high filtering effect and good stability, effectively removing the noise in the signal while retaining the main features and trends of the data, and has high computational efficiency, which is suitable for the processing of real-time data streams, including:
[0057] (1) Select the filter window size: SG filtering uses a sliding window to process the signal, and the window size is an odd number N;
[0058] (2) Calculate the fitting coefficients: For the data points in the current window, the SG filter uses the least squares method to fit a polynomial function. The order of the fitting polynomial is selected according to the needs. A third-order polynomial is selected. The goal of the fitting is to make the fitting polynomial closest to the data points in the window. The fitting formula P(x) is:
[0059] P(x)=c0+c1x+c2x 2 +c3*x 3 ;
[0060] (3) Calculate the smoothing value: For the central data point in the current window, use the fitting polynomial P(x) to calculate the smoothing value. This smoothing value is the value of the data point after filtering.
[0061] (4) Sliding window movement: The window slides forward one data point, and the fitting and smoothing value calculation steps (1) to (3) are continued until all data points are processed.
[0062] Example
[0063] Step 1: In the data collection module, real-time logging data is obtained from the well site sensor, and the data is collected every 5 seconds;
[0064] Step 2: In the drilling status identification module, whenever a piece of logging data is received, the data processing module automatically determines whether the data is drilling data;
[0065] The judgment criteria are that the drill bit depth is equal to the well depth, and the three main parameters of drilling pressure, rotation speed and displacement are non-negative and greater than the preset threshold value. The threshold value needs to be set in advance according to the field data collection standard;
[0066] Set the drilling pressure to be greater than 5KN, the speed to be greater than 0RPM, and the displacement to be greater than 0L / s;
[0067] If it is drilling status data, select Save, and non-drilling status data will not be saved;
[0068] Step 3: In the outlier processing module, when the length of the collected drilling status data is equal to the sliding window length, the window length is set to 30m (usually set to the length of a drill string), and the isolated forest anomaly detection algorithm is used to perform anomaly processing on the data to remove abnormal data. The results are as follows: Figure 2 As shown, the red points are the detected abnormal data, and the blue points are the retained normal data;
[0069] Step 4: In the data smoothing module, the SG sliding filter algorithm is used to smooth the normal data in the data window. The results are shown in Figure 3 (a) to (e). The blue curve is the normal data after step 3 processing, and the yellow curve is the data after smoothing. The results retain the main features and trends of the logging data.
[0070] Step 5: In the sliding update module, after the data in a data window has been operated in steps 2, 3, and 4, the continuously received data reaches the data window update step, which is set to 5m here, and the data is updated in a sliding manner, and the process returns to step 2.
[0071] This method can process the logging data in real time. The processed data eliminates outliers and retains the main features and trends of the data, which can be directly used for drilling rate prediction and optimization of intelligent training and prediction.
[0072] This method fully considers the dynamic acquisition mechanism of real-time logging data stream, and adopts a method combining sliding window and exception processing and sliding filtering algorithm to process the logging data stream in real time to meet the real-time update requirements of the drilling rate prediction intelligent model.
[0073] Although the embodiments of the present invention have been disclosed as above, they are not limited to the applications listed in the specification and the implementation modes, and they can be fully applied to various fields suitable for the present invention. For those familiar with the art, additional modifications can be easily implemented. Therefore, without departing from the general concept defined by the claims and the scope of equivalents, the present invention is not limited to the specific details and the illustrations shown and described herein.
Claims
1. A real-time data stream processing method suitable for drilling rate prediction and optimization, characterized in that: include: Step 1: Establish a drilling speed prediction model and an optimization model, and obtain drilling parameter data of adjacent wells and target wells through well site sensors according to the sampling period; Step 2: judging the drilling status data and saving the drilling status data; Step 3: When the length of the collected drilling status data is equal to the length of the sliding window, the abnormal data is removed by using the isolation forest anomaly detection algorithm; Step 4: Smoothing the normal data in the data window based on the SG sliding filter algorithm; Step 5: When the continuously received data reaches the update step of the data window, the data is updated by sliding, and the process returns to step 2 until all data points are processed, thus completing the data processing of the path data stream.
2. The real-time data stream processing method for drilling speed prediction and optimization according to claim 1, characterized in that: The drilling status judgment standard in step 2 is: The drill bit depth is equal to the well depth; and The three parameters of drilling pressure, rotation speed and displacement are non-negative and greater than the set threshold value at the same time.
3. The real-time data stream processing method for drilling speed prediction and optimization according to claim 2, characterized in that: The drilling pressure is greater than 5KN, the rotation speed is greater than 0RPM, and the displacement is greater than 0L / s.
4. The real-time data stream processing method for drilling speed prediction and optimization according to claim 3, characterized in that: The step three comprises: Randomly select a set of features and random cut values from the data space to be processed to build a binary tree; For each sample, starting from the root node, according to the comparison result between the feature and the cut value, the sample is assigned to the left subtree or the right subtree (what kind of sample is assigned to the left subtree, what kind of sample is assigned to the right subtree), until the sample reaches the leaf node; Build multiple trees and record the path length of each tree; For a new sample, traverse each tree and calculate the average length of the path that the sample takes to reach the leaf node; If the average value is less than the set threshold, the sample is judged as an abnormal sample; If the average value is greater than or equal to the set threshold, the sample is judged as a normal sample.
5. The real-time data stream processing method for drilling speed prediction and optimization according to claim 4, characterized in that: The fourth step comprises: SG filtering processes the data signal based on a sliding window, and sets the window size to an odd number; The data points in the current window are fitted by the least square method to obtain a fitting polynomial; Use the fitting polynomial to calculate the smoothed value of the central data point in the current window; The window slides forward one data point, and fitting and smoothing continue until all data points have been processed.
6. The real-time data stream processing method for drilling speed prediction and optimization according to claim 5, characterized in that: In the step three, the length of the sliding window is 30m.
7. The real-time data stream processing method for drilling speed prediction and optimization according to claim 6, characterized in that: In step 5, the window update step is 5m.