CN112765880A - Method for monitoring stratum saturated brine immersion amount based on Bi-LSTM - Google Patents

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

Info

Publication number
CN112765880A
CN112765880A CN202110043087.0A CN202110043087A CN112765880A CN 112765880 A CN112765880 A CN 112765880A CN 202110043087 A CN202110043087 A CN 202110043087A CN 112765880 A CN112765880 A CN 112765880A
Authority
CN
China
Prior art keywords
lstm
saturated brine
model
amount
data
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.)
Granted
Application number
CN202110043087.0A
Other languages
Chinese (zh)
Other versions
CN112765880B (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)
  • Geology (AREA)
  • Mining & Mineral Resources (AREA)
  • Medical Informatics (AREA)
  • Computer Hardware Design (AREA)
  • Geometry (AREA)
  • Geophysics (AREA)
  • Environmental & Geological Engineering (AREA)
  • Fluid Mechanics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • General Life Sciences & Earth Sciences (AREA)
  • Geochemistry & Mineralogy (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The invention provides a method for monitoring the immersion amount of stratum saturated brine 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 immersion amount based on Bi-LSTM
Technical Field
The invention belongs to the field of measurement for monitoring the immersion amount of formation saturated brine, and particularly relates to a method for monitoring the immersion amount of formation saturated brine 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 water immersion amount of the stratum is large, the effective liquid column pressure in the well is unbalanced with the stratum pressure, the stratum fluid overflows when entering a shaft, if the control is not timely or improper, the well blowout can occur, and therefore the saturated saline water immersion 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 BDA0002896653020000021
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 BDA0002896653020000031
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 BDA0002896653020000032
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 BDA0002896653020000033
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 BDA0002896653020000034
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 BDA0002896653020000041
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 BDA0002896653020000042
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=σ(Wyh ht)
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 vectors of the output layer at the current moment are shown as ht and ht-1, and the ht-1 are respectively the output vectors of the shadow storage layer at the current moment and the shadow storage 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 occlusion layer, and σ and tanh are 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 shadow layer and the output layer through forward and backward data information transfer processes, respectively storing the vectors in a data group, and realizing the gradient descending process 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 BDA0002896653020000051
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 BDA0002896653020000081
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 BDA0002896653020000082
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 BDA0002896653020000083
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 BDA0002896653020000084
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 BDA0002896653020000085
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 BDA0002896653020000091
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 BDA0002896653020000092
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 BDA0002896653020000093
Figure BDA0002896653020000094
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 immersion 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 in the cell state and outputtingThe entry is the shadow state h at time t-1t-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=σ(Wyh ht)
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 vectors of the output layer at the current moment are shown as ht and ht-1, and the ht-1 are respectively the output vectors of the shadow storage layer at the current moment and the shadow storage 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, the weight matrix between the output layer and the occlusion layer, σ and tanh are 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 immersion amount of the saturated saline water of the stratum according to the bidirectional 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 BDA0002896653020000111
x is an input variable, h is a prediction function, yiThe prediction effect is better when the deviation between the predicted value and the reality is smaller as the RMSE value is smaller.
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 BDA0002896653020000121
Figure BDA0002896653020000122
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 (7)

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;
step four: calculating the invasion amount of the stratum saturated brine in the saturated brine;
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. According to the method for monitoring the invasion amount of the saturated brine of the stratum based on the Bi-LSTM, the method is characterized in that in the third step, in the calculation process, to find the inlet drilling fluid corresponding to the mud at the outlet, as the flow rate V of the drilling fluid in the well is not changed greatly and is regarded as a constant flow rate, the distance s of the drilling fluid flowing from the inlet to the outlet is known, and therefore the time delta t of the drilling fluid flowing from the inlet to the outlet is obtained:
Figure FDA0002896653010000011
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, dividing the segments into N segments (N is 1,2,3 … …) in total, and calculating the amount N of the substances flowing into and out of each segment by integration1、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 FDA0002896653010000021
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 FDA0002896653010000022
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 FDA0002896653010000023
3. the method for monitoring the amount of saturated brine invasion of a formation based on Bi-LSTM as claimed in claim 1 wherein: 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 FDA0002896653010000024
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 FDA0002896653010000025
4. the method for monitoring the amount of saturated brine intrusion of a formation based on the Bi-LSTM method as claimed in claim 1, wherein in the fifth step, the influencing factors are selected based on the predicted amount of saturated brine intrusion of the formation and are classified into three types, namely, a chloride ion concentration measurement influencing factor, an ultrasonic flow measurement influencing factor and a fiber thermometer measurement temperature influencing factor, wherein the chloride ion concentration measurement influencing 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 FDA0002896653010000031
wherein X is an influencing factor, and Y is the invasion amount of the formation saturated brine.
5. The method for monitoring the saturated brine immersion amount 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 highest prediction accuracy as the target, and the test set and the training set are divided 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.
6. The method for monitoring the saturated brine invasion of the formation based on the Bi-LSTM of claim 1, wherein: in the eighth step, when the Bi-LSTM model is established, vectors of the shadow layer and 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 immersion 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.
7. 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 FDA0002896653010000041
Figure FDA0002896653010000042
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.
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 true CN112765880A (en) 2021-05-07
CN112765880B 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)

Cited By (2)

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

Citations (5)

* 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
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

Patent Citations (5)

* 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
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
XIANKAI B 等: "Study of mixed mode fracture toughness and fracture trajectories in gypsum interlayers in corrosive environment", 《ROYAL SOCIETY OPEN SCIENCE》 *
周凡涵 等: "基于人工神经网络的河口区盐水入侵预报研究", 《水文》 *
李光辉: "钱塘江河口盐水入侵数值模拟", 《中国优秀博硕士学位论文全文数据库(博士) 工程科技Ⅱ辑》 *

Cited By (3)

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

Also Published As

Publication number Publication date
CN112765880B (en) 2022-03-25

Similar Documents

Publication Publication Date Title
CN112765880B (en) Method for monitoring stratum saturated brine invasion amount based on Bi-LSTM
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
CN110824914B (en) Intelligent wastewater treatment monitoring method based on PCA-LSTM network
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
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
CN116245227A (en) Daily weather drought prediction method, device, storage medium and equipment
CN115948964A (en) Road flatness prediction method based on GA-BP neural network
CN115982141A (en) Characteristic optimization method for time series data prediction
CN113858566B (en) Injection molding machine energy consumption prediction method and system based on machine learning
CN117272202A (en) Dam deformation abnormal value identification method and system
CN117350146A (en) GA-BP neural network-based drainage pipe network health evaluation method
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
CN109101759A (en) A kind of parameter identification method based on forward and reverse response phase method
CN115935488A (en) High arch dam stress prediction model construction method based on monitoring data
CN115544891A (en) Method and system for predicting height of original pressure-bearing height guide belt
CN112381380B (en) System health detection method and device for spacecraft
CN110705186B (en) Real-time online instrument checksum diagnosis method through RBF particle swarm optimization algorithm
CN113204583A (en) Reservoir group scheduling decision behavior mining method and reservoir scheduling automatic control device

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