Well drilling leakage accident prediction method and device, electronic equipment and storage medium

Through BP neural network and simulated annealing algorithm, efficient and accurate prediction of drilling well leakage accidents is achieved, problems affected by subjective bias in the existing technology are solved, and safety and efficiency of drilling operations are improved.

CN119801475AActive Publication Date: 2025-04-11GUANGZHOU MARINE GEOLOGICAL SURVEY
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202411819871.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-11
Publication Date
2025-04-11
Estimated Expiration
2044-12-11

AI Technical Summary

Technical Problem

The existing technology is affected by expert subjective bias in the monitoring and judgment of drilling status and abnormal accidents, and it is difficult to achieve large-scale and systematic replication and application, which limits the improvement of efficiency and safety of drilling operations.

Method used

A method for predicting well leakage accidents by obtaining drilling data, segmenting it into test sets and verification sets, initializing the topology of the BP network, and optimizing network parameters through simulated annealing algorithm, training the BP network to achieve efficient and accurate prediction of well leakage accidents.

Benefits of technology

It improves the prediction accuracy of well leakage accidents, realizes adaptive optimization and enhanced generalization capabilities, dynamically adjusts the network structure to adapt to different drilling environments, and improves the safety and efficiency of drilling operations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119801475A_ABST
    Figure CN119801475A_ABST
Patent Text Reader

Abstract

The invention discloses a drilling well leakage accident prediction method and device, electronic equipment and a storage medium, and aims to obtain a more accurate well leakage prediction model by improving simulated annealing to find optimal parameters of a BP neural network. According to the well leakage prediction method based on the BP neural network, the intelligence level of accident early warning is remarkably enhanced based on the BP neural network. Moreover, the optimal parameters of the BP neural network are searched on the basis of an improved simulated annealing method, the network parameter adjustment process is automated, and the early warning precision is improved. Meanwhile, a test set and verification set double-track verification process is provided, support for multi-dimensional expansion of input data is enhanced, the applicability and generalization ability of the BP neural network model are guaranteed, and the method can be widely applied to the technical field of data processing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data processing, and in particular to a method, device, electronic equipment and storage medium for predicting a drilling leakage accident. Background Art

[0002] In the current technical solution, the monitoring and judgment of drilling status and abnormal accidents mainly rely on the subjective interpretation of real-time sensor data by experts, combined with their long-term experience accumulated at the drilling site. Although this method can achieve effective monitoring and judgment to a certain extent, it is inevitably affected by the subjective bias of experts, resulting in significant limitations in the judgment results.

[0003] At the same time, since the experience and knowledge at the drilling site often rely on the personal experience and intuition of experts, it is difficult to achieve large-scale, systematic replication and application. This not only limits the efficiency and safety of drilling operations, but also hinders the widespread dissemination and in-depth application of related technologies and knowledge. Summary of the invention

[0004] The present invention aims to solve the problem of related technical limitations at least to a certain extent. To this end, the present invention proposes a method, device, electronic device and storage medium for predicting well leakage accidents in drilling, which can efficiently and accurately predict well leakage accidents.

[0005] On the one hand, an embodiment of the present invention provides a method for predicting a drilling lost circulation accident, comprising:

[0006] Drilling data is obtained, and a test set and a validation set are obtained based on the drilling data segmentation; both the test set and the validation set include multiple sets of drilling feature data and whether a drilling leakage accident has occurred in each set of data;

[0007] Initialize the topological structure of the BP network and randomly generate network parameters corresponding to the topological structure;

[0008] Apply the network parameters to the BP network, and then use the test set to train the BP network to obtain the first network;

[0009] The F1 score of the first network is obtained by evaluating the training results based on the test set. When the F1 score is greater than the score threshold, the F1 score is used as the score threshold and the historical score of the next round, and the network parameters are used as the optimal parameters and historical parameters; otherwise, based on the F1 score and the historical score of the previous round, the acceptance probability of the network parameters is determined in combination with the preset temperature; when the acceptance probability meets the preset conditions, the F1 score is used as the historical score of the next round, and the network parameters are used as the historical parameters;

[0010] The number of iterations is increased by 1, the historical parameters are updated for the first time, the result of the first update is used as the network parameter, and the step of applying the network parameter to the BP network is returned to be executed until the number of iterations reaches the number threshold;

[0011] Perform attenuation processing on the preset temperature, set the number of iterations to 0, and return to the step of applying the network parameters to the BP network until the preset temperature reaches the temperature threshold;

[0012] Apply the optimal parameters to the BP network, and then use the validation set to train the BP network to obtain the second network;

[0013] The target F1 score of the second network is obtained by evaluating the training results based on the validation set. When the target F1 score does not meet the expected conditions, the topological structure of the BP network is updated for the second time, and the result of the second update is used as the topological structure of the BP network. The preset temperature is reset, and the step of randomly generating network parameters for the corresponding topological structure is returned to execute until the target F1 score meets the expected conditions, and the second network is applied to the prediction of well leakage accidents.

[0014] Optionally, the BP network includes an input layer, a hidden layer and an output layer; initializing the topological structure of the BP network includes the following steps:

[0015] The number of input neurons of the input layer of the BP network is set according to the number of features of the drilling feature data;

[0016] Based on the input quantity, the number of neurons in the hidden layer of the BP network is set through a preset quantity relationship; wherein the output number of neurons in the output layer is 1.

[0017] Optionally, the BP network includes an input layer, a hidden layer and an output layer, the topological structure includes the number of input neurons of the input layer, the number of neurons of the hidden layer and the number of output neurons of the output layer; the network parameters include weight parameters and threshold parameters; randomly generating network parameters corresponding to the topological structure includes the following steps:

[0018] The weight number of the weight parameter is determined according to the sum of the product of the number of inputs and the number of neurons and the product of the number of neurons and the number of outputs;

[0019] The threshold number of the threshold parameter is determined according to the sum of the number of neurons and the number of outputs;

[0020] The weight parameters of the weight quantity and the threshold parameters of the threshold quantity are randomly generated in a preset interval.

[0021] Optionally, the training result of the test set includes a lost circulation prediction result of each set of drilling characteristic data in the test set, and obtaining an F1 score of the first network based on the training result evaluation of the test set includes the following steps:

[0022] Compare the lost circulation prediction results and accident annotations corresponding to each set of drilling characteristic data in the test set;

[0023] According to the comparison result, the first number of samples correctly predicted as positive, the second number of samples incorrectly predicted as positive, and the third number of samples incorrectly predicted as negative are obtained; wherein the positive class indicates that the prediction result of well leakage is that well leakage occurs, and the negative class indicates that the prediction result of well leakage is that well leakage does not occur;

[0024] The F1 score of the first network is calculated based on the first sample number, the second sample number, and the third sample number.

[0025] Optionally, based on the F1 score and the historical score of the previous round, the reception probability of the network parameters is determined in combination with a preset temperature, including the following steps:

[0026] The index parameter is obtained according to the ratio of the difference between the previous round's historical score and the F1 score and the preset temperature;

[0027] The natural constant is used as the base, the exponential parameter is used as the exponent, and the reception probability of the network parameter is obtained by performing exponential operation based on the base and the exponent.

[0028] Optionally, performing a first update on the historical parameters includes the following steps:

[0029] Assign and update the value of each parameter in the historical parameters through a normally distributed random number;

[0030] The assignment update represents updating the corresponding parameter value by the sum of the parameter value and the random number;

[0031] When the result of the assignment update is greater than the first extreme value, the corresponding parameter value is replaced with the first extreme value;

[0032] When the result of the assignment update is less than the second extreme value, the corresponding parameter value is replaced with the second extreme value.

[0033] Optionally, the BP network includes an input layer, a hidden layer and an output layer; performing a second update on the topological structure of the BP network includes the following steps:

[0034] The number of neurons in the hidden layer is increased and adjusted by using integer random values ​​in a preset range.

[0035] On the other hand, an embodiment of the present invention provides a drilling lost circulation accident prediction device, comprising:

[0036] The first module is used to obtain drilling data and obtain a test set and a validation set based on the drilling data segmentation; the test set and the validation set both include multiple sets of drilling feature data and whether a drilling leakage accident has occurred in each set of data;

[0037] The second module is used to initialize the topological structure of the BP network and randomly generate network parameters corresponding to the topological structure;

[0038] The third module is used to apply the network parameters to the BP network, and then train the BP network using the test set to obtain the first network;

[0039] The fourth module is used to evaluate the training results of the test set to obtain the F1 score of the first network. When the F1 score is greater than the score threshold, the F1 score is used as the score threshold and the historical score of the next round, and the network parameters are used as the optimal parameters and historical parameters; otherwise, based on the F1 score and the historical score of the previous round, the acceptance probability of the network parameters is determined in combination with a preset temperature; when the acceptance probability meets the preset conditions, the F1 score is used as the historical score of the next round, and the network parameters are used as historical parameters;

[0040] The fifth module is used to increase the number of iterations by 1, perform a first update on the historical parameters, use the result of the first update as the network parameter, and return to execute the third module until the number of iterations reaches a threshold value;

[0041] The sixth module is used to perform attenuation processing on the preset temperature, set the number of iterations to 0, and return to execute the third module until the preset temperature reaches the temperature threshold;

[0042] The seventh module is used to apply the optimal parameters to the BP network, and then train the BP network using the verification set to obtain a second network;

[0043] The eighth module is used to evaluate the training results of the validation set to obtain the target F1 score of the second network. When the target F1 score does not meet the expected conditions, the topological structure of the BP network is updated for the second time, the result of the second update is used as the topological structure of the BP network, the preset temperature is reset, and the step of randomly generating network parameters for the corresponding topological structure in the second module is returned to execute until the target F1 score meets the expected conditions, and the second network is applied to the prediction of well leakage accidents.

[0044] On the other hand, an embodiment of the present invention provides an electronic device, including: a processor and a memory; the memory is used to store programs; the processor executes the program to implement the above-mentioned drilling leakage accident prediction method.

[0045] On the other hand, an embodiment of the present invention provides a computer storage medium, in which a program executable by a processor is stored. When the program executable by the processor is executed by the processor, it is used to implement the above-mentioned method for predicting a drilling leakage accident.

[0046] The embodiment of the present invention obtains drilling data, and obtains a test set and a validation set according to the segmentation of the drilling data; both the test set and the validation set include multiple groups of drilling feature data and whether a drilling leakage accident has occurred in each group of data; the topological structure of the BP network is initialized, and network parameters are randomly generated corresponding to the topological structure; the network parameters are applied to the BP network, and then the BP network is trained with the test set to obtain a first network; the F1 score of the first network is obtained based on the evaluation of the training result of the test set, and when the F1 score is greater than the score threshold, the F1 score is used as the score threshold and the historical score of the next round, and the network parameters are used as the optimal parameters and historical parameters; otherwise, based on the F1 score and the historical score of the previous round, the acceptance probability of the network parameters is determined in combination with a preset temperature; when the acceptance probability meets the preset condition, the F1 score is used as the historical score of the next round, and the network parameters are used as historical parameters; The number of times is increased by 1, the historical parameters are updated for the first time, the results of the first update are used as the network parameters, and the step of applying the network parameters to the BP network is returned to execute until the number of iterations reaches the number threshold; the preset temperature is attenuated, the number of iterations is set to 0, and the step of applying the network parameters to the BP network is returned to execute until the preset temperature reaches the temperature threshold; the optimal parameters are applied to the BP network, and then the BP network is trained using the validation set to obtain the second network; the target F1 score of the second network is obtained based on the training result evaluation of the validation set, and when the target F1 score does not meet the expected conditions, the topological structure of the BP network is updated for the second time, the result of the second update is used as the topological structure of the BP network, the preset temperature is reset, and the step of randomly generating network parameters for the corresponding topological structure is returned to execute until the target F1 score meets the expected conditions, and the second network is applied to the prediction of well leakage accidents. The beneficial effects of the present invention include:

[0047] Improve prediction accuracy: By adopting BP neural network and combining with test set for training, the present invention can effectively learn the complex relationship between drilling characteristics and lost circulation accidents, thereby improving the prediction accuracy of lost circulation accidents.

[0048] Adaptive optimization: This invention introduces an adaptive optimization mechanism based on the F1 score. When the F1 score of the network reaches or exceeds a certain threshold, the score and network parameters are automatically saved as the optimal result. Otherwise, the network parameters are updated based on the reception probability. This mechanism enables the network to continuously optimize itself during the training process to adapt to different drilling environments and conditions.

[0049] Enhanced generalization ability: By introducing the temperature decay mechanism in the simulated annealing algorithm, the present invention can gradually reduce the threshold of the reception probability during the training process, thereby encouraging the network to explore more parameter space and enhancing the generalization ability of the network, so that it can maintain a high prediction performance in different scenarios.

[0050] Dynamically adjust the network structure: If the target F1 score on the validation set does not meet the expected conditions, the present invention will dynamically adjust the topology of the BP network and retrain it. This mechanism ensures that the network structure can be optimized according to actual needs, further improving the prediction effect.

[0051] Efficient and practical: The present invention combines a variety of advanced machine learning and optimization technologies, which can efficiently process and analyze large amounts of drilling data, provide timely and accurate predictions of well leakage accidents for drilling operations, and thus improve the safety and efficiency of drilling operations. BRIEF DESCRIPTION OF THE DRAWINGS

[0052] The accompanying drawings are used to provide a further understanding of the technical solution of the present invention and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the technical solution of the present invention and do not constitute a limitation on the technical solution of the present invention.

[0053] Figure 1 A schematic diagram of an implementation environment for predicting a drilling leakage accident provided by an embodiment of the present invention;

[0054] Figure 2 A schematic diagram of a flow chart of a method for predicting a drilling leakage accident provided by an embodiment of the present invention;

[0055] Figure 3 A schematic diagram of an example of a topological structure of a BP neural network provided in an embodiment of the present invention;

[0056] Figure 4 A schematic diagram of the expansion process of initializing the topological structure of a BP network provided by an embodiment of the present invention;

[0057] Figure 5 A schematic diagram of an expanded flow chart of generating network parameters provided by an embodiment of the present invention;

[0058] Figure 6 A schematic diagram of an expanded flow chart of evaluating the F1 score of a first network provided by an embodiment of the present invention;

[0059] Figure 7 A schematic diagram of a process flow for performing a first update on historical parameters provided by an embodiment of the present invention;

[0060] Figure 8 A schematic diagram of the overall process principle of a method for predicting a drilling leakage accident provided by an embodiment of the present invention;

[0061] Fig. 9 A schematic diagram of the structure of a drilling leakage accident prediction device provided by an embodiment of the present invention;

[0062] Fig.10 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0063] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.

[0064] It should be noted that, although the functional modules are divided in the system schematic diagram and the logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than the module division in the system or the order in the flowchart. The terms "first / S100", "second / S200", etc. in the specification, claims and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.

[0065] Reference to "embodiments" in the present invention means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present invention. The appearance of the phrase in various places in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described in the present invention may be combined with other embodiments.

[0066] It is understandable that the method for predicting a drilling well leakage accident provided by an embodiment of the present invention can be applied to any computer device with data processing and computing capabilities, and this computer device can be various types of terminals or servers. When the computer device in the embodiment is a server, the server is an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms. Optionally, the terminal is a smart phone, a tablet computer, a laptop computer, a desktop computer, etc., but is not limited to this.

[0067] To facilitate the understanding of the technical solution of the present invention, the specific terms of the technical features that may appear in the embodiments of the present invention are first explained:

[0068] The simulated annealing algorithm is derived from solid annealing. It is a probability-based algorithm that heats the solid to a sufficiently high temperature and then slowly cools it. When heated, the particles inside the solid become disordered as the temperature rises, and the internal energy increases. When slowly cooled, the particles gradually become ordered and reach equilibrium at each temperature. The simulated annealing algorithm is a general optimization algorithm. In theory, the algorithm has probabilistic global optimization performance and has been widely used in engineering, such as VLSI, production scheduling, control engineering and other fields. The simulated annealing algorithm is an optimization algorithm that effectively avoids falling into local minima and eventually tends to the global optimum by giving the search process a time-varying probability jump that eventually tends to zero.

[0069] BP (back propagation) neural network is a multi-layer feedforward neural network trained according to the error back propagation algorithm. It is one of the most widely used neural network models. The process of BP neural network is mainly divided into two stages. The first stage is the forward propagation of the signal, from the input layer through the hidden layer, and finally to the output layer; the second stage is the back propagation of the error, from the output layer to the hidden layer, and finally to the input layer, and the weights and biases from the hidden layer to the output layer, and the weights and biases from the input layer to the hidden layer are adjusted in turn.

[0070] Reference Figure 3 , the following focuses on the input layer, hidden layer and output layer of the BP neural network. Input layer: data input of the BP neural network. The number of input layers depends on the number of input variables. Hidden layer: maps the data x from the input layer. Simply put, refer to the formula HiddenLayerOutput=F(w*x+b), where w and b are called weight and threshold parameters, and F() is the mapping rule, also called the activation function. In other words, the hidden layer maps the input influencing factor data x and generates a mapping value. There can be multiple hidden layers, and the number of neural networks in each hidden layer can also be customized. Output layer: the result output of the BP neural network. The number of output layers depends on the number of output variables. Simply put, refer to the formula, OutputLayerOutput=w*HiddenLayerOutput+b, where w and b are weight and threshold parameters. Gradient descent algorithm: by calculating the deviation between the output result and the y value passed in by the neural network model, the algorithm is used to adjust the parameters such as weights and thresholds accordingly.

[0071] In summary, for the BP neural network, the values ​​of weight w and threshold b are very important. The present invention does not use the commonly used gradient descent algorithm, but introduces a simulated annealing method to find the optimal weight w and threshold b, thereby improving the prediction accuracy of the BP neural network. This is the main starting point of the present invention.

[0072] Well leakage refers to the phenomenon that drilling fluid (commonly known as mud) accidentally leaks into the formation due to geological reasons or improper technical operation during the drilling process. Well leakage not only poses a pollution risk to the ecological environment, but may also cause serious consequences such as equipment damage and endangerment to the safety of operators. It may even cause the situation to deteriorate to a blowout, thereby triggering a chain reaction and ultimately causing the borehole to lose its function. Therefore, in drilling operations, it is extremely important to foresee the precursors of well leakage. In the early years, well leakage prediction was highly dependent on the subjective judgment made by technicians based on real-time data from sensors, which required technicians to have profound practical experience. However, manual judgment is inevitably affected by subjective bias and has limitations. In recent years, the leap in intelligent algorithm technology has brought innovation to this field. Domestic and foreign researchers have explored a variety of methods for predicting well leakage using intelligent algorithms. These technologies are more rigorous and the prediction accuracy is significantly improved. In order to further prevent well leakage events and reduce losses caused by drilling accidents, the present invention proposes an improved simulated annealing algorithm to optimize the BP neural network model to enhance the ability to predict well leakage.

[0073] K-fold cross-validation is a commonly used technique for evaluating the performance of machine learning models. The specific operation process is as follows: First, the entire dataset is evenly divided into K non-overlapping subsets (or "folds"), and each subset keeps the data distribution as consistent as possible to ensure that the proportion of samples in each category in each subset is similar. Next, K rounds of training and validation are performed. In each round: one subset is selected as the validation set, and the remaining K-1 subsets are combined as the test set. Repeating this for K rounds will result in K performance evaluation scores, and the average of these scores is usually taken as the final model evaluation indicator. The advantage of K-fold cross-validation is that it can better utilize all data for training and testing, providing valuable information about the stability and reliability of the model, while helping to avoid overfitting during model selection and parameter adjustment.

[0074] like Figure 1 FIG. 1 is a schematic diagram of an implementation environment provided by an embodiment of the invention. Figure 1 The implementation environment includes at least one terminal 102 and a server 101. The terminal 102 and the server 101 can be connected to a network wirelessly or wired to complete data transmission and exchange.

[0075] Server 101 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers. It can also be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), as well as big data and artificial intelligence platforms.

[0076] In addition, the server 101 can also be a node server in the blockchain network. Blockchain is a new application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, and encryption algorithm.

[0077] The terminal 102 may be a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, etc., but is not limited thereto. The terminal 102 and the server 101 may be directly or indirectly connected via wired or wireless communication, which is not limited in the embodiment of the present invention.

[0078] Based on the example Figure 1 In the implementation environment shown, an embodiment of the present invention provides a method for predicting a drilling well leakage accident. The following is explained using the example of the method for predicting a drilling well leakage accident applied to the server 101. It can be understood that the method for predicting a drilling well leakage accident can also be applied to the terminal 102.

[0079] Reference Figure 2 , Figure 2 A flowchart of a method for predicting a well leakage accident in a drilling well provided by an embodiment of the present invention and applied to a server. The execution subject of the method for predicting a well leakage accident in a drilling well can be any of the aforementioned computer devices (including a server or a terminal). Figure 2 , the method comprises the following steps:

[0080] S100, obtaining drilling data, and obtaining a test set and a validation set according to the drilling data;

[0081] Among them, both the test set and the validation set include multiple sets of drilling feature data and whether the drilling leakage accident has occurred in each set of data;

[0082] For example, in some specific implementations, the present invention can use drilling data mainly from domestic and foreign public data, multiple sets of data records collected from daily drilling reports, daily mud reports, completion reports and other materials, some of which indicate that lost circulation occurs during the drilling process, and some of which indicate that the drilling process is normal. Each set of data includes multiple characteristics such as lithology, pore size, porosity, pore pressure, fracture pressure, shear stress, gel strength, pump pressure, drill bit speed, primary fracture direction, and whether drilling lost circulation occurs under the data set.

[0083] The present invention can use the idea of ​​K-fold cross validation to split the test set and the validation set, where K can be customized and is generally about 5 to 10, and the value of K is evaluated according to the actual amount of data collected. First, K groups are obtained through K-fold cross validation, and generally VerifySize groups (VerifySize can be customized, generally 2) are randomly selected as the validation set, and the other K-VerifySize groups are used as the test set.

[0084] S200, initializing the topological structure of the BP network, and randomly generating network parameters corresponding to the topological structure;

[0085] It should be noted that the BP network includes an input layer, a hidden layer and an output layer; in some embodiments, such as Figure 4 As shown, initializing the topological structure of the BP network may include the following steps: S201, setting the input number of neurons in the input layer of the BP network according to the feature number of the drilling feature data; S202, based on the input number, setting the number of neurons in the hidden layer of the BP network through a preset quantitative relationship; wherein the output number of neurons in the output layer is 1.

[0086] Exemplarily, in some specific implementations, the BP neural network topology can be determined for each set of drilling data, for example, the data features are 10 features such as lithology, pore size, porosity, pore pressure, fracture pressure, shear stress, gel strength, pump pressure, drill bit speed, and primary fracture direction, that is, the input variables are 10 and the output variable is 1, that is, whether to send a well leakage accident. That is, the input layer of the BP neural network is 10 and the output layer is 1. The present invention uses a three-layer BP neural network, the activation function is the Sigmoid function, and there is an approximate relationship between the number of hidden layer neural networks n2 and the number of input layer neurons n1, refer to the following formula (i.e., the preset quantitative relationship):

[0087] n2=2*n1+1

[0088] Therefore, the BP neural network topology has 10 input layers, 21 hidden layers, and 1 output layer. At this time, the weight parameters w to be optimized are 10*21+21*1=231, and the threshold parameters b to be optimized are 21+1=22, that is, the optimization variables of simulated annealing search are 231+22=253.

[0089] It should also be noted that in some embodiments, the BP network includes an input layer, a hidden layer and an output layer, and the topological structure includes the number of input neurons in the input layer, the number of neurons in the hidden layer and the number of output neurons in the output layer; the network parameters include weight parameters and threshold parameters; Figure 5As shown, randomly generating network parameters corresponding to the topological structure may include the following steps: S203, determining the weight number of weight parameters according to the sum of the product of the number of inputs and the number of nerves and the product of the number of nerves and the number of outputs; S204, determining the threshold number of threshold parameters according to the sum of the number of nerves and the number of outputs; S205, randomly generating weight parameters of the weight number and threshold parameters of the threshold number in a preset interval.

[0090] For example, in some specific implementations, assuming that the current BP neural network topology has 10 input layers, n2 hidden layers, and 1 output layer, then the weight parameters w to be optimized are 10*n2+n2*1 in total, and the threshold parameters b to be optimized are n2+1 in total. Generally speaking, the value range of weight w and threshold b is [-1,1], and can also be flexibly adjusted according to actual conditions. The initialization of NewPara (i.e., network parameters) can be completed by random generation through the following formula, where R(-1,1) represents a random floating point number of [-1,1].

[0091] w i =R(-1,1),1≤i≤10*n2+n2*1

[0092] b i =R(-1,1),1≤i≤n2+1

[0093]

[0094] S300, applying the network parameters to the BP network, and then using the test set to train the BP network to obtain a first network;

[0095] For example, in some specific implementations, in the previous steps, a test set is obtained, the topological structure of the BP neural network is clarified, and the weight w and threshold b of the neural network are obtained. Then, the BP neural network model for leak prediction (i.e., the first network) can be obtained through training based on the test set data.

[0096] S400, obtaining an F1 score of the first network based on the training result evaluation of the test set, and when the F1 score is greater than the score threshold, using the F1 score as the score threshold and the historical score of the next round, and using the network parameters as the optimal parameters and historical parameters; otherwise, determining the acceptance probability of the network parameters based on the F1 score and the historical score of the previous round in combination with a preset temperature; when the acceptance probability meets the preset conditions, using the F1 score as the historical score of the next round, and using the network parameters as historical parameters;

[0097] It should be noted that the training results of the test set include the lost circulation prediction results of each set of drilling characteristic data in the test set. In some embodiments, Figure 6As shown, obtaining the F1 score of the first network based on the evaluation of the training results of the test set may include the following steps: S401, comparing the well leakage prediction results and accident annotations corresponding to each group of drilling feature data in the test set; S402, obtaining the first number of samples correctly predicted as the positive class, the second number of samples incorrectly predicted as the positive class, and the third number of samples incorrectly predicted as the negative class according to the comparison results; wherein the positive class characterizes the well leakage prediction result as the occurrence of well leakage, and the negative class characterizes the well leakage prediction result as the non-occurrence of well leakage; S403, calculating the F1 score of the first network based on the first number of samples, the second number of samples, and the third number of samples.

[0098] The score threshold is initially set to a smaller value so that the F1 score obtained in the first evaluation can be replaced smoothly and the subsequent iteration process can be smoothly implemented.

[0099] For example, in some specific implementations, each array group of the test set is input into the BP neural network model to obtain the predicted result, which is then compared with the actual result. This article uses the commonly used F1 score as the fitness function for evaluation. The F1 score is between [0,1]. The larger the score, the better the model performance. The calculation formula is as follows:

[0100]

[0101] Among them, True Positives indicates the number of samples correctly predicted as positive by the model; False Positives indicates the number of samples incorrectly predicted as positive by the model, but actually negative; False Negatives indicates the number of samples incorrectly predicted as negative by the model, but actually positive. The positive class is predicted as a well leakage accident, and the negative class is predicted as normal operation.

[0102] In general, the current test set is used as the benchmark, the current NewPara is used as the input, and the F1 score F1 of the output result is calculated. NewPara , which is the fitness function value.

[0103] Among them, in some embodiments, determining the reception probability of the network parameters based on the F1 score and the historical score of the previous round in combination with a preset temperature may include the following steps: obtaining an exponential parameter based on the ratio of the difference between the historical score of the previous round and the F1 score and the preset temperature; taking a natural constant as the base and the exponential parameter as the exponent, and performing an exponential operation based on the base and the exponent to obtain the reception probability of the network parameters.

[0104] For example, in some specific implementations, if the parameter variable NewPara found this time does not perform as expected, you can choose to accept NewPara with a certain probability. The probability formula is as follows, where NowTemp represents the current temperature (ie, the preset temperature) and gradually decreases.

[0105]

[0106] Then a [0,1] random probability randomProb is calculated. If acceptBadProb (i.e., the acceptance probability) is greater than randomProb, the new parameters are accepted according to the probability.

[0107] Here is an explanation of why this is done: In order to avoid falling into the local optimum, the simulated annealing algorithm will use a certain random probability to jump out of the current search range. This is why poor parameters are accepted with a certain probability. The calculation of this probability is related to the current temperature NowTemp.

[0108] S500, adding 1 to the number of iterations, performing a first update on the historical parameters, using the result of the first update as the network parameters, and returning to execute the step of applying the network parameters to the BP network until the number of iterations reaches the number threshold;

[0109] It should be noted that in some embodiments, Figure 7 As shown, the first update of the historical parameters may include the following steps: S501, assigning and updating each parameter value in the historical parameters by a normally distributed random number; wherein the assignment update represents updating the corresponding parameter value by the sum of the parameter value and the random number; S502, when the result of the assignment update is greater than the first extreme value, replacing the corresponding parameter value with the first extreme value; S503, when the result of the assignment update is less than the second extreme value, replacing the corresponding parameter value with the second extreme value.

[0110] For example, in some specific implementations, NewPara is generated based on CurrPara (i.e., historical parameters), and each parameter executes the following formula to complete the generation of new variables. Where normal(0,1) represents a normal distribution with a mean of 0 and a standard deviation of 1, and the obtained random number satisfies the normal distribution, thereby ensuring the fairness of the search.

[0111] NewPara i =CurrPara i +normal(0,1)

[0112] NewPara i = min(1, NewPara i )

[0113] NewPara i =max(-1,NewPara i )

[0114] Finally, the initialization of the parameter NewPara (ie, the first update) is completed.

[0115] S600. Decay the preset temperature, set the iteration count to 0, and return to execute the step of applying the network parameters to the BP network until the preset temperature reaches the temperature threshold.

[0116] Exemplarily, in some specific embodiments, the temperature decay can be implemented as follows: NowTemp represents the current temperature, initialized to MaxTemp (reset the preset temperature to MaxTemp as well, which can be customized, default is 100), and the minimum value is MinTemp (i.e., the temperature threshold, which can be customized, and MinTemp < MaxTemp, default is 1). The decay formula is as follows:

[0117] NowTemp = DecayRate * NowTemp

[0118] Where DecayRate represents the decay rate, and its value range is [0, 1), which can be customized, default is 0.99.

[0119] When NowTemp ≤ MinTemp, that is, the current temperature has reached the temperature lower limit, indicating that the optimal parameter value has been found, and at this time the entire simulated annealing search process ends.

[0120] S700. Apply the optimal parameters to the BP network, and then use the validation set to train the BP network to obtain a second network.

[0121] Exemplarily, in some specific embodiments, when reaching this step, that is, the entire simulated annealing process is completed, indicating that the optimal parameters BestPara (i.e., the optimal parameters) have been obtained.

[0122]

[0123] In the previous steps, a validation set was obtained, the structure of the BP network topology was determined, and the optimal parameters were obtained, that is, the neural network weights w and thresholds b have been adjusted to the optimal. Facing the validation set data, a well leakage prediction BP neural network model (i.e., the second network) is obtained through training.

[0124] S800. Evaluate the target F1 score of the second network based on the training results of the validation set. When the target F1 score does not meet the expected conditions, perform a second update on the topology of the BP network, use the result of the second update as the topology of the BP network, reset the preset temperature, and return to execute the step of randomly generating network parameters for the corresponding topology until the target F1 score meets the expected conditions, and then apply the second network to well leakage accident prediction.

[0125] It should be understood that the logical principle of the process of evaluating the target F1 score of the second network based on the training results of the validation set is consistent with the logical principle of the expanded process of evaluating the F1 score of the first network based on the training results of the test set, and will not be repeated here.

[0126] The expected condition may be set as a score threshold. When the target F1 score is greater than or equal to the score threshold, the expected condition is met; otherwise, the expected condition is not met.

[0127] It should be noted that the BP network includes an input layer, a hidden layer and an output layer; in some embodiments, a second update is performed on the topological structure of the BP network, including the following steps: increasing and adjusting the number of neurons in the hidden layer by an integer random value within a preset range.

[0128] For example, in some specific implementations, the second update of the topological structure can be implemented by randomly adjusting the number of hidden layers n2. The adjustment formula is as follows, where R(1,5) represents an integer random value of [1,5], that is, a few neural network units are added each time, thereby improving the prediction accuracy of the BP neural network.

[0129] n2=n2+R(1,5)

[0130] In order to explain the principle of the technical solution of the present invention in detail, the overall process of the present invention is described below in combination with some specific embodiments. It is easy to understand that the following is an explanation of the technical principle of the present invention and cannot be regarded as a limitation of the present invention.

[0131] First of all, it should be noted that the current technical solutions rely on subjective judgments made by experts based on real-time sensor data, combined with long-term accumulated drilling site experience to judge drilling status and abnormal accident alarms. However, manual judgment is inevitably affected by subjective bias and has great limitations. At the same time, relevant experience and knowledge are difficult to replicate and apply on a large scale.

[0132] The disadvantages of the existing technology include:

[0133] 1) Slow early warning response: The early warning mechanism that relies on manual judgment significantly reduces the efficiency of analysis, and the emergency response is not timely enough to meet the timeliness requirements.

[0134] 2) Limited dissemination of experience: Since early warning relies on personal work experience, relevant experience and knowledge are difficult to replicate and apply on a large scale.

[0135] 3) The difficulty of data analysis has increased dramatically: With the explosive growth of data volume and the rapid expansion of data dimensions, manual processing and analysis of data has become increasingly difficult.

[0136] In view of this, if Figure 8As shown, the present invention proposes a method for predicting drilling lost circulation accidents, and finds the optimal parameters of the BP neural network by improving simulated annealing, thereby obtaining a more accurate lost circulation prediction model. The method of the present invention can be implemented as follows:

[0137] Step 1: Get the test set and validation set. The drilling data used in this paper mainly comes from public data at home and abroad. Multiple sets of data records are collected from daily drilling reports, daily mud reports, completion reports and other materials. Some data show that the drilling process has lost circulation, and some data show that the drilling process is normal. Each set of data includes multiple characteristics such as lithology, pore size, porosity, pore pressure, fracture pressure, shear stress, gel strength, pump pressure, drill bit speed, primary fracture direction, and whether drilling loss has occurred in this set of data.

[0138] This article uses the idea of ​​K-fold cross validation to split the test set and the validation set, where K can be customized and is generally around 5 to 10. The value of K is evaluated based on the actual amount of data collected. First, K groups are obtained through K-fold cross validation. Generally, VerifySize groups (VerifySize can be customized, generally 2) are randomly selected as the validation set, and the other K-VerifySize groups are used as the test set.

[0139] Step 2: Update the BP network topology. This step mainly does two things: reset the simulated annealing parameters and update the BP network topology.

[0140] First, reset the parameters related to simulated annealing, including resetting the current temperature NowTemp to MaxTemp, resetting the number of inner loop iterations to 0, and so on.

[0141] The following is to determine the BP neural network topology. For each set of drilling data, the data features are 10 features such as lithology, pore size, porosity, pore pressure, fracture pressure, shear stress, gel strength, pump pressure, drill bit speed, and primary fracture direction. That is, there are 10 input variables and 1 output variable, that is, whether to send a well leakage accident. That is, the BP neural network has 10 input layers and 1 output layer. This article uses a three-layer BP neural network with a Sigmoid function as the activation function. There is an approximate relationship between the number of hidden layer neural networks n2 and the number of input layer neurons n1. Refer to the following formula:

[0142] n2=2*n1+1

[0143] Therefore, the BP neural network topology has 10 input layers, 21 hidden layers, and 1 output layer. At this time, the weight parameters w to be optimized are 10*21+21*1=231, and the threshold parameters b to be optimized are 21+1=22, that is, the optimization variables of simulated annealing search are 231+22=253.

[0144] When step 2 is executed for the first time, the network topology is 10-21-1. Each time step 2 is executed, the number of hidden layers n2 will be randomly adjusted. The adjustment formula is as follows, where R(1,5) represents an integer random value of [1,5], that is, a few neural network units will be added each time, thereby improving the prediction accuracy of the BP neural network.

[0145] n2=n2+R(1,5)

[0146] Step 3: Randomly generate new parameters. Assuming that the current BP neural network topology has 10 input layers, n2 hidden layers, and 1 output layer, there are 10*n2+n2*1 weight parameters w to be optimized, and n2+1 threshold parameters b to be optimized. Generally speaking, the value range of weight w and threshold b is [-1,1], which can also be flexibly adjusted according to actual conditions.

[0147] If step 3 is executed for the first time (CurrPara has not yet completed initialization), the following formula is used to randomly generate and initialize it, where R(-1,1) represents a random floating point number of [-1,1].

[0148] w i =R(-1,1),1≤i≤10*n2+n2*1

[0149] b i =R(-1,1),1≤i≤n2+1

[0150]

[0151] If step 3 is executed for the second time or later, NewPara is generated based on CurrPara, and each parameter executes the following formula to complete the generation of new variables. Normal(0,1) represents a normal distribution with a mean of 0 and a standard deviation of 1. The obtained random numbers satisfy the normal distribution, thus ensuring the fairness of the search.

[0152] NewPara i =CurrPara i +normal(0,1)

[0153] NewPara i = min(1, NewPara i )

[0154] NewPara i =max(-1,NewPara i )

[0155] Finally, the initialization of the parameter NewPara is completed, and go to step 4.

[0156] Step 4: Initialize BP neural network parameters. In step 1, the test set was obtained; in step 2, the topological structure of the BP neural network was determined; in step 3, the weight w and threshold b of the neural network were obtained. Based on the test set data, the BP neural network model for lost circulation prediction was obtained through training.

[0157] Step 5: Calculate the F1 score based on the BP neural network. Traverse each array group of the test set, input it into the BP neural network model, get the predicted results, and then compare them with the actual results. This article uses the commonly used F1 score as the fitness function for evaluation. The F1 score is between [0,1]. The larger the score, the better the model performance. The calculation formula is as follows:

[0158]

[0159] Among them, True Positives indicates the number of samples correctly predicted as positive by the model; False Positives indicates the number of samples incorrectly predicted as positive by the model, but actually negative; False Negatives indicates the number of samples incorrectly predicted as negative by the model, but actually positive. The positive class is predicted as a well leakage accident, and the negative class is predicted as normal operation.

[0160] In general, the current test set is used as the benchmark, the current NewPara is used as the input, and the F1 score F1 of the output result is calculated. NewPara , which is the fitness function value.

[0161] Step 6: The new parameters are better than the current parameters. If F1 NewPara >F1 BestPara , it means that the network model of NewPara performs better, go to step 7, otherwise go to step 8. Note that BestPara here is the parameter with the best performance of the BP network model so far.

[0162] Step 7: Receive new parameters. This means that better parameters have been found. Choose to update BestPara, F1 BestPara , CurrPara and F1 CurrPara . Refer to the following formula.

[0163] BestPara=NewPara

[0164] F1 BestPara =F1 NewPara

[0165] CurrPara=NewPara

[0166] F1 CurrPara = F1 NewPara

[0167] Step 8: Meet the acceptance probability (i.e., the reception probability). That is, the parameter variable NewPara found this time performs worse than expected. At this time, it is selected to accept NewPara with a certain probability. The probability formula is as follows, where NowTemp represents the current temperature and gradually decreases.

[0168]

[0169] Then calculate a random probability randomProb in the range [0, 1]. If acceptBadProb (i.e., the reception probability) is greater than randomProb, go to Step 9; otherwise, go to Step 10.

[0170] Here is an explanation of why this is done: In order to avoid being trapped in a local optimum, the simulated annealing algorithm will use a certain random probability to jump out of the current search range. This is the reason for accepting a worse parameter with a certain probability, and the calculation of this probability is related to the current temperature NowTemp.

[0171] Step 9: Accept the new parameter according to the probability. At this time, select to update CurrPara and F1 CurrPara , referring to the following formula.

[0172] CurrPara = NewPara

[0173] F1 CurrPara = F1 NewPara

[0174] Step 10: Meet the iteration upper limit. Steps 3 to 9 are the innermost loop. Each time it is executed, the iteration count is incremented by one. If the iteration count exceeds the maximum value MaxIterCnt (which can be customized, default is 100), go to Step 11; otherwise, go to Step 3.

[0175] Step 11: Decrease the temperature. After the innermost loop is executed, temperature decay is performed. NowTemp represents the current temperature, initialized to MaxTemp (which can be customized, default is 100), and the minimum value is MinTemp (which can be customized, and MinTemp < MaxTemp, default is 1). The decay formula is as follows:

[0176] NowTemp = DecayRate * NowTemp

[0177] where DecayRate represents the decay rate, with a value range of [0, 1), which can be customized, default is 0.99.

[0178] Step 12: Reach the temperature lower limit. Steps 3 to 11 are the loops of the intermediate layer. Each time it is executed, the temperature decays once. When NowTemp ≤ MinTemp, that is, the current temperature has reached the temperature lower limit, it means that the optimal parameter value has been found. At this time, the entire simulated annealing search process ends, go to Step 13, otherwise go to Step 3.

[0179] Step 13: Find the optimal BP neural network parameters. When reaching this step, that is, the entire simulated annealing process is completed, indicating that the optimal parameter BestPara has been obtained.

[0180]

[0181] Step 14: Initialize the BP neural network parameters. In Step 1, the validation set is obtained. In Step 2, the structure of the BP network topology is defined. In Step 13, the optimal parameter BestPara is obtained, that is, the neural network weights w and thresholds b have been adjusted to the optimal. Facing the validation set data, the BP neural network model for lost circulation prediction is obtained through training.

[0182] Step 15: Calculate the classification accuracy based on the BP neural network. At this time, the optimal BP neural network model for lost circulation prediction has been obtained. Traverse each array group of the validation set, input it into the BP neural network model to obtain the prediction result, and then compare it with the real result. Finally, calculate the F1 score F1 Verify 。

[0183] It should be noted that the F1 score is calculated based on the test set in Step 5, but here the F1 score is calculated based on the validation set.

[0184] Step 16: The classification accuracy meets the requirements. Steps 2 to 16 are the outermost loops. Whenever a BP neural network model for lost circulation prediction that meets the expectations is not found, it will start over. Only when the expected model is found will the entire process end. TargetF1 is a value in [0,1], which can be customized and defaults to 0.9, and is used to determine the optimal model. The logic is as follows:

[0185] If F1 Verify ≥TargetF1, it means that the verification result meets the expectations, that is, the BP neural network model for lost circulation prediction meets the expectations. At this time, go to Step 17 and the entire process ends.

[0186] If F1 Verify <TargetF1, it means that the verification result does not meet the expectations, and there is still room for optimization in the BP neural network model for lost circulation prediction. At this time, go to Step 2, reset the simulated annealing related parameters, update the BP neural network topology, re-find the optimal parameters, and the entire process starts over.

[0187] Step 17: Find the optimal BP neural network model. When this step is reached, it means that the BP neural network model for lost circulation prediction meets expectations, and the entire process is complete.

[0188] In summary, the present invention proposes a method for predicting drilling lost circulation accidents, and finds the optimal parameters of the BP neural network by improving simulated annealing, thereby obtaining a more accurate lost circulation prediction model. Compared with the prior art, the present invention has at least the following beneficial effects:

[0189] 1) A well leakage prediction method based on BP neural network was proposed. Relying on BP neural network, the intelligent level of accident warning was significantly enhanced.

[0190] 2) A method based on improved simulated annealing to search for the optimal parameters of the BP neural network was proposed, which automated the network parameter adjustment process and improved the accuracy of the early warning.

[0191] 3) A dual-track verification process of test set and validation set is proposed, which strengthens the support for multi-dimensional expansion of input data and ensures the applicability and generalization ability of the BP neural network model.

[0192] On the other hand, Fig. 9 As shown, an embodiment of the present invention provides a drilling leakage accident prediction device 900, which may include:

[0193] The first module 901 is used to obtain drilling data, and to obtain a test set and a validation set according to the segmentation of the drilling data; the test set and the validation set both include multiple sets of drilling characteristic data and whether a drilling leakage accident has occurred in each set of data;

[0194] The second module 902 is used to initialize the topological structure of the BP network and randomly generate network parameters corresponding to the topological structure;

[0195] The third module 903 is used to apply the network parameters to the BP network, and then train the BP network using the test set to obtain the first network;

[0196] The fourth module 904 is used to evaluate the training result of the test set to obtain the F1 score of the first network. When the F1 score is greater than the score threshold, the F1 score is used as the score threshold and the historical score of the next round, and the network parameters are used as the optimal parameters and historical parameters; otherwise, based on the F1 score and the historical score of the previous round, the reception probability of the network parameters is determined in combination with a preset temperature; when the reception probability meets the preset condition, the F1 score is used as the historical score of the next round, and the network parameters are used as historical parameters;

[0197] The fifth module 905 is used to increase the number of iterations by 1, perform a first update on the historical parameters, use the result of the first update as the network parameter, and return to execute the third module until the number of iterations reaches a threshold number;

[0198] The sixth module 906 is used to perform attenuation processing on the preset temperature, set the number of iterations to 0, and return to execute the third module until the preset temperature reaches the temperature threshold;

[0199] The seventh module 907 is used to apply the optimal parameters to the BP network, and then train the BP network using the verification set to obtain a second network;

[0200] The eighth module 908 is used to evaluate the training results of the validation set to obtain the target F1 score of the second network. When the target F1 score does not meet the expected conditions, the topological structure of the BP network is updated for the second time, the result of the second update is used as the topological structure of the BP network, the preset temperature is reset, and the step of randomly generating network parameters for the corresponding topological structure in the second module is returned to execute until the target F1 score meets the expected conditions, and the second network is applied to the prediction of well leakage accidents.

[0201] The contents of the method embodiments of the present invention are all applicable to the device embodiments. The functions specifically implemented by the device embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.

[0202] On the other hand, an embodiment of the present invention further provides an electronic device, the electronic device comprising a memory and a processor, the memory storing a computer program, and the processor implementing the above-mentioned hydrate stability region bottom boundary prediction method when executing the computer program. The electronic device can be any intelligent terminal including a tablet computer, a car computer, etc.

[0203] It can be understood that the contents of the above method embodiments are all applicable to the present device embodiments, the functions specifically implemented by the present device embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.

[0204] like Fig.10 As shown, Fig.10 The hardware structure of an electronic device 1000 of another embodiment is illustrated. The electronic device 1000 includes:

[0205] The processor 1001 may be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of the present invention.

[0206] The memory 1002 can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 1002 can store an operating system and other application programs. When the technical solution provided in the embodiment of this specification is implemented by software or firmware, the relevant program code is stored in the memory 1002, and the processor 1001 calls and executes the network node population optimization method of the embodiment of the present invention;

[0207] Input / output interface 1003, used to implement information input and output;

[0208] The communication interface 1004 is used to realize the communication interaction between the device and other devices. The communication can be realized through a wired manner (such as USB, network cable, etc.) or a wireless manner (such as mobile network, WIFI, Bluetooth, etc.);

[0209] A bus 1005 , which transmits information between various components of the device (e.g., the processor 1001 , the memory 1002 , the input / output interface 1003 , and the communication interface 1004 );

[0210] The processor 1001 , the memory 1002 , the input / output interface 1003 and the communication interface 1004 are connected to each other in communication within the device via the bus 1005 .

[0211] The electronic device embodiments described above are merely illustrative, and the units described as separate components may or may not be physically separated, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0212] The contents of the method embodiments of the present invention are all applicable to the electronic device embodiments. The functions specifically implemented by the electronic device embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.

[0213] Another aspect of an embodiment of the present invention further provides a computer-readable storage medium, wherein the storage medium stores a program, and the program is executed by a processor to implement the above method.

[0214] It should be noted that the computer-readable medium shown in the embodiment of the present invention may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disk read-only memory (Compact Disc Read to Only Memory, CD to ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, device or device. In the present invention, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer readable signal media may also be any computer readable medium other than computer readable storage media, which may send, propagate, or transmit programs for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.

[0215] The contents of the method embodiments of the present invention are all applicable to the computer-readable storage medium embodiments. The functions specifically implemented by the computer-readable storage medium embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.

[0216] The embodiment of the present invention also discloses a computer program product or a computer program, which includes a computer instruction stored in a computer-readable storage medium. A processor of a computer device can read the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device executes the above method.

[0217] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present invention. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0218] It should be noted that, although several modules of the device for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to an embodiment of the present invention, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into being embodied by multiple modules or units.

[0219] Through the description of the above implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation of the present invention can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD to ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a touch terminal, or a network device, etc.) to execute the method according to the implementation of the present invention.

[0220] In some selectable embodiments, the function / operation mentioned in the block diagram may not occur in the order mentioned in the operation diagram. For example, depending on the function / operation involved, the two boxes shown in succession can actually be executed substantially simultaneously or the boxes can sometimes be executed in reverse order. In addition, the embodiment presented and described in the flow chart of the present invention is provided by way of example, for the purpose of providing a more comprehensive understanding of the technology. The disclosed method is not limited to the operation and logic flow presented by the present invention. Selectable embodiments are expected, wherein the order of various operations is changed and the sub-operation of a part described as a larger operation is performed independently.

[0221] In addition, although the present invention is described in the context of functional modules, it should be understood that, unless otherwise specified, one or more of the functions and / or features can be integrated into a single physical device and / or software module, or one or more functions and / or features can be implemented in separate physical devices or software modules. It is also understood that a detailed discussion of the actual implementation of each module is unnecessary for understanding the present invention. More specifically, in view of the properties, functions and internal relationships of various functional modules in the device disclosed in the present invention, the actual implementation of the module will be understood within the conventional skills of engineers. Therefore, those skilled in the art can implement the present invention set forth in the claims without excessive experimentation using ordinary techniques. It is also understood that the specific concepts disclosed are merely illustrative and are not intended to limit the scope of the present invention, which is determined by the full scope of the appended claims and their equivalents.

[0222] If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods of each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.

[0223] The logic and / or steps represented in the flowchart or otherwise described herein, for example, may be considered as an ordered list of executable instructions for implementing logical functions, and may be embodied in any computer-readable medium for use by an instruction execution device, apparatus or device (such as a computer-based device, a device including a processor, or other device that can fetch instructions from an instruction execution device, apparatus or device and execute the instructions), or in conjunction with such instruction execution device, apparatus or device. For purposes of this specification, "computer-readable medium" may be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution device, apparatus or device, or in conjunction with such instruction execution device, apparatus or device.

[0224] More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or more wires (electronic device), a portable computer disk case (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), a fiber optic device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be a paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, deciphering or, if necessary, processing in another suitable manner, and then stored in a computer memory.

[0225] It should be understood that the various parts of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, a plurality of steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution device. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.

[0226] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "examples", "specific examples", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.

[0227] Although the embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the claims and their equivalents.

[0228] The above is a specific description of the preferred implementation of the present invention, but the present invention is not limited to the embodiments. Those skilled in the art can make various equivalent modifications or substitutions without violating the spirit of the present invention. These equivalent modifications or substitutions are all included in the scope defined by the claims of the present invention.

Claims

1. A method for predicting a drilling leakage accident, characterized in that: The following steps are involved: Acquire drilling data, and obtain a test set and a validation set according to the segmentation of the drilling data; the test set and the validation set both include multiple sets of drilling feature data and whether a drilling leakage accident occurs in each set of data; Initializing the topological structure of the BP network, and randomly generating network parameters corresponding to the topological structure; Applying the network parameters to the BP network, and then training the BP network using the test set to obtain a first network; The F1 score of the first network is obtained by evaluating the training result of the test set; when the F1 score is greater than a score threshold, the F1 score is used as the score threshold and the historical score of the next round, and the network parameters are used as the optimal parameters and historical parameters; otherwise, based on the F1 score and the historical score of the previous round, the reception probability of the network parameters is determined in combination with a preset temperature; when the reception probability meets a preset condition, the F1 score is used as the historical score of the next round, and the network parameters are used as the historical parameters; Add 1 to the number of iterations, perform a first update on the historical parameters, use the result of the first update as the network parameter, and return to execute the step of applying the network parameter to the BP network until the number of iterations reaches a threshold; Performing attenuation processing on the preset temperature, setting the number of iterations to 0, and returning to execute the step of applying the network parameters to the BP network until the preset temperature reaches a temperature threshold; Applying the optimal parameters to the BP network, and then training the BP network using the validation set to obtain a second network; The target F1 score of the second network is obtained by evaluating the training result of the validation set. When the target F1 score does not meet the expected conditions, the topological structure of the BP network is updated for a second time, and the result of the second update is used as the topological structure of the BP network. The preset temperature is reset, and the step of randomly generating network parameters corresponding to the topological structure is returned to be executed until the target F1 score meets the expected conditions, and the second network is applied to the prediction of well leakage accidents.

2. A method for predicting a drilling leakage accident according to claim 1, characterized in that: The BP network includes an input layer, a hidden layer and an output layer; the topological structure of the initialization BP network includes the following steps: Setting the number of input neurons of the input layer of the BP network according to the number of features of the drilling feature data; Based on the input quantity, the number of neurons in the hidden layer of the BP network is set through a preset quantity relationship; wherein the output number of neurons in the output layer is 1.

3. A method for predicting a drilling leakage accident according to claim 1, characterized in that: The BP network includes an input layer, a hidden layer and an output layer, the topological structure includes the input number of neurons in the input layer, the number of neurons in the hidden layer and the output number of neurons in the output layer; the network parameters include weight parameters and threshold parameters; the randomly generated network parameters corresponding to the topological structure include the following steps: Determine the weight number of the weight parameter according to the sum of the product of the number of inputs and the number of nerves and the product of the number of nerves and the number of outputs; Determine a threshold value of the threshold parameter according to the sum of the number of nerves and the number of outputs; The weight parameters of the weight quantity and the threshold parameters of the threshold quantity are randomly generated within a preset interval.

4. A method for predicting a drilling lost circulation accident according to claim 1, characterized in that: The training result of the test set includes the lost circulation prediction result of each group of the drilling characteristic data in the test set, and the F1 score of the first network is obtained by evaluating the training result of the test set, comprising the following steps: Comparing the lost circulation prediction result and the accident annotation corresponding to each group of the drilling characteristic data in the test set; According to the comparison result, the first number of samples correctly predicted as positive, the second number of samples incorrectly predicted as positive, and the third number of samples incorrectly predicted as negative are obtained; wherein the positive class indicates that the well leakage prediction result is that well leakage occurs, and the negative class indicates that the well leakage prediction result is that well leakage does not occur; The F1 score of the first network is calculated based on the first number of samples, the second number of samples, and the third number of samples.

5. A method for predicting a drilling lost circulation accident according to claim 1, characterized in that: The determining of the reception probability of the network parameters based on the F1 score and the historical score of the previous round in combination with a preset temperature comprises the following steps: Obtaining an index parameter according to a ratio of a difference between the historical score and the F1 score of the previous round and the preset temperature; The natural constant is used as a base, the exponential parameter is used as an exponent, and an exponential operation is performed based on the base and the exponent to obtain the reception probability of the network parameter.

6. A method for predicting a drilling lost circulation accident according to claim 1, characterized in that: The first updating of the historical parameters comprises the following steps: Assign and update each parameter value in the historical parameters by using a normally distributed random number; The assignment update characterizes that the corresponding parameter value is updated by the sum of the parameter value and the random number; When the result of the assignment update is greater than a first extreme value, the corresponding parameter value is replaced with the first extreme value; When the result of the assignment update is less than the second extreme value, the corresponding parameter value is replaced with the second extreme value.

7. A method for predicting a drilling lost circulation accident according to claim 1, characterized in that: The BP network includes an input layer, a hidden layer and an output layer; the second updating of the topological structure of the BP network includes the following steps: The number of neurons in the hidden layer is increased and adjusted by using integer random values ​​within a preset range.

8. A drilling leakage accident prediction device, characterized in that: include: The first module is used to obtain drilling data, and to obtain a test set and a validation set according to the segmentation of the drilling data; the test set and the validation set both include multiple sets of drilling feature data and whether a drilling leakage accident has occurred in each set of data; The second module is used to initialize the topological structure of the BP network and randomly generate network parameters corresponding to the topological structure; A third module is used to apply the network parameters to the BP network, and then train the BP network using the test set to obtain a first network; The fourth module is used to evaluate the training result of the test set to obtain the F1 score of the first network; when the F1 score is greater than the score threshold, the F1 score is used as the score threshold and the historical score of the next round, and the network parameters are used as the optimal parameters and historical parameters; otherwise, based on the F1 score and the historical score of the previous round, the reception probability of the network parameters is determined in combination with a preset temperature; when the reception probability meets a preset condition, the F1 score is used as the historical score of the next round, and the network parameters are used as the historical parameters; A fifth module is used to increase the number of iterations by 1, perform a first update on the historical parameters, use the result of the first update as the network parameter, and return to execute the third module until the number of iterations reaches a threshold number; The sixth module is used to perform attenuation processing on the preset temperature, set the number of iterations to 0, and return to execute the third module until the preset temperature reaches a temperature threshold; The seventh module is used to apply the optimal parameters to the BP network, and then train the BP network using the verification set to obtain a second network; The eighth module is used to evaluate the target F1 score of the second network based on the training result of the validation set. When the target F1 score does not meet the expected conditions, the topological structure of the BP network is updated for the second time, the result of the second update is used as the topological structure of the BP network, the preset temperature is reset, and the step of randomly generating network parameters corresponding to the topological structure in the second module is returned to execute until the target F1 score meets the expected conditions, and the second network is applied to the prediction of well leakage accidents.

9. An electronic device, characterized in that: including a processor and a memory; The memory is used to store programs; The processor executes the program to implement the method according to any one of claims 1 to 7.

10. A computer storage medium storing a program executable by a processor, characterized in that: The program executable by the processor is used to implement the method according to any one of claims 1 to 7 when executed by the processor.

Citation Information

Patent Citations

  • BP neural network-based pre-drilling mud leakage prediction method for complex well conditions

    CN114357887A

  • Well leakage event dynamic early warning method and system based on multi-machine learning model fusion

    CN118245936A

  • Well drilling accident early warning method and device, electronic equipment and storage medium

    CN118981637A

  • Early warning and automated detection for lost circulation in wellbore drilling

    GB2595548A

  • Hybrid neural network for drilling anomaly detection

    US20230082520A1