CN114357852A - Layered water injection optimization method based on long-short term memory neural network and particle swarm optimization algorithm - Google Patents
Layered water injection optimization method based on long-short term memory neural network and particle swarm optimization algorithm Download PDFInfo
- Publication number
- CN114357852A CN114357852A CN202111338932.3A CN202111338932A CN114357852A CN 114357852 A CN114357852 A CN 114357852A CN 202111338932 A CN202111338932 A CN 202111338932A CN 114357852 A CN114357852 A CN 114357852A
- Authority
- CN
- China
- Prior art keywords
- water injection
- oil well
- training
- long
- neural network
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- XLYOFNOQVPJJNP-UHFFFAOYSA-N water Substances O XLYOFNOQVPJJNP-UHFFFAOYSA-N 0.000 title claims abstract description 202
- 238000002347 injection Methods 0.000 title claims abstract description 181
- 239000007924 injection Substances 0.000 title claims abstract description 181
- 239000002245 particle Substances 0.000 title claims abstract description 69
- 238000005457 optimization Methods 0.000 title claims abstract description 68
- 238000000034 method Methods 0.000 title claims abstract description 63
- 238000004422 calculation algorithm Methods 0.000 title claims abstract description 45
- 238000013528 artificial neural network Methods 0.000 title claims abstract description 32
- 230000015654 memory Effects 0.000 title claims abstract description 22
- 238000004519 manufacturing process Methods 0.000 claims abstract description 76
- 239000003129 oil well Substances 0.000 claims abstract description 59
- 238000012549 training Methods 0.000 claims abstract description 57
- 239000007788 liquid Substances 0.000 claims abstract description 50
- 238000012360 testing method Methods 0.000 claims abstract description 15
- 238000012216 screening Methods 0.000 claims abstract description 11
- 238000010606 normalization Methods 0.000 claims abstract description 8
- 230000006870 function Effects 0.000 claims description 29
- 230000007774 longterm Effects 0.000 claims description 17
- 230000004913 activation Effects 0.000 claims description 16
- 239000000243 solution Substances 0.000 claims description 16
- 230000008569 process Effects 0.000 claims description 13
- 230000001149 cognitive effect Effects 0.000 claims description 11
- 239000011159 matrix material Substances 0.000 claims description 10
- ORILYTVJVMAKLC-UHFFFAOYSA-N Adamantane Natural products C1C(C2)CC3CC1CC2C3 ORILYTVJVMAKLC-UHFFFAOYSA-N 0.000 claims description 8
- 238000012545 processing Methods 0.000 claims description 7
- 239000013598 vector Substances 0.000 claims description 6
- 230000033001 locomotion Effects 0.000 claims description 5
- 238000007637 random forest analysis Methods 0.000 claims description 5
- 238000013507 mapping Methods 0.000 claims description 4
- 230000003044 adaptive effect Effects 0.000 claims description 3
- 238000010276 construction Methods 0.000 claims description 3
- 238000012937 correction Methods 0.000 claims description 3
- 238000003066 decision tree Methods 0.000 claims description 3
- 239000012530 fluid Substances 0.000 claims description 3
- 238000012163 sequencing technique Methods 0.000 claims description 3
- 238000000638 solvent extraction Methods 0.000 claims description 3
- 238000004148 unit process Methods 0.000 claims description 3
- 230000007547 defect Effects 0.000 abstract description 3
- 238000004088 simulation Methods 0.000 abstract description 3
- 210000002569 neuron Anatomy 0.000 description 7
- 230000008859 change Effects 0.000 description 6
- 238000011161 development Methods 0.000 description 5
- 238000004364 calculation method Methods 0.000 description 4
- 230000000694 effects Effects 0.000 description 4
- 230000008901 benefit Effects 0.000 description 3
- 238000006243 chemical reaction Methods 0.000 description 3
- 230000001276 controlling effect Effects 0.000 description 3
- 230000019637 foraging behavior Effects 0.000 description 3
- 239000012535 impurity Substances 0.000 description 3
- 230000009467 reduction Effects 0.000 description 3
- 210000004027 cell Anatomy 0.000 description 2
- 238000011156 evaluation Methods 0.000 description 2
- 230000007787 long-term memory Effects 0.000 description 2
- 238000003062 neural network model Methods 0.000 description 2
- 238000011160 research Methods 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000013136 deep learning model Methods 0.000 description 1
- 238000010586 diagram Methods 0.000 description 1
- 230000008034 disappearance Effects 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 238000010801 machine learning Methods 0.000 description 1
- 230000000306 recurrent effect Effects 0.000 description 1
- 230000006403 short-term memory Effects 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
Images
Landscapes
- Feedback Control In General (AREA)
Abstract
A stratified water injection optimization method based on a long-short term memory neural network and a particle swarm optimization algorithm comprises the following steps: determining a data set and dividing the data set into a training set and a test set; analyzing the important degree of contribution of each water injection interval to the oil well liquid production rate by the MDI method, and screening out main water injection intervals influencing the oil well liquid production rate; after screening out main water injection layer sections influencing the liquid production capacity of the oil well, carrying out normalization treatment on the water injection capacity of each water injection layer section; building, training and verifying an LSTM model, and training to obtain the LSTM model of the oil well; and optimizing the layered water injection amount of each water injection well by adopting a PSO algorithm. The invention utilizes the long-short term memory neural network and the particle swarm optimization algorithm to overcome the defects of the traditional layered water injection optimization method based on numerical reservoir simulation.
Description
Technical Field
The invention belongs to the technical field of oil and gas exploitation, and particularly relates to a stratified water injection optimization method based on a long-short term memory neural network and a particle swarm optimization algorithm.
Background
At present, most of oil fields in China enter the middle and later stages of development, the water content is increased, the development benefit is reduced, stratified water injection is an important means for improving the contradiction between injection and production among layers and improving the water drive development effect in the oil field production process, and development of stratified water injection optimization research has important significance for maintaining efficient water control and oil increase development of the oil fields.
The layered water injection optimization based on the numerical reservoir simulation has the defects of strong uncertainty of a geological model, more required data, long calculation time consumption and the like. Machine learning and intelligent optimization algorithms developed in recent years provide a new means for optimization of layered water injection. BP neural networks are widely used for yield prediction, but do not take into account the effects of historical time series data.
Disclosure of Invention
Aiming at the problems in the prior art, the invention discloses a layered water injection optimization method based on a long-short term memory neural network and a particle swarm optimization algorithm.
The invention utilizes long-short term memory neural network (LSTM) and Particle Swarm Optimization (PSO) to overcome the defects of the traditional layered water injection optimization method based on numerical reservoir simulation. A long-short term memory neural network (LSTM) is a time recursion neural network model, has a time sequence concept, has long-term memory capacity, belongs to a typical deep learning model, and can dig potential rules among data more deeply. The LSTM is an improvement of a Recurrent Neural Network (RNN), and an input gate, an output gate and a forgetting gate are added on the basis of the RNN, so that the weight of self-circulation is changed, and therefore, under the condition that model parameters are fixed, integral scales at different moments can be dynamically changed, the problem of gradient disappearance or gradient expansion is avoided, and the production dynamics is accurately predicted. The Particle Swarm Optimization (PSO) is an optimization algorithm proposed according to the foraging behavior of birds, a group of particles are initialized randomly in a search space, the position of each particle is a solution, the solution is substituted into an objective function to obtain a fitness value, the quality of the particles is judged according to the fitness value, and the moving direction and the step length of the particles are determined by the speed of the particles. In each iteration, the particles can continuously update the positions and the speeds of the particles according to the information of the particles and the information of the whole particle swarm, and the iteration is stopped when the termination condition is reached, so that the optimal solution is found.
The detailed technical scheme of the invention is as follows:
a stratified water injection optimization method based on a long-short term memory neural network and a particle swarm optimization algorithm is characterized in that:
step one, determining a data set and dividing the data set into a training set and a testing set, wherein the specific method comprises the following steps:
s1.1: determining a data set
Determining a production well group, and selecting liquid production amount and water content data of an oil well in the well group in a certain time period and layered water injection amount data of a water injection well in a corresponding time period as a data set;
if the missing data exists in the data set at a certain time point or within a certain time period, filling the missing data with the average value of the data near the missing data; wherein, the certain time point is a certain day; the certain time period refers to a certain number of consecutive days, at least two days;
s1.2: partitioning a data set into a training set and a test set
Dividing a data set into a training set and a test set according to a preset proportion; preferably, the preset ratio is 8: 2;
step two, analyzing the important degree of contribution of each water injection interval to the oil well liquid production rate by an MDI method (the MDI method is based on an average impurity degree reduction method), and screening out the main water injection intervals influencing the oil well liquid production rate, wherein the specific method comprises the following steps:
s2.1: analyzing the importance degree of contribution of each water injection interval to oil well liquid production capacity based on MDI method
A random forest classifier module is led into a sklern library, water injection quantity of each layer is used as a characteristic value, and liquid production quantity is used as an observed value to train an RF model (the RF model refers to a random forest model); in the generation process of the RF model, adding hierarchical water injection characteristic nodes to the RF model in sequence, obtaining the MDI value of an observed value when a certain layer of water injection characteristic is selected and added, adding the rest hierarchical water injection characteristics in sequence, stopping the growth of the decision tree until all the characteristics are traversed, and obtaining the MDI values of the rest characteristic parameters at the same time;
s2.2: screening out main water injection layer section influencing oil well liquid production
Sequencing the layered water injection quantity characteristics according to the MDI value, reserving the layered water injection quantity characteristics with the MDI value ranked at the top, and determining the main water injection layer section influencing the oil well liquid production quantity; preferably, the stratified water injection quantity characteristic of 85 percent of the MDI value ranking is reserved;
step three, after screening out the main water injection interval which influences the liquid production capacity of the oil well, carrying out normalization treatment on the water injection capacity of each water injection interval, wherein the specific method comprises the following steps:
and mapping the input characteristic data of each water injection layer section to an interval [0,1] by adopting a maximum and minimum normalization method, wherein the formula is as follows:
wherein x represents the data of the water injection amount of a certain layer, xminRepresents the minimum value, x, of the water injection in the zonemaxThe maximum value of the water injection amount of the layer is shown;
step four, building, training and verifying an LSTM model, taking the layered water injection amount as input, and taking the oil well liquid production amount and the water content as output, and training to obtain the LSTM model of the oil well, wherein the specific method comprises the following steps:
s4.1: construction of LSTM model
Leading in an open-source artificial neural network algorithm tool module from a sklern library to build a long-short term memory neural network:
at time t, the LSTM unit processes the input state xtShort term hidden state ht-1And long-term hidden state ct-1Generating an output state yt;
Long term hidden state ct-1The relevant information of the time step before the t moment is contained;
short term hidden state ht-1Containing information of the last time step;
within the LSTM cell, state x is inputtAnd short-term hidden state ht-1Is processed by the full connection layer FC, wherein gt、ft、it、otRespectively as follows:
wherein f is a nonlinear activation function, generally tan h or ReLU, equations (6) to (7); σ is an activation function, usually Sigmoid, equation (8); f. oft、it、otThe activation function sigma determines to respectively control a forgetting gate, an input gate and an output gate, and the value range is 0 to 1; gtIs determined by a nonlinear activation function f, and itControlling parameters of the input gate together, wherein the value range is 0 to 1; wxg、Wxf、Wxi、WxoTo process input xtWeight matrix of Whg、Whf、Whi、WhoFor processing shortHidden state ht-1Weight matrix of bg、bf、bi、boIs a bias term; the weight matrix and the bias term are the weighting coefficient of each element in the state matrix and are automatically adjusted by a program in the self-learning process of the neural network;
at forgetting gate, LSTM unit determines t time ct-1Forgotten part by performing ftAnd ct-1And array element multiplication between them, specifically: c. Ct-1Elements in the table are multiplied by 0, so that all the elements are forgotten, and multiplied by 1, so that all the elements are reserved; at the input gate, the LSTM unit passes execution gtAnd itMultiplying array elements in between to determine g in long-term hidden statetA saved portion; information to be forgotten in the processing of the doorAnd processing information of input gateCombined to update the long-term hidden state (c) at time tt):
output gate handles long-term hidden state of updates ctAnd the output vector otGenerating an updated short-term hidden state ht:
The LSTM model parameters comprise training times, time step length, batch size, the number of hidden layers and the number of neurons contained in the hidden layers, the proportion of the neurons which are randomly ignored by the Dropout layer, the conversion dimension of output vectors of the fully connected Dense layer, the selection of f function and the selection of sigma function, the parameters are determined according to a grid search method, the grid search method is to arrange and combine the possible values of each parameter, list all possible combination results to generate a grid, then use each combination for LSTM model training, evaluate the results according to the following model evaluation indexes and return the best parameter combination;
evaluating the LSTM model training by using mean square error MSE (mean Squared error):
wherein, N is the number of data, x' is the predicted data after LSTM model learning, x is the real data, the smaller the mean square error is, the better the model training is;
s4.2: training of LSTM models
The artificial neural network built in the step S4.1 is adopted to train the training set, in the LSTM model training process, the optimizer is used for searching the optimal solution of the model, the optimizer adopts Adaptive motion Estimation, called Adam optimizer for short, the Adam optimizer is one of self-Adaptive learning rate optimizers, the learning rate can be automatically modified along with the training process, and the method has the advantages of high convergence rate, easiness in optimization adjustment and the like, and the algorithm strategy of the Adam optimizer is as follows:
in the formula, mtAnd vtFirst and second order momentum terms, beta, respectively, for the t-th iteration of the model1And beta2Typically values of 0.9 and 0.999,andrespectively represents mtAnd vtCorrection value of (1), WtThe parameter representing the t iteration of the model, is 10-8;
And finally training to obtain the LSTM model of the oil well.
Step five, optimizing the layered water injection amount of each water injection well by adopting a PSO algorithm, wherein the specific method comprises the following steps:
training all production wells in the selected well group according to the first step, the second step, the third step and the fourth step, storing respective LSTM models, and integrally optimizing the water injection rate of each water injection interval by adopting a particle swarm algorithm with the well group oil increasing and water controlling as a target on the basis of the LSTM models of all the production wells trained in the well group, wherein the oil yield of the oil well is equal to the product of the oil well liquid yield multiplied by the water content, and the oil yield of the oil well is equal to the product of the oil well liquid yield minus the oil well liquid yield;
the particle swarm optimization algorithm is an optimization algorithm proposed according to the foraging behavior of birds, and is called PSO algorithm for short, a group of particles are initialized randomly in a search space, the position of each particle is a solution, the solution is substituted into a target function to obtain a fitness value, the quality of the particles is judged according to the fitness value, and the moving direction and the step length of the particles are determined by the speed of the particles; in each iteration, the particles can continuously update the positions and the speeds of the particles according to the information of the particles and the information of the whole particle swarm, and the iteration is stopped when a termination condition is reached; the iterative formula of the PSO algorithm is as follows:
in the formula, Vi(t +1) is the velocity of the t +1 th iteration of the particle; xi(t) is the position of the t-th iteration of the particle; vi(t) is the speed of the t-th iteration of the particle; t is the number of iterations; pi(t) is the individual best solution; pg(t) is a global optimal solution; c1And C2Is constant and respectively represents a social cognitive learning factor and a self cognitive learning factor; r is1And r2Is a random number in the interval (0, 1); omega is an inertia factor;
parameters needing to be adjusted by the particle swarm optimization algorithm comprise the size of a population, the iteration times, an inertia factor omega and a social cognitive learning factor C1And self-cognitive learning factor C2These parameters need to be adjusted according to the optimization effect; the population size is adjusted according to the complexity of the problem, and can be 100, 300 and 500, or any value between 0 and 1000; the iteration times are adjusted according to whether the optimization result reaches an optimal value, and the value range is usually 10 to 1000; the inertia factor ω can be 0.5, 0.8, 1.0, or any value between 0.5 and 1.0; the social cognitive learning factor C1And self-cognitive learning factor C2Typically a value of 2.
The particle swarm optimization algorithm randomly initializes a group of particles in a layered water injection rate constraint condition space of each water injection layer, the position of each particle is a layered water injection rate, and the particles are substituted into LSTM models of all production wells trained in a well group to predict the liquid production rate and the water content of each production well; judging the quality of the layered water injection quantity according to the predicted liquid production quantity and the water content of each production well, wherein the movement direction and the step length of the optimized layered water injection quantity are determined by the change speed of the layered water injection quantity; in each iteration, the position and the change speed of the layer water injection quantity can be continuously updated according to the information of the layer water injection quantity and the information of all the layer water injection quantities, the iteration is stopped when the total liquid production quantity and the water content of the well group are not changed any more, the layer water injection quantity of each water injection layer section with the optimal well group is obtained, and otherwise, the layer water injection quantity is continuously adjusted to carry out iterative calculation.
According to the optimization of the invention, the restriction conditions of the separate layer water injection quantity of each water injection layer section of the separate layer water injection optimization are as follows: the current water injection quantity of the water injection layer section fluctuates up and down by a certain proportion. The certain proportion can be any value between 0 and 100 percent of the current water injection quantity of the water injection interval.
The invention has the beneficial effects that:
(1) aiming at the layered water injection oil field, three visual production parameters of the layered water injection amount, the oil well liquid production amount and the water content are utilized to realize intelligent learning and prediction, the required parameters are few, and the field operation is simple.
(2) And mapping the data from a high-dimensional space to a low-dimensional space by using an average impurity degree reduction method, revealing main water injection layer sections influencing oil well production, and accurately capturing the injection-production change trend by combining a long-term and short-term memory neural network.
(3) The particle swarm optimization algorithm based on the long-short term memory neural network model can quickly realize the optimization of the stratified water injection, and has short calculation time, high efficiency and reliable result.
Drawings
FIG. 1 is a flow chart of a layered water injection optimization method based on a long-short term memory neural network and a particle swarm optimization algorithm;
FIG. 2 is a block diagram of a long-short term memory neural network;
FIG. 3 is a histogram of the characteristic importance of the A16 well MDI, with the ordinate representing the water injection interval codes, to which each water injection interval is given a name;
FIG. 4 is the results of the fluid production training of the A16 well training set;
FIG. 5 is the training results of the water cut of the A16 well training set;
FIG. 6 is a graph of the training set and test set loss functions for the A16 well as a function of training times;
FIG. 7 is a prediction of fluid production from the A16 well test set;
FIG. 8 is a water cut prediction from A16 well test set;
figure 9 is the change in oil production for the experimental well group as a function of iteration number.
The specific implementation mode is as follows:
the present invention will be described in detail below with reference to examples and drawings, but is not limited thereto.
Examples of the following,
A stratified water injection optimization method based on a long-short term memory neural network and a particle swarm optimization algorithm comprises the following steps:
as shown in FIGS. 1 and 2, in FIG. 2, xtIs in an input state; h ist-1A short-term hidden state; c. Ct-1Is in a long-term hidden state; y istIs in an output state; c. CtUpdating the long-term hidden state at the moment t; h istUpdating the short-term hidden state at the moment t; f. oft、it、otThe parameters of a forgetting gate, an input gate and an output gate are respectively controlled according to the activation function sigma; gtIs determined by a nonlinear activation function f, and itControlling parameters of the input gate together; f is a nonlinear activation function; sigma is an activation function; FC is a full connection layer;
step one, determining a data set and dividing the data set into a training set and a testing set, wherein the specific method comprises the following steps:
s1.1: determining a data set
Determining a production well group, and selecting liquid production amount and water content data of an oil well in the well group in a certain time period and layered water injection amount data of a water injection well in a corresponding time period as a data set;
if the missing data exists in the data set at a certain time point or within a certain time period, filling the missing data with the average value of the data near the missing data;
s1.2: partitioning a data set into a training set and a test set
Dividing a data set into a training set and a test set according to a preset proportion; in this embodiment, the predetermined ratio is 8: 2;
in the first step, 1 well group is selected as a research object for optimizing the stratified waterflood. The well group is put into production in 11 and 30 months in 2015, production is carried out in a co-injection mode at first, separate injection measures are taken in 2019, 9 and 25 months, the well group currently comprises 12 ports of a production well and 7 ports of a water injection well, the separate injection amount of each separate layer of the water injection well is selected as a characteristic parameter, the separate injection amount, the daily liquid production amount of an oil well and the water content data of the oil well from the start of separate injection to 20 days in 2 and 20 months in 2021 are collected and sorted as a training set, and the separate injection amount, the daily liquid production amount of the oil well and the water content data of the oil well from 21 days in 2 and 21 days in 2021 to 30 days in 6 and 30 months in 2021 are collected as a testing set;
step two, analyzing the important degree of contribution of each water injection interval to the oil well liquid production rate by an MDI method (the MDI method is based on an average impurity degree reduction method), and screening out the main water injection intervals influencing the oil well liquid production rate, wherein the specific method comprises the following steps:
s2.1: analyzing the importance degree of contribution of each water injection interval to oil well liquid production capacity based on MDI method
A random forest classifier module is led into a sklern library, water injection quantity of each layer is used as a characteristic value, and liquid production quantity is used as an observed value to train an RF model (the RF model refers to a random forest model); in the generation process of the RF model, adding hierarchical water injection characteristic nodes to the RF model in sequence, obtaining the MDI value of an observed value when a certain layer of water injection characteristic is selected and added, adding the rest hierarchical water injection characteristics in sequence, stopping the growth of the decision tree until all the characteristics are traversed, and obtaining the MDI values of the rest characteristic parameters at the same time;
s2.2: screening out main water injection layer section influencing oil well liquid production
Sequencing the layered water injection quantity characteristics according to the MDI value, reserving the layered water injection quantity characteristics with the MDI value ranked at the top, and determining the main water injection layer section influencing the oil well liquid production quantity; preferably, the stratified water injection quantity characteristic of 85 percent of the MDI value ranking is reserved;
in the second step, taking the production well a16 as an example, MDI values of each water injection well interval are calculated, MDI values of each interval are sorted from large to small, and the characteristics with the accumulated value of 15% sorted later are removed, as shown in fig. 3, the characteristic with the largest influence on the liquid production amount and the water content of the production well a16 is an interval of a01E2s3MIu + Id, the characteristic with the smallest influence is an interval of a03E2s3UI4-5, 4 characteristics in total are removed, i.e. a03E2s3UI4-5, a12E2s3MIu1, a03E2s3UII and a12E2s3MIu2-4, and the first 25 characteristics are reserved as input variables of LSTM.
Step three, after screening out the main water injection interval which influences the liquid production capacity of the oil well, carrying out normalization treatment on the water injection capacity of each water injection interval, wherein the specific method comprises the following steps:
and mapping the input characteristic data of each water injection layer section to an interval [0,1] by adopting a maximum and minimum normalization method, wherein the formula is as follows:
wherein x represents the data of the water injection amount of a certain layer, xminRepresents the minimum value, x, of the water injection in the zonemaxThe maximum value of the water injection amount of the layer is shown;
in the third step, the input characteristics of each water injection interval of the A16 well are subjected to maximum and minimum normalization treatment.
Step four, building, training and verifying an LSTM model, taking the layered water injection amount as input, and taking the oil well liquid production amount and the water content as output, and training to obtain the LSTM model of the oil well, wherein the specific method comprises the following steps:
s4.1: construction of LSTM model
Leading in an open-source artificial neural network algorithm tool module from a sklern library to build a long-short term memory neural network:
at time t, the LSTM unit processes the input state xtShort term hidden state ht-1And long-term hidden state ct-1Generating an output state yt;
Long term hidden state ct-1The relevant information of the time step before the t moment is contained;
short term hidden state ht-1Containing information of the last time step;
within the LSTM cell, state x is inputtAnd short-term hidden state ht-1Is processed by the full connection layer FC, wherein gt、ft、it、otRespectively as follows:
wherein f is a nonlinear activation function, generally tan h or ReLU, equations (6) to (7); σ is an activation function, usually Sigmoid, equation (8); f. oft、it、otThe activation function sigma determines to respectively control a forgetting gate, an input gate and an output gate, and the value range is 0 to 1; gtIs determined by a nonlinear activation function f, and itControlling parameters of the input gate together, wherein the value range is 0 to 1; wxg、Wxf、Wxi、WxoTo process input xtWeight matrix of Whg、Whf、Whi、WhoTo handle short-term hidden states ht-1Weight matrix of bg、bf、bi、boIs a bias term; the weight matrix and the bias term are the weighting coefficient of each element in the state matrix and are automatically adjusted by a program in the self-learning process of the neural network;
at forgetting gate, LSTM unit determines t time ct-1Forgotten part by performing ftAnd ct-1And array element multiplication between them, specifically: c. Ct-1Elements in the table are multiplied by 0, so that all the elements are forgotten, and multiplied by 1, so that all the elements are reserved; at the input gate, the LSTM unit passes execution gtAnd itMultiplying array elements in between to determine g in long-term hidden statetA saved portion; information to be forgotten in the processing of the doorAnd processing information of input gateCombined to update the long-term hidden state (c) at time tt):
output gate handles long-term hidden state of updates ctAnd the output vector otGenerating an updated short-term hidden state ht:
The LSTM model parameters comprise training times, time step length, batch size, the number of hidden layers and the number of neurons contained in the hidden layers, the proportion of the neurons which are randomly ignored by the Dropout layer, the conversion dimension of output vectors of the fully connected Dense layer, the selection of f function and the selection of sigma function, the parameters are determined according to a grid search method, the grid search method is to arrange and combine the possible values of each parameter, list all possible combination results to generate a grid, then use each combination for LSTM model training, evaluate the results according to the following model evaluation indexes and return the best parameter combination;
evaluating the LSTM model training by using mean square error MSE (mean Squared error):
wherein, N is the number of data, x' is the predicted data after LSTM model learning, x is the real data, the smaller the mean square error is, the better the model training is;
s4.2: training of LSTM models
The artificial neural network built in the step S4.1 is adopted to train the training set, in the LSTM model training process, the optimizer is used for searching the optimal solution of the model, the optimizer adopts Adaptive motion Estimation, called Adam optimizer for short, the Adam optimizer is one of self-Adaptive learning rate optimizers, the learning rate can be automatically modified along with the training process, and the method has the advantages of high convergence rate, easiness in optimization adjustment and the like, and the algorithm strategy of the Adam optimizer is as follows:
in the formula, mtAnd vtFirst and second order momentum terms, beta, respectively, for the t-th iteration of the model1And beta2Typically values of 0.9 and 0.999,andrespectively represents mtAnd vtCorrection value of (1), WtThe parameter representing the t iteration of the model, is 10-8;
And finally training to obtain the LSTM model of the oil well.
In the fourth step, an LSTM model is built, and all parameters used for training the LSTM model of the A16 well are as follows: the training frequency is 480, the time step is 5, the batch size is 128, the number of hidden layers is 2, the number of neurons in the first layer is 128, the number of neurons in the second layer is 128, the proportion of the neurons which are randomly ignored by the Dropout layer is 0.2, the output vector conversion dimension of the fully connected Dense layer is 2, the f function selects the ReLU function, the sigma function selects the Sigmoid function, the mean square error is slowly reduced and tends to be stable after the LSTM model is trained for 200 times by using 515 groups of data in the training set, and the training result is shown in FIGS. 4-8.
Step five, optimizing the layered water injection amount of each water injection well by adopting a PSO algorithm, wherein the specific method comprises the following steps:
training all production wells in the selected well group according to the first step, the second step, the third step and the fourth step, storing respective LSTM models, and integrally optimizing the water injection rate of each water injection interval by adopting a particle swarm algorithm with the well group oil increasing and water controlling as a target on the basis of the LSTM models of all the production wells trained in the well group, wherein the oil yield of the oil well is equal to the product of the oil well liquid yield multiplied by the water content, and the oil yield of the oil well is equal to the product of the oil well liquid yield minus the oil well liquid yield;
the particle swarm optimization algorithm is an optimization algorithm proposed according to the foraging behavior of birds, and is called PSO algorithm for short, a group of particles are initialized randomly in a search space, the position of each particle is a solution, the solution is substituted into a target function to obtain a fitness value, the quality of the particles is judged according to the fitness value, and the moving direction and the step length of the particles are determined by the speed of the particles; in each iteration, the particles can continuously update the positions and the speeds of the particles according to the information of the particles and the information of the whole particle swarm, and the iteration is stopped when a termination condition is reached; the iterative formula of the PSO algorithm is as follows:
in the formula, Vi(t +1) is the velocity of the t +1 th iteration of the particle; xi(t) is the position of the t-th iteration of the particle; vi(t) is the speed of the t-th iteration of the particle; t is the number of iterations; pi(t) is the individual best solution; pg(t) is a global optimal solution; c1And C2Is constant and respectively represents a social cognitive learning factor and a self cognitive learning factor; r is1And r2Is a random number in the interval (0, 1); omega is an inertia factor;
parameters needing to be adjusted by the particle swarm optimization algorithm comprise the size of a population, the iteration times, an inertia factor omega and a social cognitive learning factor C1And self-cognitive learning factor C2These parameters need to be adjusted according to the optimization effect; the population size is adjusted according to the complexity of the problem, and can be 100, 300 and 500, or any value between 0 and 1000; the iteration times are adjusted according to whether the optimization result reaches an optimal value, and the value range is usually 10 to 1000; the inertia factor ω can be 0.5, 0.8, 1.0, or any value between 0.5 and 1.0; the social cognitive learning factor C1And self-cognitive learning factor C2Typically a value of 2.
The particle swarm optimization algorithm randomly initializes a group of particles in a layered water injection rate constraint condition space of each water injection layer, the position of each particle is a layered water injection rate, and the particles are substituted into LSTM models of all production wells trained in a well group to predict the liquid production rate and the water content of each production well; judging the quality of the layered water injection quantity according to the predicted liquid production quantity and the water content of each production well, wherein the movement direction and the step length of the optimized layered water injection quantity are determined by the change speed of the layered water injection quantity; in each iteration, the position and the change speed of the layer water injection quantity can be continuously updated according to the information of the layer water injection quantity and the information of all the layer water injection quantities, the iteration is stopped when the total liquid production quantity and the water content of the well group are not changed any more, the layer water injection quantity of each water injection layer section with the optimal well group is obtained, and otherwise, the layer water injection quantity is continuously adjusted to carry out iterative calculation.
The zonal water injection quantity constraint conditions of each water injection layer section of the zonal water injection optimization are as follows: the current water injection quantity of the water injection layer section fluctuates up and down by a certain proportion. The certain proportion can be any value between 0 and 100 percent of the current water injection quantity of the water injection interval.
At this stepIn the fifth step, the LSTM models of the remaining production wells in the well group are trained and stored according to the first step to the fourth step, the trained models of all the production wells in the well group are read, the stratified water injection amount is optimized by adopting a PSO algorithm, and the PSO parameters of the well group in the optimization implementation scheme are set as follows: the population size is 500, the iteration times are 30, the inertia factor omega is 0.8, and the social cognitive learning factor C1Is 2, a self-cognition learning factor C2Is 2; the constraint condition of the zonal injection optimization is +/-30% of the current zonal injection amount, and the zonal injection amount optimization result is shown in figure 9, and tables 1 and 2:
TABLE 1 comparison of water injection rates before and after optimization of water injection intervals for well groups according to embodiments of the present invention
TABLE 2 comparison of production parameters before and after optimization for each production well of a well group according to an embodiment
From table 1, it can be seen that the water injection amount of each water injection interval after optimization has a certain increase and decrease compared with that before optimization, and the total water injection amount is reduced by 31.9m compared with that before optimization3D; from the table 2, it can be seen that the total oil production volume after the optimization of the well group in the embodiment is reduced by 18.4t/d, the total oil production volume is increased by 55t/d (increased by 12.2% compared with that before the optimization), the average water content is reduced by 4.3%, a good oil increasing and water controlling effect is achieved, and guidance is provided for the optimization of oilfield zonal water injection.
Claims (6)
1. A stratified water injection optimization method based on a long-short term memory neural network and a particle swarm optimization algorithm is characterized by comprising the following steps:
step one, determining a data set and dividing the data set into a training set and a test set;
analyzing the important degree of contribution of each water injection layer section to the oil well liquid production rate by using an MDI method, and screening out main water injection layer sections influencing the oil well liquid production rate;
step three, after screening out the main water injection layer sections which influence the liquid production capacity of the oil well, performing normalization treatment on the water injection capacity of each water injection layer section;
step four, building, training and verifying an LSTM model, and training to obtain the LSTM model of the oil well;
and fifthly, optimizing the layered water injection quantity of each water injection well by adopting a PSO algorithm.
2. The method for optimizing the water injection by layers based on the long-short term memory neural network and the particle swarm optimization algorithm as claimed in claim 1, wherein the step one comprises determining a data set and dividing the data set into a training set and a test set, and the specific method comprises the following steps:
s1.1: determining a data set
Determining a production well group, and selecting liquid production amount and water content data of an oil well in the well group in a certain time period and layered water injection amount data of a water injection well in a corresponding time period as a data set;
if the missing data exists in the data set at a certain time point or within a certain time period, filling the missing data with the average value of the data near the missing data;
s1.2: partitioning a data set into a training set and a test set
Dividing a data set into a training set and a test set according to a preset proportion; preferably, the preset ratio is 8: 2.
3. The zonal water injection optimization method based on the long-short term memory neural network and the particle swarm optimization algorithm as claimed in claim 2, wherein in the second step, the MDI method analyzes the importance degree of contribution of each water injection interval to the oil well liquid production rate, and screens out the main water injection intervals affecting the oil well liquid production rate, and the specific method is as follows:
s2.1: analyzing the importance degree of contribution of each water injection interval to oil well liquid production capacity based on MDI method
Leading in a random forest classifier module from a sklern library, and training an RF model by taking the water injection amount of each layer as a characteristic value and taking the liquid production amount as an observed value; in the generation process of the RF model, adding hierarchical water injection characteristic nodes to the RF model in sequence, obtaining the MDI value of an observed value when a certain layer of water injection characteristic is selected and added, adding the rest hierarchical water injection characteristics in sequence, stopping the growth of the decision tree until all the characteristics are traversed, and obtaining the MDI values of the rest characteristic parameters at the same time;
s2.2: screening out main water injection layer section influencing oil well liquid production
And sequencing the layered water injection quantity characteristics according to the MDI value, reserving the layered water injection quantity characteristic with the MDI value ranked at the top, and determining the main water injection layer section influencing the oil well liquid production quantity.
4. The zonal water injection optimization method based on the long-short term memory neural network and the particle swarm optimization algorithm as claimed in claim 3, wherein after the main water injection intervals affecting the oil well fluid production are screened out, the water injection rate of each water injection interval is normalized, and the specific method is as follows:
and mapping the input characteristic data of each water injection layer section to an interval [0,1] by adopting a maximum and minimum normalization method, wherein the formula is as follows:
wherein x represents the data of the water injection amount of a certain layer, xminRepresents the minimum value, x, of the water injection in the zonemaxThe maximum value of the water injection amount in the layer is shown.
5. The method for optimizing the water injection by layers based on the long-short term memory neural network and the particle swarm optimization algorithm according to claim 4, wherein the fourth step is to train and verify the LSTM model, and train and obtain the LSTM model of the oil well by taking the water injection by layers as input and the liquid production and water content of the oil well as output, and the specific method is as follows:
s4.1: construction of LSTM model
Leading in an open-source artificial neural network algorithm tool module from a sklern library to build a long-short term memory neural network:
at time t, the LSTM unit processes the input state xtShort term hidden state ht-1And long-term hidden state ct-1Generating an output state yt;
Long term hidden state ct-1The relevant information of the time step before the t moment is contained;
short term hidden state ht-1Containing information of the last time step;
within the LSTM cell, state x is inputtAnd short-term hidden state ht-1Is processed by the full connection layer FC, wherein gt、ft、it、otRespectively as follows:
wherein f is a nonlinear activation function; sigma is an activation function; f. oft、it、otBy activation letterDetermining the number sigma, and respectively controlling a forgetting gate, an input gate and an output gate to obtain a value range from 0 to 1; gtIs determined by a nonlinear activation function f, and itControlling parameters of the input gate together, wherein the value range is 0 to 1; wxg、Wxf、Wxi、WxoTo process input xtWeight matrix of Whg、Whf、Whi、WhoTo handle short-term hidden states ht-1Weight matrix of bg、bf、bi、boIs a bias term;
at forgetting gate, LSTM unit determines t time ct-1Forgotten part: c. Ct-1Elements in the table are multiplied by 0, so that all the elements are forgotten, and multiplied by 1, so that all the elements are reserved; at the input gate, the LSTM unit passes execution gtAnd itMultiplying array elements in between to determine g in long-term hidden statetA saved portion; information to be forgotten in the processing of the doorAnd processing information of input gateCombined to update the long-term hidden state (c) at time tt):
output gate handles long-term hidden state of updates ctAnd the output vector otGenerating an updated short-term hidden state ht:
Evaluating the LSTM model training by using mean square error MSE (mean Squared error):
wherein N is the number of data, x' is the predicted data after LSTM model learning, and x is the real data;
s4.2: training of LSTM models
Training the training set by adopting the artificial neural network built in the step S4.1, wherein in the LSTM model training process, an optimizer is used for searching the optimal solution of the model, and the optimizer adopts Adaptive motion Estimation, which is called Adam optimizer for short; the algorithm strategy of the Adam optimizer is as follows:
in the formula, mtAnd vtFirst and second order momentum terms, beta, respectively, for the t-th iteration of the model1And beta2Typically values of 0.9 and 0.999,andrespectively represents mtAnd vtCorrection value of (1), WtThe parameter representing the t iteration of the model, is 10-8;
And finally training to obtain the LSTM model of the oil well.
6. The zonal water injection optimization method based on the long-short term memory neural network and the particle swarm optimization algorithm as claimed in claim 5, wherein the PSO algorithm is adopted to optimize the zonal water injection amount of each water injection well, and the specific method is as follows:
integrally optimizing the water injection rate of each water injection interval by adopting a particle swarm optimization with the aim of oil increasing and water controlling of a well group as a target, wherein the water yield of an oil well is equal to the product of the liquid yield of the oil well multiplied by the water content, and the oil yield of the oil well is equal to the product of the liquid yield of the oil well minus the water yield of the oil well;
the iterative formula of the PSO algorithm is as follows:
in the formula, Vi(t +1) is the velocity of the t +1 th iteration of the particle; xi(t) is the position of the t-th iteration of the particle; vi(t) is the speed of the t-th iteration of the particle; t is the number of iterations; pi(t) is the individual best solution; pg(t) is a global optimal solution; c1And C2Is constant and respectively represents a social cognitive learning factor and a self cognitive learning factor; r is1And r2Is a random number in the interval (0, 1); omega is an inertia factor;
the zonal water injection quantity constraint conditions of each water injection layer section of the zonal water injection optimization are as follows: the current water injection quantity of the water injection layer section fluctuates up and down by a certain proportion.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111338932.3A CN114357852A (en) | 2021-11-12 | 2021-11-12 | Layered water injection optimization method based on long-short term memory neural network and particle swarm optimization algorithm |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111338932.3A CN114357852A (en) | 2021-11-12 | 2021-11-12 | Layered water injection optimization method based on long-short term memory neural network and particle swarm optimization algorithm |
Publications (1)
Publication Number | Publication Date |
---|---|
CN114357852A true CN114357852A (en) | 2022-04-15 |
Family
ID=81096210
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202111338932.3A Pending CN114357852A (en) | 2021-11-12 | 2021-11-12 | Layered water injection optimization method based on long-short term memory neural network and particle swarm optimization algorithm |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114357852A (en) |
Cited By (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115099539A (en) * | 2022-08-25 | 2022-09-23 | 大庆正方软件科技股份有限公司 | Big data artificial intelligence water injection method based on water absorption profile |
CN115372569A (en) * | 2022-08-19 | 2022-11-22 | 北京工商大学 | Red wine quality evaluation method and system based on long-term and short-term memory neural network |
CN116307706A (en) * | 2023-03-08 | 2023-06-23 | 东北石油大学 | Timing sequence model-based gas storage operation geological risk early warning and gas injection and production scheme optimization method |
CN116401931A (en) * | 2023-06-08 | 2023-07-07 | 吉林大学 | Circulation well structure and operation parameter optimization method, system and equipment |
CN116401749A (en) * | 2023-06-09 | 2023-07-07 | 吉林大学 | Method, system, electronic equipment and storage medium for determining circulation well parameters |
CN116562174A (en) * | 2023-07-07 | 2023-08-08 | 中国石油天然气股份有限公司 | Method and device for determining water distribution and injection quantity |
WO2024046086A1 (en) * | 2022-08-31 | 2024-03-07 | 中国石油天然气股份有限公司 | Automatic history matching method and apparatus based on ru-net and lstm neural network models |
-
2021
- 2021-11-12 CN CN202111338932.3A patent/CN114357852A/en active Pending
Cited By (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115372569A (en) * | 2022-08-19 | 2022-11-22 | 北京工商大学 | Red wine quality evaluation method and system based on long-term and short-term memory neural network |
CN115099539A (en) * | 2022-08-25 | 2022-09-23 | 大庆正方软件科技股份有限公司 | Big data artificial intelligence water injection method based on water absorption profile |
WO2024046086A1 (en) * | 2022-08-31 | 2024-03-07 | 中国石油天然气股份有限公司 | Automatic history matching method and apparatus based on ru-net and lstm neural network models |
CN116307706A (en) * | 2023-03-08 | 2023-06-23 | 东北石油大学 | Timing sequence model-based gas storage operation geological risk early warning and gas injection and production scheme optimization method |
CN116307706B (en) * | 2023-03-08 | 2023-11-03 | 东北石油大学 | Timing sequence model-based gas storage operation geological risk early warning and gas injection and production scheme optimization method |
CN116401931A (en) * | 2023-06-08 | 2023-07-07 | 吉林大学 | Circulation well structure and operation parameter optimization method, system and equipment |
CN116401931B (en) * | 2023-06-08 | 2023-08-18 | 吉林大学 | Circulation well structure and operation parameter optimization method, system and equipment |
CN116401749A (en) * | 2023-06-09 | 2023-07-07 | 吉林大学 | Method, system, electronic equipment and storage medium for determining circulation well parameters |
CN116401749B (en) * | 2023-06-09 | 2023-09-01 | 吉林大学 | Method, system, electronic equipment and storage medium for determining circulation well parameters |
CN116562174A (en) * | 2023-07-07 | 2023-08-08 | 中国石油天然气股份有限公司 | Method and device for determining water distribution and injection quantity |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN114357852A (en) | Layered water injection optimization method based on long-short term memory neural network and particle swarm optimization algorithm | |
CN101383023B (en) | Neural network short-term electric load prediction based on sample dynamic organization and temperature compensation | |
CN102622418B (en) | Prediction device and equipment based on BP (Back Propagation) nerve network | |
CN103605909B (en) | It is a kind of based on gray theory and the water quality prediction method of support vector machine | |
EP1082698A1 (en) | An improved method and system for training an artificial neural network | |
CN108846526A (en) | A kind of CO2 emissions prediction technique | |
CN109472397B (en) | Polymerization process parameter adjusting method based on viscosity change | |
CN110674965A (en) | Multi-time step wind power prediction method based on dynamic feature selection | |
CN113128124B (en) | Multi-grade C-Mn steel mechanical property prediction method based on improved neural network | |
Alcalá et al. | Techniques for learning and tuning fuzzy rule-based systems for linguistic modeling and their application | |
CN113486593B (en) | Wind-storage-hydrogen hybrid energy storage control method based on wind power climbing prediction | |
CN110259592A (en) | A kind of PID diesel engine self-adapting electronic speed regulating method | |
CN115618987A (en) | Production well production data prediction method, device, equipment and storage medium | |
CN114362175A (en) | Wind power prediction method and system based on depth certainty strategy gradient algorithm | |
CN107392315B (en) | Breast cancer data classification method for optimizing brain emotion learning model | |
CN115438842A (en) | Load prediction method based on adaptive improved dayflies and BP neural network | |
CN115755219A (en) | Flood forecast error real-time correction method and system based on STGCN | |
Lalaoui et al. | Simulated annealing with adaptive neighborhood using fuzzy logic controller | |
CN117574776A (en) | Task planning-oriented model self-learning optimization method | |
CN116976192A (en) | JS-BP model-based die forging defect accurate repair process parameter decision method | |
CN115309045B (en) | Prediction control method and system for multi-working-condition learning of industrial system | |
CN114266186B (en) | Air conditioner energy consumption data missing value filling method, equipment and medium | |
CN110705756A (en) | Electric power energy consumption optimization control method based on input convex neural network | |
CN113807005B (en) | Bearing residual life prediction method based on improved FPA-DBN | |
Mishra et al. | Multi-objective genetic algorithm: A comprehensive survey |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |