An oil and gas well digital twin model construction method, system and electronic device
By cleaning, transforming, feature-selecting, and dimensionality-reducing the physical data of oil and gas wells, and combining CNN and LSTM models, a digital twin model was constructed and validated. This solved the data processing and accuracy problems of digital twin models for fracturing well sites, enabling oil and gas production prediction and fault early warning, and improving production efficiency and reliability.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CNPC BOHAI DRILLING ENG
- Filing Date
- 2024-12-04
- Publication Date
- 2026-06-05
AI Technical Summary
Existing digital twin models of fracturing well sites suffer from complex construction environments, inconsistent data quality and sampling frequencies, making it difficult to process multi-source heterogeneous data and lacking sufficient sample data, thus making it difficult to verify the accuracy and reliability of the digital model.
By acquiring the physical data of reservoir grid points, we perform data cleaning, transformation, feature selection and construction, and dimensionality reduction to build physical and mechanistic models. We then combine CNN and LSTM models to establish a digital twin model and use nested cross-validation algorithm to verify the model's accuracy and optimize the model parameters.
It achieves efficient processing of multi-source heterogeneous data in complex environments, constructs accurate and reliable digital twin models, can predict oil and gas production, capture production change trends, provide a basis for production strategies, and issue timely fault warnings, thereby improving production efficiency and reducing costs.
Smart Images

Figure CN122154372A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of oil and gas wells and intelligent control, and specifically relates to a method, system and electronic equipment for constructing a digital twin model of an oil and gas well. Background Technology
[0002] Fracturing is a commonly used oil and gas field production enhancement technology. It involves injecting high-pressure fluid into the wellbore to break up the rock and create fractures, thereby increasing the production capacity of the oil and gas field.
[0003] Digital twins connect physical systems in the real world with their virtualized models in the digital world, enabling mutual feedback and synchronous updates between the physical system and the digital model. Digital twin models have become an important tool for simulating the development process of fracturing well sites and optimizing production plans. By digitally modeling the real-world well site system and combining it with real-time data acquisition and monitoring, the well site operation status can be simulated, problems can be identified, and solutions can be provided.
[0004] However, existing digital twin models of fracturing well sites suffer from problems such as complex construction environments, inconsistent data quality and sampling frequencies, leading to difficulties in processing multi-source heterogeneous data. Furthermore, the limited exploration and production data in the fracturing field, coupled with a lack of sufficient sample data, makes it difficult to verify the accuracy and reliability of the digital model within the digital twin model. Summary of the Invention
[0005] To address the aforementioned problems in the prior art, namely, the difficulty in handling multi-source heterogeneous data during the construction of digital twin models, the poor accuracy of the digital models within the constructed digital twin models, and the difficulty in verifying the accuracy and reliability of the digital models, the present invention, in its first aspect, proposes a method for constructing a digital twin model of an oil and gas well, comprising:
[0006] Step S1: Obtain the entity data of the oil and gas wells to be constructed in the digital twin model at the reservoir grid points as input data; the entity data includes geological data, equipment data, fracturing operation data, and wellbore data;
[0007] Step S2: Filter and process the entity data to obtain preprocessed data; the filtering and processing includes data cleaning, data transformation, feature selection and construction, and dimensionality reduction.
[0008] Step S3: Construct a digital twin model based on the preprocessed data; the digital twin model includes a physical model, a mechanistic model, and a digital model;
[0009] Step S4: The digital twin model is verified using a nested cross-validation algorithm, and then corrected and deployed based on the verification results.
[0010] In some preferred embodiments, the data cleaning process specifically includes the following steps:
[0011] Step S211: Delete duplicate entity data;
[0012] Step S212: Calculate the missing rate of each feature in the entity data;
[0013] Step S213: For features with a missing rate of less than M%, use cubic spline interpolation to impute the missing values of the features:
[0014] g i (x)=a i +b i (xx i )+c i (xx i ) 2 +d i (xx i ) 3 ;
[0015] In the formula, g i The equation is a cubic polynomial function, where x is the insertion point. i For the i-th data node, a i b i c i d i These are the coefficients of the spline curve;
[0016] Step S214: For features with a missing rate greater than M%, use linear interpolation to impute the missing values of the features:
[0017]
[0018] In the formula, x1, y1 and x2, y2 are the x and y coordinates of two known points, x is the x coordinate of the point to be inserted, and y is the corresponding estimated value.
[0019] In some preferred embodiments, the dimensionality reduction process is as follows:
[0020] Step S241: Calculate the covariance matrix between features in the numerical data;
[0021] Step S242: Perform eigenvalue decomposition on the covariance matrix to obtain eigenvalues and corresponding eigenvectors;
[0022] Step S243: Sort the eigenvectors according to the size of their eigenvalues, and select the eigenvectors with eigenvalues greater than N as principal components;
[0023] Step S244: Project the numerical data onto the selected principal components and perform dimensionality reduction to obtain the dimensionality-reduced preprocessed data.
[0024] In some preferred embodiments, a digital twin model is constructed based on the preprocessed data, and the method is as follows:
[0025] Step S31: Define the geometric, motion, and functional properties of the physical entity and construct a three-dimensional physical model;
[0026] Step S32: Based on the reservoir seepage equation and the Beggs-Brill model of multiphase flow in the wellbore, construct a mechanism model, determine the parameters and initial conditions involved in the mechanism model, and establish a reservoir-wellbore-surface collaborative mechanism model;
[0027] Step S33: Based on the pumping pressure and pumping pressure of the fracturing operation data on the reservoir grid points, calculate the pressure gradient between adjacent reservoir grid points, calculate the seepage velocity by combining permeability and fluid viscosity, and then calculate the flow rate parameters. Based on the mechanism model, provide reservoir seepage physical constraints for the digital model. Use a CNN model combined with an LSTM model to establish a digital twin model.
[0028] The calculation method for the flow rate parameters is as follows:
[0029] In the formula, v is the seepage velocity vector, k is the permeability tensor, and μ is the fluid viscosity. It is a pressure gradient, v SL and v sG These are the apparent velocities of the liquid and gas phases, respectively; g is the acceleration due to gravity; D is the pipe diameter; and ρ is the apparent velocity of the liquid phase and the apparent velocity of the gas phase. L and ρ G These are the densities of the liquid phase and the gas phase, respectively, N. VL It is the dimensionless fluid velocity, N VG It is a dimensionless gas velocity;
[0030] The digital twin model architecture includes: an input layer, a convolutional layer, a pooling layer, an LSTM layer, a fully connected layer, and an output layer.
[0031] In some preferred embodiments, the method for verifying the digital twin model using a nested cross-validation algorithm, and then correcting and deploying it based on the verification results, is as follows:
[0032] Step S41: Construct a validation dataset based on the physical data obtained from the fracturing operation site and the prediction results output by the digital twin model;
[0033] Step S42: Perform outer loop validation using K-Fold cross-validation: Based on the number of outer loop folds, the validation dataset is divided into training and test sets in each loop. The number of outer loop folds is denoted as K. i The training set is denoted as The test set is denoted as
[0034] Step S43: Perform inner loop validation using K-Fold cross-validation: Based on the number of folds in the inner loop, perform cross-validation on each... The dataset is divided into an inner training set and an inner test set, and the inner loop fold number is denoted as K. j The inner training set is denoted as Inner test set denoted as
[0035] Step S44: Obtain the optimal hyperparameter set. In each iteration, randomly sample the hyperparameter set of the digital twin model to form a set, denoted as θ. Train the digital model on the inner training set and verify it using the inner test set. Select the subset of hyperparameters with the smallest average loss function as the optimal θ. * ;
[0036] Step S45: Combine the aforementioned θ * and Train the digital twin model and calculate the digital twin model in The performance metrics include precision, recall, and F1 score, where the F1 score is the harmonic mean of precision and recall.
[0037] Step S46: Repeat steps S42-S45 until the outer loop stops, and use the average value of the obtained performance indicators as the evaluation result of the digital model;
[0038] Step S47: Determine whether the digital twin model meets the set evaluation criteria based on the evaluation results. If yes, deploy the digital twin model; otherwise, return to step S2.
[0039] In some preferred embodiments, the digital model is trained on the inner training set, validated using the inner test set, and the subset of hyperparameters with the minimum average loss function is selected as the optimal θ. * The calculation method is as follows:
[0040] Step S441: Calculate the prediction result using forward propagation: Based on the parameters of the current digital twin model, calculate the output value of each neuron sequentially from the input layer of the digital twin model until the prediction result of the output layer is obtained;
[0041] Step S442: Use the average loss function to represent the error between the predicted result and the actual result. Select a subset of the hyperparameters with the smallest average loss function as the optimal hyperparameter set, denoted as θ. * The calculation method is as follows:
[0042] In the formula, argmin θ This indicates that θ is selected from the minimum value in the array. This represents the nth inner test subset. Let L represent the nth inner layer training subset, and let f be the loss function. θ For training digital twin models;
[0043] Step S443: Propagate the error from the output layer to the input layer through the backpropagation algorithm, and adjust the hyperparameter set of the digital twin model according to the error to minimize the average loss function of the digital twin model on the inner training set.
[0044] Step S444: Calculate the gradient of each parameter and hyperparameter with respect to the loss function based on the chain rule, and update the parameters and hyperparameters according to the gradient descent algorithm. The calculation method is as follows: α = α0 / 1 + decay × epoch;
[0045] In the formula, α is the learning rate, α0 is the initial learning rate, decay is the decay rate, epoch is the current training epoch, W is the weight, b is the bias, l represents the layer order of the digital twin model, and i represents the neuron number. This represents the updated weights from the j-th neuron in layer (l-1) to the i-th neuron in layer l. This represents the weights from the j-th neuron in layer (l-1) to the i-th neuron in layer l. This represents the bias of the i-th neuron in the l-th layer after the update. This represents the bias of the i-th neuron in the l-th layer. This represents the error value of the j-th neuron in the l-th layer. This represents the output value of the i-th neuron in the (l-1)-th layer. This represents the error value of the i-th neuron in the l-th layer.
[0046] In a second aspect, the present invention proposes a digital twin model construction system for oil and gas wells, comprising: data acquisition equipment and a cloud server;
[0047] The data acquisition device includes sensors, recorders, and data acquisition cards; the data acquisition device is configured to acquire physical data of the oil and gas wells to be used as input data for constructing a digital twin model.
[0048] The cloud server is configured to receive input data sent by the data acquisition device; filter and process the entity data to obtain preprocessed data; the filtering and processing includes data cleaning, data transformation, feature selection and construction, and dimensionality reduction.
[0049] A digital twin model is constructed based on the preprocessed data; the digital twin model includes a physical model, a mechanistic model, and a digital model.
[0050] In a third aspect, the present invention provides an electronic device comprising: at least one processor; and a memory communicatively connected to at least one of the processors; wherein the memory stores instructions executable by the processor for implementing the above-described method for constructing a digital twin model of an oil and gas well.
[0051] The beneficial effects of this invention are:
[0052] (1) In response to the problem of complex construction environment, inconsistent data quality and sampling frequency, which makes it difficult to process multi-source heterogeneous data, this solution uses feature engineering technology for data processing. Through data cleaning, data transformation, feature selection and construction, and dimensionality reduction, entity data is screened and processed. This ensures data quality for processing multi-source heterogeneous data. The constructed digital twin model integrates physical model and mechanism model. By comprehensively considering reservoir characteristics, fluid flow in wellbore, and operating parameters of surface equipment, and combining historical entity data, an accurate and reliable digital twin model is established. This model can more accurately predict oil and gas production, capture the long-term trend and periodicity of production changes, and thus provide a more reliable basis for adjusting production strategies. It helps to determine reasonable pumping unit stroke and stroke parameters to maximize production.
[0053] (2) The digital twin model receives physical data from oil well sensors in real time. When the data fluctuates abnormally, it can issue a fault warning in a timely manner by combining the normal operating range set in the physical model and the mechanism model. If the pressure at a certain point in the wellbore suddenly drops and exceeds the normal fluctuation range, it can analyze whether it is caused by tubing leakage, pump failure or reservoir pressure change based on the wellbore physical model, thereby reducing downtime.
[0054] (3) In response to the problem that the accuracy and reliability of the digital twin model are difficult to verify due to the limited exploration and production data in the field of fracturing and the lack of sufficient sample data, we use real entity data to verify the accuracy and reliability of the digital model through nested cross-validation algorithm, and optimize the parameters of the digital twin model through backpropagation algorithm, so that the digital twin model can fit the entity data more accurately, improve production efficiency and reduce production costs. Attached Figure Description
[0055] Other features, objects, and advantages of this application will become more apparent from the following detailed description of non-limiting embodiments with reference to the accompanying drawings:
[0056] Figure 1 This is a flowchart illustrating a method for constructing a digital twin model of an oil and gas well according to the present invention.
[0057] Figure 2 This is a schematic diagram illustrating the process of using a nested cross algorithm to verify a digital twin model, and then making corrections and deployments based on the verification results.
[0058] Figure 3 This is a schematic diagram of the structure of a digital twin model construction system for oil and gas wells according to the present invention. Detailed Implementation
[0059] The present application will now be described in further detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are for illustrative purposes only and are not intended to limit the invention. Furthermore, it should be noted that, for ease of description, only the parts relevant to the invention are shown in the accompanying drawings.
[0060] It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other. This application will now be described in detail with reference to the accompanying drawings and embodiments.
[0061] To more clearly illustrate the method for constructing a digital twin model of an oil and gas well according to the present invention, the following will be combined with... Figure 1 The steps in the embodiments of the present invention will be described in detail below.
[0062] A method for constructing a digital twin model of an oil and gas well according to the first embodiment of the present invention, see [link to relevant documentation]. Figure 1 The method includes the following steps:
[0063] Step S1: Obtain the physical data of the oil and gas wells for which the digital twin model is to be built, that is, obtain the physical data of the oil and gas wells on the reservoir grid points, as follows:
[0064] Step S11: Analyze the needs raised by stakeholders, break them down into several sub-needs, and define the functions based on the sub-needs;
[0065] First, we communicated with stakeholders through meetings and interviews to gather their needs for the digital twin model. In this embodiment, the oil company hopes to improve the operational efficiency of fracturing well sites through digital twin technology. After analyzing the needs, the needs were broken down into two sub-needs: reducing equipment failure rate and optimizing work processes. Corresponding functions were defined for each sub-need. For the first need, the function of predicting equipment failures was required; for the second need, the function of automatically identifying inefficient links in the work process was required.
[0066] Step S12: Determine the data to be collected based on the functional definition, including geological data, equipment data, fracturing operation data, and wellbore data;
[0067] The geological data that needs to be collected includes rock porosity, rock type, permeability, Poisson's ratio, rock fracture density, fracture length, fracture direction, formation fluid density, and bottom fluid viscosity.
[0068] Equipment data includes fracturing pump power, fracturing pump pressure, fracturing pump running time, mortar mixer feed rate, mixer stirring rate, mortar mixer temperature, pipeline pressure, valve open / close status, pump truck running status, pump truck location, and pump truck speed.
[0069] Fracturing operation data includes fracturing production duration, start time, fracturing fluid type, fracturing fluid injection volume, injection rate, fracturing fluid recovery volume, sand usage, pump type, pump inlet pressure, pump outlet pressure, motor temperature, microseismic data, daily oil production, and daily fluid production.
[0070] Wellbore data, including well depth, well diameter, wellbore curvature, tubing arrangement, wellhead working status, fluid level, fluid pressure, wellhead temperature, fluid flow rate, and fluid composition;
[0071] Step S13: Install and deploy data acquisition equipment to collect entity data;
[0072] See Figure 3 The data acquisition equipment includes sensors, recorders, and data acquisition cards. Then, based on the characteristics of the data acquisition object and the environment, the installation location of the data acquisition equipment is determined. At the same time, the distance between the data acquisition equipment and the data acquisition object, the installation height, and the orientation factors must be considered to ensure that the acquisition equipment can effectively acquire the required data. After completing the physical data acquisition, the physical data is uploaded to the cloud server via the network.
[0073] Step S2: Filter and process the entity data to obtain preprocessed data;
[0074] In this embodiment, the screening and processing includes data cleaning, data transformation, feature selection and construction, and dimensionality reduction, thereby processing multi-source heterogeneous data, ensuring data quality, and facilitating the establishment of accurate and reliable digital twin models;
[0075] Data cleaning is used to remove duplicates and handle missing values in entity data. The specific steps are as follows:
[0076] Step S211: Delete duplicate entity data to ensure the accuracy and consistency of the data and avoid duplicate data affecting the analysis results;
[0077] Step S212: Calculate the number of missing values in each feature of the entity data, divide it by the total number of data in that feature, obtain the missing rate of each feature, and supplement the missing values to improve the quality of the feature data and reduce the risk of modeling errors in the algorithm.
[0078] Step S213: For features with a missing rate less than M%, preferably 90%, use cubic spline interpolation to fill in the missing values. The formula used is as follows: g i (x)=a i +b i (xx i )+c i (xx i ) 2 +d i (xx i ) 3 ;
[0079] In the formula, g i The equation is a cubic polynomial function, where x is the insertion point. i For the i-th data node, a i b i c i d i These are the coefficients of the spline curve;
[0080] Step S214: For features with a missing rate greater than M%, preferably 90%, simple data filling is performed using linear interpolation, with the following formula:
[0081] In the formula, x1, y1 and x2, y2 are the x and y coordinates of two known points, x is the x coordinate of the point to be inserted, and y is the corresponding estimated value.
[0082] Data transformation specifically involves using one-hot encoding and label encoding methods to convert non-numerical data into numerical data, and then normalizing the numerical data.
[0083] It should be noted that unique thermal coding is suitable for classification data without any sequential relationship, including rock type, fracturing fluid type, pump type, and wellhead operating status; label coding is suitable for classification data with a natural order, including pump truck operating status and valve on / off status.
[0084] Data feature selection and construction specifically involves selecting relevant numerical data based on functional definitions, using the minimum entropy method for data binning, and leveraging the principle of information entropy to maximize the similarity of numerical data in each bin. The formula for information entropy is as follows:
[0085] In the formula, H i p(x) represents the entropy value of the i-th bin, n is the number of categories, and p(x) represents the entropy value of the i-th bin. ij Let represent the probability distribution of the i-th bin and the j-th category.
[0086] Data dimensionality reduction processing includes the following steps:
[0087] Step S241: Calculate the covariance matrix between features in the numerical data;
[0088] Step S242: Perform eigenvalue decomposition on the covariance matrix to obtain eigenvalues and corresponding eigenvectors;
[0089] Step S243: Sort the eigenvectors according to the size of their eigenvalues, and select the eigenvectors with eigenvalues greater than N as principal components. In this invention, N is preferably 1.
[0090] Step S244: Project the numerical data onto the selected principal components and perform dimensionality reduction to obtain the dimensionality-reduced preprocessed data.
[0091] Step S3: Construct a digital twin model based on the preprocessed data, including a physical model, a mechanistic model, and a digital model;
[0092] In this embodiment, the method for constructing a digital twin model based on the preprocessed data is as follows:
[0093] Step S31: Construct a physical model. In this embodiment, Creo Parametric and Unity 3D software are used to import the entity data of oil and gas well equipment to establish a three-dimensional physical model. When constructing the physical model, the geometric properties of the physical entity are defined (such as determining the shape and size of oil and gas well equipment, pipelines, etc.), motion properties (such as setting the degree of freedom, range and dynamic parameters of the equipment in motion), and functional properties (purpose, interaction method and response mechanism of each component). This includes changing and adjusting the geometric structure, texture details, texture characteristics and mechanism characteristics of the object according to the requirements to achieve accurate simulation of oil and gas well equipment.
[0094] Step S32: Based on the reservoir seepage equation and the Beggs-Brill model of multiphase flow in the wellbore, construct a mechanism model, determine the parameters and initial conditions involved in the mechanism model, and establish a reservoir-wellbore-surface collaborative mechanism model. That is, a model is established based on the internal mechanism of oil and gas wells and the material flow transmission mechanism, including parameters such as permeability, porosity, fluid viscosity, seepage velocity, pressure, and temperature.
[0095] Step S33: Construct a digital twin model: Based on the fracturing operation data on the reservoir grid points, calculate the pressure gradient between adjacent reservoir grid points, calculate the seepage velocity by combining permeability and fluid viscosity, and then calculate the flow parameters. This belongs to the mechanism model, which provides physical constraints for reservoir seepage in the digital model, ensuring that the simulation results conform to actual physical laws. The digital model is a digitized version of the physical model and the mechanism model, which is convenient for storage, representation, and simulation. The physical model, mechanism model, and digital model are combined with the LSTM model using a CNN model to obtain the digital twin model.
[0096] The calculation method for the flow rate parameters is as follows:
[0097] In the formula, v is the seepage velocity vector, k is the permeability tensor, and μ is the fluid viscosity. It is a pressure gradient, v SL and v SG These are the apparent velocities of the liquid and gas phases, respectively; g is the acceleration due to gravity; D is the pipe diameter; and ρ is the apparent velocity of the liquid phase and the apparent velocity of the gas phase. L and ρ G These are the densities of the liquid phase and the gas phase, respectively, N. VL It is the dimensionless fluid velocity, N VG It is a dimensionless gas velocity;
[0098] The digital model architecture includes: an input layer, a convolutional layer, a pooling layer, an LSTM layer, a fully connected layer, and an output layer.
[0099] Multiple convolutional layers are used to extract spatial features, with a kernel size of 3×3×3 and a stride of 2, employing the ReLU activation function. The number of units in the LSTM layer is set to 256. A linear activation function is used in the fully connected layer for production prediction, and the Sigmoid function is used to determine the well production status category. The output layer contains seven nodes, three of which predict production (oil, gas, and water production respectively), and the remaining four nodes determine the production status category, including high production, medium production, low production, and fault categories.
[0100] See Figure 2 The method for verifying the digital twin model using a nested cross-validation algorithm, and then correcting and deploying it based on the verification results, is as follows:
[0101] Step S41: Based on the physical data obtained from the fracturing operation site and the prediction results output by the digital twin model, construct a verification dataset. In this embodiment, the prediction result is: Oil production: 30 cubic meters of crude oil per day.
[0102] Gas production: 5,000 cubic meters of natural gas per day;
[0103] Water output: 10 cubic meters of water per day; Production status classification: "Medium production" status;
[0104] Step S42: Perform outer loop validation using K-Fold cross-validation: Based on the number of outer loop folds, the validation dataset is divided into training and test sets in each loop. The number of outer loop folds is denoted as K. i The training set is denoted as The test set is denoted as
[0105] Step S43: Perform inner loop validation using K-Fold cross-validation: Based on the number of folds in the inner loop, perform cross-validation on each... The dataset is divided into an inner training set and an inner test set, and the inner loop fold number is denoted as K. j The inner training set is denoted as Inner test set denoted as
[0106] Step S44: Obtain the optimal hyperparameter set. During each iteration, randomly sample the hyperparameter set of the digital twin model to form a set, denoted as θ. Train the digital model on the inner training set and validate it using the inner test set. Using the average loss function, select the subset of hyperparameters with the smallest average loss function as the optimal hyperparameter set, denoted as θ. * The calculation method is as follows:
[0107] Step S441: Calculate the prediction result using forward propagation: Based on the parameters of the current digital twin model, calculate the output value of each neuron sequentially from the input layer of the digital twin model until the prediction result of the output layer is obtained;
[0108] Step S442: Use the average loss function to represent the error between the predicted result and the actual result. Select a subset of the hyperparameters with the smallest average loss function as the optimal hyperparameter set, denoted as θ. * The calculation method is as follows:
[0109] In the formula, argmin θ This indicates that θ is selected from the minimum value in the array. This represents the nth inner test subset. Let L represent the nth inner layer training subset, and let f be the loss function. θ For training digital twin models;
[0110] Step S443: Propagate the error from the output layer to the input layer through the backpropagation algorithm, and adjust the hyperparameter set of the digital twin model according to the error to minimize the average loss function of the digital twin model on the inner training set.
[0111] Step S444: Calculate the gradient of each parameter and hyperparameter with respect to the loss function based on the chain rule, and update the parameters and hyperparameters according to the gradient descent algorithm. The calculation method is as follows: α = α0 / 1 + decay × epoch;
[0112] In the formula, α is the learning rate, α0 is the initial learning rate, decay is the decay rate, epoch is the current training epoch, W is the weight, b is the bias, l represents the layer order of the digital twin model, and i represents the neuron number. This represents the updated weights from the i-th neuron in layer (l-1) to the i-th neuron in layer l. This represents the weights from the j-th neuron in layer (l-1) to the i-th neuron in layer l. This represents the bias of the i-th neuron in the l-th layer after the update. This represents the bias of the i-th neuron in the l-th layer. This represents the error value of the j-th neuron in the l-th layer. This represents the output value of the i-th neuron in the (l-1)-th layer. This represents the error value of the i-th neuron in the l-th layer;
[0113] Step S45: Using θ* and Training digital models and computing digital twin models On the performance indicators;
[0114] In this embodiment, the performance metrics include precision, recall, and F1 score. Precision represents the proportion of correct predictions made by the digital model out of the total samples; recall represents the proportion of correct predictions made by the digital model among all actual positive examples; and the F1 score is the harmonic mean of precision and recall, used to achieve a balance between precision and recall.
[0115] Step S46: Obtain evaluation results: Repeat steps S42-S45 until the outer loop stops, and use the average value of the performance indicators as the evaluation result of the digital twin model;
[0116] Step S47: Based on the evaluation results of the digital twin model, determine whether the evaluation criteria are met. Meeting the evaluation criteria is defined as precision, recall, and F1 score all reaching 0.8 or higher. If the criteria are met, deploy the digital model; otherwise, return to step S2. In this embodiment, the evaluation results of the digital twin model after 5 iterations of evaluation are as follows:
[0117] Finally, the effective digital twin model is uploaded to the cloud server using tools provided by the cloud service provider or command-line tools, and deployed to the oil well digital twin ecosystem platform. After deployment, the digital model is tested using real physical data from the fracturing operation site to ensure that the digital model can operate normally. During the operation of the digital model, the accuracy and performance of the digital model are tested to verify and update the digital model.
[0118] Although the steps in the above embodiments are described in the above order, those skilled in the art will understand that in order to achieve the effect of this embodiment, different steps do not need to be executed in such an order. They can be executed simultaneously (in parallel) or in a reverse order. These simple variations are all within the protection scope of this invention.
[0119] A digital twin model construction system for oil and gas wells according to a second embodiment of the present invention includes: a data acquisition device and a cloud server;
[0120] The data acquisition device includes sensors, recorders, and data acquisition cards; the data acquisition device is configured to acquire physical data of the oil and gas wells to be used as input data; the physical data includes geological data, equipment data, fracturing operation data, and wellbore data.
[0121] In this embodiment, the cloud server is configured to receive input data sent by the data acquisition device; filter and process the entity data to obtain preprocessed data; the filtering and processing includes data cleaning, data transformation, feature selection and construction, and dimensionality reduction.
[0122] A digital twin model is constructed based on the preprocessed data; the digital twin model includes a physical model, a mechanistic model, and a digital model.
[0123] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working process and related descriptions of the system described above can be found in the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0124] It should be noted that the system based on a digital twin model of an oil and gas well provided in the above embodiments is only an example of the division of the above functional modules. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the modules or steps in the embodiments of the present invention can be further decomposed or combined. For example, the modules in the above embodiments can be merged into one module, or further divided into multiple sub-modules to complete all or part of the functions described above. The names of the modules and steps involved in the embodiments of the present invention are only for distinguishing the various modules or steps and are not considered as an improper limitation of the present invention.
[0125] An electronic device according to a third embodiment of the present invention includes: at least one processor; and a memory communicatively connected to at least one of the processors; wherein the memory stores instructions executable by the processor, the instructions being executed by the processor to implement the above-described method for constructing a digital twin model of an oil and gas well.
[0126] A fourth embodiment of the present invention provides a computer-readable storage medium storing computer instructions, which are executed by the computer to implement the above-described method for constructing a digital twin model of an oil and gas well.
[0127] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working process and related descriptions of the electronic device and computer-readable storage medium described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0128] Those skilled in the art will recognize that the modules and method steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. The programs corresponding to the software modules and method steps can be placed in random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disks, removable disks, CD-ROMs, or any other form of storage medium known in the art. To clearly illustrate the interchangeability of electronic hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in electronic hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the invention.
[0129] The terms “first”, “second”, etc., are used to distinguish similar objects, not to describe or indicate a specific order or sequence.
[0130] The term "comprising" or any other similar term is intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus / device that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent in such process, method, article, or apparatus / device.
[0131] The technical solution of the present invention has been described above with reference to the preferred embodiments shown in the accompanying drawings. However, it will be readily understood by those skilled in the art that the scope of protection of the present invention is obviously not limited to these specific embodiments. Without departing from the principles of the present invention, those skilled in the art can make equivalent changes or substitutions to the relevant technical features, and the technical solutions after these changes or substitutions will all fall within the scope of protection of the present invention.
Claims
1. A method for constructing a digital twin model of an oil and gas well, characterized in that, The method includes the following steps: Step S1: Obtain the entity data of the oil and gas wells to be constructed in the digital twin model at the reservoir grid points as input data; the entity data includes geological data, equipment data, fracturing operation data, and wellbore data; Step S2: Filter and process the entity data to obtain preprocessed data; the filtering and processing includes data cleaning, data transformation, feature selection and construction, and dimensionality reduction. Step S3: Construct a digital twin model based on the preprocessed data; the digital twin model includes a physical model, a mechanistic model, and a digital model; Step S4: The digital twin model is verified using a nested cross-validation algorithm, and then corrected and deployed based on the verification results.
2. The method for constructing a digital twin model of an oil and gas well according to claim 1, characterized in that, The specific steps for data cleaning are as follows: Step S211: Delete duplicate entity data; Step S212: Calculate the missing rate of each feature in the entity data; Step S213: For features with a missing rate less than M%, use cubic spline interpolation to impute the missing values of the features: g i (x)=a i +b i (x-x i )+c i (x-x i ) 2 +d i (x-x i ) 3 ; In the formula, g i The equation is a cubic polynomial function, where x is the insertion point. i For the i-th data node, a i b i c i d i These are the coefficients of the spline curve; Step S214: For features with a missing rate greater than M%, use linear interpolation to impute the missing values of the features: In the formula, x1, y1 and x2, y2 are the x and y coordinates of two known points, x is the x coordinate of the point to be inserted, and y is the corresponding estimated value.
3. The method for constructing a digital twin model of an oil and gas well according to claim 1, characterized in that, The dimensionality reduction process is performed as follows: Step S241: Calculate the covariance matrix between features in the numerical data; Step S242: Perform eigenvalue decomposition on the covariance matrix to obtain eigenvalues and corresponding eigenvectors; Step S243: Sort the eigenvectors according to the size of their eigenvalues, and select the eigenvectors with eigenvalues greater than N as principal components; Step S244: Project the numerical data onto the selected principal components and perform dimensionality reduction to obtain the dimensionality-reduced preprocessed data.
4. The method for constructing a digital twin model of an oil and gas well according to claim 1, characterized in that, The method for constructing a digital twin model based on the preprocessed data is as follows: Step S31: Define the geometric, motion, and functional properties of the physical entity and construct a three-dimensional physical model; Step S32: Based on the reservoir seepage equation and the Beggs-Brill model of multiphase flow in the wellbore, construct a mechanism model, determine the parameters and initial conditions involved in the mechanism model, and establish a reservoir-wellbore-surface collaborative mechanism model; Step S33: Based on the pump inlet pressure and pump outlet pressure of the fracturing operation data on the reservoir grid points, calculate the pressure gradient between adjacent reservoir grid points, calculate the seepage velocity by combining permeability and fluid viscosity, and then calculate the flow rate parameters. Based on the mechanism model, provide reservoir seepage physical constraints for the digital model. Use a CNN model combined with an LSTM model to establish a digital twin model. The calculation method for the flow rate parameters is as follows: In the formula, v is the seepage velocity vector, k is the permeability tensor, and μ is the fluid viscosity. It is a pressure gradient, v SL and v SG These are the apparent velocities of the liquid and gas phases, respectively; g is the acceleration due to gravity; D is the pipe diameter; and ρ is the apparent velocity of the liquid phase and the apparent velocity of the gas phase. L and ρ G These are the densities of the liquid phase and the gas phase, respectively, N. VL It is the dimensionless fluid velocity, N VG It is a dimensionless gas velocity; The digital twin model architecture includes: an input layer, a convolutional layer, a pooling layer, an LSTM layer, a fully connected layer, and an output layer.
5. The method for constructing a digital twin model of an oil and gas well according to claim 1, characterized in that, The method for verifying the digital twin model using a nested cross-validation algorithm, and then revising and deploying it based on the verification results, is as follows: Step S41: Construct a validation dataset based on the physical data obtained from the fracturing operation site and the prediction results output by the digital twin model; Step S42: Perform outer loop validation using K-Fold cross-validation: Based on the number of outer loop folds, the validation dataset is divided into training and test sets in each loop. The number of outer loop folds is denoted as K. i The training set is denoted as The test set is denoted as Step S43: Perform inner loop validation using K-Fold cross-validation: Based on the number of folds in the inner loop, perform cross-validation on each... The dataset is divided into an inner training set and an inner test set, and the inner loop fold number is denoted as K. j The inner training set is denoted as Inner test set denoted as Step S44: Obtain the optimal hyperparameter set. In each iteration, randomly sample the hyperparameter set of the digital twin model to form a set, denoted as θ. Train the digital model on the inner training set and verify it using the inner test set. Select the subset of hyperparameters with the smallest average loss function as the optimal θ. * ; Step S45: Combine the aforementioned θ * and Train the digital twin model and calculate the digital twin model in The performance metrics include precision, recall, and F1 score, where the F1 score is the harmonic mean of precision and recall. Step S46: Repeat steps S42-S45 until the outer loop stops, and use the average value of the obtained performance indicators as the evaluation result of the digital twin model. Step S47: Determine whether the digital twin model meets the set evaluation criteria based on the evaluation results. If yes, deploy the digital twin model; otherwise, return to step S2.
6. The method for constructing a digital twin model of an oil and gas well according to claim 7, characterized in that, The digital model is trained on the inner training set and validated using the inner test set. The subset of hyperparameters with the minimum average loss function is selected as the optimal θ. * The calculation method is as follows: Step S441: Calculate the prediction result using forward propagation: Based on the parameters of the current digital twin model, calculate the output value of each neuron sequentially from the input layer of the digital twin model until the prediction result of the output layer is obtained; Step S442: Use the average loss function to represent the error between the predicted result and the actual result. Select a subset of the hyperparameters with the smallest average loss function as the optimal hyperparameter set, denoted as θ. * The calculation method is as follows: In the formula, argmin θ This indicates that θ is selected from the minimum value in the array. This represents the nth inner test subset. Let L represent the nth inner layer training subset, and let f be the loss function. θ For training digital twin models; Step S443: Propagate the error from the output layer to the input layer through the backpropagation algorithm, and adjust the hyperparameter set of the digital twin model according to the error to minimize the average loss function of the digital twin model on the inner training set. Step S444: Calculate the gradient of each parameter and hyperparameter with respect to the loss function based on the chain rule, and update the parameters and hyperparameters according to the gradient descent algorithm. The calculation method is as follows: α = α0 / 1 + decay × epoch; In the formula, α is the learning rate, α0 is the initial learning rate, decay is the decay rate, epoch is the current training epoch, W is the weight, b is the bias, l represents the layer order of the digital twin model, and i represents the neuron number. This represents the updated weights from the j-th neuron in layer (l-1) to the i-th neuron in layer l. This represents the weights from the j-th neuron in layer (l-1) to the i-th neuron in layer l. This represents the bias of the i-th neuron in the l-th layer after the update. This represents the bias of the i-th neuron in the l-th layer. This represents the error value of the j-th neuron in the l-th layer. This represents the output value of the i-th neuron in the (l-1)-th layer. This represents the error value of the i-th neuron in the l-th layer.
7. A system for constructing digital twin models of oil and gas wells, based on the method for constructing digital twin models of oil and gas wells according to any one of claims 1-8, characterized in that, The system includes: data acquisition equipment and a cloud server; The data acquisition device includes sensors, recorders, and data acquisition cards; the data acquisition device is configured to acquire physical data of the oil and gas wells to be used as input data for constructing a digital twin model. The cloud server is configured to receive input data sent by the data acquisition device; filter and process the entity data to obtain preprocessed data; A digital twin model is constructed based on the preprocessed data; the digital twin model includes a physical model, a mechanistic model, and a digital model.
8. An electronic device, characterized in that, include: At least one processor; and a memory communicatively connected to at least one of the processors; The memory stores instructions that can be executed by the processor to implement the method for constructing a digital twin model of an oil and gas well as described in any one of claims 1-8.