CN112765880B - Method for monitoring stratum saturated brine invasion amount based on Bi-LSTM - Google Patents

Method for monitoring stratum saturated brine invasion amount based on Bi-LSTM Download PDF

Info

Publication number
CN112765880B
CN112765880B CN202110043087.0A CN202110043087A CN112765880B CN 112765880 B CN112765880 B CN 112765880B CN 202110043087 A CN202110043087 A CN 202110043087A CN 112765880 B CN112765880 B CN 112765880B
Authority
CN
China
Prior art keywords
lstm
model
saturated brine
data
amount
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.)
Active
Application number
CN202110043087.0A
Other languages
Chinese (zh)
Other versions
CN112765880A (en
Inventor
梁海波
杨海
刘杰
李忠兵
张禾
于学会
邹佳玲
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Southwest Petroleum University
Original Assignee
Southwest Petroleum University
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Southwest Petroleum University filed Critical Southwest Petroleum University
Priority to CN202110043087.0A priority Critical patent/CN112765880B/en
Publication of CN112765880A publication Critical patent/CN112765880A/en
Application granted granted Critical
Publication of CN112765880B publication Critical patent/CN112765880B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F30/00Computer-aided design [CAD]
    • G06F30/20Design optimisation, verification or simulation
    • G06F30/27Design optimisation, verification or simulation using machine learning, e.g. artificial intelligence, neural networks, support vector machines [SVM] or training a model
    • EFIXED CONSTRUCTIONS
    • E21EARTH OR ROCK DRILLING; MINING
    • E21BEARTH OR ROCK DRILLING; OBTAINING OIL, GAS, WATER, SOLUBLE OR MELTABLE MATERIALS OR A SLURRY OF MINERALS FROM WELLS
    • E21B47/00Survey of boreholes or wells
    • E21B47/10Locating fluid leaks, intrusions or movements
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/049Temporal neural networks, e.g. delay elements, oscillating neurons or pulsed inputs
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • G06N3/084Backpropagation, e.g. using gradient descent
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2111/00Details relating to CAD techniques
    • G06F2111/06Multi-objective optimisation, e.g. Pareto optimisation using simulated annealing [SA], ant colony algorithms or genetic algorithms [GA]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2113/00Details relating to the application field
    • G06F2113/08Fluids

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Evolutionary Computation (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Software Systems (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Biophysics (AREA)
  • Mathematical Physics (AREA)
  • Biomedical Technology (AREA)
  • Health & Medical Sciences (AREA)
  • Mining & Mineral Resources (AREA)
  • Geology (AREA)
  • Fluid Mechanics (AREA)
  • Environmental & Geological Engineering (AREA)
  • Geophysics (AREA)
  • General Life Sciences & Earth Sciences (AREA)
  • Geochemistry & Mineralogy (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Medical Informatics (AREA)
  • Computer Hardware Design (AREA)
  • Geometry (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The invention provides a method for monitoring stratum saturated brine invasion amount based on Bi-LSTM, which comprises the steps of determining real-time chloride ion concentration curves of an inlet and an outlet; determining real-time flow curves at an inlet and an outlet; determining the concentration of chloride ions in the saturated brine of the stratum; calculating the total invasion amount of the formation saturated brine; dividing a data training set and a testing set, setting parameters of a Bi-LSTM prediction model, training the model, and performing back propagation of the model and reverse normalization of a predicted value of stratum saturated brine invasion. The invention fully utilizes the long-term memory of the LSTM network to the flow data, and adopts the Bi-LSTM to fully solve the defect that the LSTM only considers the characteristics of the data from front to back when the time sequence data is predicted. Meanwhile, supervised learning can effectively find out the relation among variables, and the prediction precision of the saturated salt water of the stratum is improved.

Description

Method for monitoring stratum saturated brine invasion amount based on Bi-LSTM
Technical Field
The invention belongs to the field of measurement for monitoring stratum saturated brine invasion, and particularly relates to a method for monitoring stratum saturated brine invasion based on Bi-LSTM.
Background
During drilling, sometimes a cavern formation is encountered, and a large amount of saturated brine exists in the cavern, and the content of chloride ions in the saturated brine is high. When the stratum is drilled through, the solution in the stratum is mixed with the drilling fluid, the density of the drilling fluid is far greater than that of the liquid in the stratum, so that the density of the mixed liquid is smaller than that of the drilling fluid, if the saturated saline invasion amount of the stratum is large, the effective liquid column pressure in the well is unbalanced with the stratum pressure, stratum fluid overflows when entering a shaft, if the control is not timely or improper, blowout can occur, and therefore the saturated saline invasion amount of the stratum needs to be measured.
Because the area of the mud pit is very large, even if the saturated saline water invasion amount of the stratum is very large, the liquid level of the mud pit fluctuates, the height change of the liquid level of the mud pit caused by the bottom saline water invasion amount is very small, the measurement accuracy is not high, and if the invasion amount reaches the liquid level measurement range, the invasion amount is quite large, and overflow or blowout is generated.
Therefore, it is necessary to design a method to monitor the invasion amount of the formation saturated brine in real time to achieve the early warning effect, so as to take corresponding measures.
Disclosure of Invention
The invention aims to solve the defects of the prior art, and provides a method for monitoring the invasion amount of saturated formation brine based on Bi-LSTM, which aims to monitor the invasion amount of the formation saturated brine in real time so as to prevent overflow or blowout.
The invention adopts the following technical scheme:
the invention discloses a method for monitoring stratum saturated brine invasion amount based on Bi-LSTM, which is provided for monitoring overflow and blowout in real time and comprises the following implementation steps:
measuring to obtain concentration curves of chloride ions at an inlet and an outlet;
measuring to obtain real-time flow curves of an inlet and an outlet;
calculating the amount of the chloride ion substances in the formation saturated brine;
calculating the invasion amount of the stratum saturated brine in the saturated brine;
selecting influence factors x ' 1, x ' 2, … and x'm influencing the result as evaluation indexes of the established model according to the predicted result, performing Pearson correlation coefficient analysis before screening the evaluation indexes of the predicted model, and then determining the final evaluation index to obtain a screened data set;
correcting original data sequences of independent variables and dependent variables in the data set, and preprocessing corrected data; dividing the data set into a training set test set, and normalizing the training set test set;
constructing a Bi-LSTM network model, determining a Bi-LSTM model structure for predicting the invasion amount of the formation saturated brine, and setting initial parameter values of the Bi-LSTM model; training the Bi-LSTM model by using a training set to obtain a trained Bi-LSTM model;
performing prediction performance evaluation on the trained Bi-LSTM model by using a test set, stopping training when an error meets an expectation or reaches the number of model training iterations, and determining model parameters; otherwise, continuing to train the model until the expectation is met;
and step nine, after the model training is finished, inputting the test set into the trained Bi-LSTM grid to obtain a test result, and performing inverse normalization on the result.
Further, in the first step and the second step, since the fluid at the outlet and the fluid at the inlet do not correspond to each other at the same time, the time when the injected drilling fluid reaches the mud outlet is determined, and the fluid at the inlet corresponding to the fluid at the outlet is found, so as to obtain the change of the corresponding chloride ion content and flow rate. Since the drilling fluid flow velocity v in the well is not changed greatly and is regarded as a constant flow velocity, the distance s that the drilling fluid flows from the inlet to the outlet can be known, and therefore the time delta t that the drilling fluid flows from the inlet to the outlet can be obtained.
Figure GDA0003501629230000021
In the third step, attention is paid to finding the inlet drilling fluid corresponding to the mud at the outlet in the calculation process, because the flow velocity V of the drilling fluid in the well is not changed greatly and is regarded as a constant flow velocity, the distance s that the drilling fluid flows from the inlet to the outlet can also be known, so the time Δ t that the drilling fluid flows from the inlet to the outlet can be obtained:
Figure GDA0003501629230000022
where s is the distance the drilling fluid flows from the inlet to the outlet and v is the flow rate of the drilling fluid.
Further, in the third and fourth steps, the chloride ion concentration curve and the flow rate curve obtained by real-time monitoring are divided into 5 second segments, and the total is divided into N segments (N is 1,2,3 … …), and the amount N of the material flowing into and out of each segment is calculated by integrating the total1、n2The amount of the substance increased in chloride ion Δ n per small piece was obtainedi
The invasion calculation process of the formation saturated brine in the first 5 seconds is as follows:
amount of the substance in which chloride ions flow in:
Figure GDA0003501629230000031
in the formula n1Amount of substance which is chloride ion influx, C1Is the concentration of chloride ions at the inlet, Q1Is the flow at the inlet, t1Is the initial time of the first segment, t2Is the termination time of the first segment.
The amount of the outflowing species of chloride ions was recalculated:
amount of the species of chloride ion eluted:
Figure GDA0003501629230000032
in the formula n2Amount of substance which is the chloride ion to be exported, C2Is the concentration of chloride ions, Q, at the outlet2Is the flow at the outlet, t5Is the initial time of the first segment, t6Is the termination time of the first segment.
The amount of species of chloride ion added in the first 5 seconds was then calculated:
amount of species of chloride ion increased in the first 5 seconds:
Figure GDA0003501629230000033
measuring the formation temperature at the saturated saline water position of the formation by using an optical fiber temperature measuring instrument to obtain the chloride ion concentration C in the saturated saline water at the temperature3And calculating the invasion amount of the formation saturated brine in the first 5 seconds:
Figure GDA0003501629230000034
and finally, accumulating the invasion amount of the stratum saturated brine of each small section to obtain the total invasion amount of the stratum saturated brine:
Figure GDA0003501629230000035
further, in the fifth step, influence factors are selected based on prediction of the invasion amount of the saturated brine of the formation and are divided into three types, namely chlorine ion concentration measurement influence factors, ultrasonic flow meter measurement influence factors and optical fiber thermometer measurement temperature influence factors, wherein the chlorine ion concentration measurement influence factors comprise measurement noise x1, ambient temperature x2, mud flow rate x3 and mud concentration x 4; the influence factors measured by the ultrasonic flowmeter comprise pipeline dirt x5, working pressure x 6; the optical fiber thermometer measures influence factors including strain x7 generated by gravity tension, analyzes the relation among the influence factors by utilizing Pearson correlation, and finally selects 5 factors with the maximum correlation as evaluation indexes.
Further, in the seventh step, each cell in the Bi-LSTM model contains three types of thresholds:
a forgetting gate (forget gate) for determining the information discarded from the cell, the forgetting gate selecting whether to forget the previous cell state with a certain probability, the input of the forgetting gate being the shadow state h at the time t-1t-1And input x at time ttOutput ftThe probability of forgetting the state of the cell at the previous moment;
an input gate (input gate) for determining from the inputs which values to use to update the memory state, the input gate selectively storing the input at time t into the cell state, the input at time t-1 being the hidden state ht-1And input x at time ttInput itDeciding what value to update, ctCreating a new vector of candidate values, ctThe cell state after renewal.
An output gate (output gate) for determining the output content according to the inputs and the memory of the cell, the output gate determining the value to be output at time t, OtOutput information of selectable cell states, htThe output of the output gate.
The structure of the LSTM prediction model is as follows:
yt=σ(Wyhht)
ht=ot*tanh(Ct)
Ct-1=tanh(Wc[ht-1,xt]+c)
Ct=ft*Ct-1+it*Ct-1
ft=σ(Wf[ht-1,xt]+bf)
it=σ(Wi[ht-1,xt]+bi)
ot=σ(Wo[ht-1,xt]+bo)
wherein t represents the current time in the model, and t-1 represents the last time in the model; x is the number oftIs the input vector, y, of the LSTM neuron at the current timetThe output vector of the output layer at the current moment, ht and ht-1 are respectively the output vectors of the hidden layer at the current moment and the hidden layer at the last moment; t is an activation vector of an input gate at the current moment, ft is an activation vector of a forgotten gate at the current moment, and ot is an activation vector of an output gate at the current moment; ct represents a neuron cell state vector at the current moment and is used for updating the cell state, and Ct-1 represents a cell state vector at the last moment; wf, Wi, Wo and Wc are weight matrixes of a forgetting gate, an input gate, an output gate and a cell state vector respectively; bf. bi, bo and bc are respectively bias terms of a forgetting gate, an input gate, an output gate and a cell state vector; wyh denotes the weight matrix between the output layer and the hidden layer, σ and tanh are the activation functions, sigmoid function and hyperbolic tangent function, respectively.
Setting initial parameter values of the Bi-LSTM model, comprising the following steps: the method comprises the steps of inputting layer dimensions, hidden layer dimensions, outputting layer dimensions, hidden layer node numbers, iterative training times, initial learning rate and training step length.
Further, a Bi-LSTM model is established, the LSTM can memorize the effective information appearing above, and the Bi-LSTM model formed by combining the forward LSTM with the backward LSTM can memorize the effective information appearing in the context at the same time.
Further, the seventh step of calculating vectors of the hidden layer and the output layer through forward and backward data information transfer processes, respectively storing the vectors in a data group, and realizing a process of gradient descent of the model through updating parameters; the weights of the input gate, the output gate and the forgetting gate are updated through the weight updating function respectively.
Further, in the step eight, the model prediction effect evaluation method is as follows:
according to the difference distance between the actual values of the prediction value ranges of the stratum saturated brine invasion amount, calculating the prediction effect evaluation index of the model; the root mean square error RMSE is taken as a loss function, and can measure the deviation between the actual values of the observation value range, and the formula is as follows:
Figure GDA0003501629230000051
x is an input variable, h is a prediction function, yi is a true value, m is the number of samples, the smaller the RMSE value is, the smaller the deviation between the predicted value and the true value is, and the better the prediction effect is.
Calculating the model parameters after gradient reduction to realize the back propagation of errors; and when the error reaches the lowest state or the iteration reaches the maximum iteration time state, determining the final parameters of the model, stopping the training of the model, and obtaining the prediction result of the stratum saturated brine invasion amount.
Further, in the step eight, the model back propagation uses an Adam optimization algorithm based on gradient descent, and the model parameters are adjusted by calculating the gradient of each weight according to the corresponding error term, so that the prediction result reaches the optimization target.
The invention has the beneficial effects that:
the invention fully utilizes the long-term memory and excellent nonlinear approximation capability of the LSTM network to the traffic data, and simultaneously fully utilizes the capability of the Bi-LSMT to simultaneously memorize the effective information appearing in the context, and the prediction precision is higher than that of the LSTM. And the data value of the stratum saturated brine invasion amount can be adjusted and output according to the input variable data, and the influence relationship of each input variable on the stratum saturated brine invasion amount is fully reflected. The method effectively improves the prediction precision of the stratum saturated brine invasion amount.
Drawings
FIG. 1 is a flow chart of an implementation of the present invention;
FIG. 2 is a schematic view of the inlet chloride ion concentration of the present invention;
FIG. 3 is a schematic diagram of the concentration of the exit chloride ions of the present invention;
FIG. 4 is a schematic inlet flow diagram of the present invention;
FIG. 5 is a schematic of the outlet flow of the present invention;
FIG. 6 is a block diagram of an LSTM;
FIG. 7 is a structural diagram of Bi-LSTM.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the technical solutions of the present invention are described below clearly and completely, and it is obvious that the described embodiments are some, not all embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The method mainly obtains the invasion amount of the saturated brine of the stratum by monitoring the concentrations of chloride ions in the inlet drilling fluid and the return mud in real time and through a certain calculation optimization process so as to monitor the overflow and blowout conditions of the oil well in real time. The method is based on key parameters such as chloride ion concentration, mud flow and formation temperature, and the numerical optimization of a Bi-LSTM (bidirectional long-and-short-term memory neural network) algorithm is used for monitoring the result of the saturated saline invasion amount of the formation in real time.
The method is suitable for different oil wells, and although the conditions in the oil wells are only different and the surrounding environment is different, the trained models and the prediction method are consistent.
The invention discloses a Bi-LSTM stratum saturated brine invasion amount-based calculation and prediction method, which is realized as shown in a flow chart 1:
the method comprises the following steps:
s101, measuring the chloride ion concentration in the injected drilling fluid and the chloride ion concentration C in the returned mud in real time by adopting an ion selective electrode method1,C2Obtaining a real-time chloride ion concentration curve;
the ion selective electrode method is selected because it can monitor the concentration of chloride ions in real time, and has high measurement accuracy and fast response.
Because the drilling fluid concentration in the mud pit is not necessarily uniformly mixed, the chloride ion concentration at the inlet is relatively stable but fluctuates a little, and the chloride ion concentration in the mud pit slightly rises along with the invasion of the saturated salt water of the stratum, as shown in a schematic diagram of the chloride ion concentration at the inlet of fig. 2; the mixing of the formation saturated brine with the drilling fluid causes the chloride ion concentration in the drilling fluid to rise, which is a slow process and the displacement is not completed very quickly, so the chloride ion concentration curve rises slightly slowly, and after the displacement is gradually completed, the chloride ion concentration in the mixed drilling fluid begins to fall, so that the outlet chloride ion concentration diagram shown in fig. 3 can be obtained.
S102: measuring the flow Q of the injected drilling fluid by an ultrasonic flowmeter1And the flow rate Q of the returned slurry2Obtaining a real-time flow curve;
since the flow rate of the injected drilling fluid is constant, the flow rate at the inlet is a straight line with a certain slope, as shown in fig. 4, and when the saturated brine in the formation is mixed with the drilling fluid, the flow rate is increased, so that the flow rate at the outlet is slightly increased, and therefore, a curve that the flow rate is increased, the flow rate is increased firstly, then is decreased, and finally is consistent with the original increase rate is presented, as shown in fig. 5.
S103: dividing a chloride ion concentration curve and a flow curve obtained by real-time monitoring into a small segment of 5 seconds, totally dividing the small segment into N segments (N is 1,2,3 and … …), and integrating to calculate the amount of inflow and outflow substances;
in the calculation process, attention is paid to finding inlet drilling fluid corresponding to mud at an outlet, and because the flow velocity V of the drilling fluid in the well is not changed greatly, the distance s that the drilling fluid flows from the inlet to the outlet can also be known, so that the time delta t for the drilling fluid to flow from the inlet to the outlet can be obtained;
Figure GDA0003501629230000071
where s is the distance the drilling fluid travels from the inlet to the outlet and v is the flow rate of the drilling fluid.
As indicated by t in fig. 35,t6,t7,t8The corresponding mud is t in FIG. 21,t2,t3,t4The difference between them, which is flowing in at a time, is Δ t.
S104, the invasion amount of the formation saturated brine in the first 5 seconds is calculated as follows:
amount of the substance in which chloride ions flow in:
Figure GDA0003501629230000072
in the formula n1Amount of substance which is chloride ion influx, C1As concentration of chloride ions at the inlet, Q1Is the flow at the inlet, t1Is the initial time of the first segment, t2Is the termination time of the first segment.
The amount of the outflowing species of chloride ions was recalculated:
Figure GDA0003501629230000081
in the formula, n2Amount of substance which is the chloride ion to be exported, C2Is the concentration of chloride ions, Q, at the outlet2Is the flow at the outlet, t5Is the initial time of the first segment, t6Is the termination time of the first segment.
The amount of species of chloride ion added in the first 5 seconds was calculated:
Figure GDA0003501629230000082
s105: measuring the formation temperature at the saturated saline water position of the formation by using an optical fiber temperature measuring instrument to obtain the chloride ion concentration C in the saturated saline water at the temperature3
S106: the invasion of the formation saturated brine in the first 5 seconds is calculated:
Figure GDA0003501629230000083
s107: and finally, accumulating the invasion amount of the stratum saturated brine of each small section to obtain the total invasion amount of the stratum saturated brine:
Figure GDA0003501629230000084
s108: according to the predicted result, influence factors x ' 1, x ' 2, … and x'm influencing the result are selected as evaluation indexes of the established model according to the predicted result, Pearson correlation coefficient analysis can be carried out before the evaluation indexes of the predicted model are screened, then the final evaluation indexes are determined, and the screened data set is obtained.
Correcting error data or data missing condition contained in original data sequence of independent variable x1, x2, …, xm and dependent variable Y in the data set, ensuring validity of model input data, and preprocessing the corrected data.
S109: and dividing the data set into a training set data set by taking the highest prediction precision as a target.
The method for dividing the training set of the test set comprises the following steps:
taking 200 groups of experimental data, taking the highest prediction precision as a target, dividing 15% -85% of a data set into a training set, and dividing the rest data into a testing set. The test set is mainly used for adjusting the Bi-LSTM model and evaluating the prediction accuracy, and the training set is mainly used for training the Bi-LSTM model.
S110: normalization is a dimensionless approach to make the absolute value of a physical system value become some relative value relationship. The Pearson correlation coefficient analysis is carried out on the strain 7 group data generated by measuring noise, ambient temperature, mud flow rate, mud concentration, pipeline dirt, working pressure and gravity tension. The calculation method for analyzing the relationship among the factors by adopting the Pearson correlation coefficient to carry out correlation analysis on the influencing factors comprises the following steps:
Figure GDA0003501629230000091
wherein X is an influencing factor, and Y is the invasion amount of the formation saturated brine.
Under the characteristic of not losing the original data, the linear transformation of the original data maps the data between [0,1], and the min-max is normalized as follows:
Figure GDA0003501629230000092
Figure GDA0003501629230000093
data representing normalized sample points, xmaxOriginal data, x, representing a maximum sample point within the historical sample dataminRaw data representing a minimum sample point within the historical sample data.
S111: constructing a Bi-LSTM network model, determining a Bi-LSTM model structure for predicting the invasion amount of the formation saturated brine, and setting initial parameter values of the Bi-LSTM model; the Bi-LSTM model is trained by using a training set to obtain a trained Bi-LSTM model, as shown in FIG. 6.
Further, in S111, each cell in the LSTM model includes three types of thresholds:
a forgetting gate (forget gate) for determining the information discarded from the cell, the forgetting gate selecting whether to forget the previous cell state with a certain probability, the input of the forgetting gate being the shadow state h at the time t-1t-1And input x at time ttOutput ftThe probability of forgetting the state of the cell at the previous moment;
an input gate (input gate) for determining from the inputs which values to use to update the memory state, the input gate selectively storing the input at time t into the cell state, the input at time t-1 being the hidden state ht-1And input x at time ttInput itDeciding what value to update, ctCreating a new vector of candidate values, ctThe cell state after renewal.
An output gate (output gate) for determining the output content according to the inputs and the memory of the cell, the output gate determining the value to be output at time t, OtOutput information of selectable cell states, htThe output of the output gate.
The structure of the LSTM prediction model is as follows:
yt=σ(Wyhht)
ht=ot*tanh(Ct)
Ct-1=tanh(Wc[ht-1,xt]+c)
Ct=ft*Ct-1+it*Ct-1
ft=σ(Wf[ht-1,xt]+bf)
it=σ(Wi[ht-1,xt]+bi)
ot=σ(Wo[ht-1,xt]+bo)
wherein t represents the current time in the model, and t-1 represents the last time in the model; x is the number oftIs the input vector, y, of the LSTM neuron at the current timetThe output vector of the output layer at the current moment, ht and ht-1 are respectively the output vectors of the hidden layer at the current moment and the hidden layer at the last moment; t is an activation vector of an input gate at the current moment, ft is an activation vector of a forgotten gate at the current moment, and ot is an activation vector of an output gate at the current moment; ct represents a neuron cell state vector at the current moment and is used for updating the cell state, and Ct-1 represents a cell state vector at the last moment; wf, Wi, Wo and Wc are weight matrixes of a forgetting gate, an input gate, an output gate and a cell state vector respectively; bf. bi, bo and bc are respectively bias terms of a forgetting gate, an input gate, an output gate and a cell state vector; wyh denotes the weight matrix between the output layer and the hidden layer, σ and tanh are the activation functions, sigmoid function and hyperbolic tangent function, respectively.
Setting initial parameter values of the Bi-LSTM model, comprising the following steps: input layer dimension, hidden layer dimension, output layer dimension, number of hidden layer nodes, iterative training times, initial learning rate and training step length.
Further, in S107, vectors of the hidden layer and the output layer are calculated through forward and backward data information transfer processes, and are respectively stored in the data group, and a process of gradient descent of the model is implemented by updating parameters; the weights of the input gate, the output gate and the forgetting gate are updated through the weight updating function respectively.
Further, a Bi-LSTM model is established, as shown in fig. 7, the prediction result of the Bi-LSTM is determined by the prediction results of two LSTMs, the forward LSTM calculates once forward from the time t to the time t + n, and stores the output of each hidden layer of the forward LSTM, the backward LSTM calculates once backward from the time t + n to the time t, and stores the output of each hidden layer of the backward LSTM, and the output of the Bi-LSTM model combines the outputs of the forward LSTM and the backward LSTM to obtain the final output result.
And predicting the invasion amount of the saturated saline water of the stratum according to the two-way long-short memory neural network. The long-short memory is a special cyclic neural network, and the weight parameters of the network are updated according to the gradient guidance of the loss function, so that the defect that the gradient of the original cyclic neural network disappears is overcome, and the Bi-LSTM is more accurate in prediction of the saturated salt water of the stratum.
S112, carrying out prediction evaluation on the trained Bi-LSTM model by using a test set, stopping training when the error meets the expectation or reaches the number of model training iterations, and determining model parameters; otherwise, the model continues to be trained until expectations are met.
In the step S112, according to the difference distance between the actual values of the prediction value ranges of the stratum saturated saline invasion amount, the prediction effect evaluation index of the model is measured and calculated; and taking the root mean square error as a loss function, solving model parameters after gradient descent, realizing the back propagation of the error back propagation model, using an Adam optimization algorithm based on gradient descent, and adjusting the model parameters by calculating the gradient of each weight according to a corresponding error item to enable the prediction result to reach an optimization target.
Root Mean Square Error (RMSE) is used as an evaluation index of the model, and the deviation between the actual values of the observation value range can be measured.
Figure GDA0003501629230000111
x is an input variable, h is a prediction function, yiIs trueAnd m is the number of samples, and the smaller the RMSE value is, the smaller the deviation between the predicted value and the reality is, and the better the prediction effect is.
And when the error reaches the lowest state or the iteration reaches the maximum iteration time state, determining the final parameters of the model, and stopping the training of the model.
And S113, after the model training is finished, inputting the test set into the trained Bi-LSTM grid to obtain a test result, comparing the actual calculation result, and performing reverse normalization on the result obtained by prediction, so that the comparison with the original label is facilitated, and the quality of the performance of the model is measured. The denormalization formula of the predicted result is as follows:
Figure GDA0003501629230000112
Figure GDA0003501629230000113
data representing normalized sample points, xiData representing sample points within the shown historical sample data, xmaxOriginal data, x, representing a maximum sample point within the historical sample dataminRaw data representing a minimum sample point within the historical sample data. .
The method has the advantages that the calculation of the invasion amount of the formation saturated brine can be monitored in real time through the concentration of the chloride ions, no one can monitor the invasion amount of the formation saturated brine in real time through the method, the invasion amount of the saturated brine is more accurately predicted through a Bi-LSTM (long-short time neural network algorithm), and the invasion amount can be predicted in advance to achieve the effect of preventing overflow or blowout.
Finally, it should be noted that: the above mode is only used for illustrating the technical scheme of the invention, and not limiting the same; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (5)

1. A method for monitoring the invasion amount of formation saturated brine based on Bi-LSTM is characterized in that: the method comprises the following steps:
the method comprises the following steps: measuring to obtain concentration curves of chloride ions at an inlet and an outlet;
step two: measuring to obtain real-time flow curves of an inlet and an outlet;
step three: calculating the amount of the substance of chloride ions in the formation saturated brine;
in the calculation process, to find the inlet drilling fluid corresponding to the mud at the outlet, the flow velocity V of the drilling fluid in the well is not changed greatly and is regarded as a constant flow velocity, and the distance s that the drilling fluid flows from the inlet to the outlet is known, so that the time Δ t for the drilling fluid to flow from the inlet to the outlet is obtained:
Figure FDA0003501629220000011
in the above formula, s is the distance that the drilling fluid flows from the inlet to the outlet, and v is the flow velocity of the drilling fluid;
dividing the chloride ion concentration curve and the flow curve obtained by real-time monitoring into 5 second segments, totally dividing the segments into N segments, wherein N is 1,2 and 3 … …, and integrating the amount N of the substances flowing into and out of each segment1、n2The amount of the substance increased in chloride ion Δ n per small piece was obtainedi
The amount of the substance of the inflowing chloride ions is calculated:
Figure FDA0003501629220000012
in the formula n1Amount of substance which is chloride ion influx, C1As concentration of chloride ions at the inlet, Q1Is the flow at the inlet, t1Is the initial time of the first segment, t2Is as followsA termination time of a segment;
the amount of the outflowing species of chloride ions was recalculated:
Figure FDA0003501629220000013
in the formula n2Amount of substance which is the chloride ion to be exported, C2Is the concentration of chloride ions, Q, at the outlet2Is the flow at the outlet, t5Is the initial time of the first segment, t6Is the termination time of the first segment;
the amount of species of chloride ion added in the first 5 seconds was then calculated:
Figure FDA0003501629220000021
step four: calculating the invasion amount of the stratum saturated brine in the saturated brine;
in the fourth step, the optical fiber temperature measuring instrument is used for measuring the formation temperature at the saturated brine position of the formation to obtain the chloride ion concentration C in the saturated brine at the temperature3And calculating the invasion amount of the formation saturated brine of the first section:
Figure FDA0003501629220000022
and finally, accumulating the invasion amount of the stratum saturated brine of each small section to obtain the total invasion amount of the stratum saturated brine:
Figure FDA0003501629220000023
step five: according to the predicted result, selecting influence factors x ' 1, x ' 2, … and x'm influencing the result as evaluation indexes of the established model, carrying out Pearson correlation coefficient analysis before screening the evaluation indexes of the prediction model, and then determining the final evaluation index to obtain a screened data set;
step six: correcting original data sequences of independent variables and dependent variables in a data set, and preprocessing corrected data; dividing the data set into a training set test set, and normalizing the training set test set;
step seven: constructing a Bi-LSTM network model, determining a Bi-LSTM model structure for predicting the invasion amount of the formation saturated brine, and setting initial parameter values of the Bi-LSTM model; training the Bi-LSTM model by using a training set to obtain a trained Bi-LSTM model;
step eight: performing prediction performance evaluation on the trained Bi-LSTM model by using a test set, stopping training when an error meets an expectation or reaches the number of model training iterations, and determining model parameters; otherwise, continuing to train the model until the expectation is met;
step nine: and after the model training is finished, inputting the test set to obtain a trained Bi-LSTM grid to obtain a test result, and performing inverse normalization on the result.
2. The method for monitoring the invasion amount of the saturated brine of the stratum based on the Bi-LSTM in claim 1, wherein in the fifth step, the influence factors are selected based on the predicted invasion amount of the saturated brine of the stratum and are classified into three types, namely a chlorine ion concentration measurement influence factor, an ultrasonic flow measurement influence factor and a fiber thermometer measurement temperature influence factor, wherein the chlorine ion concentration measurement influence factors comprise measurement noise x1, ambient temperature x2, mud flow rate x3 and mud concentration x 4; the influence factors measured by the ultrasonic flowmeter comprise pipeline dirt x5, working pressure x 6; the optical fiber thermometer measures influence factors including strain x7 generated by gravity pull, and meanwhile, a correlation calculation method for analyzing the correlation among the influence factors by adopting a Pearson correlation coefficient is as follows:
Figure FDA0003501629220000031
wherein X is an influencing factor, and Y is the invasion amount of the formation saturated brine.
3. The method for monitoring the invasion amount of the saturated brine of the stratum based on the Bi-LSTM according to claim 1, wherein in the sixth step, the updated data is converted into supervised learning time series data and normalized, and the data set is divided into a training set and a data set with the goal of highest prediction accuracy, and the method for dividing the testing set and the training set is as follows:
taking 200 groups of experimental data, taking the highest prediction precision as a target, dividing 15% -85% of a data set into a training set, dividing the rest data into a test set, wherein the test set is used for adjusting a Bi-LSTM model and evaluating the prediction precision, and the training set is suitable for training the Bi-LSTM model.
4. The Bi-LSTM based method of monitoring formation saturated brine invasion of claim 1, wherein: in the eighth step, when the Bi-LSTM model is established, vectors of the hidden layer and vectors of the output layer are calculated in the forward and backward data information transfer processes and are respectively stored in the data group, the gradient of the model is reduced by updating parameters, and the weights of the input gate, the output gate and the forgetting gate are respectively updated by the weight updating function;
according to the difference distance between the predicted value and the true value of the stratum saturated brine invasion amount, calculating the prediction effect evaluation index of the model; and taking the root-mean-square error RMSE as a loss function, solving the model parameters after gradient reduction to realize the back propagation of the error, determining the final parameters of the model when the error reaches the lowest state or the iteration reaches the maximum iteration time state, stopping the training of the model, and obtaining the complete Bi-LSTM model.
5. The Bi-LSTM-based method of monitoring formation saturated brine invasion of claim 1, wherein: in the ninth step, after the model training is finished, inputting the test set into the trained Bi-LSTM grid to obtain the immersion result of the tested formation saturated brine, comparing the actual calculation result, and simultaneously performing reverse normalization on the result obtained by prediction to compare with the original label and measure the performance of the model, wherein the reverse normalization formula of the prediction result is as follows:
Figure FDA0003501629220000041
Figure FDA0003501629220000042
data representing normalized sample points, xmaxRaw data, x, representing the largest sample point within historical sample dataminRaw data representing the smallest sample point within the historical sample data.
CN202110043087.0A 2021-01-13 2021-01-13 Method for monitoring stratum saturated brine invasion amount based on Bi-LSTM Active CN112765880B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110043087.0A CN112765880B (en) 2021-01-13 2021-01-13 Method for monitoring stratum saturated brine invasion amount based on Bi-LSTM

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110043087.0A CN112765880B (en) 2021-01-13 2021-01-13 Method for monitoring stratum saturated brine invasion amount based on Bi-LSTM

Publications (2)

Publication Number Publication Date
CN112765880A CN112765880A (en) 2021-05-07
CN112765880B true CN112765880B (en) 2022-03-25

Family

ID=75700123

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110043087.0A Active CN112765880B (en) 2021-01-13 2021-01-13 Method for monitoring stratum saturated brine invasion amount based on Bi-LSTM

Country Status (1)

Country Link
CN (1) CN112765880B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114611832B (en) * 2022-03-30 2022-11-25 河海大学 Seawater intrusion prediction method based on Bayesian multi-model set pair analysis
CN116146190B (en) * 2023-02-24 2024-07-19 西南石油大学 Underground leakage or overflow early warning device and method based on bidirectional flow measurement

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109523072A (en) * 2018-11-02 2019-03-26 中国石油化工股份有限公司 Oil field oil production prediction technique based on LSTM
CN111487172A (en) * 2019-01-28 2020-08-04 中国石油天然气股份有限公司 Device and method for evaluating flow conductivity of acid-etched fracture of tight reservoir core
CN111563706A (en) * 2020-03-05 2020-08-21 河海大学 Multivariable logistics freight volume prediction method based on LSTM network
EP3721054A1 (en) * 2017-12-08 2020-10-14 Solution Seeker AS Modelling of oil and gas networks

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US4508169A (en) * 1982-12-10 1985-04-02 Exxon Production Research Co. Method for determining connate water saturation and salinity in reservoirs

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP3721054A1 (en) * 2017-12-08 2020-10-14 Solution Seeker AS Modelling of oil and gas networks
CN109523072A (en) * 2018-11-02 2019-03-26 中国石油化工股份有限公司 Oil field oil production prediction technique based on LSTM
CN111487172A (en) * 2019-01-28 2020-08-04 中国石油天然气股份有限公司 Device and method for evaluating flow conductivity of acid-etched fracture of tight reservoir core
CN111563706A (en) * 2020-03-05 2020-08-21 河海大学 Multivariable logistics freight volume prediction method based on LSTM network

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
Study of mixed mode fracture toughness and fracture trajectories in gypsum interlayers in corrosive environment;Xiankai B 等;《Royal Society Open Science》;20180217;第5卷(第1期);第171374页 *
基于人工神经网络的河口区盐水入侵预报研究;周凡涵 等;《水文》;20201225;第40卷(第6期);第55-62页 *
钱塘江河口盐水入侵数值模拟;李光辉;《中国优秀博硕士学位论文全文数据库(博士) 工程科技Ⅱ辑》;20171115(第11期);第C038-54页 *

Also Published As

Publication number Publication date
CN112765880A (en) 2021-05-07

Similar Documents

Publication Publication Date Title
Gholami et al. Uncertainty analysis of intelligent model of hybrid genetic algorithm and particle swarm optimization with ANFIS to predict threshold bank profile shape based on digital laser approach sensing
CN112765880B (en) Method for monitoring stratum saturated brine invasion amount based on Bi-LSTM
Aytek et al. An application of artificial intelligence for rainfall-runoff modeling
CN111461453B (en) Medium-and-long-term runoff ensemble forecasting method based on multi-model combination
CN111767517B (en) BiGRU multi-step prediction method, system and storage medium applied to flood prediction
CN110501646A (en) Off-line lithium battery residual capacity estimation method
CN111415492A (en) Slope landslide early warning method and system based on fuzzy comprehensive evaluation algorithm
CN110824914B (en) Intelligent wastewater treatment monitoring method based on PCA-LSTM network
CN112966891A (en) River water environment quality prediction method
CN116721537A (en) Urban short-time traffic flow prediction method based on GCN-IPSO-LSTM combination model
CN112307536B (en) Dam seepage parameter inversion method
Ghimire et al. Development of stage-discharge rating curve in river using genetic algorithms and model tree
CN116451556A (en) Construction method of concrete dam deformation observed quantity statistical model
CN117113236B (en) Smart city monitoring system and data processing method
CN115935834A (en) History fitting method based on deep autoregressive network and continuous learning strategy
CN113449905A (en) Traffic jam early warning method based on gated cyclic unit neural network
CN108416458A (en) A kind of tunnel rich water rock mass Synthetic Geological Prediction Ahead of Construction method based on BP neural network
CN115948964A (en) Road flatness prediction method based on GA-BP neural network
CN115982141A (en) Characteristic optimization method for time series data prediction
CN111914487A (en) Data-free regional hydrological parameter calibration method based on antagonistic neural network
CN117272202A (en) Dam deformation abnormal value identification method and system
CN117350146A (en) GA-BP neural network-based drainage pipe network health evaluation method
CN111914488A (en) Data regional hydrological parameter calibration method based on antagonistic neural network
Lu et al. Uncertainty quantification of machine learning models to improve streamflow prediction under changing climate and environmental conditions
CN116663607A (en) Method for constructing oilfield separate layer water injection prediction model based on LSTM

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
GR01 Patent grant
GR01 Patent grant
EE01 Entry into force of recordation of patent licensing contract
EE01 Entry into force of recordation of patent licensing contract

Application publication date: 20210507

Assignee: BEIJING LIUHE GREATNESS TECHNOLOGY Co.,Ltd.

Assignor: SOUTHWEST PETROLEUM University

Contract record no.: X2022510000031

Denomination of invention: A method based on Bi LSTM to monitor the invasion of saturated brine in formation

Granted publication date: 20220325

License type: Common License

Record date: 20220701