A method and system for predicting oil production with multiple steps
By using an interpretable Transformer model in oil production forecasting, combining local amplifiers and multi-head attention mechanisms, the idealized assumptions and nonlinear prediction problems of traditional methods are solved, and multi-step prediction of oil production and exogenous factors are achieved. Interpretability improves the optimization strategy formulation capabilities of predictive models.
Patent Information
- Application Number
- CN202411415584.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-11
- Publication Date
- 2024-12-13
- Estimated Expiration
- 2044-10-11
AI Technical Summary
Traditional oil yield prediction methods have idealized assumptions and poor interpretability caused by nonlinear prediction models, making it difficult to understand the reasons for improving oil recovery, and ignore the influence of exogenous factors, which hinders the formulation of optimization strategies.
Using the interpretable Transformer model, the decoupled local trend representation of production dynamics is learned through local amplifiers, interpretable exogenous attention and interpretable time attention modules, distinguish local fluctuations and noise, and establish the causal relationship between exogenous factors and yield. Capture long-term time dependence to achieve multi-step prediction of oil output.
It improves the interpretability of yield prediction, intuitively presents the correlation between influencing factors, enhances the optimization strategy formulation ability of the prediction model, reduces prediction errors, and improves the robustness of the prediction.
Smart Images

Figure CN118917499B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of oil production prediction, in particular to an interpretable multi-step oil production prediction method and system. Background Art
[0002] At present, production prediction is a basic task in the petroleum energy industry. Traditionally, production prediction is achieved by solving or fitting empirical physical formulas. The analytical method is to establish the seepage equation to solve the production based on the fluid flow regime under different conditions. However, this method introduces many idealized assumptions to make the equation solvable. Numerical simulation uses seepage mechanics and computer technology to simulate the behavior of the reservoir, which is laborious in practice and heavily dependent on prior geological models. In contrast, decline curve analysis (DCA) is much simpler, which uses preset physical formulas to fit past production to predict future production. However, this method has limited consideration of the control process. Therefore, more advanced solutions are needed to address the limitations of traditional production prediction methods. In recent years, the research progress of smart oil fields has provided new perspectives for production prediction. As a special time series, production dynamics continuously records the daily or monthly oil production of a well, which gives deep neural networks such as LSTM, TCN and the recent Transformer great application potential. Unlike general time series such as traffic flow and electricity consumption, which can be decomposed into trend, seasonality and noise (i.e., residual), production dynamics exhibit special characteristics consisting of trend, local fluctuations and noise. Specifically, actual oil reservoirs are not purely natural systems, but mixed systems affected by natural laws and human intervention. On the one hand, oil and gas production naturally shows a downward trend due to the reduction of reservoir permeability and pressure. On the other hand, engineers will adjust drilling parameters and development measures to improve oil recovery, which may cause local production fluctuations. For example, when acidizing measures are implemented, reservoir permeability is increased, which significantly increases production. Since these fluctuations appear suddenly and irregularly, they are easily confused with noise. Therefore, the analysis of production curves must not only consider long-term characteristics and local patterns, but also distinguish between local fluctuations and noise interference. This makes the production forecasting task particularly challenging. In addition to not considering the specificity of production data, most deep neural networks (DNNs) have poor interpretability of the predictions they produce due to their strong nonlinearity, which brings another challenge to production forecasting.
[0003] As mentioned above, reservoirs are affected by engineering measures such as acidizing operations and production time. These exogenous factors are artificially controllable and can be planned in advance in reservoir development plans. However, the impact of different factors on actual production remains unknown. Ignoring this influence process and adopting a black box prediction model will make it difficult for engineers to gain a deep understanding of the reasons for enhanced oil recovery, thereby hindering the formulation of prediction model optimization strategies. Summary of the invention
[0004] The technical problem to be solved by the present invention is to provide an interpretable multi-step oil production prediction method and system, which introduces aggregated multi-head attention to intuitively present the relevant influence relationship. The constructed interpretable Transformer model learns the decoupled local trend representation of production dynamics, and at the same time achieves interpretability in terms of time patterns and the influence of exogenous factors.
[0005] The technical solution of the present invention is:
[0006] An interpretable multi-step oil production prediction method specifically includes the following steps:
[0007] (1) Define the objectives of multi-step oil production forecasting , see the following formula (1) for details:
[0008] (1);
[0009] Formula (1) indicates that given and Prediction of the situation ; A total of N time series samples are generated during the production process, expressed as ; , represents the oil production of a well in the historical time step T; , indicating exogenous factors; is the number of types of exogenous factors; represents the future M time steps; represents a learnable parameter;
[0010] (2) Construct an interpretable Transformer model, including a local amplifier, interpretable exogenous attention, and interpretable temporal attention. The interpretable exogenous attention is the IEA module, and the interpretable temporal attention is the ITA module. The local amplifier extracts effective local enhancement information by enhancing the position perception of local fluctuations caused by exogenous factors while suppressing noise, thereby distinguishing local fluctuations from noise. The interpretable exogenous attention establishes the causal relationship between exogenous factors and production in the covariate dimension, and grasps the impact of exogenous factors on target production. The interpretable temporal attention connects historical and future oil production in the time dimension to learn long-term production behavior, thereby capturing long-term time dependence.
[0011] (3) Collect a real historical production data set, then train and test the interpretable Transformer model to obtain a trained and optimized interpretable Transformer model. Finally, use the trained and optimized interpretable Transformer model to predict oil production in the future M time steps.
[0012] The interpretable Transformer model includes an encoder and a decoder, the encoder includes a sequentially connected input embedding layer, a local amplifier, an IEA module and a feedforward layer, and the decoder includes a sequentially connected input embedding layer, a local amplifier, an IEA module, an ITA module and a feedforward layer; the outputs of the IEA module and the feedforward layer of the decoder, and the outputs of the IEA module, the ITA module and the feedforward layer of the decoder are all subjected to residual layer normalization connection processing.
[0013] The specific processing process of the local amplifier is as follows:
[0014] S11. Given input embedding and , express The embedded features after feature extraction, that is, the historical production embedding, express After feature extraction, the embedded features, i.e., exogenous factors, are embedded, and then the input is embedded into the input seq2seq layer, and the initial output is obtained , is the feature dimension of the input embedding, and the processing process is shown in the following formula (2):
[0015] (2);
[0016] In formula (2), , is a learnable parameter; It is a seq2seq layer;
[0017] S12. Embedding of exogenous factors Perform two consecutive 1D convolutions followed by softmax activation to obtain the position attention coefficient , the processing process is shown in the following formula (3):
[0018] (3);
[0019] In formula (3), Exogenous factors embedded The position attention coefficient, and represents two consecutive 1D convolutions, Represents the Softmax activation function;
[0020] S13, use Stimulate To reshape the distribution of local representations and perform convolution to learn rich local enhancement information on the stimulated representations, the processing process is shown in the following formula (4):
[0021] (4);
[0022] In formula (4), represents the element-wise product after dimension expansion, represents the convolution operation, Represents local enhancement information.
[0023] The processing process of the IEA module is as follows:
[0024] S21. Given exogenous factors embedded or , and local enhancement information or , perform linear projection, specifically or Project to In the query, or Projection on The processing process is shown in the following formulas (5) and (6):
[0025] (5);
[0026] (6);
[0027] In equations (5) and (6), subscript e represents the encoder, subscript d represents the decoder, and subscript , It is the number of IEA module headers; Q stands for Query; K stands for Key;
[0028] Represents Valu, which is the same value shared by multiple headers; , , , , , Represent the weight vectors of different linear projections respectively;
[0029] S22, use AMHA to align each query and key to generate a unified aggregated exogenous attention matrix;
[0030] AMHA stands for Aggregations multi-head attention, which is the aggregation of multi-head attention. The processing process is shown in the following formula (7):
[0031] (7);
[0032] In formula (7), represents convolution; represents the aggregated exogenous attention matrix; Represents the same value shared by multiple headers; represents the weight vector of the aggregated exogenous attention matrix; is a channel descriptor that describes the importance of each attention matrix and serves as a point-wise convolution kernel to recalibrate the response of each head to the aggregation; is the permuted attention matrix, , are the number of input time steps, Indicates the number of IEA module headers or the number of ITA module headers; represents the gating mechanism;
[0033] The aggregated exogenous attention matrix of the IEA module in the encoder is obtained by formula (7): and the aggregated exogenous attention matrix of the IEA module in the decoder , see the following formula (8) and formula (9) for details:
[0034] (8);
[0035] (9);
[0036] In formula (8) and formula (9), , , and Including the time dimension and covariate dimensions , which reflects the impact of each exogenous factor on oil production at different time steps, and are the outputs of the IEA module in the encoder and the IEA module in the decoder, respectively. , Represent the weight vectors of different linear projections respectively.
[0037] The channel descriptor From the following formula (10), we get:
[0038] (10);
[0039] In formula (10), , represents the attention matrix Perform global maximum pooling, , Is the channel descriptor Different weight vectors.
[0040] The specific processing process of the ITA module is as follows:
[0041] S31, the output of the encoder feedforward layer is , the output of the decoder IEA module is ,Will The linear projection is Query ,Will Convert to Keys and a value , see the following formula (11) for details:
[0042] (11);
[0043] In formula (11), , is the number of ITA module headers, , , Represent the weight vectors of different linear projections respectively;
[0044] S32, calculate the time AMHA, specifically the following formula (12):
[0045] (12);
[0046] In formula (12), is the aggregated temporal attention matrix;
[0047] S33, Last After being input into the forward feedback layer, the output of the decoder is obtained .
[0048] The output of the feedforward layer of the decoder is , according to the following formula (13) to obtain the predicted target :
[0049] (13);
[0050] In formula (13), The target of prediction The weight vector of
[0051] Finally, the interpretable Transformer model is trained and tested by minimizing the mean square error loss between the true value and the predicted result to obtain a trained and optimized interpretable Transformer model.
[0052] An interpretable multi-step oil production prediction system includes a data acquisition module, a production prediction module and a training optimization module;
[0053] The data collection module is used to collect historical production data sets and corresponding exogenous factors;
[0054] The yield prediction module uses an interpretable Transformer model to predict future yields based on historical yield data sets and corresponding exogenous factors;
[0055] The training optimization module trains and optimizes the interpretable Transformer model according to the data collected and updated by the data acquisition module to obtain a trained and optimized interpretable Transformer model.
[0056] Advantages of the present invention:
[0057] (1) The present invention can explain the local amplifier set in the Transformer model, which is used to enhance the local fluctuation caused by exogenous factors, and suppress noise interference from the perspective of position, so as to extract effective local enhancement information and distinguish local fluctuations from noise.
[0058] (2) The aggregated exogenous attention matrix obtained by processing the IEA module set in the interpretable Transformer model reflects the impact of each exogenous factor on oil production at different time steps; in addition to providing insights into dynamic impacts, the IEA module also selectively reduces the impact of production-insensitive factors, thereby reducing unnecessary noise input, and the attention calculation is independent at each time step (and within each head), thereby achieving parallel calculation along the time dimension.
[0059] (3) The present invention can explain that the ITA module set in the Transformer model connects historical and future oil production in the time dimension to learn long-term production behavior, thereby capturing long-term time dependencies. The processed aggregated time attention matrix reveals the correlation between historical production and future production.
[0060] (4) Both the IEA module and the ITA module of the present invention adopt an aggregated multi-head attention mechanism, so that multiple heads share the same value V, while retaining a separate query Q and key K for each head to maintain search diversity; the aggregated attention matrix (aggregated exogenous attention matrix and aggregated temporal attention matrix) derived by the aggregated multi-head attention mechanism has three characteristics: (i) simplicity, with only one channel; (ii) ensuring the diversity of the feature subspace through multiple Q and K; (iii) logic, with each step of the derivation maintaining the physical meaning of the variable; based on the above advantages, the aggregated multi-head attention mechanism greatly improves the interpretability of the interpretable Transformer model and can intuitively present the correlation between factors affecting oil production. BRIEF DESCRIPTION OF THE DRAWINGS
[0061] Figure 1 It is a network structure diagram of the Transformer model that can be explained by the present invention.
[0062] Figure 2 It is a network structure diagram of the present invention that aggregates multi-head attention. DETAILED DESCRIPTION
[0063] The technical solutions in the embodiments of the present invention are described clearly and completely below. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0064] An interpretable multi-step oil production prediction method is characterized by comprising the following steps:
[0065] (1) Define the objectives of multi-step oil production forecasting , see the following formula (1) for details:
[0066] (1);
[0067] Formula (1) indicates that given and Prediction of the situation ; A total of N time series samples are generated during the production process, expressed as , , represents the oil production of a well in the historical time step T; , indicating exogenous factors; is the number of types of exogenous factors; represents the future M time steps; represents a learnable parameter;
[0068] (2) Construct an interpretable Transformer model, including a locality amplifier (LA), an interpretable exogenous attention (IEA module), and an interpretable temporal attention (ITA module); the local amplifier extracts effective local enhancement information by enhancing the position perception of local fluctuations caused by exogenous factors while suppressing noise, thereby distinguishing local fluctuations from noise; the IEA module establishes a causal relationship between exogenous factors and production in the covariate dimension, and grasps the impact of exogenous factors on target production; the ITA module connects historical and future oil production in the time dimension to learn long-term production behavior, thereby capturing long-term time dependence;
[0069] (3) Collect a real historical production data set, then train and test the interpretable Transformer model to obtain a trained and optimized interpretable Transformer model. Finally, use the trained and optimized interpretable Transformer model to predict oil production in the future M time steps.
[0070] See Figure 1 The interpretable Transformer model includes an encoder and a decoder, the encoder includes a sequentially connected input embedding layer, a local amplifier, an IEA module and a feedforward layer, and the decoder includes a sequentially connected input embedding layer, a local amplifier, an IEA module, an ITA module and a feedforward layer; the outputs of the IEA module and the feedforward layer of the decoder, and the outputs of the IEA module, the ITA module and the feedforward layer of the decoder are all subjected to residual layer normalization connection processing.
[0071] The specific processing process of the local amplifier is as follows:
[0072] S11. Given input embedding and , express The embedded features after feature extraction, that is, the historical production embedding, express After feature extraction, the embedded features, i.e., exogenous factors, are embedded, and then the input is embedded into the input seq2seq layer, and the initial output is obtained , the processing process is shown in the following formula (2):
[0073] (2);
[0074] In formula (2), , is a learnable parameter; It is a seq2seq layer;
[0075] S12. Embedding of exogenous factors Perform two consecutive 1D convolutions followed by softmax activation to obtain the position attention coefficient , the processing process is shown in the following formula (3):
[0076] (3);
[0077] In formula (3), Exogenous factors embedded The position attention coefficient, and represents two consecutive 1D convolutions, Represents the Softmax activation function;
[0078] S13, use Stimulate To reshape the distribution of local representations and perform convolution to learn rich local enhancement information on the stimulated representations, the processing process is shown in the following formula (4):
[0079] (4);
[0080] In formula (4), represents the element-wise product after dimension expansion, represents the convolution operation, Represents local enhancement information.
[0081] The processing of the IEA module is as follows:
[0082] S21. Given exogenous factors embedded or , and local enhancement information or , perform linear projection, specifically or Project to In the query, or Projection on The processing process is shown in the following formulas (5) and (6):
[0083] (5);
[0084] (6);
[0085] In equations (5) and (6), subscript e represents the encoder, subscript d represents the decoder, and subscript , It is the number of IEA module headers; Q stands for Query; K stands for Key; Represents Valu, which is the same value shared by multiple headers; , , , , , Represent the weight vectors of different linear projections respectively;
[0086] S22, see Figure 2 , AMHA is used to align each query and key to generate a unified aggregated exogenous attention matrix;
[0087] AMHA stands for Aggregations multi-head attention, which is the aggregation of multi-head attention. The processing process is shown in the following formula (7):
[0088] (7);
[0089] In formula (7), represents convolution; represents the aggregated exogenous attention matrix; Represents the same value shared by multiple headers; represents the weight vector of the aggregated exogenous attention matrix; is the permuted attention matrix, , are the number of input time steps, Indicates the number of IEA module headers or the number of ITA module headers; represents the gating mechanism;
[0090] is a channel descriptor that describes the importance of each attention matrix and serves as a point-by-point convolution kernel to recalibrate the response of each head to the aggregation. From the following formula (10), we get:
[0091] (10);
[0092] In formula (10), , represents the attention matrix Perform global maximum pooling, , Is the channel descriptor Different weight vectors of ;
[0093] The aggregated exogenous attention matrix of the IEA module in the encoder is obtained by formula (7): and the aggregated exogenous attention matrix of the IEA module in the decoder , see the following formula (8) and formula (9) for details:
[0094] (8);
[0095] (9);
[0096] In formula (8) and formula (9), , , and Including the time dimension and covariate dimensions , which reflects the impact of each exogenous factor on oil production at different time steps, and are the outputs of the IEA module in the encoder and the IEA module in the decoder, respectively. , Represent the weight vectors of different linear projections respectively.
[0097] The specific processing process of the ITA module is as follows:
[0098] S31, the output of the encoder feedforward layer is , the output of the decoder IEA module is ,Will The linear projection is Query ,Will Convert to Keys and a value , see the following formula (11) for details:
[0099] (11);
[0100] In formula (11), , is the number of ITA module headers, , , Represent the weight vectors of different linear projections respectively;
[0101] S32, calculate the time AMHA, specifically the following formula (12):
[0102] (12);
[0103] In formula (12), is the aggregated temporal attention matrix, which reveals the correlation between historical output and future output;
[0104] S33, Last After being input into the forward feedback layer, the output of the decoder is obtained .
[0105] S4, decoder output The predicted target is obtained according to the following formula (13): :
[0106] (13);
[0107] In formula (13), The target of prediction The weight vector of
[0108] Finally, the interpretable Transformer model is trained and tested by minimizing the mean square error loss between the true value and the predicted result to obtain a trained and optimized interpretable Transformer model.
[0109] A. Verification Experiment
[0110] (1) Dataset: In order to verify the effectiveness of the interpretable Transformer model (PPT), two real historical production datasets are used for verification:
[0111] Volve: The Volve production dataset is a public dataset of the Volve oil field in the southern Norwegian North Sea; the dataset contains 5 production wells and 2 injection wells. Using the data of the 5 production wells, each well records the daily oil volume. The exogenous factors selected include the number of operating hours and the average throttle size percentage. The actual production data of the past 60 days is used to predict the situation in the next 30 and 60 days;
[0112] SWei: The SWei production dataset is from the Wei-2 fault block in the southern part of the Subei Basin in China. The dataset includes 101 producing wells, and the monthly oil production is recorded for each well. Each well involves five discrete exogenous factors (acidizing, fracturing, formation conversion, pump inspection and maintenance) and four continuous factors (choke size, stroke length, stroke count, and production days). The real production data of the past 24 months is used to predict the situation in the next 12 and 24 months.
[0113] (2) Implementation details: The performance of the model is measured by three common indicators: root mean square error (RMSE), mean absolute error (MAE) and mean absolute error (R2).
[0114] Comparative experiments were conducted under four task settings, namely Volve30, Volve60, SWei12, and SWei24; Volve30 refers to the prediction range of 30-day time steps on the Volve dataset, Volve60 refers to the prediction range of 60-day time steps on the Volve dataset; SWei12 refers to the prediction range of 12-month time steps on the SWei dataset, and SWei24 refers to the prediction range of 24-month time steps on the SWei dataset. For each task, grid search is used to determine the key hyperparameters of PPT, including the number of heads of the IEA module, the number of heads of the ITA module, the hidden layer size, and the dropout rate. The optimal hyperparameters for the four tasks are , , and GRU is used as the recurrent unit in the seq2seq layer. The convolution kernel size of two consecutive 1D convolutions in formula (3) is set to 1, and the convolution operation in formula (4) is The convolution kernel size is set to 3. In terms of training strategy, the batch size is set to 128, and the Adam optimizer with a learning rate of 0.001 is used. An early stopping strategy is adopted to prevent overfitting. All experiments are implemented in PyTorch on a system equipped with an NVIDIA GeForceRTX 3090 GPU.
[0115] B. Comparison with Baseline Methods
[0116] The model performance (RMSE, MAE, R2) of PPT is compared with 12 prediction methods (Exp DCA, Hyp DCA, Har DCA, LSTM, Seq2seq, PatchTST, Crossformer, NLlinear, Pyraformer, TFT, BiGRU-DHNN and PAPF), as shown in Tables 1 to 3 below. Exp DCA, Hyp DCA and Har DCA are traditional yield prediction methods. NLlinear, PatchTST, Crossformer, Pyraformer and TFT are state-of-the-art time series prediction methods, among which NLlinear is a time-decomposed linear model and the rest are transformer-based models. Pyraformer and TFT integrate exogenous factors as covariates. BiGRU-DHNN and PAPF are physically constrained yield prediction methods, which incorporate exogenous factors into GRU as physical constraints.
[0117] Table 1
[0118]
[0119] Table 2
[0120]
[0121] Table 3
[0122]
[0123] From Tables 1-3, we can see that: (1) PPT consistently outperforms all prediction methods in all four tasks and three indicators, reducing MSE by 10.1%, MSE by 10.6%, and R2 by 10.3% on average; this proves the superiority of the present invention in understanding potential production behavior. (2) The performance change of PPT is relatively stable as the prediction period increases (numbers in brackets), indicating that PPT has better robustness for long-term predictions. (3) It is inefficient to directly apply simple deep learning methods or time series prediction methods without covariates to yield data. This can be attributed to the significant differences between the temporal characteristics of yield dynamics and typical time series. In contrast, methods involving exogenous factors, such as Pyraformer and TFT, can improve prediction performance. This indirectly emphasizes the importance of directional feature decomposition in yield prediction.
[0124] C. Ablation study
[0125] In order to verify the effectiveness of the structured design of the proposed PPT, the model performance (RMSE, MAE, R2) is compared after removing / replacing key components from the PPT. The performance results are shown in Tables 4 to 6 below. LA represents local amplifier, PA represents position attention, and ExF represents pathways related to exogenous factors. It stands for without, that is, some components are removed from the model. AMHA2MHA means AMHA is replaced by MHA, AMHA2SHA means AMHA is replaced by SHA, and AMHAIMHA means AMHA is replaced by IMHA. MHA is a typical multi-head attention, SHA is a single-head attention, and IMHA is head aggregation based on addition.
[0126] Table 4
[0127]
[0128] Table 5
[0129]
[0130] Table 6
[0131]
[0132] In general, the components related to exogenous factors have the largest impact on the performance, with an average increase of 98.1% and 28.6% in MAE when the entire exogenous factor pathway or IEA module is ablated. This highlights the need to analyze the role of exogenous factors in promoting industrial applications of yield prediction algorithms. The component responsible for capturing temporal relationships - ITA module, including local processing and global temporal attention, has the second largest impact, with an average increase of more than 20% in MAE when ablated, because these components are tailored to reservoir characteristics, considering that reservoirs are affected by both natural decline laws and artificial regulatory interventions. For AMHA, it plays an important role in maintaining the accuracy and interpretability of the model. Replacing AMHA with the standard multi-head attention MHA leads to a slight drop in performance, while replacing AMHA with the single-head attention SHA leads to a significant drop in performance. The adaptive aggregation strategy also performs better than simple addition because different subspaces may differ in feature discriminability. In summary, the various components in PPT play different roles and contribute to the performance of the final prediction results.
[0133] D. Explainability Case Study
[0134] Considering the space limitation, the Jiangsu dataset with a 12-month forecast period will be used as an example. Similar results can be observed on the Volve dataset or other forecast horizons.
[0135] 1) Temporal pattern recognition: The trend of the production curve describes the natural decline pattern of production due to the depletion of reservoir permeability and pressure. To demonstrate how PPT learns this trend, the aggregated temporal attention weights of all training / test samples in all forecast horizons are integrated to reveal the universal temporal pattern, from which it can be seen that the dependence increases significantly, and more attention weight is assigned to the recent historical production. This is consistent with the natural decline pattern of production, indicating that PPT can learn decoupled trend features from complex production dynamics.
[0136] To summarize, the eight heads learn different degrees of attention from multiple perspectives: heads 2, 4, 5, and 6 focus on two recession periods (April-October and 20-22 months), heads 1, 3, and 7 try to capture long-term downward trends; head 8 considers the impact of extreme situations. PPT assigns different importance to each head and merges multiple heads into one head in a logical way. In the first 3 months of the forecast (months 25-27), the output is mainly affected by the last 3 months (months 22-24). In the last 9 months of the forecast (months 28-36), the output is affected by the above two recession periods, and the latter has a greater impact. The above observations show that PPT is able to identify patterns from historical data that may be similar to future trends, thereby accurately predicting future output. The aggregated single attention map also helps to better explain the temporal patterns reflected by multiple heads.
[0137] 2) Analysis of exogenous factors: Revealing the temporal impact of engineering measures on production plays an important role in optimizing development plans. Taking a test well as an example, the attention dynamics of different factors are demonstrated. First, regarding positional attention, it is noted that PPT pays more attention to periods with measurement events or sharp changes, and pays less attention to other periods. This shows that PPT can effectively distinguish local fluctuations and noise caused by exogenous factors. Subsequently, the dynamic impact of exogenous factors is analyzed. For discrete factors, the attention weight is higher in months with measurements, which shows that PPT is more inclined to learn how measurements affect production. For continuous factors, PPT pays more attention to months with fewer production days. This is reasonable because low-production periods usually mean shutting in wells in order to take production measures. On the other hand, PPT believes that adjusting the choke size and stroke length will not significantly affect the production of this well. Similarly, less attention is given to the stroke count adjustment. These findings provide new ideas for optimizing development plans: unnecessary adjustments to the choke size, stroke length, and stroke counts in months 43-59 can be removed from the original plan, thereby reducing costs and improving efficiency.
[0138] To verify the above optimization suggestions, taking the fracturing in the 43rd month as an example, canceling unnecessary measures has little impact on production, while not implementing fracturing may lead to production loss. In short, PPT can evaluate the impact of exogenous factors, which helps to formulate more effective development plans.
[0139] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.
Claims
1. An interpretable multi-step oil production forecasting method, characterized by: The specific steps include: (1) Define the objectives of multi-step oil production forecasting , see the following formula (1) for details: (1); Formula (1) indicates that given and Prediction of the situation ; A total of N time series samples are generated during the production process, expressed as ; , represents the oil production of a well in the historical time step T; , indicating exogenous factors; is the number of types of exogenous factors; represents the future M time steps; represents a learnable parameter; (2) Construct an interpretable Transformer model, including a local amplifier, interpretable exogenous attention, and interpretable temporal attention. The interpretable exogenous attention is the IEA module, and the interpretable temporal attention is the ITA module. The local amplifier extracts effective local enhancement information by enhancing the position perception of local fluctuations caused by exogenous factors while suppressing noise, thereby distinguishing local fluctuations from noise. The interpretable exogenous attention establishes the causal relationship between exogenous factors and production in the covariate dimension, and grasps the impact of exogenous factors on target output. Interpretable temporal attention connects historical and future oil production in the temporal dimension to learn long-term production behaviors, thus capturing long-term temporal dependencies; (3) Collect a real historical production data set, then train and test the interpretable Transformer model to obtain a trained and optimized interpretable Transformer model, and finally use the trained and optimized interpretable Transformer model to predict oil production in the future M time steps; The interpretable Transformer model includes an encoder and a decoder, the encoder includes an input embedding layer, a local amplifier, an IEA module and a feedforward layer connected in sequence, and the decoder includes an input embedding layer, a local amplifier, an IEA module, an ITA module and a feedforward layer connected in sequence; the output of the IEA module and the feedforward layer of the decoder, and the output of the IEA module, the ITA module and the feedforward layer of the decoder are all subjected to residual layer normalization connection processing; The processing process of the IEA module is as follows: S21. Given exogenous factors embedded or , and local enhancement information or , perform linear projection, specifically or Project to In the query, or Projection on The processing process is shown in the following formulas (5) and (6): (5); (6); In equations (5) and (6), subscript e represents the encoder, subscript d represents the decoder, and subscript , It is the number of IEA module headers; Q stands for Query; K stands for Key; Represents Valu, which is the same value shared by multiple headers; , , , , , Represent the weight vectors of different linear projections respectively; S22, use AMHA to align each query and key to generate a unified aggregated exogenous attention matrix; AMHA stands for Aggregations multi-head attention, which is the aggregation of multi-head attention. The processing process is shown in the following formula (7): (7); In formula (7), represents convolution; represents the aggregated exogenous attention matrix; Represents the same value shared by multiple headers; represents the weight vector of the aggregated exogenous attention matrix; is a channel descriptor that describes the importance of each attention matrix and serves as a point-wise convolution kernel to recalibrate the response of each head to the aggregation; is the permuted attention matrix, , are the number of input time steps, Indicates the number of IEA module headers or the number of ITA module headers; represents the gating mechanism; The aggregated exogenous attention matrix of the IEA module in the encoder is obtained by formula (7): and the aggregated exogenous attention matrix of the IEA module in the decoder , see the following formula (8) and formula (9) for details: (8); (9); In formula (8) and formula (9), , , and Including the time dimension and covariate dimensions , which reflects the impact of each exogenous factor on oil production at different time steps, and are the outputs of the IEA module in the encoder and the IEA module in the decoder, respectively. , Represent the weight vectors of different linear projections respectively; The specific processing process of the ITA module is as follows: S31, the output of the encoder feedforward layer is , the output of the decoder IEA module is ,Will The linear projection is Query ,Will Convert to Keys and a value , see the following formula (11) for details: (11); In formula (11), , is the number of ITA module headers, , , Represent the weight vectors of different linear projections respectively; S32, calculate the time AMHA, specifically the following formula (12): (12); In formula (12), is the aggregated temporal attention matrix; S33, Last After being input into the forward feedback layer, the output of the decoder is obtained .
2. The method for predicting oil production in multiple steps according to claim 1, characterized in that: The specific processing process of the local amplifier is as follows: S11. Given input embedding and , express The embedded features after feature extraction, that is, the historical production embedding, express After feature extraction, the embedded features, i.e., exogenous factors, are embedded, and then the input is embedded into the input seq2seq layer, and the initial output is obtained , is the feature dimension of the input embedding, and the processing process is shown in the following formula (2): (2); In formula (2), , is a learnable parameter; It is a seq2seq layer; S12. Embedding of exogenous factors Perform two consecutive 1D convolutions followed by softmax activation to obtain the position attention coefficient , the processing process is shown in the following formula (3): (3); In formula (3), Exogenous factors embedded The position attention coefficient, and represents two consecutive 1D convolutions, Represents the Softmax activation function; S13, use Stimulate To reshape the distribution of local representations and perform convolution to learn rich local enhancement information on the stimulated representations, the processing process is shown in the following formula (4): (4); In formula (4), represents the element-wise product after dimension expansion, represents the convolution operation, Represents local enhancement information.
3. The method of claim 1, wherein: The channel descriptor From the following formula (10), we get: (10); In formula (10), , represents the attention matrix Perform global maximum pooling, , Is the channel descriptor Different weight vectors.
4. The method of claim 1, wherein: The output of the feedforward layer of the decoder is , according to the following formula (13) to obtain the predicted target : (13); In formula (13), The target of prediction The weight vector of Finally, the interpretable Transformer model is trained and tested by minimizing the mean square error loss between the true value and the predicted result to obtain a trained and optimized interpretable Transformer model.
5. An interpretable multi-step oil production prediction system, used to implement the interpretable multi-step oil production prediction method according to any one of claims 1 to 4, characterized in that: It includes data collection module, production prediction module and training optimization module; The data collection module is used to collect historical production data sets and corresponding exogenous factors; The yield prediction module uses an interpretable Transformer model to predict future yields based on historical yield data sets and corresponding exogenous factors; The training optimization module trains and optimizes the interpretable Transformer model according to the data collected and updated by the data acquisition module to obtain a trained and optimized interpretable Transformer model.
