Well shut-in control method and device for high-temperature and high-pressure well

By constructing the LSTM model, using the time series data of high-temperature and high-pressure wells, the problem of difficulty in determining the shutdown time during overflow of high-temperature and high-pressure wells is solved, and the shutdown time and formation pressure are accurately calculated to ensure the efficient implementation of well control measures.

CN120444015AActive Publication Date: 2025-08-08CHINA UNIV OF PETROLEUM (EAST CHINA)
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202510583805.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-07
Publication Date
2025-08-08
Estimated Expiration
2045-05-07

AI Technical Summary

Technical Problem

When overflow occurs in high-temperature and high-pressure wells, it is difficult for traditional methods to accurately determine the shutdown time, resulting in the inability to accurately calculate the formation pressure, which affects the implementation of well control measures.

Method used

The LSTM model was constructed, using the time series data of shut-off pressure, shut-off sleeve pressure, wellbore bottom pressure and wellbore temperature. By adjusting the model layer number, neuron number and cell state, the wellbore temperature and pressure were used to correct the output shut-off time.

Benefits of technology

The calculation accuracy of the shutdown time and the efficiency of obtaining formation pressure are improved to ensure the effective implementation of well control measures.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120444015A_ABST
    Figure CN120444015A_ABST
Patent Text Reader

Abstract

The invention discloses a high-temperature and high-pressure well shut-in control method and device, and the method comprises the following steps: S11, constructing and training an LSTM model: constructing a data set, each piece of data in the data set comprising a shut-in vertical pressure Ps, a shut-in casing pressure Pa, a wellbore bottom pressure Pw, a wellbore temperature T, and a shut-in time m; s12, calculating activation values of an input gate, a forgetting gate and an output gate, updating a cell state Ct of the LSTM model, and calculating an output ht; s13, the change rate of the shaft bottom pressure Pw is calculated, the layer number nL and the neuron number Nh of the LSTM model are updated, and the cell state is updated; s14, correcting ht based on the wellbore temperature and the wellbore bottom pressure; and S15, setting a learning rate theta for learning. According to the method, an LSTM model is constructed and used for calculating the well shut-in time m according to the well shut-in vertical pressure Ps, the well shut-in casing pressure Pa, the shaft bottom pressure Pw and the shaft temperature T when overflow happens to the high-temperature and high-pressure well.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of petroleum engineering, and in particular to a high-temperature and high-pressure well shut-in control method and device. Background Art

[0002] my country's oil and gas development is increasingly moving into deepwater and deep formations. With technological advancements and growing market demand, an increasing number of high-temperature, high-pressure (HTHP) wells are being developed. These wells are typically located in deepwater or geologically complex areas, where wellbore temperatures and pressures are significantly higher than those of conventional wells. While the development of HTHP wells has improved oil and gas extraction efficiency, it has also brought new challenges.

[0003] During the drilling process of high-temperature, high-pressure wells, overflows are prone to occur due to abnormal temperature and pressure conditions and complex geological conditions. After an overflow occurs, the well must be shut in to determine the formation pressure. Subsequent well control measures such as circulating gas and killing the well are then implemented based on the formation pressure. Therefore, the ability to accurately determine the formation pressure is particularly important for handling abnormal downhole conditions such as overflows.

[0004] Traditionally, after a conventional well overflows, the well is shut in for 10-15 minutes (10-15 minutes is the time point when the wellbore bottom pressure reaches the formation pressure) based on the subsequent flow effect after shut-in and the upward migration velocity of gas. Then the pump is started at a low flow rate, the float valve in the drill string is opened, and the shut-in vertical pressure or shut-in casing pressure is read. The formation pressure is then calculated by adding the shut-in vertical pressure or shut-in casing pressure to the static column pressure.

[0005] However, during the shut-in process of a high-temperature, high-pressure well, the rate of formation gas intrusion into the wellbore during the continued flow phase will gradually decrease, the invasion time will be prolonged, the migration velocity of the gas in the wellbore will also change, and the thermal expansion effect of the drilling fluid and gas in the wellbore will be more obvious than that of a conventional well. Due to these multiple factors, the dynamic changes of wellhead pressure and downhole pressure are often nonlinear.

[0006] Therefore, the 10-15 minutes after shutting in the well is not the time when the bottom pressure of the wellbore reaches the formation pressure. The shut-in pressure or casing pressure read at this time cannot be used to calculate the formation pressure. Overall, the time when the well is shut in and pressure is measured (i.e., the shut-in time) when overflow occurs in a high-temperature, high-pressure well is difficult to determine due to the influence of multiple factors, making it difficult to determine the formation pressure when the well is shut in.

[0007] In view of this, this invention is proposed. Summary of the Invention

[0008] The purpose of the present invention is to solve the shortcomings of the prior art and propose a high-temperature and high-pressure well shut-in control method, which constructs an LSTM model for shut-in control based on the shut-in vertical pressure P when overflow occurs in a high-temperature and high-pressure well. s , shut-in casing pressure P a, Bottom pressure P w , calculate the shut-in time m based on the wellbore temperature T.

[0009] In order to achieve the above object, the present invention adopts the following technical solutions:

[0010] A high-temperature and high-pressure well shut-in control method comprises the following steps:

[0011] S1: Construct and build an LSTM model, said S1 includes the following steps:

[0012] S11: Construct a data set, each data in the data set includes shut-in vertical pressure P s , shut-in casing pressure P a , Bottom pressure P w , wellbore temperature T, shut-in time m;

[0013] S12: Calculate the activation values of the input gate, forget gate, and output gate, and update the cell state C of the LSTM model t , calculate the output h t ;

[0014] S13: Calculate the wellbore bottom pressure P w The rate of change of , updates the number of layers n of the LSTM model L and the number of neurons N h , update the cell state;

[0015] S14: Modify h based on wellbore temperature and wellbore bottom pressure t ;

[0016] S15: Set the learning rate θ for learning.

[0017] Furthermore, in S11, the well is shut down and the vertical pressure P is increased. s , shut-in casing pressure P a , Bottom pressure P w and wellbore temperature T are the input of the LSTM model, and the shut-in time m is the output of the LSTM model.

[0018] Furthermore, in S12, the activation values of the input gate, forget gate, and output gate are calculated using the following formula:

[0019] i t =σ(W i ·[h t-1 ,x t ]+b i )

[0020] f t =σ(W f ·[h t-1 ,x t ]+b f)

[0021] o t =σ(W o ·[h t-1 ,x t ]+b o )

[0022] Among them, i t is the activation value of the input, f t is the activation value of the forget gate, o t is the activation value of the output gate, W i 、W f 、W o are the weight matrices of the input gate, forget gate, and output gate, respectively, b i 、b f 、b o are the bias vectors of the input gate, forget gate, and output gate, respectively. σ is the sigmoid activation function. t is the input of the current time step, h t-1 is the output of the previous time step.

[0023] Furthermore, in S12, the cell state C of the LSTM model is updated by the following formula: t , calculate the output h t :

[0024]

[0025] h t =o t *tanh(C t )

[0026] Among them, C t is the cell state at the current time step, C t-1 is the cell state at the previous time step; Candidate status.

[0027] Furthermore, the S13 updates the number of layers n of the LSTM model by the following steps: L and the number of neurons N h :

[0028] A131: Calculate the change in the loss value at the current time step, △L, using the following formula:

[0029] ΔL=|L t -L t-1 |

[0030] Among them, L t is the loss value calculated by the loss function at the current time step, L t-1 is the loss value calculated by the loss function at the previous time step;

[0031] A132: Update the number of layers n of the LSTM model using the following formula L and the number of neurons N h :

[0032] n L =n L +ΔL·λ1

[0033] N h =N h +ΔL·λ2

[0034] Among them, λ1 and λ2 are hyperparameters, which are calculated based on the bottom pressure P of the wellbore. w The rate of change is dynamically adjusted.

[0035] Furthermore, the S3 includes the following steps to update the cell state of the LSTM model:

[0036] B131: The dynamic gating weight of the LSTM model is calculated using the following formula to control whether the cell state at the current time step is weighted and updated by the wellbore bottom pressure data at the current time step:

[0037] G t =σ(W g r t +b g )

[0038] Among them, W g is the weight matrix of the gating mechanism, b g is the bias term of the gating mechanism, and σ is the sigmoid activation function;

[0039] B132: Update the cell state of the LSTM model using the following formula

[0040] C′ t =G t ·C t +(1-G t )·C t-1 .

[0041] Furthermore, the S14 includes the following steps:

[0042] S141: Calculate the wellbore temperature influence factor T using the following formula f , used to express the influence of wellbore temperature T on downhole fluid properties:

[0043] T f =αT+β

[0044] Where α and β are constants.

[0045] S142: Calculate the corrected wellbore bottom pressure P using the following formula: adj :

[0046]

[0047] Where γ is the compressibility impact factor;

[0048] S143: Correct h by the following formula t :

[0049] h′ t =h t ·P adj .

[0050] Furthermore, in S15, the learning rate θ is dynamically set by the following formula:

[0051] m t =β1m t-1 +(1-β1)g t

[0052]

[0053] Among them, m t is the first-order moment, v t is the second-order moment, g t is the current gradient, β1 and β2 are the decay rates of the first-order moment and the second-order moment, and ò is a small constant used to prevent the denominator from being zero.

[0054] Furthermore, the method further comprises the following steps:

[0055] S2: When overflow occurs, shut down the well and obtain the shut-in vertical pressure P 10 to 15 minutes after shutting down the well s , shut-in casing pressure P a , Bottom pressure P w , wellbore temperature T;

[0056] S3: Calculates the shut-in time m based on the LSTM model built in S1. When the shut-in time is reached, the mud pump is controlled to pump at a low rate to open the float valve in the drill string.

[0057] S4: Obtain shut-in vertical pressure P s Or shut-in casing pressure P a , by shutting in the well and raising the pressure P s Or shut-in casing pressure P a Add the hydrostatic column pressure to calculate the formation pressure.

[0058] In order to achieve the above object, the present invention also adopts the following technical solutions:

[0059] A high-temperature and high-pressure well shut-in control device, comprising:

[0060] a memory for storing a computer program; and

[0061] A processor is configured to implement the steps of any one of the control methods provided by the present invention when executing the computer program.

[0062] Compared with the prior art, the present invention has the following beneficial effects:

[0063] An LSTM model was constructed to predict the overflow of a high-temperature and high-pressure well based on the shut-in pressure P. s , shut-in casing pressure P a , wellbore bottom pressure Pw, wellbore temperature T calculate the shut-in time m; LSTM model can make intelligent predictions on time series data, and when constructing the LSTM model, the present invention calculates the shut-in time m according to the wellbore bottom pressure P w Update the number of layers n of the LSTM model at the rate of change L , the number of neurons N h and cell state, based on the wellbore temperature and wellbore bottom pressure, correct h t Therefore, the LSTM constructed by the present invention has high accuracy in calculating the shut-in time m; the method based on the present invention can greatly improve the accuracy and efficiency of obtaining the formation pressure, providing a strong guarantee for the implementation of subsequent well control measures. BRIEF DESCRIPTION OF THE DRAWINGS

[0064] Figure 1 Flowchart for building LSTM model;

[0065] Figure 2 This is the structural diagram of the LSTM model;

[0066] Figure 3 The figure is a flow chart of the shut-in control method for high-temperature and high-pressure wells. DETAILED DESCRIPTION

[0067] The technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments.

[0068] Example 1:

[0069] A high temperature and high pressure well shut-in control method, such as Figures 1-2 As shown, the following steps are included:

[0070] S1: Build and train an LSTM model. S1 includes the following steps:

[0071] S11: Construct a data set, each data in the data set includes shut-in vertical pressure P s , shut-in casing pressure P a , Bottom pressure P w, wellbore temperature T, shut-in time m;

[0072] S12: Calculate the activation values of the input gate, forget gate, and output gate, and update the cell state C of the LSTM model t , calculate the output h t ;

[0073] S13: Calculate the wellbore bottom pressure P w The rate of change of , updates the number of layers n of the LSTM model L and the number of neurons N h , update the cell state;

[0074] S14: Modify h based on wellbore temperature and wellbore bottom pressure t ;

[0075] S15: Set the learning rate θ for learning.

[0076] The high-temperature and high-pressure well shut-in control method of this embodiment builds an LSTM model for shut-in vertical pressure P when overflow occurs in the high-temperature and high-pressure well. s , shut-in casing pressure P a , Bottom pressure P w , the wellbore temperature T is used to calculate the shut-in time m; the LSTM model can make intelligent predictions on time series data, and in this embodiment, when constructing the LSTM model, the wellbore bottom pressure P is used to calculate the shut-in time m. w Update the number of layers n of the LSTM model at the rate of change L , the number of neurons N h and cell state, based on the wellbore temperature and wellbore bottom pressure, correct h t Therefore, the LSTM constructed in this embodiment has high accuracy in calculating the shut-in time m; the method based on this embodiment can greatly improve the accuracy and efficiency of obtaining the formation pressure, providing a strong guarantee for the implementation of subsequent well control measures.

[0077] The high-temperature, high-pressure well shut-in control method of this embodiment first constructs a data set based on currently known data of high-temperature, high-pressure wells, and then trains and tests based on the data set to build an LSTM model. When constructing the data, data can be obtained according to empirical methods. For example, when overflow occurs, the shut-in time is set based on experience to shut in the well and calculate the formation pressure. If the calculated formation pressure is too high, the well cannot be successfully killed, and gas invasion will occur. If the calculated formation pressure is too low, the well cannot be successfully killed, and leakage will occur. Based on this, the accuracy of the shut-in time can be reversed, and ultimately the accurate shut-in time is obtained to construct the data set.

[0078] In an optional embodiment, in S11, the well is shut in and the pressure is raised to P s , shut-in casing pressure P a , Bottom pressure P wand wellbore temperature T are the input of the LSTM model, and the shut-in time m is the output of the LSTM model.

[0079] In an optional embodiment, in S12, the activation values of the input gate, the forget gate, and the output gate are calculated using the following formula:

[0080] i t =σ(W i ·[h t-1 ,x t ]+b i )

[0081] f t =σ(W f ·[h t-1 ,x t ]+b f )

[0082] o t =σ(W o ·[h t-1 ,x t ]+b o )

[0083] Among them, i t is the activation value of the input, which is used to control the influence of the current input, f t is the activation value of the forget gate, which is used to determine the degree of forgetting of the previous state. t is the activation value of the output gate, which is used to control the output of the current cell state, W i 、W f 、W o are the weight matrices of the input gate, forget gate, and output gate, respectively, b i 、b f 、b o are the bias vectors of the input gate, forget gate, and output gate, respectively. σ is the sigmoid activation function. t is the input of the current time step, h t-1 is the output of the previous time step.

[0084] In an optional embodiment, in S12, the cell state C of the LSTM model is updated by the following formula: t , calculate the output h t :

[0085]

[0086] h t =o t *tanh(C t )

[0087] Among them, C tis the cell state at the current time step, used to store long-term memory. At the first time step, C t is 0, C t-1 is the cell state at the previous time step; Candidate status.

[0088] In an optional embodiment, the wellbore bottom pressure P is calculated in S13 by the following formula: w The rate of change r t :

[0089]

[0090] In an optional embodiment, the S13 updates the number of layers n of the LSTM model by the following steps: L and the number of neurons N h :

[0091] A131: Calculate the change in the loss value at the current time step, △L, using the following formula:

[0092] ΔL=|L t -L t-1 |

[0093] Among them, L t is the loss value calculated by the loss function at the current time step, L t-1 is the loss value calculated by the loss function at the previous time step;

[0094] A132: Update the number of layers n of the LSTM model using the following formula L and the number of neurons N h :

[0095] n L =n L +ΔL·λ1

[0096] N h =N h +ΔL·λ2

[0097] Among them, λ1 and λ2 are hyperparameters, which are calculated based on the bottom pressure P of the wellbore. w The rate of change is dynamically adjusted.

[0098] In order to adapt to the complex changes during the shut-in and pressure-building process of a high-temperature, high-pressure well, in this optional embodiment, the network structure of the LSTM model is dynamically adjusted: specifically, in the early stage of shut-in, due to the rapid changes in the pressure at the bottom of the wellbore, the number of layers and neurons of the LSTM model is increased to enhance the short-term memory capacity; in the later stage of shut-in, the pressure at the bottom of the wellbore tends to be stable, and the number of layers and neurons of the LSTM model is gradually reduced to reduce the computational complexity and avoid overfitting.

[0099] In specific implementation, λ1 and λ2 can be adjusted by the following formula:

[0100] λ t =λ t-1 (1+α*r t )

[0101] The value range of α is 0.1 to 0.5.

[0102] In an optional embodiment, S3 includes the following steps to update the cell state of the LSTM model:

[0103] B131: The dynamic gating weight of the LSTM model is calculated using the following formula to control whether the cell state at the current time step is weighted and updated by the wellbore bottom pressure data at the current time step:

[0104] G t =σ(W g r t +b g )

[0105] Among them, W g is the weight matrix of the gating mechanism, which is used to adjust the impact of the pressure change rate on the network state, b g is the bias term of the gating mechanism, and σ is the sigmoid activation function;

[0106] B132: Update the cell state of the LSTM model using the following formula

[0107] C′ t =G t ·C t +(1-G t )·C t-1 .

[0108] In this optional embodiment, the weights of the forget gate, input gate, and output gate of the unit in the LSTM model are adjusted by calculating dynamic gating values based on the rate of change of the bottom bore pressure. In the early stage of shut-in of a high-temperature, high-pressure well, when the rate of change of the bottom bore pressure is large, the LSTM model can more flexibly adjust the activation of these gates to better capture rapidly changing characteristics.

[0109] In an optional embodiment, the S14 includes the following steps:

[0110] S141: Calculate the wellbore temperature influence factor T using the following formula f , used to express the influence of wellbore temperature T on downhole fluid properties:

[0111] T f =αT+β

[0112] Wherein, α and β are constants used to describe the magnitude and offset of the effect of the wellbore temperature T on the downhole fluid. The change in the wellbore temperature of a high-temperature, high-pressure well has a significant impact on the fluid density, viscosity, and other properties, thereby affecting the change in the wellbore bottom pressure 0. Therefore, in this optional embodiment, a wellbore temperature influence factor Tf is introduced to represent the effect of the wellbore temperature on the wellbore bottom pressure.

[0113] S142: Calculate the corrected wellbore bottom pressure P using the following formula: adj :

[0114]

[0115] Among them, γ is the compressibility factor, which is used to adjust the influence of wellbore temperature on the bottom pressure of the wellbore, and its value range is 1×10 -3 ~3×10 -3 Under high temperature and high pressure conditions, the compressibility of the fluid becomes significant, which affects the change in the bottom pressure of the wellbore. Therefore, a compressibility influence factor is introduced in this optional embodiment to simulate this effect.

[0116] S143: Correct h by the following formula t :

[0117] h′ t =h t ·P adj .

[0118] During the shut-in process of a high-temperature, high-pressure well, the changes in wellbore temperature and bottom wellbore pressure have interrelated effects on the downhole fluid. Therefore, in this optional embodiment, the effects of wellbore temperature and bottom wellbore pressure are combined to correct ht.

[0119] In other words, in this optional embodiment, ht is corrected by the dual scale of wellbore temperature and bottom wellbore pressure. The goal is to consider the influence of the combination of wellbore temperature and bottom wellbore pressure on the physical properties of the downhole fluid, taking into account the dual influence of wellbore temperature and pressure, especially the coupling relationship between the behavior of the fluid and the wellbore temperature and bottom wellbore pressure under high temperature and high pressure conditions, thereby further improving the accuracy of the LSTM model.

[0120] In addition, in this optional embodiment, the output is dynamically adjusted based on the interaction between the wellbore temperature and the bottom wellbore pressure, so that the model is more in line with the actual situation of high-temperature and high-pressure wells. As a result, the model can not only effectively handle pressure changes, but also fully consider the impact of the wellbore temperature on the properties of the downhole fluid, further improving the accuracy of shut-in pressure measurement.

[0121] In an optional embodiment, in S15, the learning rate θ is dynamically set by the following formula:

[0122] mt =β1m t-1 +(1-β1)g t

[0123]

[0124] Among them, m t is the first-order moment, which performs exponential weighted averaging on the past gradients to indicate the direction of the gradient, v t is the second-order moment, and the exponentially weighted average of each gradient square is performed to reflect the "gradient amplitude change", g t is the current gradient, which represents the gradient of the loss function calculated by the current model parameters. β1 and β2 are the attenuation rates of the first-order moment and the second-order moment, and their values usually range from 0 to 1. ò is a small constant used to prevent the denominator from being 0.

[0125] In addition, it should be noted that gradient descent can be used for iterative training, and the training ends when the maximum number of iterations is reached or the error condition is met. This process can be completed using existing technology and will not be elaborated here.

[0126] In an optional embodiment, if Figure 3 As shown, the following steps are also included:

[0127] S2: When overflow occurs, shut down the well and obtain the shut-in vertical pressure P 10 to 15 minutes after shutting down the well s , shut-in casing pressure P a , Bottom pressure P w , wellbore temperature T;

[0128] S3: Calculates the shut-in time m based on the LSTM model built in S1. When the shut-in time is reached, the mud pump is controlled to pump at a low rate to open the float valve in the drill string.

[0129] S4: Obtain shut-in vertical pressure P s Or shut-in casing pressure P a , by shutting in the well and raising the pressure P s Or shut-in casing pressure P a Add the hydrostatic column pressure to calculate the formation pressure.

[0130] To verify the effectiveness of the high-temperature and high-pressure well shut-in control method of this embodiment, the calculated data of this embodiment is compared with the simulated data. The basic parameters are shown in Table 1.

[0131] Table 1-Basic parameters

[0132] Parameter name / unit Numerical Well depth / m 3000 Wellhead temperature / ℃ 30 <![CDATA[Drilling fluid density / g / cm 3 > 1.35 Formation porosity / % 18 Formation pressure / MPa 50

[0133] Enter the shut-in vertical pressure P within 10-15 minutes after shutting in the well s , shut-in casing pressure Pa , Bottom pressure P w , wellbore temperature T data, the time interval is 1s, the shut-in time m calculated in this embodiment is 32.3min, the wellhead casing pressure P at this moment a The actual data of the simulation calculation is 33 minutes. The wellhead casing pressure at this moment is 10.46 MPa, the formation pressure is 50.4 MPa, and the shut-in time error is 2.4%. The prediction time of the method in this embodiment is less than 100 seconds, and it can respond quickly.

[0134] Example 2:

[0135] A high-temperature and high-pressure well shut-in control device, comprising:

[0136] a memory for storing a computer program; and

[0137] A processor is configured to implement the steps of any one of the control methods provided in embodiment 1 when executing the computer program.

[0138] The above description is only a preferred specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any technician familiar with the technical field, within the technical scope disclosed by the present invention, who makes equivalent replacements or changes based on the technical solution and inventive concept of the present invention, should be covered by the scope of protection of the present invention.

Claims

1. A high-temperature and high-pressure well shut-in control method, characterized in that: The steps include: S1: Build and train an LSTM model. S1 includes the following steps: S11: Construct a data set, each data in the data set includes shut-in vertical pressure P s , shut-in casing pressure P a , Bottom pressure P w , wellbore temperature T, shut-in time m; S12: Calculate the activation values of the input gate, forget gate, and output gate, and update the cell state C of the LSTM model t , calculate the output h t ; S13: Calculate the wellbore bottom pressure P w The rate of change of , updates the number of layers n of the LSTM model L and the number of neurons N h , update the cell state; S14: Modify h based on wellbore temperature and wellbore bottom pressure t ; S15: Set the learning rate θ for learning.

2. A high-temperature and high-pressure well shut-in control method according to claim 1, characterized in that: In S11, shut-in vertical pressure P s , shut-in casing pressure P a , Bottom pressure P w and wellbore temperature T are the input of the LSTM model, and the shut-in time m is the output of the LSTM model.

3. The high-temperature and high-pressure well shut-in control method according to claim 1, characterized in that: In S12, the activation values of the input gate, forget gate, and output gate are calculated using the following formula: i t =σ(W i ·[h t-1 ,x t ]+b i ) f t =σ(W f ·[h t-1 ,x t ]+b f ) the t =σ(W o ·[h t-1 ,x t ]+b o ) Among them, i t is the activation value of the input, f t is the activation value of the forget gate, o t is the activation value of the output gate, W i 、W f 、W o are the weight matrices of the input gate, forget gate, and output gate, respectively, b i 、b f 、b o are the bias vectors of the input gate, forget gate, and output gate, respectively. σ is the sigmoid activation function. t is the input of the current time step, h t-1 is the output of the previous time step.

4. A high-temperature and high-pressure well shut-in control method according to claim 3, characterized in that: In S12, the cell state C of the LSTM model is updated by the following formula t , calculate the output h t : h t =o t *tanh(C t ) Among them, C t is the cell state at the current time step, C t-1 is the cell state at the previous time step; Candidate status.

5. The high-temperature and high-pressure well shut-in control method according to claim 1, characterized in that: The S13 updates the number of layers n of the LSTM model through the following steps: L and the number of neurons N h : A131: Calculate the change in the loss value at the current time step, △L, using the following formula: ΔL=|L t -L t-1 | Among them, L t is the loss value calculated by the loss function at the current time step, L t-1 is the loss value calculated by the loss function at the previous time step; A132: Update the number of layers n of the LSTM model using the following formula L and the number of neurons N h : n L =n L +ΔL·λ1 N h =N h +ΔL·λ2 Among them, λ1 and λ2 are hyperparameters, which are calculated based on the bottom pressure P of the wellbore. w The rate of change is dynamically adjusted.

6. The high-temperature and high-pressure well shut-in control method according to claim 1, characterized in that: S3 includes the following steps to update the cell state of the LSTM model: B131: The dynamic gating weight of the LSTM model is calculated using the following formula to control whether the cell state at the current time step is weighted and updated by the wellbore bottom pressure data at the current time step: G t =σ(W g r t +b g ) Among them, W g is the weight matrix of the gating mechanism, b g is the bias term of the gating mechanism, r t is the wellbore bottom pressure P w The rate of change of , σ is the sigmoid activation function; B132: Update the cell state of the LSTM model using the following formula C t ′=G t ·C t +(1-G t )·C t-1 。 7. The high-temperature and high-pressure well shut-in control method according to claim 1, characterized in that: The S14 includes the following steps: S141: Calculate the wellbore temperature influence factor T using the following formula f , used to express the influence of wellbore temperature T on downhole fluid properties: T f =αT+β Among them, α and β are constants; S142: Calculate the corrected wellbore bottom pressure P using the following formula: adj : Where γ is the compressibility factor; S143: Correct h by the following formula t : h t ′=h t ·P adj 。 8. The high-temperature and high-pressure well shut-in control method according to claim 1, characterized in that: In S15, the learning rate θ is dynamically set by the following formula: m t =β1m t-1 +(1-β1)g t v t =β2v t-1 +(1-β2)g t 2 Among them, m t is the first-order moment, v t is the second-order moment, g t is the current gradient, β1 and β2 are the decay rates of the first-order moment and the second-order moment, and ò is a small constant used to prevent the denominator from being zero.

9. The high-temperature and high-pressure well shut-in control method according to claim 1, characterized in that: The following steps are also included: S2: When overflow occurs, shut down the well and obtain the shut-in vertical pressure P 10 to 15 minutes after shutting down the well s , shut-in casing pressure P a , Bottom pressure P w , wellbore temperature T; S3: Calculates the shut-in time m based on the LSTM model built in S1. When the shut-in time is reached, the mud pump is controlled to pump at a low rate to open the float valve in the drill string. S4: Obtain shut-in vertical pressure P s Or shut-in casing pressure P a , by shutting in the well and raising the pressure P s Or shut-in casing pressure P a Add the hydrostatic column pressure to calculate the formation pressure.

10. A high-temperature and high-pressure well shut-in control device, characterized in that: include: Memory for storing computer programs; as well as, A processor, configured to implement the steps of the control method according to any one of claims 1 to 9 when executing the computer program.

Citation Information

Patent Citations

  • Prediction method and system for safe well shutdown time used for drilling overflow

    CN108561119A

  • Well test interpretation method automatically adapting to different well test models, medium and equipment

    CN118606683A

  • Intelligent grading evaluation method for overflow risk in drilling process

    CN118779842A

  • Low-yield gas well intelligent intermittent opening real-time production dynamic prediction method

    CN118965158A