Drilling accident prediction method and device based on network optimization, equipment and medium

Through multiple group genetic algorithms based on network optimization, the BP neural network parameters are optimized, and the problem of insufficient accuracy and reliability of drilling accident prediction in the existing technology is solved, and more efficient and accurate drilling accident warning is achieved.

CN119646564AActive Publication Date: 2025-03-18GUANGZHOU MARINE GEOLOGICAL SURVEY
View PDF 4 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

The existing drilling accident prediction methods rely on experts' subjective judgment and experience, and there are problems of accuracy and consistency, and the inheritance and replication of experience is difficult, resulting in limited improvement in drilling operation safety level.

Method used

A drilling accident prediction method based on network optimization is proposed, using preset neural networks and multiple group genetic algorithms to iteratively optimize network parameters to improve the accuracy and reliability of drilling accident prediction.

Benefits of technology

By improving genetic algorithms to find the optimal parameters of BP neural network, the accuracy and real-time prediction of drilling accidents are improved, the problems of early maturity convergence and limitations are solved, and more efficient drilling accident warning is achieved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119646564A_ABST
    Figure CN119646564A_ABST
Patent Text Reader

Abstract

The invention discloses a well drilling accident prediction method and device based on network optimization, equipment and a medium, which introduces communication among populations based on a plurality of populations, evolving each population along different directions and keeping evolutions in the populations consistent with existing work, thereby improving the solving efficiency. According to the well drilling accident prediction method based on the BP neural network, the intelligence level of accident early warning is remarkably enhanced based on the BP neural network; a method based on multiple populations is provided for searching the optimal parameters of the BP neural network, the global search capability is enhanced, and the early warning accuracy is improved; a multi-population selection operator, a multi-population exchange operator and a multi-population crossover operator are provided, the defects of an existing genetic algorithm are overcome, 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 drilling accident prediction method, device, equipment and medium based on network optimization. Background Art

[0002] In the field of oil and gas exploration and development, the safety and efficiency of drilling operations are directly related to the success and economic benefits of the project. During the drilling process, real-time monitoring of drilling status and timely warning of abnormal accidents are important means to ensure operational safety and improve drilling efficiency. However, the currently widely used drilling accident prediction method mainly relies on the subjective judgment of experts and long-term accumulated field experience, which has obvious limitations.

[0003] First, manual judgment is affected by many factors, such as the expert's personal subjective bias, fatigue, and experience level, making it difficult to ensure the accuracy and consistency of judgment. Especially in a complex and changeable drilling environment, the judgment of a single expert may not fully and accurately reflect the drilling status, increasing the risk of misjudgment and missed judgment.

[0004] Secondly, although the experts’ on-site drilling experience is valuable, its inheritance and replication face huge challenges. It is difficult to directly compare and integrate the experience of different experts, and the accumulation of experience requires a long period of practice and learning. This makes it difficult to achieve large-scale replication and application of the knowledge system for drilling accident prediction in a short period of time, limiting the improvement of the safety level of drilling operations.

[0005] In order to overcome the above problems, researchers began to explore drilling accident prediction methods based on intelligent algorithms. Among them, the BP neural network model based on genetic algorithm has attracted much attention due to its powerful self-learning and nonlinear mapping capabilities. However, the existing BP neural network drilling accident prediction method based on genetic algorithm still has certain shortcomings. Specifically, the single population evolution strategy adopted by the genetic algorithm in this method is prone to premature convergence problems, that is, the algorithm falls into the local optimal solution too early in the search process and it is difficult to find the global optimal solution. In addition, traditional methods such as selection operators, crossover operators and mutation operators may show certain limitations when dealing with complex drilling environments, and cannot fully explore and utilize the useful information in the data, affecting the accuracy and reliability of the prediction results. Summary of the invention

[0006] 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 drilling accident prediction method, device, equipment and medium based on network optimization, which can efficiently and accurately predict drilling accidents.

[0007] On the one hand, an embodiment of the present invention provides a drilling accident prediction method based on network optimization, comprising:

[0008] Obtain drilling data, and obtain a test set and a validation set based on the drilling data; the drilling data includes drilling characteristic data and drilling accident types;

[0009] A preset neural network is used as a first neural network; a network topology structure of the preset neural network is preset based on the number of features of the drilling feature data;

[0010] Initialize the population tribe; use the population tribe as the first tribe; the first tribe includes a first number of populations, each population includes a second number of individuals, the individuals include network parameters corresponding to the network topology of the first neural network, and the second number represents a random number within a preset interval; each population of the first tribe is set with an evolution probability, and the evolution probability includes at least one of a crossover probability and a mutation probability;

[0011] Traverse all individuals of each population in the first tribe, and then obtain the first prediction accuracy corresponding to the network parameters of each individual in the first neural network through test set processing; obtain the largest first prediction accuracy in the first tribe as the target accuracy, and when the target accuracy is greater than the first threshold, take the individual corresponding to the target accuracy as the target individual, otherwise, perform the first evolution processing on the corresponding population based on the evolution probability of each population to obtain the second tribe;

[0012] Traversing all individuals of each population in the second tribe, and then obtaining the second prediction accuracy corresponding to the network parameters of each individual in the first neural network through test set processing; obtaining selected individuals from each population in the second tribe based on the second prediction accuracy combined with a preset tribe selection operator, and performing a second evolutionary process between populations on the second tribe according to the selected individuals to obtain a third tribe;

[0013] Add 1 to the number of iterations; when the number of iterations reaches the iteration threshold, determine the target individual based on the third population obtained in the last iteration; otherwise, take the third tribe as the third tribe, and then return to execute the step of traversing all individuals of each population in the first tribe; wherein the number of iterations is initially 0;

[0014] The fourth prediction accuracy corresponding to the network parameters of the target individual applied to the first neural network is obtained by processing the validation set. When the fourth prediction accuracy is greater than the second threshold, the network parameters of the target individual are applied to the first neural network as the target neural network; otherwise, the network topology of the first neural network is adjusted to obtain the second neural network, the number of iterations is reset to 0, the second neural network is used as the first neural network, and then the step of initializing the population tribe is returned to execute;

[0015] The target neural network is used to predict drilling accidents based on the drilling data to be predicted, and the drilling prediction results are obtained.

[0016] Optionally, the preset neural network includes an input layer, a hidden layer and an output layer; the method further includes the following steps:

[0017] Setting a first number of neurons in an input layer of a preset neural network according to the number of features of the drilling feature data;

[0018] Based on the first quantity, a second quantity of neurons in a hidden layer of a preset neural network is set in combination with a preset quantity relationship; wherein a third quantity of neurons in an output layer is 1; and the network parameters include a weight parameter and a threshold parameter;

[0019] The fourth number of weight parameters is determined according to the sum of the product of the first number and the second number and the product of the second number and the third number; and the number of threshold parameters is determined according to the sum of the second number and the third number.

[0020] Optionally, all individuals of each population in the first tribe are traversed, and then the first prediction accuracy corresponding to the network parameters of each individual in the first neural network is obtained through test set processing; the largest first prediction accuracy in the first tribe is obtained as the target accuracy, and when the target accuracy is greater than a first threshold, the individual corresponding to the target accuracy is used as the target individual, otherwise, the first evolution processing is performed on the corresponding population based on the evolution probability of each population to obtain the second tribe, including the following steps:

[0021] The first population in the first tribe was selected as the target population;

[0022] The first individual in the target population is used as a preparatory individual;

[0023] applying the network parameters of the preparation individual to the first neural network as a preparation neural network;

[0024] All drilling characteristic data in the test set are predicted and processed using the prepared neural network to obtain prepared results; all prepared results are compared with the drilling accident types paired with their corresponding drilling characteristic data, and the first prediction accuracy corresponding to the network parameters of the prepared individuals is obtained according to the proportion of identical results;

[0025] The next individual of the preparation individual in the target population is used as the preparation individual, and the step of applying the network parameters of the preparation individual to the first neural network as the preparation neural network is returned to be executed until the first prediction accuracy of all individuals in the target population is obtained;

[0026] The maximum first prediction accuracy in the target population is obtained as the target accuracy. When the target accuracy is greater than a first threshold, the individual corresponding to the target accuracy is used as the target individual. Otherwise, the target population is subjected to a first evolutionary process based on an evolutionary probability preset for the target population. The first evolutionary process includes at least one of a crossover operation and a mutation operation.

[0027] The next population of the target population in the first tribe is used as the target population, and the step of using the first individual in the target population as the preparation individual is returned to be executed until the target individual or the second tribe is obtained.

[0028] Optionally, obtaining selected individuals from each population in the second tribe based on the second prediction accuracy combined with a preset tribe selection operator includes the following steps:

[0029] Based on the second prediction accuracy, the accuracy standard deviation of each population in the second tribe is obtained;

[0030] Subtract the first threshold from the standard deviation of the accuracy of each population in the second tribe in turn to obtain a target difference value for each population in the second tribe;

[0031] Determining the number of selected individuals of each population in the second tribe according to the product of the target difference value of each population in the second tribe and the second number of the corresponding population;

[0032] Based on the selection quantity, a corresponding number of individuals are obtained from the corresponding population as selection individuals;

[0033] Among them, the individuals selected are the group of individuals with the second largest prediction accuracy in each population.

[0034] Optionally, performing a second evolutionary process between populations on the second tribe according to the selected individuals comprises the following steps:

[0035] Obtain the number of selections of selected individuals of each population in the second tribe, and then determine the total number of selections of all populations in the second tribe;

[0036] Obtain the maximum second prediction accuracy of each population in the second tribe, and then add them together to obtain the sum of the accuracy rates;

[0037] Determine the acceptance ratio corresponding to each population based on the ratio of the maximum second prediction accuracy rate of each population in the second tribe to the sum of the accuracy rates;

[0038] The number of acceptances corresponding to each population is determined according to the product of the acceptance ratio of each population in the second tribe and the total number of selections;

[0039] All selected individuals in the second tribe are sorted in descending order based on the second prediction accuracy to obtain a selection sequence;

[0040] According to the order of the accepted number from small to large, the selected individuals with the accepted number are taken out from the front of the selection sequence as the accepted individuals and placed into the population corresponding to the accepted number in the second tribe.

[0041] Optionally, performing a second evolutionary process between populations on the second tribe according to the selected individuals further comprises the following steps:

[0042] The first population in the second tribe is used as the target population;

[0043] Based on the selection quantity and acceptance quantity of the target population, the crossover quantity of the target population is obtained by combining the preset operation rules;

[0044] A first accepting individual is randomly selected from all the accepting individuals placed in the target population, and a second accepting individual is randomly selected from all the accepting individuals placed in the second tribe except the target population as the second individual;

[0045] Perform gene crossover processing on the first crossover individual and the second crossover individual to obtain a crossover individual;

[0046] Put the crossover individuals into the target population, add 1 to the number of crossovers, and initialize the number of crossovers to 0;

[0047] Return to the step of randomly selecting an accepting individual from all the accepting individuals placed in the target population as the first individual, until the number of crossovers is equal to the number of crossovers, reset the number of crossovers to 0, and use the next population of the target population in the second tribe as the target population;

[0048] Return to the step of obtaining the crossover number of the target population based on the selection number and the acceptance number of the target population in combination with the preset operation rules, until all populations in the second tribe are filled with the corresponding crossover number of crossover individuals.

[0049] Optionally, determining the target individual according to the third population obtained in the last iteration includes the following steps:

[0050] Traversing all individuals of each population in the third tribe, and then obtaining the third prediction accuracy corresponding to the network parameters of each individual in the first neural network by processing the test set;

[0051] The individual corresponding to the largest third prediction accuracy in the third tribe is taken as the target individual.

[0052] On the other hand, an embodiment of the present invention provides a drilling accident prediction device based on network optimization, comprising:

[0053] The first module is used to obtain drilling data, and to obtain a test set and a validation set based on the drilling data; the drilling data includes drilling characteristic data and drilling accident types;

[0054] The second module is used to use a preset neural network as a first neural network; the network topology of the preset neural network is preset based on the number of features of the drilling feature data;

[0055] The third module is used to initialize the population tribe; the population tribe is used as the first tribe; the first tribe includes a first number of populations, each population includes a second number of individuals, the individuals include network parameters corresponding to the network topology structure of the first neural network, and the second number represents a random number within a preset interval; each population of the first tribe is set with an evolution probability, and the evolution probability includes at least one of a crossover probability and a mutation probability;

[0056] The fourth module is used to traverse all individuals of each population in the first tribe, and then obtain the first prediction accuracy corresponding to the network parameters of each individual in the first neural network through test set processing; obtain the largest first prediction accuracy in the first tribe as the target accuracy, and when the target accuracy is greater than the first threshold, take the individual corresponding to the target accuracy as the target individual, otherwise, perform the first evolution processing on the corresponding population based on the evolution probability of each population to obtain the second tribe;

[0057] The fifth module is used to traverse all individuals of each population in the second tribe, and then obtain the second prediction accuracy corresponding to the network parameters of each individual of the first neural network through test set processing; based on the second prediction accuracy combined with a preset tribe selection operator, select individuals from each population in the second tribe, and perform a second evolution process between populations on the second tribe according to the selected individuals to obtain a third tribe;

[0058] The sixth module is used to increase the number of iterations by 1; when the number of iterations reaches the iteration threshold, the target individual is determined according to the third population obtained in the last iteration; otherwise, the third tribe is taken as the third tribe, and then the step of traversing all individuals of each population in the first tribe is returned; wherein the number of iterations is initially 0;

[0059] The seventh module is used to obtain the fourth prediction accuracy corresponding to the network parameters of the target individual applied to the first neural network through the verification set processing, and when the fourth prediction accuracy is greater than the second threshold, the network parameters of the target individual are applied to the first neural network as the target neural network; otherwise, the network topology structure of the first neural network is adjusted to obtain the second neural network, the number of iterations is reset to 0, the second neural network is used as the first neural network, and then the step of initializing the population tribe is returned to execute;

[0060] The eighth module is used to predict drilling accidents based on the drilling data to be predicted through the target neural network to obtain drilling prediction results.

[0061] Optionally, the preset neural network includes an input layer, a hidden layer and an output layer; the device also includes:

[0062] A ninth module, configured to set a first number of neurons in an input layer of a preset neural network according to the number of features of the drilling feature data;

[0063] A tenth module is used to set a second number of neurons in a hidden layer of a preset neural network based on the first number and in combination with a preset quantity relationship; wherein the third number of neurons in the output layer is 1; and the network parameters include weight parameters and threshold parameters;

[0064] The eleventh module is used to determine the fourth number of weight parameters according to the sum of the product of the first number and the second number and the product of the second number and the third number; and determine the number of threshold parameters according to the sum of the second number and the third number.

[0065] 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 accident prediction method based on network optimization.

[0066] 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 drilling accident prediction method based on network optimization.

[0067] The embodiment of the present invention obtains drilling data, and obtains a test set and a verification set based on the drilling data; the drilling data includes drilling feature data and drilling accident types; a preset neural network is used as a first neural network; the network topology of the preset neural network is preset based on the feature quantity of the drilling feature data; the population tribe is initialized; the population tribe is used as a first tribe; the first tribe includes a first number of populations, each population includes a second number of individuals, the individuals include network parameters corresponding to the network topology of the first neural network, and the second number represents a random number within a preset interval; each population in the first tribe is set with an evolution probability, and the evolution probability includes at least one of a crossover probability and a mutation probability; all individuals of each population in the first tribe are traversed, and then the first prediction accuracy corresponding to the network parameters of each individual of the first neural network is obtained through test set processing; the largest first prediction accuracy in the first tribe is obtained as the target accuracy, and when the target accuracy is greater than the first threshold, the individual corresponding to the target accuracy is used as the target individual, otherwise, the first evolution processing is performed on the corresponding population based on the evolution probability of each population to obtain a second tribe; all individuals of each population in the second tribe are traversed Individuals, and then the second prediction accuracy corresponding to the network parameters of each individual in the first neural network is obtained through the test set processing; based on the second prediction accuracy combined with the preset tribe selection operator, the selected individuals are obtained from each population in the second tribe, and the second evolutionary processing between populations is performed on the second tribe according to the selected individuals to obtain the third tribe; the number of iterations is increased by 1; when the number of iterations reaches the iteration threshold, the target individual is determined according to the third population obtained in the last iteration; otherwise, the third tribe is used as the third tribe, and then the step of traversing all individuals in each population in the first tribe is returned; wherein the number of iterations is initially 0; the fourth prediction accuracy corresponding to the network parameters of the target individual in the first neural network is obtained through the verification set processing, and when the fourth prediction accuracy is greater than the second threshold, the network parameters of the target individual are applied to the first neural network as the target neural network; otherwise, the network topology of the first neural network is adjusted to obtain the second neural network, the number of iterations is reset to 0, the second neural network is used as the first neural network, and then the step of initializing the population tribe is returned; drilling accidents are predicted according to the drilling data to be predicted through the target neural network to obtain drilling prediction results. The embodiment of the present invention is based on multiple populations, each population evolves in different directions, the evolution within the population is consistent with the existing work, and communication between populations is introduced, thereby improving the solution efficiency; the embodiment of the present invention finds the optimal parameters of the BP neural network by improving the genetic algorithm, thereby obtaining a more accurate drilling accident prediction model. Specifically, the present invention proposes a method based on multiple populations to search for the optimal parameters of the BP neural network, enhances the global search capability, and improves the accuracy of the early warning; the present invention can achieve efficient and accurate prediction of drilling accidents. BRIEF DESCRIPTION OF THE DRAWINGS

[0068] 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.

[0069] Figure 1 A schematic diagram of an implementation environment for network-optimized drilling accident prediction provided by an embodiment of the present invention;

[0070] Figure 2 A schematic diagram of a flow chart of a drilling accident prediction method based on network optimization provided by an embodiment of the present invention;

[0071] Figure 3 A schematic diagram of an extended flow chart of a drilling accident prediction method based on network optimization provided by an embodiment of the present invention;

[0072] Figure 4 A schematic diagram of an expansion process of traversing a first tribe provided by an embodiment of the present invention;

[0073] Figure 5 A schematic diagram of a process flow for obtaining a selected individual provided in an embodiment of the present invention;

[0074] Figure 6 A schematic diagram of the expansion process of the second evolution process provided by an embodiment of the present invention;

[0075] Figure 7 A schematic diagram of an extended process of the second evolution process provided by an embodiment of the present invention;

[0076] Figure 8 A schematic diagram of the overall process principle of a drilling accident prediction method based on network optimization provided by an embodiment of the present invention;

[0077] Fig. 9 A schematic diagram of the structure of a drilling accident prediction device based on network optimization provided by an embodiment of the present invention;

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

[0079] 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.

[0080] 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.

[0081] 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.

[0082] It is understandable that the drilling accident prediction method based on network optimization provided in the 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 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.

[0083] 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:

[0084] Genetic Algorithm (GA) is a computational model that simulates the biological evolution process. It uses mechanisms such as natural selection and gene recombination to achieve search and optimization methods for complex problems. It has the characteristics of a wide range of applications, strong global search, and easy parallel computing. It is suitable for optimizing and solving various types of problems, including combinatorial optimization, continuous optimization, and multi-objective optimization.

[0085] 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.

[0086] 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 OutputLayerOutput=w*HiddenLayerOutput+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, 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.

[0087] 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 genetic algorithm 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.

[0088] In the oil and gas extraction industry, well leakage, well kick and well blowout are three serious accidents related to drilling operations. They all involve the abnormal flow of underground fluids (such as water, oil and gas) during the drilling process, but each has its own characteristics and dangers.

[0089] Lost circulation: refers to the accidental inflow of drilling fluid (also known as mud) into the formation during the drilling process, usually due to the high permeability of the formation or improper drilling pressure control, which leads to the loss of drilling fluid. Lost circulation may lead to a reduction in the amount of drilling fluid, affecting the cooling and cleaning capabilities of the wellbore, and may also expose the wellbore wall and increase the risk of collapse. In severe cases, lost circulation will hinder further drilling, and even require special measures to plug the lost layer.

[0090] Well kick: refers to underground fluid (mainly natural gas or liquid) entering the wellbore at a rate exceeding the normal circulation rate, but has not yet reached the surface. Well kicks are usually caused by the formation pressure being greater than the pressure in the wellbore, or the drilling fluid column pressure being insufficient to balance the formation pressure. If well kicks are not controlled in time, they will quickly develop into a more serious blowout. Well kicks are emergency situations and require immediate measures such as adding weight to the drilling fluid, shutting down the blowout preventer, etc. to re-establish the pressure balance in the wellbore.

[0091] Blowout: One of the most serious accidents, when it occurs, underground high-pressure fluid (oil, gas, water or other mixtures) rushes out of the wellhead in an uncontrollable manner and reaches the ground or sea surface. Blowouts not only lead to huge resource losses, but may also cause catastrophic consequences such as fire, explosion, and environmental pollution, seriously threatening personnel safety and the environment. Blowouts usually require the emergency activation of emergency plans, including the use of special well control equipment (such as blowout preventers), injection of heavy drilling fluid or cement plugs, etc. to seal the well.

[0092] In the early years, the prediction of well leakage, well kick, and blowout was highly dependent on the subjective judgment of technicians based on real-time sensor data, 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, and researchers at home and abroad have explored a variety of methods for predicting drilling accidents using intelligent algorithms. In order to further prevent drilling accidents and reduce losses caused by drilling accidents, the present invention proposes an improved genetic algorithm to optimize the BP neural network model to enhance drilling prediction capabilities.

[0093] 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.

[0094] like Figure 1 FIG. 1 is a schematic diagram of an implementation environment provided by an embodiment of the invention. Figure 1The 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.

[0095] 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.

[0096] 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.

[0097] 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.

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

[0099] Reference Figure 2 , Figure 2 The flowchart of the drilling accident prediction method based on network optimization applied to the server provided in the embodiment of the present invention, the execution subject of the drilling accident prediction method based on network optimization can be any of the aforementioned computer devices (including servers or terminals). Figure 2 , the method comprises the following steps:

[0100] S100, obtaining drilling data, and obtaining a test set and a validation set based on the drilling data;

[0101] Among them, drilling data includes drilling characteristic data and drilling accident types;

[0102] For example, in some specific implementations, obtaining a test set and a validation set may be implemented as follows:

[0103] The drilling data used in the present invention mainly comes from public data at home and abroad, and multiple sets of data records collected from daily drilling reports, daily mud reports, completion reports and other materials. Some data show that drilling accidents occurred during the drilling process, and some data show that the drilling process is normal. Each set of data includes multiple characteristics (i.e., drilling characteristic data) such as lithology, pore size, porosity, pore pressure, fracture pressure, shear stress, gel strength, pump pressure, drill bit speed, primary fracture direction, cement slurry density, drilling fluid density, inlet flow, outlet flow, pump displacement, etc., and whether the three abnormal conditions of drilling leakage, well kick, and blowout are sent in this set of data.

[0104] The present invention 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 amount of data actually 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.

[0105] S200, using a preset neural network as a first neural network;

[0106] Wherein, the network topology structure of the preset neural network is preset based on the number of features of the drilling feature data;

[0107] It should be noted that the preset neural network includes an input layer, a hidden layer and an output layer; Figure 3 As shown, in some embodiments, the method may further include the following steps: T100, setting a first number of neurons in an input layer of a preset neural network according to the number of features of the drilling feature data; T200, setting a second number of neurons in a hidden layer of the preset neural network based on the first number and in combination with a preset quantity relationship; wherein the third number of neurons in the output layer is 1; the network parameters include weight parameters and threshold parameters; T300, determining a fourth number of weight parameters according to the sum of the product of the first number and the second number and the product of the second number and the third number; determining the number of threshold parameters according to the sum of the second number and the third number.

[0108] For example, in some specific implementations, determining the BP neural network topology can be implemented as follows:

[0109] For each set of drilling data, the data features are 15 features, including lithology, pore size, porosity, pore pressure, fracture pressure, shear stress, gel strength, pump pressure, drill bit speed, primary fracture direction, cement slurry density, drilling fluid density, inlet flow, outlet flow, pump displacement, etc., that is, there are 15 input variables and 1 output variable (type 1 indicates well leakage, type 2 indicates well kick, type 3 indicates well kick, and type 0 indicates normal or other conditions). That is, the BP neural network has 15 input layers and 1 output layer.

[0110] The present invention uses a three-layer BP neural network, the activation function is a 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:

[0111] n2=2*n1+1;

[0112] Therefore, the BP neural network topology has 15 input layers, 31 hidden layers, and 1 output layer. At this time, there are 15*31+31*1=496 weight parameters w to be optimized, and 31+1=32 threshold parameters b to be optimized, that is, there are 496+32=528 optimization variables searched by the genetic algorithm.

[0113] When the BP neural network topology is first constructed, the network topology is 15-31-1. When the network topology needs to be reset later, the number of hidden layers n2 will be randomly adjusted. The adjustment formula is as follows, where R(1,10) represents an integer random value of [1,10], that is, a few neural network units will be added each time, thereby improving the prediction accuracy of the BP neural network.

[0114] n2=n2+R(1,10);

[0115] S300, initializing the population tribe; taking the population tribe as the first tribe;

[0116] The first tribe includes a first number of populations, each population includes a second number of individuals, the individuals include network parameters corresponding to the network topology of the first neural network, and the second number represents a random number within a preset interval; each population of the first tribe is set with an evolution probability, and the evolution probability includes at least one of a crossover probability and a mutation probability;

[0117] For example, in some specific implementations, initializing the population tribe may be implemented as follows:

[0118] A tribe is composed of multiple populations, and a population is composed of multiple individuals. Each individual has multiple genes, which represent the weight parameter w and threshold parameter b of the BP neural network. Setting multiple populations is to control the evolution of the entire tribe in different directions. If the population size and evolution rules of multiple populations are exactly the same, then there is no difference between multiple populations and one large population. Therefore, it is necessary to first clarify the size of different populations, evolution rules, and individual initialization rules.

[0119] The first is the population size SizePop. The sizes of different populations are inconsistent. The initialization rules are as follows, where SizePop i represents the number of individuals in population i, MinPop represents the minimum population size (customized according to experience), and MaxPop represents the maximum

[0120] Population size (customized according to experience), usually MinPop and MaxPop satisfy the relationship: MaxPop = MinPop + 100.

[0121] SizePop i =random(MinPop,MaxPop);

[0122] The second is the population evolution rule, which is mainly the evolution reference of each population, including parameters such as crossover operator probability crossoverRate, mutation operator probability mutationRate, etc. These are actually the parameters of each operator in the genetic algorithm based on a single population. Because crossover and mutation belong to different evolutionary means, the value of each probability is determined based on experience. When facing more complex problems, the performance is not good, that is, the optimal solution cannot be found. Therefore, the present invention introduces multiple populations, each of which evolves in different directions based on different evolutionary rules.

[0123] Finally, there is the individual initialization rule. After the size of each population is determined, each population will be traversed to complete the initialization of individuals within the population. Assuming that the current BP neural network topology has 20 input layers, n2 hidden layers, and 1 output layer, then the weight parameters w to be optimized are 20*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.

[0124] The formula for individual initialization is as follows, where Individual i,j represents the individual j, w of the i-th population i,j,k represents the kth gene of individual j in the i-th population. Similarly, b i,j,mrepresents the mth gene of individual j in the i-th population, and normal(0,1) represents a normal distribution with a mean of 0 and a standard deviation of 1.

[0125] Individual i,j ={w i,j,1 ,w i,j,2 ,...w i,j,15*n2+n2*1 ,b i,j,1 ,b i,j,2 ,...b i,j,n2+1};

[0126] w i,j,k =normal(0,1),1≤k≤15*n2+n2*1;

[0127] b i,j,m =normal(0,1),1≤m≤n2+1;

[0128] In general, tribe initialization is to clarify the population size, evolutionary rules, and initialization of all individuals.

[0129] S400, traversing all individuals of each population in the first tribe, and then obtaining the first prediction accuracy corresponding to the network parameters of each individual in the first neural network through test set processing; obtaining the largest first prediction accuracy in the first tribe as the target accuracy, when the target accuracy is greater than the first threshold, taking the individual corresponding to the target accuracy as the target individual, otherwise, performing the first evolution processing on the corresponding population based on the evolution probability of each population, and obtaining the second tribe;

[0130] It should be noted that in some embodiments, Figure 4As shown, step S400 may include the following steps: S401, taking the first population in the first tribe as the target population; S402, taking the first individual in the target population as the preparatory individual; S403, applying the network parameters of the preparatory individual to the first neural network as the preparatory neural network; S404, using the preparatory neural network to perform prediction processing on all drilling feature data in the test set to obtain preparatory results; comparing the drilling accident types paired with all preparatory results and their corresponding drilling feature data, and obtaining the first prediction accuracy corresponding to the network parameters of the preparatory individual according to the proportion of the same results; S405, taking the next individual of the preparatory individual in the target population as the preparatory individual, and returning to execute The network parameters of the preparation individual are applied to the first neural network as a step of preparing the neural network until the first prediction accuracy of all individuals in the target population is obtained; S406, the largest first prediction accuracy in the target population is obtained as the target accuracy, when the target accuracy is greater than the first threshold, the individual corresponding to the target accuracy is used as the target individual, otherwise, the target population is subjected to a first evolutionary process based on the preset evolutionary probability of the target population; the first evolutionary process includes at least one of a crossover operation and a mutation operation; S407, the next population of the target population in the first tribe is used as the target population, and the step of using the first individual in the target population as the preparation individual is returned to be executed until the target individual or the second tribe is obtained.

[0131] Among them, the subsequent method flow for sorting out the second prediction accuracy, the third prediction accuracy and the fourth prediction accuracy is similar to the process logic of the aforementioned S404, and will not be repeated later.

[0132] For example, in some specific implementations, the prediction accuracy is first calculated based on the BP neural network, which can be specifically implemented as follows:

[0133] Traverse each individual in the current i-th population and calculate the corresponding accuracy. Each individual represents the BP neural network weight w and threshold b, that is, each individual represents a BP neural network. Based on each individual, traverse each array of the test set, input it into the BP neural network model, get the predicted result, and then compare it with the actual result. The present invention uses the prediction accuracy Precision as the fitness function for evaluation. Precision is between [0,1]. The larger the score means the better the model performance. The calculation formula is as follows. Wherein TrueSize represents the number of correct predictions. TestSetSize represents the number of test set data.

[0134]

[0135] At the same time, record the best individual in the current population i :

[0136]

[0137] Then, determine whether there is an individual with a value greater than the threshold. If BestIndividual i The corresponding Precision meets the requirement, that is, Precision ≥ TargetPrecision. At this time, it means that the optimal individual is found, and the target individual is directly output, otherwise the subsequent steps are executed. Here, TargetPrecision (i.e., the first threshold) is between [0, 1], and the value is customized, and the default is 0.99.

[0138] Subsequently, if all populations of the tribe are traversed, that is, each population has independently evolved, step S500 is executed to perform evolution between populations, otherwise the traversal of the i+1th population of the tribe continues.

[0139] Specifically, evolution is completed within the population through selection, crossover and mutation operators. Specifically, for the population that has completed the traversal but has not found the target individual, the evolution within the population is carried out based on the evolution rules of the current population (parameters such as the crossover operator probability crossoverRate, the mutation operator probability mutationRate, etc.). For a single population, probability-based evolution operations can be achieved through conventional genetic algorithms. This part is not the core point of the present invention, so it will not be repeated here.

[0140] S500, traversing all individuals of each population in the second tribe, and then obtaining a second prediction accuracy corresponding to the network parameters of each individual in the first neural network through test set processing; obtaining selected individuals from each population in the second tribe based on the second prediction accuracy combined with a preset tribe selection operator, and performing a second evolutionary process between populations on the second tribe according to the selected individuals to obtain a third tribe;

[0141] It should be noted that in some embodiments, Figure 5 As shown, obtaining selected individuals from each population in the second tribe based on the second prediction accuracy combined with a preset tribe selection operator may include the following steps: S501, obtaining the accuracy standard deviation of each population in the second tribe based on the second prediction accuracy; S502, subtracting the accuracy standard deviation of each population in the second tribe in turn according to the first threshold to obtain the target difference of each population in the second tribe; S503, determining the number of selected individuals for each population in the second tribe according to the product of the target difference of each population in the second tribe and the second number of the corresponding population; S504, obtaining a corresponding number of individuals from the corresponding population as selected individuals based on the selection number; wherein the selected individuals are a group of individuals with the largest second prediction accuracy in each population.

[0142] For example, in some specific implementations, individuals may be selected based on the tribe selection operator calculation (i.e., selecting individuals), which may be specifically implemented as follows:

[0143] The tribe selection operator selects some individuals from each population of the tribe to participate in the evolution operation within the tribe based on the performance of each population. Currently, the excellence of individuals is evaluated by the prediction accuracy Precision, and the excellence of populations is evaluated by analyzing the distribution of the prediction accuracy Precision. The formula is as follows:

[0144]

[0145] SelectCnt i =SizePop i *(TargetPrecision-RMSPrecision i );

[0146] Among them, AverPrecision i Represents the average prediction accuracy of population i, RMSPrecision i Indicates the standard deviation of the prediction accuracy of population i, SelectCnt i It is the individual selected from population i.

[0147] The standard error of the population RMSPrecision i The smaller it is, the lower the excellence of the population is, which means that the individuals in the population are dispersed and the gene expression is richer, so more individuals should be selected. Similarly, the standard error of the population RMSPrecision i The larger the value, the better the population is, indicating that the individuals in the population are concentrated and the gene expression is concentrated, so fewer individuals should be selected. From another perspective, a tribe is similar to a country, and RMS Precision i The larger it is, the stronger the country is, and the fewer people go abroad to study. i The smaller it is, the weaker the country is, and the more people go abroad to study.

[0148] In general, each population identifies and selects matching exchange individuals based on its own excellence, and subsequent individual exchanges and crossovers are based on these individuals.

[0149] Among them, in some embodiments, such as Figure 6As shown, performing the second evolutionary processing between populations on the second tribe according to the selected individuals may include the following steps: S505, obtaining the number of selected individuals of each population in the second tribe, and then determining the total number of selected individuals of all populations in the second tribe; S506, obtaining the second largest prediction accuracy of each population in the second tribe, and then adding them up to obtain the sum of the accuracy rates; S507, determining the corresponding acceptance ratio of each population based on the ratio of the second largest prediction accuracy of each population in the second tribe to the sum of the accuracy rates; S508, determining the corresponding acceptance number of each population according to the product of the acceptance ratio of each population in the second tribe and the total number of selected individuals; S509, sorting all selected individuals in the second tribe in descending order based on the second prediction accuracy to obtain a selection sequence; S510, taking out the selected individuals of the acceptance number from the front of the selection sequence in descending order according to the acceptance number from small to large as the acceptance individuals and putting them into the population corresponding to the acceptance number in the second tribe.

[0150] For example, in some specific implementations, multiple population individual exchanges can be performed based on the tribe exchange operator, which can be specifically implemented as follows:

[0151] Individual exchange is actually the direct exchange of individuals between two populations. For example, if individual A belongs to population 1 and individual B belongs to population 2, after the exchange of A and B, individual A belongs to population 2 and individual B belongs to population 1.

[0152] How to exchange individuals between multiple populations? The calculation formula is as follows:

[0153]

[0154] Where N represents the number of populations, Indicates the sum of the number of individuals selected for evolution this time, BestPrecision i Represents the optimal prediction accuracy of population i.

[0155] BestPrecision i The larger it is, the more individuals need to be accepted, and the best prediction accuracy is BestPrecision i The smaller it is, the fewer individuals it needs to accommodate. From another perspective, a tribe is similar to a country. i The larger the value, the stronger the country is, and the more people go to study in that country. i The smaller it is, the weaker the country is and the fewer people go to study in that country.

[0156] After determining the number of individuals that each individual needs to accept, all populations are sorted according to BestPrecision iSort from large to small, each population is sorted by number InCnt i Individuals are selected and then incorporated into the population.

[0157] Among them, in some embodiments, such as Figure 7 As shown, the second evolution process between populations of the second tribe according to the selected individuals may also include the following steps: S511, taking the first population in the second tribe as the target population; S512, based on the selection quantity and the acceptance quantity of the target population, the crossover quantity of the target population is obtained in combination with the preset operation rules; S513, randomly obtaining an accepting individual from all the accepting individuals placed in the target population as the first individual, and randomly obtaining an accepting individual from all the accepting individuals of the other populations except the target population placed in the second tribe as the second individual; S514, performing gene crossover process on the first crossover individual and the second crossover individual Processing, obtain the crossover individual; S515, put the crossover individual into the target population, add 1 to the number of crossovers; initialize the number of crossovers to 0; S516, return to execute the step of randomly obtaining an accepted individual from all accepted individuals put into the target population as the first individual, until the number of crossovers is equal to the number of crossovers, reset the number of crossovers to 0, and use the next population of the target population in the second tribe as the target population; S517, return to execute the step of obtaining the number of crossovers of the target population based on the selection number and the acceptance number of the target population, combined with the preset operation rules, until all populations in the second tribe are placed in the corresponding number of crossover individuals.

[0158] For example, in some specific implementations, after implementing the exchange of multiple population individuals, the population quantity balance can also be performed based on the tribal crossover operator, which can be specifically implemented as follows:

[0159] This is mainly to solve the problem of individual loss in the population, make up for the number of lost individuals, and ensure the relative dynamic balance of the population of the entire tribe. The calculation process of the exchange quantity of population i is as follows.

[0160] If SelectCnt i ≤InCnt i , indicating that the population size increases, the crossover number calculation formula is as follows:

[0161] CrossCnt i =random(1,SelectCnt i );

[0162] If SelectCnt i >InCnt i , indicating that the population is decreasing, and the crossover number calculation formula is as follows:

[0163] CrossCnti =SelectCnt i -InCnt i +random(1,SelectCnt i );

[0164] In general, the more individuals are lost from the population, the more individuals are replenished through the crossover operator. After the exchange is completed in the previous step, two individuals are randomly selected and the new individuals are calculated through the crossover operator. The new individuals are added to the population to replenish the number of individuals.

[0165] S600, adding 1 to the number of iterations; when the number of iterations reaches the iteration threshold, determining the target individual according to the third population obtained in the last iteration; otherwise, taking the third tribe as the third tribe, and then returning to execute the step of traversing all individuals of each population in the first tribe;

[0166] Among them, the number of iterations is initially 0;

[0167] It should be noted that, in some embodiments, determining the target individual based on the third population obtained in the last iteration may include the following steps: traversing all individuals of each population in the third tribe, and then obtaining the third prediction accuracy corresponding to the network parameters of each individual applied by the first neural network through test set processing; and taking the individual corresponding to the largest third prediction accuracy in the third tribe as the target individual.

[0168] For example, in some specific implementations, steps S400 to S600 are evolution loops outside multiple populations, and the number of iterations increases by one each time the loop is executed. If the number of iterations exceeds the maximum value MaxGenCnt (i.e., the iteration threshold, which can be customized and is 20 by default), go to step 12, otherwise return to step S400. Each time the loop reaches this point, it means that the tribe first experiences evolution within the population (step S400), and then experiences evolution between populations (steps S400 to S600).

[0169] Find the optimal BP neural network parameters. When it comes to this step, the entire genetic algorithm process is completed, indicating that the optimal parameters BestIndividual have been obtained:

[0170]

[0171] S700. Process the validation set to obtain the fourth prediction accuracy rate corresponding to the network parameters of the first neural network for the target individual. When the fourth prediction accuracy rate is greater than the second threshold, apply the network parameters of the target individual to the first neural network as the target neural network; otherwise, adjust the network topology of the first neural network to obtain the second neural network, reset the iteration count to 0, use the second neural network as the first neural network, and then return to execute the step of initializing the population tribe.

[0172] Exemplarily, in some specific embodiments, in step S100, a test set is obtained. In step S200, the BP network topology is determined. In step S600, the optimal parameters are obtained, that is, the neural network weights w and thresholds b have been adjusted to the optimal values. For the validation set data, the BP neural network model for drilling accident prediction is ready. Furthermore, based on the BP neural network, the prediction accuracy rate is calculated. Specifically, at this time, the optimal BP neural network model for drilling accident prediction has been obtained. Traverse each array group of the validation set, input it into the BP neural network model to obtain the prediction results, then compare with the real results, and finally calculate the prediction accuracy rate.

[0173] Specifically, steps S200 to S700 are the update loop of the BP neural network. Whenever a BP neural network model for drilling accident prediction that meets the expectations is not found, it will start over (reset the BP neural network). Only when the expected model is found will the entire process end. TargetPrecision (which represents the second threshold here and can be the same as the first threshold) is a value in [0, 1], which can be customized and defaults to 0.99, and is used to determine the optimal model. The logic is as follows:

[0174] If Precision verify ≥TargetPrecision, it means that the verification result meets the expectations, that is, the BP neural network model for drilling accident prediction meets the expectations, and the entire process ends.

[0175] If Precision verify <TargetPrecision, 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 drilling accident prediction. At this time, go to step S200 to update the BP network topology (the update rule refers to the description of randomly adjusting the hidden layer mentioned above and will not be elaborated here), and the relevant parameters of the genetic algorithm can also be reset (which can be manually adjusted), and re-look for the optimal parameters, and the entire process starts over.

[0176] S800. Use the target neural network to predict drilling accidents based on the drilling data to be predicted, and obtain the drilling prediction results.

[0177] For example, in some specific implementations, when this step is reached, it indicates that the drilling accident prediction BP neural network model meets expectations, and the entire process is completed, and the constructed drilling accident prediction BP neural network model can be applied to predict drilling accidents.

[0178] 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.

[0179] 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 field 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.

[0180] In the existing BP neural network drilling accident prediction method based on genetic algorithm, the genetic algorithm adopts a single population evolution strategy and uses traditional selection operators, crossover operators and mutation operators.

[0181] The existing BP neural network drilling accident prediction method based on genetic algorithm has the following shortcomings:

[0182] 1) BP neural network model updates slowly: In existing methods, the model updates slowly, affecting the user experience.

[0183] 2) Low efficiency of calculation, search and solution: Existing methods have the disadvantages of low search efficiency and easy to fall into local optimum.

[0184] 3) Real-time prediction of drilling accidents: With the explosive growth of data volume and the rapid expansion of data dimensions, current methods are difficult to support real-time prediction.

[0185] The core point of existing work is to complete population evolution based on a single population using crossover and mutation operators.

[0186] In view of this, the core point of the present invention is to use multiple populations, each population evolves in different directions, the evolution within the population is consistent with the existing work, and the communication between populations is introduced, thereby improving the solution efficiency. Figure 8 As shown, the present invention can be implemented by the following process steps:

[0187] Step 1: Get the test set and validation set. The drilling data used in the present invention mainly comes from public data at home and abroad, and multiple sets of data records collected from daily drilling reports, daily mud reports, completion reports and other materials. Some data show that drilling accidents occurred during the drilling process, 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, cement slurry density, drilling fluid density, inlet flow, outlet flow, pump displacement, and whether the three abnormal conditions of drilling leakage, well kick, and blowout were sent in this set of data.

[0188] The present invention 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 amount of data actually 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.

[0189] Step 2: Update the BP network topology. This step mainly does two things: reset the parameters of the genetic algorithm and update the BP network topology.

[0190] First, reset the parameters related to the genetic algorithm, including resetting the number of inner loop iterations to 0, resetting the current population, etc.

[0191] The following is to determine the BP neural network topology. For each set of drilling data, the data features are 15 features, including lithology, pore size, porosity, pore pressure, fracture pressure, shear stress, gel strength, pump pressure, drill bit speed, primary fracture direction, cement slurry density, drilling fluid density, inlet flow, outlet flow, pump displacement, etc., that is, there are 15 input variables and 1 output variable (type 1 indicates well leakage, type 2 indicates well kick, type 3 indicates well kick, and type 0 indicates normal or other conditions). That is, the BP neural network has 15 input layers and 1 output layer.

[0192] The present invention uses a three-layer BP neural network, the activation function is a 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:

[0193] n2=2*n1+1;

[0194] Therefore, the BP neural network topology has 15 input layers, 31 hidden layers, and 1 output layer. At this time, there are 15*31+31*1=496 weight parameters w to be optimized, and 31+1=32 threshold parameters b to be optimized, that is, there are 496+32=528 optimization variables searched by the genetic algorithm.

[0195] When step 2 is executed for the first time, the network topology is 15-31-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,10) represents an integer random value of [1,10], that is, a few neural network units will be added each time, thereby improving the prediction accuracy of the BP neural network.

[0196] n2=n2+R(1,10);

[0197] Step 3: Initialize the entire tribe. A tribe is composed of multiple populations, and a population is composed of multiple individuals. Each individual has multiple genes, which represent the weight parameter w and threshold parameter b of the BP neural network. Setting multiple populations is to control the evolution of the entire tribe in different directions. If the population size and evolution rules of multiple populations are exactly the same, then there is no difference between multiple populations and one large population. Therefore, it is necessary to first clarify the size of different populations, evolution rules, and individual initialization rules.

[0198] The first is the population size SizePop. The sizes of different populations are inconsistent. The initialization rules are as follows, where SizePop i Represents the number of individuals in population i, MinPop represents the minimum population size (customized based on experience), and MaxPop represents the maximum.

[0199] Population size (customized according to experience), usually MinPop and MaxPop satisfy the relationship: MaxPop = MinPop + 100.

[0200] SizePop i =random(MinPop,MaxPop);

[0201] The second is the population evolution rule, which is mainly the evolution reference of each population, including parameters such as crossover operator probability crossoverRate, mutation operator probability mutationRate, etc. These are actually the parameters of each operator in the genetic algorithm based on a single population. Because crossover and mutation belong to different evolutionary means, the value of each probability is determined based on experience. When facing more complex problems, the performance is not good, that is, the optimal solution cannot be found. Therefore, the present invention introduces multiple populations, each of which evolves in different directions based on different evolutionary rules.

[0202] Here is an example. Suppose there are three populations A, B, C and D, and their parameters are as follows:

[0203] Population A: The crossover probability crossoverRate is 1.0, and the mutation probability mutationRate is 0. This population mainly uses the crossover operator to obtain the best individuals, and the evolutionary direction is mainly crossover.

[0204] Population B: The crossover probability crossoverRate is 0.5, and the mutation probability mutationRate is 0.5. This population mainly uses crossover and mutation operators to obtain the best individuals, and the evolutionary direction is crossover and mutation equiprobabilistic evolution.

[0205] Population C: The crossover probability crossoverRate is 0.8, and the mutation probability mutationRate is 0.2. This population mainly uses crossover and mutation operators to obtain the best individuals. The evolutionary direction is mainly crossover and supplemented by mutation.

[0206] Population D: The crossover probability crossoverRate is 0, and the mutation probability mutationRate is 1. This population mainly uses the mutation operator to obtain the best individuals, and the evolutionary direction is mainly mutation.

[0207] Generally speaking, each tribe has at least three populations, namely, crossover-based, mutation-based, and a combination of crossover and mutation. The specific population size is determined based on actual experience. Generally speaking, the population size is between [10,20]. The evolutionary rules of each population are also different, and the values ​​are determined based on experience. In short, some populations are required to be mutation-based, some to be crossover-based, and some to take both into account. The biggest advantage of doing this is to leverage the strengths of different operators and avoid their weaknesses, thereby improving the efficiency and accuracy of finding the optimal parameters.

[0208] Finally, there is the individual initialization rule. After the size of each population is determined, each population will be traversed to complete the initialization of individuals within the population. Assuming that the current BP neural network topology has 20 input layers, n2 hidden layers, and 1 output layer, then the weight parameters w to be optimized are 20*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.

[0209] The formula for individual initialization is as follows, where Individual i,j represents the individual j, w of the i-th population i,j,k represents the kth gene of individual j in the i-th population. Similarly, b i,j,mrepresents the mth gene of individual j in the i-th population, and normal(0,1) represents a normal distribution with a mean of 0 and a standard deviation of 1.

[0210]

[0211] w i,j,k =normal(0,1),1≤k≤15*n2+n2*1;

[0212] b i,j,m =normal(0,1),1≤m≤n2+1;

[0213] In general, tribe initialization is to clarify the population size, evolution rules and initialization of all individuals. In step 1, the test set is obtained; in step 2, the topological structure of the BP neural network is clarified; in step 3, the population is initialized; facing the test set data, the drilling accident prediction BP neural network model is ready. Go to step 4.

[0214] Step 4: Calculate the prediction accuracy based on the BP neural network. Traverse each individual in the current i-th population and calculate the corresponding accuracy. Each individual represents the BP neural network weight w and threshold b, that is, each individual represents a BP neural network. Based on each individual, traverse each array of the test set, input it into the BP neural network model, get the prediction result, and then compare it with the actual result. The present invention uses the prediction accuracy Precision as the fitness function for evaluation. Precision is between [0,1]. The larger the score means the better the model performance. The calculation formula is as follows. Wherein TrueSize represents the number of correct predictions. TestSetSize represents the number of test set data.

[0215]

[0216] At the same time, record the best individual in the current population i , go to step 5.

[0217]

[0218] Step 5: There is an individual with a value greater than the threshold. If BestIndividual i The corresponding Precision meets the requirement, that is, Precision ≥ TargetPrecision, which means that the optimal individual is found, and go to step 12, otherwise go to step 6. Here, TargetPrecision is between [0, 1], and the value is user-defined, with the default value of 0.99.

[0219] Step 6: Traverse the entire tribe. If all populations of the tribe are traversed, each population has evolved independently, and then go to step 8 to communicate between populations. Otherwise, continue to traverse the i+1th population of the tribe and go to step 7.

[0220] Step 7: Evolution is completed within the population through selection, crossover and mutation operators. For the current population, based on the evolutionary rules of the current population (parameters such as the crossover operator probability crossoverRate, the mutation operator probability mutationRate, etc.), the evolution within the population is performed. This part is not the core point of the present invention, so it will not be repeated. Steps 4 to 7 are the evolutionary cycle within a single population. Go to step 4.

[0221] Step 8: Select individuals based on the tribe selection operator. The tribe selection operator selects some individuals to participate in the evolution operation within the tribe based on the performance of each population traversed in the tribe. Currently, the excellence of individuals is evaluated by the prediction accuracy Precision, and the excellence of populations is evaluated by analyzing the distribution of the prediction accuracy Precision. The formula is as follows:

[0222]

[0223] SelectCnt i =SizePop i *(TargetPrecision-RMSPrecision i );

[0224] Among them, AverPrecision i Represents the average prediction accuracy of population i, RMSPrecision i Indicates the standard deviation of the prediction accuracy of population i, SelectCnt i It is the individual selected from population i.

[0225] The standard error of the population RMSPrecision i The smaller it is, the lower the excellence of the population is, which means that the individuals in the population are dispersed and the gene expression is richer, so more individuals should be selected. Similarly, the standard error of the population RMSPrecision i The larger the value, the better the population is, indicating that the individuals in the population are concentrated and the gene expression is concentrated, so fewer individuals should be selected. From another perspective, a tribe is similar to a country, and RMS Precision i The larger it is, the stronger the country is, and the fewer people go abroad to study. iThe smaller it is, the weaker the country is, and the more people go abroad to study.

[0226] In general, each population confirms and selects matching exchange individuals based on its own excellence, and the subsequent individual exchanges and crossovers are based on these individuals. Go to step 9.

[0227] Step 9: Perform multi-population individual exchange based on the tribe exchange operator. Individual exchange is actually the direct exchange of individuals between two populations. For example, if individual A belongs to population 1 and individual B belongs to population 2, after A and B are exchanged, individual A belongs to population 2 and individual B belongs to population 1.

[0228] How to exchange individuals between multiple populations? The calculation formula is as follows:

[0229]

[0230] Where N represents the number of populations, Indicates the sum of the number of individuals selected for evolution this time, BestPrecision i Represents the optimal prediction accuracy of population i.

[0231] BestPrecision i The larger it is, the more individuals need to be accepted, and the best prediction accuracy is BestPrecision i The smaller it is, the fewer individuals it needs to accommodate. From another perspective, a tribe is similar to a country. i The larger the value, the stronger the country is, and the more people go to study in that country. i The smaller it is, the weaker the country is and the fewer people go to study in that country.

[0232] After determining the number of individuals that each individual needs to accept, all populations are sorted according to BestPrecision i Sort from large to small, each population is sorted by number InCnt i Individuals are selected and then incorporated into the population.

[0233] Here is an example. If there are three populations A, B, and C, we can get the following by using the above formula:

[0234] The exchange SelectCnt0 of population A is 3, and the acceptance InCnt0 is 7. After the exchange, the number of individuals in population A increases by 4;

[0235] Population B exchanges SelectCnt1 to 5 and accepts InCnt1 to 6. After the exchange, the number of individuals in population B increases by 1;

[0236] Population C exchanges SelectCnt2 to 7 and accepts InCnt2 to 2. After the exchange, the number of individuals in population C decreases by 5;

[0237] From the above, we can see that there are 3+5+7=15 individuals participating in the exchange. Assuming that BestPrecision i The order from smallest to largest is C, B, A.

[0238] First, select individuals for C. C needs to accept 2 individuals, so randomly select 2 individuals from these 15 individuals to enter population C, and then select from the remaining 13 individuals, 6 of which are given to population B, and finally the remaining ones are given to population A.

[0239] From the above example, we can see that the lower the population's excellence, the more individuals are exchanged and the fewer individuals are accepted. The higher the population's excellence, the fewer individuals are exchanged and the more individuals are accepted. This means that the number of excellent individuals in the population is increasing, and the number of non-excellent individuals in the population is decreasing, which will break the quantitative balance between different populations. However, this problem will be solved in step 10.

[0240] In general, each population confirms and selects the individuals to be accepted based on their own excellence, which means that the exchange between populations is completed. Go to step 10.

[0241] Step 10: Balance the population based on the tribal crossover operator. This is mainly to solve the problem of individual loss in the population, make up for the number of lost individuals, and ensure the relative dynamic balance of the entire tribe. The calculation process of the exchange number of population i is as follows.

[0242] If SelectCnt i ≤InCnt i , indicating that the population size increases, the crossover number calculation formula is as follows:

[0243] CrossCnt i =random(1,SelectCnt i );

[0244] If SelectCnt i >InCnt i , indicating that the population is decreasing, and the crossover number calculation formula is as follows:

[0245] CrossCnt i =SelectCnt i -InCnt i +random(1,SelectCnt i );

[0246] In general, the more individuals are lost from the population, the more individuals are supplemented by the crossover operator. After the exchange is completed in step 10, two individuals are randomly selected and the new individuals are calculated by the crossover operator. The new individuals are added to the population to supplement the number of individuals.

[0247] Here is an example. If there are three populations A, B, and C, we can get the following by using the above formula:

[0248] The exchange SelectCnt0 of population A is 3, and the acceptance InCnt0 is 7. After calculation, the CorssCnt0 of population A is 1;

[0249] The exchange SelectCnt1 of population B is 5, and the acceptance InCnt1 is 6. After calculation, the CorssCnt1 of population B is 2;

[0250] The exchange SelectCnt2 of population C is 7, and the acceptance InCnt2 is 2. After calculation, the CorssCnt2 of population C is 8;

[0251] That is, population A has 1 crossover opportunity, population B has 2 crossover opportunities, and population C has 8 crossover opportunities.

[0252] Taking a crossover of population A as an example, one of the seven individuals accepted from population A is randomly selected (assuming that the randomly selected individual is Individual 1,j ), and then randomly select one from the accepted individuals of other populations (assuming that individual Individual is selected from population B 2,n ):

[0253] Individual 1,j ={w 1,j,1 ,w 1,j,2 ,...w 1,j,15*n2+n2*1 ,b 1,j,1 ,b 1,j,2 ,...b 1,j,n2+1};

[0254]

[0255] Individual 1,j and Individual 2,n After the crossover, we get a new individual NewIndividual 1,m , the calculation formula is as follows:

[0256]

[0257] in Indicates the addition of a new individual NewIndividual 1,m The kth gene of Individual 1,j The kth gene of Individual 2,n The kth gene of , random() means taking a random value in the specified interval. The new individual NewIndividual 1,m Join to population A. The crossover process of other populations is similar and will not be described here.

[0258] Here is a reminder that with the continuous evolution between populations, the number of individuals in each population may increase. The redundant individuals are eliminated by the selection operator in step 7, so the population size in each generation still maintains a basic dynamic balance.

[0259] Compared with the evolutionary process within a population, the evolutionary process between populations emphasizes the exchange of individuals. The exchanged individuals will evolve in the direction of their population. By repeatedly executing this process, the possibility of excellent populations finding the optimal solution is continuously improved.

[0260] To understand it from another perspective, through the evolutionary process between populations, excellent populations will usually become better, but the genetic diversity will become less and less. Poor populations may become better or worse after accepting new individuals, but they still have value and significance, that is, to maintain genetic diversity. Poor populations are actually used for trial and error, constantly helping excellent populations to evolve. Judging from experience, most populations dominated by mutations do not perform well, but these populations have great genetic diversity and crossover potential, which is a bit like hybrid rice.

[0261] In general, each population dynamically calculates the number of exchanges based on the number of individuals lost in the current population, and then adds new individuals through the crossover operator to ensure a relatively dynamic balance between the populations. Go to step 11.

[0262] Step 11: Satisfy the maximum number of population iterations. Steps 4 to 11 are evolutionary cycles outside multiple populations. Each time they are executed, the number of iterations increases by one. If the number of iterations exceeds the maximum value MaxGenCnt (i.e., the iteration threshold, which can be customized and is 20 by default), go to step 12, otherwise go to step 4.

[0263] Each time it reaches this point, it means that the tribe first undergoes evolution within the population (steps 4 to 7), and then undergoes evolution between populations (steps 4 to 11).

[0264] Step 12: Find the optimal BP neural network parameters. When reaching this step, that is, when the entire genetic algorithm process is completed, it indicates that the optimal parameters BestIndividual have been obtained:

[0265]

[0266] Step 13: Initialize the BP neural network parameters. In Step 1, the test set was obtained. In Step 2, the BP network topology was determined. In Step 12, the optimal parameters BestIndividual were 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 drilling accident prediction is ready.

[0267] Step 14: Calculate the prediction accuracy rate based on the BP neural network. At this time, the optimal BP neural network model for drilling accident prediction has been obtained. Traverse each array group in the validation set, input it into the BP neural network model to get the prediction results, then compare with the real results, and finally calculate the prediction accuracy rate Precision verify 。

[0268] It should be noted that Precision was calculated based on the test set in Step 5, but here Precision is calculated based on the validation set verify 。

[0269] Step 15: The classification accuracy rate meets the requirements. Steps 2 to 15 are the update loop of the BP neural network. Whenever a BP neural network model for drilling accident prediction that meets the expectations is not found, it will start over. Only when the expected model is found will the entire process end. TargetPrecision is a value in [0,1], which can be customized, and the default value is 0.99, used to determine the optimal model. The logic is as follows:

[0270] If Precision verify ≥TargetPrecision, it means that the verification result meets the expectations, that is, the BP neural network model for drilling accident prediction meets the expectations. At this time, go to Step 16 and the entire process ends.

[0271] If Precision verify <TargetPrecision, 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 drilling accident prediction. At this time, go to Step 2, reset the relevant parameters of the genetic algorithm, update the BP neural network topology, and search for the optimal parameters again, and the entire process starts over.

[0272] Step 16: Find the optimal BP neural network model. When this step is reached, it means that the drilling accident prediction BP neural network model meets expectations and the entire process is completed.

[0273] In summary, the present invention proposes a drilling accident prediction method for optimizing BP neural network, and finds the optimal parameters of BP neural network by improving genetic algorithm, so as to obtain a more accurate drilling accident prediction model. The method includes:

[0274] 1) A drilling accident prediction method based on BP neural network is proposed. Relying on BP neural network, the intelligent level of accident warning is significantly enhanced.

[0275] 2) A multi-population based method was proposed to search for the optimal parameters of the BP neural network, which enhanced the global search capability and improved the accuracy of the early warning.

[0276] 3) A variety of population selection operators, exchange operators and crossover operators are proposed to improve the shortcomings of existing genetic algorithms.

[0277] On the other hand, Fig. 9 As shown, the embodiment of the present invention provides a drilling accident prediction device 900 based on network optimization, which may include:

[0278] The first module 901 is used to obtain drilling data, and to obtain a test set and a validation set based on the drilling data; the drilling data includes drilling characteristic data and drilling accident types;

[0279] The second module 902 is used to use a preset neural network as a first neural network; the network topology of the preset neural network is preset based on the number of features of the drilling feature data;

[0280] The third module 903 is used to initialize the population tribe; the population tribe is used as the first tribe; the first tribe includes a first number of populations, each population includes a second number of individuals, the individuals include network parameters corresponding to the network topology of the first neural network, and the second number represents a random number within a preset interval; each population of the first tribe is set with an evolution probability, and the evolution probability includes at least one of a crossover probability and a mutation probability;

[0281] The fourth module 904 is used to traverse all individuals of each population in the first tribe, and then obtain the first prediction accuracy corresponding to the network parameters of each individual in the first neural network through test set processing; obtain the largest first prediction accuracy in the first tribe as the target accuracy, and when the target accuracy is greater than the first threshold, take the individual corresponding to the target accuracy as the target individual, otherwise, perform the first evolution processing on the corresponding population based on the evolution probability of each population to obtain the second tribe;

[0282] The fifth module 905 is used to traverse all individuals of each population in the second tribe, and then obtain the second prediction accuracy corresponding to the network parameters of each individual of the first neural network application through test set processing; obtain selected individuals from each population in the second tribe based on the second prediction accuracy combined with a preset tribe selection operator, and perform a second evolution process between populations on the second tribe according to the selected individuals to obtain a third tribe;

[0283] The sixth module 906 is used to increase the number of iterations by 1; when the number of iterations reaches the iteration threshold, determine the target individual according to the third population obtained in the last iteration; otherwise, take the third tribe as the third tribe, and then return to execute the step of traversing all individuals of each population in the first tribe; wherein the number of iterations is initially 0;

[0284] The seventh module 907 is used to obtain the fourth prediction accuracy corresponding to the network parameters of the target individual applied to the first neural network through the verification set processing, and when the fourth prediction accuracy is greater than the second threshold, the network parameters of the target individual are applied to the first neural network as the target neural network; otherwise, the network topology of the first neural network is adjusted to obtain the second neural network, the number of iterations is reset to 0, the second neural network is used as the first neural network, and then the step of initializing the population tribe is returned to execute;

[0285] The eighth module 908 is used to predict drilling accidents according to the drilling data to be predicted through the target neural network to obtain drilling prediction results.

[0286] In some embodiments, the preset neural network includes an input layer, a hidden layer, and an output layer; the device may also include:

[0287] A ninth module, configured to set a first number of neurons in an input layer of a preset neural network according to the number of features of the drilling feature data;

[0288] A tenth module is used to set a second number of neurons in a hidden layer of a preset neural network based on the first number and in combination with a preset quantity relationship; wherein the third number of neurons in the output layer is 1; and the network parameters include weight parameters and threshold parameters;

[0289] The eleventh module is used to determine the fourth number of weight parameters according to the sum of the product of the first number and the second number and the product of the second number and the third number; and determine the number of threshold parameters according to the sum of the second number and the third number.

[0290] 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.

[0291] 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.

[0292] 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.

[0293] 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:

[0294] 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.

[0295] 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;

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

[0297] 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.);

[0298] 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 );

[0299] 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 .

[0300] 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.

[0301] 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.

[0302] 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.

[0303] 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.

[0304] 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.

[0305] 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.

[0306] 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.

[0307] 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.

[0308] 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.

[0309] 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.

[0310] 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.

[0311] 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.

[0312] 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.

[0313] 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.

[0314] 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.

[0315] 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.

[0316] 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.

[0317] 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 drilling accident prediction method based on network optimization, characterized in that: The following steps are involved: Acquire drilling data, and obtain a test set and a validation set based on the drilling data; the drilling data includes drilling characteristic data and drilling accident types; A preset neural network is used as a first neural network; the network topology of the preset neural network is preset based on the number of features of the drilling feature data; Initializing a population tribe; using the population tribe as a first tribe; the first tribe includes a first number of populations, each of the populations includes a second number of individuals, the individuals include network parameters corresponding to the network topology of the first neural network, and the second number represents a random number within a preset interval; Each population of the first tribe is provided with an evolution probability, wherein the evolution probability includes at least one of a crossover probability and a mutation probability; Traversing all the individuals of each of the populations in the first tribe, and then obtaining the first prediction accuracy corresponding to the network parameters of each individual applied by the first neural network through the test set processing; obtaining the largest first prediction accuracy in the first tribe as the target accuracy, and when the target accuracy is greater than a first threshold, taking the individual corresponding to the target accuracy as the target individual, otherwise, performing the first evolution processing on the corresponding population based on the evolution probability of each of the populations to obtain a second tribe; Traversing all the individuals of each of the populations in the second tribe, and then obtaining a second prediction accuracy corresponding to the network parameters of each individual applied by the first neural network through processing of the test set; Based on the second prediction accuracy and a preset tribe selection operator, a selected individual is obtained from each of the populations in the second tribe, and a second evolutionary process between the populations is performed on the second tribe according to the selected individual to obtain a third tribe; Add 1 to the number of iterations; when the number of iterations reaches the iteration threshold, determine the target individual according to the third population obtained in the last iteration; otherwise, take the third tribe as the third tribe, and then return to execute the step of traversing all the individuals of each population in the first tribe; wherein the number of iterations is initially 0; Obtaining, by processing the validation set, a fourth prediction accuracy corresponding to the network parameters of the target individual applied by the first neural network, and when the fourth prediction accuracy is greater than a second threshold, applying the network parameters of the target individual to the first neural network as a target neural network; Otherwise, adjusting the network topology of the first neural network to obtain a second neural network, resetting the number of iterations to 0, using the second neural network as the first neural network, and then returning to execute the step of initializing the population tribe; The target neural network is used to predict drilling accidents based on the drilling data to be predicted, and a drilling prediction result is obtained.

2. The drilling accident prediction method based on network optimization according to claim 1 is characterized in that: The preset neural network includes an input layer, a hidden layer and an output layer; the method further includes the following steps: Setting a first number of neurons in the input layer of the preset neural network according to the number of features of the drilling feature data; Based on the first number, the second number of neurons in the hidden layer of the preset neural network is set in combination with a preset quantity relationship; wherein the third number of neurons in the output layer is 1; and the network parameters include weight parameters and threshold parameters; The fourth number of weight parameters is determined according to the sum of the product of the first number and the second number and the product of the second number and the third number; and the number of threshold parameters is determined according to the sum of the second number and the third number.

3. The drilling accident prediction method based on network optimization according to claim 1 is characterized in that: The traversing of all the individuals of each of the populations in the first tribe, and then obtaining the first prediction accuracy corresponding to the network parameters of each individual applied by the first neural network through the test set processing; obtaining the largest first prediction accuracy in the first tribe as the target accuracy, when the target accuracy is greater than a first threshold, taking the individual corresponding to the target accuracy as the target individual, otherwise, performing the first evolution processing on the corresponding population based on the evolution probability of each of the populations to obtain the second tribe, includes the following steps: taking the first of said populations in said first tribe as a target population; taking the first individual in the target population as a preparation individual; applying the network parameters of the preparation individual to the first neural network as a preparation neural network; Using the prepared neural network to perform prediction processing on all the drilling characteristic data in the test set to obtain a prepared result; comparing the drilling accident types paired with all the prepared results and their corresponding drilling characteristic data, and obtaining the first prediction accuracy corresponding to the network parameters of the prepared individuals according to the proportion of identical results; Taking the next individual of the preparation individual in the target population as the preparation individual, and returning to the step of applying the network parameters of the preparation individual to the first neural network as the preparation neural network, until the first prediction accuracy of all the individuals in the target population is obtained; The maximum first prediction accuracy in the target population is obtained as the target accuracy. When the target accuracy is greater than the first threshold, the individual corresponding to the target accuracy is used as the target individual. Otherwise, the first evolution process is performed on the target population based on the evolution probability preset for the target population. The first evolution process includes at least one of a crossover operation and a mutation operation. The next population of the target population in the first tribe is used as the target population, and the step of using the first individual in the target population as a preliminary individual is returned to be executed until the target individual or the second tribe is obtained.

4. The drilling accident prediction method based on network optimization according to claim 1 is characterized in that: The step of obtaining selected individuals from each of the populations in the second tribe based on the second prediction accuracy combined with a preset tribe selection operator comprises the following steps: Obtaining a standard deviation of the accuracy of each of the populations in the second tribe based on the second prediction accuracy; Subtract the first threshold from the standard deviation of the accuracy of each population in the second tribe in turn to obtain a target difference value for each population in the second tribe; determining the selected number of the selected individuals of each of the populations in the second tribe according to the product of the target difference of each of the populations in the second tribe and the second number of the corresponding population; Based on the selection quantity, obtaining a corresponding number of the individuals from the corresponding population as the selection individuals; The selected individuals are a group of individuals in each of the populations with the largest second prediction accuracy.

5. The drilling accident prediction method based on network optimization according to claim 1, characterized in that: The step of performing a second evolutionary process among the populations on the second tribe according to the selected individuals comprises the following steps: Obtaining the number of selected individuals of each of the populations in the second tribe, and then determining the total number of selected individuals of all the populations in the second tribe; Obtaining the maximum second prediction accuracy of each of the populations in the second tribe, and then adding them up to obtain a sum of the accuracy rates; Determine the acceptance ratio corresponding to each of the populations based on the ratio of the second prediction accuracy rate of each of the populations in the second tribe to the sum of the accuracy rates; Determine the acceptance quantity corresponding to each of the populations according to the product of the acceptance ratio of each of the populations in the second tribe and the total number of selections; Sorting all the selected individuals in the second tribe in descending order based on the second prediction accuracy to obtain a selection sequence; According to the order of the acceptance number from small to large, the selected individuals of the acceptance number are taken out from the front of the selection sequence in turn as the accepted individuals and put into the population corresponding to the acceptance number in the second tribe.

6. The drilling accident prediction method based on network optimization according to claim 5 is characterized in that: The performing of the second evolutionary process between the populations on the second tribe according to the selected individuals further comprises the following steps: taking the first of said populations in said second tribe as a target population; Based on the selected number and the accepted number of the target population, the crossover number of the target population is obtained in combination with a preset operation rule; Randomly obtain one of the receiving individuals from all the receiving individuals placed in the target population as a first individual, and randomly obtain one of the receiving individuals from all the receiving individuals of the population other than the target population placed in the second tribe as a second individual; Performing gene crossover processing on the first crossover individual and the second crossover individual to obtain a crossover individual; Put the crossover individual into the target population, increase the number of crossovers by 1; initialize the number of crossovers to 0; Return to the step of randomly obtaining an accepted individual from all the accepted individuals placed in the target population as the first individual, until the number of crossovers is equal to the number of crossovers, reset the number of crossovers to 0, and use the next population of the target population in the second tribe as the target population; Return to the step of executing the selection quantity and the acceptance quantity based on the target population, and obtaining the crossover quantity of the target population in combination with the preset operation rules, until all the populations in the second tribe are placed with the corresponding crossover quantity of crossover individuals.

7. The drilling accident prediction method based on network optimization according to claim 1, characterized in that: Determining the target individual according to the third population obtained in the last iteration comprises the following steps: Traversing all the individuals of each of the populations in the third tribe, and then obtaining, through the test set processing, a third prediction accuracy corresponding to the network parameters of each individual applied by the first neural network; The individual corresponding to the largest third prediction accuracy rate in the third tribe is used as the target individual.

8. A drilling accident prediction device based on network optimization, characterized in that: include: The first module is used to obtain drilling data, and to obtain a test set and a validation set based on the drilling data; the drilling data includes drilling characteristic data and drilling accident types; The second module is used to use a preset neural network as a first neural network; the network topology structure of the preset neural network is preset based on the number of features of the drilling feature data; The third module is used to initialize a population tribe; the population tribe is used as a first tribe; the first tribe includes a first number of populations, each of the populations includes a second number of individuals, the individuals include network parameters corresponding to the network topology of the first neural network, and the second number represents a random number within a preset interval; Each population of the first tribe is provided with an evolution probability, wherein the evolution probability includes at least one of a crossover probability and a mutation probability; The fourth module is used to traverse all the individuals of each of the populations in the first tribe, and then obtain the first prediction accuracy corresponding to the network parameters of each individual applied by the first neural network through the test set processing; obtain the largest first prediction accuracy in the first tribe as the target accuracy, and when the target accuracy is greater than a first threshold, use the individual corresponding to the target accuracy as the target individual, otherwise, perform the first evolution processing on the corresponding population based on the evolution probability of each population to obtain a second tribe; A fifth module is used to traverse all the individuals of each of the populations in the second tribe, and then obtain a second prediction accuracy corresponding to the network parameters of each individual applied by the first neural network through processing of the test set; Based on the second prediction accuracy and a preset tribe selection operator, a selected individual is obtained from each of the populations in the second tribe, and a second evolutionary process between the populations is performed on the second tribe according to the selected individual to obtain a third tribe; The sixth module is used to increase the number of iterations by 1; when the number of iterations reaches the iteration threshold, determine the target individual according to the third population obtained in the last iteration; otherwise, take the third tribe as the third tribe, and then return to execute the step of traversing all the individuals of each population in the first tribe; wherein the number of iterations is initially 0; The seventh module is used to obtain, by processing the validation set, a fourth prediction accuracy corresponding to the network parameters of the target individual applied by the first neural network; when the fourth prediction accuracy is greater than a second threshold, the network parameters of the target individual are applied to the first neural network as the target neural network; otherwise, the network topology of the first neural network is adjusted to obtain a second neural network, the number of iterations is reset to 0, the second neural network is used as the first neural network, and then the step of initializing the population tribe is returned to be executed; The eighth module is used to predict drilling accidents according to the drilling data to be predicted through the target neural network to obtain drilling prediction results.

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

  • Method for predicting working fluid level of submersible reciprocating pumping unit through improved neural network

    CN118153651A

  • Low-altitude communication network organization method based on artificial intelligence

    CN118659978A

  • System for automated capture and analysis of business information for reliable business venture outcome prediction

    US20170124497A1

  • CNN-ga-BP combined model-based spare part demand prediction method and system

    WO2024139014A1