An oilfield production prediction method and system based on digital twin technology
By constructing an oilfield production prediction model using digital twin technology, and combining an improved random forest algorithm and a bidirectional xLSTM algorithm, the problems of real-time performance and accuracy in oilfield production prediction in traditional methods are solved. This enables real-time monitoring and rapid early warning of oilfield production, thereby improving production efficiency and safety.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- NORTHEAST GASOLINEEUM UNIV
- Filing Date
- 2024-10-16
- Publication Date
- 2026-06-09
AI Technical Summary
Existing oilfield production forecasting methods rely on empirical data analysis and traditional monitoring methods, which make it difficult to achieve real-time monitoring and accurate early warning, resulting in lagging oilfield management and affecting safe production and economic benefits.
An oilfield production prediction method based on digital twin technology is adopted. After acquiring oilfield production process data and preprocessing it, a twin model is constructed. An improved random forest algorithm and bidirectional xLSTM algorithm are used to predict production and monitor and issue early warnings in real time.
It enables accurate prediction and rapid early warning of oilfield production, helping to identify production problems in a timely manner, optimize production processes, improve oilfield production efficiency and safety, and reduce operating costs.
Smart Images

Figure CN119377571B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of oilfield monitoring technology, specifically to an oilfield production prediction method and system based on digital twin technology. Background Technology
[0002] A digital twin is a virtual model designed to accurately reflect a physical object. It equips the object with various sensors related to key functional aspects, generating data about various aspects of the physical object's performance. This data is then forwarded to a processing system and applied to the digital copy. Once this data is available, the virtual model can be used to run simulations, investigate performance issues, and generate potential improvements; all in order to gain valuable insights that can then be applied back to the original physical object.
[0003] Currently, oilfield production forecasting and early warning mainly rely on empirical data analysis and traditional monitoring methods. Oilfield production environments are complex and variable, with numerous factors influencing production, including well geological conditions and external environmental impacts. Traditional production forecasting methods, such as linear regression and time series analysis, typically rely on model fitting based on historical data. These methods have limitations when dealing with the combined impact of multi-dimensional data during oilfield production.
[0004] Furthermore, traditional monitoring methods rely heavily on periodic testing of on-site instruments and equipment, resulting in long data acquisition cycles and limited accuracy, making it difficult to achieve real-time monitoring and dynamic analysis of oilfield production processes. This can lead to untimely early warnings of abnormal conditions in oilfields and delays in oilfield management, impacting safe production and economic benefits. Therefore, how to achieve real-time monitoring, accurate prediction, and rapid early warning of oilfield production processes has become an urgent problem to be solved in the field of oilfield management. Summary of the Invention
[0005] In view of this, the present invention proposes an oilfield production prediction method and system based on digital twin technology, in an attempt to solve or alleviate one or more of the above-mentioned problems.
[0006] According to one aspect of the present invention, an oilfield production prediction method based on digital twin technology is proposed, the method comprising the following steps:
[0007] Obtain oilfield production process data and historical oilfield production data;
[0008] The oilfield production process data is preprocessed;
[0009] A twin model is constructed, and preprocessed oilfield production process data and historical oilfield production data are input into the twin model to predict oilfield production and obtain oilfield production prediction results; the twin model includes data prediction and real-time monitoring.
[0010] Furthermore, the oilfield production process data includes: discharge rate, pump depth, production days, water cut, dynamic fluid level, gas-oil ratio, fluid production from surrounding oil wells, and water injection from surrounding water injection wells.
[0011] Furthermore, the preprocessing includes:
[0012] Oilfield production process data collected at different times or on different dates within a day are grouped into a data set, and the mean and variance of the data set are calculated. Based on the mean and variance, it is determined whether the data in the data set are outliers, and the outliers are corrected using linear interpolation. The corrected data set is then initially normalized, and the standard deviation and mean of the initially normalized data set are calculated. The ratio of the standard deviation to the mean is defined as the volatility coefficient. If the volatility coefficient is less than or equal to a preset threshold, the corrected data set is renormalized using the max-min normalization method. If the volatility coefficient is greater than the preset threshold, the corrected data set is renormalized using the logarithmic normalization method.
[0013] Furthermore, the preprocessing also includes: for the fluid production of surrounding oil wells and the water injection volume of surrounding water injection wells in the oilfield production process data, a time increase factor is introduced to weight them, and the weighted predicted water injection volume of adjacent water injection wells and predicted fluid production of adjacent oil wells are used to replace the original fluid production volume of surrounding oil wells and the water injection volume of surrounding water injection wells.
[0014] Furthermore, the weighted predicted water injection volume of adjacent water injection wells and the predicted fluid production volume of adjacent oil wells are expressed as follows:
[0015]
[0016] In the formula, W represents the predicted water injection rate from nearby injection wells; Q represents the predicted fluid production rate from nearby oil wells; ω α and ω β Indicates the time-increase factor. This indicates the weight of the impact of changes in water injection volume over time. The weighting of the effect of time on the yield is represented by λ, which is the time decay coefficient, and d j Let be the distance between the j-th producing well and the predicted oil well, t represent time, a represent the number of water injection wells surrounding the predicted oil well, and W represent the distance between the j-th producing well and the predicted oil well. i Let b be the water injection volume of the i-th injection well; b be the predicted number of production wells surrounding the oil well; Q j Let be the fluid production of the j-th production well.
[0017] Furthermore, the step of inputting the preprocessed oilfield production process data and historical oilfield production data into the twin model for oilfield production prediction includes:
[0018] An improved random forest algorithm is constructed. Preprocessed oilfield production process data is input into the improved random forest algorithm for processing to obtain preliminary oilfield production prediction results. The improved random forest algorithm includes: for each decision tree, an adaptive boosting strategy is used to adjust the sample weights based on the error of the previous iteration; during node splitting, a dynamic control mechanism is used to automatically adjust the computation depth of the decision tree.
[0019] A bidirectional xLSTM algorithm is constructed, and the preliminary oilfield production prediction results and historical oilfield production data are input into the bidirectional xLSTM algorithm to obtain the final oilfield production prediction results; wherein, the bidirectional xLSTM algorithm includes forward xLSTM and backward xLSTM.
[0020] Furthermore, the step of inputting the preliminary oilfield production forecast results and historical oilfield production data into the bidirectional xLSTM algorithm to obtain the final oilfield production forecast results includes:
[0021] The historical production data of the oilfield and the preliminary production prediction results of the oilfield are input into the forward xLSTM in sequence, and then passed through the input gate, forget gate, candidate memory unit, update memory unit and output gate in sequence to obtain the forward oilfield production prediction results.
[0022] The preliminary oilfield production forecast and historical oilfield production data are sequentially input into the backward xLSTM, passing through the input gate, forget gate, candidate memory unit, update memory unit and output gate to obtain the backward oilfield production forecast result.
[0023] The average of the forward oilfield production forecast and the backward oilfield production forecast is taken as the final oilfield production forecast.
[0024] Furthermore, the step of adjusting the sample weights for each decision tree using an adaptive boosting strategy based on the error of the previous iteration includes:
[0025] Initialize the same weights for each sample. Where N is the total number of samples; weights ω are used. i Construct a decision tree and calculate the prediction error, which is expressed as:
[0026]
[0027] Among them, y i This represents the actual value of the oilfield production process data. These are predicted values from oilfield production process data. It is an indicator function; a prediction error equals 1, and a correct prediction equals 0; i = 1, 2, ..., N
[0028] An error threshold is set. For samples whose prediction error exceeds the error threshold, their weights will increase in the next iteration. The weight update formula is as follows:
[0029]
[0030] Where α represents the learning rate, ω i "" represents the weight of the sample in the current iteration, ω i ′ represents the sample weight for the next iteration;
[0031] The automatic adjustment of the decision tree's computational depth using a dynamic control mechanism during node splitting includes:
[0032] When splitting at each node, calculate the sample complexity C of the current node;
[0033] Calculate the maximum tree depth d based on the sample complexity C. max :d max =α·C+d0, where α represents the adjustment parameter and d0 represents the initial depth parameter;
[0034] Set a complexity threshold τ when the maximum tree depth d max Splitting stops when the complexity threshold τ is greater than or equal to the complexity threshold τ.
[0035] Furthermore, the real-time monitoring includes displaying the oilfield production process data and oilfield production forecast results in real time; the method also includes: triggering an alarm when the oilfield production forecast results are abnormal.
[0036] According to another aspect of the present invention, an oilfield production prediction system based on digital twin technology is proposed, the system comprising:
[0037] The data acquisition module is configured to acquire oilfield production process data and historical oilfield production data; the oilfield production process data includes: discharge rate, pump depth, production days, water cut, dynamic fluid level, gas-oil ratio, fluid production of surrounding oil wells, and water injection volume of surrounding water injection wells;
[0038] A preprocessing module is configured to preprocess the oilfield production process data. The preprocessing includes: forming a data set from oilfield production process data collected at different times or on different dates within a day, and calculating the mean and variance of the data set; determining whether the data in the data set are outliers based on the mean and variance, and correcting the outliers using linear interpolation; performing initial normalization on the corrected data set, calculating the standard deviation and mean of the initially normalized data set, defining the ratio of the standard deviation to the mean as the fluctuation coefficient; if the fluctuation coefficient is less than or equal to a preset threshold, renormalizing the corrected data set using the max-min normalization method; if the fluctuation coefficient is greater than the preset threshold, renormalizing the corrected data set using the logarithmic normalization method; wherein, for the production volume of surrounding oil wells and the water injection volume of surrounding water injection wells in the oilfield production process data, a time-increase factor is introduced to weight them, and the weighted predicted water injection volume and production volume of adjacent water injection wells replace the original production volume and water injection volume of surrounding oil wells.
[0039] The production prediction module is configured to construct a twin model, input preprocessed oilfield production process data and historical oilfield production data into the twin model to predict oilfield production and obtain oilfield production prediction results; the twin model includes data prediction and real-time monitoring.
[0040] The beneficial technical effects of this invention are:
[0041] This invention proposes an oilfield production prediction method and system based on digital twin technology. First, oilfield production process data and historical oilfield production data are acquired; the oilfield production process data is preprocessed; a twin model is constructed, and the preprocessed oilfield production process data and historical oilfield production data are input into the twin model to predict oilfield production and obtain the oilfield production prediction result.
[0042] Specifically, this invention collects multiple key parameters during oilfield production in real time, including displacement, pump depth, water cut, dynamic fluid level, and gas-oil ratio. These data are then cleaned and normalized to provide high-quality input data for subsequent digital twin modeling. In digital twin modeling, an improved random forest algorithm is employed, combined with an adaptive boosting strategy and a dynamic depth control mechanism. The output data is then combined with the original data and input into a bidirectional xLSTM model for prediction, improving the accuracy and generalization ability of production prediction. By analyzing oil well production data, the model can effectively capture the complex dynamic changes in the oilfield production process, thereby achieving accurate prediction of oilfield production. Furthermore, based on the prediction results, oilfield production is monitored in real time, and emergency response measures are automatically triggered when production is abnormal. The early warning mechanism, based on the comparison of predicted values with historical data and preset thresholds, can quickly identify potential production anomalies and provide targeted emergency response plans to ensure the safety and stability of oilfield production.
[0043] Through real-time monitoring and precise early warning, this invention helps oilfield managers promptly identify potential problems in the production process, reduce production losses caused by equipment failures or abnormal process parameters, and improve oilfield production efficiency and safety. Simultaneously, the intelligent early warning mechanism can guide managers to take effective countermeasures, optimize production processes, and reduce operating costs. Attached Figure Description
[0044] The present invention can be better understood by referring to the description given below in conjunction with the accompanying drawings, which together with the following detailed description are included in and form part of this specification, and are used to further illustrate preferred embodiments of the invention and explain the principles and advantages of the invention.
[0045] Figure 1 This is a flowchart of an oilfield production prediction method based on digital twin technology, as described in an embodiment of the present invention.
[0046] Figure 2 This is a schematic diagram of the structure of an oilfield production prediction system based on digital twin technology, as described in an embodiment of the present invention. Detailed Implementation
[0047] To enable those skilled in the art to better understand the present invention, exemplary embodiments or examples of the present invention will be described below in conjunction with the accompanying drawings. Obviously, the described embodiments or examples are merely some, not all, of the embodiments or examples of the present invention. All other embodiments or examples obtained by those skilled in the art based on the embodiments or examples of the present invention without inventive effort should fall within the scope of protection of the present invention.
[0048] This invention proposes an optimization method for intelligent oilfield management based on digital twin technology, such as... Figure 1 As shown, the method includes the following steps:
[0049] S1. Obtain oilfield production process data and historical oilfield production data;
[0050] S2. Preprocess the oilfield production process data;
[0051] S3. Construct a twin model, input the preprocessed oilfield production process data and historical oilfield production data into the twin model to predict oilfield production and obtain the oilfield production prediction results; the twin model includes data prediction and real-time monitoring.
[0052] The method begins with S1. In S1, oilfield production process data and historical oilfield production data are acquired.
[0053] According to embodiments of the present invention, high-precision sensors and monitoring equipment are employed, combined with wireless communication and data acquisition instruments, to achieve efficient acquisition and transmission of oilfield production data. Key data from individual oil wells during the oilfield production process are acquired in real time, with a focus on parameters that directly impact production forecasting. Oilfield production process data includes discharge rate, pump depth, production days, water cut, dynamic fluid level, gas-oil ratio, fluid production from surrounding oil wells, water injection volume from surrounding water injection wells, and historical oil well production.
[0054] Displacement: refers to the volume of liquid transported by a pump per unit time, expressed in cubic meters per day (m³ / day). 3 The unit is / d). Liquid discharge is monitored in real time by a flow sensor installed at the oil well pump outlet. Based on the principle of electromagnetic induction, the flow sensor accurately measures the volume of liquid delivered by the pump per unit time. Data is collected every 2 hours, recording the discharge value per unit time.
[0055] Pump depth: refers to the installation depth of the pump in the oil well, measured in meters (m). The pump installation depth is determined using a depth sensor installed in the oil well or by using existing wellbore depth data. The depth sensor utilizes ultrasonic measurement technology to accurately measure the pump installation depth. A one-time measurement is taken during pump installation or maintenance and recorded.
[0056] Production days: This refers to the cumulative number of production days recorded for each oil well. The cumulative production days are recorded by the oil well production management personnel.
[0057] Water cut: refers to the volume percentage of water contained in the produced fluid. An online water cut analyzer is installed at the well outlet to analyze the water content in the produced fluid in real time. Data is collected every 2 hours, and the percentage value of water cut is recorded.
[0058] Dynamic fluid level: refers to the fluid level in the wellbore during production, measured in meters (m). A sonic logging tool is used to monitor the fluid level in the wellbore in real time. The sonic logging tool emits sonic pulses and calculates the time difference between the sound waves reflecting back from the fluid surface to accurately measure the fluid level. Data is collected every 2 hours, and the dynamic fluid level value is recorded.
[0059] Gas-to-oil ratio: This refers to the ratio of gas produced by an oil well to crude oil produced, expressed in cubic meters per cubic meter (m³). 3 / m 3 The ratio of produced gas to produced crude oil is measured in real time using a two-phase flow meter installed at the oil well outlet. This flow meter is based on a capacitive sensor and can accurately measure the volumetric flow rate of the two-phase flow. Data is collected every 2 hours, and the gas-oil ratio is recorded.
[0060] Surrounding well production: This refers to the total amount of liquid produced by an oil well per unit time, typically including crude oil and accompanying water. It is measured in cubic meters. The production volume of surrounding oil wells is recorded every 2 hours using a flow sensor at the oil well.
[0061] Water injection volume from surrounding injection wells: This refers to the amount of water injected into the reservoir through injection wells to maintain reservoir pressure or improve reservoir recovery. It is measured in cubic meters. The injection volume from surrounding injection wells is recorded every two hours using flow sensors at the oil wells.
[0062] Historical oilfield production data refers to the production of a specific oil well on a specific day in history, measured in cubic meters, and recorded once a day.
[0063] Then, step S2 is executed, in which the oilfield production process data is preprocessed. The preprocessing includes: forming a data set from oilfield production process data collected at different times or on different dates within a day, and calculating the mean and variance of the data set; determining whether the data in the data set are outliers based on the mean and variance, and correcting the outliers using linear interpolation; performing initial normalization on the corrected data set, calculating the standard deviation and mean of the initially normalized data set, defining the ratio of the standard deviation to the mean as the fluctuation coefficient; if the fluctuation coefficient is less than or equal to a preset threshold, then re-normalizing the corrected data set using the max-min normalization method; if the fluctuation coefficient is greater than the preset threshold, then re-normalizing the corrected data set using the logarithmic normalization method; wherein, for the production volume of surrounding oil wells and the water injection volume of surrounding water injection wells in the oilfield production process data, a time-increase factor is introduced to weight them, and the weighted predicted water injection volume and predicted production volume of adjacent water injection wells replace the original production volume and water injection volume of surrounding oil wells.
[0064] According to embodiments of the present invention, the collected multi-dimensional data is preprocessed, including data cleaning, outlier handling, and normalization, to provide high-quality input data for the production prediction model. In actual oil reservoirs, the number of water injection wells and oil wells adjacent to each oil well is uncertain. For ease of calculation, the input sample matrix of the production prediction model requires a fixed number of columns. When analyzing the production of predicted oil wells, the distance to neighboring oil wells should be considered an important factor. Generally, the distance to neighboring oil wells has a directly proportional relationship with the predicted oil wells: closer oil wells have a more significant impact on the predicted oil wells, while farther oil wells have a relatively smaller impact. Therefore, a time increment factor is introduced:
[0065]
[0066] In the formula, ω α and ω β Indicates the time-increase factor. This indicates the weight of the impact of changes in water injection volume over time. The weight of the effect of time on the yield is represented by λ, which is the time decay coefficient, indicating the rate of decay of the weight over time. j Let t represent time; W represent the distance between the j-th production well and the predicted oil well; a represent the water injection volume of the adjacent water injection wells; and a represent the number of water injection wells surrounding the predicted oil well. i Let be the water injection volume of the i-th injection well; Q represents the predicted fluid production of neighboring wells; b is the number of production wells surrounding the predicted well; Q j Let be the fluid production of the j-th production well.
[0067] After the above processing, daily or multi-day data are treated as a set of data. Each sample x includes multiple parameter inputs: x = [displacement rate, pump depth, production time, water cut, dynamic fluid level, gas-oil ratio, production volume of surrounding oil wells, and water injection volume of surrounding water injection wells]. The number of input layer nodes for the production prediction model is set to 8. Finally, a set of data x is obtained. ij :
[0068]
[0069] Next, data processing is performed. First, outlier handling is done, which can be done using the 3σ criterion. For each data set x... ij Its average value μ can be calculated. i and variance σ i :
[0070]
[0071] If each data group x ij A certain data value exceeds μ i +3σ i or less than μi -3σ i If a value is not found, it is considered an outlier and corrected using interpolation. For detected outliers or missing values, linear interpolation can be used to correct them and obtain the data set x. i ′ j .
[0072]
[0073] In this embodiment, a decision mechanism for the normalization method is established, and the decision mechanism is used to select a normalization method to normalize the corrected data set; specifically:
[0074] The corrected data set is initially normalized to [0,1]; the standard deviation σ and mean μ of the initially normalized data set are calculated; the decision mechanism of the normalization method is set as follows: the ratio of the standard deviation σ to the mean μ is the volatility coefficient C. v If C v If the value is ≤0.1 (preset threshold), then the modified data set is normalized using max-min normalization, as shown below:
[0075]
[0076] In the formula, x i ′ j For the i-th parameter value of the j-th sample in the corrected dataset, max(x′) j ) and min(x′ j ) are the maximum and minimum values of the j-th sample, respectively; x i ′ j x′ represents the normalized data set; x′ j This represents the data in the j-th column of the data set;
[0077] If C v If the value is greater than 0.1, then logarithmic normalization is used to normalize the corrected data set, as shown below:
[0078]
[0079] The normalized data set is represented as a matrix, where each row represents the oilfield production data for a given day, and the columns represent different parameters. Each data point is a normalized value of a specific parameter during the oilfield production process.
[0080] Then, S3 is executed. In S3, a twin model is constructed, and the preprocessed oilfield production process data and historical oilfield production data are input into the twin model to predict oilfield production and obtain the oilfield production prediction result. Specifically, this includes: constructing a random forest algorithm with an adaptive boosting strategy, inputting the preprocessed oilfield production process data into the random forest algorithm with an adaptive boosting strategy to obtain the preliminary oilfield production prediction result; wherein, the adaptive boosting strategy is: during the training process, each decision tree weights the training samples according to the prediction error of the previous decision tree to automatically adjust the computation depth of the decision tree; constructing a bidirectional xLSTM algorithm, inputting the preliminary oilfield production prediction result into the bidirectional xLSTM algorithm to obtain the final oilfield production prediction result; wherein, the bidirectional xLSTM algorithm includes forward xLSTM and backward xLSTM.
[0081] According to an embodiment of the present invention, oilfield production is predicted by an improved random forest algorithm and a bidirectional xLSTM model. The random forest algorithm introduces an adaptive boosting strategy and dynamically controls the depth of each tree according to data characteristics. The bidirectional xLSTM model improves the generalization ability and parallel processing efficiency of the model by introducing exponential gating and enhanced memory structure.
[0082] 1) Improved Random Forest Algorithm
[0083] Traditional random forest algorithms use random sampling to extract training data when constructing each decision tree, and then simply average the output of each tree before taking the average of all decision tree predictions as the final prediction. First, this embodiment of the invention introduces an adaptive boosting strategy: during training, each tree weights its samples based on the error of the previous tree. The adaptive boosting process is as follows:
[0084] 11) Initialize the same weights for each training sample. Where N is the total number of training samples, and the training samples are each row in the oilfield production process data set.
[0085] 12) Using existing sample weights ω i Construct a decision tree and calculate the prediction error; the prediction error is expressed as:
[0086]
[0087] Among them, y i This represents the actual value of the oilfield production process data. These are predicted values from oilfield production process data. It is an indicator function; a prediction error equals 1, and a correct prediction equals 0. i = 1, 2, ..., N
[0088] 13) Set an error threshold. For samples whose prediction error exceeds the error threshold, their weights will increase in the next iteration. Finally, calculate the error rate of the decision tree. The weight update formula is:
[0089]
[0090] Where α represents the learning rate, ω i "" represents the weight of the sample in the current iteration, ω i ′ represents the sample weight for the next iteration;
[0091] Each iteration builds a new decision tree and updates the sample weights based on the prediction error until the predetermined number of trees is reached. Through this process, subsequent decision trees will pay more attention to those samples that are difficult to predict, thereby enhancing the model's generalization ability and accuracy.
[0092] Secondly, traditional random forest algorithms typically set a fixed maximum depth for each tree. This invention introduces a dynamic control mechanism, allowing each tree to automatically adjust its depth based on the complexity of its features, thus avoiding model overfitting. The specific process is as follows:
[0093] 14) Calculate the sample complexity of the current node at each node split. The complexity C can be estimated using the variance of the oilfield generation process data.
[0094] In a given sample, a greater difference in variance between different oil wells on a given day, such as in their pumping capacity and pump depth, indicates higher data complexity. Nodes with higher complexity require more splitting operations, while nodes with lower complexity can stop splitting earlier. The formula for calculating variance is as follows:
[0095]
[0096] 15) The sample complexity of the current node is C, and the maximum tree depth of the model is set to d. max It is proportional to the complexity C:
[0097] d max =α·C+d0
[0098] Here, α is an adjustment parameter used to control the rate of change of the tree depth, acting as a sensitivity regulator for the model. It controls the model's response speed to data complexity. If the data complexity is high, a larger adjustment parameter can rapidly increase the depth of the decision tree to adapt to complex oilfield production conditions. d0 is an initial depth parameter used to prevent the tree depth from being too shallow, reflecting the basic oilfield production patterns. For highly complex nodes, a greater depth is allowed to improve the model's fitting ability. For simple nodes, the tree depth is limited.
[0099] 16) Set a complexity threshold τ, when the maximum tree depth dmax Splitting stops when the complexity threshold τ is greater than or equal to the complexity threshold τ.
[0100] To avoid overfitting, the condition for dynamically stopping splitting can be set based on a complexity threshold τ. For different oil wells with relatively stable production data, such as flow rate and water cut, setting a lower τ value will cause the model to stop splitting early, generating simpler trees to improve efficiency. However, if production data fluctuates significantly, influenced by geological conditions or equipment status, setting a higher τ value will allow the model to continue splitting, providing in-depth analysis of complex production patterns. Until d... max If the value is greater than τ, the splitting stops; otherwise, the splitting continues. By adjusting the threshold τ, the tree depth can be automatically controlled during model training, ensuring that splitting stops early for simple nodes to avoid overfitting, while allowing further splitting for complex nodes.
[0101] By using the improved random forest algorithm, the average predicted value y for a given day can be obtained by averaging the values of each tree. i Then, it is combined with historical oilfield production data to form new data z. i =[x i ,y i ], which serves as the input to the bidirectional xLSTM.
[0102] In summary, the specific process of obtaining preliminary oilfield production prediction results using the improved random forest algorithm is as follows:
[0103] First, randomly select the i-th row of data from the corrected data set and split it to obtain a child node. Then, for each child node, split it according to the randomly selected features, and use a dynamic control mechanism to automatically adjust the depth of each tree until the tree reaches a preset depth, at which point the splitting stops, i.e., the condition for dynamically stopping splitting is met. Repeat the above process to generate multiple decision trees. For each decision tree, use an adaptive boosting strategy to adjust the weights of the training samples according to the error of the previous iteration, boosting the weights of samples that are difficult to predict. Take the average of all decision trees and output the average prediction value.
[0104] The improved random forest algorithm avoids model overfitting by automatically adjusting the depth of the decision tree based on the complexity of features by calculating the sample complexity of each node.
[0105] 2) Bidirectional xLSTM (Extended LSTM) Algorithm
[0106] Traditional LSTM models are capable of capturing long-term dependencies in time series analysis. However, their memory capacity is limited when processing long-sequence and large-scale data. Bidirectional LSTMs provide the ability to capture both preceding and following information, but still fall short when processing large-scale data. This invention improves the generalization ability and parallel processing efficiency of the bidirectional LSTM by introducing exponential gating and enhanced memory structures, transforming it into an xLSTM structure.
[0107] Bidirectional xLSTM consists of a forward xLSTM and a backward xLSTM, capable of processing sequential information from both ends simultaneously, providing richer contextual information for each time step. The forward and backward xLSTMs respectively introduce exponential gating and enhanced memory structures, including two variants: sLSTM (scalar LSTM) with added exponential gating and memory mixing, and mLSTM (matrix LSTM) which uses matrix memory and covariance update rules to support more efficient parallel processing.
[0108] Due to the preceding data Since it is a scalar, we use sLSTM from xLSTM, and the specific process is as follows.
[0109] 21) Input gate: i t =σ(W i xz t +W i hh t-1 +b i )
[0110] In the formula, i t It is the activation value of the input gate, which controls the z-axis of the input. i Impact on LSTM memory cells. Larger input gate activation values indicate a greater contribution of the input to the memory cell, and vice versa. σ is the activation function, ensuring the activation value i of the input gate... t The value is limited to a reasonable range, between 0 and 1. If the oilfield production data for a particular day contributes significantly to the prediction, then σ generates an activation value close to 1; conversely, it generates a value close to 0, indicating that the current input has a relatively small impact on the model's memory. i x is the weight matrix between the input features and the input gate. Oilfield production data are assigned different importance through the weight matrix, determining the impact of each production parameter on the input gate. W i h is the weight matrix of the hidden state and input gate from the previous time step. It is used to adjust the impact of the current time step input data on the memory cell by incorporating historical information. Historical oil well production trends are crucial to the current prediction and will be given higher weight, enabling the model to capture long-term dependencies. b i It is the bias term of the input gate, which allows the input gate to process data appropriately even without significant changes in the input.
[0111] 22) Gate of Oblivion: f t =σ(W f xz t +W f hh t-1 +b f )
[0112] In the formula, f t This is the activation value of the forgetting gate, which controls the importance of historical oilfield data, such as production parameters from previous days, to current forecasts. A larger forgetting gate value means that the memory unit retains more historical production data, and vice versa, more old information is forgotten. W f x is the weight matrix of the input features and the forgetting gate, which determines the impact of the oilfield production data at the current time step. W f h is the weight matrix of the hidden state and forget gate from the previous time step, which determines the impact of historical production status on the current time step, ensuring that production data from the previous few days can influence the current prediction decision when necessary. b f It is the bias term of the forget gate.
[0113] 23) Candidate memory units:
[0114] In the formula, This is the value of the candidate memory cell, representing a new memory state inferred from current oilfield production data. This is "candidate" data generated based on the current input, used to update the state of the memory cell. Γ t ☐ is exponential gating, used to control the replacement of old information by new information. A larger exponential gating value indicates that current production data has a greater impact on future output prediction, while the influence of old information is weakened. ☐ represents element-wise multiplication; each element in the current input data is multiplied element-wise with the weight matrix, contributing to the candidate memory. tanh is the hyperbolic tangent activation function, used to generate values for candidate memory units. This effectively limits the variation in production data to a certain range, ensuring the model has better adaptability to data fluctuations. W c x is the input feature matrix, and W is the influence of the current oilfield production data matrix on the candidate memory. c h, the weight matrix of the candidate memory unit, represents the influence of historical data on the current candidate memory. b c It is the bias term for candidate memory units.
[0115] 24) Update memory units:
[0116] In the formula, C t It is the updated memory unit, representing the internal state of the current prediction model, which combines production information from the previous few days with the input data of the day to generate a prediction of future oilfield production. tThe model determines the retention of current memory units by older memory units. If historical field production data is stable, the model will continue to retain this data through the forgetting gate to ensure its impact on future predictions. t The new candidate memory cell updates the current memory cell. If there are significant changes in the historical oilfield production data on a certain day, the model will reflect these changes in the updated memory cell through the input gate, and adjust future predictions in a timely manner.
[0117] 25) Output gate:
[0118] In the formula, It represents the hidden state of the current time step and its impact on future time steps. It combines the memory state of the current time step with the influence of the current input, ultimately outputting prediction data for future oilfield generation. t tanh(C) is the activation value of the output gate, which determines the degree to which the information in the memory cell affects the hidden state. t It is used to perform nonlinear transformations on memory cells.
[0119] The backward xLSTM processes the reverse information of the input sequence, i.e., the input data is... The final output result is By concatenating the forward and backward xLSTM outputs, the final input result can be obtained: This refers to the predicted oilfield production result. Alternatively, the average of the forward and backward oilfield production prediction results can be taken as the final oilfield production prediction result.
[0120] In this embodiment, optionally, real-time monitoring includes displaying oilfield production process data and oilfield production forecast results in real time.
[0121] Furthermore, the method of the present invention also includes S4: alarm processing when the oilfield production prediction result is abnormal.
[0122] According to an embodiment of the present invention, the obtained oilfield production prediction results are compared with early warning thresholds to take corresponding emergency response measures, including alarm activation, cause diagnosis, and execution of emergency response plans. By setting early warning thresholds for different oil wells, the current production status is determined based on a comparison of the production prediction early warning thresholds, including parameters such as displacement, pump depth, production days, water cut, dynamic fluid level, and gas-oil ratio. An emergency response mechanism is automatically triggered when the oilfield prediction data exceeds the set threshold. The emergency response mechanism includes triggering alarm signals, notifying oilfield management personnel, analyzing the causes of abnormal production, and monitoring the oil well production status in real time until production returns to normal levels. Real-time monitoring and early warning of oilfield production are conducted based on the output results of the production prediction model to ensure safe and efficient production operation.
[0123] By performing real-time analysis on the predicted production of each oil well, determine whether the current production status is normal, and when the predicted value is abnormal, execute corresponding emergency handling. The basic steps are as follows:
[0124] Compare the oilfield production prediction result with the warning threshold. The warning threshold is set manually by the operator. This threshold consists of a safety interval [L, H], where L is the lower production limit. Values below this are considered abnormal and require triggering emergency handling; H is the upper production limit. Values above this are considered normal and no measures are needed. Based on the predicted value P, determine the production status of the current oil well. If P < L, enter the emergency handling process. If L ≤ P ≤ H, maintain normal production. If P > H, consider the production status normal and no special treatment is required.
[0125] When the production prediction value P is lower than the set threshold L, automatically trigger the emergency handling mechanism to ensure production safety and minimize production losses as much as possible. The emergency handling mechanism includes two handling methods, which can be handled by the staff or processed according to the following process: when the predicted value is lower than the threshold L, immediately trigger an alarm signal, which can alert the oilfield management personnel. The alarm information includes the oil well number, the production status parameters of the oil well, the current predicted value, and the corresponding threshold information, reminding the management personnel to take measures; after emergency handling, continuously monitor the production status of the oil well and update the data in real time. If the production resumes to the normal level (P ≥ L), exit the emergency state and resume normal production.
[0126] This invention constructs a digital twin model based on oilfield production data. This model simulates the oilfield's production environment using real-time and historical production data to predict future output. The digital twin model is built upon key parameters involved in the oilfield production process, including but not limited to: displacement, pump depth, production days, water cut, dynamic fluid level, gas-oil ratio, etc., as well as historical oilfield production data. These parameters reflect the dynamic changes in the oilfield production process. Through interaction with historical and real-time data, the model can accurately simulate the oilfield's production process, forming a virtual production environment. The model receives a pre-processed dataset as input. The input data first undergoes data cleaning and normalization to ensure data quality and consistency. The processed dataset includes multiple dimensions of oilfield production parameters, such as displacement, pump depth, and water cut, comprehensively reflecting the oilfield's production status. This data is input into the digital twin model as the basis for model training and prediction. The digital twin model is trained using historical production data. By introducing an improved random forest algorithm and a bidirectional xLSTM algorithm, the model can effectively capture the complex dynamic changes in the oilfield production process. The improved random forest algorithm extracts data features through an adaptive boosting strategy, while the bidirectional xLSTM algorithm further processes time-series data, improving the model's ability to capture long-term dependencies. The trained model can accurately predict future production based on real-time input data.
[0127] Another embodiment of the present invention proposes an oilfield production prediction system based on digital twin technology, such as... Figure 2 As shown, the system includes:
[0128] The data acquisition module 210 is configured to acquire oilfield production process data and historical oilfield production data; the oilfield production process data includes: discharge rate, pump depth, production days, water cut, dynamic fluid level, gas-oil ratio, fluid production of surrounding oil wells, and water injection volume of surrounding water injection wells.
[0129] The preprocessing module 220 is configured to preprocess the oilfield production process data. The preprocessing includes: forming a data set from oilfield production process data collected at different times or on different dates within a day, and calculating the mean and variance of the data set; determining whether the data in the data set are outliers based on the mean and variance, and correcting the outliers using linear interpolation; performing initial normalization on the corrected data set, calculating the standard deviation and mean of the initially normalized data set, defining the ratio of the standard deviation to the mean as the fluctuation coefficient; if the fluctuation coefficient is less than or equal to a preset threshold, then renormalizing the corrected data set using the max-min normalization method; if the fluctuation coefficient is greater than the preset threshold, then renormalizing the corrected data set using the logarithmic normalization method; wherein, for the production volume of surrounding oil wells and the water injection volume of surrounding water injection wells in the oilfield production process data, a time increment factor is introduced to weight them, and the weighted predicted water injection volume and predicted production volume of adjacent water injection wells replace the original production volume and water injection volume of surrounding oil wells.
[0130] The production prediction module 230 is configured to construct a twin model, input preprocessed oilfield production process data and historical oilfield production data into the twin model to predict oilfield production and obtain oilfield production prediction results; the twin model includes data prediction and real-time monitoring.
[0131] In this embodiment, the system may optionally include an early warning module 240, which is configured to trigger an alarm when the oilfield production forecast result is abnormal.
[0132] The functions of the oilfield production prediction system based on digital twin technology described in this embodiment of the invention can be explained by the aforementioned oilfield production prediction method based on digital twin technology. Therefore, for the parts not described in detail in the system embodiment, please refer to the above method embodiment, and they will not be repeated here.
[0133] Although the invention has been described with respect to a limited number of embodiments, those skilled in the art will understand from the foregoing description that other embodiments are conceivable within the scope of the invention described herein. The disclosure of the invention is illustrative and not restrictive, and the scope of the invention is defined by the appended claims.
Claims
1. A method for predicting oilfield production based on digital twin technology, characterized in that, Includes the following steps: Obtain oilfield production process data and historical oilfield production data; The oilfield production process data is preprocessed; A twin model is constructed, and preprocessed oilfield production process data and historical oilfield production data are input into the twin model to predict oilfield production and obtain oilfield production prediction results. The twin model includes data prediction and real-time monitoring. The step of inputting preprocessed oilfield production process data and historical oilfield production data into the twin model to predict oilfield production includes: An improved random forest algorithm is constructed. Preprocessed oilfield production process data is input into the improved random forest algorithm for processing to obtain preliminary oilfield production prediction results. The improved random forest algorithm includes: for each decision tree, an adaptive boosting strategy is used to adjust the sample weights based on the error of the previous iteration; during node splitting, a dynamic control mechanism is used to automatically adjust the computation depth of the decision tree. A bidirectional xLSTM algorithm is constructed. The preliminary oilfield production forecast and historical oilfield production data are input into the bidirectional xLSTM algorithm to obtain the final oilfield production forecast. The bidirectional xLSTM algorithm includes forward xLSTM and backward xLSTM. The xLSTM structure is as follows: exponential gating and enhanced memory structure are introduced into the LSTM.
2. The oilfield production prediction method based on digital twin technology according to claim 1, characterized in that, The oilfield production process data includes: discharge rate, pump depth, production days, water cut, dynamic fluid level, gas-oil ratio, fluid production of surrounding oil wells, and water injection volume of surrounding water injection wells.
3. The oilfield production prediction method based on digital twin technology according to claim 2, characterized in that, The preprocessing includes: Oilfield production process data collected at different times or on different dates within a day are grouped into a data set, and the mean and variance of the data set are calculated. Based on the mean and variance, it is determined whether the data in the data set are outliers, and the outliers are corrected using linear interpolation. The corrected data set is then initially normalized, and the standard deviation and mean of the initially normalized data set are calculated. The ratio of the standard deviation to the mean is defined as the volatility coefficient. If the volatility coefficient is less than or equal to a preset threshold, the corrected data set is renormalized using the max-min normalization method. If the volatility coefficient is greater than the preset threshold, the corrected data set is renormalized using the logarithmic normalization method.
4. The oilfield production prediction method based on digital twin technology according to claim 3, characterized in that, The preprocessing further includes: for the fluid production of surrounding oil wells and the water injection volume of surrounding water injection wells in the oilfield production process data, introducing a time increase factor to weight them, and replacing the original fluid production of surrounding oil wells and the water injection volume of surrounding water injection wells with the weighted predicted water injection volume of adjacent water injection wells and the predicted fluid production of adjacent oil wells.
5. The oilfield production prediction method based on digital twin technology according to claim 4, characterized in that, The weighted predicted water injection volume and predicted fluid production of adjacent water injection wells are expressed as follows: ; ; In the formula, This indicates the predicted water injection volume from nearby injection wells; This indicates the predicted fluid production of wells adjacent to the current oil well; and Indicates the time-increase factor. This indicates the weight of the impact of changes in water injection volume over time. This indicates the weight of the effect of changes over time on the yield. The time decay coefficient, For the first The distance between the producing well and the predicted oil well, where t represents time; To predict the number of water injection wells surrounding the oil well; Let be the water injection volume of the i-th injection well; To predict the number of producing wells around an oil well; For the first The fluid production of a production well.
6. The oilfield production prediction method based on digital twin technology according to claim 5, characterized in that, The process of inputting the preliminary oilfield production forecast results and historical oilfield production data into the bidirectional xLSTM algorithm to obtain the final oilfield production forecast results includes: The historical production data of the oilfield and the preliminary production prediction results of the oilfield are input into the forward xLSTM in sequence, and then passed through the input gate, forget gate, candidate memory unit, update memory unit and output gate in sequence to obtain the forward oilfield production prediction results. The preliminary oilfield production forecast and historical oilfield production data are sequentially input into the backward xLSTM, passing through the input gate, forget gate, candidate memory unit, update memory unit and output gate to obtain the backward oilfield production forecast result. The average of the forward oilfield production forecast and the backward oilfield production forecast is taken as the final oilfield production forecast.
7. The oilfield production prediction method based on digital twin technology according to claim 6, characterized in that, The step of adjusting sample weights for each decision tree using an adaptive boosting strategy based on the error of the previous iteration includes: Initialize the same weights for each sample. ,in It is the total number of samples; weights are used. Construct a decision tree and calculate the prediction error, which is expressed as: ; in, This represents the actual value of the oilfield production process data. These are predicted values from oilfield production process data. It is an indicator function; a prediction error equals 1, and a correct prediction equals 0; i = 1, 2, ..., N; An error threshold is set. For samples whose prediction error exceeds the error threshold, their weights will increase in the next iteration. The weight update formula is as follows: ; in, Indicates the learning rate. Indicates the weight of the sample in the current iteration. Indicates the sample weight for the next iteration; The automatic adjustment of the decision tree's computational depth using a dynamic control mechanism during node splitting includes: Calculate the sample complexity of the current node at each node split. ; Based on sample complexity Calculate the maximum tree depth : ,in, Indicates the adjustment parameter. Indicates the initial depth parameter; Set complexity threshold When the maximum tree depth Greater than or equal to the complexity threshold The splitting stops at that time.
8. The oilfield production prediction method based on digital twin technology according to claim 1, characterized in that, The real-time monitoring includes displaying the oilfield production process data and oilfield production forecast results in real time; the method also includes: triggering an alarm when the oilfield production forecast results are abnormal.
9. An oilfield production prediction system based on digital twin technology, characterized in that, The system is used to implement the oilfield production prediction method based on digital twin technology according to any one of claims 1 to 8; the system includes: The data acquisition module is configured to acquire oilfield production process data and historical oilfield production data; the oilfield production process data includes: discharge rate, pump depth, production days, water cut, dynamic fluid level, gas-oil ratio, fluid production of surrounding oil wells, and water injection volume of surrounding water injection wells; A preprocessing module is configured to preprocess the oilfield production process data. The preprocessing includes: forming a data set from oilfield production process data collected at different times or on different dates within a day, and calculating the mean and variance of the data set; determining whether the data in the data set are outliers based on the mean and variance, and correcting the outliers using linear interpolation; performing initial normalization on the corrected data set, calculating the standard deviation and mean of the initially normalized data set, defining the ratio of the standard deviation to the mean as the fluctuation coefficient; if the fluctuation coefficient is less than or equal to a preset threshold, renormalizing the corrected data set using the max-min normalization method; if the fluctuation coefficient is greater than the preset threshold, renormalizing the corrected data set using the logarithmic normalization method; wherein, for the production volume of surrounding oil wells and the water injection volume of surrounding water injection wells in the oilfield production process data, a time-increase factor is introduced to weight them, and the weighted predicted water injection volume and production volume of adjacent water injection wells replace the original production volume and water injection volume of surrounding oil wells. The production prediction module is configured to construct a twin model, input preprocessed oilfield production process data and historical oilfield production data into the twin model to predict oilfield production and obtain oilfield production prediction results; the twin model includes data prediction and real-time monitoring.