A drilling accident real-time prediction method and device, electronic equipment and storage medium
By optimizing the parameter population using support vector machines and genetic algorithms, a real-time drilling accident prediction model was constructed, which solved the problem of human bias in drilling accident prediction and achieved efficient and accurate drilling accident prediction and adaptive updates.
Patent Information
- Application Number
- CN202411700346.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-26
- Publication Date
- 2026-01-13
- Estimated Expiration
- 2044-11-26
AI Technical Summary
Existing technologies rely on subjective judgment by experts in drilling accident prediction, which is prone to human bias and difficulty in dissemination, thus limiting the accuracy and scope of application of predictions.
By employing support vector machines and genetic algorithms, drilling data and label information are acquired, parameter populations are initialized, iterative optimization is performed, a target prediction model is constructed, and the model is updated in real time to improve prediction accuracy.
It improves the accuracy and efficiency of drilling accident prediction, reduces the risk of human intervention, has adaptive update capabilities, adapts to changes in the drilling site, and maintains predictive performance.
Smart Images

Figure CN119647668B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data processing technology, and in particular to a method, apparatus, electronic device, and storage medium for real-time prediction of drilling accidents. Background Technology
[0002] Currently, the technical field generally relies on experts to conduct intuitive assessments based on real-time data transmitted from sensors. This assessment process deeply integrates rich experience from the drilling site, aiming to identify drilling conditions and provide early warnings of potential accidents. While this approach embodies a wealth of practical wisdom and has demonstrated unique value in real-world applications, it also exposes some inherent limitations.
[0003] Specifically, the current evaluation process for technical solutions relies heavily on the subjective judgment of experts, which inevitably introduces the risks of human bias and subjectivity. Furthermore, this valuable knowledge and judgment methods based on extensive practical experience are difficult to disseminate widely and lack efficient application mechanisms, significantly limiting their scope of application and practical effectiveness.
[0004] In conclusion, although existing technical solutions reflect the value of practical wisdom to some extent, they are limited by the subjectivity of human judgment and the difficulties in knowledge dissemination and application. Summary of the Invention
[0005] This invention aims to at least partially address the limitations of related technologies. To this end, this invention proposes a method, apparatus, electronic device, and storage medium for real-time prediction of drilling accidents, capable of efficiently and accurately predicting drilling accidents in real time.
[0006] On one hand, embodiments of the present invention provide a method for real-time prediction of drilling accidents, including:
[0007] Obtain the dataset; the dataset includes multiple sets of drilling data and tag information indicating whether a drilling accident occurred under the given data conditions;
[0008] Initialize the parameter population; the parameter population consists of multiple parameter individuals, and the genes of each parameter individual include a regularization coefficient and a kernel parameter;
[0009] Each individual parameter in the parameter population is applied to the support vector machine in turn, and then the training result corresponding to each individual parameter in the parameter population is obtained through training on the dataset;
[0010] The F1 score for each individual parameter is evaluated based on the training results and label information. The largest F1 score is taken as the candidate score. When the candidate score is greater than the target score, the individual parameter corresponding to the candidate score is taken as the target individual and the candidate score is taken as the target score.
[0011] Based on the F1 score of each individual parameter, the parameter population is genetically processed to obtain the target population.
[0012] Increment the iteration count by 1, 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 iteration count reaches the iteration limit, and apply the target individual to the support vector machine to obtain the target prediction model;
[0013] Acquire 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] The accuracy of real-time accident prediction results is verified; accuracy includes correct prediction and incorrect prediction; when the accuracy is incorrect, the real-time accident prediction results are corrected.
[0015] The real-time data is correlated with the real-time accident prediction results and added to the dataset; the preset update threshold is incrementally updated based on the accuracy.
[0016] When the next prediction node is reached, return to the step of obtaining real-time data from the drilling site until the update threshold reaches the upper limit. Then, reset the update threshold to 0 and return to the step of initializing the parameter population to continuously update the target prediction model.
[0017] Optionally, the parameter population is initialized, including the following steps:
[0018] A preset number of regularization coefficients are constructed based on random numbers within a first preset range;
[0019] A preset number of kernel parameters are constructed based on random numbers within a second preset range;
[0020] A preset number of parameter individuals are obtained by pairing a preset number of regularization coefficients and kernel parameters, thereby completing the initialization of the parameter population.
[0021] Optionally, each individual parameter in the parameter population is sequentially applied to a support vector machine, and then the training result corresponding to each individual parameter in the parameter population is obtained through training on a dataset, including the following steps:
[0022] The regularization coefficients and kernel parameters corresponding to individual parameters are applied to the support vector machine to obtain the vector machine model;
[0023] Each set of drilling data in the dataset is sequentially input into the vector machine model, and the vector machine model predicts and outputs the drilling accident prediction results corresponding to each set of drilling data.
[0024] The training results for each parameter individual are obtained by compiling the drilling accident prediction results corresponding to all drilling data.
[0025] Optionally, the training results include drilling accident prediction results for each group of drilling data in the dataset, whereby the drilling accident prediction results include whether a drilling accident occurred or not; based on the training results and label information, the F1 score corresponding to each individual parameter is evaluated, including the following steps:
[0026] The drilling accident prediction results and tag information corresponding to each group of drilling data in the dataset are compared;
[0027] Based on the comparison results, the number of first samples correctly predicted as positive, the number of second samples incorrectly predicted as positive, and the number of third samples incorrectly predicted as negative are obtained; among them, 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 a drilling accident has not occurred.
[0028] The F1 score for each individual parameter is calculated based on the first, second, and third sample sizes.
[0029] Optionally, based on the F1 score corresponding to each parameter individual, the parameter population is genetically processed to obtain the target population, including the following steps:
[0030] The parameter individuals in the parameter population are sorted in ascending order of their F1 scores to obtain the first population;
[0031] The first number of individuals with the highest F1 scores from the first population are selected as the first candidate population.
[0032] A second number of parameter individuals are randomly selected from the first population, excluding the first candidate population, to serve as the second candidate population;
[0033] The first and second candidate populations were merged to form the target population.
[0034] Optionally, the method further includes the following steps:
[0035] A third number of parameter individuals are randomly selected from the target population as the 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 for the crossover operation is:
[0038] ;
[0039] ;
[0040] In the formula, C represents the regularization coefficient, g represents the kernel parameter; {C1, g1} represents the first body, {C2, g2} represents the second body, {C3, g3} represents the third body; min represents taking the minimum value; abs represents taking the absolute value; R(0,1) represents a random value in [0,1].
[0041] Return to the step of randomly selecting a third number of parameter individuals from the target population as the third candidate population, until a fourth number of third individuals are added to the target population.
[0042] Optionally, the method further includes the following steps:
[0043] The fifth number of parameter individuals are randomly selected from the target population as the fourth candidate population;
[0044] The first individual with the first parameter in the fourth candidate population is taken as the fourth individual;
[0045] Generate random probabilities within a third preset range;
[0046] When the random probability is in the first interval, perform the first mutation operation on the fourth individual and add the mutation result of the first mutation operation to the target population.
[0047] The expression for the first mutation operation is:
[0048] ;
[0049] ;
[0050] In the formula, C1 represents the regularization coefficient of the fourth individual; normal(0,1) represents a random value distributed normally with a mean of 0 and a standard deviation of 1; C max and C min These represent 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, perform the second mutation operation on the fourth individual and add the mutation result of the second mutation operation to the target population.
[0052] The expression for the second mutation operation is:
[0053] ;
[0054] ;
[0055] In the formula, g1 represents the kernel parameter of the fourth individual; g max and g min These represent the maximum and minimum values of the kernel parameter in the target population or the fourth candidate population, respectively.
[0056] When the random probability is in the third interval, perform the first mutation operation and the second mutation operation on the fourth individual, and add the individual mutation results of the first mutation operation and the second mutation operation to the target population.
[0057] The next parameter individual in the fourth candidate population is taken as the fourth individual, and the process of generating random probabilities within the third preset range is repeated until the individual mutation results of each parameter individual in the fourth candidate population are added to the target population.
[0058] On the other hand, embodiments of the present invention provide a real-time drilling accident prediction device, comprising:
[0059] The first module is used to acquire a dataset; the dataset includes multiple sets of drilling data and tag information indicating whether a drilling accident occurred under the given data conditions;
[0060] The second module is used to initialize the parameter population; the parameter population consists of 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 individual parameter in the parameter population to the support vector machine in turn, and then obtain the training result corresponding to each individual parameter in the parameter population through the training of the dataset.
[0062] The fourth module is used to evaluate the F1 score of each individual parameter based on the training results and label information; the largest F1 score is used as the candidate score, and when the candidate score is greater than the target score, the individual parameter 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 of each parameter individual to obtain the target population;
[0064] The sixth module is used to increment the iteration count by 1, use the target population as the parameter population, return to execute the third module, and continue until the iteration count reaches the iteration limit. The target individuals are then applied to the support vector machine to obtain the target prediction model.
[0065] The seventh module is used to acquire real-time data from the drilling site and input the real-time data into the target prediction model to obtain real-time accident prediction results.
[0066] The eighth module is used to verify the accuracy of the real-time accident prediction results; accuracy includes correct prediction and incorrect prediction; when the accuracy is incorrect, the real-time accident prediction results are corrected.
[0067] The ninth module is used to associate real-time data with real-time accident prediction results and add them to the dataset; it incrementally updates the preset update threshold based on accuracy.
[0068] The tenth module is used to return to the execution of the seventh module when the next prediction node is reached, until the update threshold reaches the upper limit of the threshold, then the update threshold is reset to 0, and the second module is returned to continuously update the target prediction model.
[0069] Optionally, the device further includes:
[0070] The eleventh module is used to randomly select a third number of parameter individuals from the target population as the third candidate population;
[0071] The twelfth module is used to perform a crossover operation between 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; the third individual is then added to the target population.
[0072] The expression for the crossover operation is:
[0073] ;
[0074] ;
[0075] In the formula, C represents the regularization coefficient, g represents the kernel parameter; {C1, g1} represents the first body, {C2, g2} represents the second body, {C3, g3} represents the third body; min represents taking the minimum value; abs represents taking the absolute value; R(0,1) represents a random value in [0,1].
[0076] Module 13 is used to return to the execution of Module 11 until the target population is joined by the third individual of the fourth number.
[0077] Optionally, the device further includes:
[0078] The fourteenth module is used to randomly select the fifth number of parameter individuals from the target population as the fourth candidate population;
[0079] The fifteenth module is used to select the first parameter individual in the fourth candidate population as the fourth individual;
[0080] The sixteenth module is used to generate random probabilities within a third preset range;
[0081] The seventeenth module is used to perform the first mutation operation on the fourth individual when the random probability is in the first interval, and to add the mutation result of the first mutation operation to the target population.
[0082] The expression for the first mutation operation is:
[0083] ;
[0084] ;
[0085] In the formula, C1 represents the regularization coefficient of the fourth individual; normal(0,1) represents a random value distributed normally with a mean of 0 and a standard deviation of 1; C max and C min These represent the maximum and minimum values of the regularization coefficient in the target population or the fourth candidate population, respectively.
[0086] The eighteenth module is used to perform a second mutation operation on the fourth individual when the random probability is in the second interval, and to add the mutation result of the second mutation operation to the target population.
[0087] The expression for the second mutation operation is:
[0088] ;
[0089] ;
[0090] In the formula, g1 represents the kernel parameter of the fourth individual; g max and g min These represent the maximum and minimum values of the kernel parameter in the target population or the fourth candidate population, respectively.
[0091] The nineteenth module is used to perform the first mutation operation and the second mutation operation on the fourth individual when the random probability is in the third interval, and to add the individual mutation results of the first mutation operation and the second mutation operation to the 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 mutation results of each parameter individual in the fourth candidate population are added to the target population.
[0093] On the other hand, embodiments of the present invention provide an electronic device, including: a processor and a memory; the memory is used to store a program; the processor executes the program to implement the above-mentioned real-time prediction method for drilling accidents.
[0094] On the other hand, embodiments of the present invention provide a computer storage medium storing a processor-executable program, which, when executed by a processor, is used to implement the above-described real-time drilling accident prediction method.
[0095] This invention involves: acquiring a dataset including multiple sets of drilling data and label information indicating whether a drilling accident occurred under those data conditions; initializing a parameter population comprising multiple individual parameters, each individual's genes including a regularization coefficient and kernel parameters; sequentially applying each individual parameter to a support vector machine (SVM) to obtain training results for each individual parameter using the dataset; evaluating the F1 score for each individual parameter based on the training results and label information; using the highest F1 score as a candidate score, and when a candidate score is higher than a target score, designating the individual parameter corresponding to the candidate score as the target individual and the candidate score as the target score; performing genetic processing on the population based on the F1 score of each individual parameter to obtain the target population; incrementing the iteration count by 1 and using the target population as the parameter. The process involves several steps: First, the parameter population is initialized. Then, each individual parameter in the population is sequentially applied to the support vector machine (SVM) until the iteration limit is reached. The target individual is then applied to the SVM to obtain the target prediction model. Next, real-time data from the drilling site is acquired and input into the target prediction model to obtain a real-time accident prediction result. The accuracy of the real-time accident prediction result is checked, including both correct and incorrect predictions. If the accuracy is incorrect, the real-time accident prediction result is corrected. Real-time data is associated with the real-time accident prediction result and added to the dataset. A preset update threshold is incrementally updated based on the accuracy. Upon reaching the next prediction node, the process returns to the step of acquiring real-time data from the drilling site until the update threshold reaches its upper limit. The update threshold is then reset to 0, and the process returns to the step of initializing the parameter population, continuously updating the target prediction model. This embodiment of the invention offers the following beneficial effects:
[0096] Improving prediction accuracy: By iteratively optimizing the parameter population and combining it with F1 score evaluation, the optimal individual parameters can be selected 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 learn and update itself. By continuously feeding real-time data and prediction results back into the dataset and dynamically adjusting the update threshold based on the prediction accuracy, the model can adapt to changes in the drilling site and maintain its prediction performance.
[0098] Applications of efficient genetic algorithms: Optimizing the parameter population using genetic algorithms can explore the parameter space more efficiently and quickly locate the optimal solution compared to traditional methods, while reducing computational resource consumption.
[0099] Real-time response and dynamic adjustment: The technical framework is designed with a real-time data acquisition and prediction mechanism, which can reflect the drilling site conditions in real time and quickly correct prediction errors to ensure the timeliness and accuracy of predictions.
[0100] Flexibility and scalability: Due to its data-driven approach, this technology can flexibly adapt to different drilling environments and conditions, while easily integrating new data features and prediction algorithms, thus improving 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, through its intelligent and adaptive approach, not only improves the accuracy and efficiency of drilling accident prediction but also enhances the system's flexibility and scalability, providing strong technical support for the safety management of drilling operations. Attached Figure Description
[0103] The accompanying drawings are provided to further understand the technical solutions of the present invention and constitute a part of the specification. They are used together with the embodiments of the present invention to explain the technical solutions of the present invention, and do not constitute a limitation on the technical solutions of the present invention.
[0104] Figure 1 A schematic diagram of an implementation environment for real-time prediction of drilling accidents provided in an embodiment of the present invention;
[0105] Figure 2 A flowchart illustrating a real-time prediction method for drilling accidents provided in an embodiment of the present invention;
[0106] Figure 3 This is a schematic diagram illustrating the unfolded process of step S200 provided in an embodiment of the present invention;
[0107] Figure 4 This is a schematic diagram illustrating the unfolded process of step S300 provided in an embodiment of the present invention;
[0108] Figure 5 A schematic diagram illustrating the unfolded process of step S400 provided in an embodiment of the present invention;
[0109] Figure 6 This is a schematic diagram illustrating the unfolded process of step S500 provided in an embodiment of the present invention;
[0110] Figure 7 A schematic diagram illustrating an extended process of the real-time prediction method for drilling accidents provided in an embodiment of the present invention;
[0111] Figure 8 This is a schematic diagram illustrating the overall process principle of the real-time prediction method for drilling accidents provided in this embodiment of the invention.
[0112] Figure 9This is a schematic diagram of the structure of a real-time drilling accident prediction device provided in an embodiment of the present invention;
[0113] Figure 10 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. Detailed Implementation
[0114] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.
[0115] It should be noted that although functional modules are divided in the system 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 aforementioned figures are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence.
[0116] In this invention, the reference to "embodiment" means that a specific feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of the invention. The appearance of this phrase in various places in the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described in this invention can be combined with other embodiments.
[0117] It is understood that the real-time drilling accident prediction method provided in this embodiment of the invention can be applied to any computer device with data processing and computing capabilities, and this computer device can be various types of terminals or servers. When the computer device in the embodiment is a server, the server is an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms. Optionally, the terminal can be a smartphone, tablet, laptop, or desktop computer, but it is not limited to these.
[0118] To facilitate understanding of the technical solution of this invention, the technical terms that may appear in the embodiments of this invention will first be explained:
[0119] Genetic Algorithm (GA) is a computational model that simulates the process of biological evolution, utilizing mechanisms such as natural selection and gene recombination to search and optimize complex problems. It belongs to the heuristic search algorithm family, and its basic idea is to create a group of artificial individuals to optimize solutions by simulating the mechanisms of heredity and evolution in nature. In a genetic algorithm, each individual represents a potential solution, and each individual has its own fitness evaluation criteria. By performing operations such as selection, crossover, and mutation on these individuals, the fitness of the current population is gradually improved, and the potential solution space is explored in order to find the optimal solution. Genetic algorithms are characterized by their wide range of applications, strong global search capability, and ease of parallel computation. They are suitable for solving various types of optimization problems, including combinatorial optimization, continuous optimization, and multi-objective optimization. Compared to other algorithms, genetic algorithms can efficiently search for the global optimum 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 (SVMs) are a classic machine learning method that has demonstrated great potential in pattern recognition, classification, and regression analysis due to their excellent generalization ability and effective handling of nonlinear problems. Its core concept lies in constructing an optimal decision boundary that not only clearly separates samples of different classes but also has the maximum margin, aiming to enhance the model's predictive performance on unknown data. For nonlinear problems, SVMs utilize kernel tricks to map to a high-dimensional space, achieving effective separation. They are suitable for small to medium-sized datasets 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] Loss of drilling fluid (also known as mud) refers to the accidental inflow of drilling fluid into the formation during drilling. This is usually caused by high formation permeability or improper drilling pressure control, leading to fluid loss. Loss of drilling fluid can reduce the amount of drilling fluid, affecting the cooling and cleaning capabilities of the wellbore, and may also expose the wellbore wall, increasing the risk of collapse. In severe cases, loss of drilling can hinder continued drilling and may even require special measures to seal the lost circulation zone.
[0123] A well kick occurs when underground fluid (mainly natural gas or liquids) enters the wellbore at a rate exceeding normal circulation speed, but before reaching the surface. Well kicks are usually caused by formation pressure exceeding the pressure inside the wellbore, or by insufficient drilling fluid column pressure to balance the formation pressure. If not controlled promptly, a well kick can quickly escalate into a more severe blowout. A well kick is an emergency requiring immediate action, such as increasing the drilling fluid volume and shutting off the blowout preventer (BOP), to re-establish pressure balance within the wellbore.
[0124] A blowout is one of the most serious accidents, occurring when high-pressure underground fluids (oil, gas, water, or other mixtures) are uncontrollably ejected from the wellhead and reach the surface or sea. Blowouts not only cause enormous resource losses but can also trigger catastrophic consequences such as fires, explosions, and environmental pollution, seriously threatening human safety and the environment. Blowouts typically require the immediate activation of emergency response plans, including the use of specialized well control equipment (such as blowout preventers), injection of re-drilling fluid, or cement plugs to seal and control the well.
[0125] like Figure 1 The diagram shown is a schematic representation of an implementation environment provided by an embodiment of the invention. (Refer to...) 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 via a network, either wirelessly or via a wired connection, to complete data transmission and exchange.
[0126] Server 101 can be a standalone physical server, a server cluster or distributed system consisting 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 communication, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms.
[0127] Additionally, server 101 can also be a node server in a blockchain network. Blockchain is a novel application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanisms, and encryption algorithms.
[0128] Terminal 102 can be a smartphone, tablet computer, laptop computer, desktop computer, smart speaker, smartwatch, etc., but is not limited to these. Terminal 102 and server 101 can be directly or indirectly connected via wired or wireless communication, and this embodiment of the invention does not impose any limitations.
[0129] Exemplary based on Figure 1The implementation environment shown in this embodiment of the invention provides a real-time prediction method for drilling accidents. The following description uses the application of this real-time prediction method for drilling accidents in server 101 as an example. It can be understood that this real-time prediction method for drilling accidents can also be applied to terminal 102.
[0130] Reference Figure 2 , Figure 2 This is a flowchart illustrating a real-time drilling accident prediction method applied to a server, provided in an embodiment of the present invention. The executing entity of this real-time drilling accident prediction method can be any of the aforementioned computer devices (including servers or terminals). (Refer to...) Figure 2 The method includes the following steps:
[0131] S100, Obtain the data set;
[0132] The dataset includes multiple sets of drilling data and tag information indicating whether a drilling accident occurred under the given data conditions.
[0133] For example, in some specific embodiments, the drilling data sources used in this 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 publicly available data both domestically and internationally, including multiple sets of data records collected from daily drilling reports, daily mud reports, and completion reports. Some data indicate that well leakage, well kick, blowout, or other accidents occurred during the drilling process, while other data indicate that the drilling process was normal.
[0135] Field operation data refers to frontline operational data. First, the SVM drilling accident prediction model is used to predict whether drilling accidents such as lost circulation, well kick, or blowout will occur. Then, the results are manually reviewed to determine their accuracy. Whether the prediction is correct or incorrect, the data is added to the drilling data set. When the data prediction is consistently correct, the SVM drilling accident prediction model will be updated periodically according to the configuration. When the data prediction fails, an update of the SVM drilling accident prediction model will be triggered if certain conditions are met.
[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 rate, outlet flow rate, and pump discharge rate, as well as whether three abnormal conditions such as well leakage, well kick, and well blowout were detected under this set of data.
[0137] S200, Initialize the population of parameters;
[0138] The parameter population consists of multiple parameter individuals, and the genes of each parameter individual include a regularization coefficient and a kernel parameter.
[0139] It should be noted that in some embodiments, such as 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 by pairing the 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 consists of a large number of individuals, each with multiple genes. In this paper, the core parameters of the SVM (Support Vector Machine) include two parameters: 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 these two genes are as follows:
[0141] Regularization coefficient C: This is an important hyperparameter in SVM, determining the model's tolerance for errors. A larger C value leads to a greater penalty for misclassification, potentially resulting in overfitting the data. A smaller C value leads to a smaller penalty for misclassification, potentially resulting in underfitting the data. The value of C has no fixed range and depends on the complexity of the dataset and problem. In practical applications, the value of C is... .
[0142] Kernel parameter g: This determines the width of the Gaussian kernel function, thus affecting the performance of the SVM model. A larger g value leads to a better fit to the data, potentially resulting in overfitting. A smaller g value leads to a worse fit, potentially resulting in underfitting. The value of g has no fixed range and depends on the complexity of the dataset and problem. In practical applications, the value of g is typically found in... .
[0143] Through in-depth data research, and addressing the real-time prediction needs of drilling accidents, the final range of values for the regularization coefficient C is as follows: The final range of values for the kernel parameter g is: Finally, the individual is completed using the following formula. The initialization, where express random floating-point numbers, express A random floating-point number.
[0144] ;
[0145] ;
[0146] ;
[0147] S300. Apply each individual parameter in the parameter population to the support vector machine in turn, and then obtain the training result corresponding to each individual parameter in the parameter population through the dataset.
[0148] It should be noted that in some embodiments, such as Figure 4 As shown, step S300 may include the following steps: S301, applying the regularization coefficient and kernel parameter corresponding to the individual parameter to the support vector machine to obtain the vector machine model; S302, inputting each group of drilling data in the dataset into the vector machine model in sequence, and predicting and outputting the drilling accident prediction result corresponding to each group of drilling data through the vector machine model; S303, organizing the drilling accident prediction results corresponding to all drilling data to obtain the training results corresponding to the individual parameter.
[0149] For example, in some specific implementations, the latest dataset is obtained in the aforementioned steps, and the key parameters of the SVM (Support Vector Machine) are defined. Using the latest dataset, a drilling accident prediction SVM model can be trained.
[0150] S400. Based on the training results and label information, evaluate the F1 score corresponding to each parameter individual; take the largest F1 score as the candidate score, and when the candidate score is greater than the target score, take the parameter individual corresponding to the candidate score as the target individual and the candidate score as the target score.
[0151] It should be noted that the training results include the drilling accident prediction results corresponding to each group of drilling data in the dataset. The drilling accident prediction results include whether a drilling accident occurred or not; in some embodiments, such as Figure 5 As shown, the F1 score for each individual parameter is obtained by evaluating the training results in combination with label information, which may include the following steps: S401, comparing the drilling accident prediction results and label information corresponding to each group of drilling data in the dataset; S402, obtaining the number of first samples correctly predicted as positive, the number of second samples incorrectly predicted as positive, and the number of third samples incorrectly predicted as negative based on the comparison results; wherein, a positive class represents that the drilling accident prediction result is that a drilling accident has occurred, and a negative class represents that the drilling accident prediction result is that a drilling accident has not occurred; S403, calculating the F1 score for each individual parameter based on the number of first, second, and third samples.
[0152] For example, in some specific implementations, each individual in the population This indicates that the core parameters of a support vector machine include the regularization coefficient C and the kernel parameter g, which are the parameters of each individual... This represents an SVM (Support Vector Machine). Based on individual... The algorithm iterates through each array in the latest dataset, inputs it into the SVM (Support Vector Machine), obtains the prediction results, and then compares them with the true results. This paper uses the commonly used F1 score as the fitness function for evaluation. The F1 score is between [0,1], and a higher score indicates better model performance. The calculation formula is as follows:
[0153] ;
[0154] ;
[0155] ;
[0156] Here, True Positives represents the number of samples correctly predicted as positive by the model; False Positives represents the number of samples incorrectly predicted as positive by the model, which are actually negative; and False Negatives represents the number of samples incorrectly predicted as negative by the model, which are actually positive.
[0157] In summary, based on the latest dataset, the current... Using the input as input, calculate the F1 score of the output, which is the fitness function value. Simultaneously, record the individual with the best current performance. .
[0158] ;
[0159] S500. Based on the F1 score of each individual parameter, perform genetic processing on the parameter population to obtain the target population.
[0160] It should be noted that in some embodiments, such as Figure 6 As shown, step S500 may include the following steps: S501, sorting the parameter individuals in the parameter population according to the F1 score from smallest to largest to obtain the first population; S502, selecting the first number of parameter individuals with the highest F1 score from the first population as the first candidate population; S503, randomly selecting the second number of parameter individuals from the first population other than the first candidate population as the second candidate population; S504, merging the first candidate population and the second candidate population as the target population.
[0161] For example, in some specific implementations, the selection operator can be applied to individuals based on probability, specifically as follows:
[0162] The selection operator primarily uses probability to choose the better individuals. A higher F1 score indicates a better individual, while a lower F1 score indicates a worse individual. The selection operator will select sizePop individuals. It's important to note that the population size nowSizePop may exceed sizePop individuals. If the population size nowSizePop exceeds sizePop individuals (nowSizePop > sizePop), only sizePop individuals will be selected, and the excess will be discarded.
[0163] The core idea of the selection process is to first sort all individuals according to their F1 scores in ascending order, and then select the individual with the highest F1 score according to the SelectRate. The data (SelectRate can be customized, with a value range of [0,1], and the default is 0.5) is selected directly from the top-ranked data.
[0164] The rest Each individual is from the surplus They are randomly selected from the remaining individuals. The selection rules are as follows: [The selection is based on the remaining individuals.] For each individual, N individuals are randomly selected each time (this can be customized, but no less than 2, the default is 5), and the individuals with the highest F1 score are selected. This process is repeated. This process yields a final number of sizePop individuals.
[0165] Each sizePop individual can also participate in subsequent calculations such as crossover and mutation operators.
[0166] In summary, the advantage of the above selection operators is that superior individuals will directly participate in population evolution, while inferior individuals still have the opportunity to participate in population evolution, which increases the probability of superior genes being selected and ensures gene diversity.
[0167] 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 the 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 for the crossover operation is:
[0168] ;
[0169] ;
[0170] In the formula, C represents the regularization coefficient, g represents the kernel parameter; {C1, g1} represents the first body, {C2, g2} represents the second body, {C3, g3} represents the third body; min represents taking the minimum value; abs represents taking the absolute value; R(0,1) represents a random value in [0,1].
[0171] T300, return to 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 joined by a fourth number of third individuals.
[0172] 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 where sizePop individuals are obtained, it can be implemented as follows:
[0173] We now have sizePop individuals, and the maximum number of crossovers required is MaxCrossCnt (this can be customized; the default is [value]). The crossover rules are as follows:
[0174] Each time, randomly select N individuals (this can be customized, but no less than 2, the default is 5), and perform crossover on the individuals with the highest and lowest F1 scores. Repeat this process a total of MaxCorssCnt times. Note that the individuals obtained through crossover are new individuals. After the crossover operator, the entire population size increases by MaxCorssCnt, that is, the population has a total of sizePop + MaxCorssCnt individuals.
[0175] ;
[0176] ;
[0177] If two individuals and Crossover occurs, resulting in new individuals. , where min represents finding the minimum value, abs represents finding the absolute value, and R(0,1) represents a random value in the range [0,1].
[0178] ;
[0179] ;
[0180] ;
[0181] It should be noted that, in some embodiments, the method may further include the following steps:
[0182] The fifth number of parameter individuals are randomly selected from the target population as the fourth candidate population;
[0183] The first individual with the first parameter in the fourth candidate population is taken as the fourth individual;
[0184] Generate random probabilities within a third preset range;
[0185] When the random probability is within the first interval, perform the first mutation operation on the fourth individual, and add the mutation result of the first mutation operation to the target population; whereby the expression for the first mutation operation is:
[0186] ;
[0187] ;
[0188] In the formula, C1 represents the regularization coefficient of the fourth individual; normal(0,1) represents a random value distributed normally with a mean of 0 and a standard deviation of 1; C max and C min The values represent the maximum and minimum regularization coefficients in the target population or the fourth candidate population, respectively. In the first formula, C1 on the right represents the original regularization coefficient of the fourth individual, C1 on the left represents the regularization coefficient of the fourth individual after the initial mutation, and C1 in the second formula represents the regularization coefficient of the fourth individual after the first mutation operation.
[0189] When the random probability is in the second interval, perform the second mutation operation on the fourth individual, and add the mutation result of the second mutation operation to the target population; whereby the expression for the second mutation operation is:
[0190] ;
[0191] ;
[0192] In the formula, g1 represents the kernel parameter of the fourth individual; g max and g min The values represent the maximum and minimum values of the nuclear parameters in the target population or the fourth candidate population, respectively. In the first formula, g1 on the right represents the original nuclear parameters of the fourth individual; g1 on the left represents the nuclear parameters of the fourth individual after the initial mutation; and g1 in the second formula represents the nuclear parameters of the fourth individual after the first mutation operation.
[0193] When the random probability is in the third interval, perform the first mutation operation and the second mutation operation on the fourth individual, and add the individual mutation results of the first mutation operation and the second mutation operation to the target population.
[0194] The next parameter individual in the fourth candidate population is taken as the fourth individual, and the process of generating random probabilities within the third preset range is repeated until the individual mutation results of each parameter individual in the fourth candidate population are added to the target population.
[0195] For example, in some specific implementations, the mutation operator can be applied to individuals based on probability. Taking the target population to obtain sizePop+MaxCrossCnt individuals as an example, it can be implemented as follows:
[0196] We now have sizePop+MaxCrossCnt individuals, and the maximum number of mutations required is MaxMutateCnt (this can be customized; the default is...). The mutation rules are as follows:
[0197] Randomly select MaxMutateCnt individuals, then iterate through these individuals and perform mutation calculations on each one. If the individuals... Participate in the mutation calculation, and then calculate a random number r in the range [0,1]. If Then, formulas (1) and (2) are executed to perform the mutation operation on the regularization coefficient C; if Then, formulas (3) and (4) are executed to perform the mutation operation on the kernel parameter g; if Then, execute formulas (1), (2), (3) and (4) to perform mutation operations on the regularization coefficient C and the kernel parameter g.
[0198]
[0199] (1)
[0200] (2)
[0201] (3)
[0202] (4)
[0203] Where normal(0,1) represents a normal distribution with a mean of 0 and a standard deviation of 1. and This represents the maximum and minimum values of the kernel parameter g. and This represents the maximum and minimum values of the regularization coefficient C. 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.
[0204] It is important to note that the mutation operator occurs directly on the individual. After MaxMutateCnt mutations, no new individuals are added, and the population size remains sizePop + MaxCrossCnt individuals.
[0205] S600, Increment the iteration count by 1, 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 iteration count reaches the iteration limit, apply the target individual to the support vector machine to obtain the target prediction model;
[0206] For example, in some specific implementations, the individuals in the population have just undergone genetic operations (including selection, crossover, and mutation), indicating that a population reproduction cycle has been completed. Through natural selection, a new generation of the population has been obtained. Steps S300 to S500 are the innermost loops, and the iteration count is incremented by one each time they are executed. If the number of iterations exceeds the maximum value MaxGenCnt (i.e., the upper limit of iterations, which can be customized, with a default value of 20), it indicates that the optimal parameters of the SVM prediction model have been found; otherwise, the process returns to step S300.
[0207] S700: Acquire real-time data from the drilling site, input the real-time data into the target prediction model to obtain real-time accident prediction results;
[0208] For example, in some specific embodiments, the real-time data here is obtained from data such as drilling reports, mud reports, and completion reports on site, or from the on-site monitoring system, and belongs to the real-time operational 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, original fracture direction, cement slurry density, drilling fluid density, inlet flow rate, outlet flow rate, and pump discharge rate.
[0209] These data can be manually recorded as needed, or automatically generated by the monitoring system. Based on this data, the drilling accident prediction SVM support vector machine model is input to perform on-site drilling accident prediction.
[0210] S800: Verify the accuracy of real-time accident prediction results;
[0211] Accuracy includes both correct and incorrect predictions; when the accuracy is incorrect, the real-time prediction results of the accident are corrected.
[0212] For example, in some specific implementations, real-time data is input into a drilling accident prediction SVM support vector machine model to perform on-site drilling accident prediction. Then, based on human experience and verification signals from human feedback, the accuracy of the prediction result is determined.
[0213] S900: Associate real-time data with real-time accident prediction results and add them to the dataset; incrementally update the preset update threshold based on accuracy;
[0214] Specifically, if the accuracy is that the prediction is correct, the update threshold is incremented by the first parameter; otherwise, the update threshold is incremented by the second parameter.
[0215] For example, in some specific implementations, if the prediction result is correct, the real-time data is directly added to the dataset, i.e., the dataset is updated. If the prediction result is incorrect, the result is corrected, and then the real-time data is added to the dataset, i.e., the dataset is updated. Specifically, the update process for the update threshold can be implemented as follows:
[0216] Based on real-time data prediction, if the prediction fails, Delt updates the formula as follows:
[0217] ;
[0218] Based on real-time data prediction, if the prediction is successful, Delt updates the formula as follows:
[0219] ;
[0220] S1000. When the next prediction node is reached, return to the step of obtaining real-time data from the drilling site until the update threshold reaches the upper limit of the threshold. Then, reset the update threshold to 0 and return to the step of initializing the parameter population to continuously update the target prediction model.
[0221] For example, in some specific implementations, if the SVM model update threshold Delt exceeds MaxDelt (i.e., the upper limit of the threshold), the SVM model needs to be updated; otherwise, the current model can continue to be used.
[0222] To explain in detail the principle of the technical solution of the present invention, the overall process of the present invention will be described below with reference to some specific embodiments. It is easy to understand that the following is an explanation of the technical principle of the present invention and should not be regarded as a limitation of the present invention.
[0223] First, it's important to note that in the past, the prediction of lost circulation, well kicks, and blowouts relied heavily on subjective judgments made by technicians based on real-time sensor data. This required technicians to have extensive practical experience. However, human judgment is inevitably influenced by subjective biases and has limitations. In recent years, the leap forward in intelligent algorithm technology has brought innovation to this field, and researchers both domestically and internationally have explored various methods for using intelligent algorithms to predict drilling accidents.
[0224] The disadvantages of the existing technology are as follows:
[0225] 1) Delay in early warning response: The current early warning system relies heavily on manual analysis and judgment, resulting in low processing efficiency, slow emergency response, and difficulty in responding quickly.
[0226] 2) The difficulty of data analysis has increased dramatically: The amount of data is growing exponentially and the dimensions of data are expanding rapidly, which has increased the complexity and difficulty of manually processing and understanding the data.
[0227] 3) The classification model iterates and upgrades slowly, lacking real-time integration of field operation data to update the overall dataset, which in turn affects the timeliness of model iteration and updates.
[0228] Therefore, in order to further prevent drilling accidents and mitigate losses caused by drilling accidents, this invention proposes an improved genetic algorithm to optimize the SVM (Support Vector Machine) to enhance drilling prediction capabilities. Figure 8 As shown, the real-time prediction method for drilling accidents of the present invention can achieve the following:
[0229] Step 1: Obtain the latest dataset. The drilling data used in this article mainly consists of two parts: historical data and field operation data, which together form the dataset.
[0230] Historical data mainly comes from publicly available data both domestically and internationally, including multiple sets of data records collected from daily drilling reports, daily mud reports, and completion reports. Some data indicate that well leakage, well kick, blowout, or other accidents occurred during the drilling process, while other data indicate that the drilling process was normal.
[0231] Field operation data refers to frontline operational data. First, the SVM drilling accident prediction model is used to predict whether drilling accidents such as lost circulation, well kick, or blowout will occur. Then, the results are manually reviewed to determine their accuracy. Whether the prediction is correct or incorrect, the data is added to the drilling data set. When the data prediction is consistently correct, the SVM drilling accident prediction model will be updated periodically according to the configuration. When the data prediction fails, an update of the SVM drilling accident prediction model will be triggered if certain conditions are met.
[0232] 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 rate, outlet flow rate, and pump discharge rate, as well as whether three abnormal conditions such as well leakage, well kick, and well blowout were detected under this set of data.
[0233] It's important to clarify that the iterative updates 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 SVM drilling accident prediction model iterative update is not yet complete, the prediction model uses the previous version. When the iterative update is complete, it will trigger a prediction model version update. During the version update, drilling accident prediction is temporarily suspended, and after the update, the latest version of the model will be used.
[0234] Step 2: Population Initialization. The population consists of a large number of individuals, each with multiple genes. In this paper, the core parameters of the SVM (Support Vector Machine) include two parameters: 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 these two genes are as follows:
[0235] Regularization coefficient C: This is an important hyperparameter in SVM, determining the model's tolerance for errors. A larger C value leads to a greater penalty for misclassification, potentially resulting in overfitting the data. A smaller C value leads to a smaller penalty for misclassification, potentially resulting in underfitting the data. The value of C has no fixed range and depends on the complexity of the dataset and problem. In practical applications, the value of C is... .
[0236] Kernel parameter g: This determines the width of the Gaussian kernel function, thus affecting the performance of the SVM model. A larger g value leads to a better fit to the data, potentially resulting in overfitting. A smaller g value leads to a worse fit, potentially resulting in underfitting. The value of g has no fixed range and depends on the complexity of the dataset and problem. In practical applications, the value of g is typically found in... .
[0237] Through in-depth data research, and addressing the real-time prediction needs of drilling accidents, the final range of values for the regularization coefficient C is as follows: The final range of values for the kernel parameter g is: Finally, the individual is completed using the following formula. The initialization, where express random floating-point numbers, express A random floating-point number.
[0238] ;
[0239] ;
[0240] ;
[0241] Step 3: Update the SVM prediction model. In Step 1, the latest dataset was obtained; in Step 2, the key parameters of the SVM (Support Vector Machine) were defined. Using the latest dataset, a drilling accident prediction SVM model was trained.
[0242] Step 4: Calculate the F1 score based on the SVM prediction model. Each individual in the population... This indicates that the core parameters of a support vector machine include the regularization coefficient C and the kernel parameter g, which are the parameters of each individual... This represents an SVM (Support Vector Machine). Based on individual... The algorithm iterates through each array in the latest dataset, inputs it into the SVM (Support Vector Machine), obtains the prediction results, and then compares them with the true results. This paper uses the commonly used F1 score as the fitness function for evaluation. The F1 score is between [0,1], and a higher score indicates better model performance. The calculation formula is as follows:
[0243] ;
[0244] ;
[0245] ;
[0246] Here, True Positives represents the number of samples correctly predicted as positive by the model; False Positives represents the number of samples incorrectly predicted as positive by the model, which are actually negative; and False Negatives represents the number of samples incorrectly predicted as negative by the model, which are actually positive.
[0247] In summary, based on the latest dataset, the current... Using the input as input, calculate the F1 score of the output, which is the fitness function value. Simultaneously, record the individual with the best current performance. .
[0248] ;
[0249] Step 5: Apply the selection operator to individuals based on probability. The selection operator primarily selects better individuals based on probability; a higher F1 score indicates a better individual, and a lower F1 score indicates a worse individual. The selection operator will select sizePop individuals. It's important to note that the population size nowSizePop may exceed sizePop individuals. If the population size nowSizePop exceeds sizePop individuals (nowSizePop > sizePop), only sizePop data points will be selected, and the excess will be eliminated.
[0250] The core idea of the selection process is to first sort all individuals according to their F1 scores in ascending order, and then select the individual with the highest F1 score according to the SelectRate. The data (SelectRate can be customized, with a value range of [0,1], and the default is 0.5) is selected directly from the top-ranked data.
[0251] The rest Each individual is from the surplus They are randomly selected from the remaining individuals. The selection rules are as follows: [The selection is based on the remaining individuals.] For each individual, N individuals are randomly selected each time (this can be customized, but no less than 2, the default is 5), and the individuals with the highest F1 score are selected. This process is repeated. This process yields a final number of sizePop individuals.
[0252] Each sizePop individual can also participate in subsequent calculations such as crossover and mutation operators.
[0253] In summary, the advantage of the above selection operators is that superior individuals will directly participate in population evolution, while inferior individuals still have the opportunity to participate in population evolution, which increases the probability of superior genes being selected and ensures gene diversity.
[0254] Step 6: Apply the crossover operator to the individuals based on probability. Now we have sizePop individuals, requiring a maximum of MaxCrossCnt crossovers (this can be customized; the default is [value]). The crossover rules are as follows:
[0255] Each time, randomly select N individuals (this can be customized, but no less than 2, the default is 5), and perform crossover on the individuals with the highest and lowest F1 scores. Repeat this process a total of MaxCorssCnt times. Note that the individuals obtained through crossover are new individuals. After the crossover operator, the entire population size increases by MaxCorssCnt, that is, the population has a total of sizePop + MaxCorssCnt individuals.
[0256] ;
[0257] ;
[0258] If two individuals and Crossover occurs, resulting in new individuals. , where min represents finding the minimum value, abs represents finding the absolute value, and R(0,1) represents a random value in the range [0,1].
[0259] ;
[0260] ;
[0261] ;
[0262] Step 7: Apply the mutation operator to the individuals based on probability. Now we have sizePop + MaxCrossCnt individuals, requiring a maximum of MaxMutateCnt mutations (this can be customized; the default is [value]). The mutation rules are as follows:
[0263] Randomly select MaxMutateCnt individuals, then iterate through these individuals and perform mutation calculations on each one. If the individuals... Participate in the mutation calculation, and then calculate a random number r in the range [0,1]. If Then, formulas (1) and (2) are executed to perform the mutation operation on the regularization coefficient C; if Then, formulas (3) and (4) are executed to perform the mutation operation on the kernel parameter g; if Then, execute formulas (1), (2), (3) and (4) to perform mutation operations on the regularization coefficient C and the kernel parameter g.
[0264]
[0265] (1)
[0266] (2)
[0267] (3)
[0268] (4)
[0269] Where normal(0,1) represents a normal distribution with a mean of 0 and a standard deviation of 1. and This represents the maximum and minimum values of the kernel parameter g. and This represents the maximum and minimum values of the regularization coefficient C. 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.
[0270] It is important to note that the mutation operator occurs directly on the individual. After MaxMutateCnt mutations, no new individuals are added, and the population size remains sizePop + MaxCrossCnt individuals.
[0271] Step 8: Obtain the next generation population. After steps 5 to 7, these individuals have just undergone selection, crossover, and mutation, indicating that a population reproduction cycle has been completed. Through natural selection, a new generation population has been obtained.
[0272] Step 9: Satisfy the maximum number of iterations. Steps 3 to 9 are the innermost loops. Each execution increments the iteration count by one. If the number of iterations exceeds the maximum value MaxGenCnt (which can be customized, the default is 20), proceed to step 10; otherwise, proceed to step 3.
[0273] Step 10: Find the optimal parameters for the SVM prediction model. Reaching this step completes the inner loop, indicating that the optimal parameters have been obtained. .
[0274]
[0275] Step 11: Update the SVM prediction model. In Step 1, the latest dataset was obtained; in Step 10, the key parameters of the SVM (Support Vector Machine) were determined. Using the latest dataset, a drilling accident prediction SVM support vector machine model is trained to obtain the model.
[0276] At the same time, reset the SVM model update threshold Delt to the default value (which can be customized, with a default value of 0 and a maximum value of MaxDelt, where the value range is [1, 100] and the default value 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 an update is not needed for the time being.
[0277] Step 12: Acquire Real-Time Data. Real-time data here refers to data obtained from on-site drilling reports, mud reports, and completion reports, or from on-site monitoring systems; it represents real-time operational data from the front lines. 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 rate, outlet flow rate, and pump displacement.
[0278] These data can be manually recorded as needed, or automatically generated by the monitoring system. Based on this data, the drilling accident prediction SVM support vector machine model is input to perform on-site drilling accident prediction.
[0279] Step 13: Calculate 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 perform on-site drilling accident prediction. Then, combine this with human experience to determine whether the prediction results are correct.
[0280] Step 14: Add real-time data to the dataset. If the prediction is correct, add the real-time data directly to the dataset, i.e., update the dataset. If the prediction is incorrect, correct the prediction and then add the real-time data to the dataset, i.e., update the dataset.
[0281] Step 15: Update the update threshold. The calculation formula is as follows:
[0282] Based on real-time data prediction, if the prediction fails, Delt updates the formula as follows:
[0283] ;
[0284] Based on real-time data prediction, if the prediction is successful, Delt updates the formula as follows:
[0285] ;
[0286] Step 16: Update the SVM model. If the SVM model update threshold Delt exceeds MaxDelt, the SVM model needs to be updated, proceed to step 17. Otherwise, the current model can continue to be used, proceed to step 12.
[0287] Step 17: Reset all parameters. Reset the parameters related to the genetic algorithm, including resetting the iteration count to 0, etc. Proceed to Step 1.
[0288] In summary, steps 1 to 11 involve finding the optimal parameters based on the latest dataset, and then iteratively updating to obtain the optimal SVM drilling accident prediction model. Steps 12 to 17 involve using real-time operational data to predict whether well leakage, well kick, blowout, and other accidents will occur using the SVM support vector machine model for drilling accident prediction. These two processes are independent and do not affect each other. When the SVM drilling accident prediction model is not fully updated, the prediction model uses the previous version. When the iteration is complete, a version update is triggered, temporarily suspending drilling accident prediction during the update. After the update, the latest version of the model is used.
[0289] In summary, this invention proposes an improved genetic algorithm-optimized SVM support vector machine for real-time drilling accident prediction. By improving the genetic algorithm to find the optimal parameters of the SVM support vector machine, and simultaneously supporting rapid updates of the classification model, the invention achieves more accurate and real-time drilling accident prediction. Compared to existing technologies, this invention offers at least the following advantages:
[0290] 1) A drilling accident prediction method based on SVM (Support Vector Machine) is proposed, which significantly enhances the intelligence level of accident early warning.
[0291] 2) An improved genetic algorithm method was proposed to search for the optimal parameters of SVM support vector machine, which automates the network parameter tuning process and improves the accuracy of early warning.
[0292] 3) Integrating on-site operation data to verify the prediction effectiveness accelerates the iterative upgrade of the SVM drilling accident prediction model, thereby ensuring the real-time updating and rapid prediction capabilities of the SVM drilling accident prediction model.
[0293] On the other hand, such as Figure 9 As shown, this embodiment of the invention provides a real-time drilling accident prediction device 900, which may include:
[0294] The first module 901 is used to acquire a data set; the data set includes multiple sets of drilling data and tag information indicating whether a drilling accident occurred under the given data conditions;
[0295] The second module 902 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;
[0296] The third module 903 is used to apply each individual parameter in the parameter population to the support vector machine in turn, and then obtain the training result corresponding to each individual parameter in the parameter population through the training of the dataset.
[0297] The fourth module 904 is used to evaluate the F1 score corresponding to each individual parameter based on the training results and label information; the largest F1 score is used as the candidate score, and when the candidate score is greater than the target score, the individual parameter corresponding to the candidate score is used as the target individual, and the candidate score is used as the target score.
[0298] 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 the target population.
[0299] The sixth module 906 is used to increment the iteration count by 1, use the target population as the parameter population, return to execute the third module, until the iteration count reaches the iteration limit, and apply the target individuals to the support vector machine to obtain the target prediction model;
[0300] Module 7, 907, is used to acquire real-time data from the drilling site and input the real-time data into the target prediction model to obtain real-time accident prediction results.
[0301] Module 8, 908, is used to verify the accuracy of real-time accident prediction results; accuracy includes correct prediction and incorrect prediction; when the accuracy is incorrect, the real-time accident prediction results are corrected.
[0302] Module 909 is used to associate real-time data with real-time accident prediction results and add them to the dataset; it incrementally updates the preset update threshold based on accuracy.
[0303] Module 910 is used to return to Module 7 when the next prediction node is reached, until the update threshold reaches the upper limit of the threshold, then the update threshold is reset to 0, and the second module is returned to continuously update the target prediction model.
[0304] In some embodiments, the apparatus may further include:
[0305] The eleventh module is used to randomly select a third number of parameter individuals from the target population as the third candidate population;
[0306] The twelfth module is used to perform a crossover operation between 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; the third individual is then added to the target population.
[0307] The expression for the crossover operation is:
[0308] ;
[0309] ;
[0310] In the formula, C represents the regularization coefficient, g represents the kernel parameter; {C1, g1} represents the first body, {C2, g2} represents the second body, {C3, g3} represents the third body; min represents taking the minimum value; abs represents taking the absolute value; R(0,1) represents a random value in [0,1].
[0311] Module 13 is used to return to the execution of Module 11 until the target population is joined by the third individual of the fourth number.
[0312] In some embodiments, the apparatus may further include:
[0313] The fourteenth module is used to randomly select the fifth number of parameter individuals from the target population as the fourth candidate population;
[0314] The fifteenth module is used to select the first parameter individual in the fourth candidate population as the fourth individual;
[0315] The sixteenth module is used to generate random probabilities within a third preset range;
[0316] The seventeenth module is used to perform the first mutation operation on the fourth individual when the random probability is in the first interval, and to add the mutation result of the first mutation operation to the target population.
[0317] The expression for the first mutation operation is:
[0318] ;
[0319] ;
[0320] In the formula, C1 represents the regularization coefficient of the fourth individual; normal(0,1) represents a random value distributed normally with a mean of 0 and a standard deviation of 1; C max and C min These represent the maximum and minimum values of the regularization coefficient in the target population or the fourth candidate population, respectively.
[0321] The eighteenth module is used to perform a second mutation operation on the fourth individual when the random probability is in the second interval, and to add the mutation result of the second mutation operation to the target population.
[0322] The expression for the second mutation operation is:
[0323] ;
[0324] ;
[0325] In the formula, g1 represents the kernel parameter of the fourth individual; g max and g min These represent the maximum and minimum values of the kernel parameter in the target population or the fourth candidate population, respectively.
[0326] The nineteenth module is used to perform the first mutation operation and the second mutation operation on the fourth individual when the random probability is in the third interval, and to add the individual mutation results of the first mutation operation and the second mutation operation to the target population.
[0327] 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 mutation results of each parameter individual in the fourth candidate population are added to the target population.
[0328] The content of the method embodiments of the present invention is applicable to the device embodiments. The specific functions 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 methods.
[0329] On the other hand, embodiments of the present invention also provide an electronic device, which includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the above-described method for predicting the bottom boundary of the hydrate stability domain. This electronic device can be any smart terminal, including tablet computers, in-vehicle computers, etc.
[0330] It is understood that the content of the above method embodiments is applicable to this device embodiment. The specific functions implemented by this device embodiment 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.
[0331] like Figure 10 As shown, Figure 10 The hardware structure of an electronic device 1000 according to another embodiment is illustrated. The electronic device 1000 includes:
[0332] The processor 1001 can be implemented using a general-purpose CPU (Central Processing Unit), microprocessor, 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.
[0333] The memory 1002 can be implemented as a read-only memory (ROM), static storage device, dynamic storage device, or random access memory (RAM). The memory 1002 can store the operating system and other application programs. When the technical solutions provided in the embodiments of this specification are implemented through software or firmware, the relevant program code is stored in the memory 1002 and is called and executed by the processor 1001 to execute the network node population optimization method of the embodiments of this invention.
[0334] Input / output interface 1003 is used to implement information input and output;
[0335] The communication interface 1004 is used to enable communication and interaction between this device and other devices. Communication can be achieved through wired means (such as USB, network cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.).
[0336] Bus 1005 transmits information between various components of the device (e.g., processor 1001, memory 1002, input / output interface 1003, and communication interface 1004);
[0337] The processor 1001, memory 1002, input / output interface 1003 and communication interface 1004 are connected to each other within the device via bus 1005.
[0338] The electronic device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.
[0339] The content of the method embodiments of the present invention is applicable to the embodiments of the present electronic device. The specific functions implemented by the embodiments of the present electronic device 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 methods.
[0340] Another aspect of this invention provides a computer-readable storage medium storing a program that is executed by a processor to implement the aforementioned method.
[0341] It should be noted that the computer-readable medium shown in the embodiments of the present invention can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), flash memory, optical fiber, portable compact disc read-only memory (CD to ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In the present invention, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In the present invention, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, wherein computer-readable program code is carried. Such transmitted data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. The computer-readable signal medium can also be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to wireless, wired, etc., or any suitable combination thereof.
[0342] The content of the method embodiments of the present invention is applicable to the computer-readable storage medium embodiments. The specific functions 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 methods.
[0343] This invention also discloses a computer program product or computer program, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device can read the computer instructions from the computer-readable storage medium and execute the computer instructions, causing the computer device to perform the aforementioned method.
[0344] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0345] It should be noted that although several modules for the device used to perform actions have been mentioned in the detailed description above, this division is not mandatory. In fact, according to embodiments 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. Conversely, the features and functions of one module or unit described above can be further divided and embodied by multiple modules or units.
[0346] Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solutions according to the embodiments of the present invention can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as a CD-ROM, USB flash drive, portable hard drive, etc.) or on a network, including several instructions to cause a computing device (such as a personal computer, server, touch terminal, or network device, etc.) to execute the method according to the embodiments of the present invention.
[0347] In some alternative embodiments, the functions / operations mentioned in the block diagrams may not occur in the order shown in the operation diagrams. For example, depending on the functions / operations involved, two consecutively shown blocks may actually be executed substantially simultaneously, or the blocks may sometimes be executed in reverse order. Furthermore, the embodiments presented and described in the flowcharts of this invention are provided by way of example to provide a more comprehensive understanding of the technology. The disclosed methods are not limited to the operations and logic flows presented in this invention. Alternative embodiments are contemplated, in which the order of various operations is changed and sub-operations described as part of a larger operation are executed independently.
[0348] Furthermore, although the invention has been described in the context of functional modules, it should be understood that, unless otherwise stated, one or more of the functions and / or features may be integrated into a single physical device and / or software module, or one or more functions and / or features may be implemented in a separate physical device or software module. It is also understood that a detailed discussion of the actual implementation of each module is unnecessary for understanding the invention. Rather, given the properties, functions, and internal relationships of the various functional modules in the apparatus disclosed herein, the actual implementation of the module will be understood within the scope of conventional skill of an engineer. Therefore, those skilled in the art can implement the invention as set forth in the claims using ordinary techniques without excessive experimentation. It is also understood that the specific concepts disclosed are merely illustrative and not intended to limit the scope of the invention, which is determined by the full scope of the appended claims and their equivalents.
[0349] If a function is implemented as 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 this invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0350] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution means, apparatus, or device (such as a computer-based device, a processor-including device, or other means that can fetch and execute instructions from, or in conjunction with, an instruction execution means, apparatus, or device). For the purposes of this specification, "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transmit programs for use by, or in conjunction with, an instruction execution means, apparatus, or device.
[0351] More specific examples (a non-exhaustive list) of computer-readable media include: electrical connections (electronic devices) having one or more wires, portable computer disk drives (magnetic devices), random access memory (RAM), read-only memory (ROM), erasable and editable read-only memory (EPROM or flash memory), fiber optic devices, and portable optical disc read-only memory (CDROM). Furthermore, computer-readable media can even be paper or other suitable media on which programs can be printed, because programs can be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, interpreting, or otherwise processing as necessary, and then stored in computer memory.
[0352] It should be understood that various parts of the present invention can be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented in software or firmware stored in memory and executed by a suitable instruction execution device. For example, if implemented in hardware, as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.
[0353] In the description of this specification, references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.
[0354] Although embodiments of the invention have been shown and described, those skilled in the art will understand that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the claims and their equivalents.
[0355] The above is a detailed description of the preferred embodiments of the present invention. However, the present invention is not limited to the embodiments. Those skilled in the art can make various equivalent modifications or substitutions without departing from the spirit of the present invention. All such equivalent modifications or substitutions are included within the scope defined by the claims of the present invention.
Claims
1. A method for real-time prediction of drilling accidents, characterized in that, Includes the following steps: Acquire a dataset; the dataset includes multiple sets of drilling data and tag information indicating whether a drilling accident occurred under the given data conditions; Initialize the parameter population; the parameter population includes multiple parameter individuals, and the genes of each parameter individual include a regularization coefficient and a kernel parameter; Each individual parameter in the parameter population is sequentially applied to a support vector machine, and then the training result corresponding to each individual parameter in the parameter population is obtained through training on the dataset. Based on the training results and the label information, the F1 score corresponding to each individual parameter is evaluated. The largest F1 score is taken as a candidate score. When the candidate score is greater than the target score, the parameter individual corresponding to the candidate score is taken as the target individual, and the candidate score is taken as the target score. Based on the F1 score corresponding to each of the parameter individuals, the parameter population is genetically processed to obtain the target population; The step of performing genetic processing on the parameter population based on the F1 score corresponding to each parameter individual to obtain the target population includes the following steps: The parameter individuals in the parameter population are sorted in ascending order of their F1 scores to obtain the first population; The first number of individuals with the highest F1 score from the first population are selected as the first candidate population. A second number of the parameter individuals are randomly selected from the first population, excluding the first candidate population, as the second candidate population; The first candidate population and the second candidate population are merged to form the target population; A third number of individuals with the specified parameters are randomly selected from the target population as a third candidate population. A crossover operation is performed between 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; the third individual is then added to the target population. 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; A fifth number of individuals with the specified parameters are randomly selected from the target population as the fourth candidate population; The first individual with the parameter in the fourth candidate population is taken as the fourth individual; Generate random probabilities within a third preset range; When the random probability is in the first interval, a 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. When the random probability is in the second interval, a 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; 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. The next parameter 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 mutation result of each parameter individual in the fourth candidate population is added to the target population. Increment the iteration count by 1, use the target population as the parameter population, and return to execute the step of applying each parameter individual in the parameter population to the support vector machine in turn until the iteration count reaches the iteration limit, and apply the target individual to the support vector machine to obtain the target prediction model; Real-time data from the drilling site is acquired, and the real-time data is input into the target prediction model to obtain real-time accident prediction results. The accuracy of the real-time accident prediction results is checked; wherein, the accuracy includes correct prediction and incorrect prediction; when the accuracy is incorrect prediction, the real-time accident prediction results are corrected. The real-time data is associated with the real-time accident prediction results and added to the data set; the preset update threshold is incrementally updated based on the accuracy. When the next prediction node is reached, return to the step of obtaining real-time data from the drilling site until the update threshold reaches the upper limit. Then, reset the update threshold to 0 and return to the step of initializing the parameter population 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: A preset number of regularization coefficients are constructed based on random numbers within a first preset range; The preset number of kernel parameters are constructed based on random numbers within a second preset range; The preset number of parameter individuals are obtained by pairing the preset number of regularization coefficients and 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 sequentially applying each individual parameter in the parameter population to a support vector machine, and then training the dataset to obtain the training result corresponding to each individual parameter in the parameter population, includes the following steps: The regularization coefficient and kernel parameter corresponding to the individual parameters are applied to the support vector machine to obtain the vector machine model; Each set of drilling data in the dataset is sequentially input into the vector machine model, and the drilling accident prediction result corresponding to each set of drilling data is predicted and output by the vector machine model. The training results corresponding to the individual parameters are obtained by organizing 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 results include drilling accident prediction results for each group of drilling data in the dataset, wherein the drilling accident prediction results include whether a drilling accident has occurred or not; the evaluation of the F1 score corresponding to each individual parameter based on the training results and the label information includes the following steps: The drilling accident prediction result and the tag information corresponding to each group of drilling data in the dataset are compared. Based on the comparison results, the number of first samples correctly predicted as positive, the number of second samples incorrectly predicted as positive, and the number of third samples incorrectly predicted as negative are obtained; 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 a drilling accident has not occurred; The F1 score corresponding to the individual parameter is calculated based on the first sample size, the second sample size, and the third sample size.
5. A real-time prediction device for drilling accidents, characterized in that, include: The first module is used to acquire a data set; the data set includes multiple sets of drilling data and tag information indicating whether a drilling accident occurred under the given data set. 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 a regularization coefficient and a kernel parameter; The third module is used to sequentially apply each individual parameter in the parameter population to the support vector machine, and then train the dataset to obtain the training result corresponding to each individual parameter in the parameter population. The fourth module is used to evaluate and obtain the F1 score corresponding to each individual parameter based on the training results and the label information. The largest F1 score is taken as a candidate score. When the candidate score is greater than the target score, the parameter individual corresponding to the candidate score is taken as the target individual, and the candidate score is taken as the target score. The 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 the target population; The step of performing genetic processing on the parameter population based on the F1 score corresponding to each parameter individual to obtain the target population includes the following steps: The parameter individuals in the parameter population are sorted in ascending order of their F1 scores to obtain the first population; The first number of individuals with the highest F1 score from the first population are selected as the first candidate population. A second number of the parameter individuals are randomly selected from the first population, excluding the first candidate population, as the second candidate population; The first candidate population and the second candidate population are merged to form the target population; The eleventh module is used to randomly select a third number of the parameter individuals from the target population as a third candidate population; The twelfth module is used to perform a crossover operation between 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 to add the third individual to the target population. The thirteenth module is used to return to the execution of the eleventh module until the target population is joined by a fourth number of the third individuals; The fourteenth module is used to randomly select a fifth number of the parameter individuals from the target population as the fourth candidate population; The fifteenth module is used to select the first individual with the parameter in the fourth candidate population as the fourth individual; The sixteenth module is used to generate random probabilities within a third preset range; The seventeenth module is used to perform a first mutation operation on the fourth individual when the random probability is in the first interval, and to add the individual mutation result of the first mutation operation to the target population. The eighteenth module is used to perform a second mutation operation on the fourth individual when the random probability is in the second interval, and to add the individual mutation result of the second mutation operation to the target population. The nineteenth module is used to perform the first mutation operation and the second mutation operation on the fourth individual when the random probability is in the third interval, and to add the individual mutation results of the first mutation operation and the second mutation operation to the target population. The twentieth module is used to take the next parameter individual in the fourth candidate population as the fourth individual, and return to execute the sixteenth module until the individual mutation results of each parameter individual in the fourth candidate population are added to the target population. The sixth module is used to increment the iteration count by 1, use the target population as the parameter population, return to execute the third module, until the iteration count reaches the iteration limit, and apply the target individual to the support vector machine to obtain the target prediction model; The seventh module is used to acquire real-time data from the drilling site and input the real-time data into the target prediction model to obtain real-time accident prediction results. The eighth module is used to verify the accuracy of the real-time accident prediction results; wherein, the accuracy includes correct prediction and incorrect prediction; when the accuracy is incorrect prediction, the real-time accident prediction results are corrected. 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; and to incrementally update the preset update threshold based on the accuracy. The tenth module is used to return to the execution of the seventh module when the next prediction node is reached, until the update threshold reaches the upper limit of the threshold, then reset the update threshold to 0, return to the execution of the second module, and continuously update the target prediction model.
6. An electronic device, characterized in that, Including the processor and memory; The memory is used to store programs; The processor executes the program to implement the method as described in any one of claims 1 to 4.
7. A computer storage medium storing a processor-executable program, characterized in that, The processor-executable program, when executed by the processor, is used to implement the method as described in any one of claims 1 to 4.
Citation Information
Patent Citations
Oilfield warehouse location method under environment of uncertain well location
CN107274039A
Accident prediction method and device for drilling operation, electronic equipment and storage medium
CN114897225A