Academic Journal of Science and Technology ISSN: 2771-3032 | Vol. 8, No. 3, 2023 98 An Identification Method for Intelligent Prediction of Drilling Overflow Based on BiLSTM‐BP Neural Network Yuqian Zhou, He Zhang School of Mechatronic Engineering, Southwest Petroleum University, Chengdu, 610500, China Abstract: The prevention and control of overflow is an important task to ensure the safe and efficient development of oil and gas fields, and the traditional overflow monitoring methods have the defects of insufficient real-time and low reliability. This paper proposes an early overflow intelligent identification method based on BiLSTM-BP neural network to address the problems of insufficient real-time and low reliability of traditional monitoring means; the lack of downhole drilling measurement data affects the prediction accuracy of multi-source data fusion. Firstly, the input parameters of the model are optimized through correlation analysis; secondly, the hidden features and complex change laws in the overflow monitoring data are learned by using bi-directional long and short-term memory network to realize the repair of downhole missing data; finally, the BP neural network realizes the early overflow intelligent identification. The test set data and field test results of a test well in Bozhong oilfield show that the early overflow intelligent identification method based on BiLSTM-BP neural network constructed in this paper can realize the intelligent identification of early overflow using multiple monitoring parameters of surface integrated logging, high- precision flowmeter at the wellhead and downhole drilling, and the identification accuracy reaches 97.02%, which is 1.23% better than the existing model and It can identify the overflow more quickly while ensuring higher accuracy. It provides a key theoretical model for early overflow identification technology from traditional identification to intelligent identification. Keywords: Neural network; Multi-parameter fusion; Missing data prediction; Early identification. 1. Introduction In the process of oil and gas field exploration and development, overflow, as the most common downhole construction safety accident, is not only risky and sudden, but once it is not identified and effectively controlled in time, it can further lead to a series of malicious accidents, endangering the lives of people and property.[1-3] The safety of life and property is at risk. With the continuous development and popularization of big data and artificial intelligence, various intelligent oil and gas development technologies are gradually emerging.[4] The intelligent monitoring of overflow is also an indispensable part of oil and gas development technology research.[5] The intelligent monitoring of spills is also an integral part of the current research on oil and gas development technologies. Through the research of some scholars on the mechanism of overflow occurrence and the summary of field experience, we can determine whether an overflow has occurred with the help of a series of relevant signs. The traditional means of overflow monitoring is carried out through the research on the mechanism of overflow occurrence and the summary of field experience with the help of a series of relevant signs, which are mainly divided into three categories according to the source of monitoring parameters: surface monitoring, wellhead monitoring and downhole monitoring. When the overflow occurs, the characteristic patterns of change of the above three types of parameters are as follows. (1) The change pattern of comprehensive logging parameters on the surface: the tank volume increases, the hook load increases, the standpipe pressure changes, the drilling speed increases, the rate of penetration and weight- on-bit decreases, the gas changes, and the temperature, density and resistivity of the returned drilling fluid changes, (2) Wellhead flowmeter parameter change pattern: the drilling fluid outlet flow rate increases relative to the inlet flow rate, (3) Downhole monitoring with drilling: increase in downhole annulus pressure and downhole fluid temperature, and change in downhole drilling fluid resistivity. Comprehensive surface logging monitoring is to monitor and analyze the changes of integrated logging parameters such as the tank volume, hook load, standpipe pressure. Liang et al.[6] (2019) established an early intelligent diagnosis model of drilling overflow by using GA-BP after feature extraction of standpipe pressure (SPP) and casing pressure (CP) monitoring data, which reduced the error caused by single feature parameter selection and reduced the probability of overflow misclassification. Liang et al.[7] (2021) proposed a remote monitoring platform for overflow accidents, which optimized the diagnosis method of overflow accidents and established a random forest overflow accident identification and classification model based on the optimization of bat algorithm, which can optimize the optimal parameter combination and has the ability to handle a large number of eigenvalues. Wellhead monitoring is to monitor and analyze the change of drilling fluid outlet flow rate relative to the inlet flow rate, which increases when formation fluid intrudes into the wellbore. Liang et al.[8] (2019) proposed a dynamic clustering-based early-stage overflow intelligence warning model, which was established by using K-Means clustering algorithm after correction of the instantaneous outlet flow rate, overcoming the problems of lagging and low accuracy of the traditional spill monitoring methods. Downhole with-drilling monitoring is to monitor and analyze the changes of downhole with-drilling measurement parameters such as downhole annular pressure and downhole annular temperature. Deng et al.[9] (2018) proposed to propose an intelligent early-warning model of overflow based on stratified fuzzy expert system to achieve intelligent early- warning of drilling overflow using downhole parameter measurements. Liang et al.[10] (2020) proposed an optimized 99 structure of downhole annular flow electromagnetic measurement to improve the accuracy of downhole annular flow electromagnetic measurement system. The accuracy of surface monitoring data overflow identification technology is high, but the real-time performance is insufficient; the overflow identification technology relying on downhole drilling monitoring has good real-time performance, but due to transmission limitations, a single data source cannot accurately identify early overflows, so a multi-source information fusion method is proposed to improve the reliability of early overflow identification. The multi-source data fusion overflow identification is a high- level decision level fusion of the preferred monitoring parameters of surface integrated logging monitoring, wellhead flowmeter monitoring and downhole with-drilling monitoring through an intelligent identification method to fully utilize the advantages of various monitoring methods, reduce the accuracy requirements and information ambiguity of a single overflow monitoring method, and thus improve the reliability and timeliness of early overflow identification[11, 12] . Yin et al.[13] (2019) proposed a method that combines mud-log and well-log data to achieve downhole overflow monitoring in deepwater HTHP wells with a LM-BP neural network model established by genetic algorithm. Li et al.[14] (2022) proposed a new method for intelligent prediction of drilling overflow and Leakage based on multi-parameter fusion, using genetic algorithm to optimize a multilayer feedforward neural network and establish a GA-BP neural network drilling spill leakage prediction model based on multi-parameter fusion to predict spills by fusing data from multiple sources. However, in the process of downhole data acquisition, the influence of complex downhole environment on sensors and the excessively long data transmission distance of deep wells and ultra-deep wells will both lead to unstable monitoring data received at the surface, the change of missing data is random, and the monitoring data of downhole may have a single missing data at one moment and multiple missing data at the same moment, thus affecting the accuracy of overflow identification. In response to the above-mentioned problems of insufficient real-time and low reliability of traditional single monitoring means; missing downhole measurement data affects the prediction accuracy of multi-source data fusion , this paper proposes an intelligent identification method of early overflow based on BiLSTM-BP neural network, and uses two-way long and short-term memory units to learn the hidden features and complex change laws of monitoring data, and achieves downhole missing by predicting missing values The repaired data of downhole monitoring, surface logging monitoring and wellhead high-precision flowmeter are then input into the BP neural network. The test set data and field test verification results show that the BiLSTM-BP model proposed in this paper can achieve more timely and accurate monitoring and identification of overflows. 2. BiLSTM-BP Overflow Intelligent Recognition Model Establishment 2.1. Intelligent recognition model parameter setting There is a certain correlation between multiple monitoring parameters of overflow monitoring, so the correlation analysis of the conventional overflow monitoring parameters and the selection of parameters with higher correlation can greatly improve the accuracy of the predicted restoration of the missing data. 𝜌 𝐸 𝑋1𝑋2 𝐸 𝑋1 𝐸 𝑋2 𝐸 𝑋1 2 𝐸2 𝑋1 𝐸 𝑋2 2 𝐸2 𝑋2 (1) where 𝑋 denotes the different monitoring parameters required for the preferred overflow monitoring,𝐸 ∙ denotes the mathematical expectation of the relevant monitoring parameters. For correlation analysis of monitoring parameters for overflow identification, the historical data of the relevant monitoring parameters are substituted into Eq. (1) The Pearson correlation coefficients of the monitoring parameters and the selected downhole monitoring parameters are calculated separately. Based on the analysis of the overflow mechanism, the downhole annular pressure, downhole fluid temperature and downhole fluid resistivity are selected as downhole monitoring parameters in order to exclude the interference of other factors on the overflow identification, and the final correlation results of each monitoring parameter are shown in Fig. 1. Figure 1. Correlation analysis of overflow identification monitoring parameters In Fig. 1, the 𝑥 is the " weight-on-bit ", 𝑥 is the " standpipe pressure ", 𝑥 is the " tank volume ", 𝑥 is "gas", 𝑥 is the " drilling rate ", 𝑥 is " downhole annular pressure ", 𝑥 is " downhole fluid resistivity ", 𝑥 is " downhole fluid temperature ", 𝑥 is the "drilling fluid outlet flow ". From the correlation analysis results, we can see that the standpipe pressure, tank volume, gas, drilling fluid outlet flow and the preferred DOWNHOLE monitoring parameters have high correlation. When the downhole monitoring parameters do not disappear at the same time, the normal monitoring downhole parameters are preferred for repair; when the downhole instrument loses signal, the above-mentioned data with higher correlation are selected for repair, which can improve the repair of missing downhole data accuracy. 2.2. Intelligent recognition model data repair layer Long Short Term Memory Network (LSTM)[15] is a type 100 of recurrent neural network (RNN). the RNN model requires back propagation after the forward propagation is completed, which is prone to gradient disappearance and gradient explosion problems when faced with deep training layers. the LSTM model is improved by introducing cell statesC_t , forgetting gatef_t , a memory gatei_t and output gatesO_t to maintain and control the information, which reduces the possibility of gradient disappearance and gradient explosion, and can deal with the long-term dependence problem well while dealing with the short-term dependence problem[16] . x + x tanh tanh σ  σ  σ  x xt ht‐1 ht ct‐1 ct Cell Vectors C Forget  Gate F fi it Input Gate I ot Output Gate O Figure 2. Long- and short-term memory network model The LSTM model continuously corrects the model output by means of forgetting gates, memory gates and output gates. The forgetting gate serves to control the retention and discard of information from the previous moment and is calculated as follows. 𝑓 𝜎 𝑊 ∙ ℎ , 𝑥 𝑏 (2) where𝑥 denotes the input at the current moment, andℎ denotes the output of the model at the previous moment, and𝑊 is the weight matrix of the forgetting gate, and𝑏 is the bias term of the forgetting gate, and𝜎 is the sigmoid activation function, which takes values in the range of [0,1]. The role of the input gate is to control the updated input information, which is calculated as follows. 𝑖 𝜎 𝑊 ∙ ℎ , 𝑥 𝑏 (3) 𝑐 tanh 𝑊 ∙ ℎ , 𝑥 𝑏 (4) where𝑐 is the cell state candidate value, the𝑊 and𝑏 are the weight matrix and bias terms of the input gates, and𝑊 and𝑏 are the weight matrices and bias terms of the cell state candidates. Current moment cell state𝑐 by the forgetting gate𝑓 , input gate 𝑖 , cell state candidates 𝑐 and the cell state at the previous moment𝑐 which is jointly determined by the following equation. 𝑐 𝑖 𝑐 𝑓 𝑐 (5) The role of the output gate is to control the output of information in the cell state at the current moment, calculated as follows. 𝑜 𝜎 𝑊 ∙ ℎ , 𝑥 𝑏 (6) ℎ 𝑜 tanh 𝑐 (7) where𝑊 and𝑏 are the weight matrix and bias terms of the output gate, andℎ is the output of the LSTM model at the current moment. Although the LSTM model solves the shortcomings of the RNN model in dealing with long-term dependency problems, in practical applications, the state of the current moment is jointly determined by the state of the previous moment and the state of the next moment, so a bidirectional long and short- term memory network (BiLSTM) is proposed[17] which is an improved structure of LSTM, including two parts of forward LSTM and backward LSTM, can extract the bidirectional features of time series data from both forward and backward directions[18] to obtain better results. In order to achieve efficient and accurate downhole missing data restoration, BiLSTM is selected as the feature extraction layer, and LSTM in both positive and negative directions are constructed to capture the complex variation patterns between the overflow identification monitoring parameters and downhole monitoring parameters, and the input features are the seven overflow identification monitoring parameters preferentially selected in the previous section, and the proposed model diagram is shown in Fig. 3. 2x 3x 4x 5x1x 7x6x LSTM LSTM LSTM LSTM LSTM LSTM LSTM LSTM LSTM LSTM LSTM LSTM LSTM LSTM 2y 3y 4y 5y1y 7y6y ' ic 0c ic ' 0c Figure 3. Schematic diagram of downhole data repair layer In Fig. 3,𝑥 and𝑦 represent the input features and output features of the proposed network model at a certain moment, respectively.𝑐 ,𝑐 and𝑐 , 𝑐 are the input and output states in the cell of the bidirectional LSTM unit. The downhole data restoration layer extracts temporal features by extracting the seven input feature parameters in both forward and backward directions according to Eq. (2) ~Eq. (7) After training, we obtain. ℎ⃗ 𝑙𝑠𝑡�⃗� 𝑔 (8) ℎ⃖ 𝑙𝑠𝑡𝑚⃖ 𝑔 (9) Then the repair prediction for downhole missing data at moment t can be expressed as 𝑦 𝜎 𝜔ℎ 𝜔 ℎ (10) Where 𝜎 ∙ is the activation function of the proposed model, the ℎ and ℎ denotes the output of the forward and reverse bi-directional LSTM units, and𝜔 and𝜔 denotes the weights. The proposed model fills in the missing data of 101 downhole by the predicted values after fully learning the hidden features and change patterns before the missing data. 2.3. Intelligent recognition model classification layer BP neural network algorithm is a multilayer feedforward neural network algorithm that back propagates by output error, and achieves prediction and classification of data by training a complex and nonlinear network structure. The algorithm model mainly includes input layer, hidden layer and output layer, and its structure is schematically shown in Fig. 4. i1 in h1 h2 h3 o1 o2 hn Intput Layer Hidden Layer Output Layer ... ... Figure 4. Schematic diagram of BP neural network structure The BP neural network model is selected for the classification layer of the overflow intelligent recognition. The parameters of the model input neurons are the parameters of the overflow intelligent recognition after the missing data repair output from the downhole data repair layer, so the number of input neurons is seven; the output neuron is one, which is the risk of overflow occurrence. Before training the BP neural network, the missing data repair prediction results from the downhole data repair layer are first normalized by Z-Score and then input into the BP neural network model, which can speed up the training process, improve the model accuracy and prevent the neural network gradient explosion.[19] The Z-Score normalization formula is as follows. 𝑧 (11) Among them, the 𝑦 and 𝑠 are the mean and sample standard deviation of the data set, respectively. 𝑦 ∑ (12) 𝑠 ∑ 𝑦 𝑦 (13) The activation function selects the ReLU function with relatively fast convergence, which is characterized by the output value equal to the input value when the input signal is greater than 0. When the input signal is less than 0, the output value is always 0. Therefore, the overflow data is calibrated as positive. The number of hidden layers and the number of neurons directly determine the recognition ability and training learning rate of the model, too many hidden layers will lead to overfitting and too few layers will reduce the recognition ability of the model.[20] Too many layers will lead to overfitting and too few layers will reduce the recognition ability of the model; too many neurons will increase the computational power of the model and lead to low recognition efficiency, while not enough neurons will affect the recognition accuracy.[21] The number of nodes in the hidden layer is mainly determined empirically. The number of nodes in the hidden layer is determined empirically, and the empirical formula is shown as follows (14). 𝑛 𝑥 𝑦 𝑎 (14) Among them 𝑛 , 𝑥 and 𝑦 are the number of nodes in the hidden layer, the input layer and the output layer, respectively.𝑎 is a random integer between 1 and 10. Through continuous experiments and adjusting the network structure, it was found that when the number of implicit layers of the model was 1 and 2, the SSE of the model was larger and the accurate recognition of overflow could not be achieved; with the increase of the number of implicit layers, the SSE of the model kept decreasing, and when the number of implicit layers reached 4 layers and the number of nodes was 13, the accuracy rate of the model was basically the same as that when the number of implicit layers was 3 layers and the number of nodes was 10, and the number of layers and nodes of the implicit layers The increase of the number of layers and nodes of the hidden layer will increase the amount of operations of the model, and also prone to overfitting phenomenon, so the overflow intelligent recognition classification layer neural network model with 3 layers of hidden layer and 10 nodes is constructed as shown in Fig. 5. z7z6z5z4z3z2z1 H1,10H1,2H1,1 ... H2,10 H2,2H2,1 ... H3,10 H3,2H3,1 ... O Early intelligent  identification of overflow Hidden  Layer 3 Hidden  Layer 2 Hidden  Layer 1 Figure 5. Neural network model of overflow intelligent recognition classification layer 2.4. Intelligent recognition model establishment based on BiLSTM-BP overflow The proposed BiLSTM-BP neural network based early overflow intelligent identification model is shown in Fig. 6. The input layer contains seven nodes representing standpipe pressure, tank volume, gas, drilling fluid outlet flow, downhole annular pressure, downhole fluid temperature and downhole fluid resistivity; the output layer has only one node representing the probability of overflow occurrence . The selected parameters are input into the BiLSTM model in time to learn the change law of the data before and after the missing values in the parameters, and the missing values in the downhole measurement parameters are repaired by using prediction, and finally the repaired data are input into the BP neural network model to complete the early intelligent 102 identification of overflow. For the output of the output node, probabilities are used to determine the magnitude of the risk of an overflow occurring downhole. The higher the output value, the higher the risk of overflow occurring, and triggers an alarm alert when the upper warning value is exceeded. The data of  comprehensive logging  unit The data of PWD The data of  high‐precision  flowmeter at the wellhead Parameter Preferences LSTM LSTM LSTM LSTM LSTM LSTM LSTM LSTM LSTM LSTM LSTM LSTM LSTM LSTM y1 y2 y3 y4 y5 y6 y7 x7x6x5x4x3x2x1 Z‐Score Normalization z7z6z5z4z3z2z1 ... ... ... O Early intelligent identification  of overflow Figure 6. Early overflow intelligent recognition model 3. Case studies and Field Applications In order to verify the effectiveness of the proposed method, monitoring data from a test well were used for its experimental validation. The total sampling time of the selected monitoring parameters was about one year. Among them, 55,000 complete data were screened for model training and validation. Due to the large amount of data recorded, only a few sample data sets were selected here, as shown in Table 1. Table 1. Sample model input parameters Serial number Well depth (m) Stand Pipe Pressure (MPa) Tank Volume Change (m³) Gas (ppm) Outlet Flow (L/min) Downhole annulus pressure (MPa) Downhole Fluid Temperature (℃) Downhole Fluid Resistivity (Ω·M) 1 2973.9 11.39 67.03 6682 3280.03 37.122 58 1.753 2 3444.6 11.12 57.82 2201 3567.69 37.276 79 6.372 3 3383 14.66 57.96 3795 3570.75 37.172 76 5.87 4 3051 14.14 58.03 874 3565.77 33.24 77 1.201 5 3103.8 6.49 59.25 703 2777.35 31.04 76 2.514 6 2250.7 10.78 63.95 1438 3351.64 24.392 50 3.71 7 3183.7 20.57 80.42 1807 3670 30.78 76 1.944 8 3355.3 14.93 56.2 4357 3515.91 39.62 80 6.609 9 3310.1 14.75 56.16 4245 3565.22 35.96 79 9.918 3.1. Downhole missing data prediction analysis To verify the effectiveness of the proposed model in predicting the restoration of downhole missing data, a training model sample size of 55000 12 and a test sample of 5000 12 were used. The selected monitoring parameters were all complete data, and the test data were assumed to be partially missing during testing, and the quantitative evaluation was performed by the standardized root mean square error NRMSE of the true and predicted restoration values. Taking downhole drilling fluid resistivity as an example, the model inputs are standpipe pressure, tank volume, full hydrocarbon, downhole annulus fluid temperature and downhole annulus pressure, and the model output is downhole drilling fluid resistivity. The BiLSTM model is set with Epochs of 300, time steps of 20, Batch Size of 64, and LSTM cells of 7. All the training data samples are input into the model first, and the test data are input after the training is completed, and the NRMSE value of the test data is 21.306 10 . The prediction results of the missing values of 200 groups of model outputs are 103 randomly selected in the test set and compared with the real values. The results are shown in Fig. 7~10 below. The two curves represented by red in them fit well with the true value represented by blue, and the model outputs a small error between the predicted and true values of the missing data, so the model can be used to fill in the predictions of the downhole missing data and provide reliable and complete data for the subsequent intelligent identification of the overflow. Figure 7. Downhole annular pressure prediction chart Figure 8. Downhole fluid temperature prediction chart Figure 9. Downhole fluid resistivity prediction chart Figure 10. Downhole fluid resistivity prediction chart 3.2. Test set data validation In order to verify the early warning capability of the early overflow intelligent recognition model, 5000 sets of complete data before the overflow occurred were selected from a test well monitoring data as the test set in the previous paper, and the test data were assumed to be partially missing during the test, and the data were input into four neural network models, BiLSTM-BP, BP, GA-BP and SVM, for test set verification after standardized processing, and exceeding the upper alarm value then triggers the overflow alarm, and some of the identification comparison results are shown in Fig. 11. Figure 11. Test set data validation Through data playback, this test set data showed an abnormal resistivity of downhole drilling fluid at group 338, 104 and the tank volume showed an upward trend, which was identified as oil intrusion. As shown in Fig. 8, the BiLSTM- BP neural network model started to rise at group 321, ahead of the other three neural network models that monitored the data anomalies and successfully identified the overflow. The accuracy and loss value comparison results of the above four neural network models are shown in Fig. 12. From the accuracy comparison results, it can be seen that each model can achieve a certain accuracy rate as the number of iterations increases, and starts to converge when the number of iterations reaches 25. The loss value comparison graph shows that the final loss values are BiLSTM-BP, GA-BP, BP and SVM models in the order of smallest to largest. Figure 12. Accuracy and loss values The dichotomous classification results verified by the data of this test set are shown in Fig. 13, and the horizontal and vertical coordinates are predicted labels and true labels, respectively. From the Fig., it can be obtained that there are 33 times that the normal class is incorrectly classified into the overflow class and 27 times that the overflow class is incorrectly classified into the normal class, and the overall accuracy of the test reaches 97.02%. Figure 13. Confusion matrix of binary classification Through the test set data verification, the early overflow intelligent identification model proposed in this paper effectively improves the speed and accuracy of overflow identification compared with other three commonly used neural network models often data. In order to further verify the early warning effect of the early overflow intelligent recognition model, the model is applied to a test well for experimental verification. 3.3. Field test verification Based on the well site conditions of this test well and the need for real-time acquisition of the model, a more appropriate field test verification scheme was developed, as shown in Fig. 14. 105 Getting data  into the queue The data of  PWD The data of  comprehensiv e logging unit The data of  High precision  flow meter at  the wellhead Receive data Getting data  into the queue Is the queue  length correct? Continue to  collect data No Is the queue  length correct? Continue to  collect data No Data  transmission Data  transmission Yes Yes TCP USART process data  and call the  model The Identify  Results of  overflow Figure 14. Field verification flow chart During the field test verification, the integrated logging data and downhole data were sent via TCP using the field integrated logger in WITS standard format, and the flowmeter data were transmitted via serial port. After receiving the data, the early overflow intelligent identification model performs analysis and calculation to finally feedback the overflow identification results, and some of the overflow identification results are shown in Fig. 15 and 16. By comparing the results of the model field test with the logging report for the same time period on the day of the test well, it was found that As shown in Fig. 12, the model reached the upper warning value and alarm at t=138 s. The logging report showed that the test well experienced gas intrusion at t=173 s. The full hydrocarbon content increased and the model monitored the anomaly manually at the drilling site in advance. As shown in Fig. 13, the model started to increase the probability of overflow at t=151 seconds and reached the upper warning value and alarm at t=167 seconds, which lasted for 5 seconds and then dropped back to below the upper warning value and lifted the risk of overflow at t=202 seconds; it is assumed from the analysis of the logging report that the probability of overflow increased due to the abnormal standpipe pressure and the increase in downhole annular pressure caused by the insufficient drilling fluid density. The model reached the upper warning value and alarmed due to the change in standpipe pressure and resistivity of the downhole annulus caused by the increase in the volume of the tank, which led to the increase in the probability of overflow, and the subsequent weighted drilling fluid to balance the formation pressure. Figure 15. Field verification (1) Figure 16. Field verification (2) In actual engineering applications, the model can be trained in advance through the historical data of adjacent blocks, and the corresponding weight coefficients of the model can be saved after the training is completed, while the corresponding 106 interface is written and encapsulated, and the real-time relevant data can be directly accessed for early overflow intelligent identification when used, which improves the level of well control safety monitoring to a certain extent and relieves the burden of field technicians. 4. Summary In this paper, an early overflow intelligent identification method based on BiLSTM-BP neural network is proposed to address the problems of insufficient real-time and low reliability of the traditional single monitoring means when the existing overflow monitoring technology is monitored; the missing downhole measurement data affects the prediction accuracy of multi-source data fusion, etc. The BiLSTM neural network model is used to learn the complex change law between the overflow identification monitoring parameters and downhole monitoring parameters, to realize the repair of downhole missing data by predicting the missing values when downhole data are missing, and to predict the overflow risk using the BP neural network model, and to alarm according to the set upper overflow risk threshold. Through the test set data validation and field test verification, the BiLSTM-BP neural network model results match well with the actual measured results, and the overall accuracy of the test is 1.23% higher than the existing model, and it can identify the overflow more quickly while ensuring a higher accuracy, which proves the accuracy and timeliness of the BiLSTM-BP neural network model in the early overflow intelligent identification. The use of BiLSTM-BP neural network model for early overflow intelligent identification can provide an important guarantee for the safe and efficient development of oil and gas fields, provide a key theoretical model for early overflow identification technology from traditional identification to intelligent identification, and have positive significance for improving the level of well control safety monitoring and reducing drilling safety risks. References [1] Liang, H.;Liu, G.;Gao, J.;Khan, M.J..Overflow remote warning using improved fuzzy c-means clustering in IoT monitoring system based on multi-access edge computing[J].Neural Computing and Applications,2019,Vol.32(19): 1-12. [2] Gao, YH (Gao, Yonghai);Chen, Y (Chen, Ye);Zhao, XX (Zhao, Xinxin);Wang, ZY (Wang, Zhiyuan);Li, H (Li, Hao);Sun, BJ (Sun, Baojiang).Risk analysis on the blowout in deepwater drilling when encountering hydrate_bearing reservoir. [J]. Ocean Engineering,2018,Vol.170: 1-5. [3] Wei, L.;Yang, X.;Xi, C.;Hong, C.;Yumin, L.;Xueqing, L..Research and application of downhole blowout prevention system while drilling: A review(Review)[J].Journal of Petroleum Science and Engineering,2020,Vol.188: 106882. [4] Abimbola, M.;Khan, F.;Khakzad, N..Dynamic safety risk analysis of offshore drilling(Article)[J].Journal of Loss Prevention in the Process Industries,2014,Vol.30(1): 74-85. [5] Zhang, Zhi;Sun, Baojiang;Wang, Zhiyuan;Pan, Shaowei;Lou, Wenqiang;Sun, Dalin.Intelligent well killing control method driven by coupling multiphase flow simulation and real-time data. [J]. Journal of Petroleum Science & Engineering, 2022, Vol.213: 110337. [6] Liang, Haibo, (secondbo@126.com);Zou, Jialing;Liang, Wenlong.An early intelligent diagnosis model for drilling overflow based on GA–BP algorithm[J].Cluster Computing, 2019, Vol.22(5): 10649-10668. [7] Haibo Liang; Haochen Han; Pengbo Ni; Yingjun Jiang. Overflow warning and remote monitoring technology based on improved random forest [J]. Neural Computing and Applications, 2021, Vol.33(9): 4027-4040. [8] Liang, Haibo, (secondbo@126.com) Li, Guoliang Liang, Wenlong.Intelligent early warning model of early-stage overflow based on dynamic clustering.[J].Cluster Computing, 2019, Vol.22(1): 481-492. [9] Deng, H.X.;Wei, G.H.;Li, J.L.;Ge, L.;Lai, X.;Huang, Q..An overflow intelligent early-warning model based on downhole parameters measurement [J]. Proceedings of the SPIE, 2018, Vol.10836: 1083624. [10] Liang Ge;Dan Li;Qi Huang;Guiyun Tian;Guohui Wei;Junaid Ahmed.Electrodes Optimization of an Annular Flow Electromagnetic Measurement System for Drilling Engineering [J]. IEEE Access, 2020, Vol.8: 138481-138492. [11] Wan Yi;Wei Liu;Jiasheng Fu;Lili He;Xiaosong Han.An Improved Transformer Framework for Well-Overflow Early Detection via Self-Supervised Learning [J]. Energies, 2022, Vol.15 (8799): 8799. [12] Xiangwei Lin,; Hongji Shi,; Xiaozhou Fan,; Jiaxin Wang,; Zhenyu Fu,; Yuqing Chen,; Siping Chen,;Xin Chen,and Mian Chen.Handheld interventional ultrasound/photoacoustic puncture needle navigation based on deep learning segmentation [J]. Biomedical Optics Express, 2023, Vol.14 (11): 5979-5993. [13] Qishuai Yin;Jin Yang;Ali Takbiri Borujeni;Shanshan Shi;Ting Sun;Yuming Yang;Yanan Geng;Qiang Xia;Xiaodong Wu;Xin Zhao.Intelligent Early Kick Detection in Ultra-Deepwater High-Temperature High-Pressure (HPHT) Wells Based on Big Data Technology[A].The 29th International Ocean and Polar Engineering Conference[C],2019. [14] Mu Li;Hengrui Zhang;Qing Zhao;Wei Liu;Xianzhi Song;Yangyang Ji;Jiangshuai Wang. A New Method for Intelligent Prediction of Drilling Overflow and Leakage Based on Multi-Parameter Fusion [J]. Energies, 2022,Vol.15(5988): 5988. [15] Alex Graves;Jürgen Schmidhuber.Framewise phoneme classification with bidirectional LSTM and other neural network architectures.[J].Neural networks : the official journal of the International Neural Network Society,2005,Vol.18: 602- 610. [16] Haibo Liang;Haifeng Chen;Jinhong Guo;Xing Zuo.Detection and Identification Method of Drilling Total Hydrocarbon Gas Based on Infrared Spectroscopy and KL+BP-RBF Algorithm [J]. IEEE Transactions on Instrumentation and Measurement, 2022, Vol.71: 1-10.