Water-drive reservoir intelligent injection-production parameter optimization method based on LSTM (Long Short Term Memory) and particle swarm optimization

Through the combination of LSTM and particle swarm algorithm, a method that can predict well group oil production and optimize injection and production parameters without numerical simulation is constructed, which solves the problem of injection and production optimization in oil fields and improves production stability and output. .

CN118551284APending Publication Date: 2024-08-27CNOOC ENERGY TECHNOLOGY & SERVICES LTD +1

Patent Information

Application Number
CN202410587494.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-13
Publication Date
2024-08-27

AI Technical Summary

Technical Problem

In the absence of preliminary numerical simulation data and numerical simulation results, it is difficult to establish a reservoir production index prediction model and then optimize injection and production.

Method used

An intelligent injection and production parameter optimization method for water drive reservoirs based on LSTM and particle swarm algorithm is used to obtain key influencing factors of well group oil production through correlation analysis, and a prediction model integrating long short-term memory network and attention mechanism is constructed, combined with adaptive Particle swarm optimization algorithm optimizes injection and production parameters.

Benefits of technology

It achieves effective prediction of well group oil production and optimization of injection and production parameters without numerical simulation data, and improves the stability and output of oilfield production.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118551284A
    Figure CN118551284A
Patent Text Reader

Abstract

The invention provides a water-drive reservoir intelligent injection-production parameter optimization method based on LSTM (Long Short Term Memory) and a particle swarm algorithm, and belongs to the technical field of water-drive reservoir well group oil production prediction. Obtaining production dynamic data of all water injection wells and oil production wells of the well group according to the prediction training period, performing data preprocessing on the original data, splicing data of different water injection wells and data of different oil production wells of the well group, and dividing a data set into a training set and a test set; and constructing a prediction model fusing the long-short-term memory network and the attention mechanism, carrying out model training, establishing a fitness evaluation function of the prediction model based on an adaptive particle swarm optimization algorithm, and optimizing two injection-production parameters, namely the layered daily water injection rate and the wellhead water injection pressure of the water injection well. Compared with an existing numerical model method, the method is more feasible, the historical water drive development measures of the water injection well and the historical oil production trend of the oil well can be effectively fused through prediction, and oil and gas field development and production index prediction and application in the intelligent injection and production field are achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of oil production prediction of a water-drive oil reservoir well group, and in particular to an intelligent injection-production parameter optimization method for a water-drive oil reservoir based on LSTM and particle swarm algorithm. Background Art

[0002] Injection-production optimization is an important measure to stabilize oilfield production and control water content. At present, most of the domestic water injection development oilfields have entered the high water content period or even the ultra-high water content period. The water content of these oilfields has increased rapidly and the production has decreased significantly. Timely injection-production adjustment is a feasible way to control the water content and stabilize production. At present, the injection-production optimization method mainly relies on numerical simulation results. The injection-production scheme is optimized by calling the numerical simulator multiple times. This research idea and process play a supporting role in stabilizing the production of high water-content oilfields. However, if an oil reservoir does not have previous numerical simulation data and numerical simulation results, the optimization will be difficult to implement. Therefore, how to establish a production indicator prediction model without numerical simulation results, so as to carry out injection-production optimization, is an urgent problem to be solved. Summary of the invention

[0003] In view of this, the present invention aims to propose an intelligent injection and production parameter optimization method for water-drive oil reservoirs based on LSTM and particle swarm algorithm, which solves the problem that production indicators of oil reservoirs cannot be predicted without previous numerical simulation data and numerical simulation results. This method can effectively combine oil field injection and production water drive production measures and oil well production historical data to realize the problem of well group oil production prediction.

[0004] To achieve the above object, the technical solution of the present invention is implemented as follows: a method for optimizing intelligent injection and production parameters of water drive reservoirs based on LSTM and particle swarm algorithm, comprising the following steps:

[0005] S1: Taking the daily oil production of the well group as the prediction target, the production dynamic data of all water injection wells and oil production wells in the well group are obtained according to the prediction training cycle, and the key influencing factors of the well group oil production are obtained by correlation analysis method to determine the characteristics of the prediction model;

[0006] S2: Obtain the original feature data in step S1 for data preprocessing, splice the data of different water injection wells and different oil production wells in the well group, and divide the data set into a training set and a test set;

[0007] S3: Construct a prediction model integrating long short-term memory network and attention mechanism and perform model training. Extract the temporal relationship and correlation features between water injection wells and oil production wells. Fuse the features of water injection wells and oil production wells through dot product and softmax mechanism. Use multiple one-dimensional convolutions to extract features of the fused features and predict the daily oil production of the well group. The mean absolute error is used as the loss function for model training, and Adam is selected as the optimizer.

[0008] S4: Input the test set into the trained prediction model that integrates the long-term and short-term characteristics of water injection wells and oil production wells, evaluate the test results, and optimize the two injection and production parameters of the water injection wells, namely, the daily injection volume of the water injection wells and the wellhead injection pressure, by combining the adaptive particle swarm optimization algorithm.

[0009] Furthermore, the step S1 includes the following steps:

[0010] S11: Multi-source data collection and integration: Use multi-source data integration technology to obtain production and development data, geological exploration data and production history data, and integrate data from different data sources into daily production dynamic data of oil and gas wells and well group relationship data to provide a comprehensive data view;

[0011] S12: Obtaining the numbers of m water injection wells and n oil production wells included in a well group through the well group relationship data;

[0012] S13: Based on the water injection well number and the oil production well number, the original characteristic data of the water injection well and the oil production well in the past k years are obtained through a database query statement. The water injection well characteristics include the water injection date, daily water injection volume, and water injection duration. The oil production well characteristics include daily oil production, water content, daily water production, oil pressure, and production duration.

[0013] S14: A prediction model can only be trained if there is at least one water injection well and one oil production well data in a well group. To improve the model training data conditions, after obtaining the original feature data, the data missing situation is judged to determine whether the feature data missing situation of each water injection well and oil production well in the well group exceeds the threshold, and the water injection well and oil production well data with serious missing well group are deleted. Samples or features with missing information attribute values ​​are analyzed, and the nearest neighbor filling method, linear interpolation method, and mean method are used to complete the well group data;

[0014] S15: To predict production indicators, select the daily oil production of the well group; the key influencing factor analysis requires a comprehensive analysis of the impact of reservoir static data and injection and production well production history data on the daily oil production of the well group; the feature correlation analysis method in machine learning is used to select key features; the Pearson correlation coefficient between the injection and production well production history data and the daily oil production is calculated to measure the relationship between each feature and the daily oil production of the well group, as shown in formula (1):

[0015]

[0016] In the formula, ρ X,Y is the Pearson correlation coefficient between X and Y, decimal; r x,i For x i The rank of X in descending order, a positive integer; y x,i for y i The rank of Y in descending order, a positive integer; n is the amount of data, a positive integer;

[0017] S16: Construct a training sample library with well groups as units: select the characteristics of water injection wells, which include stratified daily water injection volume, wellhead water injection pressure, and cumulative water injection volume; select the characteristics of oil production wells, which include wellhead pressure, daily oil production, water content, oil pressure, casing pressure, nozzle diameter, production method, and production time; calculate the daily oil production of all oil production wells in the well group as the prediction target variable.

[0018] Furthermore, the step S2 includes the following steps:

[0019] S21: preprocessing the data for each water injection well in the well group, and then splicing the characteristic data of all water injection wells in the well group according to the date;

[0020] S22: Preprocess the data for each oil producing well in the well group, and then splice the characteristic data of all oil producing wells in the well group according to the date;

[0021] S23: The daily oil production of all oil producing wells in the well group is summed up to obtain the daily oil production characteristics of the well group, and abnormal judgment is performed, and abnormal annotations are added to obtain the initial data set of the model prediction target, including production date, daily oil production of the well group, and abnormal status;

[0022] S24: Divide the model into training set and test set.

[0023] Furthermore, the step S21 includes the following steps:

[0024] S211: obtaining the original training data of a water injection well in the well group, performing null value processing on the daily water injection volume characteristics of the water injection well, and filling it with forward and backward interpolation method;

[0025] S212: Obtain the output result of step S211, perform abnormal processing on the daily water injection volume characteristics, first obtain the 24-hour daily water injection volume in the t-day time window before and after the daily water injection volume, calculate the normal mean of the daily water injection volume, and determine whether the daily water injection volume is within the abnormal fluctuation range of the normal mean of the daily water injection volume. The abnormal data needs to be replaced with the normal mean of the daily water injection volume per hour × the production time of the day;

[0026] S213: Obtain the output result of step S212, construct the stop injection state feature of the water injection well based on the daily water injection volume, when the daily water injection volume is 0, the corresponding stop injection state feature of the water injection well is 1, when the daily water injection volume is greater than 0, the corresponding stop injection state feature of the water injection well is 0, and output the initial data set of the water injection well;

[0027] S214: iteratively process the data of all water injection wells in the well group to obtain the processed data of all water injection wells, and align and splice them according to the date;

[0028] S215: According to the maximum and minimum normalization method, the daily injection volume characteristics of all injection wells are independently and globally normalized, as shown in formula (2):

[0029]

[0030] Among them, x * is the normalized data, x is the time series data of each feature, x min is the minimum value, x max is the maximum value;

[0031] S216: Obtain the initial data set of all water injection wells in the well group, the features of which include water injection date, daily water injection volume, and injection stop status.

[0032] Further, the step S22 includes the following steps:

[0033] S221: Obtain the original training data of a certain oil production well in the well group, perform abnormal judgment after processing the daily oil production feature null value of the oil production well, obtain the 24-hour daily oil production in the time window of t days before and after the daily oil production, calculate the normal mean of the daily oil production, judge whether the daily oil production is within the abnormal fluctuation range of the normal mean, and replace the abnormal data with the normal mean of the daily oil production per hour × the production time of the day;

[0034] S222: Obtain the output result of step S221, construct the production capacity characteristics based on the daily oil production, and the production capacity value of the i-th day is equal to the average of the daily oil production of the 10 days before the date; in addition, construct the shutdown status characteristics of the oil well based on the daily oil production characteristics, when the daily oil production is 0, the corresponding oil well shutdown status is 1, and when the daily oil production is greater than 0, the oil well shutdown status is 0;

[0035] S223: Obtain the output result of step S222, interpolate the null values ​​of the oil pressure, production time and water production characteristics based on the daily oil production, and output the initial data set of the oil production well;

[0036] S224: Iteratively process all the oil production well data of the well group to obtain processed data, and splice them according to date;

[0037] S225: performing independent global normalization processing on the spliced ​​oil production well characteristics according to the maximum and minimum normalization method; the oil production well characteristics include daily oil production, oil pressure, water content, and production time;

[0038] S226: Obtain an initial data set after splicing all the oil producing wells in the well group, the features of which include production date, daily oil production, water content, oil pressure, production time, and shutdown status.

[0039] Further, the step S24 includes the following steps:

[0040] S241: Obtaining the initial data set of the water injection well outputted in step S216 and the initial data set of the oil production well outputted in step S226;

[0041] S242: Set the sample partitioning configuration parameters for water injection wells and oil production wells, including the time window length window_size of the single sample water injection well 注 , the oil well time window length window_size 采 , sliding window length s;

[0042] S243: Divide the initial data of the water injection wells in the well group into several training samples through a sliding window. Considering the time lag of water injection on oil production, the time window length of the water injection well is window_size 注 The parameters are set to 90, 60, and 30. The optimization is performed through grid search. The processing formula is shown in formula (3):

[0043]

[0044] Among them, N 注 is the number of injection well samples after division, n 注 is the number of all daily data of the water injection well training data of the regularized well group, and s is the sliding window length;

[0045] S244: Divide the initial data of the oil wells in the well group into several training samples through a sliding window. The length of the oil well time window is window_size 采 Set to 10, 20, 30, the parameter is optimized through grid search, and the processing formula (4) is:

[0046]

[0047] Among them, N 采 is the number of oil well samples after division, n 采 is the number of all daily data of the water injection wells in the regularized well group, and s is the length of the sliding window;

[0048] S245: According to the set ratio of the training set to the test set and the date association relationship, the water injection well samples, the oil production well samples and the predicted oil production of the target well group are divided into the training set and the test set.

[0049] Furthermore, the step S3 includes the following steps:

[0050] S31: training data preparation, obtaining the well group training set output in step S245;

[0051] S32: Prediction model construction, using the fusion model to extract the time series relationship and correlation features of water injection wells and oil production wells, and fusion of water injection well and oil production well features through dot product and softmax weight mechanism, batch normalization of the fused features, and feature extraction through multi-layer one-dimensional convolution, and finally output the predicted oil production of the well group;

[0052] S33: Prediction model training, input the training set into the prediction model for parameter iteration, establish the fusion characteristics of all water injection wells and oil production wells in the well group, search for the mapping relationship between the oil production during the well group, terminate when the loss function meets the iteration condition, output the trained neural network model, use the mean absolute error MAE as the loss function, optimize the weights of the entire neural network through the Adam optimizer, and minimize the loss value of the loss function;

[0053] S34: Model optimization, using network search algorithm to optimize the injection well time window length window_size 注 , Oil well time window length window_size 采 , learning rate to optimize model parameters, evaluate and select the optimal model and store the model structure and parameters.

[0054] Further, the step S32 includes the following steps:

[0055] S321: Preliminary extraction of long-term and short-term features of oil wells and water injection wells, construction of a 4-layer long-term and short-term memory network, with hidden nodes of 64, 32, 16, and oil well / water injection well feature dimensions respectively, and a recurrent neural network LSTM is used to perform a time length of window_size 采 The oil well sample data and time length are window_size 注 The model divides the time series data into multiple subsequences, each of which is 10 time steps long. Then, each subsequence passes through a series of LSTM layers to extract time series features. The size of each LSTM layer gradually decreases to capture features at different levels. In addition, each subsequence is processed by the attention mechanism to strengthen the influence of associated features. The relevant formula (5) is as follows:

[0056]

[0057] This formula represents the forward calculation formula of LSTM at time t: are the three inputs of the network at time t, is the hidden layer output value at time t; is the hidden layer input value at time t-1, is the external input value of the network at time t-1; is the current input unit status; is the unit state of the network at time t-1; They represent the forget gate output, input gate output, output gate output and unit state at time t respectively. σ and tanh are both activation functions, where σ is the sigmoid function and tanh is the hyperbolic tangent function. b f , b i , b c , b o are the bias values ​​of each gated unit and cell respectively; W f , W i , W c , W c Represent the weight parameter matrices of the forget gate, input gate, cell state, and output gate respectively;

[0058] S322: Obtain the result of step S321, apply the self-attention mechanism to the time step features of the oil production wells and water injection wells extracted by the long-short cycle memory network, and further extract the fusion high-order features of the oil production wells and water injection wells. The relevant formula (6) is as follows:

[0059]

[0060] Among them, Attention(Q, K, V) represents the correlation matrix, is the attention weight, Q, K, and V are the query matrix, the queried matrix, and the value matrix, respectively. k is the feature dimension of K, K T is the transposed matrix of K;

[0061] S323: Obtain the oil production well features and water injection well features extracted in step S321, transpose them and perform feature fusion using a dot product operation. The dot product calculation is as shown in formula (7):

[0062]

[0063] Among them, a i =(a1,a2...,a n ) and b i =(b1,b2...,b n ) are the two vectors to be dot-producted, and C is the dot-product result;

[0064] S324: Obtain the result outputted in step S323 and calculate the weight using the softmax function;

[0065] S325: multiply the result outputted in step S323 by the weight result outputted in step S324 accordingly;

[0066] S326: applying a batch normalization layer to the result outputted in step S325 to improve the generalization ability of the model, and obtaining the fused and normalized features of the water injection wells and the oil production wells;

[0067] S327: Obtain the fused and normalized features of the injection wells and oil production wells in step S326, use 5 layers of one-dimensional convolution for feature extraction and dimensionality transformation, the number of convolution kernels in each layer is 64, 32, 16, 8, 1 respectively, and the final output value is the time window of window_size 采 The one-dimensional convolution related formula is shown in formula (8):

[0068]

[0069] Among them, each element of the output y is the sum of the products of the input x and the convolution kernel h at the corresponding position. The convolution kernel h slides in a small window and multiplies and sums the products with the corresponding parts of the input signal x to obtain each element of the output signal y. M is the length of the convolution kernel. This formula means that in a window of M elements, the corresponding elements are multiplied and added to obtain each element of the output signal y.

[0070] Further, the step S4 includes the following steps:

[0071] S41: Obtain test set data;

[0072] S42: Obtain the trained well group oil production prediction model, make predictions on the test set, and use the mean absolute percentage error MAPE to evaluate the results. The relevant formula is shown in formula (9):

[0073]

[0074] Among them, n is the number of samples, and the predicted value and true value are the predicted result and true label of the corresponding well group oil production respectively;

[0075] S43: Based on the evaluation results, the well group oil production prediction model is continuously optimized and iterated;

[0076] S44: The maximum oil production of the well group is obtained according to the prediction model. With the maximum oil production of the well group as the goal, an adaptive particle swarm optimization algorithm is used to optimize the injection and production parameters. The adaptive strategy is used to adjust the parameters of the algorithm to improve the performance and convergence speed of the algorithm.

[0077] Furthermore, the step S44 uses an adaptive particle swarm optimization algorithm to perform intelligent injection and production optimization of the well group, including the following sub-steps:

[0078] S441: Initialize the particle swarm parameters: including determining the population size, number of iterations T, learning factors c1, c2 and inertia weight ω; the population size is the size of the input data; the learning factors c1 and c2 represent the strength of the local search ability and global search ability of the particle respectively; in each iteration, the adaptive particle swarm optimization algorithm calculates the fitness value of each particle; if the variance of the fitness value is small, the value of the learning factor will become smaller, so as to converge to the optimal solution; on the contrary, if the variance of the fitness value is large, the value of the learning factor will become larger, so as to better explore the solution space; the inertia weight ω is a factor that affects the optimization ability, and the inertia weight is dynamically adjusted according to the number of iterations. The update formula is as follows:

[0079]

[0080] Among them, ω max and ω min are the upper and lower limits of the inertia weight, respectively. T is the maximum number of iterations. When the number of iterations t approaches T, the inertia weight gradually decreases to better converge to the optimal solution.

[0081] S442: Determine the particle dimension and value range: The particle dimension represents the number of variables, that is, the wellhead injection pressure of each water injection well in the predicted well group; the particle value range represents the change range of the variable. The wellhead water injection pressure parameter value range is determined according to the maximum and minimum values ​​of the recent historical wellhead water injection pressure. The stratified daily water injection volume is an important parameter for intelligent injection and production optimization, and its value is determined according to the apparent water absorption index and the wellhead water injection pressure parameter: First, the apparent water absorption index is calculated according to the historical production data. The apparent water absorption index = the difference in daily water injection volume under the two working systems / the difference in wellhead pressure under the two corresponding working systems. Then, the stratified daily water injection volume is calculated according to the apparent water absorption index and the wellhead water injection pressure particle value. The relevant formula (11) is as follows:

[0082] Layered water injection t+1 =Apparent water absorption index t ×(Wellhead injection pressure t+1 - Wellhead injection pressure t )+ stratified water injection volume t (11)

[0083] S443, initializing the fitness function: using the well group daily oil production prediction model obtained in step S24 as the fitness evaluation function;

[0084] S444, randomly initialize the position x of each particle i and speed v i ;

[0085] S445, calculating the fitness value F(i) of each particle: splicing the wellhead water injection pressure and stratified water injection volume determined in S32 with the historical production time series data of the injection-production optimization time interval, regularizing the input sample requirements according to the prediction model trained in step S24, and predicting through the prediction model, and outputting the result as the fitness evaluation value F(i) of each particle;

[0086] S446: For each particle, calculate the particle fitness F(i) and compare it with the individual extreme value P i and the group extreme value P g Compare; if F(i)>P i , replace P with F(i) i ; If F(i)>P g , replace P with F(i) g ;

[0087] S447: Update the particle speed and position according to formulas (12) and (13). In order to prevent the search results from falling into local extreme values ​​and improve the search capability, an adaptive particle swarm algorithm is used to update the particle speed. The update formula is as follows:

[0088] V i (j+1)=ωV i (j)+c1r1(P i (j)-S i (j))+c2r2(p g (j)-S i (j)) (12)

[0089] S i (j+1)=S i (j)+V i (j+1) (13)

[0090] Where S i and V i are the current position vector and velocity vector of particle i, j is the number of iterations, ω is the inertia weight; c1 and c2 are accelerations; r1 and r2 are random numbers in the interval [0, 1] multiplied by the variance of the fitness value; P i The individual optimal solution found for the particle; P g is the global optimal solution selected from all particles; S i (j) is the spatial position of particle i after the jth iteration update, V i (j) is the velocity of particle i after the jth iteration update, ωV i (j) controls the global and local search capabilities through ω; c1r1(P i (j)-S i(j)) describes the distance between the particle's current position and its best known position; c2r2(P g (j)-S i (j)) is the distance between the current position and the global optimal position, that is, the movement of the particle is also determined by the influence of the rest of the particles in the population, P g Improving the convergence speed will reduce the diversity of the search population, making the search results more likely to fall into local extremes.

[0091] S448: Determine whether the loop termination condition is met; if the maximum number of iterations is reached, the optimized model parameters are obtained; otherwise, return to step S34 to continue updating the particle position and velocity;

[0092] S449: Compare the optimal injection and production parameters obtained by particle swarm optimization with the actual injection and production parameters. If the production operation restrictions and requirements are met, this method can be used to adjust and optimize the injection and production parameters of water drive oil reservoirs.

[0093] Compared with the prior art, the water drive reservoir intelligent injection and production parameter optimization method based on LSTM and particle swarm algorithm described in the present invention has the following advantages:

[0094] (1) The present invention takes the oil production of the well group as the prediction target, based on the production dynamic data of the water injection well and the oil production well and the static data of the reservoir, and uses the Pearson correlation analysis method to determine the model characteristics. The method data acquisition is feasible;

[0095] (2) Based on the preprocessing of water injection well and oil production well data, the present invention establishes feature extraction networks based on long- and short-term memory networks and attention mechanisms, respectively, which can effectively capture the influence of long- and short-term water injection characteristics and the historical oil production trend characteristics of oil production wells;

[0096] (3) The present invention realizes feature fusion through dot product and softmax mechanism, and uses batch normalization to process fused features, thereby realizing fused extraction of water injection well and oil production well features;

[0097] (4) The present invention uses a multi-layer one-dimensional convolution method to further extract features from the fused features. The last layer outputs the oil production of the well group. Based on the adaptive particle swarm optimization algorithm, the trained well group daily oil production prediction model is used as the fitness evaluation function to optimize the injection and production parameters of the wellhead water injection pressure. The daily water injection volume of the water injection well layer is calculated in combination with the apparent water absorption index of the reservoir, which provides a solution for obtaining the production indicator target evaluation function in the process of fine water injection intelligent optimization of water drive reservoirs. BRIEF DESCRIPTION OF THE DRAWINGS

[0098] The accompanying drawings constituting a part of the present invention are used to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the accompanying drawings:

[0099] Figure 1 It is a schematic diagram of the method flow of the present invention;

[0100] Figure 2 Construct a flow chart for the prediction model network structure;

[0101] Figure 3 The prediction results of the oil production test set for a certain oil field well group;

[0102] Figure 4 Optimize iterative algorithm logic for predictive models; DETAILED DESCRIPTION

[0103] It should be noted that, in the absence of conflict, the embodiments of the present invention and the features in the embodiments may be combined with each other.

[0104] The present invention will be described in detail below with reference to the accompanying drawings and in conjunction with embodiments.

[0105] The emergence of machine learning technology provides a new idea for predicting oilfield production indicators. A large amount of production and development data, geological exploration data, and production history data are accumulated during the oilfield production process. These data provide the prerequisite for predicting production indicators through machine learning. The production indicator prediction model established by machine learning methods has a fast prediction speed. Further combining the prediction model with the intelligent injection and production parameter optimization algorithm can form a set of fast and intelligent injection and production optimization methods for oil reservoirs. In summary, this method uses machine learning methods, based on the dynamic and static data of oil reservoirs and the dynamic production data of injection and production wells, and adopts long and short cycle networks and attention mechanisms to construct a well group oil production model.

[0106] Combining the prediction model with the intelligent injection and production parameter optimization algorithm, a fast and intelligent injection and production optimization method is explored to realize the application of machine learning technology in the prediction of oil and gas field development and production indicators and intelligent injection and production. By splicing historical water injection well data, oil production well data, water injection measures of water injection wells and production status of oil production wells during the future decision optimization period of t days, the prediction sample is obtained, and the oil production of the well group is input for prediction. Based on the adaptive particle swarm optimization algorithm, the optimal injection and production parameters of the wellhead water injection pressure are optimized, and the daily water injection volume of the water injection wells is calculated in combination with the apparent water absorption index of the reservoir, providing a solution for fine water injection in water-drive reservoirs, thereby realizing the optimization of production measures in water-drive reservoirs.

[0107] Specifically, in view of the difficulty in selecting appropriate injection and production parameters in the production process of water-driven oil reservoirs, the present invention proposes a method that integrates the long-term and short-term characteristics of water injection wells and oil production wells to predict the maximum oil production of the well group and guide the optimization of injection and production parameters. The method is an intelligent injection and production parameter optimization method for water-driven oil reservoirs based on LSTM and particle swarm algorithm, and includes the following steps:

[0108] S1: Taking the daily oil production of the well group as the prediction target, the production dynamic data of all water injection wells and oil production wells in the well group are obtained according to the prediction training cycle, and the key influencing factors of the well group oil production are obtained by correlation analysis method to determine the characteristics of the prediction model;

[0109] S2: Obtain the original feature data in step S1 for data preprocessing, splice the data of different water injection wells and different oil production wells in the well group, and divide the data set into a training set and a test set;

[0110] S3: Construct a prediction model integrating long short-term memory network and attention mechanism and perform model training. Extract the temporal relationship and correlation features between water injection wells and oil production wells. Fuse the features of water injection wells and oil production wells through dot product and softmax mechanism. Use multiple one-dimensional convolutions to extract features of the fused features and predict the daily oil production of the well group. The mean absolute error is used as the loss function for model training, and Adam is selected as the optimizer.

[0111] S4: Input the test set into the trained prediction model that integrates the long-term and short-term characteristics of water injection wells and oil production wells, evaluate the test results, and optimize the two injection and production parameters of the water injection wells, namely, the daily injection volume of the water injection wells and the wellhead injection pressure, by combining the adaptive particle swarm optimization algorithm.

[0112] The step S1 comprises the following steps:

[0113] S11: Multi-source data collection and integration: Use multi-source data integration technology to obtain production and development data, geological exploration data and production history data, and integrate data from different data sources into daily production dynamic data of oil and gas wells and well group relationship data to provide a comprehensive data view;

[0114] S12: Obtaining the numbers of m water injection wells and n oil production wells included in a well group through the well group relationship data;

[0115] S13: Based on the water injection well number and the oil production well number, the original characteristic data of the water injection well and the oil production well in the past k years are obtained through a database query statement. The water injection well characteristics include the water injection date, daily water injection volume, and water injection duration. The oil production well characteristics include daily oil production, water content, daily water production, oil pressure, and production duration.

[0116] S14: A prediction model can only be trained if there is at least one water injection well and one oil production well data in a well group. To improve the model training data conditions, after obtaining the original feature data, the data missing situation is judged to determine whether the feature data missing situation of each water injection well and oil production well in the well group exceeds the threshold, and the water injection well and oil production well data with serious missing well group are deleted. Samples or features with missing information attribute values ​​are analyzed, and the nearest neighbor filling method, linear interpolation method, and mean method are used to complete the well group data;

[0117] S15: To predict production indicators, select the daily oil production of the well group; the key influencing factor analysis requires a comprehensive analysis of the impact of reservoir static data and injection and production well production history data on the daily oil production of the well group; the feature correlation analysis method in machine learning is used to select key features; the Pearson correlation coefficient between the injection and production well production history data and the daily oil production is calculated to measure the relationship between each feature and the daily oil production of the well group, as shown in formula (1):

[0118]

[0119] In the formula, ρ X,Y is the Pearson correlation coefficient between X and Y, decimal; r x,i For x i The rank of X in descending order, a positive integer; y x,i for y i The rank of Y in descending order, a positive integer; n is the amount of data, a positive integer;

[0120] S16: Construct a training sample library with well groups as units: select the characteristics of water injection wells, which include stratified daily water injection volume, wellhead water injection pressure, and cumulative water injection volume; select the characteristics of oil production wells, which include wellhead pressure, daily oil production, water content, oil pressure, casing pressure, nozzle diameter, production method, and production time; calculate the daily oil production of all oil production wells in the well group as the prediction target variable.

[0121] The beneficial effects of the above further scheme are: there are many factors that affect the prediction of oil production of a well group, and the production dynamic data of water injection wells and oil production wells are real-time and easy to obtain. Through data acquisition technology, they can be obtained in time and used for prediction, which can better deal with the problem of missing data in traditional reservoir numerical simulation software.

[0122] The step S2 comprises the following steps:

[0123] S21: preprocessing the data for each water injection well in the well group, and then splicing the characteristic data of all water injection wells in the well group according to the date;

[0124] S22: Preprocess the data for each oil producing well in the well group, and then splice the characteristic data of all oil producing wells in the well group according to the date;

[0125] S23: The daily oil production of all oil producing wells in the well group is summed up to obtain the daily oil production characteristics of the well group, and abnormal judgment is performed, and abnormal annotations are added to obtain the initial data set of the model prediction target, including production date, daily oil production of the well group, and abnormal status;

[0126] S24: Divide the model into training set and test set.

[0127] The beneficial effect of the above further scheme is that by cleaning, converting, handling anomalies and constructing features of the data of oil wells and water injection wells, the requirements of the prediction model on data quality and data calculation specifications can be met, thereby improving the accuracy of the prediction.

[0128] The step S21 comprises the following steps:

[0129] S211: obtaining the original training data of a water injection well in the well group, performing null value processing on the daily water injection volume characteristics of the water injection well, and filling it with forward and backward interpolation method;

[0130] S212: Obtain the output result of step S211, perform abnormal processing on the daily water injection volume characteristics, first obtain the 24-hour daily water injection volume in the t-day time window before and after the daily water injection volume, calculate the normal mean of the daily water injection volume, and determine whether the daily water injection volume is within the abnormal fluctuation range of the normal mean of the daily water injection volume. The abnormal data needs to be replaced with the normal mean of the daily water injection volume per hour × the production time of the day;

[0131] S213: Obtain the output result of step S212, construct the stop injection state feature of the water injection well based on the daily water injection volume, when the daily water injection volume is 0, the corresponding stop injection state feature of the water injection well is 1, when the daily water injection volume is greater than 0, the corresponding stop injection state feature of the water injection well is 0, and output the initial data set of the water injection well;

[0132] S214: iteratively process the data of all water injection wells in the well group to obtain the processed data of all water injection wells, and align and splice them according to the date;

[0133] S215: According to the maximum and minimum normalization method, the daily injection volume characteristics of all injection wells are independently and globally normalized, as shown in formula (2):

[0134]

[0135] Among them, x * is the normalized data, x is the time series data of each feature, x min is the minimum value, x max is the maximum value;

[0136] S216: Obtain the initial data set of all water injection wells in the well group, the features of which include water injection date, daily water injection volume, and injection stop status.

[0137] The beneficial effects of the above further scheme are: there are a lot of missing and stopped injection data in the water injection wells of the well group, and the missing values ​​and abnormal processing are performed on the feature data, and the stop injection status characteristics are constructed according to the stop injection situation, and the maximum and minimum normalization method is used to normalize the data, so as to ensure the quality of the spliced ​​water injection well feature data.

[0138] The step S22 comprises the following steps:

[0139] S221: Obtain the original training data of a certain oil production well in the well group, perform abnormal judgment after processing the daily oil production feature null value of the oil production well, obtain the 24-hour daily oil production in the time window of t days before and after the daily oil production, calculate the normal mean of the daily oil production, judge whether the daily oil production is within the abnormal fluctuation range of the normal mean, and replace the abnormal data with the normal mean of the daily oil production per hour × the production time of the day;

[0140] S222: Obtain the output result of step S221, construct the capacity characteristics based on the daily oil production, the capacity value of the i-th day is equal to the average of the daily oil production of the 10 days before the date (including the i-th day); in addition, construct the shutdown status characteristics of the oil well based on the daily oil production characteristics, when the daily oil production is 0, the corresponding oil well shutdown status is 1, when the daily oil production is greater than 0, the oil well shutdown status is 0;

[0141] S223: Obtain the output result of step S222, interpolate the null values ​​of the oil pressure, production time and water production characteristics based on the daily oil production, and output the initial data set of the oil production well;

[0142] S224: Iteratively process all the oil production well data of the well group to obtain processed data, and splice them according to date;

[0143] S225: performing independent global normalization processing on the spliced ​​oil production well characteristics according to the maximum and minimum normalization method; the oil production well characteristics include daily oil production, oil pressure, water content, and production time;

[0144] S226: Obtain an initial data set after splicing all the oil producing wells in the well group, the features of which include production date, daily oil production, water content, oil pressure, production time, and shutdown status.

[0145] The beneficial effects of the above further scheme are: there are a lot of missing and shutdown data in the oil production wells of the well group, and the missing values ​​and anomaly processing are performed on the feature data, and the shutdown status characteristics and production capacity characteristics of the oil production wells are constructed according to the daily oil production characteristics. The production capacity index can effectively characterize the current oil production capacity of the reservoir, and the maximum and minimum normalization method is used to normalize the data, thereby ensuring the quality of the spliced ​​oil production well feature data and improving the accuracy of the prediction model.

[0146] The step S24 comprises the following steps:

[0147] S241: Obtaining the initial data set of the water injection well outputted in step S216 and the initial data set of the oil production well outputted in step S226;

[0148] S242: Set the sample partitioning configuration parameters for water injection wells and oil production wells, including the time window length window_size of the single sample water injection well 注, the oil well time window length window_size 采 , sliding window length s;

[0149] S243: Divide the initial data of the water injection wells in the well group into several training samples through a sliding window. Considering the time lag of water injection on oil production, the time window length of the water injection well is window_size 注 It can be set to 90, 60, 30, etc. The parameter is optimized through grid search, and its processing formula is shown in formula (3):

[0150]

[0151] Among them, N 注 is the number of injection well samples after division, n 注 is the number of all daily data of the water injection well training data of the regularized well group, and s is the sliding window length;

[0152] S244: Divide the initial data of the oil wells in the well group into several training samples through a sliding window. The length of the oil well time window is window_size 采 It can be set to 10, 20, 30, etc. This parameter is optimized through grid search, and the processing formula (4) is:

[0153]

[0154] Among them, N 采 is the number of oil well samples after division, n 采 is the number of all daily data of the water injection wells in the regularized well group, and s is the length of the sliding window;

[0155] S245: According to the set ratio of the training set to the test set and the date association relationship, the water injection well samples, the oil production well samples and the predicted oil production of the target well group are divided into the training set and the test set.

[0156] The beneficial effects of the above further scheme are: oil production wells and water injection wells are divided and combined using different time windows for sample division, which can fully take into account the lag of water injection measures of water injection wells, and the target variable is predicted by adding up the oil production of a certain time window of the well group, which can fully reflect the long-term and short-term impact of water injection measures on oil production during the period, and reflect the periodicity of oilfield production indicator evaluation.

[0157] The step S3 comprises the following steps:

[0158] S31: training data preparation, obtaining the well group training set output in step S245;

[0159] S32: Prediction model construction, using the fusion model to extract the time series relationship and correlation features of water injection wells and oil production wells, and fusion of water injection well and oil production well features through dot product and softmax weight mechanism, batch normalization of the fused features, and feature extraction through multi-layer one-dimensional convolution, and finally output the predicted oil production of the well group;

[0160] S33: Prediction model training, input the training set into the prediction model for parameter iteration, establish the fusion characteristics of all water injection wells and oil production wells in the well group, search for the mapping relationship between the oil production during the well group, terminate when the loss function meets the iteration condition, output the trained neural network model, use the mean absolute error MAE as the loss function, optimize the weights of the entire neural network through the Adam optimizer, and minimize the loss value of the loss function;

[0161] S34: Model optimization, using network search algorithm to optimize the injection well time window length window_size 注 , Oil well time window length window_size 采 , learning rate to optimize model parameters, evaluate and select the optimal model and store the model structure and parameters.

[0162] The beneficial effects of the above further scheme are: through the long-short cycle memory neural network units and the attention mechanism, the characteristics of water injection wells and oil production wells are respectively extracted, and a fusion mechanism is established to fuse the information of different data sources, and then the dimensionality reduction processing is performed through one-dimensional convolution to realize the oil production prediction of the well group, and the network search algorithm is used to search the parameters. The constructed prediction model has strong feature extraction and feature fusion capabilities, avoiding the disadvantage that the prediction model established only by relying on the historical oil production time series cannot be used for intelligent injection and production decision optimization.

[0163] The step S32 comprises the following steps:

[0164] S321: Preliminary extraction of long-term and short-term features of oil wells and water injection wells, construction of a 4-layer long-term and short-term memory network, with hidden nodes of 64, 32, 16, and oil well / water injection well feature dimensions respectively, and a recurrent neural network LSTM is used to perform a time length of window_size 采 The oil well sample data and time length are window_size 注 The model divides the time series data into multiple subsequences, each of which is 10 time steps long. Then, each subsequence passes through a series of LSTM layers to extract time series features. The size of each LSTM layer gradually decreases to capture features at different levels. In addition, each subsequence is processed by the attention mechanism to strengthen the influence of associated features. The relevant formula (5) is as follows:

[0165]

[0166] This formula represents the forward calculation formula of LSTM at time t: are the three inputs of the network at time t, is the hidden layer output value at time t; is the hidden layer input value at time t-1, is the external input value of the network at time t-1; is the current input unit status; is the unit state of the network at time t-1; They represent the forget gate output, input gate output, output gate output and unit state at time t respectively. σ and tanh are both activation functions, where σ is the sigmoid function and tanh is the hyperbolic tangent function. b f , b i , b c , b o are the bias values ​​of each gated unit and cell respectively; W f , W i , W c , W c Represent the weight parameter matrices of the forget gate, input gate, cell state, and output gate respectively;

[0167] S322: Obtain the result of step S321, apply the self-attention mechanism to the time step features of the oil production wells and water injection wells extracted by the long-short cycle memory network, and further extract the fusion high-order features of the oil production wells and water injection wells. The relevant formula (6) is as follows:

[0168]

[0169] Among them, Attention(Q, K, V) represents the correlation matrix, is the attention weight, Q, K, and V are the query matrix, the queried matrix, and the value matrix, respectively. k is the feature dimension of K, K T is the transposed matrix of K;

[0170] S323: Obtain the oil production well features and water injection well features extracted in step S321, transpose them and perform feature fusion using a dot product operation. The dot product calculation is as shown in formula (7):

[0171]

[0172] Among them, a i =(a1,a2...,a n ) and b i =(b1,b2...,b n ) are the two vectors to be dot-producted, and C is the dot-product result;

[0173] S324: Obtain the result outputted in step S323 and calculate the weight using the softmax function;

[0174] S325: multiply the result outputted in step S323 by the weight result outputted in step S324 accordingly;

[0175] S326: applying a batch normalization layer to the result outputted in step S325 to improve the generalization ability of the model, and obtaining the fused and normalized features of the water injection wells and the oil production wells;

[0176] S327: Obtain the fused and normalized features of the injection wells and oil production wells in step S326, use 5 layers of one-dimensional convolution for feature extraction and dimensionality transformation, the number of convolution kernels in each layer is 64, 32, 16, 8, 1 respectively, and the final output value is the time window of window_size 采 The one-dimensional convolution related formula is shown in formula (8):

[0177]

[0178] Among them, each element of the output y is the sum of the products of the input x and the convolution kernel h at the corresponding position. The convolution kernel h slides in a small window and multiplies and sums the products with the corresponding parts of the input signal x to obtain each element of the output signal y. M is the length of the convolution kernel. This formula means that in a window of M elements, the corresponding elements are multiplied and added to obtain each element of the output signal y.

[0179] The beneficial effects of the above further scheme are as follows: the characteristics of oil production wells and water injection wells are extracted through different long short-term memory network units and attention units, and then through the feature fusion method, the complex feature extraction of the interactive influence of factors affecting the oil production of the well group can be realized, so that the prediction of the oil production of the well group is more accurate and combined with production measures.

[0180] The step S4 comprises the following steps:

[0181] S41: Obtain test set data;

[0182] S42: Obtain the trained well group oil production prediction model, make predictions on the test set, and use the mean absolute percentage error (MAPE) to evaluate the results. The relevant formula is shown in formula (9):

[0183]

[0184] Among them, n is the number of samples, and the predicted value and true value are the predicted result and true label of the corresponding well group oil production respectively;

[0185] S43: Based on the evaluation results, the well group oil production prediction model is continuously optimized and iterated;

[0186] S44: The maximum oil production of the well group is obtained according to the prediction model. With the maximum oil production of the well group as the goal, an adaptive particle swarm optimization algorithm is used to optimize the injection and production parameters. The adaptive strategy is used to adjust the parameters of the algorithm to improve the performance and convergence speed of the algorithm.

[0187] The step S44 uses an adaptive particle swarm optimization algorithm to perform intelligent injection and production optimization of the well group, including the following sub-steps:

[0188] S441: Initialize the particle swarm parameters: including determining the population size, number of iterations T, learning factors c1, c2 and inertia weight ω; the population size is the size of the input data; the learning factors c1 and c2 represent the strength of the local search ability and global search ability of the particle respectively; in each iteration, the adaptive particle swarm optimization algorithm calculates the fitness value of each particle; if the variance of the fitness value is small, the value of the learning factor will become smaller, so as to converge to the optimal solution; on the contrary, if the variance of the fitness value is large, the value of the learning factor will become larger, so as to better explore the solution space; the inertia weight ω is a factor that affects the optimization ability, and the inertia weight is dynamically adjusted according to the number of iterations. The update formula is as follows:

[0189]

[0190] Among them, ω max and ω min are the upper and lower limits of the inertia weight, respectively. T is the maximum number of iterations. When the number of iterations t approaches T, the inertia weight gradually decreases to better converge to the optimal solution.

[0191] S442: Determine the particle dimension and value range: The particle dimension represents the number of variables, that is, the wellhead injection pressure of each water injection well in the predicted well group; the particle value range represents the change range of the variable. The wellhead water injection pressure parameter value range is determined according to the maximum and minimum values ​​of the recent historical wellhead water injection pressure. The stratified daily water injection volume is an important parameter for intelligent injection and production optimization, and its value is determined according to the apparent water absorption index and the wellhead water injection pressure parameter: First, the apparent water absorption index is calculated according to the historical production data. The apparent water absorption index = the difference in daily water injection volume under the two working systems / the difference in wellhead pressure under the two corresponding working systems. Then, the stratified daily water injection volume is calculated according to the apparent water absorption index and the wellhead water injection pressure particle value. The relevant formula (11) is as follows:

[0192] Layered water injection t+1 =Apparent water absorption index t ×(Wellhead injection pressure t+1 - Wellhead injection pressure t )+ stratified water injection volumet (11)

[0193] S443, initializing the fitness function: using the well group daily oil production prediction model obtained in step S24 as the fitness evaluation function;

[0194] S444, randomly initialize the position x of each particle i and speed v i ;

[0195] S445, calculating the fitness value F(i) of each particle: splicing the wellhead water injection pressure and stratified water injection volume determined in S32 with the historical production time series data of the injection-production optimization time interval, regularizing the input sample requirements according to the prediction model trained in step S24, and predicting through the prediction model, and outputting the result as the fitness evaluation value F(i) of each particle;

[0196] S446: For each particle, calculate the particle fitness F(i) and compare it with the individual extreme value P i and the group extreme value P g Compare; if F(i)>P i , replace P with F(i) i ; If F(i)>P g , replace P with F(i) g ;

[0197] S447: Update the particle speed and position according to formulas (12) and (13). In order to prevent the search results from falling into local extreme values ​​and improve the search capability, an adaptive particle swarm algorithm is used to update the particle speed. The update formula is as follows:

[0198] V i (j+1)=ωV i (j)+c1r1(P i (j)-S i (j))+c2r2(p g (j)-S i (j)) (12)

[0199] S i (j+1)=S i (j)+V i (j+1) (13)

[0200] Where S i and V i are the current position vector and velocity vector of particle i, j is the number of iterations, ω is the inertia weight; c1 and c2 are accelerations; r1 and r2 are random numbers in the interval [0, 1] multiplied by the variance of the fitness value; P i The individual optimal solution found for the particle; Pg is the global optimal solution selected from all particles; S i (j) is the spatial position of particle i after the jth iteration update, V i (j) is the velocity of particle i after the jth iteration update, ωV i (j) controls the global and local search capabilities through ω; c1r1(P i (j)-S i (j)) describes the distance between the particle's current position and its best known position; c2r2(P g (j)-S i (j)) is the distance between the current position and the global optimal position, that is, the movement of the particle is also determined by the influence of the rest of the particles in the population, P g Improving the convergence speed will reduce the diversity of the search population, making the search results more likely to fall into local extremes.

[0201] S448: Determine whether the loop termination condition is met; if the maximum number of iterations is reached, the optimized model parameters are obtained; otherwise, return to step S34 to continue updating the particle position and velocity;

[0202] S449: Compare the optimal injection and production parameters obtained by particle swarm optimization with the actual injection and production parameters. If the production operation restrictions and requirements are met, this method can be used to adjust and optimize the injection and production parameters of water drive oil reservoirs.

[0203] The specific implementation modes of the present invention are described below so that those skilled in the art can understand the present invention. However, it should be clear that the present invention is not limited to the scope of the specific implementation modes. For those of ordinary skill in the art, as long as various changes are within the spirit and scope of the present invention as defined and determined by the attached claims, these changes are obvious, and all inventions and creations utilizing the concept of the present invention are protected.

[0204] like Figure 1 As shown, an embodiment of the present invention provides a method for optimizing intelligent injection and production parameters of water drive reservoirs based on LSTM and particle swarm algorithm. Taking a well group including 2 water injection wells and 4 oil production wells in an oil field in Guangdong as an example, the water injection well and oil production well data from January 1, 2019 to July 16, 2023 are obtained to predict the oil production of the well group, as shown in FIG. Figure 1 As shown, the following steps are included:

[0205] S1: Taking the daily oil production of the well group as the prediction target, obtain the production dynamic data of all water injection wells and oil production wells in the well group from January 1, 2019 to July 16, 2023;

[0206] S2: Obtain the original data in step S1 for data preprocessing, splice the data of different water injection wells and different oil production wells in the well group, and divide the data set into a training set and a test set;

[0207] S3: Construct a prediction model integrating long short-term memory network and attention mechanism and perform model training. Long short-term memory neural network units and attention units are used to extract the time series and correlation features of water injection wells and oil production wells. The features of water injection wells and oil production wells are fused through dot product and softmax mechanism. The fused features are extracted by multiple one-dimensional convolutions and the daily oil production of the well group is predicted. The mean absolute error is used as the loss function for model training, and Adam is selected as the optimizer.

[0208] S4: Input the test set into the trained prediction model that integrates the long-term and short-term characteristics of water injection wells and oil production wells, evaluate the test results, and combine the adaptive particle swarm optimization algorithm to establish the fitness evaluation function of the prediction model to optimize the two injection and production parameters of the water injection well stratified daily water injection volume and wellhead water injection pressure.

[0209] In this embodiment, by combing the existing oil field data in detail and focusing on the intelligent injection and production optimization link, the production data and reservoir data related to intelligent optimization are sorted out. Through in-depth communication and discussion with reservoir business experts, the optimization prediction target is determined. Combined with the machine learning feature selection method, the Pearson correlation coefficient analysis method is used to analyze the important factors affecting the oil production of the oil well. Therefore, it is necessary to combine the existing informationization level of the oil field and production data for feature engineering.

[0210] In this embodiment, step S1 includes the following sub-steps:

[0211] S11: Multi-source data collection and processing: Use multi-source data integration technology to obtain production and development data, geological exploration data and production history data, and integrate data from different data sources into daily production dynamic data of oil and gas wells and well group relationship data to provide a comprehensive data view;

[0212] S12: Obtain the numbers of the two water injection wells and the four oil production wells included in the well group through the well group relationship data;

[0213] S13: Based on the water injection well number and the oil production well number, the original characteristic data of the water injection well and the oil production well in the past four years are obtained through a database query statement.

[0214] S14: Obtaining the original feature data, determining whether the feature data missing of each water injection well and oil production well in the well group exceeds a threshold, deleting the water injection well and oil production well data with serious missing information in the well group, analyzing the samples or features with missing information attribute values, and using the nearest neighbor filling method, linear interpolation method, and mean method to complete the well group data;

[0215] S15: predict the production index and select the daily oil production of the well group; the key influencing factor analysis requires a comprehensive analysis of the impact of reservoir static data and injection and production well production history data on the daily oil production of the well group; use the feature correlation analysis method in machine learning to select key features; calculate the Pearson correlation coefficient between the injection and production well production history data and the daily oil production to measure the relationship between each feature and the daily oil production of the well group. Formula (1) is as follows:

[0216]

[0217] In the formula, ρ X,Y is the Pearson correlation coefficient between X and Y, decimal; r x,i For x i The rank of X in descending order, a positive integer; y x,i for y i The rank of Y in descending order, a positive integer; n is the amount of data, a positive integer.

[0218] S16: Construct a training sample library with well groups as units: Select the characteristics of water injection wells, including stratified daily water injection volume, wellhead water injection pressure, and cumulative water injection volume; select the characteristics of oil production wells, including wellhead pressure, daily oil production, water content, oil pressure, casing pressure, nozzle diameter, production method, and production time. Calculate the daily oil production of all oil production wells in the well group as the prediction target variable.

[0219] In this embodiment, the missing data are counted, and the missing data of 2 water injection wells and 4 oil production wells do not exceed the set missing threshold of 80%. Therefore, the model training set contains all water injection wells and oil production wells in the well group. The original data features of the water injection wells obtained include water injection date, daily water injection volume, and water injection duration. The original features of the oil production wells include daily oil production, water content, daily water production, oil pressure, and production duration.

[0220] In this embodiment, step S2 includes the following sub-steps:

[0221] S21: preprocessing the data for each water injection well in the well group, and then splicing the characteristic data of all water injection wells in the well group according to the date;

[0222] S22: Preprocess the data for each oil producing well in the well group, and then splice the characteristic data of all oil producing wells in the well group according to the date;

[0223] S23: The daily oil production of all oil producing wells in the well group is summed up to obtain the daily oil production characteristics of the well group, and abnormal judgment is performed, and abnormal annotations are added to obtain the initial data set of the model prediction target, including production date, daily oil production of the well group, and abnormal status;

[0224] S24: Divide the model into training set and test set;

[0225] In this embodiment, the original feature data of 2 water injection wells and 4 oil production wells need to be preprocessed, including missing value processing, exception processing, and feature construction. This embodiment uses the maximum and minimum data normalization method to normalize the feature data. Different features need to be selected in combination with the distribution of specific features to avoid data standardization problems.

[0226] In this embodiment, step S21 includes the following sub-steps:

[0227] S211: respectively obtain the original training data of two water injection wells in the well group, perform null value processing on the daily water injection volume characteristics, and fill them using the forward and backward interpolation method;

[0228] S212: Obtain the output result of step S211, perform abnormal processing on the daily water injection volume characteristics, first obtain the 24-hour daily water injection volume in the 5-day time window before and after the daily water injection volume, calculate the normal mean of the daily water injection volume, and determine whether the daily water injection volume is within the abnormal fluctuation range of the normal mean of the daily water injection volume. The abnormal data needs to be replaced by the normal mean of the daily water injection volume per hour × the production time of the day;

[0229] S213: Obtain the output result of step S212, construct the injection stop state feature of the water injection well based on the daily water injection volume, the injection stop state feature of the water injection well corresponding to the daily water injection volume of 0 is 1, and the injection stop state feature of the water injection well corresponding to the daily water injection volume greater than 0 is 0, and output the initial data set of the water injection well;

[0230] S214: iteratively process the data of all water injection wells in the well group to obtain the processed data of all water injection wells, and align and splice them according to the date;

[0231] S215: According to the maximum and minimum normalization method, the daily water injection volume characteristics of all water injection wells are independently and globally normalized, as shown in formula (2):

[0232]

[0233] Among them, x * is the normalized data, x is the time series data of each feature, x min is the minimum value, x max is the maximum value.

[0234] S216: obtaining an initial data set of two water injection wells in the well group, the features of which include water injection date, daily water injection volume, and stop injection status;

[0235] In this embodiment, interpolation and mean filling anomaly processing are used to improve data quality, and the water injection well stop injection feature is constructed in combination with production data, mainly considering the actual oil field production business. Since the daily water injection volume of 0 has a great impact on the prediction results and optimization model, the water injection well stop injection state feature is constructed. Experiments have shown that this feature can effectively improve the accuracy of water injection measures for the prediction of well group oil production.

[0236] In this embodiment, step S22 includes the following sub-steps:

[0237] S221: respectively obtain the original training data of the four oil production wells in the well group, perform abnormal judgment after processing the null value of the daily oil production feature, obtain the 24-hour daily oil production in the 10-day time window before and after the daily oil production, calculate the normal mean of the daily oil production, judge whether the daily oil production is within the abnormal fluctuation range of the normal mean, and replace the abnormal data with the normal mean of the daily oil production per hour*the production time of the day;

[0238] S222: Obtain the output result of step S221, construct the capacity characteristics based on the daily oil production, the capacity value of the i-th day is equal to the average of the daily oil production of the 10 days before this date (including the i-th day); in addition, construct the oil well shutdown status characteristics based on the daily oil production characteristics, the oil well shutdown status corresponding to the daily oil production of 0 is 1, and the oil well shutdown status is 0 when the daily oil production is greater than 0;

[0239] S223: Obtain the output result of step S222, interpolate the null values ​​of the oil pressure, production time and water production characteristics based on the daily oil production, and output the initial data set of the oil production well;

[0240] S224: Iteratively process the data of all four oil producing wells in the well group to obtain processed data, and splice them according to date;

[0241] S225: According to the maximum and minimum normalization method, the spliced ​​oil well characteristics, including daily oil production, oil pressure, water content, and production time, are independently and globally normalized;

[0242] S226: obtaining an initial data set after splicing all four oil producing wells in the well group, the features of which include production date, daily oil production, water content, oil pressure, production time, and shutdown status;

[0243] In this embodiment, the interpolation method and mean filling anomaly processing are used to improve the quality of oil well characteristic data, and the oil well shutdown feature is constructed in combination with the daily oil production data. The actual oil field production business is mainly considered, and the stage shutdown is required for pressure recovery. The shutdown has a great impact on the prediction results, so the oil well shutdown state feature is constructed. Experiments have shown that this feature can effectively improve the accuracy of the oil well production status prediction of the well group oil production.

[0244] In this embodiment, step S24 includes the following sub-steps:

[0245] S241: Obtain the initial data sets of the two water injection wells outputted in step S216 and the initial data sets of the four oil production wells outputted in step S226.

[0246] S242: Set the sample partitioning configuration parameters for water injection wells and oil production wells, including the time window length window_size of the single sample water injection well 注 , the value is [90, 60, 30], the oil well time window length window_size 采 , the value is [10, 20, 30] sliding window length s, the value is 1;

[0247] S243: Divide the initial data of the water injection wells in the well group into several training samples through a sliding window. Considering the time lag of water injection on oil production, the time window length of the water injection well is window_size 注 Set to [90, 60, 30], the parameter is optimized through grid search, and the processing formula (3) is:

[0248]

[0249] Among them, N 注 is the number of injection well samples after division, n 注 is the number of all daily data of the regularized well group water injection well training data, and s is the sliding window length;

[0250] S244: Divide the initial data of the oil wells in the well group into several training samples through a sliding window. The length of the oil well time window is window_size 采 Set to 10, 20, 30, the parameter is optimized through grid search, and the processing formula (4) is:

[0251]

[0252] Among them, N 采 is the number of oil well samples after division, n 采 is the number of daily data of the regularized injection wells in the well group, and s is the length of the sliding window;

[0253] S245: according to the ratio of training set to test set of 0.2, the end date of water injection well sample is aligned with the start date of oil production well sample, and the water injection well sample, oil production well sample and predicted target well group oil production are divided into training set and test set;

[0254] In this embodiment, the spliced ​​water injection well characteristics include the daily water injection volume and stop injection status of the two wells, and the oil production well characteristics include the production capacity, water content, oil pressure, and stop production status of the four wells. These modeling features can be used to predict the oil production of the well group through multiple demonstrations and experiments.

[0255] In this embodiment, step S3 includes the following sub-steps:

[0256] S31: training data preparation, obtaining the well group training set output in step S245;

[0257] S32: Prediction model construction, using the fusion model to extract the time series relationship and correlation features of water injection wells and oil production wells, and fusion of water injection well and oil production well features through dot product and softmax weight mechanism, batch normalization of the fused features, and feature extraction through multi-layer one-dimensional convolution, and finally output the predicted oil production of the well group;

[0258] S33: Prediction model training, input the training set into the prediction model for parameter iteration, establish the fusion characteristics of all water injection wells and oil production wells in the well group, search for the mapping relationship between the oil production during the well group, terminate when the loss function meets the iteration condition, output the trained neural network model, use the mean absolute error MAE as the loss function, and use Adam as the optimizer;

[0259] S34: Model optimization, using network search algorithm to optimize the injection well time window length window_size 注 , Oil well time window length window_size 采 , and learning rate are used to optimize the model parameters. In this embodiment, the model optimization results are that the time window length of the water injection well is 90, the time window length of the oil production well is 20, and the learning rate is 0.001. The time window of the water injection well is relatively long, which is consistent with the implementation effect of the water drive development measures in the oil reservoir. The time window of the oil production well is 20, which is consistent with the stable status of the oil production in the reservoir stage. The optimal time windows of water injection wells and oil production wells are different for different well groups, and parameters need to be set and optimized in combination with the actual production of the oil reservoir.

[0260] like Figure 2 As shown, in this embodiment, the prediction model network structure construction in step S32 includes the following sub-steps:

[0261] S321: Preliminary extraction of long-term and short-term characteristics of oil wells, construction of a 4-layer long-term and short-term memory network, with hidden nodes of 64, 32, 16, and oil well feature dimensions, for a time length of window_size 采 Extract features from oil well sample data;

[0262] S322: Obtain the result of step S321, apply the self-attention mechanism to the time step features of the oil wells extracted by the long-short cycle memory network, and further extract the fusion high-order features of the oil wells. The relevant formula (5) is as follows:

[0263]

[0264] Among them, Attention(Q, K, V) represents the correlation matrix, is the attention weight, Q, K, and V are the query matrix, the queried matrix, and the value matrix, respectively. k is the feature dimension of K, K T is the transposed matrix of K.

[0265] S323: Preliminary extraction of long-term and short-term features of water injection wells, construction of a 4-layer long-term and short-term memory network, with hidden nodes of 64, 32, 16, and water injection well feature dimensions, and a time step length of window_size 注 Extract features from injection well sample data;

[0266] S324: Obtain the result of step S323, apply the self-attention mechanism to the time step features of the water injection wells processed by the long-short cycle memory network, and further extract the fusion high-order features of the water injection wells;

[0267] S325: Obtain the oil production well features extracted in step S322 and the water injection well features extracted in step S324, transpose them and perform feature fusion using a dot product operation. The dot product calculation is shown in formula (7):

[0268]

[0269] Where A=(a1,a2…,a n ) and B = (b1, b2…, b n ) are the two vectors to be dot-producted, and C is the dot-product result.

[0270] S326: Obtain the result outputted in step S325 and calculate the weight using the softmax function;

[0271] S327: multiply the result outputted in step S325 by the weight result outputted in step S326 accordingly;

[0272] S328: applying a batch normalization layer to the result outputted in step S327 to improve the generalization ability of the model, and obtaining the fused and normalized features of the water injection wells and the oil production wells;

[0273] S329: Obtain the fused and normalized features of the injection wells and oil production wells in step S328, use 5 layers of one-dimensional convolution for feature extraction and dimensionality transformation, the number of convolution kernels in each layer is 64, 32, 16, 8, and 1 respectively, and the final output value is the time window of window_size 采 The oil production of the well group, the one-dimensional convolution related formula is as follows:

[0274]

[0275] Here, each element of the output y is the sum of the products of the input x and the convolution kernel h at the corresponding position. The convolution kernel h slides in a small window and multiplies and sums the corresponding parts of the input signal x to obtain each element of the output signal y. M is the length of the convolution kernel. This formula means that in a window of M elements, the corresponding elements are multiplied and added to obtain each element of the output signal y.

[0276] In this embodiment, the long-term and short-term features of water injection wells and oil production wells are initially extracted by constructing a 4-layer long-term and short-term memory network and an attention mechanism, using dot product and softmax to calculate weights and perform feature fusion, and finally further extracting features through multi-layer one-dimensional convolution. The network model structure design is adjusted multiple times through the prediction results to prove the effectiveness of the model.

[0277] In this embodiment, step S4 includes the following sub-steps:

[0278] S41: Obtain test set data;

[0279] S42: Obtain the trained well group oil production prediction model, make predictions on the test set, and use the mean absolute percentage error (MAPE) to evaluate the results. The relevant formula is shown in formula (9):

[0280]

[0281] Among them, n is the number of samples, and the predicted value and true value are the predicted results and true labels of the corresponding well group oil production;

[0282] S43: Based on the evaluation results, the well group oil production prediction model is continuously optimized and iterated;

[0283] S44: The maximum oil production of the well group is obtained according to the prediction model. With the maximum oil production of the well group as the goal, an adaptive particle swarm optimization algorithm is used to optimize the injection and production parameters. The adaptive strategy is used to adjust the parameters of the algorithm to improve the performance and convergence speed of the algorithm.

[0284] The step S44 uses an adaptive particle swarm optimization algorithm to perform intelligent injection and production optimization of the well group, such as Figure 4 As shown, it includes the following steps:

[0285] S441. Initialize the particle swarm parameters: including determining the population size, the number of iterations T, the learning factors c1, c2 and the inertia weight ω; the population size is the size of the input data; the learning factors c1 and c2 represent the strength of the local search ability and the global search ability of the particle respectively; in each iteration, the adaptive particle swarm optimization algorithm calculates the fitness value of each particle; if the variance of the fitness value is small, the value of the learning factor will become smaller, so as to converge to the optimal solution; on the contrary, if the variance of the fitness value is large, the value of the learning factor will become larger, so as to better explore the solution space; the inertia weight ω is a factor that affects the optimization ability, and the inertia weight is dynamically adjusted according to the number of iterations. The update formula is as follows:

[0286]

[0287] Among them, ω max and ω min are the upper and lower limits of the inertia weight, respectively, and T is the maximum number of iterations. When the number of iterations t approaches T, the inertia weight gradually decreases to better converge to the optimal solution.

[0288] S442. Determine the particle dimension and value range: The particle dimension represents the number of variables, that is, the predicted wellhead injection pressure of each water injection well in the well group; the particle value range represents the change range of the variable, and the wellhead water injection pressure parameter value range is determined according to the maximum and minimum values ​​of the recent historical wellhead water injection pressure. The stratified daily water injection volume is an important parameter for intelligent injection and production optimization, and its value is determined according to the apparent water absorption index and the wellhead water injection pressure parameters: First, the apparent water absorption index is calculated based on historical production data. The apparent water absorption index = the difference in daily water injection volume under the two working systems / the difference in wellhead pressure under the corresponding two working systems. Then, the stratified daily water injection volume is calculated based on the apparent water absorption index and the wellhead water injection pressure particle values. The relevant formula (11) is as follows:

[0289] Layered water injection t+1 =Apparent water absorption index t ×(Wellhead injection pressure t+1 - Wellhead injection pressure t )+ stratified water injection volume t (11)

[0290] S443, initializing the fitness function: using the well group daily oil production prediction model obtained in step S24 as the fitness evaluation function;

[0291] S444, randomly initialize the position x of each particle i and speed vi ;

[0292] S445. Calculate the fitness value F(i) of each particle: splice the wellhead water injection pressure and stratified water injection volume determined in S32 with the historical production time series data of the injection-production optimization time interval, regularize the input sample requirements according to the prediction model trained in step S24, and then predict through the prediction model, and output the result as the fitness evaluation value F(i) of each particle.

[0293] S446: For each particle, calculate the particle fitness F(i) and compare it with the individual extreme value P i and the group extreme value P g Compare; if F(i)>P i , replace P with F(i) i ; If F(i)>P g , replace P with F(i) g ;

[0294] S447: Update the particle speed and position according to formulas (12) and (13). In order to prevent the search results from falling into local extreme values ​​and improve the search capability, an adaptive particle swarm algorithm is used to update the particle speed. The update formula is as follows:

[0295] V i (j+1)=ωV i (j)+c1r1(P i (j)-S i (j))+c2r2(p g (j)-S i (j)) (11)

[0296] S i (j+1)=S i (j)+V i (j+1) (12)

[0297] Where S i and V i are the current position vector and velocity vector of particle i, j is the number of iterations, ω is the inertia weight; c1 and c2 are accelerations; r1 and r2 are random numbers in the interval [0, 1] multiplied by the variance of the fitness value; P i The individual optimal solution found for the particle; P g is the global optimal solution selected from all particles; S i (j) is the spatial position of particle i after the jth iteration update, V i (j) is the velocity of particle i after the jth iteration update. ωV i (j) controls the global and local search capabilities through ω; c1r1(P i(j)-S i (j)) describes the distance between the particle's current position and its best known position; c2r2(P g (j)-S i (j)) is the distance between the current position and the global optimal position, that is, the movement of the particle is also determined by the influence of the rest of the particles in the population, P g While increasing the convergence speed, it will reduce the population diversity during the search, causing the search results to easily fall into local extremes.

[0298] S448: Determine whether the loop termination condition is met; if the maximum number of iterations is reached, the optimized model parameters are obtained; otherwise, return to step S34 to continue updating the particle position and velocity;

[0299] S449: Compare the optimal injection and production parameters obtained by particle swarm optimization with the actual injection and production parameters. If the production operation constraints and requirements are met, this method can be used for detailed recommendation of injection and production parameters for water drive reservoirs.

[0300] In this embodiment, Figure 3 As shown in the figure, the test set has a total of 78 samples, and the evaluation index MAPE is 95.7, which means the prediction result is good. In the actual oilfield water injection development process, the historical water injection well data of 80 days before the decision date, the oil production well data of 10 days, the water injection measures of the water injection wells and the production status data of the oil production wells during the future decision optimization period of 10 days can be spliced ​​to obtain the prediction samples, which are input into the well group oil production prediction model for prediction. Based on the maximum oil production of the well group, the adaptive particle swarm algorithm continuously calculates, updates, and cycles to obtain the optimal injection and production parameters, thereby guiding the adjustment and optimization of the injection and production scheme of the water drive reservoir.

[0301] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. An intelligent injection and production parameter optimization method for water drive reservoirs based on LSTM and particle swarm algorithm, characterized in that: The following steps are involved: S1: Taking the daily oil production of the well group as the prediction target, the production dynamic data of all water injection wells and oil production wells in the well group are obtained according to the prediction training cycle, and the key influencing factors of the well group oil production are obtained by correlation analysis method to determine the characteristics of the prediction model; S2: Obtain the original feature data in step S1 for data preprocessing, splice the data of different water injection wells and different oil production wells in the well group, and divide the data set into a training set and a test set; S3: Construct a prediction model integrating long short-term memory network and attention mechanism and perform model training. Extract the temporal relationship and correlation features between water injection wells and oil production wells. Fuse the features of water injection wells and oil production wells through dot product and softmax mechanism. Use multiple one-dimensional convolutions to extract features of the fused features and predict the daily oil production of the well group. The mean absolute error is used as the loss function for model training, and Adam is selected as the optimizer. S4: Input the test set into the trained prediction model that integrates the long-term and short-term characteristics of water injection wells and oil production wells, evaluate the test results, and optimize the two injection and production parameters of the water injection wells, namely, the daily injection volume of the water injection wells and the wellhead injection pressure, by combining the adaptive particle swarm optimization algorithm.

2. The method for optimizing water drive reservoir intelligent injection and production parameters based on LSTM and particle swarm algorithm according to claim 1, characterized in that: The step S1 comprises the following steps: S11: Multi-source data collection and integration: Use multi-source data integration technology to obtain production and development data, geological exploration data and production history data, and integrate data from different data sources into daily production dynamic data of oil and gas wells and well group relationship data to provide a comprehensive data view; S12: Obtaining the numbers of m water injection wells and n oil production wells included in a certain well group through the well group relationship data; S13: Based on the water injection well number and the oil production well number, the original characteristic data of the water injection well and the oil production well in the past k years are obtained through a database query statement. The water injection well characteristics include the water injection date, daily water injection volume, and water injection duration. The oil production well characteristics include daily oil production, water content, daily water production, oil pressure, and production duration. S14: A prediction model can only be trained if there is at least one water injection well and one oil production well data in a well group. To improve the model training data conditions, after obtaining the original feature data, the data missing situation is judged to determine whether the feature data missing situation of each water injection well and oil production well in the well group exceeds the threshold, and the water injection well and oil production well data with serious missing well group are deleted. Samples or features with missing information attribute values ​​are analyzed, and the nearest neighbor filling method, linear interpolation method, and mean method are used to complete the well group data; S15: To predict production indicators, select the daily oil production of the well group; the key influencing factor analysis requires a comprehensive analysis of the impact of reservoir static data and injection and production well production history data on the daily oil production of the well group; the feature correlation analysis method in machine learning is used to select key features; the Pearson correlation coefficient between the injection and production well production history data and the daily oil production is calculated to measure the relationship between each feature and the daily oil production of the well group, as shown in formula (1): In the formula, ρ X,Y is the Pearson correlation coefficient between X and Y, decimal; r x,i For x i The rank of X in descending order, a positive integer; y x,i for y i The rank of Y in descending order, a positive integer; n is the amount of data, a positive integer; S16: Construct a training sample library with well groups as units: select the characteristics of water injection wells, which include stratified daily water injection volume, wellhead water injection pressure, and cumulative water injection volume; select the characteristics of oil production wells, which include wellhead pressure, daily oil production, water content, oil pressure, casing pressure, nozzle diameter, production method, and production time; calculate the daily oil production of all oil production wells in the well group as the prediction target variable.

3. The method for optimizing water drive reservoir intelligent injection and production parameters based on LSTM and particle swarm algorithm according to claim 1, characterized in that: The step S2 comprises the following steps: S21: preprocessing the data for each water injection well in the well group, and then splicing the characteristic data of all water injection wells in the well group according to the date; S22: Preprocess the data for each oil producing well in the well group, and then splice the characteristic data of all oil producing wells in the well group according to the date; S23: The daily oil production of all oil producing wells in the well group is summed up to obtain the daily oil production characteristics of the well group, and abnormal judgment is performed, and abnormal annotations are added to obtain the initial data set of the model prediction target, including production date, daily oil production of the well group, and abnormal status; S24: Divide the model into training set and test set.

4. The method for optimizing water drive reservoir intelligent injection and production parameters based on LSTM and particle swarm algorithm according to claim 3, characterized in that: The step S21 comprises the following steps: S211: obtaining the original training data of a water injection well in the well group, performing null value processing on the daily water injection volume characteristics of the water injection well, and filling it with forward and backward interpolation method; S212: Obtain the output result of step S211, perform abnormal processing on the daily water injection volume characteristics, first obtain the 24-hour daily water injection volume in the t-day time window before and after the daily water injection volume, calculate the normal mean of the daily water injection volume, and determine whether the daily water injection volume is within the abnormal fluctuation range of the normal mean of the daily water injection volume. The abnormal data needs to be replaced with the normal mean of the daily water injection volume per hour × the production time of the day; S213: Obtain the output result of step S212, construct the stop injection state feature of the water injection well based on the daily water injection volume, when the daily water injection volume is 0, the corresponding stop injection state feature of the water injection well is 1, when the daily water injection volume is greater than 0, the corresponding stop injection state feature of the water injection well is 0, and output the initial data set of the water injection well; S214: iteratively process the data of all water injection wells in the well group to obtain the processed data of all water injection wells, and align and splice them according to the date; S215: According to the maximum and minimum normalization method, the daily injection volume characteristics of all injection wells are independently and globally normalized, as shown in formula (2): Among them, x * is the normalized data, x is the time series data of each feature, x min is the minimum value, x max is the maximum value; S216: Obtain the initial data set of all water injection wells in the well group, the features of which include water injection date, daily water injection volume, and injection stop status.

5. The method for optimizing water drive reservoir intelligent injection and production parameters based on LSTM and particle swarm algorithm according to claim 4, characterized in that: The step S22 comprises the following steps: S221: Obtain the original training data of a certain oil production well in the well group, perform abnormal judgment after processing the daily oil production feature null value of the oil production well, obtain the 24-hour daily oil production in the time window of t days before and after the daily oil production, calculate the normal mean of the daily oil production, judge whether the daily oil production is within the abnormal fluctuation range of the normal mean, and replace the abnormal data with the normal mean of the daily oil production per hour × the production time of the day; S222: Obtain the output result of step S221, construct the production capacity characteristics based on the daily oil production, and the production capacity value of the i-th day is equal to the average of the daily oil production of the 10 days before the date; in addition, construct the shutdown status characteristics of the oil well based on the daily oil production characteristics, when the daily oil production is 0, the corresponding oil well shutdown status is 1, and when the daily oil production is greater than 0, the oil well shutdown status is 0; S223: Obtain the output result of step S222, interpolate the null values ​​of the oil pressure, production time and water production characteristics based on the daily oil production, and output the initial data set of the oil production well; S224: Iteratively process all the oil production well data of the well group to obtain processed data, and splice them according to date; S225: performing independent global normalization processing on the spliced ​​oil production well characteristics according to the maximum and minimum normalization method; the oil production well characteristics include daily oil production, oil pressure, water content, and production time; S226: Obtain an initial data set after splicing all the oil producing wells in the well group, the features of which include production date, daily oil production, water content, oil pressure, production time, and shutdown status.

6. The method for optimizing intelligent injection and production parameters of water drive reservoirs based on LSTM and particle swarm algorithm according to claim 5, characterized in that: The step S24 comprises the following steps: S241: Obtaining the initial data set of the water injection well outputted in step S216 and the initial data set of the oil production well outputted in step S226; S242: Set the sample partitioning configuration parameters for water injection wells and oil production wells, including the time window length window_size of the single sample water injection well 注 , the oil well time window length window_size 采 , sliding window length s; S243: Divide the initial data of the water injection wells in the well group into several training samples through a sliding window. Considering the time lag of water injection on oil production, the time window length of the water injection well is window_size 注 The parameters are set to 90, 60, and 30. The optimization is performed through grid search. The processing formula is shown in formula (3): Among them, N 注 is the number of injection well samples after division, n 注 is the number of all daily data of the water injection well training data of the regularized well group, and s is the sliding window length; S244: Divide the initial data of the oil wells in the well group into several training samples through a sliding window. The length of the oil well time window is window_size 采 Set to 10, 20, 30, the parameter is optimized through grid search, and the processing formula (4) is: Among them, N 采 is the number of oil well samples after division, n 采 is the number of all daily data of the water injection wells in the regularized well group, and s is the length of the sliding window; S245: According to the set ratio of the training set to the test set and the date association relationship, the water injection well samples, the oil production well samples and the predicted oil production of the target well group are divided into the training set and the test set.

7. The method for optimizing intelligent injection and production parameters of water drive reservoirs based on LSTM and particle swarm algorithm according to claim 6, characterized in that: The step S3 comprises the following steps: S31: training data preparation, obtaining the well group training set output in step S245; S32: Prediction model construction, using the fusion model to extract the time series relationship and correlation features of water injection wells and oil production wells, and fusion of water injection well and oil production well features through dot product and softmax weight mechanism, batch normalization of the fused features, and feature extraction through multi-layer one-dimensional convolution, and finally output the predicted oil production of the well group; S33: Prediction model training, input the training set into the prediction model for parameter iteration, establish the fusion characteristics of all water injection wells and oil production wells in the well group, search for the mapping relationship between the oil production during the well group, terminate when the loss function meets the iteration condition, output the trained neural network model, use the mean absolute error MAE as the loss function, optimize the weights of the entire neural network through the Adam optimizer, and minimize the loss value of the loss function; S34: Model optimization, using network search algorithm to optimize the injection well time window length window_size 注 , Oil well time window length window_size 采 , learning rate to optimize model parameters, evaluate and select the optimal model and store the model structure and parameters.

8. The method for optimizing intelligent injection and production parameters of water drive reservoirs based on LSTM and particle swarm algorithm according to claim 7, characterized in that: The step S32 comprises the following steps: S321: Preliminary extraction of long-term and short-term features of oil wells and water injection wells, construction of a 4-layer long-term and short-term memory network, with hidden nodes of 64, 32, 16, and oil well / water injection well feature dimensions respectively, and a recurrent neural network LSTM is used to perform a time length of window_size 采 The oil well sample data and time length are window_size 注 The model divides the time series data into multiple subsequences, each of which is 10 time steps long. Then, each subsequence passes through a series of LSTM layers to extract time series features. The size of each LSTM layer gradually decreases to capture features at different levels. In addition, each subsequence is processed by the attention mechanism to strengthen the influence of associated features. The relevant formula (5) is as follows: This formula represents the forward calculation formula of LSTM at time t: are the three inputs of the network at time t, is the hidden layer output value at time t; is the hidden layer input value at time t-1, is the network external input value at time t-1; is the current input unit status; is the unit state of the network at time t-1; They represent the forget gate output, input gate output, output gate output and unit state at time t respectively. σ and tanh are both activation functions, where σ is the sigmoid function and tanh is the hyperbolic tangent function. b f , b i , b c , b o are the bias values ​​of each gated unit and cell respectively; W f , W i , W c , W c Represent the weight parameter matrices of the forget gate, input gate, cell state, and output gate respectively; S322: Obtain the result of step S321, apply the self-attention mechanism to the time step features of the oil production wells and water injection wells extracted by the long-short cycle memory network, and further extract the fusion high-order features of the oil production wells and water injection wells. The relevant formula (6) is as follows: Among them, Attention(Q, K, V) represents the correlation matrix, is the attention weight, Q, K, and V are the query matrix, the queried matrix, and the value matrix, respectively. k is the feature dimension of K, K T is the transposed matrix of K; S323: Obtain the oil production well features and water injection well features extracted in step S321, transpose them and perform feature fusion using a dot product operation. The dot product calculation is as shown in formula (7): Among them, a i =(a1,a2...,a n ) and b i =(b1,b2...,b n ) are the two vectors to be dot-producted, and C is the dot-product result; S324: Obtain the result outputted in step S323 and calculate the weight using the softmax function; S325: multiply the result outputted in step S323 by the weight result outputted in step S324 accordingly; S326: applying a batch normalization layer to the result outputted in step S325 to improve the generalization ability of the model, and obtaining the fused and normalized features of the water injection wells and the oil production wells; S327: Obtain the fused and normalized features of the injection wells and oil production wells in step S326, use 5 layers of one-dimensional convolution for feature extraction and dimensionality transformation, the number of convolution kernels in each layer is 64, 32, 16, 8, 1 respectively, and the final output value is the time window of window_size 采 The one-dimensional convolution related formula is shown in formula (8): Among them, each element of the output y is the sum of the products of the input x and the convolution kernel h at the corresponding position. The convolution kernel h slides in a small window and multiplies and sums the products with the corresponding parts of the input signal x to obtain each element of the output signal y. M is the length of the convolution kernel. This formula means that in a window of M elements, the corresponding elements are multiplied and added to obtain each element of the output signal y.

9. The method for optimizing water drive reservoir intelligent injection and production parameters based on LSTM and particle swarm algorithm according to claim 8, characterized in that: The step S4 comprises the following steps: S41: Obtain test set data; S42: Obtain the trained well group oil production prediction model, make predictions on the test set, and use the mean absolute percentage error MAPE to evaluate the results. The relevant formula is shown in formula (9): Among them, n is the number of samples, and the predicted value and true value are the predicted result and true label of the corresponding well group oil production respectively; S43: Based on the evaluation results, the well group oil production prediction model is continuously optimized and iterated; S44: The maximum oil production of the well group is obtained according to the prediction model. With the maximum oil production of the well group as the goal, an adaptive particle swarm optimization algorithm is used to optimize the injection and production parameters. The adaptive strategy is used to adjust the parameters of the algorithm to improve the performance and convergence speed of the algorithm.

10. The method for optimizing water drive reservoir intelligent injection and production parameters based on LSTM and particle swarm algorithm according to claim 9, characterized in that: The step S44 uses an adaptive particle swarm optimization algorithm to perform intelligent injection and production optimization of the well group, including the following sub-steps: S441: Initialize the particle swarm parameters: including determining the population size, number of iterations T, learning factors c1, c2 and inertia weight ω; the population size is the size of the input data; the learning factors c1 and c2 represent the strength of the local search ability and global search ability of the particle respectively; in each iteration, the adaptive particle swarm optimization algorithm calculates the fitness value of each particle; if the variance of the fitness value is small, the value of the learning factor will become smaller, so as to converge to the optimal solution; on the contrary, if the variance of the fitness value is large, the value of the learning factor will become larger, so as to better explore the solution space; the inertia weight ω is a factor that affects the optimization ability, and the inertia weight is dynamically adjusted according to the number of iterations. The update formula is as follows: Among them, ω max and ω min are the upper and lower limits of the inertia weight, respectively. T is the maximum number of iterations. When the number of iterations t approaches T, the inertia weight gradually decreases to better converge to the optimal solution. S442: Determine the particle dimension and value range: The particle dimension represents the number of variables, that is, the wellhead injection pressure of each water injection well in the predicted well group; the particle value range represents the change range of the variable. The wellhead water injection pressure parameter value range is determined according to the maximum and minimum values ​​of the recent historical wellhead water injection pressure. The stratified daily water injection volume is an important parameter for intelligent injection and production optimization, and its value is determined according to the apparent water absorption index and the wellhead water injection pressure parameter: First, the apparent water absorption index is calculated according to the historical production data. The apparent water absorption index = the difference in daily water injection volume under the two working systems / the difference in wellhead pressure under the two corresponding working systems. Then, the stratified daily water injection volume is calculated according to the apparent water absorption index and the wellhead water injection pressure particle value. The relevant formula (11) is as follows: Layered water injection t+1 =Apparent water absorption index t ×(Wellhead injection pressure t+1 - Wellhead injection pressure t )+ stratified water injection volume t (11) S443, initializing the fitness function: using the well group daily oil production prediction model obtained in step S24 as the fitness evaluation function; S444, randomly initialize the position x of each particle i and speed v i ; S445, calculating the fitness value F(i) of each particle: splicing the wellhead water injection pressure and stratified water injection volume determined in S32 with the historical production time series data of the injection-production optimization time interval, regularizing the input sample requirements according to the prediction model trained in step S24, and predicting through the prediction model, and outputting the result as the fitness evaluation value F(i) of each particle; S446: For each particle, calculate the particle fitness F(i) and compare it with the individual extreme value P i and the group extreme value P g Compare; if F(i)>P i , replace P with F(i) i ; If F(i)>P g , replace P with F(i) g ; S447: Update the particle speed and position according to formulas (12) and (13). In order to prevent the search results from falling into local extreme values ​​and improve the search capability, an adaptive particle swarm algorithm is used to update the particle speed. The update formula is as follows: V i (j+1)=ωV i (j)+c1r1(P i (j)-S i (j))+c2r2(p g (j)-S i (j)) (12) S i (j+1)=S i (j)+V i (j+1) (13) Where S i and V i are the current position vector and velocity vector of particle i, j is the number of iterations, ω is the inertia weight; c1 and c2 are accelerations; r1 and r2 are random numbers in the interval [0, 1] multiplied by the variance of the fitness value; P i The individual optimal solution found for the particle; P g is the global optimal solution selected from all particles; S i (j) is the spatial position of particle i after the jth iteration update, V i (j) is the velocity of particle i after the jth iteration update, ωV i (j) controls the global and local search capabilities through ω; c1r1(P i (j)-S i (j)) describes the distance between the particle's current position and its best known position; c2r2(P g (j)-S i (j)) is the distance between the current position and the global optimal position, that is, the movement of the particle is also determined by the influence of the rest of the particles in the population, P g Improving the convergence speed will reduce the diversity of the search population, making the search results more likely to fall into local extremes. S448: Determine whether the loop termination condition is met; if the maximum number of iterations is reached, the optimized model parameters are obtained; otherwise, return to step S34 to continue updating the particle position and velocity; S449: Compare the optimal injection and production parameters obtained by particle swarm optimization with the actual injection and production parameters. If the production operation restrictions and requirements are met, this method can be used to adjust and optimize the injection and production parameters of water drive oil reservoirs.

Citation Information

Patent Citations

  • Multi-well system water drive reservoir injection-production parameter intelligent optimization method

    CN113032953A

  • Layered water injection optimization method based on long short-term memory neural network and particle swarm optimization algorithm

    CN114357852A

  • Single well production dynamic prediction method based on long and short term memory deep neural network

    CN116523086A

Cited By

  • Well group injection-production scheme optimization method and device based on logistic regression algorithm, equipment and medium

    CN119337754A

  • Well group injection and production scheme optimization method, device, equipment and medium based on logistic regression algorithm

    CN119337754B

  • Oil reservoir layered injection-production production prediction method based on LSTM-Attention

    CN119692576A

  • A method for predicting reservoir stratified injection and production based on LSTM-Attention

    CN119692576B

  • Method and system for quantitatively representing connectivity between injection and production wells by using machine learning

    CN119712063A