A deep learning-based passive anti-collision method for oil drilling downhole
By processing downhole magnetic field data using deep learning technology, a multi-target oil casing identification model is constructed, which solves the problem of insufficient theoretical guidance in multi-target positioning and prediction of traditional passive downhole collision avoidance technology. This achieves high precision and robustness in downhole collision avoidance and is suitable for complex working conditions.
Patent Information
- Application Number
- CN202510130410.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-05
- Publication Date
- 2026-01-13
- Estimated Expiration
- 2045-02-05
AI Technical Summary
Traditional passive downhole collision avoidance technology lacks theoretical guidance in multi-target positioning and prediction, and cannot establish a general mathematical model, resulting in poor inversion accuracy in actual production. In particular, in complex environments with severe signal interference, it is difficult to accurately predict the location between wells.
A deep learning-based approach is adopted to measure downhole magnetic field data using a magnetic gradient tensor sensor. Data cleaning and calibration are performed, and stable data are filtered using jump thresholds and adaptive windows. A multi-objective oil casing identification transfer learning model is constructed and iteratively trained to achieve downhole collision avoidance.
It improves the accuracy and robustness of downhole collision avoidance, enabling rapid and accurate prediction of casing location under different working conditions, reducing investment costs, and improving the efficiency of downhole collision avoidance and rescue.
Smart Images

Figure CN120046735B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of this application relate to the field of deep learning technology, and in particular to a passive anti-collision method for oil drilling downhole based on deep learning. Background Technology
[0002] my country is a major energy producer, with oil accounting for a significant proportion of its energy needs and serving as a crucial strategic resource. Data from 2023 indicates that oil accounts for approximately 20% to 25% of my country's total energy demand. my country's oil drilling primarily utilizes large well clusters, with an increasing number of infill wells being drilled in older areas. During new drilling, the small spacing between wells and the large number of wells in clusters make collision prevention extremely difficult, requiring high levels of precision in monitoring drilling trajectories and the location of adjacent wells. A collision could result in significant casualties and property damage. For example, the 2010 Gulf of Mexico oil spill resulted in over 20 injuries and fatalities, causing economic losses exceeding $60 billion. Therefore, downhole collision prevention technology is of paramount importance for efficient and safe production.
[0003] Currently, the most mature technology used domestically and internationally in downhole collision avoidance is magnetic guidance detection technology. This technology utilizes specific equipment to detect the magnetic field signal strength of a magnetic source, thereby achieving accurate positioning of two wells with a small gap. Magnetic guidance detection technology is divided into active detection technology and passive detection technology. Active detection technology achieves guidance control by actively applying an external magnetic field or controlling the direction and strength of the magnetic field. This technology has high reliability and accuracy, but low production efficiency, long time consumption, and cumbersome operation. Passive detection technology achieves guidance control by utilizing the magnetic characteristics of the object itself to influence the magnetic field, without the need to apply an external magnetic field. Oil casing (hereinafter referred to as casing) is a ferromagnetic material. After being magnetized by the Earth's magnetic field, it will form an induced magnetic field around it. Using a magnetic sensor, the casing's magnetic anomaly characteristics, which are different from the Earth's magnetic field, can be detected. This passive detection technology is simple to implement and can greatly improve efficiency in production. However, because the magnetic field signal strength decays cubically over distance, its reliability is poor at long distances.
[0004] Traditional passive downhole collision avoidance technology first establishes a mathematical model of the casing magnetic field, and then uses the mathematical model to invert the casing's position information. However, the traditional method has at least the following problems.
[0005] First, traditional passive downhole collision avoidance technologies mostly use numerical simulation and experimental methods to describe the magnetic field distribution around the vertical casing. Furthermore, the forward model conditions are too idealized, while the target signal is a small signal, typically ranging from tens to hundreds of nanoteslas (nT). However, the actual production environment is much more complex than the idealized model. For example, unknown interference noise and electromagnetic interference from other engineering equipment can overwhelm the target signal, thus limiting the guidance for actual production.
[0006] Second, in actual production, cluster wells (multi-target) are usually the main focus. For multi-target prediction of well spacing and well orientation, domestic and foreign research teams have not yet proposed mature theoretical methods, and cannot accurately predict location information.
[0007] Third, the residual magnetism of different bushings varies, and it is impossible to measure it uniformly on the production site. This makes it impossible to establish a universal mathematical model, so the ideal model has poor inversion accuracy in actual production.
[0008] In summary, traditional passive downhole collision avoidance technology still suffers from a lack of multi-target positioning theory guidance and difficulty in establishing a universal mathematical model for casing. Therefore, there is an urgent need for advanced theories on downhole collision avoidance. Summary of the Invention
[0009] In view of this, embodiments of this application propose a deep learning-based passive collision avoidance method for oil drilling downhole, which has good performance for multi-target location prediction, and the constructed inference model has high accuracy and robustness, and can be applied to passive collision avoidance in downhole under various working conditions.
[0010] To achieve the above objectives, embodiments of this application propose a deep learning-based passive collision avoidance method for oil drilling downholes. The method includes: selecting a subset of wells from all wells as reference wells; measuring the background magnetic field data of each reference well using a magnetic gradient tensor sensor; placing casing of different specifications in each reference well; and measuring the magnetic field data of the casing of different specifications in adjacent wells using the magnetic gradient tensor sensor; performing preprocessing, including data cleaning and data calibration, on the background magnetic field data of each reference well and the magnetic field data of the casing of different specifications to obtain preprocessed data; and then, based on a preset jump... Thresholds and adaptive windows are used to filter the preprocessed data to obtain stable data. Based on the stable data, interpolation is used to obtain the background magnetic field data of each well except the benchmark well. The background magnetic field data is subtracted from the magnetic field data after casing is installed in each well to obtain the abnormal magnetic field data of the casing. The abnormal magnetic field data of the casing is continuously interpolated to construct a dataset. An inference model is built based on a deep learning neural network. The inference model is iteratively trained until convergence using the constructed dataset to obtain the trained inference model. The trained inference model is deployed to achieve passive collision avoidance in oil drilling wells.
[0011] To achieve the above objectives, embodiments of this application also propose a deep learning-based passive collision avoidance system for oil drilling downholes. The system includes: a reference module, used to select a subset of wells from all wells as reference wells, measure the background magnetic field data of each reference well using a magnetic gradient tensor sensor, then place casing of different specifications in each reference well, and measure the magnetic field data of the casing of different specifications in adjacent wells using the magnetic gradient tensor sensor; a preprocessing module, used to perform preprocessing, including data cleaning and data calibration, on the background magnetic field data of each reference well and the magnetic field data of the casing of different specifications to obtain preprocessed data; and a stable data filtering module, used to filter data based on a preset jump threshold and... An adaptive window filters the preprocessed data to obtain stable data; an interpolation module uses interpolation to obtain background magnetic field data for each well (excluding the benchmark well) based on the stable data; an anomaly calculation module subtracts the background magnetic field data from the magnetic field data after casing is installed in each well to obtain the abnormal magnetic field data of the casing; a construction module continuously interpolates the abnormal magnetic field data of the casing to construct a dataset, and builds an inference model based on a deep learning neural network; a training module iteratively trains the inference model using the constructed dataset until convergence, obtains the trained inference model, and deploys the trained inference model to achieve passive collision avoidance in oil drilling wells.
[0012] To achieve the above objectives, embodiments of this application also propose an electronic device comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to execute a deep learning-based passive collision avoidance method for oil drilling as described above.
[0013] Embodiments of this application also provide a computer-readable storage medium storing a computer program that, when executed by a processor, can implement a deep learning-based passive collision avoidance method for oil drilling wells as described above.
[0014] This application proposes a deep learning-based passive collision avoidance method for oil drilling downholes. First, a subset of wells are selected as benchmark wells, and the background magnetic field data of each benchmark well is measured. Then, casing of different specifications is placed in each benchmark well, and the magnetic field data of casing of different specifications is measured in adjacent wells. After data cleaning and calibration, stable data is obtained by filtering based on a preset jump threshold and adaptive window. Next, interpolation is used to obtain the background magnetic field data of each well other than the benchmark wells. The abnormal magnetic field data of the casing is obtained by subtracting the background magnetic field data from the magnetic field data of each well after casing placement. Finally, continuous interpolation is performed on the abnormal magnetic field data of the casing to construct a realistic and rich dataset, which can better serve model training. Next, this application constructs a multi-target oil casing recognition transfer learning model (inference model) based on magnetic field data from different engineering environments. The constructed dataset is used to iteratively train the inference model until convergence, resulting in a trained inference model. When deployed to the required scenarios, passive collision avoidance in oil drilling downholes can be achieved. The inference model trained in this way is highly versatile, robust, and accurate, making it well applicable to different downhole drilling conditions. It effectively reduces investment costs in other conditions and has good performance in multi-target location prediction. It can quickly and accurately predict the location information of the casing, which is of great significance for downhole collision prevention and downhole rescue.
[0015] In some optional embodiments, the preprocessing of the background magnetic field data of each reference well and the magnetic field data of casings of different specifications, including data cleaning and data calibration, to obtain preprocessed data, includes:
[0016] The background magnetic field data of each benchmark well and the magnetic field data of casings of different specifications were converted into tabular form, and the converted tables were cleaned.
[0017] The magnetic gradient tensor sensor is rotated at different angles in a uniform magnetic field to calculate the calibration matrix, and the calibration matrix is used to calibrate the data in the cleaned data table to obtain the preprocessed data.
[0018] The preprocessed data is expressed by the formula:
[0019] B * =C(B-B0);
[0020] C = A -1 K -1 ;
[0021]
[0022] Where C represents the calibration matrix, B is the actual measured value, B0 is the temperature drift zero drift value of the magnetic gradient tensor sensor, and B...* This represents the preprocessed data, where A is the non-orthogonal error matrix. θ and ψ are three different angles, K is the sensitivity inconsistency error matrix, and Kx, Ky and Kz are the components of the sensitivity inconsistency error matrix K in the x-axis, y-axis and z-axis directions, respectively.
[0023] In some optional embodiments, a preset jump threshold is denoted as jump_threshold. The step of filtering the preprocessed data based on the preset jump threshold and an adaptive window to obtain stable data includes:
[0024] The preprocessed data is used as the original data. The derivative of the original data is taken to obtain the rate of change val of the original data.
[0025] Set a step width threshold width_threshold, initialize the step start index start_idx, end index end_idx, and flag;
[0026] Iterate through all the original data. If the value of the current original data i is less than jump_threshold, set the flag to 0. If the value of the current original data i is greater than or equal to jump_threshold, set the flag to 1.
[0027] On the rising edge of the flag, the value of i is assigned to start_idx, and on the falling edge of the flag, the value of i is assigned to end_idx.
[0028] Subtract start_idx from end_idx to obtain the step length, and calculate the mean step_means of this step. If the step length is less than width_threshold, delete the current step_means. If the step length is greater than or equal to width_threshold, save the current step_means as valid stable data.
[0029] In some optional embodiments, obtaining background magnetic field data for each well other than the reference well using interpolation based on stable data includes:
[0030] Based on stable data, two-dimensional interpolation is performed in a coordinate system composed of all wells using Newton's interpolation method, based on a set of discrete stable data {x i ,y i ,f(x i ,y i Construct an interpolation polynomial P(x) i ,y i ), P(x i ,y iThis can be expressed as a formula:
[0031]
[0032] The coefficient of each interpolation term is calculated using a two-dimensional difference quotient, which is expressed by the formula:
[0033] f[x i ,y i ]=f(x i ,y i );
[0034]
[0035] Based on the constructed interpolation polynomial, each term in the stable data is calculated sequentially using two-dimensional difference quotients and stored in the difference quotient table array. The difference quotient table array is initialized, and for each column, the difference quotients of different orders are calculated step by step. Each time, the difference quotient of the previous column is obtained by subtraction. Finally, the background magnetic field data of each well except the reference well are obtained by interpolation.
[0036] In some optional embodiments, the step of subtracting the background magnetic field data from the magnetic field data of each well after casing is installed to obtain the abnormal magnetic field data of the casing includes: measuring the elevation of the wellhead of each well using real-time dynamic differential positioning technology; subtracting the well depth from the elevation of the wellhead to obtain the absolute elevation of each well; and subtracting the background magnetic field data from the magnetic field data of each well after casing is installed based on the absolute elevation of each well to obtain the abnormal magnetic field data of the casing.
[0037] In some optional embodiments, the constructed dataset is represented as follows:
[0038] [Bx1,By1,Bz1,Bt1,Bx2,By2,Bz2,Bt2,Bx3,By3,Bz3,Bt3,Bx4,By4,Bz4,Bt4];
[0039] Among them, 16 values constitute one-dimensional data, Bx j By j Bz j Bt j Let x, y, z, and total values represent the x-axis component, y-axis component, z-axis component, and total value of the j-th probe, respectively. j = 1, 2, 3, 4 represent the first probe, the second probe, the third probe, and the fourth probe, respectively. The constructed dataset is divided into training set, test set, and validation set in a ratio of 8:1:1, and the labels are set to the distance and angle between the observation well and the target.
[0040] In some optional embodiments, the construction of the inference model based on the deep learning neural network includes: treating the casing position inversion as a nonlinear regression problem and constructing an inference model based on a multilayer perceptron model; the deployment of the trained inference model to achieve passive collision avoidance in oil drilling wells includes: converting the trained inference model into an ONNX format inference file, writing server-side and client-side code and packaging it into an executable file, and running the executable file to achieve passive collision avoidance in oil drilling wells. Attached Figure Description
[0041] One or more embodiments are illustrated by way of example with reference to the accompanying drawings, and these illustrative descriptions do not constitute a limitation on the embodiments.
[0042] Figure 1 This is a flowchart of a deep learning-based passive collision avoidance method for oil drilling downhole, provided in one embodiment of this application.
[0043] Figure 2 This is a schematic diagram of the wellhead distribution provided in one embodiment of this application;
[0044] Figure 3 This is a schematic diagram of a magnetic gradient tensor sensor provided in one embodiment of this application;
[0045] Figure 4 This is a real-life image of the experimental site provided in one embodiment of this application;
[0046] Figure 5 This is a comparison diagram of data before and after calibration provided in one embodiment of this application;
[0047] Figure 6 This is a schematic diagram of the numerical value after differentiating the original data provided in one embodiment of this application;
[0048] Figure 7 This is a schematic diagram of an adaptive window for finding stable data provided in one embodiment of this application;
[0049] Figure 8 This is a schematic diagram illustrating the working principle of an adaptive window provided in one embodiment of this application;
[0050] Figure 9 This is a schematic diagram of stable data provided in one embodiment of this application;
[0051] Figure 10 This is a schematic diagram of a cross-section of a shallow well provided in one embodiment of this application;
[0052] Figure 11 This is a comparison diagram before and after subtracting the background magnetic field anomaly signal provided in one embodiment of this application;
[0053] Figure 12 This is a schematic diagram of magnetic anomaly signal interpolation provided in one embodiment of this application;
[0054] Figure 13 This is a schematic diagram of the network structure of the inference model provided in one embodiment of this application;
[0055] Figure 14 This is a graph showing the training result of the model provided in one embodiment of this application;
[0056] Figure 15 This is a schematic diagram of a client running model file provided in one embodiment of this application;
[0057] Figure 16 This is a single-target and multi-target prediction result diagram provided in one embodiment of this application;
[0058] Figure 17 This is a schematic diagram of the prediction error of the inference model provided in one embodiment of this application;
[0059] Figure 18 This is a schematic diagram of the structure of a deep learning-based passive anti-collision system for oil drilling, provided in another embodiment of this application.
[0060] Figure 19 This is a schematic diagram of the structure of an electronic device provided in another embodiment of this application. Detailed Implementation
[0061] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the various embodiments of this application will be described in detail below with reference to the accompanying drawings. However, those skilled in the art will understand that many technical details have been provided in the various embodiments of this application to help readers better understand this application. However, the technical solutions claimed in this application can be implemented even without these technical details and various changes and modifications based on the following embodiments. The division of the various embodiments below is for the convenience of description and should not constitute any limitation on the specific implementation of this application. The various embodiments can be combined with and referenced by each other without contradiction.
[0062] One embodiment of this application proposes a deep learning-based passive collision avoidance method for oil drilling downhole, applied to an electronic device, wherein the electronic device can be a terminal or a server. In this embodiment and the following embodiments, the electronic device is described using a server as an example. The implementation details of the deep learning-based passive collision avoidance method for oil drilling downhole proposed in this embodiment are described in detail below. The following implementation details are provided for ease of understanding and are not necessary for implementing this solution.
[0063] The specific process of the deep learning-based passive collision avoidance method for oil drilling downhole proposed in this embodiment can be described as follows: Figure 1 As shown, it includes:
[0064] Step 101: Select a portion of the wells as reference wells from all the wells, use a magnetic gradient tensor sensor to measure the background magnetic field data of each reference well, then place casings of different specifications in each reference well, and use a magnetic gradient tensor sensor to measure the magnetic field data of casings of different specifications in adjacent wells of each reference well.
[0065] In the specific implementation, the server first needs to select some wells as reference wells from all the wells in the experimental site. Then, it uses a specially developed magnetic gradient tensor sensor to measure the background magnetic field data of each reference well. Next, it places multiple casings of different specifications in each reference well and uses the magnetic gradient tensor sensor to measure the magnetic field data of the casings of different specifications in the adjacent wells of each reference well.
[0066] In one example, a total of 7 shallow wells were set up at the experimental site, and the distribution of the wellheads of these 7 shallow wells could be as follows: Figure 2 As shown, the seven shallow wells are named sequentially as Well #1, Well #2, Well #3, Well #4, Well #5, Well #6, and Well #7. Wells #1, #2, #4, and #6 are selected as benchmark wells, and the following method is used... Figure 3 The special magnetic gradient tensor sensor shown was used to measure the background magnetic field data of wells #1, #2, #4, and #6. Then, casings of different specifications were placed in each reference well, and the magnetic gradient tensor sensor was used to measure the magnetic field data of the casings of different specifications in adjacent wells of each reference well. The specific experimental conditions are as follows... Figure 4 As shown.
[0067] Step 102: Perform preprocessing, including data cleaning and data calibration, on the background magnetic field data of each reference well and the magnetic field data of casings of different specifications to obtain preprocessed data.
[0068] In practice, after the server measures the background magnetic field data of each reference well and the magnetic field data of casings of different specifications, it needs to perform preprocessing, including data cleaning and data calibration, on the background magnetic field data of each reference well and the magnetic field data of casings of different specifications to obtain preprocessed data.
[0069] In one example, the server first converts the background magnetic field data of each reference well and the magnetic field data of casings of different specifications into tabular form, and then cleans the resulting tables to remove erroneous data. Next, the server rotates the magnetic gradient tensor sensor by different angles within a uniform magnetic field to calculate the calibration matrix, and uses the calibration matrix to calibrate the cleaned tables, obtaining preprocessed data. The comparison before and after data calibration is shown below. Figure 5 As shown.
[0070] In one example, the preprocessed data is expressed by the formula:
[0071] B * =C(B-B0);
[0072] C = A -1 K -1 ;
[0073]
[0074] Where C represents the calibration matrix, B is the actual measured value, B0 is the temperature drift zero drift value of the magnetic gradient tensor sensor, and B... * This represents the preprocessed data, where A is the non-orthogonal error matrix. θ and ψ are three different angles, K is the sensitivity inconsistency error matrix, and Kx, Ky and Kz are the components of the sensitivity inconsistency error matrix K in the x-axis, y-axis and z-axis directions, respectively.
[0075] Step 103: Based on the preset jump threshold and adaptive window, the preprocessed data is filtered to obtain stable data.
[0076] In practice, after the server completes the preprocessing, it needs to filter the preprocessed data based on a preset jump threshold and an adaptive window to obtain stable data.
[0077] In one example, let the preset jump threshold be denoted as jump_threshold. Using the preprocessed data as the original data, we take the derivative of the original data to obtain the rate of change val of the original data. The value of the derivative of the original data (i.e., the rate of change val of the original data) is as follows: Figure 6 As shown. Next, the server needs to combine jump_threshold and adaptive window for filtering. The operating mechanism of the adaptive window is as follows: Figure 7 As shown, the working principle is as follows: Figure 8As shown in the diagram. The server sets a step width threshold `width_threshold`, then initializes the start index `start_idx`, end index `end_idx`, and flag for each step. The server then iterates through all the original data. If the value of the current original data `i` is less than `jump_threshold`, the flag is set to 0; if the value of the current original data `i` is greater than or equal to `jump_threshold`, the flag is set to 1. At the rising edge of the flag, the server assigns the value of `i` to `start_idx`; at the falling edge, the server assigns the value of `i` to `end_idx`. Finally, the server subtracts `start_idx` from `end_idx` to obtain the step length, calculates the mean value `step_means` for this step, and deletes the current `step_means` if the step length is less than the step width threshold `width_threshold`; otherwise, it saves the current `step_means` as valid stable data. The final selected valid stable data can be shown as follows: Figure 9 As shown.
[0078] Step 104: Based on stable data, use interpolation to obtain background magnetic field data for each well other than the reference well.
[0079] In practice, after the server selects stable data, it needs to use interpolation to obtain the background magnetic field data of each well other than the reference well.
[0080] In one example, the server only measured the background magnetic field data for wells #1, #2, #4, and #6. To obtain the background magnetic field data for wells #3, #5, and #6, interpolation is required. The server uses Newton's interpolation method based on stable data, within a coordinate system formed by all wells (e.g., ...). Figure 2 Two-dimensional interpolation is performed in the data (as shown), based on a set of discrete, stable data {x}. i ,y i ,f(x i ,y i Construct an interpolation polynomial P(x) i ,y i P(x) i ,y i This can be expressed as a formula:
[0081]
[0082] Next, the server uses the two-dimensional difference quotient to calculate the coefficient of each interpolation term. The two-dimensional difference quotient can be expressed by the formula:
[0083] f[x i ,y i ]=f(x i ,y i );
[0084]
[0085] Finally, the server needs to use the constructed interpolation polynomial to calculate each term in the stable data sequentially using two-dimensional difference quotients and store it in the difference quotient table array. The difference quotient table array is initialized, and for each column, the difference quotients of different orders are calculated step by step. Each time, the difference quotient of the previous column is obtained by subtraction. Finally, the background magnetic field data of each well except the reference well is obtained by interpolation (that is, the interpolation result corresponding to the target point is obtained).
[0086] Step 105: Subtract the background magnetic field data from the magnetic field data of each well after casing is installed to obtain the abnormal magnetic field data of the casing.
[0087] In the specific implementation, the server has obtained the background magnetic field data of all wells. Next, it is necessary to subtract the corresponding background magnetic field data from the magnetic field data of each well after the casing is installed to obtain the abnormal magnetic field data of the casing.
[0088] In one example, the wellheads of the seven shallow wells at the experimental site have inconsistent elevations. It is necessary to measure the elevation of each wellhead using RTK (Real-Time Kinematics) technology, and record the well depth using the wellhead as the zero point of the relative coordinate system. Figure 10 As shown, the server subtracts the well depth from the wellhead elevation to obtain the absolute elevation of each well. Finally, based on the absolute elevation of each well, the background magnetic field data is subtracted from the magnetic field data after casing is installed in each well to obtain the abnormal magnetic field data of the casing. The abnormal magnetic field data of the casing is as follows: Figure 11 As shown.
[0089] Step 106: Perform continuous interpolation on the abnormal magnetic field data of the bushing to construct a dataset.
[0090] In the actual implementation, after the server obtains the abnormal magnetic field data of the bushing, it needs to continuously interpolate the abnormal magnetic field data of the bushing to construct a dataset.
[0091] In one example, the dataset constructed by the server can be represented as:
[0092] [Bx1,By1,Bz1,Bt1,Bx2,By2,Bz2,Bt2,Bx3,By3,Bz3,Bt3,Bx4,By4,Bz4,Bt4];
[0093] Among them, 16 values constitute one-dimensional data, Bx j By j Bzj Bt j Let x, y, z, and total values of the j-th probe be represented respectively, where j = 1, 2, 3, and 4 represent the first, second, third, and fourth probes respectively.
[0094] In one example, the server needs to divide the constructed dataset into a training set, a test set, and a validation set in an 8:1:1 ratio, with the labels set as the distance and angle between the observation well and the target.
[0095] In one example, during the experiment, 5-inch casing, 9-inch casing, and 5-inch casing were respectively placed in wells #1, #2, and #7, and labeled as 5-inch 1, 9-inch 2, and 5-inch 7. The data format for the labels can be as follows:
[0096] [5-inch 1_Dis, 5-inch 1_Angle, 9-inch 2_Dis, 9-inch 2_Angle, 5-inch 7_Dis, 5-inch 7_Angle];
[0097] Where Dis represents the distance between the observation well and the target, and Angle represents the angle between the observation well and the target.
[0098] In one example, the longitudinal interpolation result for 5 inches can be as follows: Figure 12 As shown.
[0099] Step 107: Construct an inference model based on a deep learning neural network, and use the constructed dataset to iteratively train the inference model until convergence, thus obtaining the trained inference model.
[0100] In the actual implementation, after the server obtains the dataset, it needs to build an inference model based on a deep learning neural network. The inference model is then iteratively trained using the obtained dataset until it converges, thus obtaining the trained inference model.
[0101] In one example, the server treats the casing location inversion as a nonlinear regression problem and builds an inference model based on a multilayer perceptron (MLP). The MLP is well-suited for nonlinear regression tasks, possessing powerful nonlinear modeling capabilities. The model structure of the inference model built by the server is as follows: Figure 13 As shown. The loss curve and accuracy curve after training are shown in the figure. Figure 14 As shown.
[0102] Step 108: Deploy the trained inference model to achieve passive collision avoidance in oil drilling wells.
[0103] In practice, once the server obtains the trained inference model, it can deploy the trained inference model to the required scenario, thereby achieving passive collision avoidance in oil drilling wells.
[0104] In one example, to facilitate user operation, the server needs to convert the trained model into an ONNX format inference file, write server-side and client-side code, package it into an executable file, and run the executable file to achieve passive collision avoidance in oil drilling wells. The final running effect is as follows. Figure 15 As shown, the prediction results of single-objective and multi-objective models are as follows: Figure 16 As shown, the prediction error is as follows Figure 17 As shown, the relative error is within 5%, which meets the actual production requirements.
[0105] This embodiment proposes a deep learning-based passive collision avoidance method for oil drilling downholes. First, a subset of wells are selected as benchmark wells, and the background magnetic field data of each benchmark well is measured. Then, casing of different specifications is placed in each benchmark well, and the magnetic field data of casing of different specifications is measured in adjacent wells of each benchmark well. After data cleaning and calibration, stable data is obtained by filtering based on a preset jump threshold and adaptive window. Next, interpolation is used to obtain the background magnetic field data of each well other than the benchmark wells. The abnormal magnetic field data of the casing is obtained by subtracting the background magnetic field data from the magnetic field data of each well after casing placement. Finally, continuous interpolation is performed on the abnormal magnetic field data of the casing to construct a realistic and rich dataset, which can better serve model training. Next, this embodiment constructs a multi-target oil casing recognition transfer learning model (also known as an inference model) based on magnetic field data from different engineering environments. The constructed dataset is used to iteratively train the inference model until convergence, resulting in a trained inference model. This model can then be deployed to the required scenarios to achieve passive collision avoidance in oil drilling downholes. The inference model trained in this way is highly versatile, robust, and accurate, making it well applicable to different downhole drilling conditions. It effectively reduces investment costs in other conditions and has good performance in multi-target location prediction. It can quickly and accurately predict the location information of the casing, which is of great significance for downhole collision prevention and downhole rescue.
[0106] The steps of the various methods described above are only for clarity. In practice, they can be combined into one step or some steps can be split into multiple steps. As long as they include the same logical relationship, they are all within the scope of protection of this application. Adding insignificant modifications or introducing insignificant designs to the algorithm or process, but without changing the core design of the algorithm and process, are also within the scope of protection of this application.
[0107] Correspondingly, another embodiment of this application proposes a deep learning-based passive collision avoidance system for oil drilling downhole. The implementation details of this deep learning-based passive collision avoidance system for oil drilling downhole are described below. The following details are provided for ease of understanding and are not essential for implementing this solution. The specific structure of the deep learning-based passive collision avoidance system for oil drilling downhole proposed in this embodiment can be as follows: Figure 18 As shown, it includes:
[0108] The reference module 201 is used to select a portion of wells as reference wells from all wells, use a magnetic gradient tensor sensor to measure the background magnetic field data of each reference well, then place casings of different specifications in each reference well, and use a magnetic gradient tensor sensor to measure the magnetic field data of casings of different specifications in adjacent wells of each reference well.
[0109] The preprocessing module 202 is used to preprocess the background magnetic field data of each benchmark well and the magnetic field data of casings of different specifications, including data cleaning and data calibration, to obtain preprocessed data.
[0110] The stable data filtering module 203 is used to filter the preprocessed data based on a preset jump threshold and an adaptive window to obtain stable data.
[0111] The interpolation processing module 204 is used to obtain the background magnetic field data of each well other than the reference well based on stable data and by using interpolation methods.
[0112] The anomaly calculation module 205 is used to subtract the background magnetic field data from the magnetic field data of each well after the casing is installed, so as to obtain the abnormal magnetic field data of the casing.
[0113] Module 206 is used to continuously interpolate the abnormal magnetic field data of the bushing to construct a dataset, and to build an inference model based on a deep learning neural network.
[0114] Training module 207 is used to iteratively train the inference model using the constructed dataset until convergence, obtain the trained inference model, and deploy the trained inference model to achieve passive collision avoidance in oil drilling wells.
[0115] It is worth mentioning that all modules involved in this embodiment are logical modules. In practical applications, a logical unit can be a physical unit, a part of a physical unit, or a combination of multiple physical units. Furthermore, to highlight the innovative aspects of this application, this embodiment does not introduce units that are not closely related to solving the technical problems proposed in this application; however, this does not mean that other units are absent in this embodiment.
[0116] Correspondingly, another embodiment of this application proposes an electronic device, such as Figure 19 As shown, it includes: at least one processor 301; and a memory 302 communicatively connected to the at least one processor 301; wherein the memory 302 stores instructions executable by the at least one processor 301, the instructions being executed by the at least one processor 301 to enable the at least one processor 301 to execute a deep learning-based passive collision avoidance method for oil drilling as described in the above method embodiments.
[0117] The memory and processor are connected via a bus, which can include any number of interconnecting buses and bridges, connecting various circuits of one or more processors and memories. The bus also connects various other circuits such as peripherals, voltage regulators, and power management circuits, which are well known in the art and will not be described further herein. The bus interface provides an interface between the bus and the transceiver. The transceiver can be a single element or multiple elements, such as multiple receivers and transmitters, providing a unit for communicating with various other devices over a transmission medium.
[0118] The processor manages the bus and general processing, and also provides various functions, including timing, peripheral interfaces, voltage regulation, power management, and other control functions. Memory is used to store data used by the processor during operation.
[0119] Another embodiment of this application proposes a computer-readable storage medium storing a computer program that, when executed by a processor, enables a deep learning-based passive collision avoidance method for oil drilling as described in the above method embodiments.
[0120] That is, those skilled in the art will understand that all or part of the steps in the methods of the above embodiments can be implemented by a program instructing related hardware. This program is stored in a storage medium and includes several instructions to cause a device (which may be a microcontroller, chip) or processor to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as a USB flash drive, a portable hard drive, ROM (Read-Only Memory), RAM (Random Access Memory), a magnetic disk, or an optical disk.
[0121] Those skilled in the art will understand that the above embodiments are specific embodiments for implementing this application, and in practical applications, various changes can be made to them in form and detail without departing from the spirit and scope of this application.
Claims
1. A deep learning-based passive anti-collision method for oil drilling downhole, characterized in that, The application relates to a method for realizing passive anti-collision in oil drilling. The method comprises the following steps: Selecting part of the wells as reference wells, measuring the background magnetic field data of each reference well by using a magnetic gradient tensor sensor, placing different specifications of casings in each reference well, and measuring the magnetic field data of the casings in the adjacent wells of each reference well by using the magnetic gradient tensor sensor; Preprocessing the background magnetic field data of each reference well and the magnetic field data of casings with different specifications, including data cleaning and data calibration, to obtain preprocessed data; Based on a preset jump threshold and an adaptive window, the preprocessed data is screened to obtain stable data; Based on the stable data, the background magnetic field data of each well except the reference wells is obtained by using an interpolation method; The magnetic field data of the casings after being placed in each well is subtracted by the background magnetic field data to obtain abnormal magnetic field data of the casings; The abnormal magnetic field data of the casings is continuously interpolated to construct a data set; Based on a deep learning neural network, an inference model is constructed, and the inference model is iteratively trained based on the constructed data set until convergence, so that a trained inference model is obtained; 2. The deep learning-based passive anti-collision method for oil drilling downhole according to claim 1, characterized in that, The trained inference model is deployed to realize passive anti-collision in oil drilling. The preprocessing of the background magnetic field data of each reference well and the magnetic field data of casings with different specifications, including data cleaning and data calibration, to obtain preprocessed data, comprises the following steps: The background magnetic field data of each reference well and the magnetic field data of casings with different specifications are converted into a table form, and the converted table is subjected to data cleaning; The magnetic gradient tensor sensor is rotated at different angles in a uniform magnetic field to calculate a calibration matrix, and the calibration matrix is used to calibrate the data cleaned table to obtain preprocessed data; B * = C(B - B0); C = A -1 K -1 ; Wherein, C represents the calibration matrix, B is the actual measured value, B0 is the temperature drift zero drift value of the magnetic gradient tensor sensor, B * represents the pre-processed data, A is a non-orthogonal error matrix, θ and ψ are three different angles, K is a sensitivity inconsistency error matrix, Kx, Ky and Kz are respectively components of the sensitivity inconsistency error matrix K in the x-axis direction, the y-axis direction and the z-axis direction.
3. The deep learning-based passive anti-collision method for oil drilling downhole according to claim 2, characterized in that, The preprocessed data is expressed by a formula as follows: The jump threshold is denoted as jump_threshold, and the preprocessed data is screened based on the preset jump threshold and the adaptive window to obtain stable data, which comprises the following steps: The preprocessed data is taken as original data, and the derivative of the original data is obtained to obtain the change rate val of the original data; A step width threshold width_threshold is set, and the starting index start_idx, the ending index end_idx and the flag are initialized; All original data is traversed, if the val of the current original data i is less than the jump_threshold, the flag is set to 0, if the val of the current original data i is greater than or equal to the jump_threshold, the flag is set to 1; When the flag rises, the i value is assigned to the start_idx, and when the flag falls, the i value is assigned to the end_idx; The step length is obtained by subtracting the start_idx from the end_idx, the mean value step_means of the step is calculated, if the step length is less than the width_threshold, the current step_means is deleted, if the step length is greater than or equal to the width_threshold, the current step_means is saved as valid stable data.
4. The deep learning-based passive anti-collision method for oil drilling downhole according to claim 3, characterized in that, The background magnetic field data of each well except the reference well is obtained by using an interpolation method based on the stable data, and the background magnetic field data of each well except the reference well is obtained by using an interpolation method based on the stable data, including: Based on stable data, two-dimensional interpolation is performed in a coordinate system composed of all wells using Newton's interpolation method, based on a set of discrete stable data {x i ,y i ,f(x i ,y i Construct an interpolation polynomial P(x) i ,y i ), P(x i ,y i This can be expressed as a formula: The coefficients of each interpolation term are calculated using a two-dimensional difference quotient, which is represented by the formula: f[x i ,y i ] = f(x i ,y i ); Based on the constructed interpolation polynomial, each term in the stable data is calculated in turn using a two-dimensional difference quotient, and is stored in a difference quotient table array. The difference quotient table array is initialized, and for each column, the difference quotients of different orders are calculated step by step. Each time, the difference quotient of the previous column is calculated by subtraction. Finally, the background magnetic field data of each well except the reference well is obtained by interpolation.
5. The deep learning-based passive anti-collision method for oil drilling downhole according to claim 4, characterized in that, The background magnetic field data of each well except the reference well is obtained by using an interpolation method based on the stable data, and the background magnetic field data of each well except the reference well is obtained by using an interpolation method based on the stable data, including: The elevation of the wellhead of each well is measured by real-time dynamic differential positioning technology; The absolute height of each well is obtained by subtracting the well depth from the elevation of the wellhead; Based on the absolute height of each well, the background magnetic field data of each well after being put into the casing is subtracted to obtain the abnormal magnetic field data of the casing.
6. The deep learning-based passive anti-collision method for oil drilling downhole according to claim 5, characterized in that, The data set obtained by construction is represented as: [Bx1, By1, Bz1, Bt1, Bx2, By2, Bz2, Bt2, Bx3, By3, Bz3, Bt3, Bx4, By4, Bz4, Bt4]; wherein 16 values constitute one-dimensional data, Bx j , By j , Bz j , Bt j respectively represent the x-axis component, the y-axis component, the z-axis component, and the total amount of the jth probe, j = 1, 2, 3, 4 respectively represent the first probe, the second probe, the third probe, and the fourth probe. The data set obtained by construction is divided into training set, test set and validation set according to the ratio of 8:1:1, and the label is set as the distance and angle between the observation well and the target.
7. The deep learning-based passive anti-collision method for oil drilling downhole according to claim 6, characterized in that, The inference model is constructed based on the deep learning neural network, including: The position inversion of the casing is regarded as a nonlinear regression problem, and the inference model is constructed based on a multilayer perception model; The trained inference model is deployed to realize passive anti-collision in oil drilling, including: The trained inference model is converted into an onnx format inference file, the server and client codes are written and packaged into executable files, and the executable files are run to realize passive anti-collision in oil drilling.
8. A deep learning based passive anti-collision system for oil drilling downhole, characterized in that, Including: The reference module is used to select part of the wells as reference wells in all wells, measure the background magnetic field data of each reference well using a magnetic gradient tensor sensor, and then put different specifications of casings into each reference well, and measure the magnetic field data of the casings of different specifications in the adjacent wells of each reference well using a magnetic gradient tensor sensor; The preprocessing module is used for preprocessing the background magnetic field data of each reference well and the magnetic field data of casings of different specifications, including data cleaning and data calibration, to obtain preprocessed data; The stable data screening module is used to screen the preprocessed data based on a preset jump threshold and an adaptive window to obtain stable data; The interpolation processing module is used to obtain the background magnetic field data of each well except the reference well by using an interpolation method based on the stable data; The anomaly calculation module is used to subtract the background magnetic field data from the magnetic field data of each well after being put into the casing to obtain the abnormal magnetic field data of the casing; The construction module is used to continuously interpolate the abnormal magnetic field data of the casing, construct a data set, and construct an inference model based on a deep learning neural network. The training module is configured to perform iterative training on the inference model using the constructed data set until convergence, obtain a trained inference model, and deploy the trained inference model, thereby achieving passive anti-collision in oil drilling.
9. An electronic device, comprising: Comprise: at least one processor; and, a memory in communication with the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform a deep learning-based passive anti-collision method for oil drilling as claimed in any one of claims 1 to 7.
10. A computer readable storage medium storing a computer program, characterized in that, The computer program is executed by the processor to implement a deep learning-based passive anti-collision method for oil drilling as claimed in any one of claims 1 to 7.
Citation Information
Patent Citations
Petroleum drilling anti-collision passive detection device and method based on magnetic core coil
CN111188614A
Passive magnetic ranging anti-collision method and device
CN116104469A