Well drilling accident real-time prediction method and device, electronic equipment and storage medium
By using support vector machines and genetic algorithms to optimize parameters in real-time prediction of drilling accidents, the prediction model is constructed and updated, and the problem of relying on subjective judgment in the existing technology is solved, achieving higher prediction accuracy and system flexibility.
Patent Information
- Application Number
- CN202411700346.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-26
- Publication Date
- 2025-03-18
- Estimated Expiration
- 2044-11-26
AI Technical Summary
The existing technology relies on subjective judgment of experts in real-time prediction of drilling accidents, and there are human errors and knowledge dissemination problems, resulting in limited application scope and effect.
A real-time prediction method for drilling accidents is proposed. By obtaining multiple sets of drilling data and label information, initializing parameter populations, using support vector machines for training, optimizing parameters with genetic algorithms, building a target prediction model, and updating in real time to improve prediction accuracy.
It significantly improves the prediction accuracy of drilling accidents, reduces the risk of human intervention, realizes adaptive update capabilities, and improves the flexibility and scalability of the system.
Smart Images

Figure CN119647668A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data processing, and in particular to a method, device, electronic equipment and storage medium for real-time prediction of drilling accidents. Background Art
[0002] At present, the technical field generally relies on experts to conduct intuitive assessments based on data transmitted in real time by sensors. This assessment process deeply integrates the rich experience of the drilling site to identify drilling conditions and warn of potential accidents. Although this approach contains rich practical wisdom and demonstrates its unique value in practical applications, it also exposes some inherent limitations.
[0003] Specifically, the current evaluation process of technical solutions mainly relies on the subjective judgment of experts, which inevitably introduces the risk of human bias and subjectivity. In addition, this kind of valuable knowledge and judgment methods based on deep practical experience are difficult to spread widely, and lack efficient application mechanisms, resulting in significant limitations on their scope of application and actual effects.
[0004] In summary, although the existing technical solutions reflect the value of practical wisdom to a certain extent, they are limited by the subjectivity of human judgment and the difficulties of knowledge dissemination and application. Summary of the invention
[0005] 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 real-time prediction method, device, electronic device and storage medium for drilling accidents, which can efficiently and accurately predict drilling accidents in real time.
[0006] On the one hand, an embodiment of the present invention provides a method for real-time prediction of drilling accidents, comprising:
[0007] Acquire a data set; the data set includes multiple sets of drilling data and label information of whether a drilling accident occurs in the set of data;
[0008] Initialize the parameter population; the parameter population includes multiple parameter individuals, and the genes of each parameter individual include regularization coefficients and kernel parameters;
[0009] Apply each parameter individual in the parameter population to the support vector machine in turn, and then obtain the training result corresponding to each parameter individual in the parameter population through data set training;
[0010] Based on the training results combined with the label information, the F1 score corresponding to each parameter individual is evaluated; the maximum F1 score is used as the candidate score. When the candidate score is greater than the target score, the parameter individual corresponding to the candidate score is used as the target individual, and the candidate score is used as the target score;
[0011] Based on the F1 score corresponding to each parameter individual, the parameter population is genetically processed to obtain the target population;
[0012] Add 1 to the number of iterations, use the target population as the parameter population, return to execute the step of applying each parameter individual in the parameter population to the support vector machine in turn, until the number of iterations reaches the iteration upper limit, and apply the target individual to the support vector machine to obtain the target prediction model;
[0013] Obtain real-time data from the drilling site, input the real-time data into the target prediction model to obtain real-time accident prediction results;
[0014] Check the accuracy of the real-time accident prediction results; where accuracy includes correct prediction and wrong prediction; when the accuracy is wrong prediction, correct the real-time accident prediction results;
[0015] Associating the real-time data with the real-time accident prediction results and adding them to the data set; incrementally updating the preset update threshold based on accuracy;
[0016] When the next prediction node is reached, the step of obtaining real-time data of the drilling site is returned until the update threshold reaches the upper threshold limit, the update threshold is reset to 0, and the step of initializing the parameter population is returned to continuously update the target prediction model.
[0017] Optionally, initializing the parameter population includes the following steps:
[0018] constructing a preset number of regularization coefficients based on random numbers within a first preset range;
[0019] constructing a preset number of kernel parameters based on random numbers within a second preset range;
[0020] According to the preset number of regularization coefficients and kernel parameter pairings, a preset number of parameter individuals are obtained, thereby completing the initialization of the parameter population.
[0021] Optionally, applying each parameter individual in the parameter population to the support vector machine in turn, and then obtaining the training result corresponding to each parameter individual in the parameter population through data set training, includes the following steps:
[0022] Apply the regularization coefficient and kernel parameter corresponding to the parameter individual to the support vector machine to obtain the support vector machine model;
[0023] Input each set of drilling data in the data set into the vector machine model in turn, and output the drilling accident prediction result corresponding to each set of drilling data through the vector machine model prediction;
[0024] The training results corresponding to the parameter individuals are obtained by sorting out the drilling accident prediction results corresponding to all drilling data.
[0025] Optionally, the training result includes a drilling accident prediction result corresponding to each set of drilling data in the data set, and the drilling accident prediction result includes whether a drilling accident occurred or did not occur; obtaining an F1 score corresponding to each parameter individual based on the training result combined with the label information evaluation includes the following steps:
[0026] Compare the drilling accident prediction results and label information corresponding to each set of drilling data in the data set;
[0027] According to the comparison results, the first number of samples correctly predicted as positive, the second number of samples incorrectly predicted as positive, and the third number of samples incorrectly predicted as negative are obtained; wherein the positive class represents that the drilling accident prediction result is that a drilling accident occurs, and the negative class represents that the drilling accident prediction result is that no drilling accident occurs;
[0028] The F1 scores corresponding to the parameter individuals are calculated based on the first sample number, the second sample number, and the third sample number.
[0029] Optionally, based on the F1 score corresponding to each parameter individual, genetic processing is performed on the parameter population to obtain a target population, including the following steps:
[0030] Sort the parameter individuals in the parameter population in ascending order of F1 scores to obtain the first population;
[0031] Obtain the first number of parameter individuals with the highest F1 score from the first population as the first candidate population;
[0032] Randomly obtain a second number of parameter individuals from the first population except the first candidate population as a second candidate population;
[0033] The first candidate population and the second candidate population are combined as the target population.
[0034] Optionally, the method further comprises the following steps:
[0035] Randomly selecting a third number of parameter individuals from the target population as a third candidate population;
[0036] Perform a crossover operation on the first individual with the highest F1 score and the second individual with the lowest F1 score in the third candidate population to obtain a third individual; add the third individual to the target population;
[0037] The expression of the crossover operation is:
[0038] C3=min(C1,C2)+abs(C1-C2)*R(0,1);
[0039] g3=min(g1,g2)+abs(g1-g2)*R(0,1);
[0040] In the formula, C represents the regularization coefficient, g represents the kernel parameter; {C1, g1} represents the first individual, {C2, g2} represents the second individual, and {C3, g3} represents the third individual; min represents the minimum value; abs represents the absolute value; R(0,1) represents a random value of [0,1];
[0041] Return to execute the step of randomly selecting a third number of parameter individuals from the target population as the third candidate population until the target population is added with a fourth number of third individuals.
[0042] Optionally, the method further comprises the following steps:
[0043] Randomly select a fifth number of parameter individuals from the target population as a fourth candidate population;
[0044] The first parameter individual in the fourth candidate population is used as the fourth individual;
[0045] generating a random probability within a third preset range;
[0046] When the random probability is in the first interval, the first mutation operation is performed on the fourth individual, and the individual mutation result of the first mutation operation is added to the target population;
[0047] Among them, the expression of the first mutation operation is:
[0048] C1=C1+normal(0,1)*(C max -C min );
[0049] C1=min(C max ,max(C min ,C1));
[0050] Where C1 represents the regularization coefficient of the fourth individual; normal(0,1) represents a random value with a normal distribution with a mean of 0 and a standard deviation of 1; C max and C min represents the maximum and minimum values of the regularization coefficient in the target population or the fourth candidate population respectively;
[0051] When the random probability is in the second interval, the second mutation operation is performed on the fourth individual, and the individual mutation result of the second mutation operation is added to the target population;
[0052] Among them, the expression of the second mutation operation is:
[0053] g1=g1+normal(0,1)*(g max -g min );
[0054] g1=min(g max,max(g min ,g1));
[0055] Where g1 represents the kernel parameter of the fourth individual; g max and g min represents the maximum and minimum values of the kernel parameters in the target population or the fourth candidate population respectively;
[0056] When the random probability is in the third interval, the first mutation operation and the second mutation operation are performed on the fourth individual, and the individual mutation results of the first mutation operation and the second mutation operation are added to the target population;
[0057] The next parameter individual of the fourth individual in the fourth candidate population is taken as the fourth individual, and the step of generating random probability within the third preset range is returned to be executed until the individual variation results of each parameter individual in the fourth candidate population are added to the target population.
[0058] On the other hand, an embodiment of the present invention provides a real-time prediction device for drilling accidents, comprising:
[0059] The first module is used to obtain a data set; the data set includes multiple sets of drilling data and label information of whether a drilling accident occurs in the data set;
[0060] The second module is used to initialize the parameter population; the parameter population includes multiple parameter individuals, and the genes of each parameter individual include regularization coefficients and kernel parameters;
[0061] The third module is used to apply each parameter individual in the parameter population to the support vector machine in turn, and then obtain the training result corresponding to each parameter individual in the parameter population through data set training;
[0062] The fourth module is used to evaluate the F1 score corresponding to each parameter individual based on the training results combined with the label information; the maximum F1 score is used as the candidate score, and when the candidate score is greater than the target score, the parameter individual corresponding to the candidate score is used as the target individual, and the candidate score is used as the target score;
[0063] The fifth module is used to perform genetic processing on the parameter population based on the F1 score corresponding to each parameter individual to obtain the target population;
[0064] The sixth module is used to increase the number of iterations by 1, use the target population as the parameter population, return to execute the third module until the number of iterations reaches the iteration upper limit, and apply the target individual to the support vector machine to obtain the target prediction model;
[0065] The seventh module is used to obtain real-time data from the drilling site, input the real-time data into the target prediction model to obtain the real-time prediction result of the accident;
[0066] The eighth module is used to check the accuracy of the real-time accident prediction results; wherein the accuracy includes correct prediction and wrong prediction; when the accuracy is wrong prediction, the real-time accident prediction results are corrected;
[0067] The ninth module is used to associate the real-time data with the real-time accident prediction results and add them to the data set; based on the accuracy, the preset update threshold is incrementally updated;
[0068] The tenth module is used to return to execute the seventh module when reaching the next prediction node, until the update threshold reaches the upper threshold limit, reset the update threshold to 0, return to execute the second module, and continuously update the target prediction model.
[0069] Optionally, the device further comprises:
[0070] An eleventh module is used to randomly select a third number of parameter individuals from the target population as a third candidate population;
[0071] The twelfth module is used to perform a crossover operation on the first individual with the highest F1 score and the second individual with the lowest F1 score in the third candidate population to obtain a third individual; and add the third individual to the target population;
[0072] The expression of the crossover operation is:
[0073] C3=min(C1,C2)+abs(C1-C2)*R(0,1);
[0074] g3=min(g1,g2)+abs(g1-g2)*R(0,1);
[0075] In the formula, C represents the regularization coefficient, g represents the kernel parameter; {C1, g1} represents the first individual, {C2, g2} represents the second individual, and {C3, g3} represents the third individual; min represents the minimum value; abs represents the absolute value; R(0,1) represents a random value of [0,1];
[0076] The thirteenth module is used to return to execute the eleventh module until the third individual of the fourth quantity is added to the target population.
[0077] Optionally, the device further comprises:
[0078] A fourteenth module is used for randomly selecting a fifth number of parameter individuals from the target population as a fourth candidate population;
[0079] A fifteenth module is used to use the first parameter individual in the fourth candidate population as the fourth individual;
[0080] A sixteenth module, used to generate a random probability within a third preset range;
[0081] The seventeenth module is used for performing a first mutation operation on the fourth individual when the random probability is in the first interval, and adding the individual mutation result of the first mutation operation to the target population;
[0082] Among them, the expression of the first mutation operation is:
[0083] C1=C1+normal(0,1)*(C max -C min );
[0084] C1=min(C max ,max(C min ,C1));
[0085] Where C1 represents the regularization coefficient of the fourth individual; normal(0,1) represents a random value with a normal distribution with a mean of 0 and a standard deviation of 1; C max and C min represents the maximum and minimum values of the regularization coefficient in the target population or the fourth candidate population respectively;
[0086] An eighteenth module is used for performing a second mutation operation on the fourth individual when the random probability is in the second interval, and adding the individual mutation result of the second mutation operation to the target population;
[0087] Among them, the expression of the second mutation operation is:
[0088] g1=g1+normal(0,1)*(g max -g min );
[0089] g1=min(g max ,max(g min ,g1));
[0090] Where g1 represents the kernel parameter of the fourth individual; g max and g min represents the maximum and minimum values of the kernel parameters in the target population or the fourth candidate population respectively;
[0091] A nineteenth module is used for performing a first mutation operation and a second mutation operation on a fourth individual when the random probability is in a third interval, and adding individual mutation results of the first mutation operation and the second mutation operation to a target population;
[0092] The twentieth module is used to take the next parameter individual of the fourth individual in the fourth candidate population as the fourth individual, and return to execute the sixteenth module until the individual variation results of each parameter individual in the fourth candidate population are added to the target population.
[0093] 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 real-time prediction method for drilling accidents.
[0094] 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 real-time prediction method of drilling accidents.
[0095] The embodiment of the present invention obtains a data set; the data set includes multiple groups of drilling data and label information of whether a drilling accident occurs in the case of the group of data; initializes a parameter population; the parameter population includes multiple parameter individuals, and the gene of each parameter individual includes a regularization coefficient and a kernel parameter; each parameter individual in the parameter population is applied to a support vector machine in turn, and then the training result corresponding to each parameter individual in the parameter population is obtained through data set training; based on the training result combined with the label information evaluation, the F1 score corresponding to each parameter individual is obtained; the maximum F1 score is used as a candidate score, and when the candidate score is greater than the target score, the parameter individual corresponding to the candidate score is used as the target individual, and the candidate score is used as the target score; based on the F1 score corresponding to each parameter individual, the parameter population is genetically processed to obtain a target population; the number of iterations is increased by 1, and the target population is used as the parameter population, return to execute the step of applying each parameter individual in the parameter population to the support vector machine in turn, until the number of iterations reaches the upper limit of the iteration, apply the target individual to the support vector machine to obtain the target prediction model; obtain real-time data from the drilling site, input the real-time data into the target prediction model to predict the real-time prediction result of the accident; check the accuracy of the real-time prediction result of the accident; wherein the accuracy includes correct prediction and prediction error; when the accuracy is a prediction error, correct the real-time prediction result of the accident; associate the real-time data with the real-time prediction result of the accident and add it to the data set; incrementally update the preset update threshold based on the accuracy; when reaching the next prediction node, return to execute the step of obtaining real-time data from the drilling site, until the update threshold reaches the upper limit of the threshold, reset the update threshold to 0, return to execute the step of initializing the parameter population, and continuously update the target prediction model. The embodiment of the present invention includes the following beneficial effects:
[0096] Improve prediction accuracy: By iteratively optimizing the parameter population and combining it with F1 score evaluation, the optimal parameter individuals can be screened out to build the target prediction model, thereby significantly improving the prediction accuracy of drilling accidents.
[0097] Adaptive update capability: This technology has the ability to self-learn and update. By continuously feeding real-time data and prediction results into the data set and dynamically adjusting the update threshold based on prediction accuracy, the model can adapt to changes at the drilling site and continuously maintain prediction performance.
[0098] Application of efficient genetic algorithms: Using genetic algorithms to optimize parameter populations can more efficiently explore parameter space, quickly locate the optimal solution, and reduce computing resource consumption compared to traditional methods.
[0099] Real-time response and dynamic adjustment: The technical framework is designed with a real-time data acquisition and prediction mechanism that can instantly reflect the drilling site conditions and quickly correct them when the prediction is wrong, ensuring the timeliness and accuracy of the prediction.
[0100] Flexibility and scalability: Due to the data-driven approach, the technology can flexibly adapt to different drilling environments and conditions, and it is easy to integrate new data features and prediction algorithms to improve the scalability and versatility of the system.
[0101] Reduce the risk of human intervention: Through automated and intelligent prediction processes, the subjectivity and bias of human judgment are reduced, the objectivity and scientific nature of decision-making are improved, and the risk of safety accidents caused by human factors is reduced.
[0102] In summary, this technology not only improves the accuracy and efficiency of drilling accident prediction through intelligent and adaptive methods, but also enhances the flexibility and scalability of the system, providing strong technical support for the safety management of drilling operations. BRIEF DESCRIPTION OF THE DRAWINGS
[0103] 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.
[0104] Figure 1 A schematic diagram of an implementation environment for real-time prediction of drilling accidents provided by an embodiment of the present invention;
[0105] Figure 2 A schematic diagram of a flow chart of a real-time prediction method for drilling accidents provided by an embodiment of the present invention;
[0106] Figure 3 A schematic diagram of the expanded flow of step S200 provided in an embodiment of the present invention;
[0107] Figure 4 A schematic diagram of the expanded flow of step S300 provided in an embodiment of the present invention;
[0108] Figure 5 A schematic diagram of the expanded flow of step S400 provided in an embodiment of the present invention;
[0109] Figure 6 A schematic diagram of the expanded flow of step S500 provided in an embodiment of the present invention;
[0110] Figure 7 A schematic diagram of an extended process of a real-time prediction method for drilling accidents provided by an embodiment of the present invention;
[0111] Figure 8 A schematic diagram of the overall process principle of the real-time prediction method for drilling accidents provided by an embodiment of the present invention;
[0112] Fig. 9 A schematic diagram of the structure of a real-time prediction device for drilling accidents provided by an embodiment of the present invention;
[0113] Fig.10 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0114] 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.
[0115] 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.
[0116] 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.
[0117] It is understandable that the real-time prediction method for drilling accidents 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.
[0118] 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:
[0119] Genetic Algorithm (GA) is a computational model that simulates the biological evolution process, using mechanisms such as natural selection and gene recombination to search and optimize complex problems. It is a heuristic search algorithm, and its basic idea is to create a group of artificial individuals for optimization and solution by simulating the mechanisms of natural inheritance and evolution. In a genetic algorithm, each individual represents a potential solution, and each individual has its own fitness evaluation criteria. By selecting, crossing over, and mutating these individuals, the adaptability of the current population is gradually improved and the potential solution space is explored in order to find the optimal solution. Genetic algorithms have the characteristics of a wide range of applications, strong global search, and easy parallel computing. They are suitable for optimizing and solving various types of problems, including combinatorial optimization, continuous optimization, and multi-objective optimization. Compared with other algorithms, genetic algorithms can efficiently search for the global optimal solution and are widely used in various fields, including but not limited to engineering optimization design, artificial intelligence tasks, financial analysis and prediction, etc.
[0120] Support Vector Machines (SVM) is a classic machine learning method. With its excellent generalization ability and effective handling of nonlinear problems, it has shown great potential in the fields of pattern recognition, classification and regression analysis. Its core concept is to construct an optimal decision boundary that can not only clearly divide samples of different categories, but also has the maximum interval, in order to enhance the prediction performance of the model on unknown data. For nonlinear problems, SVM uses kernel techniques to map to high-dimensional space to achieve effective separation. It is suitable for small to medium-sized data sets and high-dimensional feature spaces.
[0121] 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.
[0122] 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.
[0123] 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.
[0124] 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.
[0125] like Figure 1 FIG. 1 is a schematic diagram of an implementation environment provided by an embodiment of the invention. Figure 1 The implementation environment includes at least one terminal 102 and a server 101. The terminal 102 and the server 101 can be connected to a network wirelessly or wired to complete data transmission and exchange.
[0126] 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.
[0127] 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.
[0128] 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.
[0129] Based on the example Figure 1 In the implementation environment shown, an embodiment of the present invention provides a real-time prediction method for drilling accidents. The following is explained using the application of the real-time prediction method for drilling accidents in the server 101 as an example. It can be understood that the real-time prediction method for drilling accidents can also be applied to the terminal 102.
[0130] Reference Figure 2 , Figure 2 The flowchart of the real-time prediction method for drilling accidents applied to a server provided in an embodiment of the present invention, the execution subject of the real-time prediction method for drilling accidents can be any of the aforementioned computer devices (including servers or terminals). Figure 2 , the method comprises the following steps:
[0131] S100, obtaining a data set;
[0132] The data set includes multiple sets of drilling data and label information of whether a drilling accident occurs in the set of data;
[0133] For example, in some specific implementations, the drilling data sources used in the present invention are mainly divided into two parts: historical data and field operation data, which together constitute a data set.
[0134] Historical data 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 accidents such as leakage, well gusher, and blowout occurred during the drilling process, while some data show that the drilling process was normal.
[0135] Field operation data is the front-line operation data. First, the SVM drilling accident prediction model is used to predict whether drilling accidents such as well leakage, well kick, and blowout will occur. Then, the results are manually determined to be correct. Whether the prediction is correct or wrong, the data will be added to the drilling data set. When the data prediction continues to be correct, the SVM drilling accident prediction model will be updated regularly according to the configuration; when the data prediction fails, if certain conditions are met, the SVM drilling accident prediction model will be triggered to update.
[0136] 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, original fracture direction, cement slurry density, drilling fluid density, inlet flow, outlet flow, pump displacement, and whether the three abnormal conditions such as drilling leakage, well kick, and blowout were sent in this set of data.
[0137] S200, initializing parameter population;
[0138] The parameter population includes multiple parameter individuals, and the genes of each parameter individual include regularization coefficients and kernel parameters;
[0139] It should be noted that in some embodiments, Figure 3 As shown, step S200 may include the following steps: S201, constructing a preset number of regularization coefficients based on random numbers within a first preset range; S202, constructing a preset number of kernel parameters based on random numbers within a second preset range; S203, obtaining a preset number of parameter individuals according to pairing a preset number of regularization coefficients and kernel parameters, thereby completing the initialization of the parameter population.
[0140] For example, in some specific implementations, the population is composed of a large number of individuals, each of which has multiple genes. In this article, the core parameters of the SVM support vector machine include two parameters, namely, the regularization coefficient C and the kernel parameter g. That is, each individual has two genes, representing the regularization coefficient C and the kernel parameter g, respectively. The specific meanings of the two genes are as follows:
[0141] Regularization coefficient C: It is an important hyperparameter in SVM, which determines the model's tolerance for errors. It determines the model's tolerance for errors. A larger C value will cause the model to penalize more for misclassification and may overfit the data. A smaller C value will cause the model to penalize less for misclassification and may underfit the data. There is no fixed range for the value of C, which depends on the complexity of the data set problem. In practical applications, the value of C is between (0,10 8 ].
[0142] Kernel parameter g: It determines the width of the Gaussian kernel function, which affects the performance of the SVM model. A larger g value will result in a higher degree of fit of the model to the data, which may overfit the data. A smaller g value will result in a lower degree of fit of the model to the data, which may underfit the data. There is no fixed range for the value of g, which depends on the complexity of the data set problem. In practical applications, the value of g is between (0,10 2 ].
[0143] Through in-depth data query, facing the real-time prediction needs of drilling accidents, the final value range of the regularization coefficient C is (0,100], and the final value range of the kernel parameter g is (0,10]. Finally, the individual Individual is initialized by the following formula, where R(0,100) represents a random floating point number of (0,100], and R(0,10) represents a random floating point number of (0,10].
[0144] C = R (0, 100);
[0145] g = R (0, 10);
[0146] Individual = {C, g};
[0147] S300, applying each parameter individual in the parameter population to the support vector machine in turn, and then obtaining the training result corresponding to each parameter individual in the parameter population through data set training;
[0148] It should be noted that in some embodiments, Figure 4 As shown, step S300 may include the following steps: S301, applying the regularization coefficient and kernel parameter corresponding to the parameter individual to the support vector machine to obtain a support vector machine model; S302, inputting each group of drilling data in the data set into the support vector machine model in turn, and outputting the drilling accident prediction results corresponding to each group of drilling data through the support vector machine model; S303, arranging the drilling accident prediction results corresponding to all drilling data to obtain the training results corresponding to the parameter individual.
[0149] For example, in some specific implementations, in the above steps, the latest data set is obtained, and the key parameters of the SVM support vector machine are clarified. For the latest data set, a drilling accident prediction SVM support vector machine model can be obtained through training.
[0150] S400, based on the training results combined with the label information, the F1 score corresponding to each parameter individual is obtained; the maximum F1 score is used as the candidate score, and when the candidate score is greater than the target score, the parameter individual corresponding to the candidate score is used as the target individual, and the candidate score is used as the target score;
[0151] It should be noted that the training results include drilling accident prediction results corresponding to each set of drilling data in the data set, and the drilling accident prediction results include whether a drilling accident occurred or not. In some embodiments, Figure 5As shown, obtaining the F1 score corresponding to each parameter individual based on the training result combined with the label information evaluation may include the following steps: S401, comparing the drilling accident prediction result and label information corresponding to each group of drilling data in the data set; S402, obtaining the first number of samples correctly predicted as the positive class, the second number of samples incorrectly predicted as the positive class, and the third number of samples incorrectly predicted as the negative class according to the comparison results; wherein the positive class represents that the drilling accident prediction result is that a drilling accident has occurred, and the negative class represents that the drilling accident prediction result is that no drilling accident has occurred; S403, calculating the F1 score corresponding to the parameter individual based on the first number of samples, the second number of samples, and the third number of samples.
[0152] For example, in some specific implementations, each individual in the population represents the core parameters of the support vector machine, including the regularization coefficient C and the kernel parameter g, that is, each individual represents an SVM support vector machine. Based on the individual, each array of the latest data set is traversed, input into the SVM support vector machine, and the predicted results are obtained, which are then compared with the actual results. This article uses the commonly used F1 score as the fitness function for evaluation. The F1 score is between [0,1]. The larger the score, the better the model performance. The calculation formula is as follows:
[0153]
[0154] Among them, True Positives indicates the number of samples correctly predicted by the model as positive; False Positives indicates the number of samples incorrectly predicted by the model as positive, which are actually negative; False Negatives indicates the number of samples incorrectly predicted by the model as negative, which are actually positive.
[0155] In general, the current latest data set is used as the benchmark, the current Individual is used as the input, and the F1 score of the output result, that is, the fitness function value, is calculated. At the same time, the BestIndividual with the best performance at the moment is recorded.
[0156] BestIndividual = {C, g};
[0157] S500, based on the F1 score corresponding to each parameter individual, genetic processing is performed on the parameter population to obtain a target population;
[0158] It should be noted that in some embodiments, Figure 6As shown, step S500 may include the following steps: S501, sorting the parameter individuals in the parameter population in ascending order of F1 scores to obtain a first population; S502, obtaining a first number of parameter individuals with the highest F1 scores from the first population as a first candidate population; S503, randomly obtaining a second number of parameter individuals from the first population except the first candidate population as a second candidate population; S504, merging the first candidate population and the second candidate population as a target population.
[0159] For example, in some specific implementations, the selection operator may be applied to individuals based on probability, which may be implemented as follows:
[0160] The selection operator mainly selects better individuals based on probability. The larger the F1 score, the better the individual, and the smaller the F1 score, the worse the individual. The selection operator will select sizePop individuals. It should be noted that the population size SnowSizePop may exceed sizePop individuals. If the population size SnowSizePop exceeds sizePop individuals (snowSizePop>sizePop), only sizePop data will be selected, and the excess will be eliminated.
[0161] The core idea of selection is to first sort all individuals from small to large according to the F1 score, and then select SelectRate*sizePop data with the largest F1 score according to SelectRate (SelectRate can be customized, with a value range of [0,1] and a default of 0.5), that is, directly select the top ranked data.
[0162] The remaining (1-SelectRate)*sizePop individuals are randomly selected from the remaining snowSizePop-SelectRate*sizePop individuals. The selection rule is as follows: facing the remaining snowSizePop-SelectRate*sizePop individuals, randomly select N individuals each time (can be customized, no less than 2, default 5), select the one with the largest F1 score, and repeat this (1-SelectRate)*sizePop times. Finally, sizePop individuals are obtained.
[0163] sizePop individuals can also participate in subsequent calculations such as crossover operators and mutation operators.
[0164] In general, the advantage of the above selection operator is that excellent individuals will directly participate in the evolution of the population, but poor individuals still have the opportunity to participate in the evolution of the population, which not only increases the probability of excellent genes being selected, but also ensures the diversity of genes.
[0165] Among them, in some embodiments, such as Figure 7 As shown, the method may further include the following steps: T100, randomly selecting a third number of parameter individuals from the target population as a third candidate population; T200, performing a crossover operation on the first individual with the highest F1 score and the second individual with the lowest F1 score in the third candidate population to obtain a third individual; adding the third individual to the target population; wherein the expression of the crossover operation is:
[0166] C3=min(C1,C2)+abs(C1-C2)*R(0,1);
[0167] g3=min(g1,g2)+abs(g1-g2)*R(0,1);
[0168] In the formula, C represents the regularization coefficient, g represents the kernel parameter; {C1, g1} represents the first individual, {C2, g2} represents the second individual, and {C3, g3} represents the third individual; min represents the minimum value; abs represents the absolute value; R(0,1) represents a random value of [0,1];
[0169] T300, return to execute the step of randomly selecting a third number of parameter individuals from the target population as the third candidate population, until the target population is added with a fourth number of third individuals.
[0170] For example, in some specific implementations, the crossover operator can also be applied to individuals based on probability. Taking the target population as an example, sizePop individuals are obtained, which can be specifically implemented as follows:
[0171] Now we have sizePop individuals, and the maximum number of crossovers required is MaxCrossCnt (which can be customized, the default is The crossover rules are as follows:
[0172] Each time, randomly select N individuals (customizable, no less than 2, default 5), select the largest and smallest F1 scores for crossover, and repeat this process for a total of MaxCorssCnt times. Note that the individuals obtained by crossover are new individuals. After the crossover operator, the size of the entire population increases by MaxCorssCnt, that is, the population has a total of sizePop+MaxCorssCnt individuals.
[0173] Individual1 = {C1, g1};
[0174] Individual2 = {C2, g2};
[0175] If two individuals Individual1 and Individual2 are crossed, the new individual Individual3 is obtained after the crossover, where min means finding the minimum value, abs means finding the absolute value, and R(0,1) means a random value of [0,1].
[0176] Individual3 = {C3, g3};
[0177] C3=min(C1,C2)+abs(C1-C2)*R(0,1);
[0178] g3=min(g1,g2)+abs(g1-g2)*R(0,1);
[0179] It should be noted that, in some embodiments, the method may further include the following steps:
[0180] Randomly select a fifth number of parameter individuals from the target population as a fourth candidate population;
[0181] The first parameter individual in the fourth candidate population is used as the fourth individual;
[0182] generating a random probability within a third preset range;
[0183] When the random probability is in the first interval, the first mutation operation is performed on the fourth individual, and the individual mutation result of the first mutation operation is added to the target population; wherein the expression of the first mutation operation is:
[0184] C1=C1+normal(0,1)*(C max -C min );
[0185] C1=min(C max ,max(C min ,C1));
[0186] Where C1 represents the regularization coefficient of the fourth individual; normal(0,1) represents a random value with a normal distribution with a mean of 0 and a standard deviation of 1; C max and C min represents the maximum and minimum values of the regularization coefficient in the target population or the fourth candidate population respectively; wherein, C1 on the right side of the first formula represents the original regularization coefficient of the fourth individual, C1 on the left side of the first formula represents the regularization coefficient after the initial mutation of the fourth individual, and C1 in the second formula represents the regularization coefficient after the fourth individual completes the first mutation operation;
[0187] When the random probability is in the second interval, the second mutation operation is performed on the fourth individual, and the individual mutation result of the second mutation operation is added to the target population; wherein, the expression of the second mutation operation is:
[0188] g1=g1+normal(0,1)*(g max -g min );
[0189] g1=min(g max ,max(g min ,g1));
[0190] Where g1 represents the kernel parameter of the fourth individual; g max and g min represents the maximum and minimum values of the kernel parameters in the target population or the fourth candidate population respectively; wherein, g1 on the right side of the first formula represents the original kernel parameters of the fourth individual, g1 on the left side of the first formula represents the kernel parameters of the fourth individual after the initial mutation, and g1 in the second formula represents the kernel parameters of the fourth individual after the first mutation operation is completed;
[0191] When the random probability is in the third interval, the first mutation operation and the second mutation operation are performed on the fourth individual, and the individual mutation results of the first mutation operation and the second mutation operation are added to the target population;
[0192] The next parameter individual of the fourth individual in the fourth candidate population is taken as the fourth individual, and the step of generating random probability within the third preset range is returned to be executed until the individual variation results of each parameter individual in the fourth candidate population are added to the target population.
[0193] For example, in some specific implementations, the mutation operator can be applied to individuals based on probability. Taking the target population as an example to obtain sizePop+MaxCrossCnt individuals, the specific implementation can be as follows:
[0194] Now we have sizePop+MaxCrossCnt individuals, and the maximum number of mutations required is MaxMutateCnt (you can customize the configuration, the default is ), the mutation rules are as follows:
[0195] Randomly select MaxMutateCnt individuals, then traverse these individuals and perform mutation calculations one by one. If individual Individual1 participates in the mutation calculation, then calculate a random number r in [0,1]. If Then execute formulas (1) and (2) to perform the variation operation of the regularization coefficient C; if Then execute formulas (3) and (4) to perform the mutation operation of the kernel parameter g; if Then, formulas (1), (2), (3) and (4) are executed to perform mutation operations on the regularization coefficient C and the kernel parameter g.
[0196] Individual1={C1,g1}
[0197] C1=C1+normal(0,1)*(C max -C min ) (1)
[0198] C1=min(C max ,max(C min ,C1)) (2)
[0199] g1=g1+normal(0,1)*(g max -g min ) (3)
[0200] g1=min(g max ,max(g min ,g1)) (4)
[0201] Among them, normal(0,1) represents a normal distribution with a mean of 0 and a standard deviation of 1, g max and g max represents the maximum and minimum values of the kernel parameter g, C max and C max Represents the maximum and minimum values of the regularization coefficient C, where the maximum and minimum values of the kernel parameter g and the regularization coefficient C can be the maximum and minimum values among sizePop+MaxCrossCnt individuals, or the maximum and minimum values among MaxMutateCnt individuals.
[0202] It should be noted that the mutation operator occurs directly on individuals. After MaxMutateCnt mutations, no new individuals are added, and the population size remains sizePop+MaxCrossCnt individuals.
[0203] S600, adding 1 to the number of iterations, taking the target population as the parameter population, returning to execute the step of applying each parameter individual in the parameter population to the support vector machine in turn, until the number of iterations reaches the iteration upper limit, applying the target individual to the support vector machine to obtain the target prediction model;
[0204] For example, in some specific implementations, the individuals of the population have just undergone genetic operations (including selection, crossover and mutation, etc.), indicating that a population reproduction has been completed, and a new generation of population has been obtained through the survival of the fittest. Steps S300 to S500 are the innermost loop, and the number of iterations increases by one each time it is executed. If the number of iterations exceeds the maximum value MaxGenCnt (i.e., the upper limit of iterations, which can be customized and is 20 by default), it indicates that the optimal parameters of the SVM prediction model have been found, otherwise it returns to step S300.
[0205] S700, obtaining real-time data from the drilling site, and inputting the real-time data into a target prediction model to obtain a real-time prediction result of an accident;
[0206] For example, in some specific implementations, the real-time data here is obtained from on-site drilling reports, mud reports, completion reports and other materials, or from on-site monitoring systems, and is real-time operation data on the front line. 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, etc.
[0207] These data can be manually transcribed according to needs, or automatically generated by the monitoring system. Based on these data, they are input into the drilling accident prediction SVM support vector machine model to make on-site drilling accident predictions.
[0208] S800, checking the accuracy of the real-time accident prediction results;
[0209] Among them, accuracy includes correct prediction and prediction error; when the accuracy is a prediction error, the real-time prediction result of the accident is corrected;
[0210] For example, in some specific implementations, real-time data is input into a drilling accident prediction SVM support vector machine model to make on-site drilling accident predictions. Then, combined with manual experience, it is determined whether the prediction result is correct based on the verification signal of manual feedback.
[0211] S900, associating the real-time data with the real-time accident prediction result and adding them to the data set; incrementally updating the preset update threshold based on accuracy;
[0212] Wherein, when the accuracy is that the prediction is correct, the update threshold is added to the first parameter for incremental update, otherwise, the update threshold is added to the second parameter for incremental update;
[0213] For example, in some specific implementations, if the prediction result is correct, the real-time data is directly added to the data set, that is, the data set is updated. If the prediction result is wrong, the result is modified to be correct, and then the real-time data is added to the data set, that is, the data set is updated. Specifically, the update process of updating the threshold value can be implemented as follows:
[0214] Based on real-time data prediction, if the prediction fails, the Delt update formula is as follows:
[0215] Delt = Delt + 1;
[0216] Based on real-time data prediction, if the prediction is successful, the Delt update formula is as follows:
[0217] Delt = Delt + 2;
[0218] S1000, when reaching the next prediction node, return to the step of obtaining real-time data of the drilling site until the update threshold reaches the upper threshold limit, reset the update threshold to 0, return to the step of initializing the parameter population, and continuously update the target prediction model.
[0219] For example, in some specific implementations, if the SVM model update threshold Delt exceeds MaxDelt (ie, the upper threshold limit), the SVM model needs to be updated, otherwise the current model can continue to be used.
[0220] 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.
[0221] First of all, it should be noted that 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.
[0222] Among them, the shortcomings of the prior art are as follows:
[0223] 1) Delays in early warning response: The current early warning system is highly dependent on manual analysis and judgment, resulting in low processing efficiency, slow emergency response, and difficulty in responding quickly.
[0224] 2) The difficulty of data analysis has increased dramatically: the amount of data has grown exponentially and the data dimensions have expanded rapidly, increasing the complexity and difficulty of manual processing and understanding of data.
[0225] 3) The iteration and upgrade of the classification model is slow, and there is a lack of immediate integration of field operation data to update the overall data set, which in turn affects the timeliness of the model iteration and update.
[0226] In view of this, in order to further prevent drilling accidents and reduce the losses caused by drilling accidents, the present invention proposes to improve the genetic algorithm to optimize the SVM support vector machine to enhance the drilling prediction ability. Figure 8 As shown, the real-time prediction method for drilling accidents of the present invention can be implemented as follows:
[0227] Step 1: Get the latest data set. The drilling data used in this article mainly consists of historical data and field operation data, which together constitute the data set.
[0228] Historical data 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 accidents such as leakage, well gusher, and blowout occurred during the drilling process, while some data show that the drilling process was normal.
[0229] Field operation data is the front-line operation data. First, the SVM drilling accident prediction model is used to predict whether drilling accidents such as well leakage, well kick, and blowout will occur. Then, the results are manually determined to be correct. Whether the prediction is correct or wrong, the data will be added to the drilling data set. When the data prediction continues to be correct, the SVM drilling accident prediction model will be updated regularly according to the configuration; when the data prediction fails, if certain conditions are met, the SVM drilling accident prediction model will be triggered to update.
[0230] 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, original fracture direction, cement slurry density, drilling fluid density, inlet flow, outlet flow, pump displacement, and whether the three abnormal conditions such as drilling leakage, well kick, and blowout were sent in this set of data.
[0231] Here, it should be noted that the iterative update of the SVM drilling accident prediction model and the prediction results based on the SVM drilling accident prediction model are independent of each other, that is, they do not affect each other. When the iterative update of the SVM drilling accident prediction model is not completed, the prediction model uses the previous version of the model; when the iterative update is completed, it will trigger the prediction model version update, and the drilling accident prediction will be temporarily stopped during the version update. After the update, the latest version of the model will be used.
[0232] Step 2: Population initialization. The population is composed of a large number of individuals, each of which has multiple genes. In this paper, the core parameters of the SVM support vector machine include two parameters, namely, the regularization coefficient C and the kernel parameter g. That is, each individual has two genes, representing the regularization coefficient C and the kernel parameter g. The specific meanings of these two genes are as follows:
[0233] Regularization coefficient C: It is an important hyperparameter in SVM, which determines the model's tolerance for errors. It determines the model's tolerance for errors. A larger C value will cause the model to penalize more for misclassification and may overfit the data. A smaller C value will cause the model to penalize less for misclassification and may underfit the data. There is no fixed range for the value of C, which depends on the complexity of the data set problem. In practical applications, the value of C is between (0,10 8 ].
[0234] Kernel parameter g: It determines the width of the Gaussian kernel function, which affects the performance of the SVM model. A larger g value will result in a higher degree of fit of the model to the data, which may overfit the data. A smaller g value will result in a lower degree of fit of the model to the data, which may underfit the data. There is no fixed range for the value of g, which depends on the complexity of the data set problem. In practical applications, the value of g is between (0,10 2 ].
[0235] Through in-depth data query, facing the real-time prediction needs of drilling accidents, the final value range of the regularization coefficient C is (0,100], and the final value range of the kernel parameter g is (0,10]. Finally, the individual Individual is initialized by the following formula, where R(0,100) represents a random floating point number of (0,100], and R(0,10) represents a random floating point number of (0,10].
[0236] C = R (0, 100);
[0237] g = R (0, 10);
[0238] Individual = {C, g};
[0239] Step 3: Update the SVM prediction model. In step 1, the latest data set was obtained; in step 2, the key parameters of the SVM support vector machine were determined. Based on the latest data set, the drilling accident prediction SVM support vector machine model was obtained through training.
[0240] Step 4: Calculate the F1 score based on the SVM prediction model. Each individual in the population represents the core parameters of the support vector machine, including the regularization coefficient C and the kernel parameter g, that is, each individual represents an SVM support vector machine. Based on the individual, traverse each array of the latest data set, input it into the SVM support vector machine, get the prediction result, and then compare it with the actual result. This article uses the commonly used F1 score as the fitness function for evaluation. The F1 score is between [0,1]. The larger the score, the better the model performance. The calculation formula is as follows:
[0241]
[0242] Among them, True Positives indicates the number of samples correctly predicted by the model as positive; False Positives indicates the number of samples incorrectly predicted by the model as positive, which are actually negative; False Negatives indicates the number of samples incorrectly predicted by the model as negative, which are actually positive.
[0243] In general, the current latest data set is used as the benchmark, the current Individual is used as the input, and the F1 score of the output result, that is, the fitness function value, is calculated. At the same time, the BestIndividual with the best performance at the moment is recorded.
[0244] BestIndividual = {C, g};
[0245] Step 5: Apply the selection operator to individuals based on probability. The selection operator mainly selects better individuals based on probability. The larger the F1 score, the better the individual, and the smaller the F1 score, the worse the individual. The selection operator will select sizePop individuals. It should be noted that the population size SnowSizePop may exceed sizePop individuals. If the population size SnowSizePop exceeds sizePop individuals (snowSizePop>sizePop), only sizePop data will be selected, and the excess will be eliminated.
[0246] The core idea of selection is to first sort all individuals from small to large according to the F1 score, and then select SelectRate*sizePop data with the largest F1 score according to SelectRate (SelectRate can be customized, with a value range of [0,1] and a default of 0.5), that is, directly select the top ranked data.
[0247] The remaining (1-SelectRate)*sizePop individuals are randomly selected from the remaining snowSizePop-SelectRate*sizePop individuals. The selection rule is as follows: facing the remaining snowSizePop-SelectRate*sizePop individuals, randomly select N individuals each time (can be customized, no less than 2, default 5), select the one with the largest F1 score, and repeat this (1-SelectRate)*sizePop times. Finally, sizePop individuals are obtained.
[0248] sizePop individuals can also participate in subsequent calculations such as crossover operators and mutation operators.
[0249] In general, the advantage of the above selection operator is that excellent individuals will directly participate in the evolution of the population, but poor individuals still have the opportunity to participate in the evolution of the population, which not only increases the probability of excellent genes being selected, but also ensures the diversity of genes.
[0250] Step 6: Apply the crossover operator to individuals based on probability. Now we have sizePop individuals, and the maximum number of crossovers required is MaxCrossCnt (which can be customized and defaults to ), the crossover rules are as follows:
[0251] Each time, randomly select N individuals (customizable, no less than 2, default 5), select the largest and smallest F1 scores for crossover, and repeat this process for a total of MaxCorssCnt times. Note that the individuals obtained by crossover are new individuals. After the crossover operator, the size of the entire population increases by MaxCorssCnt, that is, the population has a total of sizePop+MaxCorssCnt individuals.
[0252] Individual1 = {C1, g1};
[0253] Individual2 = {C2, g2};
[0254] If two individuals Individual1 and Individual2 are crossed, the new individual Individual3 is obtained after the crossover, where min means finding the minimum value, abs means finding the absolute value, and R(0,1) means a random value of [0,1].
[0255] Individual3 = {C3, g3};
[0256] C3=min(C1,C2)+abs(C1-C2)*R(0,1);
[0257] g3=min(g1,g2)+abs(g1-g2)*R(0,1);
[0258] Step 7: Apply mutation operators to individuals based on probability. Now we have sizePop+MaxCrossCnt individuals, and the maximum number of mutations required is MaxMutateCnt (which can be customized and is the default). ), the mutation rules are as follows:
[0259] Randomly select MaxMutateCnt individuals, then traverse these individuals and perform mutation calculations one by one. If individual Individual1 participates in the mutation calculation, then calculate a random number r in [0,1]. If Then execute formulas (1) and (2) to perform the variation operation of the regularization coefficient C; if Then execute formulas (3) and (4) to perform the mutation operation of the kernel parameter g; if Then, formulas (1), (2), (3) and (4) are executed to perform mutation operations on the regularization coefficient C and the kernel parameter g.
[0260] Individual1={C1,g1}
[0261] C1=C1+normal(0,1)*(C max -C min ) (1)
[0262] C1=min(C max ,max(C min ,C1)) (2)
[0263] g1=g1+normal(0,1)*(g max -g min ) (3)
[0264] g1=min(g max ,max(g min ,g1)) (4)
[0265] Among them, normal(0,1) represents a normal distribution with a mean of 0 and a standard deviation of 1, g max and g max represents the maximum and minimum values of the kernel parameter g, C max and C max Represents the maximum and minimum values of the regularization coefficient C, where the maximum and minimum values of the kernel parameter g and the regularization coefficient C can be the maximum and minimum values among sizePop+MaxCrossCnt individuals, or the maximum and minimum values among MaxMutateCnt individuals.
[0266] It should be noted that the mutation operator occurs directly on individuals. After MaxMutateCnt mutations, no new individuals are added, and the population size remains sizePop+MaxCrossCnt individuals.
[0267] Step 8: Get the next generation of population. After steps 5 to 7, these individuals have just undergone operations such as selection, crossover and mutation, indicating that a population reproduction has been completed. Through the survival of the fittest, a new generation of population is obtained.
[0268] Step 9: Satisfy the maximum number of iterations. Steps 3 to 9 are the innermost loop. Each time it is executed, the number of iterations increases by one. If the number of iterations exceeds the maximum value MaxGenCnt (which can be customized and is 20 by default), go to step 10, otherwise go to step 3.
[0269] Step 10: Find the optimal parameters of the SVM prediction model. When this step is reached, the inner loop process is completed, indicating that the optimal parameters BestIndividual have been obtained.
[0270] BestIndividual={C,g}
[0271] Step 11: Update the SVM prediction model. In step 1, the latest data set was obtained; in step 10, the key parameter of the SVM support vector machine, BestIndividual, was determined. Based on the latest data set, the drilling accident prediction SVM support vector machine model was obtained through training.
[0272] At the same time, reset the SVM model update threshold Delt to the default value (you can customize the configuration, the default is 0, the maximum value is MaxDelt, the MaxDelt value range is [1,100], and the default is 20). The SVM model update threshold Delt indicates whether an update is needed. If Delt>MaxDelt, it means that an update is needed immediately, otherwise it means that no update is needed for the time being.
[0273] Step 12: Get real-time data. The real-time data here is obtained from the on-site drilling report, mud report and completion report, or the on-site monitoring system, and belongs to the real-time operation data of the front line. 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, etc.
[0274] These data can be manually transcribed according to needs, or automatically generated by the monitoring system. Based on these data, they are input into the drilling accident prediction SVM support vector machine model to make on-site drilling accident predictions.
[0275] Step 13: Calculate the prediction accuracy based on the SVM prediction model. Based on real-time data, input it into the drilling accident prediction SVM support vector machine model to make on-site drilling accident predictions. Then combine manual experience to determine whether the prediction results are correct.
[0276] Step 14: Add real-time data to the data set. If the prediction result is correct, directly add the real-time data to the data set, that is, update the data set. If the prediction result is wrong, modify the result to be correct, and then add the real-time data to the data set, that is, update the data set.
[0277] Step 15: Update the update threshold. The calculation formula is as follows:
[0278] Based on real-time data prediction, if the prediction fails, the Delt update formula is as follows:
[0279] Delt = Delt + 1;
[0280] Based on real-time data prediction, if the prediction is successful, the Delt update formula is as follows:
[0281] Delt = Delt + 2;
[0282] Step 16: Update the SVM model. If the SVM model update threshold Delt exceeds MaxDelt, the SVM model needs to be updated, and go to step 17. Otherwise, the current model can continue to be used, and go to step 12.
[0283] Step 17: Reset all parameters. Reset the parameters related to the genetic algorithm, including resetting the number of iterations to 0, etc. Go to step 1.
[0284] To summarize, steps 1 to 11 are based on the latest data set to find the optimal parameters, so as to iteratively update and obtain the optimal SVM drilling accident prediction model; steps 12 to 17 are based on real-time operation data, and are oriented to the drilling accident prediction SVM support vector machine model to predict whether well leakage, well kick, blowout and other accidents will occur. These two processes are independent of each other, that is, they do not affect each other. When the iterative update of the SVM drilling accident prediction model is not completed, the prediction model uses the previous version of the model; when the iterative update is completed, the prediction model version update will be triggered, and the drilling accident prediction will be temporarily stopped during the version update. After the update, the latest version of the model will be used.
[0285] In summary, the present invention proposes a real-time prediction method for drilling accidents by improving genetic algorithm to optimize SVM support vector machine, which finds the optimal parameters of SVM support vector machine by improving genetic algorithm and supports rapid update of classification model, so as to make the prediction of drilling accident prediction model more accurate and real-time. Compared with the prior art, the present invention has at least the following beneficial effects:
[0286] 1) A drilling accident prediction method based on SVM support vector machine was proposed. Relying on SVM support vector machine, the intelligence level of accident warning was significantly enhanced.
[0287] 2) A method based on improved genetic algorithm to search for the optimal parameters of SVM support vector machine was proposed, which automated the network parameter adjustment process and improved the accuracy of early warning.
[0288] 3) Integrate field operation data to verify prediction results and accelerate the iterative upgrade of the SVM drilling accident prediction model, thereby ensuring the real-time update and rapid prediction capabilities of the SVM drilling accident prediction model.
[0289] On the other hand, Fig. 9 As shown, an embodiment of the present invention provides a real-time prediction device 900 for drilling accidents, which may include:
[0290] The first module 901 is used to obtain a data set; the data set includes multiple sets of drilling data and label information of whether a drilling accident occurs in the data set;
[0291] The second module 902 is used to initialize the parameter population; the parameter population includes a plurality of parameter individuals, and the gene of each parameter individual includes a regularization coefficient and a kernel parameter;
[0292] The third module 903 is used to apply each parameter individual in the parameter population to the support vector machine in turn, and then obtain the training result corresponding to each parameter individual in the parameter population through data set training;
[0293] The fourth module 904 is used to evaluate the F1 score corresponding to each parameter individual based on the training results combined with the label information; the maximum F1 score is used as the candidate score, and when the candidate score is greater than the target score, the parameter individual corresponding to the candidate score is used as the target individual, and the candidate score is used as the target score;
[0294] The fifth module 905 is used to perform genetic processing on the parameter population based on the F1 score corresponding to each parameter individual to obtain a target population;
[0295] The sixth module 906 is used to increase the number of iterations by 1, use the target population as the parameter population, return to execute the third module until the number of iterations reaches the iteration upper limit, and apply the target individual to the support vector machine to obtain the target prediction model;
[0296] The seventh module 907 is used to obtain real-time data of the drilling site, and input the real-time data into the target prediction model to obtain the real-time prediction result of the accident;
[0297] The eighth module 908 is used to check the accuracy of the real-time accident prediction result; wherein the accuracy includes a correct prediction and a wrong prediction; when the accuracy is a wrong prediction, the real-time accident prediction result is corrected;
[0298] The ninth module 909 is used to associate the real-time data with the real-time accident prediction result and add it to the data set; and incrementally update the preset update threshold based on the accuracy;
[0299] The tenth module 910 is used to return to execute the seventh module when reaching the next prediction node, until the update threshold reaches the upper threshold limit, reset the update threshold to 0, return to execute the second module, and continuously update the target prediction model.
[0300] In some embodiments, the apparatus may further include:
[0301] An eleventh module is used to randomly select a third number of parameter individuals from the target population as a third candidate population;
[0302] The twelfth module is used to perform a crossover operation on the first individual with the highest F1 score and the second individual with the lowest F1 score in the third candidate population to obtain a third individual; and add the third individual to the target population;
[0303] The expression of the crossover operation is:
[0304] C3=min(C1,C2)+abs(C1-C2)*R(0,1);
[0305] g3=min(g1,g2)+abs(g1-g2)*R(0,1);
[0306] In the formula, C represents the regularization coefficient, g represents the kernel parameter; {C1, g1} represents the first individual, {C2, g2} represents the second individual, and {C3, g3} represents the third individual; min represents the minimum value; abs represents the absolute value; R(0,1) represents a random value of [0,1];
[0307] The thirteenth module is used to return to execute the eleventh module until the third individual of the fourth quantity is added to the target population.
[0308] In some embodiments, the apparatus may further include:
[0309] A fourteenth module is used for randomly selecting a fifth number of parameter individuals from the target population as a fourth candidate population;
[0310] A fifteenth module is used to use the first parameter individual in the fourth candidate population as the fourth individual;
[0311] A sixteenth module, used to generate a random probability within a third preset range;
[0312] The seventeenth module is used for performing a first mutation operation on the fourth individual when the random probability is in the first interval, and adding the individual mutation result of the first mutation operation to the target population;
[0313] Among them, the expression of the first mutation operation is:
[0314] C1=C1+normal(0,1)*(C max -C min );
[0315] C1=min(C max ,max(C min ,C1));
[0316] Where C1 represents the regularization coefficient of the fourth individual; normal(0,1) represents a random value with a normal distribution with a mean of 0 and a standard deviation of 1; C max and C min represents the maximum and minimum values of the regularization coefficient in the target population or the fourth candidate population respectively;
[0317] An eighteenth module is used for performing a second mutation operation on the fourth individual when the random probability is in the second interval, and adding the individual mutation result of the second mutation operation to the target population;
[0318] Among them, the expression of the second mutation operation is:
[0319] g1=g1+normal(0,1)*(g max -g min );
[0320] g1=min(g max ,max(g min ,g1));
[0321] Where g1 represents the kernel parameter of the fourth individual; g max and g min represents the maximum and minimum values of the kernel parameters in the target population or the fourth candidate population respectively;
[0322] A nineteenth module is used for performing a first mutation operation and a second mutation operation on a fourth individual when the random probability is in a third interval, and adding individual mutation results of the first mutation operation and the second mutation operation to a target population;
[0323] The twentieth module is used to take the next parameter individual of the fourth individual in the fourth candidate population as the fourth individual, and return to execute the sixteenth module until the individual variation results of each parameter individual in the fourth candidate population are added to the target population.
[0324] 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.
[0325] 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.
[0326] 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.
[0327] 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:
[0328] 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.
[0329] 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;
[0330] Input / output interface 1003, used to implement information input and output;
[0331] 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.);
[0332] 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 );
[0333] 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 .
[0334] 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.
[0335] 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.
[0336] 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.
[0337] 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.
[0338] 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.
[0339] 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.
[0340] 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.
[0341] 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.
[0342] 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.
[0343] 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.
[0344] 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.
[0345] 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.
[0346] 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.
[0347] 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.
[0348] 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.
[0349] 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.
[0350] 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.
[0351] 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 real-time prediction method for drilling accidents, characterized in that: The following steps are involved: Acquire a data set; the data set includes multiple sets of drilling data and label information of whether a drilling accident occurs in the set of data; Initializing a parameter population; the parameter population includes a plurality of parameter individuals, and the gene of each parameter individual includes a regularization coefficient and a kernel parameter; Applying each of the parameter individuals in the parameter population to a support vector machine in turn, and then obtaining a training result corresponding to each of the parameter individuals in the parameter population through training with the data set; Based on the training results and the label information, an F1 score corresponding to each parameter individual is obtained; The maximum F1 score is used as a candidate score, and when the candidate score is greater than the target score, the parameter individual corresponding to the candidate score is used as the target individual, and the candidate score is used as the target score; Based on the F1 score corresponding to each of the parameter individuals, performing genetic processing on the parameter population to obtain a target population; Add 1 to the number of iterations, use the target population as the parameter population, return to the step of applying each parameter individual in the parameter population to the support vector machine in turn, until the number of iterations reaches the iteration upper limit, and apply the target individual to the support vector machine to obtain a target prediction model; Acquire real-time data from the drilling site, and input the real-time data into the target prediction model to obtain a real-time prediction result of an accident; Checking the accuracy of the real-time accident prediction result; wherein the accuracy includes correct prediction and wrong prediction; when the accuracy is wrong prediction, correcting the real-time accident prediction result; Associating the real-time data with the real-time accident prediction result and adding them to the data set; incrementally updating the preset update threshold based on the accuracy; When the next prediction node is reached, the step of obtaining real-time data of the drilling site is returned to execute until the update threshold reaches the upper threshold limit, the update threshold is reset to 0, and the step of initializing the parameter population is returned to execute to continuously update the target prediction model.
2. The real-time prediction method for drilling accidents according to claim 1, characterized in that: The initialization parameter population includes the following steps: constructing a preset number of the regularization coefficients based on random numbers within a first preset range; Constructing the preset number of kernel parameters based on random numbers within a second preset range; The preset number of parameter individuals are obtained according to the preset number of regularization coefficients and the pairing of the kernel parameters, thereby completing the initialization of the parameter population.
3. The real-time prediction method for drilling accidents according to claim 1, characterized in that: The step of applying each parameter individual in the parameter population to a support vector machine in turn, and then obtaining a training result corresponding to each parameter individual in the parameter population through training with the data set, comprises the following steps: Applying the regularization coefficient and the kernel parameter corresponding to the parameter individual to the support vector machine to obtain a support vector machine model; Inputting each group of the drilling data in the data set into the vector machine model in sequence, and outputting the drilling accident prediction result corresponding to each group of the drilling data through prediction by the vector machine model; The training results corresponding to the parameter individuals are obtained by sorting out the drilling accident prediction results corresponding to all the drilling data.
4. The real-time prediction method for drilling accidents according to claim 1, characterized in that: The training result includes a drilling accident prediction result corresponding to each group of the drilling data in the data set, and the drilling accident prediction result includes whether a drilling accident occurred or did not occur; the F1 score corresponding to each parameter individual is obtained based on the training result combined with the label information evaluation, including the following steps: Comparing the drilling accident prediction result corresponding to each group of the drilling data in the data set with the label information; According to the comparison result, the first number of samples correctly predicted as positive, the second number of samples incorrectly predicted as positive, and the third number of samples incorrectly predicted as negative are obtained; wherein the positive class indicates that the drilling accident prediction result is that a drilling accident has occurred, and the negative class indicates that the drilling accident prediction result is that no drilling accident has occurred; The F1 score corresponding to the parameter individual is calculated based on the first sample number, the second sample number, and the third sample number.
5. The real-time prediction method for drilling accidents according to claim 1, characterized in that: The step of performing genetic processing on the parameter population based on the F1 score corresponding to each parameter individual to obtain a target population comprises the following steps: Sort the parameter individuals in the parameter population according to the F1 scores in ascending order to obtain a first population; Obtaining a first number of the parameter individuals with the highest F1 scores from the first population as a first candidate population; Randomly obtain a second number of the parameter individuals from the first population except the first candidate population as a second candidate population; The first candidate population and the second candidate population are combined as the target population.
6. The real-time prediction method for drilling accidents according to claim 1, characterized in that: The method further comprises the following steps: Randomly selecting a third number of the parameter individuals from the target population as a third candidate population; Performing a crossover operation on the first individual with the highest F1 score and the second individual with the lowest F1 score in the third candidate population to obtain a third individual; and adding the third individual to the target population; The expression of the crossover operation is: C3=min(C1,C2)+abs(C1-C2)*R(0,1); g3=min(g1,g2)+abs(g1-g2)*R(0,1); In the formula, C represents the regularization coefficient, g represents the kernel parameter; {C1, g1} represents the first individual, {C2, g2} represents the second individual, and {C3, g3} represents the third individual; min represents the minimum value; abs represents the absolute value; R(0,1) represents a random value of [0,1]; Return to the step of randomly selecting a third number of the parameter individuals from the target population as a third candidate population until a fourth number of the third individuals are added to the target population.
7. The real-time prediction method for drilling accidents according to claim 1, characterized in that: The method further comprises the following steps: Randomly selecting a fifth number of the parameter individuals from the target population as a fourth candidate population; Taking the first parameter individual in the fourth candidate population as the fourth individual; generating a random probability within a third preset range; When the random probability is in the first interval, performing a first mutation operation on the fourth individual, and adding the individual mutation result of the first mutation operation to the target population; The expression of the first mutation operation is: C1=C1+normal(0,1)*(C max -C min ); C1=min(C max ,max(C min ,C1)); Where C1 represents the regularization coefficient of the fourth individual; normal(0,1) represents a random value with a normal distribution with a mean of 0 and a standard deviation of 1; C max and C min represents the maximum and minimum values of the regularization coefficient in the target population or the fourth candidate population respectively; When the random probability is in the second interval, performing a second mutation operation on the fourth individual, and adding the individual mutation result of the second mutation operation to the target population; The expression of the second mutation operation is: g1=g1+normal(0,1)*(g max -g min ); g1=min(g max ,max(g min ,g1)); Where g1 represents the kernel parameter of the fourth individual; g max and g min represents the maximum and minimum values of the kernel parameters in the target population or the fourth candidate population respectively; When the random probability is in a third interval, performing the first mutation operation and the second mutation operation on the fourth individual, and adding individual mutation results of the first mutation operation and the second mutation operation to the target population; The next parameter individual of the fourth individual in the fourth candidate population is taken as the fourth individual, and the step of generating random probability within the third preset range is returned to be executed until the individual variation results of each parameter individual in the fourth candidate population are added to the target population.
8. A real-time prediction device for drilling accidents, characterized in that: include: The first module is used to obtain a data set; the data set includes multiple sets of drilling data and label information of whether a drilling accident occurs in the data set; The second module is used to initialize the parameter population; the parameter population includes a plurality of parameter individuals, and the gene of each parameter individual includes a regularization coefficient and a kernel parameter; The third module is used to apply each parameter individual in the parameter population to the support vector machine in turn, and then obtain the training result corresponding to each parameter individual in the parameter population through the data set training; A fourth module is used to evaluate and obtain the F1 score corresponding to each parameter individual based on the training result combined with the label information; The maximum F1 score is used as a candidate score, and when the candidate score is greater than the target score, the parameter individual corresponding to the candidate score is used as the target individual, and the candidate score is used as the target score; A fifth module is used to perform genetic processing on the parameter population based on the F1 score corresponding to each of the parameter individuals to obtain a target population; The sixth module is used to increase the number of iterations by 1, use the target population as the parameter population, return to execute the third module until the number of iterations reaches the iteration upper limit, and apply the target individual to the support vector machine to obtain a target prediction model; The seventh module is used to obtain real-time data of the drilling site, and input the real-time data into the target prediction model to obtain a real-time prediction result of the accident; The eighth module is used to check the accuracy of the real-time accident prediction result; wherein the accuracy includes correct prediction and wrong prediction; when the accuracy is wrong prediction, the real-time accident prediction result is corrected; A ninth module is used to associate the real-time data with the real-time accident prediction result and add it to the data set; and incrementally update the preset update threshold based on the accuracy; The tenth module is used to return to execute the seventh module when reaching the next prediction node, until the update threshold reaches the upper threshold limit, reset the update threshold to 0, return to execute the second module, and continuously update the target prediction model.
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
Oilfield warehouse location method under environment of uncertain well location
CN107274039A
Method for predicting frictional resistance coefficients of roadways of mines on basis of support vector machines
CN107729671A
Accident prediction method and device for drilling operation, electronic equipment and storage medium
CN114897225A
Intelligent drilling system, abnormal state detection method thereof and medium thereof
CN118481604A
Well drilling accident early warning method and device, electronic equipment and storage medium
CN118981637A