Well drilling condition prediction method and device based on improved weeds, equipment and medium
By improving the weed optimization algorithm dynamically adjusting SVM parameters, the parameter optimization problem in drilling accident prediction is solved, efficient and accurate accident prediction is achieved, drilling risks are reduced, and operational safety and economy are improved.
Patent Information
- Application Number
- CN202510434020.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-08
- Publication Date
- 2025-08-15
AI Technical Summary
The existing drilling accident prediction methods rely on expert experience or traditional statistical models, and there are problems of insufficient prediction accuracy and weak generalization capabilities. Moreover, it is difficult for SVM parameter optimization methods to find global optimal solutions within a limited number of iterations, resulting in limited real-time and accuracy of drilling accident prediction.
The core parameters of the support vector machine (SVM) are dynamically adjusted by using an improved weed optimization algorithm (Invasive Weed Optimization, IWO), and the weed population is initialized, the scores are evaluated, and the new individuals are generated by generating new individuals in combination with normal distributions. The population reproduction ability is dynamically adjusted, and the global optimal parameter combination is quickly found, and the target prediction model is constructed.
It improves the accuracy and real-time performance of drilling accident prediction, reduces invalid calculations, quickly finds the optimal parameter combination, reduces drilling risks, and improves operational safety and economy.
Smart Images

Figure CN120494147A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of drilling prediction, and in particular to a drilling condition prediction method, device, equipment and medium based on improved weeds. Background Art
[0002] In oil drilling operations, predicting drilling accidents (such as blowouts, stuck pipe, and lost circulation) is crucial for ensuring operational safety and improving economic efficiency. Traditional drilling accident prediction methods rely primarily on expert experience or monitoring systems based on statistical models, but these methods often suffer from insufficient prediction accuracy and weak generalization capabilities. With the development of machine learning technology, algorithms such as support vector machines (SVMs) have been introduced to the field of drilling accident prediction. However, due to the complex and variable drilling monitoring parameters and the uneven distribution of accident samples, the parameter selection of traditional SVMs (such as kernel function type, penalty factor, and kernel parameters) significantly affects the prediction effect. Improper parameter selection can lead to model overfitting or underfitting, reducing prediction accuracy.
[0003] Currently, SVM parameter optimization typically uses grid search or genetic algorithms. However, grid search is computationally expensive, while genetic algorithms can get stuck in local optima during the parameter search process, making it difficult to efficiently find the global optimal solution. Furthermore, historical drilling data is high-dimensional, nonlinear, and noisy. Existing optimization methods struggle to find the optimal parameter combination that adapts to the complex data characteristics within a limited number of iterations, limiting the real-time and accuracy of accident prediction. Summary of the Invention
[0004] The present invention aims to at least partially address the limitations of the related art. To this end, the present invention provides a method, apparatus, device, and medium for predicting drilling conditions based on improved weeds, which can efficiently and accurately predict drilling conditions based on improved weeds.
[0005] In one aspect, an embodiment of the present invention provides a drilling condition prediction method based on improved weeds, comprising the following steps:
[0006] Obtain historical drilling data; historical drilling data includes drilling monitoring parameters and their corresponding drilling accident conditions;
[0007] Initializing multiple sets of support vector machine core parameters to construct a weed population; each weed individual in the weed population includes a set of randomly generated core parameters;
[0008] Using historical drilling data as a dataset, the prediction effect of the support vector machine adjusted by the core parameters of each weed individual was evaluated to obtain the evaluation score of each weed individual.
[0009] Renewing the weed population by retaining a preset number of weed individuals based on the evaluation scores;
[0010] Based on the core parameters of each weed individual, the next generation of weed individuals is generated using a normally distributed random number, and the next generation of weed individuals is added to the weed population. The number of seeds generated by each weed individual for the next generation of weed individuals is obtained based on the association with the evaluation score.
[0011] The number of iterations is increased by one. If the number of iterations is greater than the preset maximum number of iterations, the target parameter is obtained based on the evaluation score. Otherwise, the process returns to the step of using the drilling history data as a data set until the number of iterations is greater than the maximum number of iterations.
[0012] The target parameters are applied to support vector machine to build a target prediction model, and the target prediction model is used to predict drilling accidents based on real-time drilling monitoring parameters to obtain the predicted accident situation.
[0013] Optionally, the evaluation score is an F1 score; using the historical drilling data as a data set, performing a prediction effect evaluation on a support vector machine adjusted by the core parameters of each weed individual to obtain an evaluation score for each weed individual, comprising the following steps:
[0014] Traverse each weed individual in the weed population one by one, and use the core parameters corresponding to the traversed weed individuals as application parameters;
[0015] Applying the application parameters to the support vector machine to construct a prediction training model;
[0016] Input the drilling monitoring parameters into the prediction training model to obtain the training prediction results;
[0017] The F1 score corresponding to each weed individual is obtained based on the training prediction results corresponding to each weed individual and the actual drilling accident situation.
[0018] Optionally, updating the weed population by retaining a preset number of weed individuals based on the evaluation scores comprises the following steps:
[0019] When the number of individuals in the weed population exceeds a preset number, all weed individuals are sorted in descending order based on the evaluation scores to obtain an individual sequence;
[0020] The target number of weed individuals in the first row of the individual sequence is taken as the first retained individual set; the target number is half of the preset number, and the preset number is the initialization number of the weed population;
[0021] Randomly obtain a target number of weed individuals from other weed individuals in the weed population except the first reserved individual set as the second reserved individual set;
[0022] The weed population is updated according to the first retained individual set and the second retained individual set.
[0023] Optionally, before the step of generating the next generation of weed individuals based on the core parameters of each weed individual and using a normally distributed random number, the method further comprises the following steps:
[0024] Based on the evaluation score of each weed individual, the maximum score, minimum score and average score in the current weed population are obtained;
[0025] The score distribution parameter of the current weed population is obtained based on the ratio of the difference between the average score and the minimum score to the difference between the maximum score and the minimum score;
[0026] The crossover quantity is obtained by multiplying the score distribution parameter by the target quantity; the target quantity is half of the preset quantity;
[0027] The crossover probability is obtained by adding the product of the score distribution parameter and the preset increase probability to the preset baseline probability;
[0028] Two weed individuals are randomly obtained from the weed population as candidate individuals;
[0029] Generate a crossover random number within a preset range. If the crossover random number is less than the crossover probability, perform a crossover operation on the two candidate individuals to obtain a crossover individual; otherwise, no crossover operation is performed.
[0030] The number of crossovers is increased by one, and the step of randomly obtaining two weed individuals from the weed population as candidate individuals is returned to execute until the number of crossovers reaches the crossover number, and all the obtained crossover individuals are added to the weed population.
[0031] Optionally, based on the core parameters of each weed individual, a next generation of weed individuals is generated in combination with a normally distributed random number, and the next generation of weed individuals is added to the weed population, comprising the following steps:
[0032] Based on the evaluation score of each weed individual, the minimum score, maximum score and average score in the current weed population are obtained;
[0033] A search range parameter is constructed based on the execution progress of the iteration number combined with the minimum score, the average score, and a preset nonlinear adjustment factor; wherein the expression of the search range parameter is:
[0034]
[0035] Wherein, sigma represents the search range parameter; minF1Score represents the minimum score; e is a natural constant; maxGenCnt represents the maximum number of iterations; iterCnt represents the current number of iterations; nonlinearFactor represents the nonlinear adjustment factor; averF1Score represents the average score;
[0036] Traverse each weed individual in the weed population one by one, and use the traversed weed individuals as candidate individuals;
[0037] The relative score parameter of the candidate individual is obtained based on the ratio of the difference between the candidate individual's evaluation score and the average score to the difference between the maximum score and the average score;
[0038] The number of seeds of the candidate individuals is obtained by subtracting the score relative parameter and the preset seed range number from the preset maximum seed number; the preset seed range number is obtained based on the difference between the maximum seed number and the preset minimum seed number;
[0039] Using the search range parameter as the standard deviation, the update random number is randomly generated based on the preset normal distribution;
[0040] The core parameters of the candidate individuals are updated based on the updated random numbers to obtain the next generation of weed individuals of the candidate individuals;
[0041] Returning to execute the step of randomly generating and updating random numbers based on a preset normal distribution until the number of next generation weed individuals of the candidate individuals reaches the number of seeds;
[0042] All next generation weed individuals of each weed individual are added to the weed population.
[0043] Optionally, the method further comprises the following steps:
[0044] Compare the predicted accident situation with the actual accident situation corresponding to the real-time drilling monitoring parameters to obtain the prediction accuracy of the real-time drilling monitoring parameters;
[0045] Correlate real-time drilling monitoring parameters with actual accident situations and add them to historical drilling data;
[0046] Update the iteration parameters based on the prediction accuracy results;
[0047] When the iteration parameter is less than or equal to the update threshold, the target prediction model is continued to be used to predict drilling accidents for the new real-time drilling monitoring parameters, and then the process returns to the step of comparing the predicted accident situation with the actual accident situation corresponding to the real-time drilling monitoring parameters. Otherwise, the preset parameters are reset, and the process returns to the step of initializing multiple sets of support vector machine core parameters to construct the weed population, and the target prediction model is continuously updated.
[0048] Optionally, updating the iteration parameters based on the prediction accuracy results includes the following steps:
[0049] When the prediction accuracy is a successful prediction, the update iteration parameter is incremented by a single factor;
[0050] When the prediction accuracy is a prediction failure, the update iteration parameters are increased multiple times.
[0051] On the other hand, an embodiment of the present invention provides a drilling condition prediction device based on improved weeds, comprising:
[0052] The first module is used to obtain historical drilling data; the historical drilling data includes drilling monitoring parameters and their corresponding drilling accident conditions;
[0053] The second module is used to initialize multiple sets of core parameters of support vector machines to construct a weed population; each weed individual in the weed population includes a set of randomly generated core parameters;
[0054] The third module is used to use the drilling history data as a data set to evaluate the prediction effect of the support vector machine adjusted by the core parameters of each weed individual, and obtain the evaluation score of each weed individual;
[0055] A fourth module is used for renewing the weed population by retaining a preset number of weed individuals based on the evaluation scores;
[0056] The fifth module is used to generate the next generation of weed individuals based on the core parameters of each weed individual and a normally distributed random number, and add the next generation of weed individuals to the weed population; the number of seeds generated by each weed individual for the next generation of weed individuals is obtained based on the association with the evaluation score;
[0057] The sixth module is configured to increase the number of iterations by one. If the number of iterations is greater than a preset maximum number of iterations, the target parameter is obtained based on the evaluation score. Otherwise, the process returns to the third module and continues until the number of iterations is greater than the maximum number of iterations.
[0058] The seventh module is used to apply the target parameters to the support vector machine to build a target prediction model, and use the target prediction model to predict drilling accidents based on the real-time drilling monitoring parameters to obtain predicted accident conditions.
[0059] Optionally, the apparatus further includes an eighth module configured to perform the following operations:
[0060] Based on the evaluation score of each weed individual, the maximum score, minimum score and average score in the current weed population are obtained;
[0061] The score distribution parameter of the current weed population is obtained based on the ratio of the difference between the average score and the minimum score to the difference between the maximum score and the minimum score;
[0062] The crossover quantity is obtained by multiplying the score distribution parameter by the target quantity; the target quantity is half of the preset quantity;
[0063] The crossover probability is obtained by adding the product of the score distribution parameter and the preset increase probability to the preset baseline probability;
[0064] Two weed individuals are randomly obtained from the weed population as candidate individuals;
[0065] Generate a crossover random number within a preset range. If the crossover random number is less than the crossover probability, perform a crossover operation on the two candidate individuals to obtain a crossover individual; otherwise, no crossover operation is performed.
[0066] The number of crossovers is increased by one, and the step of randomly obtaining two weed individuals from the weed population as candidate individuals is returned to execute until the number of crossovers reaches the crossover number, and all the obtained crossover individuals are added to the weed population.
[0067] Optionally, the apparatus further includes a ninth module configured to perform the following operations:
[0068] Compare the predicted accident situation with the actual accident situation corresponding to the real-time drilling monitoring parameters to obtain the prediction accuracy of the real-time drilling monitoring parameters;
[0069] Correlate real-time drilling monitoring parameters with actual accident situations and add them to historical drilling data;
[0070] Update the iteration parameters based on the prediction accuracy results;
[0071] When the iteration parameter is less than or equal to the update threshold, the target prediction model is continued to be used to predict drilling accidents for the new real-time drilling monitoring parameters, and then the process returns to the step of comparing the predicted accident situation with the actual accident situation corresponding to the real-time drilling monitoring parameters. Otherwise, the preset parameters are reset, and the process returns to the step of initializing multiple sets of support vector machine core parameters to construct the weed population, and the target prediction model is continuously updated.
[0072] On the other hand, an embodiment of the present invention provides an electronic device, including: a processor and a memory; the memory is used to store a program; the processor executes the program to implement the above-mentioned drilling condition prediction method based on improved weeds.
[0073] On the other hand, an embodiment of the present invention provides a computer storage medium storing a program executable by a processor. When the program is executed by the processor, it is used to implement the above-mentioned drilling condition prediction method based on improved weeds.
[0074] The embodiment of the present invention obtains historical drilling data; the historical drilling data includes drilling monitoring parameters and their corresponding drilling accident conditions; initializes multiple sets of core parameters of a support vector machine to construct a weed population; each weed individual in the weed population includes a set of randomly generated core parameters; uses the historical drilling data as a data set, evaluates the prediction effect of the support vector machine adjusted by the core parameters of each weed individual, and obtains an evaluation score for each weed individual; updates the weed population based on the evaluation score, retains a preset number of weed individuals, generates the next generation of weed individuals based on the core parameters of each weed individual and a normally distributed random number, and adds the next generation of weed individuals to the weed population; obtains the number of seeds generated by each weed individual for the next generation based on the evaluation score; increments the number of iterations by one; if the number of iterations is greater than a preset maximum number of iterations, obtains a target parameter based on the evaluation score; otherwise, returns to the step of using the historical drilling data as a data set until the number of iterations is greater than the maximum number of iterations; applies the target parameter to the support vector machine to construct a target prediction model, and uses the target prediction model to predict drilling accidents based on real-time drilling monitoring parameters to obtain predicted accident conditions. By dynamically adjusting the core parameters of the SVM, the present invention enables a more efficient search for the global optimal solution, avoiding the local optimality issues of traditional grid searches or genetic algorithms. Furthermore, the present invention dynamically adjusts the reproductive capacity (seed number) of individual weeds based on their evaluation scores, enabling optimal parameter combinations to more quickly dominate population evolution and accelerate convergence to the optimal solution. Simultaneously, the present invention uses a normal distribution to randomly generate new individuals, maintaining population diversity and avoiding premature convergence. Furthermore, the present invention iteratively retains high-scoring individuals and eliminates inefficient parameter combinations, reducing inefficient computations and rapidly obtaining optimal parameters within a limited number of iterations, thus meeting the needs of real-time prediction of drilling accidents. This invention can provide an efficient and accurate means of accident prediction for drilling operations, effectively reducing drilling risks and improving operational safety and economic efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0075] The accompanying drawings are used to provide a further understanding of the technical solution of the present invention and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the technical solution of the present invention and do not constitute a limitation to the technical solution of the present invention.
[0076] Figure 1 This is a schematic diagram of an implementation environment for a drilling condition prediction method based on improved weeds provided in an embodiment of the present invention;
[0077] Figure 2 1 is a flow chart of a drilling condition prediction method based on improved weeds provided by an embodiment of the present invention;
[0078] Figure 3 A schematic diagram of the expanded flow of step S300 provided in an embodiment of the present invention;
[0079] Figure 4 A schematic diagram of the expanded flow of step S400 provided in an embodiment of the present invention;
[0080] Figure 5 A schematic diagram of an expanded process of the drilling condition prediction method based on improved weeds provided in an embodiment of the present invention;
[0081] Figure 6 A schematic diagram of the expanded flow of step S500 provided in an embodiment of the present invention;
[0082] Figure 7 A schematic diagram of another extended process of the drilling condition prediction method based on improved weeds provided in an embodiment of the present invention;
[0083] Figure 8 A schematic diagram of the overall process of the drilling condition prediction method based on improved weeds provided in an embodiment of the present invention;
[0084] Figure 9 A schematic structural diagram of a drilling condition prediction device based on improved weeds provided in an embodiment of the present invention;
[0085] Figure 10 A schematic structural diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0086] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present 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 only used to explain the present invention and are not intended to limit the present invention.
[0087] It should be noted that although the system diagrams illustrate functional module divisions and the flowcharts illustrate a logical sequence, in certain circumstances, the steps shown or described may be performed in a sequence that differs from the module divisions in the system or the sequence in the flowcharts. The terms "first / S100," "second / S200," and the like in the specification, claims, and drawings are used to distinguish similar objects and are not necessarily intended to describe a specific sequence or precedence.
[0088] References to "embodiments" in this disclosure mean that a particular feature, structure, or characteristic described in connection with the embodiment may be included in at least one embodiment of the disclosure. The appearance of this phrase in various places in the specification does not necessarily refer to the same embodiment, nor does it constitute an independent or alternative embodiment that is mutually exclusive of other embodiments. It is understood, both explicitly and implicitly, by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0089] To facilitate understanding of the technical solution of the present invention, the following technical terms that may appear in the technical solution of the present invention are first explained:
[0090] The Invasive Weed Optimization (IWO) algorithm, proposed by Mehrabian and Lucas in 2006, is a heuristic optimization algorithm based on weed population growth. It draws inspiration from the efficient survival mechanisms of weeds in nature through reproduction, diffusion, and competition. Its unique feature is that it achieves a smooth transition from global exploration to local exploitation by dynamically adjusting the standard deviation of the normal distribution of seed diffusion. This algorithm has a low parameter count and strong robustness, making it widely used in engineering design, machine learning, and data clustering.
[0091] Support Vector Machines (SVMs) are a classic machine learning method. With its exceptional generalization capabilities and effective handling of nonlinear problems, they demonstrate strong potential in areas such as pattern recognition, classification, and regression analysis. Their core concept is to construct an optimal decision boundary that not only clearly separates samples from different categories but also maximizes the margin between them, thereby enhancing the model's predictive performance on unknown data. For nonlinear problems, SVMs utilize kernel techniques to map the data to a high-dimensional space, achieving effective separation. They are suitable for small to medium-sized datasets and high-dimensional feature spaces.
[0092] Ocean drilling: This involves drilling deep into the ocean floor to obtain core samples from the Earth's crust and upper mantle to study its internal structure and geological processes. This process involves using specialized drilling equipment and vessels, such as ocean drilling vessels, to drill thousands of meters below the seafloor. This process not only helps scientists understand the Earth's internal structure but also reveals important geological phenomena such as its historical evolution and plate tectonics. For example, analyzing the sediments and rock composition in the cores can reveal historical information about climate change, biological succession, and other historical phenomena.
[0093] In the oil and gas extraction industry, lost circulation, well kicks, and blowouts are three serious accidents associated with 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.
[0094] Lost circulation refers to the unintended inflow of drilling fluid (also known as mud) into the formation during drilling. This loss is typically caused by high formation permeability or improper drilling pressure control. Lost circulation can reduce drilling fluid volume, impairing the ability to cool and clean the wellbore, and may also expose the wellbore wall, increasing the risk of collapse. In severe cases, lost circulation can hinder further drilling and may even require special measures to seal the lost zone.
[0095] A kick occurs when underground fluids (primarily natural gas or liquids) enter the wellbore at a rate exceeding normal circulation but not yet reaching the surface. A kick typically occurs when formation pressure exceeds wellbore pressure, or when the drilling fluid column pressure is insufficient to balance formation pressure. If a kick is not promptly controlled, it can quickly develop into a more serious blowout. A kick is an emergency, requiring immediate action such as adding weight to the drilling fluid or shutting down the blowout preventer to re-establish pressure equilibrium within the wellbore.
[0096] A blowout is one of the most serious accidents, occurring when high-pressure underground fluid (oil, gas, water, or other mixtures) rushes uncontrollably out of the wellhead, reaching the surface or sea. Blowouts not only result in significant resource losses but can also cause catastrophic consequences such as fires, explosions, and environmental pollution, posing a serious threat to personnel 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) and the injection of heavy drilling fluid or cement plugs to seal and control the well.
[0097] It is understandable that the drilling condition prediction method based on improved weeds provided in the embodiment of the present invention can be applied to any computer device with data processing and computing capabilities, and this computer device can be various terminals or servers. When the computer device in the embodiment is a server, the server is an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms. Optionally, the terminal is a smart phone, tablet computer, laptop computer, desktop computer, etc., but is not limited to this.
[0098] To facilitate understanding of the technical solutions of the present invention, the following are first explained regarding the technical features that may appear in the embodiments of the present invention:
[0099] like Figure 1 FIG. 1 is a schematic diagram of an implementation environment provided by an embodiment of the present invention. Figure 1 , the implementation environment includes at least one terminal 102 and a server 101. The terminal 102 and the server 101 can be connected to the network in a wireless or wired manner to complete data transmission and exchange.
[0100] Server 101 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers. It can also be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), as well as big data and artificial intelligence platforms.
[0101] In addition, server 101 can also be a node server in a blockchain network. Blockchain is a new application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, and encryption algorithm.
[0102] The terminal 102 may be a smart phone, tablet computer, laptop computer, desktop computer, smart speaker, smart watch, etc., but is not limited thereto. The terminal 102 and the server 101 may be connected directly or indirectly via wired or wireless communication, which is not limited in this embodiment of the present invention.
[0103] Based on the example Figure 1 In the implementation environment shown, an embodiment of the present invention provides a drilling condition prediction method based on improved weeds. The following description will be given using an example of the drilling condition prediction method based on improved weeds being applied to the server 101. It will be understood that the drilling condition prediction method based on improved weeds can also be applied to the terminal 102.
[0104] Reference Figure 2 , Figure 2 The flowchart of the drilling condition prediction method based on improved weeds applied to the server provided in the embodiment of the present invention, the execution subject of the drilling condition prediction method based on improved weeds can be any of the aforementioned computer devices (including servers or terminals). Figure 2 , the method comprises the following steps:
[0105] S100, obtaining historical drilling data;
[0106] Among them, the drilling history data includes drilling monitoring parameters and their corresponding drilling accident conditions;
[0107] For example, in some specific implementations, historical data mainly comes from currently available data, as well as public data from home and abroad, and multiple sets of data records collected from daily drilling reports, daily mud reports, completion reports and other materials. Some data indicate that accidents such as lost circulation, well kicks, and blowouts occurred during the drilling process, while some data indicate that the drilling process was normal.
[0108] S200, initializing multiple groups of core parameters of support vector machines to construct weed populations;
[0109] Among them, each weed individual in the weed population includes a set of randomly generated core parameters;
[0110] For example, in some specific implementations, the parameters of the improved weed optimization algorithm are as follows: preset population individual number maxWeedSize, the maximum number of weed populations, the default value is 50 (the value can be adjusted according to needs); the maximum number of population iterations MaxGenCnt, the maximum number of reproduction times of the weed population, the value is determined according to needs, and the default value is 10; the nonlinear adjustment factor nonlinearFactor, used to adjust the search accuracy, the value range is [1,5], the default value is 3, generally a constant, the larger the value, the larger the search range, the worse the search accuracy, and vice versa; the maximum number of seeds maxSeedNum, the maximum number of seeds generated by a weed individual, used to adjust the scale of newly generated seeds in each generation, the value is determined according to needs, the default value is 6; the minimum number of seeds minSeedNum, the minimum number of seeds generated by a weed individual, used to adjust the scale of newly generated seeds in each generation, the value is determined according to needs, the default value is 2, and the minSeedNum is satisfied. <maxSeedNum。
[0111] A weed population is composed of a large number of individuals. Each individual has two parameters, representing the regularization coefficient C and the kernel parameter g. These two variables are the core parameters of the SVM support vector machine. Their specific meanings are as follows:
[0112] Regularization coefficient C: This is an important hyperparameter in SVM that determines the model's tolerance for errors. Larger C values result in a greater penalty for misclassifications, potentially leading to overfitting the data. Smaller C values result in a smaller penalty for misclassifications, potentially leading to underfitting the data. There is no fixed range for the value of C; it depends on the complexity of the dataset. In this invention, the range of C is (0, 100).
[0113] Kernel parameter g: It determines the width of the Gaussian kernel function, which affects the performance of the SVM support vector machine model. Larger g values will result in a higher degree of fit of the model to the data, which may overfit the data. Smaller g values will result in a lower degree of fit of the model to the data, which may underfit the data. There is no fixed range for the value of g, which depends on the complexity of the data set problem. In the present invention, the value range of g is (0,10].
[0114] Population initialization is to generate maxWeedSize individuals, and each individual is initialized according to the following formula, where R(0,100) represents a random floating point number of (0,100], and R(0,10) represents a random floating point number of (0,10].
[0115] C=R(0,100)
[0116] g=R(0,10)
[0117] Weed i ={C,g}
[0118] Execute maxWeedSize times to get a population of maxWeedSize weeds.
[0119] It should be noted that the default values of various parameter values (such as the number of individuals in the population, the maximum number of iterations, and various parameters in subsequent embodiments) in the embodiments of the present invention are only for example descriptions, and their specific values can be adjusted according to needs.
[0120] S300, using the historical drilling data as a data set, performing a prediction evaluation on a support vector machine adjusted by the core parameters of each weed individual, and obtaining an evaluation score for each weed individual;
[0121] It should be noted that the evaluation score is the F1 score; in some embodiments, such as Figure 3 As shown, step S300 may include the following steps: S301, traversing each weed individual in the weed population one by one, and using the core parameters corresponding to the traversed weed individuals as application parameters; S302, applying the application parameters to a support vector machine to construct a prediction training model; S303, inputting the drilling monitoring parameters into the prediction training model for processing to obtain a training prediction result; S304, arranging the training prediction result corresponding to each weed individual and the actual drilling accident situation to obtain an F1 score corresponding to the corresponding weed individual.
[0122] For example, in some specific implementations, a drilling accident prediction SVM support vector machine model can be obtained through training based on a data set, which can be implemented as follows:
[0123] The F1 score is calculated based on the SVM prediction model. Each individual in the weed population represents the regularization coefficient C and the kernel parameter g, that is, each individual represents an SVM support vector machine. Based on the current individual, each data in the latest data set is traversed and input into the SVM support vector machine to obtain the predicted result, which is then compared with the actual result. The present invention uses the commonly used F1 score as the fitness function for evaluation. The F1 score is between [0,1]. The larger the score, the better the model performance. The calculation formula is as follows
[0124]
[0125] Among them, True Positives indicates the number of samples correctly predicted by the model as positive; False Positives indicates the number of samples incorrectly predicted by the model as positive, which are actually negative; False Negatives indicates the number of samples incorrectly predicted by the model as negative, which are actually positive.
[0126] In general, the most recent dataset is used as a benchmark, the current individual is used as input, and the F1 score (also known as the fitness function value) of the output is calculated. The best performing individual (BestWeed) is also recorded (i.e., the individual corresponding to the target parameter).
[0127] S400, reserving a preset number of weed individuals based on the evaluation scores to update the weed population;
[0128] It should be noted that, in some embodiments, Figure 4 As shown, step S400 may include the following steps: S401, when the number of individuals in the weed population exceeds a preset number, sorting all weed individuals in descending order based on the evaluation scores to obtain an individual sequence; S402, taking a target number of weed individuals in the front row of the individual sequence as a first retained individual set; the target number is half of the preset number, and the preset number is the initialization number of the weed population; S403, randomly obtaining a target number of weed individuals from other weed individuals in the weed population except the first retained individual set as a second retained individual set; S404, updating the weed population according to the first retained individual set and the second retained individual set.
[0129] For example, in some specific implementations, poorly performing weeds can be eliminated. Specifically, the number of individuals in the current weed population, curWeedSize, is counted. If it exceeds maxWeedSize, the poorly performing weeds need to be eliminated. The population data must always be guaranteed not to exceed maxWeedSize. The elimination rule is as follows: all weeds are sorted from largest to smallest according to their F1 scores, and the top weeds are taken. Weeds enter the next generation to reproduce, and then randomly select from the remaining individuals weeds, together forming a weed population of maxWeedSize individuals.
[0130] In some embodiments, before step S500, as Figure 5As shown, the method also includes the following steps: T100, obtaining the maximum score, minimum score and average score in the current weed population based on the evaluation score of each weed individual; T200, obtaining the score distribution parameter of the current weed population based on the ratio of the difference between the average score and the minimum score to the difference between the maximum score and the minimum score; T300, obtaining the crossover number according to the product of the score distribution parameter and the target number; the target number is half of the preset number; T400, obtaining the crossover probability according to the product of the score distribution parameter and the preset increase probability plus the preset baseline probability; T500, randomly obtaining two weed individuals from the weed population as candidate individuals; T500, generating a crossover random number within a preset range, if the crossover random number is less than the crossover probability, performing a crossover operation on the two candidate individuals to obtain a crossover individual; otherwise, no crossover operation is performed; T700, increasing the number of crossovers by one, returning to the step of randomly obtaining two weed individuals from the weed population as candidate individuals, until the number of crossovers reaches the crossover number, and adding all the obtained crossover individuals to the weed population.
[0131] For example, in some specific embodiments, a cross operation can also be performed between individual weeds, which can be specifically implemented as follows:
[0132] Traditional weed optimization algorithms rely on each individual producing the next generation of seeds, lacking inter- and intra-individual communication. Inspired by genetic algorithms, this paper introduces a crossover operator. Selecting high-quality weed individuals for the crossover operation requires specifying the crossover number (crossNum) and the crossover probability (crossRate).
[0133] The following formula is used to calculate the number of crosses crossNum, where averF1Score iter Indicates the average F1 score of the current iteration iterCnt population, maxF1Score iter Indicates the maximum F1 score of the current iteration iterCnt population, minF1Score iter Indicates the minimum F1 score of the current iteration iterCnt population. If averF1Score iter A large value indicates that the F1 scores of the weed population are dispersed. In this case, the crossover number corssNum will increase, thereby increasing population diversity, and vice versa. In general, corssNum will dynamically adjust according to the distribution of the current population F1 scores, with the overall trend being to decrease.
[0134]
[0135] The following formula is used to calculate the crossover probability crossRate, where baseCR is the base probability, usually a constant, with a default value of 0.3, and incrCR is the added probability, usually a constant, with a default value of 0.5. That is, the value range of crossRate is [baseCR, baseCR+incrCR]. iter A large value indicates that the F1 scores of the weed population are more dispersed. In this case, the crossover probability (crossRate) will increase, thereby increasing population diversity, and vice versa. In general, crossRate will dynamically adjust according to the current population F1 score distribution, with the overall trend being to decrease.
[0136]
[0137] Randomly select two weeds A1 and A2 from the current population and calculate a random number R1 between [0,1]. If R1 is less than the crossRate, weeds A1 and A2 are cross-pollinated to produce a new weed A3 (formula below). This completes one crossover operation. Repeat this process for crossNum times, ultimately obtaining crossNum weeds.
[0138]
[0139] S500, based on the core parameters of each weed individual and in combination with a normally distributed random number, generating the next generation of weed individuals, and adding the next generation of weed individuals to the weed population;
[0140] The number of seeds generated by each weed individual to generate the next generation of weed individuals is obtained based on the evaluation score association;
[0141] It should be noted that, in some embodiments, Figure 6 As shown, step S500 may include the following steps: S501, obtaining the minimum score, maximum score, and average score in the current weed population based on the evaluation score of each weed individual; S502, constructing a search range parameter based on the execution progress of the iteration number combined with the minimum score, the average score, and a preset nonlinear adjustment factor; wherein the expression of the search range parameter is:
[0142]
[0143] Wherein, sigma represents the search range parameter; minF1Score represents the minimum score; e is a natural constant; maxGenCnt represents the maximum number of iterations; iterCnt represents the current number of iterations; nonlinearFactor represents the nonlinear adjustment factor; averF1Score represents the average score;
[0144] S503. Traverse each weed individual in the weed population one by one and use the traversed weed individuals as candidate individuals. S504. Obtain a score relative parameter for the candidate individual based on the ratio of the difference between the candidate individual's evaluation score and the average score to the difference between the maximum score and the average score. S505. Obtain the number of seeds for the candidate individual by subtracting the score relative parameter and a preset seed range number from a preset maximum seed number; the preset seed range number is obtained based on the difference between the maximum seed number and a preset minimum seed number. S506. Use the search range parameter as the standard deviation and randomly generate an update random number based on a preset normal distribution. S507. Update the core parameters of the candidate individual based on the updated random number to obtain the next generation of weed individuals of the candidate individual. S508. Return to the step of randomly generating an update random number based on a preset normal distribution until the number of the next generation of weed individuals of the candidate individual reaches the seed number. S509. Add all next generation weed individuals of each weed individual to the weed population.
[0145] For example, in some specific implementations, the number of seeds for the next generation is first calculated dynamically: the entire weed population is traversed, and the number of seeds for each weed is calculated. i The number of seeds for the next generation seedNum i Where curF1Score i Weed i F1 score, averF1Score iter Indicates the average F1 score of the current iteration iterCnt population, maxF1Score iter Indicates the maximum F1 score of the current iteration iterCnt population, minF1Score iter It represents the minimum F1 score of the current iteration iterCnt population. IterCnt represents the number of iterations of the current population. Each time the population reproduces, the number of iterations iterCnt increases by one.
[0146] curF1Score i The larger the seedNum i This means that when the population is further away from the optimal solution, more seeds need to be generated for search. When the population is closer to the optimal solution, at least minSeedNum seeds of each weed can be guaranteed to be used for search, that is, all weeds participating in reproduction have the opportunity to leave seeds.
[0147]
[0148] Then, adaptively generate new weeds: traverse the entire weed population, the current weed Weed i Generate seedNum iA new seed is generated each time the following formula is executed, where normal(0,sigma) represents a normal distribution with a mean of 0 and a standard deviation of sigma (used to generate updated random numbers). j Indicates the current weed i Generate a seed and execute seedNum i times, based on Weed i Will generate seedNum i Traverse each weed, each seed will generate a new seed, and repeat this process until the traversal is completed, and the next generation of seeds will be obtained.
[0149] C j =C i +normal(0,sigma)
[0150] g j =g i +normal(0,sigma)
[0151] NewWeed j ={C j ,g j},1≤j≤seedNum i
[0152] At this point, the weeds have completed their growth and reproduction. The next generation of seeds has grown into weeds, and the population consists of parent and offspring weeds. Through natural selection, the new population determines whether the global optimal solution has been found.
[0153] It's important to note that the sigma value (i.e., the search range parameter) is updated with each iteration of the method. The sigma variable is updated using the following formula: MaxGenCnt represents the maximum number of iterations, minF1Score represents the minimum F1 score of the population at the current iteration (iterCnt), nonlinearFactor is the nonlinear adjustment factor, averF1Score represents the average F1 score of the population, and iterCnt represents the current number of iterations. The value range is [1, MaxGenCnt], and iterCnt increases by one with each iteration.
[0154]
[0155] Specifically, sigma dynamically adjusts the standard deviation of the normal distribution for seed diffusion. As iterCnt increases, averF1Score decreases overall, and sigma decreases, indicating a gradual narrowing of the search range. At the same time, the best individuals are retained in each generation. As sigma decreases, the search shifts from a large standard deviation initially to cover a wide area to a gradually narrowing standard deviation later in the search for the optimal solution, resulting in an increasingly refined search.
[0156] S600, incrementing the number of iterations by one. If the number of iterations is greater than a preset maximum number of iterations, obtaining the target parameter based on the evaluation score; otherwise, returning to the step of using the drilling history data as a data set until the number of iterations is greater than the maximum number of iterations;
[0157] It should be noted that the number of iterations is initially 0; if the number of iterations exceeds the maximum value MaxGenCnt (ie, the maximum number of iterations), the subsequent steps are performed; otherwise, the process returns to the step of using the drilling history data as a data set.
[0158] S700: Apply target parameters to a support vector machine to construct a target prediction model, and use the target prediction model to predict drilling accidents based on real-time drilling monitoring parameters to obtain predicted accident conditions.
[0159] For example, in some specific implementations, reaching this step means the entire simulated annealing process is complete, indicating that the optimal BestWeed parameter (i.e., the target parameter, determined based on the core parameters corresponding to the weed individual with the highest evaluation score during the iterative process) has been obtained. Specifically, applying the target parameter to a support vector machine to construct a target prediction model can be achieved as follows: the key parameters of the SVM (i.e., the target parameter) are clarified. Then, based on the latest dataset, a drilling accident prediction SVM model is obtained by training the historical data as the dataset.
[0160] Ultimately, the latest data (i.e., real-time drilling monitoring parameters) is obtained from on-site drilling reports, mud reports, completion reports, and other materials, or from the on-site monitoring system. These are real-time frontline operational data. 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. This data can be manually transcribed as needed or automatically generated by the monitoring system. Based on this data, it is input into the drilling accident prediction SVM support vector machine model to make on-site drilling accident predictions.
[0161] Among them, in some embodiments, such as Figure 7As shown, the method may further include the following steps: S800, comparing the predicted accident situation with the actual accident situation corresponding to the real-time drilling monitoring parameters to obtain the prediction accuracy of the real-time drilling monitoring parameters; S900, associating the real-time drilling monitoring parameters with the actual accident situation and adding them to the drilling history data; S1000, updating the iteration parameter based on the prediction accuracy result; S1100, when the iteration parameter is less than or equal to the update threshold, continuing to use the target prediction model to predict drilling accidents for the new real-time drilling monitoring parameters, and then returning to the step of comparing the predicted accident situation with the actual accident situation corresponding to the real-time drilling monitoring parameters; otherwise, resetting the preset parameters, returning to the step of initializing multiple sets of support vector machine core parameters to construct the weed population, and continuously updating the target prediction model. The preset parameters include the number of iterations and the iteration parameter.
[0162] For example, in some specific implementations, prediction accuracy can also be calculated based on an SVM prediction model. Real-time data is input into a drilling accident prediction SVM model to perform on-site drilling accident predictions. The accuracy of the predictions is then determined based on human experience. Furthermore, iteration parameters are updated based on prediction accuracy. If the SVM model iteration parameter, Delt, exceeds MaxDelt, the SVM model needs to be updated; otherwise, the current model can continue to be used. Specifically, updating the SVM model resets all parameters, including those related to the weed optimization algorithm, including resetting the number of iterations to 0.
[0163] Among them, in some embodiments, updating the iteration parameters based on the prediction accuracy result may include the following steps: when the prediction accuracy is a prediction success, the updated iteration parameters are increased by a single factor; when the prediction accuracy is a prediction failure, the updated iteration parameters are increased by multiple factors.
[0164] In some specific application scenarios, updating the iteration parameters can be achieved by the following formula:
[0165] Based on real-time data prediction, if the prediction fails, the Delt update formula is as follows:
[0166] Delt=Delt+1
[0167] Based on real-time data prediction, if the prediction is successful, the Delt update formula is as follows:
[0168] Delt=Delt+3
[0169] The parameter of the multiple-fold incremental application (3 in this embodiment) can be adjusted according to actual needs.
[0170] In order to explain the principle of the technical solution of the present invention in detail, the overall process of the present invention is described below in combination with some specific embodiments. It is easy to understand that the following is an explanation of the technical principle of the present invention and cannot be regarded as a limitation of the present invention.
[0171] First, it's important to note that current technical solutions rely on intuitive assessments by experts based on real-time sensor data. This assessment incorporates extensive field experience to identify drilling conditions and warn of potential accidents. This approach is limited by the subjectivity of human judgment and efficiency. Existing technical solutions have the following shortcomings:
[0172] 1) Delays in early warning response: The current early warning system relies heavily on manual analysis and judgment, and relies heavily on personal experience, resulting in low processing efficiency, a slow emergency response, and difficulty in responding quickly.
[0173] 2) Data analysis becomes more difficult: The amount of data is growing exponentially and the dimensions of data are expanding rapidly, which increases the complexity and difficulty of manual processing and understanding of data.
[0174] 3) The classification model is iteratively upgraded slowly, and there is a lack of immediate integration of field operation data to update the overall data set, which in turn affects the timeliness of the model iteration and update.
[0175] In view of this, the present invention proposes a drilling condition prediction method based on improved weeds, such as Figure 8 As shown, the method may include:
[0176] Step 1: Update the historical data set. The drilling data used in the present invention mainly includes historical data and field operation data, which together constitute the data set.
[0177] Historical data mainly comes from currently available data and public data at home and abroad. It is a collection of multiple data records collected from daily drilling reports, daily mud reports, completion reports and other materials. Some data show that accidents such as lost circulation, well kicks and blowouts occurred during the drilling process, while some data show that the drilling process was normal.
[0178] Field operation data is the data from the front lines. The SVM drilling accident prediction model is first used to predict whether drilling accidents such as lost circulation, kicks, and blowouts will occur. A human then manually determines the accuracy of the prediction. Whether the prediction is correct or not, the data is added to the historical data set. If the data predictions are consistently correct, the SVM drilling accident prediction model is regularly updated according to the configuration. If the data predictions fail, a certain condition is met, triggering an SVM drilling accident prediction model update.
[0179] 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, pump displacement, as well as whether three abnormal conditions such as drilling leakage, well kick, and blowout occurred under this set of data.
[0180] It should be noted 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, meaning they do not affect each other. While the iterative update of the SVM drilling accident prediction model is incomplete, the prediction model uses the previous version. When the iterative update is complete, a prediction model version update is triggered, temporarily suspending drilling accident prediction during the update. After the update, the latest model version is used. Go to step 2.
[0181] Step 2: Initialize the weed population. The parameters of the improved weed optimization algorithm are as follows: maxWeedSize, the maximum number of weed individuals, which is determined by demand and has a default value of 50; MaxGenCnt, the maximum number of iterations of the weed population, which is determined by demand and has a default value of 10; nonlinear adjustment factor nonlinearFactor, which is used to adjust the search accuracy, has a value range of [1,5] and a default value of 3. It is generally a constant. The larger the value, the larger the search range and the worse the search accuracy, and vice versa; maxSeedNum, the maximum number of seeds generated by a weed individual, which is used to adjust the size of the newly generated seeds in each generation, which is determined by demand and has a default value of 6; minSeedNum, the minimum number of seeds generated by a weed individual, which is used to adjust the size of the newly generated seeds in each generation, which is determined by demand and has a default value of 2, which satisfies minSeedNum. <maxSeedNum。
[0182] A weed population is composed of a large number of individuals. Each individual has two parameters, representing the regularization coefficient C and the kernel parameter g. These two variables are the core parameters of the SVM support vector machine. Their specific meanings are as follows:
[0183] Regularization coefficient C: This is an important hyperparameter in SVM that determines the model's tolerance for errors. Larger C values result in a greater penalty for misclassifications, potentially leading to overfitting the data. Smaller C values result in a smaller penalty for misclassifications, potentially leading to underfitting the data. There is no fixed range for the value of C; it depends on the complexity of the dataset. In this invention, the range of C is (0, 100).
[0184] Kernel parameter g: It determines the width of the Gaussian kernel function, which affects the performance of the SVM support vector machine model. Larger g values will result in a higher degree of fit of the model to the data, which may overfit the data. Smaller g values will result in a lower degree of fit of the model to the data, which may underfit the data. There is no fixed range for the value of g, which depends on the complexity of the data set problem. In the present invention, the value range of g is (0,10].
[0185] Population initialization is to generate maxWeedSize individuals, and each individual is initialized according to the following formula, where R(0,100) represents a random floating point number of (0,100], and R(0,10) represents a random floating point number of (0,10].
[0186] C=R(0,100)
[0187] g=R(0,10)
[0188] Weed i ={C,g}
[0189] Execute maxWeedSize times to obtain a population of maxWeedSize weeds, and go to step 3.
[0190] Step 3: Update the SVM prediction model. In Step 1, the latest dataset was obtained; in Step 2, the key parameters of the SVM were determined. Using the latest dataset, the drilling accident prediction SVM model was trained.
[0191] Step 4: Calculate the F1 score based on the SVM prediction model. Each individual in the weed population represents the regularization coefficient C and the kernel parameter g, that is, each individual represents an SVM support vector machine. Based on the current individual, traverse each data in the latest data set, input it into the SVM support vector machine, obtain the predicted result, and then compare it with the actual result. The present invention uses the commonly used F1 score as the fitness function for evaluation. The F1 score is between [0,1]. The larger the score, the better the model performance. The calculation formula is as follows
[0192]
[0193] Among them, True Positives indicates the number of samples correctly predicted by the model as positive; False Positives indicates the number of samples incorrectly predicted by the model as positive, which are actually negative; False Negatives indicates the number of samples incorrectly predicted by the model as negative, which are actually positive.
[0194] In general, using the latest dataset as the benchmark and the current individual as the input, calculate the F1 score (also known as the fitness function value) of the output. Also record the best-performing individual, BestWeed. Go to step 5.
[0195] BestWeed={C,g}
[0196] Step 5: Eliminate poorly performing weeds. Count the number of individuals in the current weed population, curWeedSize. If it exceeds maxWeedSize, the poorly performing weeds need to be eliminated. Always ensure that the population data does not exceed maxWeedSize. The elimination rules are as follows: All weeds are sorted from largest to smallest according to their F1 scores, and the top weeds are selected. Weeds enter the next generation to reproduce, and then randomly select from the remaining individuals Weeds together form a weed population of maxWeedSize individuals. Go to step 6.
[0197] Step 6: Update the sigma value. Update the value of the sigma variable using the following formula: MaxGenCnt represents the maximum number of iterations, minF1Score represents the minimum F1 score of the current iteration iterCnt population, nonlinearFactor is the nonlinear adjustment factor, averF1Score represents the average F1 score of the current population, and iterCnt is the current number of iterations. The value range is [1, MaxGenCnt]. IterCnt increases by one after each iteration.
[0198]
[0199] sigma dynamically adjusts the standard deviation of the normal distribution for seed diffusion. As iterCnt increases, averF1Score decreases overall, and sigma decreases, indicating a gradual narrowing of the search range. At the same time, the best individuals are retained in each generation. As sigma decreases, the search shifts from a large standard deviation initially to cover a wide area to a gradually narrowing standard deviation later in the search for the optimal solution, resulting in an increasingly refined search. Go to step 7.
[0200] Step 7: Perform a crossover operation between weed individuals. Traditional weed optimization algorithms have each individual generate the next generation of seeds (Step 8), lacking inter- and intra-individual communication. Inspired by genetic algorithms, this invention introduces a crossover operator. Selecting high-quality weed individuals for the crossover operation requires specifying the crossover number (crossNum) and the crossover probability (crossRate).
[0201] The following formula is used to calculate the number of crosses crossNum, where averF1Scoreiter Indicates the average F1 score of the current iteration iterCnt population, maxF1Score iter Indicates the maximum F1 score of the current iteration iterCnt population, minF1Score iter Indicates the minimum F1 score of the current iteration iterCnt population. If averF1Score iter A large value indicates that the F1 scores of the weed population are dispersed. In this case, the crossover number corssNum will increase, thereby increasing population diversity, and vice versa. In general, corssNum will dynamically adjust according to the distribution of the current population F1 scores, with the overall trend being to decrease.
[0202]
[0203] The following formula is used to calculate the crossover probability crossRate, where baseCR is the base probability, usually a constant, with a default value of 0.3, and incrCR is the added probability, usually a constant, with a default value of 0.5. That is, the value range of crossRate is [baseCR, baseCR+incrCR]. iter A large value indicates that the F1 scores of the weed population are more dispersed. In this case, the crossover probability (crossRate) will increase, thereby increasing population diversity, and vice versa. In general, crossRate will dynamically adjust according to the current population F1 score distribution, with the overall trend being to decrease.
[0204]
[0205] Randomly select two weeds A1 and A2 from the current population and calculate a random number R1 between [0,1]. If R1 is less than the crossRate, weeds A1 and A2 are cross-pollinated to produce a new weed A3 (formula below). This completes one cross-pollination operation. Repeat this process for crossNum times, ultimately obtaining crossNum weeds. Go to step 8.
[0206]
[0207] Step 8: Dynamically calculate the number of seeds for the next generation. Traverse the entire weed population and calculate the number of seeds for each weed. i The number of seeds for the next generation seedNum i Where curF1Score i Weed i F1 score, averF1Score iterIndicates the average F1 score of the current iteration iterCnt population, maxF1Score iter Indicates the maximum F1 score of the current iteration iterCnt population, minF1Score iter It represents the minimum F1 score of the current iteration iterCnt population. Iter represents the number of iterations of the current population. Each time the population reproduces, the number of iterations iterCnt increases by one.
[0208] curF1Score i The larger the seedNum i The larger the number, the fewer the number. This means that as the population moves further away from the optimal solution, more seeds need to be generated for the search. As the population moves closer to the optimal solution, at least the minSeedNum number of seeds per weed can be guaranteed to be used for the search. This means that all weeds participating in the reproduction process have a chance to leave seeds. Go to step 9.
[0209]
[0210] Step 9: Adaptively generate new weeds: traverse the entire weed population, the current weed Weed i Generate seedNum i A new seed is generated each time the following formula is executed, where normal(0,sigma) represents a normal distribution with a mean of 0 and a standard deviation of sigma (used to generate updated random numbers). j Indicates the current weed i Generate a seed and execute seedNum i times, based on Weed i Will generate seedNum i Traverse each weed, each seed will generate a new seed, and repeat this process until the traversal is completed, and the next generation of seeds will be obtained.
[0211] C j =C i +normal(0,sigma)
[0212] g j =g i +normal(0,sigma)
[0213] NewWeed j ={C j ,g j},1≤j≤seedNum i
[0214] After steps 5 through 9, the weeds have completed their growth and reproduction. The next generation of seeds has grown into weeds, and the population consists of parent and offspring weeds. Through natural selection, the global optimal solution is determined based on the new population. Then, proceed to step 10.
[0215] Step 10: The maximum number of iterations is met. Steps 3 to 9 are the innermost loop. The number of iterations increases by one each time it is executed. If the number of iterations exceeds the maximum value, MaxGenCnt (which can be customized and defaults to 10), go to step 11; otherwise, go to step 3.
[0216] Step 11: Find the optimal parameters of the SVM prediction model. When this step is reached, the entire simulated annealing process is completed, indicating that the optimal parameters BestWeed have been obtained, and go to step 12.
[0217] BestWeed={C,g}
[0218] Step 12: Update the SVM prediction model. In Step 1, the latest dataset was obtained; in Step 11, the key parameter of the SVM, BestWeed, was determined. Using the latest dataset, the drilling accident prediction SVM model was trained.
[0219] At the same time, the SVM model iteration parameter Delt is reset to its default value (which can be customized, with a default value of 0 and a maximum value equal to the update threshold MaxDelt, which ranges from [1,100] and defaults to 20). The SVM model iteration parameter Delt indicates whether an update is needed. If Delt > MaxDelt, an update is needed immediately; otherwise, an update is not needed for the time being.
[0220] Step 13: Obtain the latest data. This real-time data is obtained from on-site drilling reports, mud reports, completion reports, and other materials, or from on-site monitoring systems. It represents real-time frontline operational data. 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.
[0221] These data can be manually transcribed according to needs, or automatically generated by the monitoring system. Based on these data, they are input into the drilling accident prediction SVM support vector machine model to make on-site drilling accident predictions.
[0222] Step 14: Calculate prediction accuracy based on the SVM prediction model. Based on real-time data, input it into the drilling accident prediction SVM model to perform on-site drilling accident prediction. Then, combined with human experience, determine whether the prediction results are correct.
[0223] Step 15: Add the latest data to the historical data. If the prediction result is correct, directly add the real-time data to the historical data set. If the prediction result is incorrect, add the real-time data to the historical data set based on the actual result.
[0224] Step 16: Update the iteration parameters. The calculation formula is as follows:
[0225] Based on real-time data prediction, if the prediction fails, the Delt update formula is as follows:
[0226] Delt=Delt+1
[0227] Based on real-time data prediction, if the prediction is successful, the Delt update formula is as follows:
[0228] Delt=Delt+3
[0229] Step 17: Update the SVM model. If the SVM model iteration parameter Delt exceeds MaxDelt, the SVM model needs to be updated and go to step 18. Otherwise, the current model can continue to be used and go to step 13.
[0230] Step 18: Reset all parameters. Reset the parameters related to the weed optimization algorithm, including resetting the number of iterations to 0. Go to step 1.
[0231] To summarize, steps 1 through 12 use the latest dataset to find optimal parameters, thereby iteratively updating the optimal SVM drilling accident prediction model. Steps 13 through 17 use real-time operational data to predict the occurrence of drilling accident prediction SVM models, such as lost circulation, kicks, and blowouts. These two processes are independent and do not affect each other. While the iterative update of the SVM drilling accident prediction model is incomplete, the prediction model uses the previous version. When the iterative update is complete, a model version update is triggered, temporarily suspending drilling accident prediction. After the update, the latest model version is used.
[0232] In summary, the present invention proposes a drilling condition prediction method based on improved weeds. By improving the weed optimization algorithm to find the optimal parameters of the SVM support vector machine, and supporting the rapid update of the classification model, the drilling accident prediction model is made more accurate and real-time. Compared with the existing technology, the present invention has at least the following beneficial effects:
[0233] 1) A drilling accident prediction method based on SVM support vector machine is proposed. Relying on SVM support vector machine, the real-time performance of data prediction is stronger, which improves the intelligent level of accident warning.
[0234] 2) A method based on improved weed optimization method to search for the optimal parameters of SVM support vector machine was proposed. With the help of the global search capability of improved weeds, the network parameter adjustment process was automated and the accuracy of early warning was improved.
[0235] 3) An automated computing framework is proposed. By integrating multi-source data as input, the SVM drilling accident prediction model is automatically constructed throughout the entire process, reducing human intervention and enabling real-time updating and rapid prediction of the prediction model.
[0236] On the other hand, Figure 9 As shown, an embodiment of the present invention provides a drilling condition prediction device 900 based on improved weeds, which may include:
[0237] The first module 901 is used to obtain historical drilling data; the historical drilling data includes drilling monitoring parameters and their corresponding drilling accident conditions;
[0238] The second module 902 is used to initialize multiple sets of core parameters of support vector machines to construct a weed population; each weed individual in the weed population includes a set of randomly generated core parameters;
[0239] The third module 903 is used to use the drilling history data as a data set, and to evaluate the prediction effect of the support vector machine adjusted by the core parameters of each weed individual to obtain an evaluation score for each weed individual;
[0240] The fourth module 904 is configured to update the weed population by retaining a preset number of weed individuals based on the evaluation scores;
[0241] The fifth module 905 is configured to generate the next generation of weed individuals based on the core parameters of each weed individual and a normally distributed random number, and add the next generation of weed individuals to the weed population; the number of seeds generated by each weed individual for the next generation of weed individuals is obtained based on the evaluation score association;
[0242] The sixth module 906 is configured to increase the number of iterations by one. If the number of iterations is greater than a preset maximum number of iterations, the target parameter is obtained based on the evaluation score. Otherwise, the process returns to the third module 903 and continues until the number of iterations is greater than the maximum number of iterations.
[0243] The seventh module 907 is used to apply the target parameters to the support vector machine to build a target prediction model, and use the target prediction model to predict drilling accidents based on the real-time drilling monitoring parameters to obtain predicted accident conditions.
[0244] In some embodiments, the apparatus may further include an eighth module configured to perform the following operations:
[0245] Based on the evaluation score of each weed individual, the maximum score, minimum score and average score in the current weed population are obtained;
[0246] The score distribution parameter of the current weed population is obtained based on the ratio of the difference between the average score and the minimum score to the difference between the maximum score and the minimum score;
[0247] The crossover quantity is obtained by multiplying the score distribution parameter by the target quantity; the target quantity is half of the preset quantity;
[0248] The crossover probability is obtained by adding the product of the score distribution parameter and the preset increase probability to the preset baseline probability;
[0249] Two weed individuals are randomly obtained from the weed population as candidate individuals;
[0250] Generate a crossover random number within a preset range. If the crossover random number is less than the crossover probability, perform a crossover operation on the two candidate individuals to obtain a crossover individual; otherwise, no crossover operation is performed.
[0251] The number of crossovers is increased by one, and the step of randomly obtaining two weed individuals from the weed population as candidate individuals is returned to execute until the number of crossovers reaches the crossover number, and all the obtained crossover individuals are added to the weed population.
[0252] In some embodiments, the apparatus may further include a ninth module configured to perform the following operations:
[0253] Compare the predicted accident situation with the actual accident situation corresponding to the real-time drilling monitoring parameters to obtain the prediction accuracy of the real-time drilling monitoring parameters;
[0254] Correlate real-time drilling monitoring parameters with actual accident situations and add them to historical drilling data;
[0255] Update the iteration parameters based on the prediction accuracy results;
[0256] When the iteration parameter is less than or equal to the update threshold, continue to use the target prediction model to predict drilling accidents for the new real-time drilling monitoring parameters, and then return to the step of comparing the predicted accident situation with the actual accident situation corresponding to the real-time drilling monitoring parameters; otherwise, reset the preset parameters, return to execute the second module, and continuously update the target prediction model; the preset parameters include the number of iterations.
[0257] The contents of the method embodiments of the present invention are all applicable to the device embodiments. The functions specifically implemented by the device embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0258] In another aspect, an embodiment of the present invention further provides an electronic device comprising a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the aforementioned method for predicting drilling conditions based on improved weeds. The electronic device can be any smart terminal, including a tablet computer and an in-vehicle computer.
[0259] It can be understood that the contents of the above method embodiments are applicable to the present device embodiments, the functions specifically implemented by the present device embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0260] like Figure 10 As shown, Figure 10 The hardware structure of an electronic device 1000 according to another embodiment is shown. The electronic device 1000 includes:
[0261] The processor 1001 may be implemented as a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is configured to execute relevant programs to implement the technical solutions provided by the embodiments of the present invention.
[0262] The memory 1002 can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 1002 can store an operating system and other application programs. When the technical 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 by the processor 1001 to execute the network node population optimization method of the embodiment of the present invention.
[0263] Input / output interface 1003, used to implement information input and output;
[0264] Communication interface 1004, used to implement communication interaction between this device and other devices, which can be achieved through wired means (such as USB, network cable, etc.) or wireless means (such as mobile network, WiFi, Bluetooth, etc.);
[0265] Bus 1005 , which transmits information between various components of the device (e.g., processor 1001 , memory 1002 , input / output interface 1003 , and communication interface 1004 );
[0266] The processor 1001 , the memory 1002 , the input / output interface 1003 and the communication interface 1004 are connected to each other in communication within the device via the bus 1005 .
[0267] The electronic device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, i.e., they may be located in one location or distributed across multiple network units. Some or all of these modules may be selected based on actual needs to achieve the objectives of this embodiment.
[0268] The contents of the method embodiments of the present invention are all applicable to the electronic device embodiments. The functions specifically implemented by the electronic device embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0269] Another aspect of an embodiment of the present invention further provides a computer-readable storage medium, wherein the storage medium stores a program, and the program is executed by a processor to implement the above method.
[0270] It should be noted that the computer-readable medium shown in the embodiments of the present invention may be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or component, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, device, or component. In the present invention, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, which carries computer-readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer-readable medium may be transmitted using any suitable medium, including but not limited to wireless, wired, or any suitable combination thereof.
[0271] The contents of the method embodiments of the present invention are all applicable to the computer-readable storage medium embodiments. The functions specifically implemented by the computer-readable storage medium embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0272] The present 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 above method.
[0273] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present invention. In this regard, each box in the flowchart or block diagram can represent a module, program segment, or a part of code, and the above-mentioned module, program segment, or a part of code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in an order different from that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0274] It should be noted that although several modules of the device for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to an embodiment of the present invention, the features and functions of two or more modules or units described above can be concretized in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided into multiple modules or units to be concretized.
[0275] Through the description of the above embodiments, it is easy for those skilled in the art to understand that the example embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solution 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 (which can be a CD to ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes a number of instructions to enable a computing device (which can be a personal computer, a server, a touch terminal, or a network device, etc.) to execute the method according to the embodiments of the present invention.
[0276] In some optional embodiments, the function / operation mentioned in the block diagram may not occur in the order mentioned in the operation diagram. For example, depending on the function / operation involved, the two boxes shown in succession can actually be executed substantially simultaneously or the boxes can sometimes be executed in reverse order. In addition, the embodiment presented and described in the flow chart of the present invention is provided in an exemplary manner for the purpose of providing a more comprehensive understanding of the technology. The disclosed method is not limited to the operation and logic flow presented by the present invention. Optional embodiments are contemplated in which the order of the various operations is changed and the sub-operations described as a part of a larger operation are performed independently.
[0277] Furthermore, while the present invention has been described in the context of functional modules, it should be understood that, unless otherwise indicated, 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 separate physical devices or software modules. It will also be understood that a detailed discussion of the actual implementation of each module is not necessary for understanding the present invention. More specifically, given the properties, functions, and internal relationships of the various functional modules in the devices disclosed in the present invention, the actual implementation of the module will be understood within the ordinary skill of an engineer. Therefore, a person skilled in the art will be able to implement the present invention as set forth in the claims using ordinary skill without undue experimentation. It will also be understood that the specific concepts disclosed are merely illustrative and are not intended to limit the scope of the present invention, which is determined by the full scope of the appended claims and their equivalents.
[0278] If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, and other media that can store program code.
[0279] The logic and / or steps represented in the flowcharts or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing the logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution apparatus, device, or apparatus (e.g., a computer-based apparatus, a device including a processor, or other apparatus that can fetch instructions from and execute instructions on an instruction execution apparatus, device, or apparatus). For purposes of this specification, a "computer-readable medium" can be any device that can contain, store, communicate, propagate, or transport a program for use by, or in conjunction with, an instruction execution apparatus, device, or apparatus.
[0280] More specific examples (a non-exhaustive list) of computer-readable media include the following: an electrical connection with one or more wires (electronic devices), a portable computer disk cartridge (magnetic devices), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), a fiber optic device, and a portable compact disc read-only memory (CDROM). In addition, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, deciphering, or processing in another suitable manner as necessary, and then stored in a computer memory.
[0281] It should be understood that various parts of the present invention can be implemented using hardware, software, firmware, or a combination thereof. In the above-described embodiments, multiple steps or methods can be implemented using software or firmware stored in a memory and executed by a suitable instruction execution device. For example, if implemented using hardware, as in another embodiment, any one of the following technologies known in the art or a combination thereof can be used: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application-specific integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0282] Throughout this specification, reference to terms such as "one embodiment," "some embodiments," "examples," "specific examples," or "some examples" means that a specific feature, structure, material, or characteristic described in conjunction with that embodiment or example is included in at least one embodiment or example of the present invention. In this specification, schematic representations 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 any one or more embodiments or examples.
[0283] While embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions, and variations may be made to the embodiments without departing from the principles and spirit of the invention, and that the scope of the invention is defined by the claims and their equivalents.
[0284] The above is a specific description of the preferred implementation of the present invention, but the present invention is not limited to the embodiments. Those skilled in the art can make various equivalent modifications or substitutions without violating the spirit of the present invention. These equivalent modifications or substitutions are all included in the scope defined by the claims of the present invention.
Claims
1. A drilling condition prediction method based on improved weeds, characterized in that: The following steps are involved: Acquire historical drilling data; the historical drilling data includes drilling monitoring parameters and corresponding drilling accident conditions; Initializing multiple groups of support vector machine core parameters to construct a weed population; each weed individual in the weed population includes a group of randomly generated core parameters; Using the historical drilling data as a data set, performing a prediction effect evaluation on the support vector machine adjusted by the core parameters of each individual weed to obtain an evaluation score for each individual weed; Retaining a preset number of the weed individuals based on the evaluation scores to update the weed population; generating next-generation weed individuals based on the core parameters of each weed individual and a normally distributed random number, and adding the next-generation weed individuals to the weed population; and obtaining a number of seeds generated by each weed individual for the next-generation weed individuals based on the evaluation score; Incrementing the number of iterations by one, and if the number of iterations is greater than a preset maximum number of iterations, obtaining a target parameter based on the evaluation score; otherwise, returning to the step of using the drilling history data as a data set until the number of iterations is greater than the maximum number of iterations; The target parameters are applied to the support vector machine to construct a target prediction model, and the target prediction model is used to predict drilling accidents based on real-time drilling monitoring parameters to obtain predicted accident conditions.
2. The drilling condition prediction method based on improved weeds according to claim 1, characterized in that: The evaluation score is an F1 score; the method uses the drilling history data as a data set, performs a prediction effect evaluation on the support vector machine adjusted by the core parameters of each individual weed, and obtains an evaluation score for each individual weed, including the following steps: traversing each of the weed individuals in the weed population one by one, and using the core parameters corresponding to the traversed weed individuals as application parameters; Applying the application parameters to the support vector machine to construct a prediction training model; Inputting the drilling monitoring parameters into the prediction training model to obtain a training prediction result; The F1 score corresponding to each weed individual is obtained according to the training prediction result corresponding to each weed individual and the actual drilling accident situation.
3. The drilling condition prediction method based on improved weeds according to claim 1, characterized in that: The step of retaining a preset number of weed individuals based on the evaluation scores and updating the weed population comprises the following steps: When the number of individuals in the weed population exceeds the preset number, all the weed individuals are sorted in descending order based on the evaluation scores to obtain an individual sequence; taking a target number of weed individuals in the front row of the individual sequence as a first retained individual set; the target number is half of the preset number, and the preset number is the initialization number of the weed population; Randomly obtain the target number of weed individuals from the weed population except the first retained individual set as a second retained individual set; The weed population is updated according to the first retained individual set and the second retained individual set.
4. The drilling condition prediction method based on improved weeds according to claim 1, characterized in that: Before the step of generating the next generation of weed individuals based on the core parameters of each weed individual and in combination with normally distributed random numbers, the method further comprises the following steps: obtaining the maximum score, the minimum score and the average score in the current weed population based on the evaluation score of each weed individual; obtaining a score distribution parameter of the current weed population based on a ratio of a difference between the average score and the minimum score to a difference between the maximum score and the minimum score; Obtaining a crossover quantity according to the product of the score distribution parameter and a target quantity; the target quantity is half of the preset quantity; Obtaining a crossover probability based on a product of the score distribution parameter and a preset increase probability plus a preset baseline probability; randomly obtaining two weed individuals from the weed population as candidate individuals; Generate a crossover random number within a preset range, and if the crossover random number is less than the crossover probability, perform a crossover operation on the two candidate individuals to obtain a crossover individual; otherwise, do not perform the crossover operation; The number of crossovers is increased by one, and the step of randomly obtaining two weed individuals from the weed population as candidate individuals is returned to execution until the number of crossovers reaches the crossover quantity, and all the obtained crossover individuals are added to the weed population.
5. The drilling condition prediction method based on improved weeds according to claim 1, characterized in that: The step of generating the next generation of weed individuals based on the core parameters of each weed individual and combining them with a normally distributed random number, and adding the next generation of weed individuals to the weed population, comprises the following steps: obtaining the minimum score, the maximum score and the average score in the current weed population based on the evaluation score of each weed individual; A search range parameter is constructed based on the execution progress of the iteration number combined with the minimum score, the average score, and a preset nonlinear adjustment factor; wherein the expression of the search range parameter is: Wherein, sigma represents the search range parameter; minF1Score represents the minimum score; e is a natural constant; maxGenCnt represents the maximum number of iterations; iterCnt represents the current number of iterations; nonlinearFactor represents the nonlinear adjustment factor; averF1Score represents the average score; traversing each of the weed individuals in the weed population one by one, and taking the traversed weed individuals as candidate individuals; Obtaining a score relative parameter of the candidate individual based on a ratio of a difference between the evaluation score of the candidate individual and the average score to a difference between the maximum score and the average score; The seed number of the candidate individual is obtained by subtracting the score relative parameter and a preset seed range number from a preset maximum seed number; the preset seed range number is obtained based on the difference between the maximum seed number and a preset minimum seed number; Using the search range parameter as a standard deviation, randomly generating an updated random number based on a preset normal distribution; Performing multiplication and updating on the core parameters of the candidate individuals based on the updated random number to obtain the next generation weed individuals of the candidate individuals; Returning to the step of randomly generating and updating random numbers based on a preset normal distribution until the number of the next generation weed individuals of the candidate individuals reaches the number of seeds; All of the next generation weed individuals of each of the weed individuals are added to the weed population.
6. The drilling condition prediction method based on improved weeds according to claim 1, characterized in that: The method further comprises the following steps: Comparing the predicted accident situation with the actual accident situation corresponding to the real-time drilling monitoring parameters to obtain the prediction accuracy of the real-time drilling monitoring parameters; Associating the real-time drilling monitoring parameters with the actual accident situation and adding them to the drilling history data; updating an iteration parameter based on the prediction accuracy result; When the iteration parameter is less than or equal to the update threshold, continue to use the target prediction model to predict the drilling accident for the new real-time drilling monitoring parameters, and then return to the step of comparing the predicted accident situation with the actual accident situation corresponding to the real-time drilling monitoring parameters; otherwise, reset the preset parameters, return to the step of initializing multiple groups of support vector machine core parameters to construct the weed population, and continue to update the target prediction model.
7. The drilling condition prediction method based on improved weeds according to claim 6, characterized in that: The updating of the iteration parameters based on the prediction accuracy result comprises the following steps: When the prediction accuracy is a successful prediction, the update iteration parameter is incremented by a single factor; When the prediction accuracy is a prediction failure, the update iteration parameter is increased multiple times.
8. A drilling condition prediction device based on improved weeds, characterized in that: include: The first module is used to obtain historical drilling data; the historical drilling data includes drilling monitoring parameters and their corresponding drilling accident conditions; The second module is used to initialize multiple groups of core parameters of support vector machines to construct a weed population; each weed individual in the weed population includes a group of randomly generated core parameters; A third module is configured to use the historical drilling data as a data set, perform prediction effect evaluation on the support vector machine adjusted by the core parameters of each individual weed, and obtain an evaluation score for each individual weed; A fourth module is configured to retain a preset number of the weed individuals based on the evaluation scores and update the weed population; A fifth module is configured to generate next-generation weed individuals based on the core parameters of each weed individual and a normally distributed random number, and add the next-generation weed individuals to the weed population; the number of seeds generated by each weed individual for the next-generation weed individuals is obtained based on the evaluation score; a sixth module, configured to increase the number of iterations by one, and if the number of iterations is greater than a preset maximum number of iterations, obtain a target parameter based on the evaluation score; otherwise, return to executing the third module until the number of iterations is greater than the maximum number of iterations; The seventh module is used to apply the target parameters to the support vector machine to construct a target prediction model, and use the target prediction model to predict drilling accidents based on real-time drilling monitoring parameters to obtain predicted accident conditions.
9. An electronic device, characterized in that: including a processor and a memory; The memory is used to store programs; The processor executes the program to implement the method according to any one of claims 1 to 7.
10. A computer storage medium storing a program executable by a processor, characterized in that: The program executable by the processor is used to implement the method according to any one of claims 1 to 7 when executed by the processor.