Oil well yield prediction method and system based on BiLSTM model

By applying the BiLSTM model in oil well production prediction, combined with the reservoir simulator and Spearman correlation coefficient screening features, the shortcomings of traditional methods in high water cut oil well production prediction are solved, and high-precision production prediction is achieved.

CN119337123AInactive Publication Date: 2025-01-21LUYI COUNTY YULONG COMMERCE & TRADE CO LTD

Patent Information

Application Number
CN202411878882.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-19
Publication Date
2025-01-21
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Traditional oil well yield prediction methods cannot accurately predict high water-containing oil well production, mainly because they are prone to gradient disappearance or explosion problems when processing long-sequence data, and it is difficult to effectively capture periodic information and potential relationships in the data.

Method used

Using the oil well production prediction method based on the BiLSTM model, a high water-cut oil field block is constructed through a reservoir simulator, the production data features are extracted, the Spearman correlation coefficient is calculated to screen the main control features, and the BiLSTM model is built to capture the long-term dependencies in the time series data. And optimize the model hyperparameters through the Sparrow search algorithm.

Benefits of technology

Realized the high -precision prediction of the oil well output of high aquatic oil fields, solved the problem of gradient disappearance of traditional models in long sequence data processing, enhanced the understanding and capture ability of time sequence data, improved the generalization ability and prediction of the model and accurate prediction accuracy sex.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119337123A_ABST
    Figure CN119337123A_ABST
Patent Text Reader

Abstract

The invention discloses an oil well yield prediction method and system based on a BiLSTM model, and the method comprises the steps: capturing a long-term dependency relationship in time series data through an LSTM layer, randomly discarding a part of neurons outputted by the LSTM layer through a first Dropout layer, processing the forward information and the reverse information of the time series data through a BiLSTM layer at the same time, the method comprises the steps that forward LSTM output and reverse LSTM output are combined to serve as output of a BiLSTM layer, part of neurons output by the BiLSTM layer are randomly discarded through a second Dropout layer, data output by the BiLSTM layer and data output by the second Dropout layer are subjected to integration and nonlinear transformation through a full connection layer, and a high-water-content oil field oil well yield prediction result is output through an output layer; and inputting to-be-predicted time sequence data into the optimal BiLSTM model to obtain a high-water-content oil field oil well yield prediction result. The problem that the high-water-content oil field oil well yield cannot be accurately predicted in the prior art is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of artificial intelligence technology, and in particular to an oil well production prediction method and system based on a BiLSTM model. Background Art

[0002] In the process of developing high-water-cut oilfields, accurate prediction of oil well production and reasonable allocation of production play a vital role in accurately predicting oilfield development trends and scientifically evaluating development effects. Traditional oil well production prediction methods can perform relatively effective analysis and prediction in conventional oilfield scenarios, but as oilfield development enters the high-water-cut stage, its seepage mechanism becomes extremely complex and is affected by the interaction of multiple factors. Traditional oil well production prediction methods cannot accurately predict the production of high-water-cut oil wells.

[0003] Currently known time series neural network models mainly include recurrent neural networks (RNNs) and long short-term memory neural networks (LSTMs). However, due to its own structural characteristics, RNN has limited storage capacity for features. When processing long sequence data, it is prone to problems such as gradient vanishing or gradient explosion, which seriously affects the accuracy of its long-term prediction of oil well production. Although LSTM has alleviated the long sequence processing problem of RNN to a certain extent through a special gating mechanism, when the input time series is too long, the derivative of the LSTM activation function is less than 1. In the back propagation process, the multiplication of multiple derivatives less than 1 will cause the gradient to disappear; when the input time series is too short, LSTM cannot effectively capture the periodic information in the data, and it is difficult to fully explore the effective information and the potential relationship between discontinuous data, and it is impossible to accurately predict the oil well production in high water-cut oil fields.

[0004] Therefore, there is an urgent need for a method that can accurately predict the oil well production in high water-cut oil fields. Summary of the invention

[0005] In view of this, the present invention proposes a method and system for predicting oil well production based on the BiLSTM model, which can accurately predict the production of oil wells in high water-cut oil fields through the BiLSTM model. The present invention provides the following technical solutions: Constructing a high water-cut oilfield block through a reservoir simulator, and extracting production data characteristics of a target single well from the high water-cut oilfield block; Calculating the Spearman correlation coefficient between the production data features, extracting the production data features whose Spearman correlation coefficients meet the preset values ​​as the main control features, and acquiring the main control feature data based on the main control features; Sorting the master control feature data based on time sequence to form a time series data set; Constructing a BiLSTM model, wherein the BiLSTM model includes an input layer, an LSTM layer, a first Dropout layer, a BiLSTM layer, a second Dropout layer, a fully connected layer and an output layer; receiving time series data through the input layer, capturing long-term dependencies in the time series data through the LSTM layer, randomly discarding some neurons output by the LSTM layer through the first Dropout layer, processing the forward information and reverse information of the time series data simultaneously through the BiLSTM layer, and then merging the forward and reverse LSTM outputs as the output of the BiLSTM layer, randomly discarding some neurons output by the BiLSTM layer through the second Dropout layer, integrating and nonlinearly transforming the data output by the BiLSTM layer and the second Dropout layer through the fully connected layer, and outputting the oil well production prediction result of the high water-cut oil field through the output layer; Inputting the time series data into the BiLSTM model for training, and optimizing the hyperparameters of the BiLSTM model using a sparrow search algorithm in each iteration process to obtain an optimal BiLSTM model; The time series data to be predicted is input into the optimal BiLSTM model to obtain the oil well production prediction result of the high water-cut oil field corresponding to the time series data to be predicted.

[0006] On the basis of the above technical solution, the present invention can also be improved as follows: Furthermore, the calculating of the Spearman correlation coefficient between the production data features and extracting the production data features whose Spearman correlation coefficients meet the preset values ​​as the main control features includes: The Spearman correlation coefficient between production data features is calculated using formula (1); Formula (1); In the formula, For the List and List The Spearman correlation coefficient, For the Column and The difference in rank between corresponding elements in the columns, is the length of each column; when =-1, indicating a completely negative correlation. = +1, indicating a completely positive correlation. =0, indicating no correlation.

[0007] Furthermore, the master control feature data is sorted based on the time sequence to form a time series data set, including: The time series data is normalized to convert the time series data into normalized time series data within the range of [0, 1] or [-1, 1].

[0008] Furthermore, the time series data is input into the BiLSTM model for training, and the hyperparameters of the BiLSTM model are optimized by using a sparrow search algorithm in each iteration process to obtain an optimal BiLSTM model, including: The discoverer position update rule is defined by formula (2). During the iteration process, the discoverer's position is updated according to different conditions. Formula (2); In the formula, is the position of the i-th individual in the j-th dimension when the number of iterations is t+1, is the position of the i-th individual in the j-th dimension when the number of iterations is t, is a random number, is the threshold value, is a coefficient that controls the update speed of parameters. is the maximum number of iterations, is a parameter related to the search range, and L is a vector related to the search direction; when When , the discoverer position is updated based on exponential decay. When , a random disturbance is added to the current position to update the discoverer's position.

[0009] Furthermore, the time series data is input into the BiLSTM model for training, and the hyperparameters of the BiLSTM model are optimized by using a sparrow search algorithm in each iteration process to obtain an optimal BiLSTM model, and further includes: Define the joiner position update rule through formula (3); Formula (3); In the formula, is the position of the optimal individual when the number of iterations is t+1, is the position of the worst individual when the number of iterations is t, is the total number of individuals involved in the optimization process, A is the matrix related to the search direction; when When , the joiner position is updated based on the difference between the worst individual position and the current individual position, and the updated joiner position is adjusted by the exponential function; when When , the position of the joiner is adjusted based on the difference between the current individual position and the optimal individual position.

[0010] Furthermore, the time series data is input into the BiLSTM model for training, and the hyperparameters of the BiLSTM model are optimized by using a sparrow search algorithm in each iteration process to obtain an optimal BiLSTM model, and further includes: Formula (4) defines the anti-predator behavior rules that sparrow populations will follow when they perceive danger; Formula (4); In the formula, To control the parameters, is the fitness value of the ith individual, is the global optimal fitness value, is a parameter related to the search range or step size, To avoid positive numbers with zero denominator; when When , the position is updated based on the difference between the current position and the worst individual position, and the updated position is adjusted by a factor related to fitness; when When , the position is updated based on the square of the difference between the current position and the optimal individual position, and the updated position is adjusted by a factor related to fitness.

[0011] Furthermore, the time series data is input into the BiLSTM model for training, and the hyperparameters of the BiLSTM model are optimized by using a sparrow search algorithm in each iteration process to obtain an optimal BiLSTM model, and further includes: Calculate the comprehensive evaluation index value of each BiLSTM model based on the predicted value and the true value, wherein the comprehensive evaluation index includes mean absolute error, mean relative error, mean square error, root mean square error and determination coefficient; The comprehensive evaluation index value is calculated by formula (5); Formula (5); In the formula, is the comprehensive evaluation index value, is the weight of the mean absolute error, is the weight of the mean relative error, is the weight of the mean square error, is the weight of the root mean square error, is the weight of the determination coefficient, is the mean absolute error, is the average relative error, is the mean square error, is the root mean square error, is the coefficient of determination; The BiLSTM model with the largest comprehensive evaluation index value is determined as the optimal BiLSTM model.

[0012] An oil well production prediction system based on a BiLSTM model, comprising: A first feature extraction module is used to construct a high water-cut oilfield block through a reservoir simulator, and extract production data features of a target single well from the high water-cut oilfield block; A second feature extraction module is used to calculate the Spearman correlation coefficient between the production data features, extract the production data features whose Spearman correlation coefficients meet the preset values ​​as the main control features, and obtain the main control feature data based on the main control features; A sorting module, used to sort the master control feature data based on time sequence to form a time series data set; A construction module is used to construct a BiLSTM model, wherein the BiLSTM model includes an input layer, an LSTM layer, a first Dropout layer, a BiLSTM layer, a second Dropout layer, a fully connected layer and an output layer; time series data is received through the input layer, long-term dependencies in the time series data are captured through the LSTM layer, some neurons output by the LSTM layer are randomly discarded through the first Dropout layer, forward information and reverse information of the time series data are simultaneously processed through the BiLSTM layer, and then the forward and reverse LSTM outputs are merged as the output of the BiLSTM layer, some neurons output by the BiLSTM layer are randomly discarded through the second Dropout layer, data output by the BiLSTM layer and the second Dropout layer are integrated and nonlinearly transformed through the fully connected layer, and the oil well production prediction result of the high water-cut oil field is output through the output layer; A training module, used for inputting the time series data into the BiLSTM model for training, and optimizing the hyperparameters of the BiLSTM model by using a sparrow search algorithm in each iteration process to obtain an optimal BiLSTM model; The prediction module is used to input the time series data to be predicted into the optimal BiLSTM model to obtain the oil well production prediction result of the high water-cut oil field corresponding to the time series data to be predicted.

[0013] An electronic device comprises a memory, a processor and a computer program stored in the memory and running on the processor, wherein the processor implements the steps of the method when executing the computer program.

[0014] A non-transitory computer-readable storage medium stores a computer program, which implements the steps of the method when executed by a processor.

[0015] The present invention has the following advantages: According to the technical solution of the present invention, by calculating the Spearman correlation coefficient to extract the main control features, it is possible to screen out production data features with high correlation with oil well production, reduce the interference of irrelevant or redundant data, and make model training more focused and efficient. The main control feature data is sorted in chronological order to form a time series data set, which can make full use of the time correlation of production data, conform to the characteristics of oil well production process changing over time, and help to mine potential laws in the data.

[0016] In the oil well production prediction method based on the BiLSTM model, the LSTM layer in the BiLSTM model can capture the long-term dependencies in the time series data, solve the gradient vanishing or explosion problem that is easy to occur in the traditional model when processing long sequence data, and make the long-term prediction of the oil well production more accurate. The BiLSTM layer processes the forward and reverse information at the same time and merges the output, which can more comprehensively capture the contextual information in the sequence. Compared with the unidirectional model, it can better reflect the temporal correlation of the oil well production data. The first Dropout layer and the second Dropout layer set in the model can effectively prevent the model from overfitting during the training process by randomly discarding neurons, improve the generalization ability of the model, and make it have better prediction performance in different oil well production scenarios. The sparrow search algorithm is used to optimize the hyperparameters of the BiLSTM model in each iteration process, which can quickly find the optimal hyperparameter combination, so that the model performance is further improved, so as to more accurately predict the oil well production in high water-cut oil fields.

[0017] In summary, the oil well production prediction method based on the BiLSTM model can achieve high-precision prediction of oil well production in high-water-cut oilfields, provide reliable data support for the reasonable production allocation, development trend prediction and effect evaluation of oilfields, help to formulate scientific and reasonable production plans, optimize oil well operations, reduce unnecessary production inputs, and thus improve the development efficiency of the entire high-water-cut oilfield. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] For the purpose of illustration and not limitation, the present invention is now described in conjunction with the embodiments of the present invention and the accompanying drawings, in which: Figure 1 It is a schematic diagram of the flow of the oil well production prediction method based on the BiLSTM model in an embodiment of the present invention; Figure 2 It is a schematic diagram of the main components of the oil well production prediction system based on the BiLSTM model in an embodiment of the present invention; Figure 3 It is a characteristic analysis diagram of the Spearman correlation coefficient in an embodiment of the present invention; Figure 4A schematic diagram of the process of BiLSTM model training in an embodiment of the present invention; Figure 5 Schematic diagram of the principle of the BiLSTM model in the embodiment of the present invention; Figure 6 is a training density map in an embodiment of the present invention; Figure 7 is a verification density map in an embodiment of the present invention; Figure 8 is a test density map in an embodiment of the present invention; Fig. 9 This is a schematic diagram of the physical structure of the electronic device provided by the present invention. DETAILED DESCRIPTION

[0019] In order to enable those skilled in the art to better understand the solution of the present invention, the technical solution in the implementation of the present invention will be clearly and completely described below in conjunction with the drawings in the implementation of the present invention. Obviously, the described implementation is only a part of the implementation of the present invention, not all of the implementations. Based on the implementation of the present invention, all other implementations obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0020] It should be noted that the terms "first", "second", etc. in the specification of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so as to describe the embodiments of the present invention described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0021] It should be noted that, in the absence of conflict, the embodiments of the present invention and the features in the embodiments can be combined with each other. The embodiments of the present invention will be described in detail below with reference to the accompanying drawings.

[0022] Figure 1 FIG. 1 is a flow chart of a method for predicting oil well production based on a BiLSTM model in an embodiment of the present invention. Figure 1 As shown, an oil well production prediction method based on a BiLSTM model provided by an embodiment of the present invention includes the following steps S101 to S106.

[0023] S101, constructing a high water-cut oilfield block through a reservoir simulator, and extracting production data characteristics of a target single well from the high water-cut oilfield block.

[0024] Specifically: Through advanced reservoir simulators, combined with relevant data such as geological parameters, reservoir physical characteristics, and fluid properties of high-water-cut oil fields, a virtual model of high-water-cut oil field blocks is accurately constructed. This model can highly restore key elements such as reservoir structure, fluid distribution, and seepage laws of actual oil fields, providing a reliable basis for subsequent data extraction and analysis.

[0025] In the constructed high-water-cut oilfield block model, in-depth data mining is performed on the target single well. From the production history data of the single well, multi-dimensional production data features including but not limited to the daily oil production, daily water production, water content, bottom hole pressure, production time, wellhead temperature, etc. of the oil well are extracted. These features fully reflect the actual operating status of the oil well during the production process and are an important basis for subsequent production prediction.

[0026] S102, calculating the Spearman correlation coefficient between production data features, extracting production data features whose Spearman correlation coefficients meet preset values ​​as main control features, and acquiring main control feature data based on the main control features.

[0027] Specifically, Figure 3 It is a characteristic analysis diagram of the Spearman correlation coefficient in the embodiment of the present invention, such as Figure 3 As shown, the Spearman correlation coefficient between production data features is calculated by formula (1); Formula (1); In the formula, For the List and List The Spearman correlation coefficient, For the Column and The difference in rank between corresponding elements in the columns, is the length of each column; when =-1, indicating a completely negative correlation. = +1, indicating a completely positive correlation. =0, indicating no correlation.

[0028] By carefully comparing the correlation coefficient with the preset value, the main control features closely related to the production were accurately screened out. Finally, based on the Spearman correlation coefficient between the production data features, liquid production, productivity, bottom hole pressure, cumulative water production, water injection volume of injection well 4, production days, cumulative oil production, water injection volume of injection well 5, daily water production and water injection volume of injection well 3 were selected as input features, which reduced the complexity and redundancy of the data and improved the efficiency of subsequent model processing of data.

[0029] S103, sorting the master control feature data based on time sequence to form a time series data set.

[0030] Specifically, the acquired master control characteristic data are strictly sorted in chronological order. This process ensures the temporal coherence of the data and can better reflect the evolution of the oil well production process over time.

[0031] After the data is sorted, these ordered master feature data are integrated into a time series data set. At the same time, in order to make the data more suitable for model training and processing, the time series data is normalized and converted into normalized time series data in the range of [0, 1] or [-1, 1]. This can avoid the adverse effects on model training due to large differences in data magnitude and help improve the convergence speed and prediction accuracy of the model.

[0032] In the formula, is the normalized data, is the original data, is the minimum value in the original data set. is the maximum value in the original data set.

[0033] when hour, =0; when hour, =1; when hour, The value of will fall in the interval (0,1); Normalization is a method that linearly maps raw data to a new range, which helps make features of different scales comparable in data analysis and machine learning algorithms, and can improve the convergence speed and performance of some algorithms.

[0034] S104, constructing a BiLSTM model, wherein the BiLSTM model includes an input layer, an LSTM layer, a first Dropout layer, a BiLSTM layer, a second Dropout layer, a fully connected layer, and an output layer.

[0035] Specifically, Figure 4 Schematic diagram of the process of BiLSTM model training in an embodiment of the present invention, Figure 5 Schematic diagram of the principle of the BiLSTM model in the embodiment of the present invention. Figure 4 and Figure 5As shown in the figure, the input layer receives time series data, and the input layer serves as the entrance of the BiLSTM model, passing the data to the next layer for processing; the LSTM layer captures the long-term dependencies in the time series data, and the long short-term memory network (LSTM) layer plays a key role in capturing the long-term dependencies in the time series data in the model. LSTM can effectively process and memorize information in long time series through its unique gating mechanism (including input gate, forget gate and output gate), avoiding the gradient vanishing or gradient exploding problems that are prone to occur in traditional recurrent neural networks (RNN), thereby accurately capturing the complex change pattern of oil well production data in the time dimension; the first Dropout layer randomly discards some neurons output by the LSTM layer. In order to prevent the model from overfitting during the training process, the first Dropout layer is set after the LSTM layer. This layer randomly discards some neurons output by the LSTM layer according to a certain ratio (such as 0.2 or 0.3, which can be adjusted according to actual conditions) at each training iteration. This random dropout operation can increase the generalization ability of the model, enabling it to make more accurate predictions when faced with new data; the BiLSTM layer simultaneously processes the forward and reverse information of the time series data, and then merges the forward and reverse LSTM outputs as the output of the BiLSTM layer. The bidirectional long short-term memory network (BiLSTM) layer is the core component of the model. It simultaneously processes the forward and reverse information of the time series data. Specifically, BiLSTM consists of two independent LSTM networks, one that processes data forward in chronological order and the other that processes data backward in chronological order. Then, the LSTM outputs of these two directions are merged as the final output of the BiLSTM layer. This bidirectional processing mechanism can make full use of the contextual information in the time series data and more comprehensively capture the characteristics and regularities in the data. Compared with the unidirectional LSTM model, it can provide more accurate prediction results; the second Dropout layer randomly discards some neurons output by the BiLSTM layer. The second Dropout layer is similar to the first Dropout layer, and the second Dropout layer is set after the BiLSTM layer. Its function is also to randomly discard some neurons, further prevent the model from overfitting, and enhance the robustness and generalization ability of the model; the data output by the BiLSTM layer and the second Dropout layer are integrated and nonlinearly transformed through the fully connected layer. The fully connected layer is responsible for integrating and nonlinearly transforming the data output by the BiLSTM layer and the second Dropout layer. It introduces nonlinear factors by fully connecting each neuron and applying activation functions (such as ReLU, Sigmoid, etc., selected according to actual conditions), so that the model can learn more complex data patterns and relationships.The output layer outputs the prediction results of oil well production in high water-cut oil fields. As the last layer of the model, the output layer generates the prediction results of oil well production in high water-cut oil fields based on the processing results of the previous layers. The number of neurons in the output layer is usually determined according to the specific situation of the prediction target. For example, if the daily oil production of an oil well is predicted, the output layer may have only one neuron.

[0036] The BiLSTM model has 200 epochs, 70 iterations per round, and a maximum number of iterations of 1400. The optimization function uses Adam, and the initial learning rate is 0.001. The initial structure settings of the model are shown in Table 1.

[0037] Table 1

[0038] S105, inputting the time series data into the BiLSTM model for training, and optimizing the hyperparameters of the BiLSTM model using the sparrow search algorithm in each iteration process to obtain the optimal BiLSTM model.

[0039] Specifically, the time series dataset is divided into training set, validation set and test set in a ratio of 8:1:1; Train the BiLSTM model based on the training set; The performance of the trained BiLSTM model is evaluated based on the validation set to obtain a BiLSTM model that meets the performance requirements; The prediction results of the BiLSTM model that meets the performance conditions are evaluated based on the test set, and the evaluation index corresponding to the BiLSTM model is obtained.

[0040] The performance of the trained BiLSTM model is evaluated based on the validation set to obtain a BiLSTM model that meets the performance requirements; the similarity calculation results of the BiLSTM model that meets the performance requirements are evaluated based on the test set to obtain the evaluation index corresponding to the BiLSTM model. The performance of the BiLSTM model is evaluated to obtain a percentage score (i.e., the highest score is 100 points and the lowest score is 0 points). Based on the percentage score, the BiLSTM model with a score greater than the set value is determined. For example, a BiLSTM model with a score greater than 90 points is a BiLSTM model that meets the performance requirements.

[0041] The BiLSTM model that meets the performance conditions is evaluated and the evaluation index of the BiLSTM model is obtained. The evaluation value corresponding to each evaluation index is calculated and obtained. The evaluation value is used to represent the capability value of the BiLSTM model on the evaluation index.

[0042] The discoverer position update rule is defined by formula (2). During the iteration process, the discoverer's position is updated according to different conditions. Formula (2); In the formula, is the position of the i-th individual in the j-th dimension when the number of iterations is t+1, is the position of the i-th individual in the j-th dimension when the number of iterations is t, is a random number, is the threshold value, is a coefficient that controls the update speed of parameters. is the maximum number of iterations, is a parameter related to the search range, and L is a vector related to the search direction; when When , the discoverer position is updated based on exponential decay. When , a random disturbance is added to the current position to update the discoverer's position.

[0043] Define the joiner position update rule through formula (3); Formula (3); In the formula, is the position of the optimal individual when the number of iterations is t+1, is the position of the worst individual when the number of iterations is t, is the total number of individuals involved in the optimization process, A is the matrix related to the search direction; when When , the joiner position is updated based on the difference between the worst individual position and the current individual position, and the updated joiner position is adjusted by the exponential function; when When , the position of the joiner is adjusted based on the difference between the current individual position and the optimal individual position.

[0044] Formula (4) defines the anti-predator behavior rules that sparrow populations will follow when they perceive danger; Formula (4); In the formula, To control the parameters, is the fitness value of the ith individual, is the global optimal fitness value, is a parameter related to the search range or step size, To avoid positive numbers with zero denominator; when When , the position is updated based on the difference between the current position and the worst individual position, and the updated position is adjusted by a factor related to fitness; when When , the position is updated based on the square of the difference between the current position and the optimal individual position, and the updated position is adjusted by a factor related to fitness.

[0045] Calculate the comprehensive evaluation index value of each BiLSTM model based on the predicted value and the true value, wherein the comprehensive evaluation index includes mean absolute error, mean relative error, mean square error, root mean square error and determination coefficient; By optimizing the hyperparameters of the BiLSTM model (such as learning rate, number of hidden layer neurons, Dropout ratio, etc.) through the sparrow search algorithm, we can find the hyperparameter combination that makes the model performance optimal, thereby obtaining the optimal BiLSTM model. The optimal BiLSTM model has 8 position encoding vectors, 16 attention mechanisms, 32 attention mechanism keys, 16 hidden layer neurons, 0.2559 dropout layer ratio, and 0.0090365 learning rate.

[0046] The comprehensive evaluation index value is calculated by formula (5); Formula (5); In the formula, is the comprehensive evaluation index value, is the weight of the mean absolute error, is the weight of the mean relative error, is the weight of the mean square error, is the weight of the root mean square error, is the weight of the determination coefficient, is the mean absolute error, is the average relative error, is the mean square error, is the root mean square error, is the coefficient of determination; The BiLSTM model with the largest comprehensive evaluation index value is determined as the optimal BiLSTM model.

[0047] Five evaluation indicators, namely, mean absolute error (MAE), mean relative error (MAPE), mean square error (MSE), root mean square error (RMSE) and determination coefficient (R2), are used to represent the error of the oil well production prediction model in high water-cut oil fields. Table 2 shows the error indicators of the BiLSTM model; Table 2

[0048] Figure 6 is a training density map in an embodiment of the present invention, Figure 7 is a verification density map in an embodiment of the present invention, Figure 8 is a test density map in an embodiment of the present invention, Figures 6 to 8The horizontal axis represents "true data", and the vertical axis represents "predicted data". Combining Table 2 and Figures 6 to 8 It can be seen that the MAE, MAPE, MSE, RMSE and R2 of the training set, validation set and test set meet the requirements of engineering accuracy. The BiLSTM production prediction model can be used as a feasible method to predict the production of oil wells in high water-cut oil fields.

[0049] S106, inputting the time series data to be predicted into the optimal BiLSTM model to obtain the oil well production prediction result of the high water-cut oil field corresponding to the time series data to be predicted.

[0050] Specifically, the time series data to be predicted is input into the trained and optimized optimal BiLSTM model. The model quickly and accurately calculates the oil well production prediction results of the high water-cut oil field corresponding to the time series data to be predicted based on the laws and characteristics of the oil well production data it has learned. These prediction results can provide important decision-making basis for oil field production management, development planning, and resource allocation, helping oil field enterprises achieve more efficient and scientific production operations.

[0051] Figure 2 Schematic diagram of the main components of the oil well production prediction system based on the BiLSTM model in the embodiment of the present invention. Figure 2 As shown, the oil well production prediction system 1 based on the BiLSTM model in the embodiment of the present invention includes a first feature extraction module 10, a second feature extraction module 20, a sorting module 30, a construction module 40, a training module 50 and a prediction module 60: The first feature extraction module 10 is used to construct a high water-cut oilfield block through a reservoir simulator, and extract production data features of a target single well from the high water-cut oilfield block; The second feature extraction module 20 is used to calculate the Spearman correlation coefficient between the above production data features, extract the production data feature whose Spearman correlation coefficient meets the preset value as the main control feature, and obtain the main control feature data based on the main control feature; The sorting module 30 is used to sort the above-mentioned master control feature data based on time sequence to form a time series data set; The construction module 40 is used to construct a BiLSTM model, wherein the BiLSTM model includes an input layer, an LSTM layer, a first Dropout layer, a BiLSTM layer, a second Dropout layer, a fully connected layer and an output layer; the time series data is received through the input layer, the long-term dependencies in the time series data are captured through the LSTM layer, some neurons output by the LSTM layer are randomly discarded through the first Dropout layer, the forward information and reverse information of the time series data are simultaneously processed through the BiLSTM layer, and then the forward and reverse LSTM outputs are merged as the output of the BiLSTM layer, some neurons output by the BiLSTM layer are randomly discarded through the second Dropout layer, the data output by the BiLSTM layer and the second Dropout layer are integrated and nonlinearly transformed through the fully connected layer, and the oil well production prediction result of the high water-cut oil field is output through the output layer; The training module 50 is used to input the above time series data into the above BiLSTM model for training, and in each iteration process, the sparrow search algorithm is used to optimize the hyperparameters of the BiLSTM model to obtain the optimal BiLSTM model; The prediction module 60 is used to input the time series data to be predicted into the above-mentioned optimal BiLSTM model to obtain the oil well production prediction result of the high water-cut oil field corresponding to the time series data to be predicted.

[0052] Fig. 9 A schematic diagram of the physical structure of an electronic device provided in an embodiment of the present invention, such as Fig. 9 As shown, the electronic device 70 includes: a processor 701 (processor), a memory 702 (memory) and a bus 703; The processor 701 and the memory 702 communicate with each other via the bus 703; The processor 701 is used to call the program instructions in the memory 702 to execute the method provided by the embodiment of the present invention, such as the aforementioned Figure 1 The method in .

[0053] This embodiment provides a non-transitory computer-readable storage medium, which stores computer instructions, and the computer instructions enable the computer to execute, for example, the above Figure 1 The method in .

[0054] A person skilled in the art can understand that all or part of the steps of implementing the above method embodiment can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above method embodiment; and the aforementioned storage medium includes: ROM, RAM, magnetic disk or optical disk, etc., various storage media that can store program codes.

[0055] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A method for predicting oil well production based on the BiLSTM model, characterized in that: include: Constructing a high water-cut oilfield block through a reservoir simulator, and extracting production data characteristics of a target single well from the high water-cut oilfield block; Calculating the Spearman correlation coefficient between the production data features, extracting the production data features whose Spearman correlation coefficients meet the preset values ​​as the main control features, and acquiring the main control feature data based on the main control features; Sorting the master control feature data based on time sequence to form a time series data set; Constructing a BiLSTM model, wherein the BiLSTM model includes an input layer, an LSTM layer, a first Dropout layer, a BiLSTM layer, a second Dropout layer, a fully connected layer and an output layer; receiving time series data through the input layer, capturing long-term dependencies in the time series data through the LSTM layer, randomly discarding some neurons output by the LSTM layer through the first Dropout layer, processing the forward information and reverse information of the time series data simultaneously through the BiLSTM layer, and then merging the forward and reverse LSTM outputs as the output of the BiLSTM layer, randomly discarding some neurons output by the BiLSTM layer through the second Dropout layer, integrating and nonlinearly transforming the data output by the BiLSTM layer and the second Dropout layer through the fully connected layer, and outputting the oil well production prediction result of the high water-cut oil field through the output layer; Inputting the time series data into the BiLSTM model for training, and optimizing the hyperparameters of the BiLSTM model using a sparrow search algorithm in each iteration process to obtain an optimal BiLSTM model; The time series data to be predicted is input into the optimal BiLSTM model to obtain the oil well production prediction result of the high water-cut oil field corresponding to the time series data to be predicted.

2. The oil well production prediction method based on the BiLSTM model according to claim 1, characterized in that: Calculating the Spearman correlation coefficient between the production data features and extracting the production data features whose Spearman correlation coefficients meet the preset values ​​as the main control features includes: The Spearman correlation coefficient between production data features is calculated using formula (1); Formula (1): In the formula, For the List and List The Spearman correlation coefficient, For the Column and The difference in rank between corresponding elements in the columns, is the length of each column; when =-1, indicating a completely negative correlation. = +1, indicating a completely positive correlation. =0, indicating no correlation.

3. The oil well production prediction method based on the BiLSTM model according to claim 1, characterized in that: The step of sorting the master control feature data based on time sequence to form a time series data set includes: The time series data is normalized to convert the time series data into normalized time series data within the range of [0, 1] or [-1, 1].

4. The oil well production prediction method based on the BiLSTM model according to claim 1, characterized in that: The time series data is input into the BiLSTM model for training, and the hyperparameters of the BiLSTM model are optimized by using a sparrow search algorithm in each iteration process to obtain an optimal BiLSTM model, including: The discoverer position update rule is defined by formula (2). During the iteration process, the discoverer's position is updated according to different conditions. Formula (2): In the formula, is the position of the i-th individual in the j-th dimension when the number of iterations is t+1, is the position of the i-th individual in the j-th dimension when the number of iterations is t, is a random number, is the threshold value, is a coefficient that controls the update speed of parameters. is the maximum number of iterations, is a parameter related to the search range, and L is a vector related to the search direction; when When , the discoverer position is updated based on exponential decay. When , a random disturbance is added to the current position to update the discoverer's position.

5. The oil well production prediction method based on the BiLSTM model according to claim 4, characterized in that: The step of inputting the time series data into the BiLSTM model for training, optimizing the hyperparameters of the BiLSTM model using a sparrow search algorithm in each iteration process to obtain an optimal BiLSTM model, further includes: Define the joiner position update rule through formula (3); Formula (3): In the formula, is the position of the optimal individual when the number of iterations is t+1, is the position of the worst individual when the number of iterations is t, is the total number of individuals involved in the optimization process, A is the matrix related to the search direction; when When , the joiner position is updated based on the difference between the worst individual position and the current individual position, and the updated joiner position is adjusted by the exponential function; when When , the position of the joiner is adjusted based on the difference between the current individual position and the optimal individual position.

6. The oil well production prediction method based on the BiLSTM model according to claim 5, characterized in that: The step of inputting the time series data into the BiLSTM model for training, optimizing the hyperparameters of the BiLSTM model using a sparrow search algorithm in each iteration process to obtain an optimal BiLSTM model, further includes: Formula (4) defines the anti-predator behavior rules that sparrow populations will follow when they perceive danger; Formula (4): In the formula, To control the parameters, is the fitness value of the ith individual, is the global optimal fitness value, is a parameter related to the search range or step size, To avoid positive numbers with zero denominator; when When , the position is updated based on the difference between the current position and the worst individual position, and the updated position is adjusted by a factor related to fitness; when When , the position is updated based on the square of the difference between the current position and the optimal individual position, and the updated position is adjusted by a factor related to fitness.

7. The oil well production prediction method based on the BiLSTM model according to claim 6, characterized in that: The step of inputting the time series data into the BiLSTM model for training, optimizing the hyperparameters of the BiLSTM model using a sparrow search algorithm in each iteration process to obtain an optimal BiLSTM model, further includes: Calculate the comprehensive evaluation index value of each BiLSTM model based on the predicted value and the true value, wherein the comprehensive evaluation index includes mean absolute error, mean relative error, mean square error, root mean square error and determination coefficient; The comprehensive evaluation index value is calculated by formula (5); Formula (5): In the formula, is the comprehensive evaluation index value, is the weight of the mean absolute error, is the weight of the mean relative error, is the weight of the mean square error, is the weight of the root mean square error, is the weight of the determination coefficient, is the mean absolute error, is the average relative error, is the mean square error, is the root mean square error, is the coefficient of determination; The BiLSTM model with the largest comprehensive evaluation index value is determined as the optimal BiLSTM model.

8. A system for predicting oil well production based on the BiLSTM model, characterized in that: include: A first feature extraction module is used to construct a high water-cut oilfield block through a reservoir simulator, and extract production data features of a target single well from the high water-cut oilfield block; A second feature extraction module is used to calculate the Spearman correlation coefficient between the production data features, extract the production data features whose Spearman correlation coefficients meet the preset values ​​as the main control features, and obtain the main control feature data based on the main control features; A sorting module, used to sort the master control feature data based on time sequence to form a time series data set; A construction module is used to construct a BiLSTM model, wherein the BiLSTM model includes an input layer, an LSTM layer, a first Dropout layer, a BiLSTM layer, a second Dropout layer, a fully connected layer and an output layer; time series data is received through the input layer, long-term dependencies in the time series data are captured through the LSTM layer, some neurons output by the LSTM layer are randomly discarded through the first Dropout layer, forward information and reverse information of the time series data are simultaneously processed through the BiLSTM layer, and then the forward and reverse LSTM outputs are merged as the output of the BiLSTM layer, some neurons output by the BiLSTM layer are randomly discarded through the second Dropout layer, data output by the BiLSTM layer and the second Dropout layer are integrated and nonlinearly transformed through the fully connected layer, and the oil well production prediction result of the high water-cut oil field is output through the output layer; A training module, used for inputting the time series data into the BiLSTM model for training, and optimizing the hyperparameters of the BiLSTM model by using a sparrow search algorithm in each iteration process to obtain an optimal BiLSTM model; The prediction module is used to input the time series data to be predicted into the optimal BiLSTM model to obtain the oil well production prediction result of the high water-cut oil field corresponding to the time series data to be predicted.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.

10. A non-transitory computer readable medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Discrete wavelet transform and neural network-based oil production or CO2 burying and storing amount prediction method

    CN116307034A

  • Gas well daily gas production rate prediction method and determination device, electronic equipment and storage medium

    CN116502772A

  • WOA-based low-permeability oil field single well yield prediction method and device

    CN117875494A

Cited By

  • Oil well yield multi-step prediction method based on multi-feature fusion

    CN120525132A

  • Multi-step prediction method for oil well production based on multi-feature fusion

    CN120525132B