A method for predicting oil well production based on temporal augmentation and residual learning

By employing multi-scale temporal augmentation and residual learning methods, combined with extended causal temporal convolutional networks and gradient boosting decision tree models, the problem of insufficient model response to sudden changes in oil well production prediction was solved. This resulted in high-precision production prediction and error compensation, improving the model's stability and adaptability.

CN123116113APending Publication Date: 2026-11-17XI'AN PETROLEUM UNIVERSITY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610661095.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-05-13
Publication Date
2026-11-17

AI Technical Summary

Technical Problem

Existing oil well production prediction methods are insufficient in responding to abrupt changes when dealing with nonlinear and non-stationary characteristics. The prediction results are prone to lag or over-smoothing, and the stability decreases when multi-well data is used for joint modeling. The structural information in the prediction error is not fully utilized.

Method used

We employ a multi-scale temporal augmentation and residual learning approach. By expanding the causal temporal convolutional network, we extract the long-term and short-term dependencies of the output sequence. We combine this with a gradient boosting decision tree model for error compensation and use an adaptive multifidelity Bayesian optimization strategy to optimize hyperparameters, thereby achieving coordinated processing of trend modeling and error compensation.

Benefits of technology

It improves the accuracy and adaptability of oil well production prediction, effectively captures multi-scale dynamic characteristics, enhances the response to local fluctuations and sudden changes, and reduces computational costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123116113A_ABST
    Figure CN123116113A_ABST
Patent Text Reader

Abstract

This invention addresses the intelligent development scenario of oil and gas fields, specifically focusing on the problem of high-precision oil well production prediction. It discloses an oil well production prediction method based on temporal enhancement and residual learning. The method includes: collecting historical oil well production data and multi-source monitoring parameters; preprocessing the raw data by handling outliers, dividing it into time series, and standardizing it; constructing a multi-scale temporal feature system, integrating rolling statistical features and first- and second-order difference features to characterize the local dynamic behavior and long-term evolution trend of production changes; inputting the processed features into a multi-scale dilated temporal convolutional network to model the long-term dependence of oil well production time series; constructing a residual sequence based on the preliminary prediction results, and introducing a LightGBM model for nonlinear learning and compensation of prediction errors; employing an adaptive multi-fidelity Bayesian optimization strategy to dynamically optimize key hyperparameters of the model to improve its stability and generalization ability under different operating conditions; and finally outputting high-precision oil well production prediction results. This invention effectively improves the model's ability to characterize non-stationary, multi-stage dynamic changes by decoupling the trend modeling and error compensation processes, significantly improving the accuracy and robustness of oil well production prediction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of intelligent technology for oil and gas field development, and relates to a data-driven dynamic modeling method for oil well production, specifically a method for predicting oil well production that integrates multi-scale temporal feature modeling and residual learning mechanism. Background Technology

[0002] As oil and gas field development enters the digital age, production systems are gradually shifting from experience-driven to data-driven. On-site monitoring methods are continuously improving, and the scale of dynamic data from wellheads and formations is constantly expanding. Oil well production, as a core production indicator, directly reflects the formation's energy supply capacity and the effectiveness of development policies. Predicting production changes in advance helps in formulating injection-production adjustment plans and production control strategies. Building predictive models based on historical data has become an important technical approach for refined oilfield management.

[0003] In existing technologies, production prediction methods mainly fall into two categories: mechanistic models and data models. Mechanistic methods rely on seepage theory and reservoir parameters, and the calculation process involves multiphysics coupling, making the modeling process complex. In actual production, key parameters are difficult to obtain accurately, limiting the applicability of the model. Data-driven methods achieve prediction by learning historical sequences, reducing reliance on prior parameters and offering greater flexibility. However, these methods often rely on a single structure and have limited ability to express complex temporal relationships.

[0004] Oil well production sequences exhibit significant nonlinear and nonstationary characteristics. Different development stages correspond to different variation patterns, with local fluctuations and long-term trends coexisting. Conventional methods often use the original sequence or simple lag terms as input, lacking characterization of the rate of change and trend evolution. They are insufficiently capable of responding to abrupt changes, and prediction results are prone to lag or over-smoothing. When multi-well data are used for joint modeling, the differences between wells are further amplified, leading to a decrease in model stability.

[0005] Existing models typically output results directly using a single prediction framework. The prediction error still contains structural information that is not further utilized. Local fluctuations are difficult to correct, and accuracy decreases under complex conditions. Parameter selection often relies on experience or exhaustive search, resulting in high computational costs and difficulty in obtaining optimal configurations. Under conditions of multi-scale dynamics and uncertainty, the model's generalization ability is insufficient. To address these issues, there is an urgent need to construct a yield prediction method that can characterize multi-scale dynamic features and possess error compensation capabilities. Summary of the Invention

[0006] This invention relates to the field of oil well production prediction technology, and in particular to an oil well production prediction method and system based on multi-scale temporal enhancement and residual learning, aiming to provide an oil well production prediction scheme with high prediction accuracy and strong adaptability to operating conditions.

[0007] Oil well production sequences exhibit significant nonlinear and nonstationary characteristics. Different development stages correspond to different change patterns, with local fluctuations and long-term trends coexisting. Information on the rate and acceleration of production changes is crucial for predicting trend reversals. However, existing technologies often use the original production sequence or simple lag terms as model input, lacking a systematic characterization of dynamic features across multiple time scales. This results in insufficient model response to abrupt changes, and predictions are prone to lag or over-smoothing. Furthermore, existing models typically use a single prediction framework to directly output the final result, often leaving structural information within the prediction error unexplored, making it difficult to guarantee prediction accuracy under complex operating conditions. To address these issues, there is an urgent need to develop an oil well production prediction method capable of characterizing multi-scale dynamic features and possessing error compensation capabilities.

[0008] To address the shortcomings of existing technologies in modeling non-stationary, multi-stage oil well production sequences and inadequate fitting of local nonlinear fluctuations, this invention proposes the following technical solution:

[0009] An oil well production prediction method based on multi-scale temporal enhancement and residual learning includes the following steps: S1: Obtain historical production data of oil wells, remove outliers and fill in missing values ​​in the raw data, perform logarithmic transformation on the target variable daily oil production, and then perform standardization processing together with other production parameters; construct historical lag features, rolling statistical features, first-order difference features and second-order difference features based on sliding window, and splice the above features to form a multi-scale feature vector. S2: Input the multi-scale feature vector into the dilated causal temporal convolutional network, extract the long-short-term dependencies of the time series through multi-layer dilated convolution and residual connections, and output the initial yield prediction results in the normalized logarithmic space. S3: Construct a residual sequence based on the difference between the target true value and the initial prediction result under the same transformation space, input the residual sequence into the gradient boosting decision tree model for nonlinear fitting, and obtain the residual prediction result; S4: Adaptive multifidelity Bayesian optimization strategy is adopted to collaboratively optimize the key hyperparameters of the temporal convolutional network and gradient boosting decision tree model in order to obtain the optimal parameter combination. S5: The initial prediction result and the residual prediction result are added together according to the time step to obtain the fused prediction value. The fused prediction value is then subjected to inverse standardization and inverse logarithmic transformation to restore it to the oil well production prediction result with actual physical dimensions.

[0010] Further, in step S1, the historical production data of the oil well includes: time series, oil well number, average downhole pressure, average downhole temperature, average tubing pressure differential, average nozzle size, average wellhead pressure, nozzle pressure differential, and the target variable daily oil production.

[0011] Outlier removal and missing value imputation were performed on the collected raw data, with outlier removal based on the 3σ criterion: |x t -μ|>3σ Where μ is the mean of the production sequence and σ is the standard deviation; when the data meets the above conditions, it is judged as an outlier and removed; when there are missing data, linear interpolation is used to fill in the missing data.

[0012] Logarithmic transformation of the target variable, daily oil production: y′=ln(y+1) Where y is the original daily oil production, and y′ is the target value after logarithmic transformation.

[0013] The logarithmically transformed target variable and other production parameters are subjected to Min-Max normalization, mapping all features to the interval [0, 1]. Where, x min With x max These represent the minimum and maximum values ​​of the feature in the training set, respectively. After preprocessing, the dataset is divided into training and test sets according to time order, ensuring that the training data is earlier than the test data in time, thus guaranteeing the causal consistency of time series modeling.

[0014] Furthermore, the multi-scale temporal feature system in step S1 includes the multi-scale features of the following four-dimensional system:

[0015] Historical lag characteristics: Extracting historical output values ​​y from the previous p time steps using a sliding window. t-1 y t-2 , ..., y t-p This enables the model to directly learn the autocorrelation structure of the output sequence.

[0016] Rolling statistical features: Calculate the rolling mean and rolling standard deviation under different window lengths w to capture the central tendency and volatility of output at different time scales.

[0017] First-order difference characteristics: Δy t =y t -y t-1 The first-order difference characterizes the instantaneous rate of change in output, reflecting the direction and magnitude of increase or decrease between adjacent time steps.

[0018] Second-order difference feature: Δ 2 y t =Δy t -Δy t-1 The second-order difference characterizes the acceleration of output change and reflects the trend of the rate of change itself.

[0019] After aligning the above four types of features according to time steps, they are directly concatenated along the feature dimension to form a multi-scale feature vector X. t .

[0020] Furthermore, in step S2, the extended causal temporal convolutional network is the backbone prediction model of the method of the present invention.

[0021] The temporal convolutional network comprises multiple stacked residual blocks, each consisting of a dilated convolutional layer, a nonlinear activation function, and residual connections. The core expression for the residual connections is: o(t) = f(x(t)) + x(t) Where f(·) represents dilated convolution and nonlinear activation operation.

[0022] After multiple layers of dilated convolution operations, the temporal convolutional network obtains the initial prediction result through output layer mapping: Where g(·) represents the TCN network mapping function, This represents the initial output prediction results in the normalized logarithmic space.

[0023] Furthermore, in step S3, the present invention achieves decoupling of trend modeling and error compensation using a residual learning mechanism.

[0024] The residual sequence is defined as the difference between the actual target value and the initial predicted value in the same transformation space: Where, r t Let y' be the residual value at time step t. t The true value of the target after y′=ln(y+1) transformation and Min-Max normalization is... This represents the initial prediction result of TCN in the same transformation space.

[0025] The calculated residual sequence is input into the LightGBM gradient boosting decision tree model for nonlinear fitting. Based on the trained LightGBM model, the residuals are predicted to obtain the residual prediction results for the corresponding time steps. Where h(·) represents the LightGBM residual mapping function, X represents the predicted residual value. t The input is a multi-scale feature vector.

[0026] Furthermore, in step S4, this invention employs an adaptive multi-fidelity Bayesian optimization strategy to jointly optimize the key hyperparameters of the temporal convolutional network and LightGBM. The optimized hyperparameters include: the number of convolutional layers, kernel size, dilation coefficient sequence, and learning rate of the temporal convolutional network; and the tree depth, learning rate, and number of leaf nodes of LightGBM.

[0027] The optimization process is as follows: First, several sets of hyperparameter configurations are initialized as initial sampling points. A low-fidelity rapid evaluation is used to obtain preliminary estimates of the model performance under each configuration. Then, a Gaussian process surrogate model is constructed based on the existing evaluation results. A sampling function is used to balance exploring unknown regions with utilizing existing superior regions, iteratively selecting the next set of candidate parameters for evaluation. When a set of parameter configurations performs well in the low-fidelity evaluation and the expected improvement predicted by the surrogate model exceeds a preset threshold, the process switches to a high-fidelity full evaluation mode. The optimization objective is to minimize the root mean square error of the five-fold cross-validation.

[0028] Furthermore, in step S5, the prediction results are fused using an algebraic addition method, by superimposing the initial prediction results output by the temporal convolutional network with the residual prediction results output by LightGBM according to time steps: in, This is the initial prediction result for TCN. The results are for LightGBM residual prediction. This is the fused predicted value, which is still in the normalized logarithmic space.

[0029] Subsequently, the fused predictions are denormalized to map them back to logarithmic space from the normalized interval [0, 1], resulting in the logarithmic space prediction y′. log Finally, based on the forward transformation y′=ln(y+1) performed on the target variable in step S1, the physical dimensions are restored through the inverse transformation: y stual =exp(y′) log )-1 Among them, y actual This is the final output, a predicted oil well production value with actual physical dimensions. Attached Figure Description

[0030] Figure 1 The following is a detailed flowchart of the method of the present invention.

[0031] Figure 2 This is a flowchart of the method of the present invention.

[0032] Figure 3 This is a diagram showing the data flow and collaborative relationship of the method of the present invention. Detailed Implementation

[0033] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.

[0034] This invention proposes an oil well production prediction method based on multi-scale temporal enhancement and residual learning. The core idea is to decouple the oil well production prediction problem into two sub-problems: trend modeling and error compensation. First, an extended causal temporal convolutional network is used to capture the long-term dependencies and evolutionary trends of the production sequence, obtaining initial prediction results. Then, a gradient boosting decision tree is used to perform nonlinear fitting on the prediction residuals to compensate for local fluctuations and abrupt changes. Finally, an inverse transformation is used to restore the prediction results to actual production values ​​with physical dimensions. The end-to-end processing flow of this method is as follows: Figure 1 As shown.

[0035] like Figure 1 As shown in the figure, an oil well production prediction method based on multi-scale temporal enhancement and residual learning disclosed in this invention specifically includes the following steps:

[0036] S1: Obtain historical production data of oil wells, perform logarithmic transformation and standardization on the target production, and construct multi-scale time series features through a sliding window.

[0037] In step S1, the Volve oilfield public production dataset is used as the data source for this example. Time-series production data from three wells, F-11H, F-12H, and F-14H, are selected as the research object. The dataset contains a total of 4662 valid samples. The core data collection fields include: time series, well number, average downhole pressure, average downhole temperature, average tubing differential pressure, average nozzle size, average wellhead pressure, nozzle differential pressure, and the target variable, daily oil production.

[0038] Data preprocessing begins with outlier detection and removal. This embodiment uses the 3σ criterion for outlier identification: when data point x... i Satisfy |x i When -μ|>3σ, it is identified as an outlier and removed, where μ is the mean of the oil well production sequence and σ is the standard deviation. In this embodiment, a total of 136 outliers were removed. For missing values ​​in the data, linear interpolation was used to fill in the gaps: for data points with no more than 3 consecutive days of missing values, linear interpolation was used to fill in the gaps based on the adjacent valid values. In this embodiment, a total of 89 missing values ​​were filled in.

[0039] Since oil well production data typically exhibits a significantly skewed distribution, direct modeling can lead to unstable model fitting to high-production areas. Therefore, this embodiment first performs a logarithmic transformation on the target variable, daily oil production, to compress the dynamic range of the data and alleviate the long-tailed distribution problem. The transformation formula is as follows: y ′ =ln(y+1) Where y is the original daily oil production, and y′ is the target value after logarithmic transformation. The increment operation is to avoid the situation where logarithmic operations are undefined when the production is zero.

[0040] After completing the logarithmic transformation, Min-Max normalization is uniformly applied to all features, mapping each feature to the [0, 1] interval to eliminate the adverse effects of differences in the units of different features on model training. The normalization formula is: Where, x min With x max These represent the minimum and maximum values ​​of the feature in the training set, respectively.

[0041] After preprocessing, the dataset is divided into training and test sets in chronological order at a ratio of 8:2, ensuring that the training data is always earlier than the test data to guarantee causal consistency in time series modeling. In this embodiment, the training set contains 3730 samples, and the test set contains 932 samples. The specific partitions for the three wells are as follows: F-11H: 872 training samples / 218 test samples; F-12H: 717 training samples / 179 test samples; F-14H: 2141 training samples / 535 test samples.

[0042] Multi-scale temporal feature construction is a key preliminary step in the method of this invention. Therefore, this embodiment constructs a multi-scale feature system from the following four dimensions:

[0043] Historical lag characteristics: Based on a sliding window, historical output values ​​from the previous p time steps are extracted as the input sequence [y]. t-1 y t-2 , ..., y t-p This allows the model to directly learn the autocorrelation structure of the output sequence. In this embodiment, the lag order p is set to 7.

[0044] Rolling statistical characteristics: The rolling mean and rolling standard deviation are calculated for different window lengths *w* to capture central tendency and volatility at different time scales. The calculation formula is as follows: Where w is the length of the sliding window. In this embodiment, three time scales w∈{7,14,30} are selected, corresponding to weekly, semi-monthly, and monthly production cycles, respectively.

[0045] First-order difference characteristic: Characterizes the instantaneous velocity of output change, reflecting the direction and magnitude of increase or decrease between adjacent time steps. The calculation formula is: Δy t =y t -y t-1

[0046] Second-order difference characteristics: characterize the acceleration of output change, reflect the trend of the rate of change itself, and help to detect trend reversals and inflection points in the output series in advance. The calculation formula is: Δ 2 y t =Δy t -Δy t-1

[0047] After aligning the above four types of features according to time steps, they are directly concatenated along the feature dimension to form a multi-scale feature vector: In this embodiment, the feature dimension is expanded to 48 dimensions to fully capture multi-scale dynamic characteristics.

[0048] S2: Input the multi-scale feature vector into the dilated temporal convolutional network, extract the temporal dependency through multi-layer dilated causal convolution and residual connections, and output the initial yield prediction result.

[0049] The temporal convolutional network in step S2 is the backbone prediction model of the method of this invention. Compared with the traditional recurrent neural network structure, TCN, through the combination of causal convolution and dilated convolution, can obtain an exponentially increased receptive field while performing parallel computation, and efficiently capture long-range dependencies in time series.

[0050] TCN employs a dilated causal convolution structure, and its core convolution calculation expression is as follows: Where k is the kernel size, d is the dilation coefficient, and w i These are the kernel weights.

[0051] In this embodiment, the TCN model comprises three stacked residual block structures. Each residual block consists of an dilated convolutional layer, a ReLU nonlinear activation function, and residual connections. Its mathematical expression is as follows: o(t) = f(x(t)) + x(t) Here, f(·) represents dilated convolution and nonlinear activation operations. The core function of residual connections is to directly transmit the input signal across layers to the output, enabling the network to effectively avoid the gradient vanishing problem caused by deep structures during training, thereby improving the training stability and convergence speed of deep networks.

[0052] In this embodiment, the kernel size k is set to 3, and the expansion coefficient sequence adopts a layer-by-layer increasing structure of [1, 2, 4]. After the three residual blocks are stacked sequentially, the effective receptive field of the top-level neuron can cover a historical time span of 64 days, which can fully capture the evolution trend of oil well production on medium- and long-term time scales. The TCN output dimension is 1, that is, the output is the production prediction value in normalized logarithmic space. The model training uses the Adam optimizer, the initial learning rate is set to 0.001, and the loss function is mean squared error.

[0053] After multiple layers of dilated convolution operations, TCN obtains the initial prediction result through output layer mapping: Where g(·) represents the complete mapping function of the TCN network, X t The input is a multi-scale feature vector. The initial production forecast output by TCN is in the normalized logarithmic space.

[0054] S3: Calculate the residual between the initial prediction result and the true value after logarithmic transformation and standardization, input it into the LightGBM model for nonlinear error fitting, and output the residual prediction result.

[0055] This invention introduces a residual learning mechanism to construct a specialized error compensation model.

[0056] The residual sequence is defined as the difference between the true value and the initial predicted value of TCN in the same transformation space: Where, r t Let y' be the residual value at time step t. t The true value of the target after y′=ln(y+1) transformation and Min-Max normalization is... This represents the initial prediction results of the TCN model in the same space.

[0057] The calculated residual sequence is aligned by time and then input into the LightGBM gradient boosting decision tree model for nonlinear fitting. LightGBM is an efficient gradient boosting framework based on histogram algorithms, which iteratively builds decision trees to gradually approximate the objective function. Its optimized objective function has the following form: Where l(·) is the loss function, and in this embodiment, the mean squared error is used; Ω(f) is the regularization term.

[0058] In this embodiment, the main hyperparameters of LightGBM are set as follows: tree depth of 6, learning rate of 0.05, number of leaf nodes of 31, and number of iterations of 200. Through training, LightGBM learns the local nonlinear patterns contained in the residual sequence, and the model outputs the residual prediction results for the corresponding time step: Where h(·) represents the LightGBM residual mapping function after training, X is the predicted value of the residual at time step t. t The input is a multi-scale feature vector.

[0059] S4: An adaptive multi-fidelity Bayesian optimization strategy is adopted to collaboratively optimize the key hyperparameters of TCN and LightGBM.

[0060] This embodiment employs an adaptive multi-fidelity Bayesian optimization strategy to jointly optimize the key hyperparameters of both TCN and LightGBM models. The optimized hyperparameter space covers: the number of convolutional layers in the TCN model (search range: 2 to 5 layers); the kernel size (search range: 2 to 5); the dilation coefficient sequence structure and learning rate (search range: 0.0005 to 0.005); the tree depth in the LightGBM model (search range: 4 to 10); the learning rate (search range: 0.01 to 0.1); and the number of leaf nodes (search range: 10 to 64).

[0061] First, five sets of hyperparameter configurations are randomly initialized as initial sampling points. Each set is then rapidly evaluated using a limited number of training epochs. This stage employs a low-fidelity evaluation mode with 8 epochs to obtain preliminary estimates of the model performance for each configuration. Subsequently, a Gaussian process surrogate model is constructed based on the existing evaluation results, using the Matern kernel function to measure similarity in the parameter space. Building upon this, an expected improvement sampling function is used to balance exploring unknown regions with utilizing existing superior regions, iteratively selecting the next set of candidate parameters for evaluation. When a parameter configuration performs well in the low-fidelity evaluation and the expected improvement predicted by the surrogate model exceeds a preset threshold τ = 8, the system switches to a high-fidelity evaluation mode for complete training and validation. The optimization objective is to minimize the root mean square error of the five-fold cross-validation.

[0062] After 15 rounds of iterative optimization, the optimal hyperparameter combination was obtained: 3 layers in the TCN, a kernel size of 3, an expansion sequence of [1, 2, 4], and a learning rate of 0.001; and a LightGBM tree depth of 6, a learning rate of 0.05, and 31 leaf nodes. Experimental results show that adaptive multifidelity Bayesian optimization can save approximately 68% of computational resources compared to a grid search scheme with equivalent accuracy.

[0063] S5: The initial prediction results are merged with the residual prediction results, and inverse standardization and inverse logarithmic transformation are performed in sequence to restore the oil well production prediction results with physical dimensions.

[0064] The prediction results are fused using an algebraic addition method, which superimposes the initial prediction value output by TCN and the residual prediction value output by LightGBM according to time steps: in, This is the initial prediction result for TCN. The results are for LightGBM residual prediction. This is the fused predicted value, which is still in the normalized logarithmic space. The fusion weights are 1:1, so no additional learnable parameters need to be introduced.

[0065] Since all prediction calculations in this invention are performed in normalized logarithmic space, the prediction results must ultimately be converted back to physical quantity production values ​​that can be directly used in the oilfield. This conversion process consists of two steps:

[0066] The fused predicted values ​​are mapped back to logarithmic space from the [0, 1] interval to obtain the predicted values ​​y′log in logarithmic space. The denormalization operation is strictly performed according to the feature scaling parameters recorded during the training phase to ensure the fidelity of scale restoration.

[0067] An exponential transformation is performed on the destandardized log-space predictions to restore them to daily oil production with actual physical dimensions. Based on the forward transformation y′=ln(y+l) performed on the target variable in S1, the corresponding inverse transformation formula is: y actual =exp(y′) log )-1 Where, y′ log The predicted value y is recovered to the logarithmic space by inverse standardization. actual This is the final output, a predicted oil well production value with physical dimensions.

[0068] Through steps S1 to S5 described above, the method of this invention completes a full closed loop from the input of raw production data to the output of the final production prediction value. By decoupling trend modeling and residual compensation into two independent and collaborative sub-tasks, this invention effectively improves the model's ability to characterize and predict non-stationary, multi-stage oil well production sequences.

[0069] like Figure 2As shown, the overall processing flow of the method of the present invention includes the following steps in the order of data flow: data preprocessing, construction of time series samples by sliding window, construction of multi-scale features, prediction by TCN backbone network, learning of LightGBM residuals, adaptive multi-fidelity Bayesian optimization, inverse transformation restoration, and yield prediction and output, which together constitute a complete processing link from raw data to final prediction results.

[0070] like Figure 3 As shown, the data flow and collaborative relationship between the algorithm components of this invention are as follows: After preprocessing, the time series data enters the multi-scale feature construction stage. The generated multi-scale feature vector is input into the TCN backbone network for trend modeling and outputs the initial prediction result. Based on the initial prediction value and the true value, the residual sequence is calculated and sent to LightGBM for residual learning to obtain the residual prediction result. In the feature fusion and residual compensation stage, the TCN output and the LightGBM output are superimposed and restored by inverse transformation to obtain the final output of yield prediction.

[0071] To verify the effectiveness of the method of this invention, this embodiment conducted a thorough experimental evaluation on the real production dataset of the Volve oilfield. The testing process employed four commonly used regression evaluation metrics:

[0072]

[0073] Evaluation results on the test set show that the method of the present invention achieves excellent performance of R2=0.9832 and MAPE=7.8%. Compared with 13 comparative models such as traditional LSTM, Transformer, and CNN-LSTM, it shows significant advantages in all four indicators. The overlap between the single-well prediction curve and the actual production curve on the test set reaches more than 98%.

[0074] Ablation experiments further validated the effectiveness of each core component of this invention. Compared with the single TCN model, the introduction of the LightGBM residual compensation mechanism significantly improved the model's response to periods of local yield mutations, reducing MAPE by more than 3 percentage points in the test sample interval with drastic yield fluctuations. The prediction results of each model on the test set are shown in the table below:

[0075] Model RMSE MAE MAPE R2 TR-Net 111.65 63.47 12.93% 0.9734 LTR-Net 128.39 79.90 17.78% 0.9648 GTR-Net 125.64 70.07 15.12% 0.9663 TBL-Net 225.16 189.47 36.26% 0.8917 TCN 184.01 85.63 27.53% 0.9277 CNN-LSTM 145.64 58.31 11.90% 0.9547 LSTM-Attention 138.92 45.02 8.32% 0.9588 Transformer 152.54 64.36 11.93% 0.9503 LSTM 161.89 75.69 12.95% 0.9377 RNN 176.91 83.12 15.64% 0.9300 TAR-GridNet 130.66 63.17 11.71% 0.9746 TAR-PSONet 149.36 75.49 13.71% 0.9655 TAR-GANet 160.31 81.26 15.97% 0.9521 TAR-Net 88.69 38.56 7.8% 0.9832

[0076] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any equivalent substitutions or technical improvements made within the technical scope disclosed in the present invention shall be deemed to fall within the scope of protection of the present invention.

Claims

1. A method for predicting oil well production based on multi-scale temporal enhancement and residual learning, characterized in that, The method includes the following steps: s1: Obtain historical production data of oil wells, perform logarithmic transformation on the target variable daily oil production, and then perform standardization processing together with other production parameters; construct historical lag features, rolling statistical features, first-order difference features and second-order difference features based on sliding window, and concatenate the above features to form a multi-scale feature vector. S2: Input the multi-scale feature vector into the dilated causal temporal convolutional network, extract the long-short-term dependencies of the time series through multi-layer dilated convolution and residual connections, and output the initial yield prediction results in the normalized logarithmic space. S3: Construct a residual sequence based on the difference between the target true value and the initial prediction result under the same transformation space, input the residual sequence into the gradient boosting decision tree model for nonlinear fitting, and obtain the residual prediction result; S4: Adaptive multifidelity Bayesian optimization strategy is adopted to collaboratively optimize the key hyperparameters of the temporal convolutional network and gradient boosting decision tree model in order to obtain the optimal parameter combination. s5: The initial prediction result and the residual prediction result are added together according to the time step to obtain the fused prediction value. The fused prediction value is then subjected to inverse standardization and inverse logarithmic transformation to restore the oil well production prediction result with actual physical dimensions.

2. The oil well production prediction method according to claim 1, characterized in that, The specific content of step S1 includes: 2.1 The historical production data of the oil wells mentioned include: time series, oil well number, average downhole pressure, average downhole temperature, average tubing pressure differential, average nozzle size, average wellhead pressure, nozzle pressure differential, and the target variable daily oil production. 2.2 Outlier removal and missing value imputation were performed on the collected raw data, with outlier removal based on the 3σ criterion. 2.3 Perform a logarithmic transformation on the target variable, daily oil production. The transformation formula is as follows: y′=ln(y+1) Where y is the original daily oil production, and y′ is the target value after logarithmic transformation; 2.4 The logarithmically transformed target variable and other production parameters are subjected to Min-Max normalization to map the data to the [0, 1] interval; the preprocessed data are divided into training set and test set according to time order, so that the training data is earlier than the test data in time; 2.5 Constructing multi-scale temporal features based on a sliding window, including: Extract the historical output values ​​from the first p time steps as historical lag features; Calculate the rolling mean and rolling standard deviation for different window lengths w; Calculate first-order difference characteristics Dy t y t -y t-1 Calculate the difference features D 2 y t =Δy t -Yes t-1 The above features are aligned according to time steps and then concatenated to form a multi-scale feature vector X. t .

3. The oil well production prediction method as described in claim 1, characterized in that the temporal convolutional network modeling in step S2 includes: 3.1 Using an extended causal convolution structure, the convolution calculation is expressed as follows: in, k is the kernel size, d is the dilation coefficient, and W i These are the kernel weights. 3.2 This TCN model contains multiple residual block structures. Each residual block includes a dilated convolutional layer, a nonlinear activation function, and residual connections, expressed as follows: o(t) = f(x(t)) + x(t) 3.3 The multi-scale feature vectors are input into the temporal convolutional network in chronological order. After multiple layers of dilated convolution operations, the output sequence representation is obtained, and the initial prediction result is obtained by mapping through the output layer: Where g(·) represents the TCN network mapping function.

4. The oil well production prediction method as described in claim 1, characterized in that, The residual modeling in step S3 includes: 4.1 Calculate the residual sequence based on the difference between the true value after logarithmic transformation and normalization and the initial prediction result: Where, r t Let y′ be the residual value. t The true value is obtained after y′=ln(y+1) transformation and Min-Max normalization. This is the initial prediction result for TCN; 4.2 The residual sequence is input into the gradient boosting decision tree model for fitting, and its objective function is: Where l(·) is the loss function and Ω(·) is the regularization term. 4.3 Based on the trained gradient boosting decision tree model, the residuals are predicted to obtain the residual prediction results for the corresponding time steps: Where h(·) represents the LightGBM residual mapping function, X t The input is a multi-scale feature vector.

5. The oil well production prediction method according to claim 1, characterized in that, The specific content of step S4 includes: 5.1 The optimization of hyperparameters covers: the number of convolutional layers, kernel size, dilation coefficient sequence, and learning rate of temporal convolutional networks; and the tree depth, learning rate, and number of leaf nodes of LightGBM; 5.2 The optimization process is as follows: Initialize several sets of hyperparameter configurations, and use low-fidelity rapid evaluation to obtain preliminary performance estimates; construct a Gaussian process surrogate model based on the existing evaluation results, and use the acquisition function to iteratively select candidate parameters; when a set of parameter configurations performs well under low-fidelity evaluation and the expected improvement predicted by the surrogate model exceeds the preset threshold, switch to high-fidelity complete evaluation; the optimization objective is to minimize the root mean square error of the five-fold cross-validation.

6. The oil well production prediction method according to claim 1, characterized in that, The prediction result processing in step S5 includes: 6.1 Add the initial prediction results and the residual prediction results according to the corresponding time steps to obtain the fused prediction value: in, This is the initial prediction result. The result is the residual prediction. 6.2 Perform destandardization on the fused predictions to obtain the predictions y′ in logarithmic space. log When the target variable is transformed by y′=ln(y+1) and standardized, it can be restored to its actual physical dimensions using the following formula: y=exp(y′ log )-1 6.3 Output oil well production prediction values ​​that are consistent with the actual physical dimensions, and form a final prediction result sequence.