A method and system for predicting wellbore scaling based on transfer function and machine learning

By combining transfer functions and machine learning methods, and utilizing 3D CNN and LSTM models, the problem of insufficient accuracy in wellbore scaling prediction by traditional methods has been solved, achieving high-precision quantitative prediction of wellbore scaling and supporting normal production and cleaning of gas wells.

CN120031782BActive Publication Date: 2025-10-31CHENGDU UNIV OF INFORMATION TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411580474.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-07
Publication Date
2025-10-31
Estimated Expiration
2044-11-07

AI Technical Summary

Technical Problem

Traditional wellbore scaling prediction methods are unable to accurately reflect the formation and changes of scaling inside the wellbore, especially under complex and multidimensional parameter changes, making it impossible to accurately identify and quantify the scaling situation, which affects gas well productivity and production.

Method used

By combining transfer functions and machine learning, spatial features of wellbore images are extracted using a 3D convolutional neural network. Long short-term memory networks are used to process time series data, a dynamic transfer function model is constructed, and a feedback controller is used to adjust the model parameters to achieve quantitative prediction of wellbore scaling.

Benefits of technology

It improves the accuracy and robustness of wellbore scaling prediction, effectively captures the spatial distribution and temporal changes of scaling, reduces prediction errors, provides quantitative information on scaling blockages, and supports regular cleaning and oil and gas extraction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120031782B_ABST
    Figure CN120031782B_ABST
Patent Text Reader

Abstract

This invention discloses a method and system for predicting wellbore scaling based on transfer function and machine learning. The method includes the following steps: S1: Acquire three-dimensional images and basic parameters of the wellbore interior at different time points, and preprocess the three-dimensional images and basic parameters; S2: Construct a dynamic transfer function model to predict the dynamic behavior of scaling in the wellbore over time; S3: Construct a 3D CNN model and use the preprocessed three-dimensional images as input to the 3D CNN model to extract spatial features; S4: Construct an LSTM model and use the extracted spatial features as input to the LSTM model to predict the amount of scaling in the wellbore; S5: Based on the dynamic behavior predicted by the dynamic transfer function model and combined with the output results of step S4, adjust the parameters in the model, and repeat steps S2-S5 to obtain the final prediction model; S6: Predict scaling in the target wellbore based on the final prediction model. This invention can accurately predict wellbore scaling.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of gas reservoir development technology, and in particular to a method and system for predicting wellbore scaling based on transfer function and machine learning. Background Technology

[0002] With the rapid development of industry in the new era, the gas reservoir energy industry is also under continuous development. This development process is accompanied by a series of problems, such as severe blockage and throttling in the wellbore (the blockage material is often scale), causing a sharp decline in gas well productivity, forcing wells to reduce or even shut down, severely impacting production. Scale buildup in some gas wells can also cause pollution in the near-wellbore area and reduce the effective flow space in the wellbore. Therefore, high-pressure gas wells need to constantly monitor the qualitative and quantitative characteristics of scale buildup to facilitate periodic descaling and ensure normal production.

[0003] Traditional scaling prediction methods rely on physical models, primarily based on the chemical kinetics and fluid dynamics of scaling formation, using transfer functions to describe the system's dynamic behavior. However, due to the complexity of wellbore scaling processes and the diversity of influencing factors, traditional transfer function models struggle to comprehensively and accurately reflect the formation and changes of scaling within the wellbore, resulting in insufficient precision in identifying gas well scaling and deficiencies in quantitative assessment. Other quantitative scaling prediction methods rely mainly on empirical models and experimental data, but these methods have limited accuracy and cannot fully consider the complex multidimensional parameter variations within the wellbore. Furthermore, temperature and pressure are crucial indicators affecting the degree of scaling, but the temperature and pressure distribution in gas wellbores dynamically changes, increasing with well depth. Therefore, establishing a vertical deposition model for the wellbore is critical. Summary of the Invention

[0004] To address the aforementioned problems, this invention aims to provide a method and system for predicting wellbore scaling based on transfer functions and machine learning.

[0005] The technical solution of the present invention is as follows:

[0006] On the one hand, a wellbore scaling prediction method based on transfer function and machine learning is provided, including the following steps:

[0007] S1: Obtain three-dimensional images and basic parameters of the wellbore at different time points, and preprocess the three-dimensional images and basic parameters;

[0008] S2: Construct a dynamic transfer function model, and use the dynamic transfer function model combined with preprocessed basic data to predict the dynamic behavior of scale formation in the wellbore over time;

[0009] S3: Construct a 3D CNN model and use the preprocessed 3D image as input to the 3D CNN model to extract its spatial features;

[0010] S4: Construct an LSTM model and use the extracted spatial features as input to the LSTM model to predict the amount of scale buildup in the wellbore;

[0011] S5: Based on the dynamic behavior predicted by the dynamic transfer function model and combined with the output of step S4, adjust the parameters in the dynamic transfer function model, 3D CNN model and LSTM model, and repeat steps S2-S5 to obtain the final prediction model.

[0012] S6: Based on the final prediction model, predict scaling in the target wellbore.

[0013] Preferably, in step S1, the basic parameters include pressure, temperature, flow rate, and concentration of scale-forming substances.

[0014] Preferably, in step S1, the preprocessing of the basic parameters includes noise reduction, standardization or normalization.

[0015] Preferably, in step S2, the dynamic transfer function model includes:

[0016] Hydrodynamic transfer function:

[0017]

[0018] In the formula: G(s) is the transfer function; U(s,x) and P(s,x) are the Laplace transforms of u(x,t) and P(x,t) respectively; u(x,t) and P(x,t) are the gas velocity and pressure under conditions x and t respectively; x is the distribution location of gas velocity and pressure in the fluid; s is the Laplace variable; ρ is the gas density; μ is the gas viscosity; t is time;

[0019] Mass conservation transfer function of scaling precursors:

[0020]

[0021] In the formula: D is the diffusion coefficient;

[0022] Chemical reaction rate transfer function:

[0023]

[0024] Scaling rate transfer function:

[0025]

[0026] In the formula: k s The scaling rate constant;

[0027] Scale location transfer function:

[0028]

[0029] In the formula: R(s) is the system reference input or set value; u(s) is the control input or control signal; a is a constant term.

[0030] Preferably, step S3, spatial feature extraction specifically includes the following sub-steps: first, input the preprocessed 3D image; second, perform convolutional feature extraction; third, perform activation processing; fourth, perform pooling processing; then, perform multiple repetitive convolutions and pooling; and finally, output the extracted spatial features through a fully connected layer.

[0031] Preferably, step S4, which uses the LSTM model to predict the amount of scale in the wellbore, specifically includes the following sub-steps: First, the extracted spatial features are obtained; second, the spatial features are flattened and input into the LSTM model; third, long-term dependencies are captured through the input gate, update memory gate, forget gate, and output gate of the LSTM model; then, prediction is performed through the fully connected layer of the LSTM model; finally, the error is calculated using the loss function, and the LSTM model parameters are optimized through backpropagation.

[0032] Preferably, in step S5, the parameters in the dynamic transfer function model, the 3D CNN model, and the LSTM model are adjusted by a feedback controller.

[0033] Preferably, in step S5, the feedback controller is a PID controller.

[0034] Preferably, step S5, adjusting the parameters in the dynamic transfer function model, 3D CNN model, and LSTM model through the feedback controller, specifically includes the following sub-steps: calculating the error between the predicted value and the actual observed data, calculating the error correction amount through the error, adjusting the model weights by the controller output, and updating the model through feedback loop.

[0035] On the other hand, a wellbore scaling prediction system based on transfer function and machine learning is also provided, including:

[0036] The data acquisition module is used to acquire three-dimensional images and basic parameters inside the wellbore at different time points, and to preprocess the three-dimensional images and basic parameters.

[0037] The dynamic transfer function model module is used to construct a dynamic transfer function model and predict the dynamic behavior of scale in the wellbore over time by combining the dynamic transfer function model with preprocessed basic data.

[0038] The 3D CNN model module is used to construct a 3D CNN model and to extract spatial features from the preprocessed 3D image as input to the 3D CNN model.

[0039] The LSTM model module is used to construct an LSTM model and take the extracted spatial features as input to the LSTM model to predict the amount of scaling in the wellbore.

[0040] The adjustment module is used to adjust the parameters in the dynamic transfer function model, 3D CNN model and LSTM model based on the dynamic behavior predicted by the dynamic transfer function model and the output results of step S4, and repeat steps S2-S5 to obtain the final prediction model.

[0041] The prediction module is used to predict scaling in the target wellbore based on the final prediction model.

[0042] The beneficial effects of this invention are:

[0043] This invention combines 3D convolutional neural networks to extract spatial features from wellbore image data, effectively capturing the spatial distribution information of scale within the wellbore. Simultaneously, it utilizes long short-term memory networks to process time-series data, capturing the long-term dependence of scale changes over time. By introducing a transfer function, the model can provide real-time feedback and adjustments based on the system's physical dynamics, effectively reducing prediction errors.

[0044] This invention also utilizes a controller to adjust the output of the transfer function and the weights of the neural network, making the system's prediction results closer to the actual observations, thereby enhancing the model's robustness and generalization ability. This invention not only effectively handles the complex spatial and temporal characteristics of scaling prediction but also avoids overfitting by fusing physical and data-driven models, further improving the model's prediction accuracy.

[0045] This invention can quantitatively predict the scale and blockage in wellbores and obtain the distribution of the scale and blockage, which brings great convenience to subsequent periodic cleaning and oil and gas extraction. Attached Figure Description

[0046] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0047] Figure 1 This is a flowchart illustrating the wellbore scaling prediction method based on transfer function and machine learning of the present invention.

[0048] Figure 2 This is a schematic diagram of the deep embedding layer processing flow when collecting data in a specific embodiment.

[0049] Figure 3 This is a schematic diagram of the structure of a 3D CNN model in a specific embodiment;

[0050] Figure 4 This is a schematic diagram showing the distribution of different formation parameters with depth in a specific wellbore embodiment.

[0051] Figure 5 This is a schematic diagram showing the changes in scale and porosity with depth in a single wellbore in a specific embodiment.

[0052] Figure 6 This is a schematic diagram showing the approximate distribution of scale in multiple wellbores in a specific embodiment. Detailed Implementation

[0053] The present invention will be further described below with reference to the accompanying drawings and embodiments. It should be noted that, unless otherwise specified, the embodiments and technical features described in this application can be combined with each other. It should also be pointed out that, unless otherwise indicated, all technical and scientific terms used in this application have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains. The terms "comprising" or "including" and similar words used in this invention refer to elements or objects preceding the word that encompass the elements or objects listed following the word and their equivalents, without excluding other elements or objects.

[0054] On the one hand, such as Figure 1 As shown, this invention provides a wellbore scaling prediction method based on transfer function and machine learning, comprising the following steps:

[0055] S1: Obtain three-dimensional images and basic parameters of the wellbore at different time points, and preprocess the three-dimensional images and basic parameters.

[0056] In one specific embodiment, the basic parameters include pressure, temperature, flow rate, and concentration of scale-forming substances; optionally, the preprocessing of the basic parameters includes noise reduction, standardization, or normalization.

[0057] S2: Construct a dynamic transfer function model, and use the dynamic transfer function model combined with preprocessed basic data to predict the dynamic behavior of scale formation in the wellbore over time.

[0058] In one specific embodiment, the dynamic transfer function model includes:

[0059] Hydrodynamic transfer function:

[0060]

[0061] In the formula: G(s) is the transfer function; U(s,x) and P(s,x) are the Laplace transforms of u(x,t) and P(x,t) respectively; u(x,t) and P(x,t) are the gas velocity and pressure under conditions x and t respectively; x is the distribution location of gas velocity and pressure in the fluid; s is the Laplace variable; ρ is the gas density; μ is the gas viscosity; t is time;

[0062] Mass conservation transfer function of scaling precursors:

[0063]

[0064] In the formula: D is the diffusion coefficient;

[0065] Chemical reaction rate transfer function:

[0066]

[0067] Scaling rate transfer function:

[0068]

[0069] In the formula: k s The scaling rate constant;

[0070] Scale location transfer function:

[0071]

[0072] In the formula: R(s) is the system reference input or setpoint; u(s) is the control input or control signal (in a control system, it often refers to the input applied to the system, such as force or voltage, so that the system follows the reference input R(s)); a is a constant term (representing the pole position or time constant of the system).

[0073] In the above embodiments, the dynamic transfer function model is established through the following steps:

[0074] First, based on the physical laws governing the scaling process inside the wellbore, a dynamic transfer function model is constructed in the form of G(s) = C(s) / R(s) (the transfer function is the ratio of output to input under zero initial conditions; R(s) represents input variables, such as wellbore pressure, temperature, flow rate, and chemical composition, with its antiderivative in the time domain being r(t), and R(s) obtained through Laplace transform in the time domain; C(s) represents output variables, such as scale thickness, rate, and location, with its antiderivative in the time domain being c(t), and C(s) obtained through Laplace transform in the time domain). This model describes the basic process and trends of scale formation. The transfer function is mathematically expressed by analyzing known physicochemical reaction kinetics, fluid mechanics, and internal wellbore process parameters, thus reflecting the dynamic behavior of scaling within the wellbore over time. Then, the governing equations for wellbore scaling are constructed, simultaneously determining the input and output variables, and finally, a Laplace transform is performed to obtain the transfer function. The established governing equations include:

[0075] (1) Fluid dynamic equations described by the equations of conservation of mass and momentum:

[0076]

[0077] In the formula: F represents other external force terms;

[0078] (2) The mass conservation equation used to address the concentration changes of dissolved scaling precursors (such as calcium and magnesium ions) inside the wellbore:

[0079]

[0080] In the formula: C is the concentration of calcium and magnesium ions; R(C,T,P) is the chemical reaction rate (such as the precipitation or dissolution reaction of ions), which depends on concentration, temperature and pressure;

[0081] (3) Taking calcium carbonate scale as an example, its reaction kinetic equation and chemical reaction rate equation can be expressed as:

[0082]

[0083] In the formula: k0 is the reaction rate constant; E a Activation energy; R is the gas constant; T is the temperature;

[0084] (4) Scaling rate equation based on reaction rate and hydrodynamic effects:

[0085]

[0086] In the formula: S is the scale thickness; f(u,P) is the function of the effect of flow rate and pressure on the scaling rate;

[0087] (5) Equation of the evolution of scale location:

[0088]

[0089] Based on the above five control equations, the input variables are P(x,t), T(x,t), and Q. f (x,t) (fracking fluid velocity in a gas well), u(x,t), C g (x,t) (gas field gas composition), C d (x,t) (concentration of dissolved scaling precursors); the output variable is r. s (t) (scaling rate), S(x,t) (scaling thickness), L s (x,t)(Scale location distribution).

[0090] For equation (6), first introduce the perturbation term to linearize the equation:

[0091]

[0092] Substituting this into equation (6), and performing a Laplace transform on t, with the Laplace variable denoted as s, the equation becomes:

[0093]

[0094] After further simplification, it can be written in the form of the transfer function shown in equation (1);

[0095] For equation (7), similarly to equation (6), the Laplace transform is first performed as follows:

[0096]

[0097] Secondly, it can be simplified to the transfer function form shown in equation (2);

[0098] The Laplace transform of equation (8) is:

[0099]

[0100] Secondly, it can be simplified to the transfer function form shown in equation (3);

[0101] The Laplace transform of equation (9) is:

[0102] sS(s)=k s ·R(s)·f(u(s),P(s)) (15)

[0103] Secondly, it can be simplified to the transfer function form shown in equation (4);

[0104] The Laplace transform of equation (10) is:

[0105] sS(s,x)=k s·R(s,x)·f(u(s,x),P(s,x)) (16)

[0106] Secondly, after simplification, it can be written in the form of the transfer function shown in equation (5).

[0107] S3: Construct a 3D CNN model and use the preprocessed 3D image as input to the 3D CNN model to extract its spatial features.

[0108] In a specific embodiment, spatial feature extraction includes the following sub-steps:

[0109] First, input the preprocessed 3D image; the preprocessed 3D image is usually a 4D tensor, in the form of (N, D, H, W, C), where N is the number of samples, D is the depth, H is the height, W is the width, and C is the number of channels, for example, C=1 for grayscale images and C=3 for color images.

[0110] Secondly, convolution feature extraction is performed; the convolution formula is:

[0111]

[0112] In the formula: Z ijk X represents the value at position (i,j,k) of the output feature map; M, N, and P are the depth, height, and width of the convolutional kernel (equivalent to D, H, and W in the first step); X i+m,j+n,k+p W represents the pixel value of the input image at position (i+m,j+n,k+p). mnp is the weight of the convolution kernel at position (m,n,p); b is the bias; the shape of one of the 3D convolution kernels is (k,k,k,c), where k is the size of the convolution kernel (usually 3 or 5), and c is the number of channels of the input image.

[0113] Next, activation processing is performed; after convolution, an activation function is used to introduce non-linearity, usually the ReLU activation function, to enhance the model's expressive power. Its calculation formula is as follows:

[0114] A(Z) = max(0,Z) (18)

[0115] The ReLU activation function retains only positive numbers and sets negative numbers to 0, ensuring the sparsity and non-linearity of the convolution output.

[0116] Then, pooling is performed. Pooling can reduce the size of the feature map, reduce computation, and enhance the translation invariance of the model. For 3D CNN models, 3D pooling is usually used, with max pooling being the most common. Its calculation formula is as follows:

[0117] P ijk =max(X i:i+K,j:j+K,k:k+K(19)

[0118] In the formula: k is the size of the pooling window, typically 2 or 3; P ijk This is the output feature map after pooling.

[0119] Then, multiple convolutions and pooling are performed; repeating the convolution and pooling layers multiple times allows for the gradual extraction of higher-level spatial features, with each layer extracting features representing information from different scales and perspectives of the image.

[0120] Finally, the extracted spatial features are output through fully connected layers. In the last few layers of the 3DCNN model, the extracted spatial features are flattened into one-dimensional feature vectors and further processed by fully connected layers. The role of fully connected layers is to map high-dimensional features to specific outputs, which are then fed into the subsequent LSTM model.

[0121] S4: Construct an LSTM model and use the extracted spatial features as input to the LSTM model to predict the amount of scale buildup in the wellbore.

[0122] In a specific embodiment, predicting the amount of scale inside the wellbore using the LSTM model specifically includes the following sub-steps:

[0123] First, the spatial features are extracted. The 3DCNN model extracts spatial features from the 3D image data of the wellbore. The 3DCNN model then obtains a feature map with high-dimensional spatial information. After multiple convolutions, the original input (N,D,H,W,C) becomes (N,F). d ,F h ,Fw,F c ), where F d F h F w These are the depth, height, and width of the feature map, respectively, F c It is the number of channels in the final output feature map.

[0124] Secondly, the spatial features are flattened and then input into the LSTM model; the flattening calculation formula is as follows:

[0125] F = flatten(F) d ×F h ×F ω ×F c (19)

[0126] In the formula: F is the flattened feature vector with shape (N, T, Fc); where T = F d ×F h ×F c It is the length of the time series; F cThis represents the feature dimension at each time step.

[0127] Furthermore, long-term dependencies are captured through the input gate, memory update gate, forget gate, and output gate of the LSTM model; the forget gate calculation formula is:

[0128] f t =σ(W f ·[h t-1 ,x t ]+b f (20)

[0129] In the formula: f t W is the output of the forget gate at time step t; σ is the activation function (usually sigmoid); f h is the weight matrix of the forget gate; t-1 It is the hidden state from the previous moment; x t This is the current input.

[0130] The formula for calculating the input gate is:

[0131]

[0132] In the formula: i t The output of the input gate; W represents the candidate memory cell state at time step t. c For connecting input (the input x at the current time step) t and the hidden state h from the previous time step t-1 The weight matrix from candidate memory cells; b c is the bias vector of the candidate memory unit; tanh is the hyperbolic tangent function, often used as an activation function to ensure that the value of the candidate memory state is in the range (-1, 1).

[0133] The updated memory gate calculation formula is as follows:

[0134]

[0135] In the formula: C t The state of the memory cell at the current time step; C t- This represents the state of the memory unit at the previous time step.

[0136] The formula for calculating the output gate is:

[0137]

[0138] Where: h t The hidden state at the current time step; o t This is the result of the output gate.

[0139] Based on the steps above, multiple LSTM layers can be stacked to enhance the model's ability to capture complex temporal dependencies. The output of each layer can be used as the input to the next layer.

[0140] Then, prediction is performed through the fully connected layers of the LSTM model; the calculation formula is:

[0141] y t =W o ·h t +b o (twenty four)

[0142] In the formula: y t W is the output of the model. o and b o For weights and biases.

[0143] Finally, the error is calculated using the loss function, and the LSTM model parameters are optimized through backpropagation.

[0144] In a specific implementation, a loss function such as MSE is chosen, and the parameters of the two machine learning models above are updated through backpropagation and the Adam optimization algorithm to minimize MSE. The calculation formula is as follows:

[0145]

[0146] Assuming the true target value is 100, the predicted value is between -10000 and 10000. The closer the predicted value is to 100, the smaller the MSE loss value, which ranges from (0, ∞).

[0147] Then, the difference between the output layer predictions and the target value is compared, and the optimizer is defined as the Adam algorithm to optimize the model. The steps are as follows:

[0148] 1. Initialize parameters:

[0149] θ0: Model parameters

[0150] m0 = 0: Initial value for the first moment estimate

[0151] v0 = 0: Initial value for the second moment estimate

[0152] t=0: Time step

[0153] β1, β2: Attenuation rate parameters, typically taken as β1 = 0.9, β2 = 0.999.

[0154] ∈: A small constant to prevent division by zero errors, usually taken as 10⁻⁶.

[0155] 2. Parameter update:

[0156] t = t + 1

[0157] Calculate gradient g t

[0158] Update first-order moment estimate: m t =β1m t-1 +(1-β1)g t

[0159] Update the second-order moment estimate:

[0160] Calculate the first-moment estimate with bias correction:

[0161] Calculate the second-order moment estimate with bias correction:

[0162] Update parameters:

[0163] S5: Based on the dynamic behavior predicted by the dynamic transfer function model and combined with the output of step S4, adjust the parameters in the dynamic transfer function model, 3D CNN model and LSTM model, and repeat steps S2-S5 to obtain the final prediction model.

[0164] In one specific embodiment, the parameters in the dynamic transfer function model, the 3D CNN model, and the LSTM model are adjusted by a feedback controller. Optionally, the feedback controller is a PID controller.

[0165] In the above embodiments, a feedback controller is used to monitor the error between the actual amount of fouling and the predicted result, and dynamically adjust the parameters of the transfer function and the machine learning model. Through this real-time error feedback mechanism, the system can adaptively optimize the parameters, improve the prediction accuracy, and ensure that the system remains stable in complex and changing environments.

[0166] In a specific embodiment, adjusting the parameters in the dynamic transfer function model, the 3D CNN model, and the LSTM model through the feedback controller specifically includes the following sub-steps:

[0167] The error between the predicted value and the actual observed data is calculated using the following formula:

[0168] e(t) = y actual (t)-y pred (t) (26)

[0169] The error correction amount is calculated based on the aforementioned error; the PID controller calculates the required correction amount for the system using proportional, integral, and derivative operations, with the following formula:

[0170]

[0171] In the formula: Kp For the instantaneous response of the proportional gain adjustment error; K i To eliminate accumulated error in the integral gain; K d To predict the future trend of error changes in differential gain.

[0172] The controller output adjusts the model weights; the controller output u(t) serves as feedback to adjust the transfer function parameters and neural network weights in the system. The specific adjustment steps include adjusting the transfer function and the neural network parameters. The parameters of the transfer function (e.g., system gain, time constant, etc.) can be adjusted based on the controller output. For example, if the error is large, the system response speed may need to be improved, i.e., by adjusting the time constant τ through the controller.

[0173]

[0174] In the formula, τ or gain K can be dynamically updated based on the controller output u(t).

[0175] In neural network parameter tuning (such as LSTM), the controller output u(t) can be used to modify the network's learning rate or directly adjust the weights.

[0176] W new =W old +αu(t) (29)

[0177] In the formula: W old is the current weight matrix; u(t) is the controller output; α is the adjustment coefficient, which corrects the output of the neural network by increasing or decreasing the weight values.

[0178] The correction method for 3D CNN is similar to that of LSTM, and its adjustment calculation formula is as follows:

[0179] W cnn-new =W cnn-old +α cnn u(t) (30)

[0180] In the formula: W cnn-old α is the weight matrix of the convolutional layer in the convolutional model; α is still the adjustment factor, controlling the weight update step size of the 3D CNN; u(t) is the controller output, representing the current error correction amount.

[0181] The feedback loop updates the model; the correction calculated by the controller is used to adjust the parameters of the transfer function and neural network, and the system then recalculates the next predicted value ypred(t+1). Subsequently, the system compares it with the actual observed data again, generates a new error e(t+1), and enters the next round of feedback adjustment. This process is continuously repeated, and the control system gradually adjusts to make the model predicted value ypred(t) tend to be consistent with the actual value yactual(t), thereby reducing the error and achieving the goal of optimal system control.

[0182] S6: Based on the final prediction model, predict scaling in the target wellbore.

[0183] In this step, the final prediction model combining 3D CNN, LSTM, and the transfer function can output a quantitative prediction of future fouling. The prediction results include parameters such as fouling thickness, rate, and location, and can be presented in image or numerical form. Specifically, the transfer function adjusts the overall state of the system based on its dynamic input and output. Through feedback from the controller, the dynamic input and output signals are integrated via the transfer function relationship, thereby influencing the weight adjustment and feature extraction methods of 3D CNN and LSTM. For example, when there is a large error between the system's prediction and the actual data, the transfer function can output a correction amount u(t) through the controller, which is fed back to 3D CNN and LSTM to adjust the weights of their convolutional layers and optimize image feature extraction.

[0184] This invention combines the transfer function in an automatic control system with a machine learning model for quantitative prediction of scaling. By combining the physical transfer function with the machine learning model, it overcomes the shortcomings of relying solely on either physical model or machine learning. The transfer function describes the basic dynamic process of scaling in the wellbore, while the machine learning model handles complex nonlinear and interactive effects, improving prediction accuracy, especially in highly dynamic and multi-dimensional data under complex formation conditions.

[0185] On the other hand, the present invention also provides a wellbore scaling prediction system based on transfer function and machine learning, comprising:

[0186] The data acquisition module is used to acquire three-dimensional images and basic parameters inside the wellbore at different time points, and to preprocess the three-dimensional images and basic parameters.

[0187] The dynamic transfer function model module is used to construct a dynamic transfer function model and predict the dynamic behavior of scale in the wellbore over time by combining the dynamic transfer function model with preprocessed basic data.

[0188] The 3D CNN model module is used to construct a 3D CNN model and to extract spatial features from the preprocessed 3D image as input to the 3D CNN model.

[0189] The LSTM model module is used to construct an LSTM model and take the extracted spatial features as input to the LSTM model to predict the amount of scaling in the wellbore.

[0190] The adjustment module is used to adjust the parameters in the dynamic transfer function model, 3D CNN model and LSTM model based on the dynamic behavior predicted by the dynamic transfer function model and the output results of step S4, and repeat steps S2-S5 to obtain the final prediction model.

[0191] The prediction module is used to predict scaling in the target wellbore based on the final prediction model.

[0192] In a specific embodiment, taking a wellbore in the Beiba gas field as an example, the wellbore scaling prediction method based on transfer function and machine learning described in this invention is used to predict its scaling, specifically including the following steps:

[0193] (1) Obtain three-dimensional images and basic parameters inside the wellbore at different time points, and preprocess the three-dimensional images and basic parameters.

[0194] In this embodiment, multi-dimensional parameters are collected in real time using downhole cameras and sensors installed inside the wellbore, including three-dimensional images of the wellbore interior at different time points, as well as pressure, temperature, flow rate, and concentration of scale-forming substances within the wellbore. This data undergoes noise reduction to eliminate data anomalies caused by sensor malfunctions or environmental interference. Standardization or normalization methods are used to convert each parameter value into a uniform scale range to ensure that subsequent transfer function models and machine learning models can handle multi-dimensional heterogeneous data. Finally, the data is compiled and saved as an Excel file.

[0195] In this embodiment, when collecting data, the wellbore is divided into discrete segments, and then images and data of the scale amount, pressure, temperature, formation porosity, and formation gas saturation of the corresponding segments are collected; the depth is processed by embedding layers to ensure that it is in the same dimension as other feature variables, such as... Figure 2 As shown, specifically:

[0196] 1. First, collect the wellbore depth data of gas wells. Collect the longitudinal depth data of fourteen wells W0-W14, with depths ranging from 1500m to 3000m. Discretize the data into multiple intervals, with each interval being 100 meters.

[0197] 2. Then, the discretized depth intervals are one-hot encoded to generate a high-dimensional sparse vector. In this embodiment, the depth is divided into 150 intervals, so one-hot encoding will generate a 150-dimensional vector, with one position being 1 and the rest being 0.

[0198] 3. Use an embedding layer to convert high-dimensional sparse vectors into low-dimensional dense vectors. Import the TensorFlow library in Python to write code to implement deep embedding layer processing.

[0199] In addition, other feature data undergo outlier removal, normalization, and standardization. Specifically, the Min-Max standardization method is used to transform the parameter values ​​into a uniform scale range, ensuring that subsequent transfer function models and machine learning models can handle multidimensional heterogeneous data.

[0200] This data is then combined with the processed depth data, which should be organized into a three-dimensional structure to fit the input format of a 3D CNN. For example, if the depth range of each sample is from 1500 to 3000 meters, and the feature data such as pressure and temperature in each interval are represented with a spatial resolution of 10x10, these image data can be organized into a three-dimensional grid, where each grid point represents a feature value at a specific depth.

[0201] (2) Construct the dynamic transfer function model shown in equations (1)-(5), and predict the dynamic behavior of scale in the wellbore over time by combining the dynamic transfer function model with the preprocessed basic data.

[0202] (3) Construction Figure 3 The 3D CNN model shown is used, and the preprocessed 3D image is used as input to the 3D CNN model to extract spatial features.

[0203] (4) Construct an LSTM model and use the extracted spatial features as the input of the LSTM model to predict the amount of scale in the wellbore;

[0204] (5) Based on the dynamic behavior predicted by the dynamic transfer function model, and combined with the output results of step S4, use the PID controller to adjust the parameters in the dynamic transfer function model, 3D CNN model and LSTM model, and repeat steps S2-S5 to obtain the final prediction model.

[0205] In this embodiment, the initial model of the transfer function is set as Equation (5), where a = 1, and the specific weight adjustment process is as follows:

[0206] 1. Calculation error: When t=1, based on the collected data, the parameters such as flow rate, pressure, and reaction rate are input into the above transfer function to calculate the actual observed scale thickness as 1.5mm, while the predicted value of the machine learning system is 1.2mm. Therefore, the error e(1) = 1.5 - 1.2 = 0.3.

[0207] 2. Calculate the correction amount using the PID controller: Kp = 2, Ki = 0.1, Kd = 0.01, and output the correction amount as follows:

[0208]

[0209] 3. Adjusting the transfer function parameters: Given u(1) = 0.6, the transfer function gain K can be adjusted (i.e., the numerator K = k). s ·R(s)·u(s))

[0210] K new =K old +u(1)=1+0.6=1.6 (32)

[0211] The updated transfer function is:

[0212]

[0213] 4. Adjust the weights of deep learning parameters: Based on the controller u(1) = 0.6, adjust the weights of the convolutional layers of 3D CNN and LSTM.

[0214] W CNN-new =W CNN-old +0.01×0.6=W CNN-old +0.006 (34)

[0215] W LSTM-new =W LSTM-old +0.006 (35).

[0216] (6) Based on the final prediction model, scale formation is predicted in the target wellbore, and the results are as follows: Figure 4-6 As shown.

[0217] In summary, this invention combines 3D CNN, LSTM, and transfer functions to more accurately predict wellbore scaling, and can obtain quantitative prediction results such as scaling thickness, rate, and location. Compared with existing technologies, this invention represents a significant advancement.

[0218] The above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention in any way. Although the present invention has been disclosed above with reference to preferred embodiments, it is not intended to limit the present invention. Any person skilled in the art can make some modifications or alterations to the above-disclosed technical content to create equivalent embodiments without departing from the scope of the present invention. Any simple modifications, equivalent changes, and alterations made to the above embodiments based on the technical essence of the present invention without departing from the scope of the present invention shall still fall within the scope of the present invention.

Claims

1. A wellbore scaling prediction method based on transfer function and machine learning, characterized in that, Includes the following steps: S1: Obtain three-dimensional images and basic parameters of the wellbore interior at different time points, and preprocess the three-dimensional images and basic parameters; the basic parameters include pressure, temperature, flow rate, and concentration of scale-forming substances; S2: Construct a dynamic transfer function model, and use the dynamic transfer function model combined with preprocessed basic data to predict the dynamic behavior of scale formation in the wellbore over time; The dynamic transfer function model includes: Hydrodynamic transfer function: In the formula: G(s)1 is the fluid dynamics transfer function; U(s,x) and P(s,x) are the Laplace transforms of u(x,t) and P(x,t) respectively; u(x,t) and P(x,t) are the gas velocity and pressure under conditions x and t respectively; x is the distribution location of gas velocity and pressure in the fluid; s is the Laplace variable; ρ is the gas density; μ is the gas viscosity; t is time; Mass conservation transfer function of scaling precursors: In the formula: G(s)2 is the mass conservation transfer function of the scaling precursor; D is the diffusion coefficient; Chemical reaction rate transfer function: In the formula: G(s)3 is the chemical reaction rate transfer function; Scaling rate transfer function: In the formula: G(s)⁴ is the scaling rate transfer function; k s The scaling rate constant; Scale location transfer function: In the formula: G(s)5 is the scale location transfer function; R(s) is the system reference input or setpoint; u(s) is the control input or control signal; a is a constant term; S3: Construct a 3D CNN model and use the preprocessed 3D image as input to the 3D CNN model to extract its spatial features; S4: Construct an LSTM model and use the extracted spatial features as input to the LSTM model to predict the amount of scaling in the wellbore; S5: Based on the dynamic behavior predicted by the dynamic transfer function model and combined with the output of step S4, adjust the parameters in the dynamic transfer function model, 3D CNN model and LSTM model, and repeat steps S2-S5 to obtain the final prediction model. S6: Based on the final prediction model, predict scaling in the target wellbore.

2. The wellbore scaling prediction method based on transfer function and machine learning according to claim 1, characterized in that, In step S1, the preprocessing of the basic parameters includes noise reduction, standardization or normalization.

3. The wellbore scaling prediction method based on transfer function and machine learning according to claim 1, characterized in that, In step S3, spatial feature extraction specifically includes the following sub-steps: First, input the preprocessed 3D image; second, perform convolutional feature extraction; third, perform activation processing; fourth, perform pooling processing; then, perform multiple repetitive convolutions and pooling; and finally, output the extracted spatial features through a fully connected layer.

4. The wellbore scaling prediction method based on transfer function and machine learning according to claim 1, characterized in that, In step S4, the prediction of scale in the wellbore using the LSTM model specifically includes the following sub-steps: First, the extracted spatial features are obtained; second, the spatial features are flattened and input into the LSTM model; third, long-term dependencies are captured through the input gate, update memory gate, forget gate, and output gate of the LSTM model; then, prediction is performed through the fully connected layer of the LSTM model; finally, the error is calculated using the loss function, and the LSTM model parameters are optimized through backpropagation.

5. The wellbore scaling prediction method based on transfer function and machine learning according to claim 1, characterized in that, In step S5, the parameters in the dynamic transfer function model, the 3D CNN model, and the LSTM model are adjusted by the feedback controller.

6. The wellbore scaling prediction method based on transfer function and machine learning according to claim 5, characterized in that, In step S5, the feedback controller is a PID controller.

7. The wellbore scaling prediction method based on transfer function and machine learning according to claim 5 or 6, characterized in that, In step S5, adjusting the parameters in the dynamic transfer function model, 3D CNN model, and LSTM model through the feedback controller specifically includes the following sub-steps: calculating the error between the predicted value and the actual observed data, calculating the error correction amount through the error, adjusting the model weights by the controller output, and updating the model through feedback loop.

8. A wellbore scaling prediction system based on transfer function and machine learning, characterized in that, include: The data acquisition module is used to acquire three-dimensional images and basic parameters inside the wellbore at different time points, and to preprocess the three-dimensional images and basic parameters; the basic parameters include pressure, temperature, flow rate, and concentration of scale-forming substances. The dynamic transfer function model module is used to construct a dynamic transfer function model and predict the dynamic behavior of scale in the wellbore over time by combining the dynamic transfer function model with preprocessed basic data. The dynamic transfer function model includes: Hydrodynamic transfer function: In the formula: G(s)1 is the fluid dynamics transfer function; U(s,x) and P(s,x) are the Laplace transforms of u(x,t) and P(x,t) respectively; u(x,t) and P(x,t) are the gas velocity and pressure under conditions x and t respectively; x is the distribution location of gas velocity and pressure in the fluid; s is the Laplace variable; ρ is the gas density; μ is the gas viscosity; t is time; Mass conservation transfer function of scaling precursors: In the formula: G(s)2 is the mass conservation transfer function of the scaling precursor; D is the diffusion coefficient; Chemical reaction rate transfer function: In the formula: G(s)3 is the chemical reaction rate transfer function; Scaling rate transfer function: In the formula: G(s)⁴ is the scaling rate transfer function; k s The scaling rate constant; Scale location transfer function: In the formula: G(s)5 is the scale location transfer function; R(s) is the system reference input or setpoint; u(s) is the control input or control signal; a is a constant term; The 3D CNN model module is used to construct a 3D CNN model and takes a preprocessed 3D image as input to the 3D CNN model to extract its spatial features. The LSTM model module is used to construct an LSTM model and take the extracted spatial features as input to the LSTM model to predict the amount of scaling in the wellbore. The adjustment module is used to adjust the parameters in the dynamic transfer function model, 3D CNN model and LSTM model based on the dynamic behavior predicted by the dynamic transfer function model and the output results of step S4, and repeat steps S2-S5 to obtain the final prediction model. The prediction module is used to predict scaling in the target wellbore based on the final prediction model.

Citation Information

Patent Citations

  • Industrial circulating water online corrosion and scaling prediction system and method based on LSTM algorithm

    CN115631802A

  • Shaft scaling dynamic deposition blockage prediction model construction method

    CN115936258A