Oil reservoir end-to-end dynamic modeling method based on diffusion model

Through the end-to-end dynamic modeling method of reservoir based on diffusion model, the reservoir model construction, parameter adjustment and historical fitting process are integrated, and the problems of time-consuming and non-convex optimization of reservoir historical fitting are solved, achieving efficient and accurate reservoir dynamic modeling and real-time dynamic adjustment.

CN120197518AActive Publication Date: 2025-06-24QINGDAO UNIV OF TECH

Patent Information

Application Number
CN202510677755.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-26
Publication Date
2025-06-24
Estimated Expiration
2045-05-26

AI Technical Summary

Technical Problem

The prior art iteration takes a long time to solve the non-convex optimization problem in the historical fit of reservoirs, and it is difficult to effectively solve the problem of non-convex optimization, easily fall into the local optimal solution, and GANs are difficult to converge during training and are difficult to update dynamically.

Method used

The end-to-end dynamic modeling method of reservoirs based on diffusion model is adopted to integrate reservoir model construction, parameter adjustment and historical fitting processes into an end-to-end automated process. The production data characteristics are extracted using the Informer module, and the posterior distribution is inferred in combination with the Bayesian method to generate prediction data for future flows.

Benefits of technology

It significantly reduces artificial intervention, improves work efficiency, improves the accuracy of reservoir models, and can dynamically adjust the reservoir model to reflect the dynamic changes of reservoirs in real time.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120197518A_ABST
    Figure CN120197518A_ABST
Patent Text Reader

Abstract

The invention discloses an oil reservoir end-to-end dynamic modeling method based on a diffusion model, which belongs to the field of petroleum engineering and comprises the following steps: establishing a sample data set; constructing a time sequence feature extraction model based on an Informer model; constructing a basic process architecture of the diffusion model; constructing a de-noising network based on Unet, and packaging the time sequence feature extraction model based on Informer, the basic process architecture of the diffusion model and the de-noising network to obtain an inversion prediction model capable of realizing end-to-end dynamic modeling of the oil reservoir; for observation production data containing noise, a data space inversion method is used for generating multiple pieces of prediction data of future flow, the prediction data serve as input of an inversion prediction model, and dynamic adjustment of a real oil reservoir model is achieved. According to the invention, the matching capability of the oil reservoir model to actual development dynamics can be obviously improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of petroleum engineering, and particularly relates to an end-to-end dynamic reservoir modeling method based on a diffusion model. Background Art

[0002] In the field of petroleum engineering, history matching, as a key technical link in reservoir numerical simulation, essentially involves dynamically adjusting reservoir model parameters to achieve the best match between the numerical simulation results and the actual production data of the oilfield. History matching can essentially be regarded as an optimization process, with the goal of minimizing the differences between reservoir model parameters and existing geological understanding, as well as between simulated data and observed data. Due to the high dimensionality of reservoir model parameters and the strong non-linearity of numerical simulation, the history matching optimization problem is a type of high-dimensional and strongly non-convex optimization problem. The currently mainstream method in the industry is the Ensemble Smoother Multiple Data Assimilation (ESMDA) method. This method applies Gaussian-type random perturbations to ensemble members during each data assimilation process and combines the Kalman gain matrix to correct model parameters. Compared with traditional optimization algorithms, the ESMDA method has a more stable iterative process, and the optimization results are easier to quantify uncertainty. However, the numerical simulator still needs to be called multiple times during the solution process, resulting in a relatively long overall fitting time.

[0003] To solve the problem of long iterative time in history matching, researchers have constructed data-driven surrogate models based on deep learning algorithms to replace traditional numerical simulators. Compared with the iterative solution of traditional numerical simulators based on physical equations, surrogate models have the characteristic of feed-forward calculation, which can compress the single simulation time from hours to seconds while maintaining a prediction accuracy of over 90%. This paradigm shift has significantly improved the efficiency of history matching, especially showing significant advantages in the history matching of large-scale oilfields.

[0004] The history matching framework based on surrogate models still needs to call optimization algorithms for solution and cannot solve the problem that non-convex optimization problems are prone to falling into local optimal solutions. In recent years, based on generative network models, researchers have proposed an end-to-end history matching method that uses production data as control conditions to directly generate corresponding reservoir models. This method simplifies the traditional fitting process, integrates production data and reservoir model parameter adjustment into a unified framework for processing, and reduces the steps of human intervention. The most representative one 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, making the generated reservoir model gradually approach the dynamic behavior of the real reservoir.

[0005] The introduction of GAN realizes the end-to-end fitting of directly generating a reservoir model from production data, avoiding the complex parameter adjustment process. However, it is difficult for its generator and discriminator to converge simultaneously during the training process, resulting in great training difficulty. In addition, GAN is also difficult to dynamically update according to the latest production data and cannot reflect the dynamic changes of the reservoir in real time, which limits its application effect in actual production. Summary of the Invention

[0006] To solve the above problems, the present invention proposes an end-to-end dynamic modeling method for reservoirs based on a diffusion model. Using the diffusion model (Diffusion Model), it integrates the reservoir model construction, parameter adjustment, and history fitting processes 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 various production data features as prompt words, solving the problems of long time span and complex features of production data and improving the accuracy of the reservoir model. In the data space, the Bayesian method is used to infer the posterior distribution under the condition of given observed production data, and multiple prediction data of future flows are generated from the posterior distribution, solving the problem of dynamically adjusting the real reservoir model according to the latest production data in the reservoir.

[0007] The technical solution of the present invention is as follows: An end-to-end dynamic modeling method for reservoirs based on a diffusion model, comprising the following steps: Step 1, obtain reservoir geological attribute data and production dynamic data of oil wells and water wells, establish a sample data set, and perform normalization processing; Step 2, construct a time series feature extraction model based on the Informer model to extract the long-term production data features of the reservoir, convert them into high-dimensional feature vectors, and then train the model with the normalized sample data set; Step 3, construct the basic process architecture of the diffusion model to gradually add noise to the reservoir geological attribute data; Step 4, construct a denoising network based on Unet, encapsulate the time series feature extraction model based on Informer, the basic process architecture of the diffusion model, and this denoising network to obtain an inversion prediction model for realizing end-to-end dynamic modeling of the reservoir; Step 5, combine the inversion prediction model with the data space inversion method to realize end-to-end dynamic modeling of the reservoir.

[0008] Further, the specific process of step 1 is as follows: Step 1.1, obtain reservoir geological attribute data, including seismic, logging, and core data; Step 1.2: Use the stochastic geological modeling method to construct multiple geological models based on reservoir geological attribute data. The geological models are prior models. Then, use the reservoir numerical simulator to perform numerical simulation calculations on all prior models, obtain the production performance data of oil and water wells corresponding to each prior model, and construct a sample data set with the prior models and their corresponding production performance data of oil and water wells. Step 1.3: Normalize the production performance data of oil and water wells and the reservoir geological attribute data in the sample data set. Organize the production performance data of oil and water wells in the sample data set into a production performance data sample set and organize the reservoir geological attribute data in the sample data set into a reservoir geological attribute sample set. ; is the th group of samples in the production performance data sample set; is the th group of samples in the reservoir geological attribute sample set; The normalization method uses the following formula: ; where is the normalized data value; is the th group of samples in the production performance data sample set or the reservoir geological attribute sample set; is the minimum value in the original data; is the maximum value in the original data; The normalized production performance data sample set is ; The normalized reservoir geological attribute data sample set is .

[0009] Furthermore, in the above 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 performance data sample set into the data embedding layer to perform data embedding and obtain embedding features. The specific process is as follows: Step 2.1.1: Use the normalized production performance data sample set as the input sample set, where is the time step, is the feature dimension; Use a one-dimensional convolutional layer to transform the input sample set, map the original data from the feature dimension to a high-dimensional space, and obtain an output feature set: ; where For the production dynamic data output feature set; Is a one-dimensional convolutional layer; Is the dimension of the high-dimensional space; Step 2.1.2, Construct the positional encoding, which is generated by a predefined function. The formula is as follows: For even dimensions: ; For odd dimensions: ; Among them, Is the position information; Represents the current word; Is the encoding dimension index; Step 2.1.3, Add the production dynamic data output feature set Extracted by the one-dimensional convolutional layer element-wise with the position information of the corresponding time step to obtain the embedded feature: ; Among them, Is the embedded feature; Step 2.2, Construct the encoder part to process the embedded feature. The encoder part contains multiple encoder layers.

[0010] Furthermore, the specific process of the said Step 2.2 is as follows: Step 2.2.1, Project the embedded feature Into the probabilistic sparse attention module, and map Into the query matrix , the key matrix And the value matrix Through a linear transformation; Calculate the similarity between the randomly selected query and the randomly selected key to obtain a sparse query-key similarity matrix, and select the top few queries with high similarity to the key to obtain the sparse attention score matrix : ; Among them, Is the randomly selected query; Is the randomly selected key; Is the transpose symbol; Step 2.2.2, Apply the softmax function to the sparse attention score matrix to convert the scores into weights, and then weight the matching degree between each query and all keys to obtain the sparse attention weight matrix , and the calculation formula for each attention weight in the matrix is: ; Among them, Is an exponential function with base is the score between the -th query and the -th key; is the attention weight between the -th query and the -th key; is the score between the -th query and the -th key; Step 2.2.3, perform weighted summation on the value matrix through the sparse attention weight matrix to generate the context vector : ; Step 2.2.4, for the multi-head attention mechanism, concatenate the context vectors of each attention head, and obtain the output of the attention module through the output projection matrix : ; where is the concatenation operation; is the context vector of the -th attention head; Step 2.2.5, perform the Dropout operation on the output of the attention module, and perform the residual connection and the first layer normalization operation with the embedded feature to obtain the first embedded feature : ; where is the layer normalization operation; is the Dropout operation; Perform the first convolution, activation function, Dropout operation on in sequence, then perform the second convolution and another Dropout operation to obtain the second embedded feature ; Perform the residual connection and the second layer normalization operation on and to obtain the output of the encoder layer: ; Stack multiple encoder layers, that is, regard as and input it into Step 2.2.1 again until the final output of the encoder part is obtained 。

[0011] Further, the specific process of step 3 is as follows: Step 3.1. Perform standardization and dimensionality reduction on the normalized reservoir geological attribute data sample set ; The formula for standardization is: ; where represents the standardized data; is the mean of the normalized data; is the standard deviation; Use the principal component analysis method to perform dimensionality reduction on the standardized data; the specific process is as follows: First, calculate the covariance matrix of the standardized data: ; where is the covariance matrix; is the data value of the th group of samples in the standardized data; 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 eigenvalues and the corresponding eigenvectors , where is the th eigenvalue corresponding eigenvector; the total number of eigenvalues or eigenvectors corresponds to the permeability feature dimension ; select the first eigenvectors as the principal components according to the magnitude of the eigenvalues; the selected eigenvectors form a matrix which is the principal component matrix required for dimensionality reduction; project the standardized data into the principal component subspace to obtain the dimensionality-reduced data set : ; where is the standardized data set; Step 3.2. Gradually add noise to the dimensionality-reduced reservoir geological attribute data, specifically using a cosine scheduling function to generate a noise coefficient; Step 3.3. In the reverse denoising process, generate the reservoir geological attribute data at time step retroactively from time step .

[0012] Furthermore, in step 3.2, the noise coefficient is calculated as follows: ; in, is the time step The noise factor of 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 property 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 , which 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 denoising process in the reverse process is expressed as: 。

[0013] Furthermore, in step 4, the denoising network adopts the Unet structure in deep learning, and Unet includes an encoder part and a decoder part; the specific process of step 4 is as follows: Step 4.1, perform a convolution operation on to extract preliminary features and generate a feature representation in the latent space : ; Among them, is the convolution kernel; is the activation function; is the bias term of the convolution operation; Perform sine positional encoding on the time step of , and then pass it through two linear layers and an activation function to map the time step to a representation of the same dimension as ; Add to to obtain the token generated by the guidance model. A token refers to the smallest text unit generated or processed by the model; Step 4.2, input and the token into the encoder part of Unet; the encoder part consists of multiple encoding modules with the same structure. Each encoding module contains two residual blocks, a multi-head spatial attention mechanism, and a downsampling; the specific formula is: Two residual blocks: ; ; Among them, , are the features output by the first residual block and the second residual block respectively; is the convolution; The multi-head spatial attention mechanism fuses and the token for feature extraction. When extracting features, first use a two-dimensional convolution to obtain the query matrix , key matrix , value matrix of , and then input the token into two linear layers respectively to obtain the key matrix and value matrix of the token; Concatenate with to obtain a new key matrix , Add and concatenate to obtain a new value matrix ; For , , execute the following formula: ; ; where is the softmax function; is the output of a single attention head; is the output of the th attention head; is the output concatenated from the results of multiple attentions; is the dimension of the new key matrix; Downsample : ; where is the downsampled feature; is the downsampling; After obtaining , input it into the next layer encoding module, and repeat the process of step 4.2 until the last layer encoding module is calculated. The output of the last layer encoding module is the final low-resolution feature map ; Step 4.3, After the downsampling in the encoder part, is passed into the decoder part of UNet; The decoder contains multiple decoding modules with the same structure, and the number of decoding modules is the same as that of the encoding modules; Each decoding module consists of a skip connection, two residual blocks, a multi-head spatial attention mechanism, and an upsampling; The specific process is as follows: The skip connection concatenates the of the encoder symmetric to the current decoder to the output of the previous layer decoder to obtain the concatenated feature; Input the concatenated feature and the token into the multi-head spatial attention module. The specific operation is the same as that of the multi-head spatial attention module in the encoder to obtain the output concatenated from multiple attention heads; Input into the upsampling layer to obtain the output of the current layer decoder: ; where is the upsampling; After the calculation of multiple 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 of the same dimension as the input data. : ; in, This is a deconvolution operation; at this point, the denoising network is constructed; Step 4.4, connect the time series feature extraction model of step 2, the diffusion model basic process architecture of step 3 and the denoising network in sequence, and encapsulate a complete diffusion model. The encapsulated complete diffusion model is the inversion prediction model.

[0014] 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.

[0015] The beneficial technical effects brought by the present invention are as follows: The present invention is an end-to-end inversion method for reservoir dynamic attribute fields based on a 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 reservoir model construction, parameter adjustment and history fitting processes 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 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 the encapsulated diffusion model; finally, the noise of the observed production data is removed by combining the observed production data and the prior model with the help of the data space inversion method, and multiple predicted data of future flows 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 predicted data of future flows 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, and the geological attribute data can be well dynamically inverted to achieve an end-to-end automated process. The present invention is an efficient "one-step" generation method of geological parameters to reservoir attribute fields, which can significantly improve the matching ability of reservoir models to actual development dynamics. Description of the Drawings

[0016] Figure 1 It is the overall design flow chart of the reservoir end-to-end dynamic modeling method based on the diffusion model of the present invention.

[0017] Figure 2 It is the porosity distribution map of the real reservoir model in the embodiment of the present invention.

[0018] Figure 3 It is the x-direction permeability field distribution map of the real reservoir model in the embodiment of the present invention.

[0019] Figure 4 It is the z-direction permeability field distribution map of the real reservoir model in the embodiment of the present invention.

[0020] Figure 5 It is the net thickness ratio distribution map of the real reservoir model in the embodiment of the present invention.

[0021] Figure 6 It is the porosity distribution map of the reservoir predicted by the inversion prediction model from the production data in the embodiment of the present invention.

[0022] Figure 7 It is the x-direction permeability distribution map of the reservoir predicted by the inversion prediction model from the production data in the embodiment of the present invention.

[0023] Figure 8 It is the z-direction permeability distribution map of the reservoir predicted by the inversion prediction model from the production data in the embodiment of the present invention.

[0024] Figure 9 It is the net thickness ratio distribution map of the reservoir predicted by the inversion prediction model from the production data in the embodiment of the present invention.

[0025] Figure 10 It is the schematic diagram of the fitting situation of the pressure data of 20 production wells in the real reservoir and the reservoir predicted by the inversion prediction model in the embodiment of the present invention.

[0026] Figure 11 It is the schematic diagram of the fitting situation of the pressure data of 10 injection wells in the real reservoir and the reservoir predicted by the inversion prediction model in the embodiment of the present invention.

[0027] Figure 12 It is the schematic diagram of the fitting situation of the oil production data of 20 production wells in the real reservoir and the reservoir predicted by the inversion prediction model in the embodiment of the present invention.

[0028] Figure 13 It is the schematic diagram of the fitting situation of the water production data of 20 production wells in the real reservoir and the reservoir predicted by the inversion prediction model in the embodiment of the present invention.

[0029] Figure 14It is a schematic diagram of the fitting situation between the production data obtained by inverting the observed production data and the real reservoir production data in the embodiments of the present invention. Specific Embodiments

[0030] The present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments: 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 characteristics of the long-term production data of the reservoir and transform them into high-dimensional feature vectors; constructing the basic process architecture of the diffusion model, gradually adding noise to the multi-dimensional geological attribute data of the reservoir model to destroy the data, and then reversing this process through a trained denoising network; constructing a special Unet module, combining the high-dimensional feature vectors of the long-term production data of the reservoir, and accurately predicting the noise components at each time step; estimating more accurate data from the noisy observed production data through data space inversion technology, and using it as the model input to improve the adaptability and prediction accuracy of the model to field data. As Figure 1 shown, an end-to-end dynamic modeling method for reservoirs based on the diffusion model specifically includes the following steps: Step 1: Obtain the reservoir geological attribute data and the production dynamic data of oil wells and water wells, establish a sample data set, and perform normalization processing. The specific process is as follows: Step 1.1: Obtain the reservoir geological attribute data, including seismic, logging, and core data; the reservoir geological attribute data is important data describing the characteristics of the reservoir, and the logging data among them is obtained by measuring in the well to obtain various information about the reservoir, including porosity, permeability, lithology, fluid type, etc.; Step 1.2: Based on the reservoir geological attribute data, use the stochastic geological modeling method to construct multiple geological models, and the geological models are prior models; then, use the reservoir numerical simulator to perform numerical simulation calculations on all prior models, obtain the production dynamic data of oil wells and water wells corresponding to each prior model, and construct the prior models and their corresponding production dynamic data of oil wells and water wells into a sample data set; Step 1.3: Perform normalization processing on the production dynamic data of oil wells and water wells and the reservoir geological attribute data in the sample data set; Organize the production dynamic data of oil wells and water wells in the sample data set into a production dynamic data sample set and organize the reservoir geological attribute data in the sample data set into a reservoir geological attribute sample set ; is the th group of samples in the production dynamic data sample set; is the th group of samples in the reservoir geological attribute sample set; The normalization processing method uses the following formula: ; Among them, is the normalized data; is the th group of samples in the production dynamic data sample set or the reservoir geological attribute sample set; 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 .

[0031] 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 transform them into high-dimensional feature vectors, and then train the model with the normalized sample data set; The Informer model is a deep learning model specifically used for time series prediction.

[0032] The constructed time series feature extraction model includes a data embedding layer and an encoder part. The data embedding layer is used to extract the multi-dimensional features of the reservoir production data. First, a one-dimensional convolutional layer is used for feature convolution, then a positional encoding is constructed to represent the position information of each time step, and finally the two are added element-wise to obtain the embedded features. The encoder part consists of multiple encoder layers, and each encoder layer integrates an attention module, a residual connection, layer normalization, and a feed-forward neural network. Through layer-by-layer processing, the initial data features are gradually mapped into high-dimensional vector representations, so as to better capture the potential complex relationships and dynamic patterns in the time series data. 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 the embedded features; The specific process is as follows: Step 2.1.1: Use the normalized production dynamic data sample set as the input sample set, where is the time step, is the feature dimension. Use a one-dimensional convolutional layer to transform the input sample set, and the size of the convolutional kernel is set according to the task requirements to extract local features. Through the convolution operation, the original data is mapped from the feature dimension to a high-dimensional space, and the output feature set is obtained: ; Among them, is the production dynamic data output feature set; is the one-dimensional convolutional layer; is the dimension of the high-dimensional space; Step 2.1.2: Then construct positional encoding so that the model can handle positional information. The positional encoding is generated by predefined functions (such as sine and cosine functions), and the formula is as follows: For even dimensions ( ): ; For odd dimensions ( ): ; Where, is the positional information; represents the current word; is the encoding dimension index.

[0033] Step 2.1.3: Element-wise add the output feature set of the production dynamic data extracted by the one-dimensional convolutional layer with the positional information at the corresponding time step to obtain the embedded features: ; Where, is the embedded feature.

[0034] 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: Step 2.2.1: Project the embedded feature into the probabilistic sparse attention module. Through linear transformation, is mapped into a query matrix , a key matrix and a value matrix ; In the traditional fully-connected attention mechanism, each query is matched with all keys to calculate their similarity. In the probabilistic sparse attention module, instead of calculating the similarity between all queries and all keys, a sampling method is used to randomly select some query-key pairs for matching. Calculate the similarity between the queries and the randomly selected keys, and the result is a sparse query-key similarity matrix, which represents the similarity between each query and the selected partial keys. To further reduce the computational amount, only select the top few queries that match the keys most strongly (i.e., have the highest similarity). Based on these strongest queries, obtain the sparse attention score matrix : ; Where, is the randomly selected query; is the randomly selected key; is the transpose symbol; Step 2.2.2: Apply the softmax function to the sparse attention score matrix, which can convert the scores into weights. Then, weight the matching degree between each query and all keys, and the sum of the weights is 1, obtaining the sparse attention weight matrix , and the calculation formula for each attention weight in the matrix is: ; where is the exponential function with as the base; is the score between the th query and the th key; is the attention weight between the th query and the th key; is the score between the th query and the th key.

[0035] Step 2.2.3: Then, perform a weighted sum on the value matrix through the sparse attention weight matrix to generate the context vector . The context vector represents the sequence relationship filtered based on the sparse attention weights: ; Step 2.2.4: For the multi-head attention mechanism, different attention heads independently extract different patterns in the sequence. Concatenate the context vectors of each attention head, and obtain the output of the attention module through the output projection matrix : ; where is the concatenation operation; is the context vector of the th attention head; Step 2.2.5: Perform a Dropout operation on the output of the attention module, and perform a residual connection and the first layer normalization operation with the embedding feature to obtain the first embedding feature : ; where is the layer normalization operation; This is the Dropout operation. Dropout is a commonly used deep learning regularization technique. Its core idea is to randomly discard a part of neurons during training to prevent the model from overfitting and improve the generalization ability and stability of the model. Perform the first convolution, activation function, and Dropout operation in sequence, then perform the second convolution and another Dropout operation to obtain the second embedded feature. ; Perform and residual connection and the second layer normalization operation to obtain the output of the encoder layer. : ; Multiple encoder layers can be stacked according to requirements, that is, is regarded as and input again into Step 2.2.1 until the final output of the encoder part is obtained. . Thus, the encoder part of the model is completed.

[0036] Step 3: Construct the basic process architecture of the diffusion model (the diffusion model is a generative model based on the probabilistic diffusion process) to gradually add noise to the reservoir geological attribute data, so that complex geological parameters can be randomly perturbed at each stage of diffusion, gradually transforming from the original distribution to the standard Gaussian distribution, providing more available information for the subsequent inversion process; the basic process architecture of the diffusion model includes two parts: forward diffusion and reverse denoising. The forward diffusion process gradually adds noise to the multi-dimensional reservoir geological attribute data to generate random Gaussian noise, and the reverse denoising process uses a denoising network to gradually reverse the noise addition process and restore the original multi-dimensional reservoir geological attribute data; the specific process is as follows: Step 3.1: Perform standardization and dimensionality reduction on the normalized reservoir geological attribute data sample set. The specific process is as follows: Step 3.1.1: To make the data have zero mean and unit variance, further perform standardization on the normalized production dynamic data sample set. The specific process is as follows: ; Among them, 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 respectively: ; ; Among them, is the total number of sample groups; is the data value of the th group of samples in the normalized data; 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: First, calculate the covariance matrix of the standardized data: ; where is the covariance matrix; is the data value of the th group of samples in the standardized data; is the mean vector of each feature in the standardized data; is the transpose symbol; Then, perform eigenvalue decomposition on the covariance matrix to obtain the eigenvalues and the corresponding eigenvectors , where is the th eigenvalue corresponding eigenvector; the total number of eigenvalues or eigenvectors corresponds to the permeability feature dimension . Select the first eigenvectors as the principal components according to the magnitude of the eigenvalues. The selected eigenvectors form the matrix which is the principal component matrix required for dimensionality reduction. Project the standardized data onto the principal component subspace to obtain the dimensionality-reduced data set : ; where is the standardized data set; in this way, the dimension of the model input data is reduced from the original dimension to , while retaining the main information of the data, which is beneficial to accelerating the model convergence speed.

[0037] Step 3.2: Gradually add noise to the reservoir geological attribute data after PCA dimensionality reduction, so that complex geological parameters can be randomly perturbed at each stage of forward diffusion. Use the cosine scheduling function to generate the noise coefficient, and the specific formula is as follows: ; where is the noise coefficient at time step , and the noise coefficient controls the amount of noise injected into the data at each time step; . It is designed to be smaller in the initial stage and gradually increase until the end of training, ensuring that the model retains more original data features in the initial stage; more noise is gradually added in the later stage to make the model have better stability and convergence during training. Define the reservoir geological attribute data after adding noise at each time step as: ; ; where , are the reservoir geological attribute data after adding noise at time steps and time step respectively; is the retention rate at time step ; is the noise at time step , and . represents a multi-dimensional normal distribution with a mean of 0 and a variance of 1, also called the standard normal distribution; Using mathematical induction, it can be extended to any step; the reservoir geological attribute data after adding noise at time step can be deduced at once using the known initial reservoir geological attribute data. The specific formula is as follows: ; ; where is the initial reservoir geological attribute data; is the cumulative retention rate from time step 1 to time step , representing the product of the retention information of all time steps from time step 1 to time step ; is the noise, . is the retention rate at time step ; Step 3.3. During the reverse denoising process, generate the reservoir geological attribute data at time step in reverse from time step . The abstract expression formula for this process is: ; where is the conditional probability distribution for generating given , and this distribution is determined by the training parameters of the model; is a multi-dimensional normal distribution, represents the probability distribution of ; is what the model predicts The mean value of is the model prediction of the covariance matrix of

[0038] It can be expressed as the weighted sum of two parts: ; where is the noise predicted by the model.

[0039] In the reverse process, corresponds to in the forward process: ; where is the cumulative retention rate from time step 1 to time step ; The denoising process of each step in the reverse process can be expressed as: ; where the first part of the formula restores the data of the previous time step by removing noise from the current data, which is based on the mean prediction part; the second part of the formula , where the noise term , although the model restores data from the noise through , due to the randomness of the noise process, some random perturbations need to be introduced during the generation process. At this time, the noise term plays this role, making the results generated by the model not only the predicted average value but also retain some uncertainty and diversity. So far, the basic process architecture of the diffusion model has been completed.

[0040] Step 4: Construct a denoising network based on Unet, combine the high-dimensional feature vectors of the long-term production data of the reservoir, and accurately predict the noise components at each time step; encapsulate the time series feature extraction model based on Informer, the basic process architecture of the diffusion model, and this 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 components at each time step, thereby supporting the reverse process of the diffusion model. This denoising network uses 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 skip connections, and efficiently and accurately restores the details and quality of the data during the noise reduction process; the specific process is as follows: Step 4.1: For the time step of the forward diffusion, the reservoir geological attribute data after adding noise Perform a convolution operation to extract preliminary features and generate a feature representation in the latent space : ; Among them, is the convolution kernel; is the activation function; is the bias term of the convolution operation.

[0041] For time step of use sine positional encoding, and then pass through two linear layers and an activation function to map the time step to a representation with the same dimension as . Add to and to obtain the token for guiding the model generation. A token refers to the smallest text unit generated or processed by the model.

[0042] Step 4.2, Input and the token into the encoder part of Unet. The encoder part consists of multiple encoding modules with the same structure. Each encoding module contains two residual blocks, a multi-head spatial attention mechanism, and a downsampling. The residual blocks ensure the effective flow of information in the network and avoid the problem of gradient vanishing; the multi-head spatial attention mechanism enables the model to capture local and global features simultaneously in the spatial domain and fuse the token; the downsampling reduces the resolution of the feature map until the final low-resolution feature map. The specific formula is: Two residual blocks: ; ; Among them, , are the features output by the first residual block and the second residual block respectively; is the convolution; The multi-head spatial attention mechanism fuses and the token for feature extraction. When extracting features, first use a two-dimensional convolution to output query matrix , key matrix , value matrix , and then input the token into two linear layers respectively to obtain the key matrix and value matrix of the token. Concatenate with , with to obtain the new key matrix , new value matrix . For , , Execute the following formula: ; ; where is the softmax function; is the normalized attention weight matrix; is the output of a single attention head; is the output of the rd attention head; is the output concatenated from the results of multiple attentions; is the dimension of the new key matrix; Downsample to reduce the resolution of the feature map: ; where is the downsampled feature; is the downsampling. After obtaining , input it into the next layer encoding module, and repeat the process of step 4.2 until the last layer encoding module is calculated. The output of the last layer encoding module is the final low-resolution feature map .

[0043] Step 4.3. After the downsampling in the encoder part, is passed into the decoder part of the UNet. The decoder is responsible for gradually restoring the resolution of the features. The decoder contains multiple decoding modules with the same structure. The number of decoding modules is the same as that of the encoding modules; each decoding module consists of a skip connection, two residual blocks, a multi-head spatial attention mechanism, and an upsampling; the specific process is as follows: The skip connection concatenates the of the encoder symmetric to the current decoder to the output of the previous layer decoder (if it is the first layer decoder, concatenate it to ), so as to obtain the concatenated feature.

[0044] Input the concatenated feature and the token into the multi-head spatial attention module. The specific operation is the same as that of the multi-head spatial attention module in the encoder to obtain the output concatenated by multiple attention heads; input into the upsampling layer to obtain the output of the current layer decoder: ; where is the upsampling; After the calculations of multiple decoding modules, the final output of the decoder is obtained. ; Perform a deconvolution operation on the final output of the decoder to restore a noise-free output with the same dimension as the input data. : ; Among them, is the deconvolution operation.

[0045] So far, the denoising network is completed.

[0046] Step 4.4: Connect the time series feature extraction model in Step 2, the basic process architecture of the diffusion model in Step 3, and the denoising network in sequence, and then encapsulate them into a complete diffusion model. The complete diffusion model obtained by encapsulation is the inversion prediction model.

[0047] Step 5: Combine the inversion prediction model with the data space inversion method to achieve end-to-end dynamic reservoir modeling; In reservoir modeling and prediction, the actual field observed production data is usually affected by various noise sources and is time-limited. For the observed production data containing noise, use the data space inversion method to convert the observed production data containing noise into the posterior distribution of model parameters. The data space inversion method combines the observed production data and the prior model to remove the noise of the observed production data and generate multiple prediction data of future flows from the posterior distribution. Use this prediction data 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 from these noisy observed production data and predict future flows; the specific process is as follows: Step 5.1: Load the prior data. For each well, combine the production data at each time step to form a complete production data vector. , among which, is the production data at time step , is the total number of time steps. Divide the collected production data into oil production data and water production data. Find the jump moment of the production well, that is, the time when water production starts. According to the found time step, calculate the corresponding jump moment: ; Among them, is the jump moment of well and the prior model ; represents the index of the well, represents the index of the prior model, represents the index of the time step; is the time interval.

[0048] Convert the original time to a new time series using non - linear mapping: ; where, is the new time series; is the current time; is the initial time; is the final time; is the time index; is the jump moment.

[0049] Interpolate the remapped time points to smooth the production data and obtain a continuous data representation. Use B - spline interpolation method to calculate the interpolation of the data, and the interpolated data is used for subsequent analysis. First, generate the B - spline representation, and then use the generated B - spline representation to calculate the interpolation of the new time points to obtain the interpolated production data: ; where, is the interpolated production data; is the target point to be interpolated; is the function to generate the B - spline representation; is the function to perform the interpolation calculation; are the original time points; is the original production data; is the order of the spline curve. After interpolation, a new complete production data vector .

[0050] Step 5.2. Reparameterize the data using PCA to make it closer to a Gaussian distribution. Calculate the mean of all mapped data as the prior data , and construct the centering matrix : ; ; where, is the total number of prior data; , are respectively the production data of all wells at all time steps for the th and the th prior data; Next, perform singular value decomposition on , select the eigenvectors corresponding to the first singular values to form the basis matrix , and represent the mapped data through the reduced - dimensional variable : ; ; ; Among them, is the left singular matrix of the singular value decomposition; is a diagonal matrix containing the singular values; is the right singular matrix; represents selecting the first singular values from the left singular matrix ; represents selecting the first singular values from the diagonal matrix ; is the data re-parameterized by using the principal component analysis method; Step 5.3, obtaining the production data prediction result based on Bayesian inversion; in Bayesian inversion, it is assumed that there are errors in the observed production data, and this kind of error is generally assumed to be Gaussian noise with zero mean, and its covariance matrix is represented by . The relationship between the observed production data and can be represented by the conditional probability density function : ;

[0051] Among them, is the conditional probability density function; is a selection matrix used to extract the part corresponding to from . The covariance matrix describes the magnitude and mutual relationship of the observation errors.

[0052] Under 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 by giving the observed production data. The posterior probability is expressed as the product of the prior probability and the conditional probability density function: ; Among them, is the posterior probability; For the prior probability , it is the Gaussian distribution of the prior data : ; Among them; is the prior probability; is the covariance matrix of the prior probability; Combining the prior probability and the conditional probability density function, the posterior probability density function of the complete data can be obtained.

[0053] To find the complete data vector that best fits the observed production data, maximum a posteriori estimation is usually achieved by minimizing the objective function, and the specific form of the objective function is: ; where, is the objective function; represents the functional relationship that maps the reduced-dimensional variable back to the original data space; is the observed production data. The first term of the objective function represents the degree of mismatch between the observed production data and the simulated data, and this term is weighted by to reflect the weights of the errors of each observed production data; the second term represents the prior regularization constraint. Assuming that the reduced-dimensional variable follows a standard normal distribution, the rationality and stability of the solution are guaranteed. The core of constructing the objective function lies in balancing the fitting of the observed production data and the constraint of prior knowledge. By minimizing this objective function, the optimal reduced-dimensional variable can be obtained, and then the optimal production data prediction result can be obtained.

[0054] To quantify the uncertainty of reservoir production prediction, the Stochastic 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, so as to generate multiple posterior samples that meet the observed conditions. Specifically, the perturbed observed production data can be expressed as: ; where, is the perturbed observed production data; is a random number following a standard normal distribution; is the noise level.

[0055] The perturbed principal component vector is generated by adding Gaussian noise, and the formula is as follows: ; Through the optimization algorithm, combined with the perturbed observed production data and the perturbed principal components, the optimal reduced-dimensional variable is optimized. The formula is as follows: ; where, is the principal component matrix; is the identity matrix; is the prior data.

[0056] After obtaining the optimal reduced-dimensional variable After that, it is necessary to map it back to the original data space to obtain the complete production data prediction result. The mapping process can be expressed as: ; where is the complete production data vector after mapping; is the inverse operation of the mapping, which is used to convert the reduced-dimensional variables back to the complete data representation. Through this mapping, a complete production data prediction result that conforms to the observed production data can be obtained.

[0057] By repeatedly perturbing the observed production data and minimizing the objective function, multiple posterior samples are generated, and each posterior sample is a possible production data prediction result.

[0058] Step 5.4: Input these production data prediction results into the inversion prediction model encapsulated in Step 4, and dynamic end-to-end reservoir modeling can be achieved.

[0059] To prove the feasibility and superiority of the present invention, the following embodiments are given.

[0060] In this embodiment, the proposed method is verified, and subsequent analysis and discussion are carried out. Then, end-to-end dynamic modeling is carried out according to the following steps. This embodiment uses a three-dimensional real reservoir model. This real reservoir model has a total of 9 layers. The parameters that need to be inverted for history matching include the x-direction permeability field, z-direction permeability, porosity, and net-to-gross ratio of each grid, totaling 240,192. The production dynamic data that needs to be matched for history in the reservoir model includes the pressures of 20 production wells, the pressures of 10 injection wells, and the oil and water production of 20 production wells. Figures 2 - 5 The porosity, x-direction permeability field, z-direction permeability, and net-to-gross ratio of this real reservoir model are shown in sequence.

[0061] First, establish a sample data set; in the sample data set, porosity, permeability field, net thickness ratio samples, and corresponding production dynamic data of oil and water wells are constructed into 1000 samples according to the process of step 1 and normalized. Then, based on the Informer model, construct a time series feature extraction model according to the process of step 2. Then, use the normalized reservoir geological attribute data as input to train the model, and complete the training of the feature extraction model by observing the reconstructed features. Then, construct the basic process architecture of the diffusion model according to the process of step 3, gradually add noise to the geological attribute data of the reservoir, so that complex geological parameters can be randomly perturbed at each stage of diffusion. After 256 time steps, the geological attribute data gradually transforms from the original distribution to the standard Gaussian distribution. According to the process of step 4, use the Unet module to construct a denoising network, combine the high-dimensional feature vectors of the long-term production data of the reservoir obtained by the time series feature extraction model in step 2, accurately predict the noise components at each time step, and then reverse the noise addition process based on this to restore the original geological data. The reservoir geological data distribution map obtained by inverting the production data is as shown in Figures 6 - 9 shown, Figure 6 is the reservoir porosity predicted by the inversion prediction model, Figure 7 is the reservoir permeability field in the x direction predicted by the inversion prediction model, Figure 8 is the reservoir permeability field in the z direction predicted by the inversion prediction model, Figure 9 is the net thickness ratio of the reservoir predicted by the inversion prediction model. By comparing Figures 2 - 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.

[0062] Use a reservoir numerical simulator to perform numerical simulation calculations on this geological attribute data, obtain the production dynamic data of oil and water wells corresponding to the reservoir predicted by this inversion prediction model, and compare the inverted data with the real data. The comparison results are as shown in Figures 10 - 13 shown; Figure 10 shows the comparison of the fitting situation between the production well pressure data of the real reservoir and the production well pressure data of the reservoir predicted by the inversion prediction model, Figure 11 shows the comparison of the fitting situation between the injection well pressure data of the real reservoir and the injection well pressure data of the reservoir predicted by the inversion prediction model; Figure 12 shows the comparison of the fitting situation between the oil production data of the production wells in the real reservoir and the oil production data of the production wells in the reservoir predicted by the inversion prediction model, Figure 13 shows the comparison of the fitting situation between the water production data of the production wells in the real reservoir and the water production data of the production wells in the reservoir predicted by the inversion prediction model. From Figures 10 - 13 it can be seen that the production curve of the reservoir predicted by the inversion prediction model is close to the production curve of the real reservoir. This verifies the effectiveness of the method of the present invention under complex three-dimensional geological conditions.

[0063] Due to the noise and time limitations of the actual reservoir observation production data, more accurate observed production data is estimated from the noisy observed production data through data space inversion technology and future flow is predicted, which 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 observed production data. The reservoir numerical simulator is used to perform numerical simulation calculations on the geological attribute data to obtain the production performance data of the oil and water wells corresponding to the model, and the production data is compared with the actual reservoir production data. At the same time, the production data curve of the reservoir is predicted using the inversion prediction model, specifically as Figure 14 shown. From Figure 14 it can be seen that the method of the present invention can effectively cope with the noise and time limitations of the observed production data, and can estimate accurate reservoir model parameters and predict future flow.

[0064] Certainly, 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 those skilled in the art within the scope of the essence of the present invention should also fall within the protection scope of the present invention.

Claims

1. An end-to-end dynamic reservoir modeling method based on a diffusion model, characterized in that It includes the following steps: Step 1: Obtain reservoir geological attribute data and oil well production dynamic data, establish a sample data set, and perform normalization processing; Step 2: Based on the Informer model, construct a time series feature extraction model to extract the features of long-term reservoir production data, convert them into high-dimensional feature vectors, and then train this model with the normalized sample data set; Step 3: Construct the basic process architecture of the diffusion model to gradually add noise to the reservoir geological attribute data; Step 4: Construct a denoising network based on Unet, encapsulate the time series feature extraction model based on Informer, the basic process architecture of the diffusion model, and this denoising network to obtain an inversion prediction model for realizing end-to-end dynamic modeling of the reservoir; Step 5: Combine the inversion prediction model with the data space inversion method to realize end-to-end dynamic modeling of the reservoir.

2. The end-to-end dynamic reservoir modeling method based on the diffusion model according to claim 1, characterized in that The specific process of Step 1 is as follows: Step 1.1: Obtain reservoir geological attribute data, including seismic, logging, and core data; Step 1.2: Based on the reservoir geological attribute data, use the stochastic geological modeling method to construct multiple geological models, and the geological models are prior models; then, use the reservoir numerical simulator to perform numerical simulation calculations on all prior models, obtain the oil well production dynamic data corresponding to each prior model, and construct the prior models and their corresponding oil well production dynamic data into a sample data set; Step 1.3: Perform normalization processing on the oil well production dynamic data and reservoir geological attribute data in the sample data set; Organize the production performance data of oil and water wells in the sample dataset into a production performance data sample set , and organize the reservoir geological attribute data in the sample dataset into a reservoir geological attribute sample set ; is the th group of samples in the production performance data sample set; is the th group of samples in the reservoir geological attribute sample set; The method of normalization processing adopts the following formula: ; Among them, is the normalized data value; is the th group of samples in the production dynamic data sample set or the reservoir geological attribute sample set; is the minimum value in the original data; is the maximum value in the original data; The normalized production performance data sample set is ; the normalized reservoir geological property data sample set is .

3. The end-to-end dynamic reservoir modeling method based on a diffusion model according to claim 2, wherein, 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 the embedded features; The specific process is as follows: Step 2.1.1: Take the normalized production dynamic data sample set as the input sample set, where is the time step, is the feature dimension; use a one-dimensional convolutional layer to transform the input sample set, map the original data from the feature dimension to a high-dimensional space to obtain the output feature set: ; Among them, is the production dynamic data output feature set; is a one-dimensional convolutional layer; is the dimension of the high-dimensional space; Step 2.1.2: Construct position encoding, and the position encoding is generated by a predefined function, and the formula is as follows: For even dimensions: ; For odd dimensions: ; Among them, is the location information; represents 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 convolutional layer Add it element-wise to the position information at the corresponding time step to obtain the embedded feature: ; Among them, is the embedded feature; Step 2.2: Construct the encoder part to process the embedded features, and the encoder part includes multiple encoder layers.

4. The end-to-end dynamic reservoir modeling method based on a diffusion model according to claim 3, wherein 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 : ; wherein, is a randomly selected query; is a randomly selected key; is a transpose symbol; Step 2.2.2: Apply the softmax function to the sparse attention score matrix to convert the scores into weights, and then weight the matching degree between each query and all keys to obtain the sparse attention weight matrix , and the calculation formula for each attention weight in the matrix is: ; Among them, is the exponential function with as the base; is the score between the th query and the th key; is the attention weight between the th query and the th key; is the score between the th query and the th key; Step 2.2.3, through the sparse attention weight matrix weight-sum the value matrix to generate a context vector : ; Step 2.2.

4. For the multi-head attention mechanism, concatenate the context vectors of each attention head and obtain the output of the attention module through the output projection matrix : ​ ; Among them, is a splicing operation; is the context vector of the Step 2.2.5, for the output of the attention module perform a Dropout operation and combine it with the embedded features perform a residual connection and the first layer normalization operation to obtain the first embedded feature : ; Among them, is a layer normalization operation; is a Dropout operation; Pairwise Perform the first convolution, activation function, and Dropout operation in sequence, then perform the second convolution and another Dropout operation to obtain the second embedded feature ; Pair And Perform a residual connection and a second layer normalization operation to obtain the output of the encoder layer : ; Stack multiple encoder layers, that is, is regarded as and input again into step 2.2.1 until the final output of the encoder part is obtained .

5. The end-to-end dynamic reservoir modeling method based on a diffusion model according to claim 4, characterized in that The specific process of Step 3 is as follows: Step 3.

1. Perform standardization and dimensionality reduction on the normalized reservoir geological attribute data sample set ; The formula for standardization processing is: ; Among them, represents the standardized data; is the mean of the normalized data; is the standard deviation; Use the principal component analysis method to perform dimensionality reduction processing on the standardized data; the specific process is as follows: First, calculate the covariance matrix of the standardized data: ; Among them, is the covariance matrix; is the data value of the th group of samples in the standardized data; 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 eigenvectors , where is the th eigenvalue corresponding eigenvector; the total number of eigenvalues or eigenvectors corresponds to the permeability feature dimension ; select the first eigenvectors as the principal components according to the magnitudes of the eigenvalues; the matrix formed by the selected eigenvectors is the principal component matrix required for dimensionality reduction; project the standardized data into the principal component subspace to obtain the dimensionality-reduced data set : ; Among them, is the standardized data set; Step 3.2: Gradually add noise to the reservoir geological attribute data after dimensionality reduction, and specifically use the cosine scheduling function to generate the noise coefficient; Step 3.

3. During the reverse denoising process, generate reservoir geological attribute data for time step in reverse to time step .

6. The end-to-end dynamic reservoir modeling method based on a diffusion model according to claim 5, characterized in that, In Step 3.2, the calculation formula of the noise coefficient is: ; Among them, is the time step of the noise factor; Define the reservoir geological attribute data with added noise at each time step as: ; ; Among them, , are the reservoir geological attribute data with noise added at time steps and time step respectively; is the retention rate at time step ; is the noise at time step . Using known initial reservoir geological property data, the time step is derived in one go The specific formula for reservoir geological attribute data after adding noise is as follows: ; ; Among them, is the initial reservoir geological attribute data; is the cumulative retention rate from time step 1 to time step ; is the noise; is the retention rate at time step ; The formula of Step 3.3 is: ; ; ; Among them, is the conditional probability distribution given generated , and this distribution is determined by the training parameters of the model ; is a multi-dimensional normal distribution; is the mean value of predicted by the model; is the covariance matrix of predicted by the model; is the noise predicted by the model; is the cumulative retention rate from time step 1 to time step ; The denoising process at each step of the reverse process is expressed as: 。 7. The end-to-end dynamic reservoir modeling method based on a diffusion model according to claim 6, characterized in that In Step 4, the denoising network adopts the 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 as follows: Step 4.

1. Perform a convolution operation on to extract preliminary features and generate a feature representation in the latent space : ; Among them, is the convolution kernel; is the activation function; is the bias term of the convolution operation; For the time step Use sine positional encoding, then pass through two layers of linear layers and activation functions to map the time step to a representation of the same dimension as ; Add to and to obtain the token that guides the model generation. A token is the smallest text unit generated or processed by the model; Step 4.2: Input and the token into the encoder part of Unet; the encoder part consists of multiple encoding modules with the same structure, and each layer of the encoding module contains two residual blocks, a multi-head spatial attention mechanism, and a downsampling; the specific formula is as follows: Two residual blocks: ; ; Among them, , are the features output by the first residual block and the second residual block respectively; is convolution; Multi-head Spatial Attention Mechanism Fusion and tokens for feature extraction. When extracting features, first use two-dimensional convolution to obtain query matrix , key matrix , and value matrix . Then input the tokens into two linear layers respectively to obtain the key matrix and value matrix of the tokens; concatenate with to obtain a new key matrix , and concatenate with to obtain a new value matrix ; perform the following formula on , , : ; ; 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; For Perform downsampling: ; Among them, is the feature after downsampling; is the downsampling; after obtaining it, input it into 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 through the encoder part, it is passed into the decoder part of the UNet; the decoder contains multiple decoding modules with the same structure, and the number of decoding modules is the same as that of the encoding modules; each decoding module consists of a skip connection, two residual blocks, a multi-head spatial attention mechanism, and an upsampling; the specific process is as follows: The skip connection splices the encoder symmetric to the current decoder onto the output of the previous-layer decoder to obtain the spliced feature; Input the concatenated features and the token into the multi-head spatial attention module. The specific operation is the same as that of the multi-head spatial attention module in the encoder, and obtain the output formed by concatenating multiple attention heads ; Input into the upsampling layer to obtain the output of the current layer decoder : ; Among them, is upsampling; After the calculations of multiple decoding modules, the final output of the decoder is obtained ; Perform a deconvolution operation on the final output of the decoder to restore a noiseless output with the same dimension as the input data : ; Among them, is the deconvolution operation; thus, the denoising network is constructed. Step 4.4: Connect the time series feature extraction model in Step 2, the basic process architecture of the diffusion model in Step 3, and the denoising network in sequence, and encapsulate them to obtain a complete diffusion model. The complete diffusion model obtained by encapsulation is the inversion prediction model.

8. The end-to-end dynamic reservoir modeling method based on a diffusion model according to claim 7, wherein 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 prediction data of future flows from the posterior distribution. The prediction data is used as the input of the inversion prediction model in Step 4.4 to realize the dynamic adjustment of the real reservoir model.

Citation Information

Patent Citations

  • Historical fitting method based on deep autoregression network and continuous learning strategy

    CN115935834A

  • Conditional diffusion model-based time series data prediction method and system

    CN117076931A

  • SAR image generation method based on de-noising diffusion probability model

    CN118230191A

  • Time series data generation method and system based on diffusion model

    CN118410289A

  • Automatic history matching method and apparatus based on RU-net and LSTM neural network models

    WO2024046086A1

Cited By

  • End-to-end oil reservoir history fitting method based on flow matching

    CN121118766A

  • An end-to-end reservoir history matching method based on flow matching

    CN121118766B

  • JIT-based reservoir parameter end-to-end inversion method

    CN121881876A

  • End-to-end reservoir parameter inversion method based on consistency model and phase control constraint

    CN121902640A