A method for end-to-end dynamic modeling of oil reservoirs based on diffusion model
Through the combination of diffusion model and Informer module, an end-to-end reservoir dynamic modeling method is constructed, which solves the problems of long time to fit the reservoir historically and difficulty in dynamic adjustment, and achieves efficient dynamic adjustment and accuracy improvement of reservoir model.
Patent Information
- Application Number
- CN202510677755.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-26
- Publication Date
- 2025-08-08
- Estimated Expiration
- 2045-05-26
AI Technical Summary
The iteration of existing reservoir historical fitting methods is time-consuming and difficult to reflect the dynamic changes of the reservoir in real time. The generator and discriminator are difficult to converge at the same time during training, and cannot effectively use the latest production data for dynamic adjustments.
The diffusion model is used to extract production data characteristics in combination with the Informer module, and an end-to-end dynamic modeling method is constructed, and multiple prediction data of future flows are generated through data space inversion, reducing human intervention and improving the accuracy of reservoir models.
The end-to-end automation process of reservoir models is realized, the historical fitting efficiency is improved, the reservoir model can be dynamically adjusted according to the latest production data, and the matching ability of actual development dynamics is significantly improved.
Smart Images

Figure CN120197518B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of petroleum engineering, and in particular relates to an end-to-end dynamic modeling method for oil reservoirs based on a diffusion model. Background Art
[0002] In petroleum engineering, history matching, a key technical step in reservoir numerical simulation, focuses on dynamically adjusting reservoir model parameters to achieve optimal alignment between numerical simulation results and actual oilfield production data. History matching can essentially be viewed as an optimization process, the goal of which is to minimize the discrepancies between reservoir model parameters and existing geological understanding, as well as between simulated and observed data. Due to the high dimensionality of reservoir model parameters and the strong nonlinearity of numerical simulation, history matching optimization is a high-dimensional, strongly nonconvex optimization problem. The current mainstream approach used in industry is the Ensemble Smoother Multiple Data Assimilation (ESMDA) method. This method applies Gaussian random perturbations to ensemble members during each data assimilation pass and uses a Kalman gain matrix to modify model parameters. Compared to traditional optimization algorithms, the ESMDA method offers a more stable iterative process and facilitates uncertainty quantification of optimization results. However, the solution still requires multiple calls to the numerical simulator, resulting in a lengthy fitting process.
[0003] To address the time-consuming nature of history matching, researchers have developed a data-driven surrogate model based on deep learning algorithms to replace traditional numerical simulators. Compared to traditional numerical simulators, which rely on iterative solutions to physical equations, surrogate models utilize feedforward computational capabilities, reducing the time required for a single simulation from hours to seconds while maintaining over 90% prediction accuracy. This paradigm shift significantly improves history matching efficiency, particularly in large-scale oilfield scenarios.
[0004] History matching frameworks based on surrogate models still require optimization algorithms for solution, and cannot address the problem of non-convex optimization problems easily falling into local optimal solutions. In recent years, researchers have proposed an end-to-end history matching method based on generative network models, which uses production data as a control condition to directly generate the corresponding reservoir model. This method simplifies the traditional fitting process, integrating production data and reservoir model parameter adjustments into a unified framework for processing, reducing the number of human intervention steps. The most representative is the dynamic data assimilation system based on Generative Adversarial Networks (GAN). GAN can continuously optimize reservoir model parameters through the adversarial training mechanism of the generator and discriminator, so that the generated reservoir model gradually approaches the dynamic behavior of the real reservoir.
[0005] The introduction of GANs enables end-to-end fitting of reservoir models directly from production data, avoiding the complex parameter adjustment process. However, the generator and discriminator often struggle to converge simultaneously during training, making training difficult. Furthermore, GANs struggle to dynamically update based on the latest production data, failing to reflect reservoir dynamics in real time. This limits their effectiveness in actual production applications. Summary of the Invention
[0006] To address the above-mentioned issues, the present invention proposes an end-to-end dynamic reservoir modeling method based on a diffusion model. Using the diffusion model, the reservoir model construction, parameter adjustment, and history fitting processes are integrated into an end-to-end automated process, reducing human intervention and improving work efficiency. An informer module is introduced into the diffusion model to extract multiple production data features as prompt words, addressing the long time span and complex features of production data and improving the accuracy of the reservoir model. In the data space, a Bayesian approach is used to infer the posterior distribution under given observed production data conditions, generating multiple future flow prediction data from the posterior distribution, addressing the need to dynamically adjust the real reservoir model based on the latest production data.
[0007] The technical solutions of the present invention are as follows:
[0008] An end-to-end dynamic modeling method for oil reservoirs based on a diffusion model comprises the following steps:
[0009] Step 1: Obtain reservoir geological attribute data and oil and water well production dynamic data, establish a sample data set, and perform normalization processing;
[0010] Step 2: Based on the Informer model, a time series feature extraction model is constructed to extract the long-term production data features of the reservoir and convert them into high-dimensional feature vectors. The model is then trained using the normalized sample data set.
[0011] Step 3: Construct the basic process framework of the diffusion model to gradually add noise to the reservoir geological attribute data;
[0012] Step 4: Build a denoising network based on Unet, encapsulate the Informer-based time series feature extraction model, the diffusion model basic process architecture, and the denoising network to obtain an inversion prediction model that implements end-to-end dynamic modeling of the reservoir;
[0013] Step 5: Combine the inversion prediction model with the data space inversion method to achieve end-to-end dynamic modeling of the reservoir.
[0014] Furthermore, the specific process of step 1 is:
[0015] Step 1.1: Obtain reservoir geological attribute data, including seismic, well logging, and core data;
[0016] Step 1.2: Based on the reservoir geological attribute data, a stochastic geological modeling method is used to construct multiple geological models, which are the prior models. Then, a reservoir numerical simulator is used to perform numerical simulation calculations on all the prior models, and the oil and water well production performance data corresponding to each prior model is obtained. The prior models and their corresponding oil and water well production performance data are constructed into a sample data set.
[0017] Step 1.3, normalize the oil and water well production dynamic data and reservoir geological attribute data in the sample data set;
[0018] Organize the oil and water well production dynamic data in the sample data set into a production dynamic data sample set , organize the reservoir geological attribute data in the sample data set into a reservoir geological attribute sample set ; To produce the first group sample; is the first in the reservoir geological attribute sample set group sample;
[0019] The normalization method uses the following formula:
[0020] ;
[0021] in, is the normalized data value; It is the first sample in the production dynamic data sample set or reservoir geological attribute sample set. group sample; is the minimum value in the original data; is the maximum value in the original data;
[0022] The normalized production dynamic data sample set is ; The normalized reservoir geological attribute data sample set is .
[0023] Furthermore, in step 2, the constructed time series feature extraction model includes a data embedding layer and an encoder part; the specific working process of the time series feature extraction model is as follows:
[0024] Step 2.1: Input the normalized production dynamic data sample set into the data embedding layer, perform data embedding, and obtain embedding features. The specific process is as follows:
[0025] Step 2.1.1: Normalize the production dynamic data sample set As the input sample set, is the time step, is the feature dimension; use a one-dimensional convolution layer to transform the input sample set, converting the original data from the feature dimension Mapping to high-dimensional space, we get the output feature set:
[0026] ;
[0027] in, Output feature sets for production dynamic data; is a one-dimensional convolutional layer; is the dimension of the high-dimensional space;
[0028] Step 2.1.2: Construct the position code. The position code is generated by a predefined function. The formula is as follows:
[0029] For even dimensions:
[0030] ;
[0031] For odd dimensions:
[0032] ;
[0033] in, is location information; Indicates the current word; is the encoding dimension index;
[0034] Step 2.1.3: Output the feature set of the production dynamic data extracted by the one-dimensional convolution layer Add element-by-element to the position information of the corresponding time step to obtain the embedded feature:
[0035] ;
[0036] in, is the embedded feature;
[0037] Step 2.2: Construct the encoder part to process the embedded features. The encoder part contains multiple encoder layers.
[0038] Furthermore, the specific process of step 2.2 is as follows:
[0039] Step 2.2.1, embed features Projected into the probabilistic sparse attention module, the linear transformation Mapped into query matrix , key matrix Sum Matrix ; Calculate the similarity between randomly selected queries and randomly selected keys to obtain a sparse query-key similarity matrix, select the first few queries with high similarity to the key match, and obtain a sparse attention score matrix :
[0040] ;
[0041] in, is a randomly selected query; is a randomly selected key; is the transpose symbol;
[0042] Step 2.2.2. Apply the softmax function to the sparse attention score matrix to convert the score into a weight, and then weight the matching degree between each query and all keys to obtain the sparse attention weight matrix , the calculation formula for each attention weight in the matrix is:
[0043] ;
[0044] in, For An exponential function with base ; It is query and The score between the keys; It is query and Attention weights between keys; For the query and The score between the keys;
[0045] Step 2.2.3, through the sparse attention weight matrix Pair Matrix Perform weighted summation to generate context vector :
[0046] ;
[0047] Step 2.2.4: For the multi-head attention mechanism, the context vector of each attention head is Perform stitching operations and output the projection matrix Get the output of the attention module :
[0048] ;
[0049] in, For splicing operation; For the The context vector of each attention head;
[0050] Step 2.2.5: Output of the attention module Perform Dropout operation and embedding features Perform residual connection and first layer normalization operations to obtain the first embedding feature :
[0051] ;
[0052] in, is the layer normalization operation; Dropout operation;
[0053] right Perform the first convolution, activation function, and Dropout operation in sequence, then perform the second convolution and another Dropout operation to obtain the second embedding feature ;
[0054] right and Perform residual connection and second layer normalization operation to obtain the output of the encoder layer :
[0055] ;
[0056] Overlay multiple encoder layers, Treat Enter step 2.2.1 again until you get the final output of the encoder part .
[0057] Furthermore, the specific process of step 3 is as follows:
[0058] Step 3.1: Normalized reservoir geological attribute data sample set Perform standardization and dimensionality reduction;
[0059] The formula for standardization is:
[0060] ;
[0061] in, Represents the standardized data; is the mean of the normalized data; is the standard deviation;
[0062] The principal component analysis method is used to reduce the dimension of the standardized data; the specific process is as follows:
[0063] First, calculate the covariance matrix of the standardized data:
[0064] ;
[0065] in, is the covariance matrix; The first The data values of the group sample; is the mean vector of each feature in the standardized data; is the total number of sample groups;
[0066] Then, perform eigenvalue decomposition on the covariance matrix to obtain the eigenvalues and the corresponding eigenvector ,in, For the eigenvalues Corresponding eigenvectors; the total number of eigenvalues or eigenvectors and the permeability characteristic dimension Corresponding; select the front according to the size of the eigenvalue eigenvectors as principal components; the selected eigenvectors The matrix It is the principal component matrix required for dimensionality reduction; project the standardized data into the principal component subspace to obtain the data set after dimensionality reduction :
[0067] ;
[0068] in, is the standardized data set;
[0069] Step 3.2: gradually add noise to the reservoir geological attribute data after dimensionality reduction, specifically using the cosine scheduling function to generate the noise coefficient;
[0070] Step 3.3: In the reverse denoising process, from the time step Generate time steps in reverse Reservoir geological attribute data.
[0071] Furthermore, in step 3.2, the noise coefficient is calculated as follows:
[0072] ;
[0073] in, is the time step Noise figure;
[0074] The reservoir geological attribute data after adding noise at each time step is defined as:
[0075] ;
[0076] ;
[0077] in, 、 The time steps are , time step Reservoir geological attribute data after adding noise; is the time step retention rate; is the time step noise;
[0078] Using known initial reservoir geological attribute data, the time step is derived in one go The specific formula for reservoir geological attribute data after adding noise is as follows:
[0079] ;
[0080] ;
[0081] in, is the initial reservoir geological attribute data; From time step 1 to time step Cumulative retention rate; For noise; is the time step retention rate;
[0082] The formula of step 3.3 is:
[0083] ;
[0084] ;
[0085] ;
[0086] in, For a given generate The conditional probability distribution of this distribution is determined by the training parameters of the model to decide; is a multidimensional normal distribution; The model predicts The mean of The model predicts The covariance matrix of is the noise in the model prediction; From time step 1 to time step Cumulative retention rate;
[0087] Each step of the denoising process in the reverse process is expressed as:
[0088] .
[0089] Furthermore, in step 4, the denoising network adopts a U-shaped network structure Unet in deep learning, and Unet includes an encoder part and a decoder part; the specific process of step 4 is:
[0090] Step 4.1, Perform convolution operations to extract preliminary features and generate feature representations in the latent space :
[0091] ;
[0092] in, is the convolution kernel; is the activation function; is the bias term of the convolution operation;
[0093] right Time step Using sinusoidal position encoding, followed by two linear layers and activation functions, the time steps are mapped to Representation of the same dimension ;Will and Add them together to get the token that guides the model generation. A token is the smallest unit of text generated or processed by the model.
[0094] Step 4.2, The encoder part of the Unet is input with tokens. The encoder part consists of multiple layers of encoding modules with the same structure. Each layer of encoding modules contains two residual blocks, a multi-head spatial attention mechanism, and a downsampling. The specific formula is:
[0095] Two residual blocks:
[0096] ;
[0097] ;
[0098] in, 、 are the features output by the first residual block and the second residual block respectively; is convolution;
[0099] Multi-head spatial attention mechanism fusion And token feature extraction, when extracting features, first use two-dimensional convolution to get The query matrix , key matrix , value matrix , then input the token into two linear layers respectively to obtain the key matrix of the token Sum Matrix ;Will and Splicing to obtain a new bond matrix ,Will and Splicing to obtain a new value matrix ;right 、 、 Execute the following formula:
[0100] ;
[0101] ;
[0102] in, is the softmax function; is the output of a single attention head; For the The output of an attention head; The output is the concatenation of multiple attention results; is the dimension of the new bond matrix;
[0103] right Downsampling:
[0104] ;
[0105] in, is the feature after downsampling; is down-sampling; get After that, input the next layer of encoding module and repeat the process of step 4.2 until the last layer of encoding module is calculated. The output of the last layer of encoding module is the final low-resolution feature map ;
[0106] Step 4.3, after downsampling in the encoder part, The decoder is fed into the UNet. The decoder contains multiple layers of decoding modules with the same structure, and the number of decoding modules is the same as that of encoding modules. Each decoding module consists of a skip connection, two residual blocks, a multi-head spatial attention mechanism, and an upsampling mechanism. The specific process is as follows:
[0107] The skip connection will be symmetrical with the encoder of the current decoder Spliced to the output of the previous decoder On the top, get the spliced features;
[0108] The concatenated features and tokens are input into the multi-head spatial attention module. The specific operation is consistent with the multi-head spatial attention module of the encoder, and the output of multiple attention heads is obtained. ;Will Input the upsampling layer and get the output of the current layer decoder :
[0109] ;
[0110] in, is upsampling;
[0111] After calculations by multiple layers of decoding modules, the final output of the decoder is obtained ;
[0112] Deconvolution is performed on the final output of the decoder to restore the noise-free output with the same dimension as the input data. :
[0113] ;
[0114] in, This is the deconvolution operation; at this point, the denoising network is constructed;
[0115] Step 4.4: Connect the time series feature extraction model in step 2, the diffusion model basic process architecture in step 3, and the denoising network in sequence to encapsulate a complete diffusion model. The encapsulated complete diffusion model is the inversion prediction model.
[0116] Furthermore, in step 5, for the observed production data containing noise, the data space inversion method combines the observed production data and the prior model to remove the noise of the observed production data, and generates multiple future flow prediction data from the posterior distribution. The predicted data is used as the input of the inversion prediction model in step 4.4 to realize dynamic adjustment of the real reservoir model.
[0117] The beneficial technical effects brought about by the present invention are as follows: The present invention is an end-to-end inversion method for the dynamic attribute field of the reservoir based on the diffusion model, which realizes end-to-end dynamic modeling from production data to geological attribute maps, takes the diffusion model as the core method for solving the inverse problem of history fitting, and integrates the reservoir model construction, parameter adjustment and history fitting process into an end-to-end automated process, reducing human intervention and improving work efficiency. The present invention constructs a large number of geological models through a random geological modeling method, obtains the production dynamics of the oil and water wells corresponding to each model, and forms a sample data set; then, a long time series prediction model based on Informer is used to extract the production characteristics and time characteristics of each well, and map them into high-dimensional vectors; then, the geological attribute data of the reservoir is gradually noised so that the complex geological parameters can be randomly disturbed at each stage of diffusion. Then, the denoising network is trained, and the actual geological parameters of the reservoir are restored from the Gaussian distribution in combination with the conditional information provided by the Informer model. The trained diffusion model and the Informer model are encapsulated to obtain an encapsulated diffusion model. Finally, with the help of the data space inversion method, the noise of the observed production data is removed by combining the observed production data and the prior model, and multiple future flow prediction data are generated from the posterior distribution. These predictions are input as conditions into the encapsulated diffusion model to achieve dynamic adjustment of the real reservoir model. In the present invention, multiple future flow prediction data can be effectively generated based on the actual observed production data after data space inversion processing. The predicted data is input into the encapsulated diffusion model, which can well dynamically invert the geological attribute data and realize an end-to-end automated process. The present invention is an efficient "one-step" generation method for geological parameters to reservoir attribute fields, which can significantly improve the matching ability of the reservoir model to the actual development dynamics. BRIEF DESCRIPTION OF THE DRAWINGS
[0118] Figure 1 It is the overall design flow chart of the end-to-end dynamic modeling method of the oil reservoir based on the diffusion model of the present invention.
[0119] Figure 2 It is a porosity distribution diagram of a real reservoir model in an embodiment of the present invention.
[0120] Figure 3 It is the permeability field distribution diagram in the x direction of the real reservoir model in the embodiment of the present invention.
[0121] Figure 4 3 is a permeability field distribution diagram in the z direction of the real reservoir model in the embodiment of the present invention.
[0122] Figure 5 3 is a net thickness ratio distribution diagram of a real reservoir model in an embodiment of the present invention.
[0123] Figure 6It is a reservoir porosity distribution map obtained by predicting production data through an inversion prediction model in an embodiment of the present invention.
[0124] Figure 7 It is the permeability distribution map in the x direction of the reservoir obtained by predicting the production data through the inversion prediction model in the embodiment of the present invention.
[0125] Figure 8 It is a permeability distribution map in the z direction of the reservoir obtained by predicting the production data through the inversion prediction model in the embodiment of the present invention.
[0126] Figure 9 It is a distribution diagram of the net thickness ratio of the oil reservoir obtained by predicting the production data through the inversion prediction model in the embodiment of the present invention.
[0127] Figure 10 It is a schematic diagram of the fitting of the pressure data of 20 production wells in the real oil reservoir and the oil reservoir predicted by the inversion prediction model in an embodiment of the present invention.
[0128] Figure 11 It is a schematic diagram of the fitting of the pressure data of 10 water injection wells in the real oil reservoir and the oil reservoir predicted by the inversion prediction model in an embodiment of the present invention.
[0129] Figure 12 It is a schematic diagram of the fitting of the actual oil reservoir and the oil production data of 20 production wells in the oil reservoir predicted by the inversion prediction model in an embodiment of the present invention.
[0130] Figure 13 It is a schematic diagram of the fitting of the water production data of 20 production wells in the oil reservoir predicted by the inversion prediction model and the actual oil reservoir in an embodiment of the present invention.
[0131] Figure 14 It is a schematic diagram of the fitting between the production data obtained by inverting the observed production data and the actual reservoir production data in an embodiment of the present invention. DETAILED DESCRIPTION
[0132] The present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments:
[0133] The main process of the present invention is as follows: establishing a sample data set; constructing an encoder based on the Informer model to extract the features of the long-term production data of the reservoir and convert it into a high-dimensional feature vector; constructing a diffusion model basic process architecture to gradually add noise to the multi-dimensional geological attribute data of the reservoir model to destroy the data, and then reverse this process through the trained denoising network; constructing a special Unet module to combine the high-dimensional feature vectors of the long-term production data of the reservoir to accurately predict the noise component in each time step; estimating more accurate data from the observed production data containing noise through data space inversion technology, and using it as model input to improve the model's adaptability to field data and prediction accuracy. Figure 1 As shown in FIG, an end-to-end dynamic modeling method for an oil reservoir based on a diffusion model includes the following steps:
[0134] Step 1: Obtain reservoir geological attribute data and oil and water well production dynamic data, establish a sample data set, and perform normalization. The specific process is as follows:
[0135] Step 1.1: Obtain reservoir geological attribute data, including seismic, well logging, and core data. Reservoir geological attribute data is important for describing reservoir characteristics. Well logging data is obtained through measurements in wells to obtain various reservoir information, including porosity, permeability, lithology, fluid type, etc.
[0136] Step 1.2: Based on the reservoir geological attribute data, a stochastic geological modeling method is used to construct multiple geological models, which are the prior models. Then, a reservoir numerical simulator is used to perform numerical simulation calculations on all the prior models, and the oil and water well production performance data corresponding to each prior model is obtained. The prior models and their corresponding oil and water well production performance data are constructed into a sample data set.
[0137] Step 1.3, normalize the oil and water well production dynamic data and reservoir geological attribute data in the sample data set;
[0138] Organize the oil and water well production dynamic data in the sample data set into a production dynamic data sample set , organize the reservoir geological attribute data in the sample data set into a reservoir geological attribute sample set ; To produce the first group sample; is the first in the reservoir geological attribute sample set group sample;
[0139] The normalization method uses the following formula:
[0140] ;
[0141] in, is the normalized data; It is the first sample in the production dynamic data sample set or reservoir geological attribute sample set. group sample; is the minimum value in the original data; is the maximum value in the original data;
[0142] The normalized production dynamic data sample set is ; The normalized reservoir geological attribute data sample set is .
[0143] Step 2: Build a time series feature extraction model based on the Informer model to extract the long-term production data features of the reservoir and convert them into high-dimensional feature vectors. Then, train the model using the normalized sample data set. The Informer model is a deep learning model specifically designed for time series prediction.
[0144] The constructed time series feature extraction model consists of a data embedding layer and an encoder part. The data embedding layer is used to extract the multidimensional features of reservoir production data. First, a one-dimensional convolutional layer is used for feature convolution. Then, a position encoding is constructed to represent the position information of each time step. Finally, the two are added element by element to obtain the embedded features. The encoder part consists of multiple encoder layers, each of which integrates an attention module, residual connection, layer normalization, and feedforward neural network. Through layer-by-layer processing, the initial data features are gradually mapped to high-dimensional vector representations, thereby better capturing the potential complex relationships and dynamic patterns in time series data. The specific working process of the time series feature extraction model is as follows:
[0145] Step 2.1: Input the normalized production dynamic data sample set into the data embedding layer, perform data embedding, and obtain embedding features. The specific process is as follows:
[0146] Step 2.1.1: Normalize the production dynamic data sample set As the input sample set, is the time step, Is the feature dimension. Use a one-dimensional convolution layer to transform the input sample set. The size of the convolution kernel is set according to the task requirements to extract local features. Through the convolution operation, the original data is transformed from the feature dimension to the Mapping to high-dimensional space, we get the output feature set:
[0147] ;
[0148] in, Output feature sets for production dynamic data; is a one-dimensional convolutional layer; is the dimension of the high-dimensional space;
[0149] Step 2.1.2, then construct a position encoding so that the model can process position information. The position encoding is generated by predefined functions (such as sine and cosine functions) and the formula is as follows:
[0150] For even dimensions ( ):
[0151] ;
[0152] For odd dimensions ( ):
[0153] ;
[0154] in, is location information; Indicates the current word; is the encoding dimension index.
[0155] Step 2.1.3: Output the feature set of the production dynamic data extracted by the one-dimensional convolution layer and the position information of the corresponding time step Add element by element to get the embedded features:
[0156] ;
[0157] in, is the embedded feature.
[0158] Step 2.2: Construct the encoder part to process the embedded features. The encoder part contains multiple encoder layers. The specific process is as follows:
[0159] Step 2.2.1, embed features Projected into the probabilistic sparse attention module, the linear transformation Mapped into query matrix , key matrix Sum Matrix ; In the traditional fully connected attention mechanism, each query is matched with all keys and their similarity is calculated. In the probabilistic sparse attention module, instead of calculating the similarity between all queries and all keys, some query and key pairs are randomly selected for matching through sampling. The similarity is calculated for the query and the randomly selected keys, and a sparse query-key similarity matrix is obtained, which represents the similarity between each query and the selected keys. In order to further reduce the amount of calculation, only the first few queries with the strongest match to the key (i.e., the highest similarity) are selected. Based on these strongest queries, a sparse attention score matrix is obtained. :
[0160] ;
[0161] in, is a randomly selected query; is a randomly selected key; is the transpose symbol;
[0162] Step 2.2.2. Apply the softmax function to the sparse attention score matrix, so that the score can be converted into a weight, and then the matching degree between each query and all keys is weighted, and the sum of the weights is 1 to obtain the sparse attention weight matrix , the calculation formula for each attention weight in the matrix is:
[0163] ;
[0164] in, For An exponential function with base ; It is query and The score between the keys; It is query and Attention weights between keys; For the query and The score between the keys.
[0165] Step 2.2.3, then, through the sparse attention weight matrix Pair Matrix Perform weighted summation to generate context vector The context vector represents the sequence relationship filtered out based on sparse attention weights:
[0166] ;
[0167] Step 2.2.4: For the multi-head attention mechanism, different attention heads independently extract different patterns in the sequence. Perform stitching operations and output the projection matrix Get the output of the attention module :
[0168] ;
[0169] in, For splicing operation; For the The context vector of each attention head;
[0170] Step 2.2.5: Output of the attention module Perform Dropout operation and embedding features Perform residual connection and first layer normalization operations to obtain the first embedding feature :
[0171] ;
[0172] in, is the layer normalization operation; Dropout is a commonly used regularization technique for deep learning. Its core idea is to randomly discard some neurons during the training process to prevent overfitting of the model and improve the generalization ability and stability of the model.
[0173] right Perform the first convolution, activation function, and Dropout operation in sequence, then perform the second convolution and another Dropout operation to obtain the second embedding feature ;
[0174] right and Perform residual connection and second layer normalization operation to obtain the output of the encoder layer :
[0175] ;
[0176] Multiple encoder layers can be stacked as needed, Treat Enter step 2.2.1 again until you get the final output of the encoder part . At this point, the encoder part of the model is completed.
[0177] Step 3. Construct a diffusion model (a diffusion model is a generative model based on a probabilistic diffusion process). The basic process architecture gradually adds noise to the reservoir geological attribute data, allowing complex geological parameters to be randomly perturbed at each stage of diffusion, gradually transforming from the original distribution to a standard Gaussian distribution, providing more usable information for the subsequent inversion process. The diffusion model basic process architecture includes two parts: forward diffusion and reverse denoising. The forward diffusion process gradually adds noise to the reservoir multidimensional geological attribute data to generate random Gaussian noise. The reverse denoising process uses a denoising network to gradually reverse the denoising process and restore the original reservoir multidimensional geological attribute data. The specific process is as follows:
[0178] Step 3.1: Normalized reservoir geological attribute data sample set Perform standardization and dimensionality reduction processing; the specific process is:
[0179] Step 3.1.1: In order to make the data have zero mean and unit variance, the normalized production dynamic data sample set is further To perform standardization:
[0180] ;
[0181] in, Represents the standardized data; is the normalized data; is the mean of the normalized data; is the standard deviation; the calculation formulas for the mean and standard deviation are:
[0182] ;
[0183] ;
[0184] in, is the total number of sample groups; The first The data values of the group sample;
[0185] Step 3.1.2: Use the principal component analysis (PCA) method to reduce the dimension of the standardized data. The specific process is as follows:
[0186] First, calculate the covariance matrix of the standardized data:
[0187] ;
[0188] in, is the covariance matrix; The first The data values of the group sample; is the mean vector of each feature in the standardized data; is the transpose symbol;
[0189] Then, perform eigenvalue decomposition on the covariance matrix to obtain the eigenvalues and the corresponding eigenvector ,in, For the eigenvalues Corresponding eigenvectors; the total number of eigenvalues or eigenvectors and the permeability characteristic dimension Corresponding. Select the front according to the size of the eigenvalue The eigenvectors are selected as principal components. The matrix is the principal component matrix required for dimensionality reduction. Projecting into the principal component subspace, we get the reduced dimensionality data set :
[0190] ;
[0191] in, is a standardized data set; in this way, the dimension of the model input data is changed from the original dimension Reduced to , while retaining the main information of the data, which is conducive to accelerating the convergence of the model.
[0192] Step 3.2: Gradually add noise to the reservoir geological attribute data after PCA dimension reduction so that the complex geological parameters can be randomly disturbed at each stage of forward diffusion. Use the cosine scheduling function to generate the noise coefficient. The specific formula is as follows:
[0193] ;
[0194] in, is the time step The noise coefficient controls the amount of noise injected into the data at each time step; . It is designed to be small in the initial stage and gradually increase towards the end of training, ensuring that the model retains more original data features in the early stages; more noise is gradually added in the later stages to make the model more stable and convergent during the training process. The reservoir geological attribute data after adding noise at each time step is defined as:
[0195] ;
[0196] ;
[0197] in, 、 The time steps are , time step Reservoir geological attribute data after adding noise; is the time step retention rate; is the time step noise, and . It represents a multidimensional normal distribution with a mean of 0 and a variance of 1, also called a standard normal distribution;
[0198] Using mathematical induction, it can be extended to any step; using the known initial reservoir geological attribute data, the time step can be deduced at one time The specific formula for reservoir geological attribute data after adding noise is as follows:
[0199] ;
[0200] ;
[0201] in, is the initial reservoir geological attribute data; From time step 1 to time step The cumulative retention rate from time step 1 to time step The product of the retained information across all time steps; is noise, . is the time step retention rate;
[0202] Step 3.3: In the reverse denoising process, from the time step Generate time steps in reverse The abstract expression formula of the reservoir geological attribute data is:
[0203] ;
[0204] in, For a given generate The conditional probability distribution of this distribution is determined by the training parameters of the model to decide; is a multidimensional normal distribution, express The probability distribution of The model predicts The mean of The model predicts The covariance matrix of .
[0205] It can be expressed as a weighted sum of two parts:
[0206] ;
[0207] in, is the noise in the model prediction.
[0208] In the reverse process Corresponding to the forward process :
[0209] ;
[0210] in, From time step 1 to time step Cumulative retention rate;
[0211] Each step of the denoising process in the reverse process can be expressed as:
[0212] ;
[0213] The first part of the formula By removing noise from the current data, the data of the previous time step is restored, which is based on the mean prediction part; the second part of the formula , where the noise term , although the model passes Recover data from noise, but because the noise process is random, some random disturbances need to be introduced in the generation process. At this time, the noise term By playing this role, the model generates results that are not just the average of the predictions, but also retain some uncertainty and diversity. At this point, the basic process architecture of the diffusion model has been completed.
[0214] Step 4. Construct a denoising network based on Unet, and combine it with the high-dimensional feature vector of the long-term production data of the reservoir to accurately predict the noise component in each time step; encapsulate the time series feature extraction model based on Informer, the basic process architecture of the diffusion model and the denoising network to obtain an inversion prediction model that can realize end-to-end dynamic modeling of the reservoir. The denoising network combines the final output of the Informer model in step 2 to accurately predict the noise component in each time step, thereby supporting the inverse process of the diffusion model. The denoising network adopts the U-shaped network structure Unet in deep learning. Unet includes an encoder part and a decoder part; Unet optimizes the transmission of information through its unique symmetry and jump connection, and efficiently and accurately restores the details and quality of the data during the noise reduction process; the specific process is as follows:
[0215] Step 4.1: Time step for forward diffusion Reservoir geological attribute data after adding noise Perform convolution operations to extract preliminary features and generate feature representations in the latent space :
[0216] ;
[0217] in, is the convolution kernel; is the activation function; is the bias term of the convolution operation.
[0218] right Time step Using sinusoidal position encoding, followed by two linear layers and activation functions, the time steps are mapped to Representation of the same dimension .Will and Add them together to get the token that guides the model generation. A token is the smallest text unit generated or processed by the model.
[0219] Step 4.2, The token is fed into the encoder portion of the Unet. The encoder consists of multiple layers of encoding modules with the same structure. Each layer of encoding modules contains two residual blocks, a multi-head spatial attention mechanism, and a downsampling algorithm. The residual blocks ensure that information can flow effectively within the network, preventing the vanishing gradient problem. The multi-head spatial attention mechanism enables the model to capture both local and global features in the spatial domain and fuse tokens. Downsampling reduces the resolution of the feature map until the final low-resolution feature map is obtained. The specific formula is:
[0220] Two residual blocks:
[0221] ;
[0222] ;
[0223] in, 、 are the features output by the first residual block and the second residual block respectively; is convolution;
[0224] Multi-head spatial attention mechanism fusion And token for feature extraction, when extracting features, first use two-dimensional convolution output The query matrix , key matrix , value matrix , then input the token into two linear layers respectively to obtain the key matrix of the token Sum Matrix .Will and Splicing, and Splicing to obtain a new bond matrix , new value matrix .right 、 、 Execute the following formula:
[0225] ;
[0226] ;
[0227] in, is the softmax function; is the normalized attention weight matrix; is the output of a single attention head; For the The output of an attention head; The output is the concatenation of multiple attention results; is the dimension of the new bond matrix;
[0228] right Downsampling is performed to reduce the resolution of the feature map:
[0229] ;
[0230] in, is the feature after downsampling; is down-sampled. After that, input the next layer of encoding module and repeat the process of step 4.2 until the last layer of encoding module is calculated. The output of the last layer of encoding module is the final low-resolution feature map .
[0231] Step 4.3, after downsampling in the encoder part, The decoder is fed into the UNet, which is responsible for gradually restoring the feature resolution. The decoder contains multiple layers of decoding modules with the same structure, and the number of decoding modules is the same as that of encoding modules. Each decoding module consists of a skip connection, two residual blocks, a multi-head spatial attention mechanism, and an upsampling mechanism. The specific process is as follows:
[0232] The skip connection will be symmetrical with the encoder of the current decoder Spliced to the output of the previous decoder (If it is the first layer decoder, it is spliced to Thus, the spliced features are obtained.
[0233] The concatenated features and tokens are input into the multi-head spatial attention module. The specific operation is consistent with the multi-head spatial attention module of the encoder, and the output of multiple attention heads is obtained. ;Will Input the upsampling layer and get the output of the current layer decoder :
[0234] ;
[0235] in, is upsampling;
[0236] After calculations by multiple layers of decoding modules, the final output of the decoder is obtained ;
[0237] Deconvolution is performed on the final output of the decoder to restore the noise-free output with the same dimension as the input data. :
[0238] ;
[0239] in, is the deconvolution operation.
[0240] At this point, the denoising network is completed.
[0241] Step 4.4: Connect the time series feature extraction model in step 2, the diffusion model basic process architecture in step 3, and the denoising network in sequence to encapsulate a complete diffusion model. The encapsulated complete diffusion model is the inversion prediction model.
[0242] Step 5: Combine the inversion prediction model with the data space inversion method to achieve end-to-end dynamic modeling of the reservoir;
[0243] In reservoir modeling and prediction, actual field observation production data is often affected by various noise sources and is subject to time constraints. For noisy observation production data, the data space inversion method is used to convert the noisy observation production data into the posterior distribution of model parameters. The data space inversion method combines the observed production data with the prior model to remove the noise of the observed production data and generates multiple future flow prediction data from the posterior distribution. This prediction data is used as the input of the inversion prediction model in step 4.4 to achieve dynamic adjustment of the real reservoir model. The data space inversion method can estimate more accurate model parameters and predict future flow from these noisy observation production data; the specific process is as follows:
[0244] Step 5.1. Load the prior data and combine the production data at each time step for each well to form a complete production data vector. ,in, is in the time step Production data at the time, is the total number of time steps. The collected production data is divided into oil production data and water production data. Find the transition moment of the production well, that is, the time when water production begins. Based on the found time steps, calculate the corresponding transition moment:
[0245] ;
[0246] in, Well With the prior model The moment of transformation; represents the index of the well, represents the index of the prior model, Represents the index of the time step; is the time interval.
[0247] Use a nonlinear mapping to transform the original time into a new time series:
[0248] ;
[0249] in, For the new time series; is the current time; is the initial time; It is the final time; is the time index; It's a moment of transformation.
[0250] Interpolate the remapped time points to smooth the production data and obtain a continuous data representation. Use B-spline interpolation to interpolate the data, and the interpolated data is used for subsequent analysis. First, generate a B-spline representation, and then use the generated B-spline representation to interpolate the new time points to obtain the interpolated production data:
[0251] ;
[0252] in, is the interpolated production data; is the target point that needs to be interpolated; is a function that generates a B-spline representation; Is the function for interpolation calculation; is the original time point; It is the original production data; is the order of the spline curve. After the interpolation is completed, a new complete production data vector is formed. .
[0253] Step 5.2: Use PCA to reparameterize the data to make it closer to Gaussian distribution. Calculate the mean of all mapped data as prior data. , and construct the centralized matrix :
[0254] ;
[0255] ;
[0256] in, is the total number of prior data; 、 Respectively Article, Prior data: production data of all wells at all time steps;
[0257] Next, we need to Perform singular value decomposition and select The eigenvectors corresponding to the singular values constitute the basis matrix , through the variable after dimension reduction Represents the mapped data:
[0258] ;
[0259] ;
[0260] ;
[0261] in, is the left singular matrix of the singular value decomposition; is a diagonal matrix containing singular values; is a right singular matrix; Represents a left singular matrix Before the selection singular values; Represents a diagonal matrix Before the selection singular values; The data are reparameterized using principal component analysis;
[0262] Step 5.3: Obtain the production data prediction results based on Bayesian inversion. In Bayesian inversion, it is assumed that the observed production data has errors. Such errors are generally assumed to be zero-mean Gaussian noise, and its covariance matrix is expressed as Observed production data and The relationship between express:
[0263] ;
[0264] in, is the conditional probability density function; is a selection matrix for Extracted from The corresponding part. The covariance matrix describes the size and relationship of the observation errors.
[0265] In the Bayesian framework, the posterior probability density function is constructed by combining the prior information and the likelihood function of the observed production data. Here, the posterior probability of the complete data is estimated given the observed production data. It is expressed as the product of the prior probability and the conditional probability density function:
[0266] ;
[0267] in, is the posterior probability;
[0268] For the prior probability , which is the prior data Gaussian distribution of:
[0269] ;
[0270] in; is the prior probability; is the covariance matrix of the prior probability;
[0271] Combining the prior probability and the conditional probability density function, we can get the posterior probability density function of the complete data.
[0272] In order to find the complete data vector that best matches the observed production data, the maximum a posteriori estimation is usually achieved by minimizing the objective function. The specific form of the objective function is:
[0273] ;
[0274] in, is the objective function; Represents the functional relationship of mapping the reduced-dimensional variables back to the original data space; is the observed production data. The first term of the objective function is Indicates the degree of mismatch between observed production data and simulated data. To add weight, it reflects the weight of each observation production data error; the second represents the prior regularization constraint, assuming the dimension reduction variable It is a standard normal distribution, which ensures the rationality and stability of the solution. The core of the objective function construction is to balance the fitting of the observed production data and the constraints of prior knowledge. By minimizing the objective function, the optimal dimension reduction variable can be obtained. , and then obtain the optimal production data prediction results.
[0275] To quantify the uncertainty of reservoir production prediction, the random maximum likelihood (RML) method is used to generate multiple posterior samples. The basic idea of RML is to perform multiple random perturbations on the observed production data and minimize the objective function for the data after each perturbation, thereby generating multiple posterior samples that meet the observation conditions. Specifically, the observed production data after perturbation can be expressed as:
[0276] ;
[0277] in, Producing data for observations after perturbation; is a random number from a standard normal distribution; is the noise level.
[0278] Generate the perturbed principal component vector by adding Gaussian noise , the formula is as follows:
[0279] ;
[0280] By optimizing the algorithm, combining the disturbance observation production data and the disturbance principal component, the optimal dimension reduction variable is obtained. The formula is as follows:
[0281] ;
[0282] in, is the principal component matrix; is the identity matrix; is the prior data.
[0283] After obtaining the optimal dimension reduction variable After that, it needs to be mapped back to the original data space to obtain the complete production data prediction results. The mapping process can be expressed as:
[0284] ;
[0285] in, is the complete production data vector after mapping; It is the inverse operation of the mapping, which is used to convert the reduced-dimensional variables back into the complete data representation. Through this mapping, a complete production data prediction result that is consistent with the observed production data can be obtained.
[0286] By repeatedly perturbing the observed production data and minimizing the objective function, multiple posterior samples are generated, each of which is a possible prediction result of the production data.
[0287] Step 5.4: Input these production data prediction results into the inversion prediction model packaged in step 4 to achieve dynamic end-to-end reservoir modeling.
[0288] In order to demonstrate the feasibility and superiority of the present invention, the following examples are given.
[0289] This example validates the proposed method and conducts subsequent analysis and discussion. End-to-end dynamic modeling is then performed according to the following steps. This example uses a three-dimensional, real reservoir model with nine layers. The parameters required for history matching include the x-direction permeability field, z-direction permeability, porosity, and net thickness ratio for each grid, totaling 240,192 parameters. The production dynamic data required for history matching in the reservoir model include the pressures of 20 production wells, the pressures of 10 water injection wells, and the oil and water production of the 20 production wells. Figure 2-Figure 5 The porosity, x-direction permeability field, z-direction permeability, and net thickness ratio of the real reservoir model are displayed in turn.
[0290] First, a sample data set is established; the porosity, permeability field, net thickness ratio samples and corresponding oil and water well production dynamic data in the sample data set are constructed into 1,000 samples according to the process of step 1 and normalized. Then, according to the process of step 2, a time series feature extraction model is constructed based on the Informer model, and then the normalized reservoir geological attribute data is used as input to train the model, and the training of the feature extraction model is completed by reconstructing feature observations. Then, according to the process of step 3, the basic process architecture of the diffusion model is constructed, and the geological attribute data of the reservoir is gradually denoised so that the complex geological parameters can be randomly disturbed at each stage of diffusion. After 256 time steps, the geological attribute data is gradually transformed from the original distribution to a standard Gaussian distribution. According to the process of step 4, the Unet module is used to construct a denoising network, and the high-dimensional feature vector of the long-term production data of the reservoir obtained by the time series feature extraction model in step 2 is combined to accurately predict the noise component in each time step. Then, based on this, the denoising process is reversed to restore the original geological data. The distribution map of the reservoir geological data obtained by the inversion of the production data is shown as follows. Figure 6-Figure 9 As shown, Figure 6 is the reservoir porosity predicted by the inversion prediction model, Figure 7 is the reservoir x-direction permeability field predicted by the inversion prediction model, Figure 8 is the reservoir z-direction permeability field predicted by the inversion prediction model, Figure 9 This is the net thickness ratio of the reservoir predicted by the inversion prediction model. Figure 2-Figure 9 It can be seen that the spatial distribution pattern and numerical range of the reservoir predicted by the inversion prediction model are highly consistent with the real reservoir model.
[0291] The geological attribute data is numerically simulated using a reservoir numerical simulator to obtain the oil and water well production dynamic data corresponding to the reservoir predicted by the inversion prediction model, and the inverted data is compared with the real data. The comparison results are as follows: Figure 10-13 As shown; Figure 10The comparison of the production well pressure data of the real oil reservoir and the production well pressure data of the oil reservoir predicted by the inversion prediction model is shown. Figure 11 The comparison of the water injection well pressure data of the real oil reservoir and the water injection well pressure data of the oil reservoir predicted by the inversion prediction model is shown; Figure 12 The comparison of the production data of the real oil reservoir and the production data of the oil reservoir predicted by the inversion prediction model is shown. Figure 13 The comparison of the water production data of the production wells in the real oil reservoir and the water production data of the production wells in the oil reservoir predicted by the inversion prediction model is shown. Figure 10-13 It can be seen that the production curve of the oil reservoir predicted by the inversion prediction model is close to the production curve of the real oil reservoir, which proves the effectiveness of the method of the present invention under complex three-dimensional geological conditions.
[0292] Since the actual reservoir observation production data has noise and time limitations, the data space inversion technology is used to estimate more accurate observation production data from the noisy observation production data and predict future flow. It is used as the input of the inversion prediction model to obtain the multi-dimensional geological attribute data of the reservoir model corresponding to the observation production data. The reservoir numerical simulator is used to perform numerical simulation calculations on the geological attribute data to obtain the oil and water well production dynamic data corresponding to the model. The production data is compared with the actual reservoir production data. At the same time, the inversion prediction model is used to predict the production data curve of the reservoir, as shown in the following example. Figure 14 As shown. Figure 14 It can be seen that the method of the present invention can effectively deal with the noise and time limitations of observed production data, estimate accurate reservoir model parameters and predict future flow.
[0293] Of course, the above description is not a limitation of the present invention, and the present invention is not limited to the above examples. Changes, modifications, additions or substitutions made by technicians in this technical field within the essential scope of the present invention should also fall within the scope of protection of the present invention.
Claims
1. A method for end-to-end dynamic modeling of oil reservoirs based on a diffusion model, characterized in that: The steps include: Step 1: Obtain reservoir geological attribute data and oil and water well production dynamic data, establish a sample data set, and perform normalization processing; Step 2: Based on the Informer model, a time series feature extraction model is constructed to extract the long-term production data features of the reservoir and convert them into high-dimensional feature vectors. The model is then trained using the normalized sample data set. Step 3: Construct the basic process framework of the diffusion model to gradually add noise to the reservoir geological attribute data; Step 4: Build a denoising network based on Unet, encapsulate the Informer-based time series feature extraction model, the diffusion model basic process architecture, and the denoising network to obtain an inversion prediction model that implements end-to-end dynamic modeling of the reservoir; The denoising network uses the U-shaped network structure Unet in deep learning. Unet includes an encoder part and a decoder part. The specific process of step 4 is as follows: Step 4.1, Perform convolution operations to extract preliminary features and generate feature representations in the latent space : ; in, is the convolution kernel; is the activation function; is the bias term of the convolution operation; right Time step Using sinusoidal position encoding, followed by two linear layers and activation functions, the time steps are mapped to Representation of the same dimension ;Will and Add them together to get the token that guides the model generation. A token is the smallest unit of text generated or processed by the model. Step 4.2, The encoder part of the Unet is input with tokens. The encoder part consists of multiple layers of encoding modules with the same structure. Each layer of encoding modules contains two residual blocks, a multi-head spatial attention mechanism, and a downsampling. The specific formula is: Two residual blocks: ; ; in, 、 are the features output by the first residual block and the second residual block respectively; is convolution; Multi-head spatial attention mechanism fusion And token feature extraction, when extracting features, first use two-dimensional convolution to get The query matrix , key matrix , value matrix , then input the token into two linear layers respectively to obtain the key matrix of the token Sum Matrix ;Will and Splicing to obtain a new bond matrix ,Will and Splicing to obtain a new value matrix ;right 、 、 Execute the following formula: ; ; in, is the softmax function; is the output of a single attention head; For the The output of an attention head; The output is the concatenation of multiple attention results; is the dimension of the new bond matrix; right Downsampling: ; in, is the feature after downsampling; is down-sampling; get After that, input the next layer of encoding module and repeat the process of step 4.2 until the last layer of encoding module is calculated. The output of the last layer of encoding module is the final low-resolution feature map ; Step 4.3, after downsampling in the encoder part, The decoder is fed into the UNet. The decoder contains multiple layers of decoding modules with the same structure, and the number of decoding modules is the same as that of encoding modules. Each decoding module consists of a skip connection, two residual blocks, a multi-head spatial attention mechanism, and an upsampling mechanism. The specific process is as follows: The skip connection will be symmetrical with the encoder of the current decoder Spliced to the output of the previous decoder On the top, get the spliced features; The concatenated features and tokens are input into the multi-head spatial attention module. The specific operation is consistent with the multi-head spatial attention module of the encoder, and the output of multiple attention heads is obtained. ;Will Input the upsampling layer and get the output of the current layer decoder : ; in, is upsampling; After calculations by multiple layers of decoding modules, the final output of the decoder is obtained ; Deconvolution is performed on the final output of the decoder to restore the noise-free output with the same dimension as the input data. : ; in, This is the deconvolution operation; at this point, the denoising network is constructed; Step 4.4: Connect the time series feature extraction model in step 2, the diffusion model basic process architecture in step 3, and the denoising network in sequence to encapsulate a complete diffusion model. The encapsulated complete diffusion model is the inversion prediction model. Step 5: Combine the inversion prediction model with the data space inversion method to achieve end-to-end dynamic modeling of the reservoir.
2. The end-to-end dynamic modeling method for oil reservoirs based on a diffusion model according to claim 1, characterized in that: The specific process of step 1 is: Step 1.1: Obtain reservoir geological attribute data, including seismic, well logging, and core data; Step 1.2: Based on the reservoir geological attribute data, a stochastic geological modeling method is used to construct multiple geological models, which are the prior models. Then, a reservoir numerical simulator is used to perform numerical simulation calculations on all the prior models, and the oil and water well production performance data corresponding to each prior model is obtained. The prior models and their corresponding oil and water well production performance data are constructed into a sample data set. Step 1.3, normalize the oil and water well production dynamic data and reservoir geological attribute data in the sample data set; Organize the oil and water well production dynamic data in the sample data set into a production dynamic data sample set , organize the reservoir geological attribute data in the sample data set into a reservoir geological attribute sample set ; To produce the first group sample; is the first in the reservoir geological attribute sample set group sample; The normalization method uses the following formula: ; in, is the normalized data value; It is the first sample in the production dynamic data sample set or reservoir geological attribute sample set. group sample; is the minimum value in the original data; is the maximum value in the original data; The normalized production dynamic data sample set is ; The normalized reservoir geological attribute data sample set is .
3. The end-to-end dynamic modeling method for oil reservoirs based on a diffusion model according to claim 2, characterized in that: In step 2, the constructed time series feature extraction model includes a data embedding layer and an encoder part; the specific working process of the time series feature extraction model is as follows: Step 2.1: Input the normalized production dynamic data sample set into the data embedding layer, perform data embedding, and obtain embedding features; The specific process is: Step 2.1.1: Normalize the production dynamic data sample set As the input sample set, is the time step, is the feature dimension; use a one-dimensional convolution layer to transform the input sample set, converting the original data from the feature dimension Mapping to high-dimensional space, we get the output feature set: ; in, Output feature sets for production dynamic data; is a one-dimensional convolutional layer; is the dimension of the high-dimensional space; Step 2.1.2: Construct the position code. The position code is generated by a predefined function. The formula is as follows: For even dimensions: ; For odd dimensions: ; in, is location information; Indicates the current word; is the encoding dimension index; Step 2.1.3: Output the feature set of the production dynamic data extracted by the one-dimensional convolution layer Add element-by-element to the position information of the corresponding time step to obtain the embedded feature: ; in, is the embedded feature; Step 2.2: Construct the encoder part to process the embedded features. The encoder part contains multiple encoder layers.
4. The end-to-end dynamic modeling method for oil reservoirs based on a diffusion model according to claim 3, characterized in that: The specific process of step 2.2 is as follows: Step 2.2.1, embed features Projected into the probabilistic sparse attention module, the linear transformation Mapped into query matrix , key matrix Sum Matrix ; Calculate the similarity between randomly selected queries and randomly selected keys to obtain a sparse query-key similarity matrix, select the first few queries with high similarity to the key match, and obtain a sparse attention score matrix : ; in, is a randomly selected query; is a randomly selected key; is the transpose symbol; Step 2.2.
2. Apply the softmax function to the sparse attention score matrix to convert the score into a weight, and then weight the matching degree between each query and all keys to obtain the sparse attention weight matrix , the calculation formula for each attention weight in the matrix is: ; in, For An exponential function with base ; It is query and The score between the keys; It is query and Attention weights between keys; For the query and The score between the keys; Step 2.2.3, through the sparse attention weight matrix Pair Matrix Perform weighted summation to generate context vector : ; Step 2.2.4: For the multi-head attention mechanism, the context vector of each attention head is Perform stitching operations and output the projection matrix Get the output of the attention module : ; in, For splicing operation; For the The context vector of each attention head; Step 2.2.5: Output of the attention module Perform Dropout operation and embedding features Perform residual connection and first layer normalization operations to obtain the first embedding feature : ; in, is the layer normalization operation; Dropout operation; right Perform the first convolution, activation function, and Dropout operation in sequence, then perform the second convolution and another Dropout operation to obtain the second embedding feature ; right and Perform residual connection and second layer normalization operation to obtain the output of the encoder layer : ; Overlay multiple encoder layers, Treat Enter step 2.2.1 again until you get the final output of the encoder part .
5. The end-to-end dynamic modeling method for oil reservoirs based on a diffusion model according to claim 4, characterized in that: The specific process of step 3 is: Step 3.1: Normalized reservoir geological attribute data sample set Perform standardization and dimensionality reduction; The formula for standardization is: ; in, Represents the standardized data; is the mean of the normalized data; is the standard deviation; The principal component analysis method is used to reduce the dimension of the standardized data; the specific process is as follows: First, calculate the covariance matrix of the standardized data: ; in, is the covariance matrix; The first The data values of the group sample; is the mean vector of each feature in the standardized data; is the total number of sample groups; Then, perform eigenvalue decomposition on the covariance matrix to obtain the eigenvalues and the corresponding eigenvector ,in, For the eigenvalues Corresponding eigenvectors; the total number of eigenvalues or eigenvectors and the permeability characteristic dimension Corresponding; select the front according to the size of the eigenvalue eigenvectors as principal components; the selected eigenvectors The matrix It is the principal component matrix required for dimensionality reduction; project the standardized data into the principal component subspace to obtain the data set after dimensionality reduction : ; in, is the standardized data set; Step 3.2: gradually add noise to the reservoir geological attribute data after dimensionality reduction, specifically using the cosine scheduling function to generate the noise coefficient; Step 3.3: In the reverse denoising process, from the time step Generate time steps in reverse Reservoir geological attribute data.
6. The end-to-end dynamic modeling method for oil reservoirs based on a diffusion model according to claim 5, characterized in that: In step 3.2, the noise coefficient is calculated as follows: ; in, is the time step Noise figure; The reservoir geological attribute data after adding noise at each time step is defined as: ; ; in, 、 The time steps are , time step Reservoir geological attribute data after adding noise; is the time step retention rate; is the time step noise; Using known initial reservoir geological attribute data, the time step is derived in one go The specific formula for reservoir geological attribute data after adding noise is as follows: ; ; in, is the initial reservoir geological attribute data; From time step 1 to time step Cumulative retention rate; For noise; is the time step retention rate; The formula of step 3.3 is: ; ; ; in, For a given generate The conditional probability distribution of this distribution is determined by the training parameters of the model to decide; is a multidimensional normal distribution; The model predicts The mean of The model predicts The covariance matrix of is the noise in the model prediction; From time step 1 to time step Cumulative retention rate; Each step of the denoising process in the reverse process is expressed as: 。 7. The end-to-end dynamic reservoir modeling method based on the diffusion model according to claim 6 is characterized in that: In step 5, for the observed production data containing noise, the data space inversion method combines the observed production data and the prior model to remove the noise of the observed production data, and generates multiple future flow prediction data from the posterior distribution. The predicted data is used as the input of the inversion prediction model in step 4.4 to realize dynamic adjustment of the real reservoir model.
Citation Information
Patent Citations
Historical fitting method based on deep autoregression network and continuous learning strategy
CN115935834A
Thermodynamic artificial intelligence for generative diffusion models and bayesian deep learning
WO2024118915A1