A swarm intelligence risk assessment and early warning method and related device

CN122840686APending Publication Date: 2026-09-29GUANGZHOU MARINE GEOLOGICAL SURVEY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611081219.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-21
Publication Date
2026-09-29

AI Technical Summary

Technical Problem

但这些现有技术,在实现事故方面还存一些不足:1、事故预警的智能化水平需要进一步提高;2、智能算法用的模型的参数往往无法自动化调参,导致预警精度需要进一步提高;3、智能算法用的模型的迭代升级往往缺乏,导致该模型往往缺乏具备实时更新能力和快速响应能力

Benefits of technology

[0051]本发明的有益效果:本发明提出利用支持向量机SVM构建钻井险情评估预警模型,提升了事故预警的智能化水平。采用改进的差分进化算法自动搜索SVM最优参数,实现了模型调参过程的自动化,有效提高了预警精度。整合现场作业数据对预测模型进行验证和持续优化,加速模型迭代升级,确保预测模型具备实时更新能力和快速响应特性。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122840686A_ABST
    Figure CN122840686A_ABST
Patent Text Reader

Abstract

The application discloses a kind of group intelligence danger assessment early warning method and related equipment, the method includes the following steps: obtaining multiple drilling data and establishing the population of difference evolution algorithm DE, each individual of population includes two hyperparameters, two hyperparameters are respectively regularizing coefficient C in support vector machine SVM and kernel parameter g, find and the optimal regularizing coefficient and optimal kernel parameter are respectively as regularizing parameter C and kernel parameter g in support vector machine SVM, to obtain the updated support vector machine SVM and as drilling danger assessment early warning model, input the latest field drilling data into drilling danger assessment early warning model, to predict drilling operation danger, according to the prediction result, issue early warning, danger includes well leakage, well gushing and blowout. The application improves the intelligent level of accident early warning, realizes the automation of model parameter adjustment process, effectively improves the early warning precision.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of drilling hazard prediction technology, specifically a swarm intelligence hazard assessment and early warning method and related equipment. Background Technology

[0002] In the process of oil and gas drilling and extraction, well leakage, well kick, and well blowout are three serious accidents related to drilling operations. The assessment and early warning of these three risks are of great significance to ensuring production operations.

[0003] These three types of hazards 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.

[0004] Loss of drilling fluid (also known as mud) refers to the accidental inflow of drilling fluid into the formation during the drilling process. This is usually caused by high formation permeability or improper drilling pressure control, leading to fluid loss. Loss of drilling fluid can reduce the amount of drilling fluid, affecting the cooling and cleaning capabilities of the wellbore, and may also expose the wellbore wall, increasing the risk of collapse. In severe cases, loss of drilling can hinder continued drilling and may even require special measures to seal the lost circulation zone.

[0005] A well kick occurs when underground fluid (mainly natural gas or liquids) enters the wellbore at a rate exceeding normal circulation speed, but before reaching the surface. Well kicks are usually caused by formation pressure exceeding the pressure inside the wellbore, or by insufficient drilling fluid column pressure to balance the formation pressure. If not controlled promptly, a well kick can quickly escalate into a more severe blowout. A well kick is an emergency requiring immediate action, such as increasing the drilling fluid volume and shutting off the blowout preventer (BOP), to re-establish pressure balance within the wellbore.

[0006] A blowout is one of the most serious accidents, occurring when high-pressure underground fluids (oil, gas, water, or other mixtures) are uncontrollably ejected from the wellhead and reach the surface or sea. Blowouts not only cause enormous resource losses but can also trigger catastrophic consequences such as fires, explosions, and environmental pollution, seriously threatening human safety and the environment. Blowouts typically require the immediate activation of emergency response plans, including the use of specialized well control equipment (such as blowout preventers), injection of re-drilling fluid, or cement plugs to seal and control the well.

[0007] For the assessment of hazards during drilling, including lost circulation, well kicks, and blowouts, existing technologies have begun to explore various methods for predicting drilling accidents using intelligent algorithms, that is, methods for assessing and issuing early warnings using intelligent algorithms. However, these existing technologies still have some shortcomings in terms of accident detection: 1. The level of intelligence in accident early warning needs to be further improved; 2. The parameters of the models used by intelligent algorithms often cannot be automatically adjusted, resulting in a need to further improve the accuracy of early warnings; 3. Iterative upgrades of the models used by intelligent algorithms are often lacking, resulting in models that often lack real-time update capabilities and rapid response capabilities. Summary of the Invention

[0008] To address the shortcomings of existing technologies, the purpose of this invention is to provide a swarm intelligence-based risk assessment and early warning method and related equipment, which can solve the problems described in the background art.

[0009] The technical solution to achieve the objective of this invention is: a swarm intelligence-based risk assessment and early warning method, comprising the following steps: Step S1: Obtain multiple drilling data sets, including historical drilling data and on-site drilling data. Both historical and on-site drilling data include records of any incidents that may have occurred. A population for the Differential Evolutionary Algorithm (DE) is established, where each individual in the population has two hyperparameters: the regularization coefficient C and the kernel parameter g, which are used in Support Vector Machines (SVMs). Step S2: Treat each drilling data point as an individual and use the Differential Evolutionary Algorithm (DE) to find the optimal individual. The two hyperparameters of the optimal individual are then used as the optimal hyperparameters, including the optimal regularization coefficient. and optimal kernel parameters , The optimal regularization coefficient and optimal kernel parameters The regularization parameter C and kernel parameter g are respectively used as the regularization parameter and kernel parameter g in the support vector machine (SVM), thus obtaining the updated SVM. The updated SVM is used as a drilling hazard assessment and early warning model. Step S3: Input the latest field drilling data into the drilling hazard assessment and early warning model to predict drilling operation hazards and issue early warnings based on the prediction results. Hazards include well leakage, well kick, and well blowout.

[0010] Furthermore, the specific implementation process of step S2 includes the following steps: Step 2: Establish a population for the differential evolution algorithm (DE), with a total number of individuals M, and initialize the individuals in the population to obtain the values ​​of the regularization coefficient C and kernel parameter g for each individual after initialization. Step 3: Iterate through each drilling data point, treating each individual data point as a prediction model. Input each drilling data point into each prediction model to obtain the prediction result. Compare the prediction result with the actual result to obtain the comparison result. Accuracy is calculated for each individual based on the comparison results. Accuracy represents the proportion of samples that correctly predicted the data out of the total sample, after comparing the predictions of all prediction models with the actual results for that historical data input. Each individual is considered as one sample. Accuracy is calculated using the following formula:

[0011] In the formula, TP is the number of correctly predicted positive class samples, FP is the number of incorrectly predicted positive class samples, TN is the number of correctly predicted negative class samples, and FN is the number of incorrectly predicted negative class samples. Step 4: Iterate through the accuracy of each individual and check if there exists an accuracy ≥ 1. individuals, As a preset value, If it exists, the accuracy will be ≥ The individual's hyperparameters are selected as the optimal hyperparameters, and the process proceeds to step 9; if no optimal hyperparameters are found, the process proceeds to step 5. Step 5: Iterate through each individual in the population, performing the same mutation operation on each individual to obtain a new individual. After each individual has obtained a new individual, the original population... Becoming a new population , For the individual The mutation operations include: Three different individuals were randomly selected from the population. , and , And obtain the first one according to the following formula. individual New individuals after mutation :

[0012]

[0013]

[0014]

[0015]

[0016]

[0017]

[0018]

[0019] In the formula, Represents a new individual The regularization coefficient C, Represents a new individual The kernel parameter g, This represents the maximum value of the correlation coefficient. This represents the minimum value of the correlation coefficient. Indicates the current iteration number. Indicates the maximum number of iterations. This represents the correlation coefficient of the current iteration; Step 6: Traverse the new population For each individual in the process, the same crossover operation is performed, resulting in a crossover population. , For new populations The first in individual Its crossover operations include: new population In the process, a different individual is randomly selected. , The crossover probability of individual iterations is calculated as follows. :

[0020]

[0021]

[0022]

[0023]

[0024]

[0025]

[0026] In the formula, Represents an individual The regularization coefficient C and the kernel parameter g, Represents an individual The regularization coefficient C and the kernel parameter g, This represents the maximum value of the crossover probability. This represents the minimum crossover probability. Indicates the attenuation coefficient; Step 7: Traverse the crossover population For each individual, calculate the crossover population. The accuracy of each individual, in relation to the population. and cross populations Individuals are sorted by accuracy from smallest to largest, and the top-ranked individuals are selected. One individual, the remainder Individuals are randomly generated to obtain an updated crossover population. The updated cross population The total number of individuals remains at M; Step 8: Repeat steps 3-7 until the current iteration number r ≥ the maximum iteration number MaxGen, and then jump to step 9; otherwise, jump to step 3 and continue repeating steps 3-7. Step 9: Iterate through the accuracy of each individual and select the individual with the highest accuracy as the optimal individual. Optimal individual , The optimal hyperparameters; Step 10: Select the optimal individual Optimal hyperparameters The regularization coefficient C and kernel parameter g in the support vector machine (SVM) are used to obtain the updated support vector machine (SVM), which serves as a drilling hazard assessment and early warning model.

[0027] Furthermore, after step S2 and before step 3, the following steps are also included: Step S4: Collect the latest field drilling data. Based on the latest field drilling data, determine whether it is necessary to update the drilling hazard assessment and early warning model. If not, continue to use the current drilling hazard assessment and early warning model to predict drilling operation hazards. If necessary, reset the target parameters of the current drilling hazard assessment and early warning model and jump to step S2.

[0028] Furthermore, the specific implementation process of step S4 includes the following steps: Step 11: Obtain the latest field drilling data and input the latest field drilling data into the drilling hazard assessment and early warning model; Step 13: Based on the prediction results obtained in Step 12, add the field drilling data with correct prediction results to the qualified data set, and add the field drilling data with incorrect prediction results to the qualified data set after manual correction. The qualified data set is initially empty. After obtaining the qualified data set, proceed to Step 14. Step 14: Repeat steps 11-13, each iteration is one iteration, and increment the iteration count by 1, update the iteration count until the iteration count reaches the second maximum iteration count OMaxGen, and add the accuracy calculated in step 12 to a queue A, and continuously calculate the standard deviation of accuracy StdAccuracy, and then go to step 15. Step 15: If the number of iterations does not reach the second maximum number of iterations OMaxGen, proceed to step 11. If the number of iterations is greater than or equal to the second maximum number of iterations OMaxGen, then compare the standard deviation StdAccuracy with... The size relationship, if StdAccuracy ≥ Then proceed to step 11. If StdAccuracy < Then proceed to step 16; Step 16: Target parameters of the current drilling hazard assessment and early warning model. Target parameters include the parameters of the differential evolution algorithm (DE), the relevant parameters of the support vector machine (SVM), the current iteration number r, and queue A. After resetting, return to step 2.

[0029] A swarm intelligence-based hazard assessment and early warning device, comprising: The data acquisition module is used to acquire multiple drilling data. The drilling data acquired by the data acquisition module includes historical drilling data and on-site drilling data. Both the historical drilling data and the on-site drilling data include records of whether any dangerous situations have occurred. The population initialization module is used to establish the population of the differential evolution algorithm (DE). Each individual in the population includes two hyperparameters, namely the regularization coefficient C and the kernel parameter g in the support vector machine (SVM). The model training module treats each drilling data point as an individual and uses the Differential Evolutionary Algorithm (DE) to find the optimal individual. The two hyperparameters of this optimal individual are then used as the optimal hyperparameters, including the optimal regularization coefficient. and optimal kernel parameters ; and the optimal regularization coefficient and optimal kernel parameters The regularization parameter C and kernel parameter g are respectively used as regularization parameters and kernel parameters in the support vector machine (SVM) to obtain the updated support vector machine (SVM), which serves as a drilling hazard assessment and early warning model. The prediction and early warning module is used to input the latest field drilling data into the drilling hazard assessment and early warning model to predict drilling operation hazards and issue early warnings based on the prediction results. The hazards include well leakage, well kick, and well blowout.

[0030] Furthermore, the model training module specifically includes: The individual accuracy calculation unit is used to traverse each drilling data point, treating each individual as a prediction model. Each drilling data point is input into each prediction model to obtain a prediction result. The prediction result is then compared with the actual result, and the accuracy of each individual is calculated based on the comparison result. The accuracy is calculated using the following formula:

[0031] In the formula, TP is the number of correctly predicted positive class samples, FP is the number of incorrectly predicted positive class samples, TN is the number of correctly predicted negative class samples, and FN is the number of incorrectly predicted negative class samples. The first judgment unit is used to iterate through the accuracy of each individual and check if there exists an accuracy ≥ 1. individuals, This is a preset value; if it exists, the accuracy will be ≥ The hyperparameters of the individual are used as the optimal hyperparameters, and the optimal parameter output unit is triggered; if they do not exist, the mutation operation unit is triggered. The mutation unit is used to traverse every individual in the population. Each individual undergoes the same mutation operation to obtain a new individual. After each individual has obtained a new individual, the original population... Becoming a new population , For the individual The mutation operations include: Three different individuals were randomly selected from the population. , and , And obtain the first one according to the following formula. individual New individuals after mutation :

[0032]

[0033]

[0034]

[0035]

[0036]

[0037]

[0038]

[0039] In the formula, Represents a new individual The regularization coefficient C, Represents a new individual The kernel parameter g, This represents the maximum value of the correlation coefficient. This represents the minimum value of the correlation coefficient. Indicates the current iteration number. Indicates the maximum number of iterations. This represents the correlation coefficient of the current iteration; The crossover unit is used to iterate through each individual in the new population Mind, performing the same crossover operation on each individual to obtain the crossover population CId. The first in individual Its crossover operations include: new population In the process, a different individual is randomly selected. , The crossover probability of individual iterations is calculated as follows. :

[0040]

[0041]

[0042]

[0043]

[0044]

[0045]

[0046] In the formula, Represents an individual The regularization coefficient C and the kernel parameter g, Represents an individual The regularization coefficient C and the kernel parameter g, This represents the maximum value of the crossover probability. This represents the minimum crossover probability. Indicates the attenuation coefficient; Select the update unit to traverse the crossover population. For each individual, calculate the crossover population. The accuracy of each individual, in relation to the population. and cross populations Individuals are sorted by accuracy from smallest to largest, and the top-ranked individuals are selected. One individual, the remainder Individuals are randomly generated to obtain an updated crossover population. The updated cross population The total number of individuals remains at M; The iterative control unit is used to repeatedly trigger the individual accuracy calculation unit, the first judgment unit, the mutation operation unit, the crossover operation unit, and the selection update unit until the current iteration number r ≥ the maximum iteration number MaxGen, and then trigger the optimal parameter output unit. The optimal parameter output unit is used to iterate through the accuracy of each individual and select the individual with the highest accuracy as the optimal individual. Optimal individual , The optimal hyperparameters; The model update unit is used to update the optimal individual Optimal hyperparameters The regularization coefficient C and kernel parameter g in the support vector machine (SVM) are used to obtain the updated support vector machine (SVM), which serves as a drilling hazard assessment and early warning model.

[0047] Furthermore, the device also includes: The model maintenance module is used to collect the latest field drilling data after the model training module is completed and before the prediction and early warning module is executed. Based on the latest field drilling data, it determines whether the drilling hazard assessment and early warning model needs to be updated. If not, the current drilling hazard assessment and early warning model continues to be used to predict drilling operation hazards. If so, the target parameters of the current drilling hazard assessment and early warning model are reset and the model training module is triggered.

[0048] Furthermore, the model maintenance module specifically includes: The data acquisition and prediction unit is used to acquire the latest field drilling data and input the latest field drilling data into the drilling hazard assessment and early warning model; The data filtering and correction unit is used to add the field drilling data with correct prediction results to the qualified data set according to the prediction results, and to add the field drilling data with incorrect prediction results to the qualified data set after manual correction. The qualified data set is initially an empty set. The iteration and statistics unit is used to repeatedly trigger the data acquisition and prediction unit and the data filtering and correction unit. Each loop is an iteration, and the iteration count is incremented by 1 to update the iteration count until the iteration count reaches the second maximum iteration count OMaxGen. The calculated accuracy is added to a queue A, and the standard deviation StdAccuracy of the accuracy is continuously calculated. The second judgment unit is used to trigger the data acquisition and prediction unit if the number of iterations does not reach the second maximum number of iterations OMaxGen; and to judge the standard deviation StdAccuracy if the number of iterations is greater than or equal to the second maximum number of iterations OMaxGen. The size relationship, if StdAccuracy ≥ Then proceed to step 11. If StdAccuracy < If so, the parameter reset unit will be triggered; The parameter reset unit is used to reset the target parameters of the current drilling hazard assessment and early warning model. The target parameters include the parameters of the differential evolution algorithm (DE), the relevant parameters of the support vector machine (SVM), the second maximum iteration number OMaxGen, and the queue A. After the reset, the population initialization module in the model training module is triggered.

[0049] An electronic device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the aforementioned swarm intelligence hazard assessment and early warning method.

[0050] A non-transitory computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the aforementioned swarm intelligence hazard assessment and early warning method.

[0051] The beneficial effects of this invention are as follows: This invention proposes to construct a drilling hazard assessment and early warning model using Support Vector Machine (SVM), thereby improving the intelligence level of accident early warning. An improved differential evolution algorithm is employed to automatically search for the optimal SVM parameters, automating the model parameter tuning process and effectively improving early warning accuracy. Integrating field operation data to verify and continuously optimize the prediction model accelerates model iteration and upgrades, ensuring that the prediction model possesses real-time update capabilities and rapid response characteristics. Attached Figure Description

[0052] Figure 1 This is a flowchart illustrating a preferred embodiment of the method of the present invention; Figure 2 This is a schematic diagram of the frame of the device of the present invention; Figure 3 This is a schematic diagram of the electronic device of the present invention. Detailed Implementation

[0053] The present invention will be further described below with reference to the accompanying drawings and specific embodiments: like Figure 1 As shown, a swarm intelligence-based risk assessment and early warning method includes the following steps: Step 1: Obtain drilling data, which includes historical drilling data and on-site drilling data. Both historical and on-site drilling data include records of any incidents that occurred. Incidents include lost circulation, well kick, and blowout. If any of these incidents occurs, it is considered an incident or an anomaly. Conversely, if no incident occurs, it is considered normal operation and no incident has occurred.

[0054] Understandably, drilling data is a dataset, and historical drilling data and field drilling data are also datasets. The historical drilling data dataset includes multiple historical drilling data entries, while the field drilling data dataset includes multiple field drilling data entries. Historical drilling data primarily originates from publicly available domestic and international sources, including multiple sets of records extracted from documents such as daily drilling reports, daily mud reports, and well completion reports. These data / records cover both cases of accidents such as lost circulation, well kicks, or blowouts that occurred during drilling, as well as relevant information under normal operating conditions. Field drilling data is generally collected directly from the front-line operation site, up to the current time.

[0055] For field drilling data, drilling accident prediction models can be applied to predict lost circulation, well kick, or blowout in real time, and then the prediction results can be manually verified. Regardless of whether the prediction is correct or not, the relevant data is incorporated into the field drilling data.

[0056] Whether it is historical drilling data or field drilling data, each set of data generally records multiple characteristic variables such as lithology, pore size, porosity, pore pressure, fracture pressure, shear stress, gel strength, pump pressure, drill bit speed, original fracture direction, cement slurry density, drilling fluid density, inlet flow rate, outlet flow rate, and pump discharge rate, and clearly indicates whether the three abnormal situations of well leakage, well kick, or well blowout have occurred.

[0057] Step 2: Establish a population for the Differential Evolutionary Algorithm (DE). The total number of individuals in the population is M. Each individual includes the regularization coefficient C and kernel parameter g from the Support Vector Machine (SVM). Initialize the individuals in the population to obtain the values ​​of the regularization coefficient C and kernel parameter g for each individual after initialization.

[0058] Understandably, the regularization coefficient C and the kernel parameter g are both key hyperparameters in Support Vector Machines (SVMs). These two parameters together constitute the genetic code of individuals in the population, and their interaction determines the overall performance of the SVM model. Furthermore, the values ​​of the regularization coefficient C and the kernel parameter g affect the performance of the SVM.

[0059] For example, in the prior art, the value of C is generally in the range of The value of g is in In this embodiment, the inventors discovered that, for the real-time prediction requirements of drilling accidents, the final value range of the regularization coefficient C should be [value missing]. That is, C should take values ​​between 0 (excluding) and 100 (including), and the final value range of the kernel parameter g should be [missing value]. That is, g should take a value between 10 (excluding) and 10 (inclusive). Specifically, initializing an individual means determining the values ​​of the regularization coefficient C and the kernel parameter g for that individual. Therefore, for the th individual in the population... individual The following expression can be used: , Indicates the first individual The value of the regularization coefficient C, Indicates the first individual The value of the kernel parameter g. For the population The following expression can be used: ,for All , , express random floating-point numbers, express A random floating-point number.

[0060] Step 3: Iterate through each drilling data point, treating each data point as an individual and each individual as a prediction model. Input each data point into each prediction model to obtain a prediction result. Compare the prediction result with the actual result to obtain the comparison result. Calculate the accuracy for each individual based on the comparison result. Accuracy represents the proportion of correctly predicted samples out of the total sample size after comparing the prediction results of all prediction models for that historical data point with the actual results.

[0061] Understandably, each individual in the population represents the regularization coefficient C and kernel parameter g of a Support Vector Machine (SVM). Different individuals may have different values ​​for the regularization coefficient C and kernel parameter g; therefore, different individuals represent different prediction models. Accuracy can be used as a fitness function to evaluate the prediction model.

[0062] For example, accuracy is calculated using the following formula:

[0063] In the formula, TP is the number of correctly predicted positive class samples, FP is the number of incorrectly predicted positive class samples (i.e., actually negative class samples), TN is the number of correctly predicted negative class samples (i.e., actually positive class samples), and FN is the number of incorrectly predicted negative class samples (i.e., actually positive class samples).

[0064] As can be understood, the "sample" here refers to the prediction result, with one prediction result representing one sample. Therefore, TP represents the number of prediction results that are consistent with the actual results and are all positive samples, FP represents the number of prediction results that are inconsistent with the actual results and are all positive samples, TN represents the number of prediction results that are both negative samples and the actual results are also negative samples, and FN represents the number of prediction results that are both negative samples and the actual results are positive samples.

[0065] The purpose of this step is to calculate the accuracy based on the prediction model.

[0066] Step 4: Iterate through the accuracy of each individual and check if there exists an accuracy ≥ 1. If such individuals exist, the accuracy will be ≥ The individual hyperparameters are selected as the optimal hyperparameters, and the process proceeds to step 9. If no optimal hyperparameters are found, the process returns to step 5. This is a preset value, a constant, with a value range of [0,1]. The default value is 0.95.

[0067] Understandably, for accuracy exceeding [a certain threshold]... If the two hyperparameters (C, g) of the individual are taken as the optimal hyperparameters, then the entire population does not need to be iterated further, and we can directly jump to step 9. If no individual meets this condition, then the entire population still needs to be iterated, so we go to step 5. It is possible that multiple individuals in the population have an accuracy exceeding [a certain threshold]. When traversing individuals, finding at least one is sufficient to be considered as finding the optimal hyperparameter.

[0068] Understandably, the purpose of this step is to find the target individual that meets the requirements and the optimal hyperparameter.

[0069] Step 5: Iterate through each individual in the population, performing the same mutation operation on each individual to obtain a new individual. After each individual has obtained a new individual, the original population... Becoming a new population For the first individual The mutation operations include: Three different individuals were randomly selected from the population. , and , And obtain the first one according to the following formula. individual New individuals after mutation :

[0070]

[0071]

[0072]

[0073]

[0074]

[0075]

[0076]

[0077] In the formula, Represents a new individual The regularization coefficient C, Represents a new individual The kernel parameter g, This represents the maximum value of the correlation coefficient. This represents the minimum value of the correlation coefficient. Indicates the current iteration number. This represents the maximum number of iterations, which is a constant, generally... , This represents the correlation coefficient of the current iteration.

[0078] Understandably, as iterations proceed (i.e.) (The value of is getting larger and larger), correlation coefficient The size gradually decreases. This design allows for a large-scale search in the early stages to enhance the global search, followed by a small-scale search in the later stages for refined local searches. After M mutation operations (with a total of M individuals), all individuals have completed the mutation operation, resulting in the mutated population. .

[0079] Maximum value of correlation coefficient The minimum value of the correlation coefficient All of them are constant values, by default. , .

[0080] Understandably, the purpose of this step is to mutate all individuals.

[0081] Step 6: Traverse the new population For each individual in the process, the same crossover operation is performed, resulting in a crossover population. For new populations The first in individual Its crossover operations include: new population In the process, a different individual is randomly selected. , The crossover probability of individual iterations is calculated as follows. :

[0082]

[0083]

[0084]

[0085]

[0086]

[0087]

[0088] In the formula, Represents an individual The regularization coefficient C and the kernel parameter g, Represents an individual The regularization coefficient C and the kernel parameter g, This represents the maximum value of the crossover probability. This represents the minimum crossover probability; both are constants, and by default... , . This represents the attenuation coefficient, which is a constant. In this embodiment, Similar to the correlation coefficient, the crossover probability increases with iteration (i.e., as r increases). Gradually decrease, initial crossover probability The higher value is intended to promote global search, while the value gradually decreases in the later stages to enhance local search, thus jointly ensuring the diversity and stability of the population.

[0089] Calculate a random number R in the interval [0,1]. Then use individual Gene replacement individuals Genes, thereby obtaining new individuals New individuals As a replacement for the original individual .like In this case, the genes of the original individual are preserved, and the preserved individual is also considered a new individual. By iterating through each individual, we obtain all new individuals, thus creating the crossover population. .

[0090] Understandably, the purpose of this step is to perform crossover based on probability.

[0091] Step 7: Traverse the crossover population For each individual, calculate the crossover population using the method in step 3. The accuracy of each individual, in relation to the population. and cross populations Individuals are sorted by accuracy from smallest to largest, and the top-ranked individuals are selected. One individual, the remainder Individuals are randomly generated to obtain an updated crossover population. Updated cross-population The total number of individuals remains at M.

[0092] Understandably, the purpose of this step is to select outstanding individuals.

[0093] Step 8: Repeat steps 3-7 until the current iteration number r ≥ the maximum iteration number MaxGen, and then jump to step 9. Otherwise, continue iterating and jump to step 3, and continue repeating steps 3-7.

[0094] refer to Figure 1 Steps 3 to 8 belong to the inner loop of the Differential Evolutionary Algorithm (DE) for optimization (finding the optimal solution). Each time it is executed, the iteration count is incremented by 1. If the current iteration count r exceeds the maximum iteration count MaxGen, it is necessary to jump to step 9; otherwise, it is necessary to continue iterating and return to step 3.

[0095] Step 9: Iterate through the accuracy of each individual and select the individual with the highest accuracy as the optimal individual. Optimal individual , These are the optimal hyperparameters.

[0096] It is understandable that the optimal individual was found in this step. This means that the optimal hyperparameters and the optimal individual in the entire population have been found. The two hyperparameters are the optimal hyperparameters for the entire population, meaning the regularization coefficient C and the kernel parameter g have been tuned to their optimal values. Therefore, we can prepare to update the model, i.e., proceed to step 10.

[0097] Step 10: Select the optimal individual Optimal hyperparameters The regularization coefficient C and kernel parameter g in Support Vector Machine (SVM) are, in other words, the regularization coefficient C = Kernel parameter g= This yields an updated Support Vector Machine (SVM), which serves as the drilling hazard assessment and early warning model. The latest field drilling data is input into the model to predict drilling operation hazards and issue warnings based on the predictions. Hazards include lost circulation, well kick, and blowout.

[0098] Step 11: Obtain the latest field drilling data and input it into the drilling hazard assessment and early warning model.

[0099] Understandably, the latest field drilling data is real-time data, obtained from field drilling reports, mud reports, and completion reports, or from field monitoring systems; it represents frontline, real-time 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 entered or automatically generated by the monitoring system.

[0100] This embodiment uses a drilling hazard assessment and early warning model based on accuracy. This requires a certain amount of real-time data (i.e., the latest field drilling data), generally more than 1000 field drilling data points, to ensure the drilling hazard assessment and early warning model calculates an accurate accuracy. Insufficient data can easily lead to significant errors. Therefore, this step involves obtaining a certain amount of data and inputting it all into the drilling hazard assessment and early warning model before proceeding to step 12.

[0101] Step 12: Treat each data point from the latest field drilling data as a sample and calculate the accuracy of each data point using the same method as in Step 3.

[0102] The third point is understandable: iterate through the latest field drilling data, input each data point into the drilling hazard assessment and early warning model, and thus obtain the accuracy of each data point, that is, obtain the prediction result of each data point, and compare the prediction result with the actual situation.

[0103] Step 13: Based on the prediction results obtained in Step 12, add the field drilling data with correct predictions to the qualified data set, and add the field drilling data with incorrect predictions to the qualified data set after manual correction. The qualified data set is initially empty. After obtaining the qualified data set, proceed to Step 14.

[0104] Step 14: Repeat steps 11-13, each iteration being one iteration. Increment the iteration count by 1, updating the iteration count until the second maximum iteration count OMaxGen is reached. OMaxGen is a constant; in this embodiment, OMaxGen = 5. Add the accuracy calculated in step 12 to a queue A, and continuously calculate the standard deviation StdAccuracy of the accuracy. Then, proceed to step 15.

[0105] Step 15: If the number of iterations has not reached the second maximum iteration count OMaxGen, it means the current drilling hazard assessment and early warning model can still be used, and proceed to step 11. If the number of iterations is greater than or equal to the second maximum iteration count OMaxGen, then compare the standard deviation StdAccuracy with... The size relationship, if StdAccuracy ≥ This also indicates that the current drilling hazard assessment and early warning model can still be used, so proceed to step 11. If StdAccuracy < If so, the drilling hazard assessment and early warning model needs to be updated, and therefore, proceed to step 16.

[0106] Step 16: Reset all parameters, including the parameters of the Differential Evolutionary Algorithm (DE), the relevant parameters of the Support Vector Machine (SVM), the current iteration number r, and queue A. Resetting queue A means clearing queue A, making queue A an empty queue again, so that the entire search process restarts. After all parameters are reset, return to step 2.

[0107] It is understandable that steps 3 to 8 belong to the inner loop of the Differential Evolutionary Algorithm (DE) for optimization, seeking the optimal hyperparameters to iteratively update and obtain the optimal Support Vector Machine (SVM), which serves as the prediction model. Steps 2 to 16 belong to the outer loop for finding the optimal model, optimizing and adjusting the optimal SVM prediction model based on the continuously updated data set. Steps 11 to 15 belong to the outer loop for real-time data prediction. Based on real-time field drilling data, the SVM prediction model for drilling accident prediction predicts whether accidents such as lost circulation, well kick, and blowout will occur. These two processes are independent and do not affect each other. When the prediction model iteration update is not complete, the prediction model uses the previous version; when the iteration update is complete, it triggers a version update of the prediction model. During the version update, drilling accident prediction is temporarily suspended, and after the update, the latest version of the prediction model is used.

[0108] like Figure 2 As shown, the present invention also provides a swarm intelligence hazard assessment and early warning device, comprising: The data acquisition module is used to acquire multiple drilling data. The drilling data acquired by the data acquisition module includes historical drilling data and on-site drilling data. Both the historical drilling data and the on-site drilling data include records of whether any dangerous situations have occurred. The population initialization module is used to establish the population of the differential evolution algorithm (DE). Each individual in the population includes two hyperparameters, namely the regularization coefficient C and the kernel parameter g in the support vector machine (SVM). The model training module treats each drilling data point as an individual and uses the Differential Evolutionary Algorithm (DE) to find the optimal individual. The two hyperparameters of this optimal individual are then used as the optimal hyperparameters, including the optimal regularization coefficient. and optimal kernel parameters ; and the optimal regularization coefficient and optimal kernel parameters The regularization parameter C and kernel parameter g are respectively used as regularization parameters and kernel parameters in the support vector machine (SVM) to obtain the updated support vector machine (SVM), which serves as a drilling hazard assessment and early warning model. The prediction and early warning module is used to input the latest field drilling data into the drilling hazard assessment and early warning model to predict drilling operation hazards and issue early warnings based on the prediction results. The hazards include well leakage, well kick, and well blowout.

[0109] Furthermore, the model training module specifically includes: The individual accuracy calculation unit is used to traverse each drilling data point, treating each individual as a prediction model. Each drilling data point is input into each prediction model to obtain a prediction result. The prediction result is then compared with the actual result, and the accuracy of each individual is calculated based on the comparison result. The accuracy is calculated using the following formula:

[0110] In the formula, TP is the number of correctly predicted positive class samples, FP is the number of incorrectly predicted positive class samples, TN is the number of correctly predicted negative class samples, and FN is the number of incorrectly predicted negative class samples. The first judgment unit is used to iterate through the accuracy of each individual and check if there exists an accuracy ≥ 1. individuals, This is a preset value; if it exists, the accuracy will be ≥ The hyperparameters of the individual are used as the optimal hyperparameters, and the optimal parameter output unit is triggered; if they do not exist, the mutation operation unit is triggered. The mutation unit is used to traverse every individual in the population. Each individual undergoes the same mutation operation to obtain a new individual. After each individual has obtained a new individual, the original population... Becoming a new population , For the individual The mutation operations include: Three different individuals were randomly selected from the population. , and , And obtain the first one according to the following formula. individual New individuals after mutation :

[0111]

[0112]

[0113]

[0114]

[0115]

[0116]

[0117]

[0118] In the formula, Represents a new individual The regularization coefficient C, Represents a new individual The kernel parameter g, This represents the maximum value of the correlation coefficient. This represents the minimum value of the correlation coefficient. Indicates the current iteration number. Indicates the maximum number of iterations. This represents the correlation coefficient of the current iteration; The crossover unit is used to iterate through each individual in the new population Mind, performing the same crossover operation on each individual to obtain the crossover population CId. The first in individual Its crossover operations include: new population In the process, a different individual is randomly selected. , The crossover probability of individual iterations is calculated as follows. :

[0119]

[0120]

[0121]

[0122]

[0123]

[0124]

[0125] In the formula, Represents an individual The regularization coefficient C and the kernel parameter g, Represents an individual The regularization coefficient C and the kernel parameter g, This represents the maximum value of the crossover probability. This represents the minimum crossover probability. Indicates the attenuation coefficient; Select the update unit to traverse the crossover population. For each individual, calculate the crossover population. The accuracy of each individual, in relation to the population. and cross populations Individuals are sorted by accuracy from smallest to largest, and the top-ranked individuals are selected. One individual, the remainder Individuals are randomly generated to obtain an updated crossover population. The updated cross population The total number of individuals remains at M; The iterative control unit is used to repeatedly trigger the individual accuracy calculation unit, the first judgment unit, the mutation operation unit, the crossover operation unit, and the selection update unit until the current iteration number r ≥ the maximum iteration number MaxGen, and then trigger the optimal parameter output unit. The optimal parameter output unit is used to iterate through the accuracy of each individual and select the individual with the highest accuracy as the optimal individual. Optimal individual , The optimal hyperparameters; The model update unit is used to update the optimal individual Optimal hyperparameters The regularization coefficient C and kernel parameter g in the support vector machine (SVM) are used to obtain the updated support vector machine (SVM), which serves as a drilling hazard assessment and early warning model.

[0126] Furthermore, the device also includes: The model maintenance module is used to collect the latest field drilling data after the model training module is completed and before the prediction and early warning module is executed. Based on the latest field drilling data, it determines whether the drilling hazard assessment and early warning model needs to be updated. If not, the current drilling hazard assessment and early warning model continues to be used to predict drilling operation hazards. If so, the target parameters of the current drilling hazard assessment and early warning model are reset and the model training module is triggered.

[0127] Furthermore, the model maintenance module specifically includes: The data acquisition and prediction unit is used to acquire the latest field drilling data and input the latest field drilling data into the drilling hazard assessment and early warning model; The data filtering and correction unit is used to add the field drilling data with correct prediction results to the qualified data set according to the prediction results, and to add the field drilling data with incorrect prediction results to the qualified data set after manual correction. The qualified data set is initially an empty set. The iteration and statistics unit is used to repeatedly trigger the data acquisition and prediction unit and the data filtering and correction unit. Each loop is an iteration, and the iteration count is incremented by 1 to update the iteration count until the iteration count reaches the second maximum iteration count OMaxGen. The calculated accuracy is added to a queue A, and the standard deviation StdAccuracy of the accuracy is continuously calculated. The second judgment unit is used to trigger the data acquisition and prediction unit if the number of iterations does not reach the second maximum number of iterations OMaxGen; and to judge the standard deviation StdAccuracy if the number of iterations is greater than or equal to the second maximum number of iterations OMaxGen. The size relationship, if StdAccuracy ≥ Then proceed to step 11. If StdAccuracy < If so, the parameter reset unit will be triggered; The parameter reset unit is used to reset the target parameters of the current drilling hazard assessment and early warning model. The target parameters include the parameters of the differential evolution algorithm (DE), the relevant parameters of the support vector machine (SVM), the second maximum iteration number OMaxGen, and the queue A. After the reset, the population initialization module in the model training module is triggered.

[0128] like Figure 3 As shown, the present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the aforementioned swarm intelligence hazard assessment and early warning method.

[0129] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the aforementioned swarm intelligence hazard assessment and early warning method.

[0130] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.

[0131] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.

[0132] The embodiments disclosed in this specification are merely illustrative of one aspect of the invention, and the scope of protection of the invention is not limited to these embodiments. Any other functionally equivalent embodiments fall within the scope of protection of the invention. Those skilled in the art can make various other corresponding changes and modifications based on the technical solutions and concepts described above, and all such changes and modifications should fall within the scope of protection of the claims of this invention.

Claims

1. A swarm intelligence-based risk assessment and early warning method, characterized in that, Includes the following steps: Step S1: Obtain multiple drilling data sets, including historical drilling data and on-site drilling data. Both historical and on-site drilling data include records of any incidents that occurred. A population for the Differential Evolutionary Algorithm (DE) is established, where each individual in the population has two hyperparameters: the regularization coefficient C and the kernel parameter g, which are used in Support Vector Machines (SVMs). Step S2: Treat each drilling data point as an individual, and use the Differential Evolutionary Algorithm (DE) to find the optimal individual. The two hyperparameters of the optimal individual are then used as the optimal hyperparameters, including the optimal regularization coefficient. and optimal kernel parameters , The optimal regularization coefficient and optimal kernel parameters The regularization parameter C and kernel parameter g are respectively used as the regularization parameter C and kernel parameter g in the Support Vector Machine (SVM), thus obtaining the updated SVM. The updated SVM is used as a drilling hazard assessment and early warning model. Step S3: Input the latest field drilling data into the drilling hazard assessment and early warning model to predict drilling operation hazards and issue early warnings based on the prediction results. Hazards include well leakage, well kick, and well blowout.

2. The swarm intelligence risk assessment and early warning method according to claim 1, characterized in that, The specific implementation process of step S2 includes the following steps: Step 2: Establish a population for the differential evolution algorithm (DE), with a total number of individuals M, and initialize the individuals in the population to obtain the values ​​of the regularization coefficient C and kernel parameter g for each individual after initialization. Step 3: Iterate through each drilling data point, treating each individual data point as a prediction model. Input each drilling data point into each prediction model to obtain the prediction result. Compare the prediction result with the actual result to obtain the comparison result. Accuracy is calculated for each individual based on the comparison results. Accuracy represents the proportion of samples that correctly predicted the data out of the total sample, after comparing the predictions of all prediction models with the actual results for that historical data input. Each individual is considered as one sample. Accuracy is calculated using the following formula: In the formula, TP is the number of correctly predicted positive class samples, FP is the number of incorrectly predicted positive class samples, TN is the number of correctly predicted negative class samples, and FN is the number of incorrectly predicted negative class samples. Step 4: Iterate through the accuracy of each individual and check if there exists an accuracy ≥ 1. individuals, As a preset value, If it exists, the accuracy will be ≥ The individual's hyperparameters are selected as the optimal hyperparameters, and the process jumps to step 9 to continue processing; if they do not exist, the process returns to step 5 to continue processing. Step 5: Iterate through each individual in the population, performing the same mutation operation on each individual to obtain a new individual. After each individual has obtained a new individual, the original population... Becoming a new population , For the individual The mutation operations include: Three different individuals were randomly selected from the population. , and , And obtain the first one according to the following formula. individual New individuals after mutation : In the formula, Represents a new individual The regularization coefficient C, Represents a new individual The kernel parameter g, This represents the maximum value of the correlation coefficient. This represents the minimum value of the correlation coefficient. Indicates the current iteration number. Indicates the maximum number of iterations. Represents the correlation coefficient of the current iteration; Step 6: Traverse the new population For each individual in the process, the same crossover operation is performed, resulting in a crossover population. , For new populations The first in individual Its crossover operations include: new population In the middle, a different individual is randomly selected. , The crossover probability of individual iterations is calculated as follows. : In the formula, Represents an individual The regularization coefficient C and the kernel parameter g, Represents an individual The regularization coefficient C and kernel parameter g, This represents the maximum value of the crossover probability. This represents the minimum crossover probability. Indicates the attenuation coefficient; Step 7: Traverse the crossover population For each individual, calculate the crossover population. The accuracy of each individual, in relation to the population. and cross populations Individuals are sorted by accuracy from smallest to largest, and the top-ranked individuals are selected. One individual, the remainder Individuals are randomly generated to obtain an updated crossover population. The updated cross population The total number of individuals remains at M; Step 8: Repeat steps 3-7 until the current iteration number r ≥ the maximum iteration number MaxGen, and then jump to step 9; otherwise, jump to step 3 and continue repeating steps 3-7. Step 9: Iterate through the accuracy of each individual and select the individual with the highest accuracy as the optimal individual. Optimal individual , The optimal hyperparameters; Step 10: Select the optimal individual Optimal hyperparameters The regularization coefficient C and kernel parameter g in the support vector machine (SVM) are used to obtain the updated support vector machine (SVM), which serves as a drilling hazard assessment and early warning model.

3. The swarm intelligence hazard assessment and early warning method according to claim 2, characterized in that, After step S2 and before step 3, the process also includes: Step S4: Collect the latest field drilling data. Based on the latest field drilling data, determine whether it is necessary to update the drilling hazard assessment and early warning model. If not, continue to use the current drilling hazard assessment and early warning model to predict drilling operation hazards. If necessary, reset the target parameters of the current drilling hazard assessment and early warning model and jump to step S2.

4. The swarm intelligence risk assessment and early warning method according to claim 3, characterized in that, The specific implementation process of step S4 includes the following steps: Step 11: Obtain the latest field drilling data and input the latest field drilling data into the drilling hazard assessment and early warning model; Step 13: Based on the prediction results obtained in Step 12, add the field drilling data with correct prediction results to the qualified data set, and add the field drilling data with incorrect prediction results to the qualified data set after manual correction. The qualified data set is initially empty. After obtaining the qualified data set, proceed to Step 14. Step 14: Repeat steps 11-13, each iteration is one iteration, and increment the iteration count by 1, update the iteration count until the iteration count reaches the second maximum iteration count OMaxGen, and add the accuracy calculated in step 12 to a queue A, and continuously calculate the standard deviation of accuracy StdAccuracy, and then go to step 15. Step 15: If the number of iterations does not reach the second maximum number of iterations OMaxGen, proceed to step 11. If the number of iterations is greater than or equal to the second maximum number of iterations OMaxGen, then compare the standard deviation StdAccuracy with... The size relationship, if StdAccuracy ≥ Then proceed to step 11. If StdAccuracy < Then proceed to step 16; Step 16: Target parameters of the current drilling hazard assessment and early warning model. Target parameters include the parameters of the differential evolution algorithm (DE), the relevant parameters of the support vector machine (SVM), the current iteration number r, and queue A. After resetting, return to step 2.

5. A swarm intelligence-based hazard assessment and early warning device, characterized in that, include: The data acquisition module is used to acquire multiple drilling data. The drilling data acquired by the data acquisition module includes historical drilling data and on-site drilling data. Both the historical drilling data and the on-site drilling data include records of whether any dangerous situations have occurred. The population initialization module is used to establish the population of the differential evolution algorithm (DE). Each individual in the population includes two hyperparameters, namely the regularization coefficient C and the kernel parameter g in the support vector machine (SVM). The model training module treats each drilling data point as an individual and uses the Differential Evolutionary Algorithm (DE) to find the optimal individual. The two hyperparameters of this optimal individual are then used as the optimal hyperparameters, including the optimal regularization coefficient. and optimal kernel parameters ; and the optimal regularization coefficient and optimal kernel parameters The regularization parameter C and kernel parameter g are respectively used as regularization parameters and kernel parameters in the support vector machine (SVM) to obtain the updated support vector machine (SVM), which serves as a drilling hazard assessment and early warning model. The prediction and early warning module is used to input the latest field drilling data into the drilling hazard assessment and early warning model to predict drilling operation hazards and issue early warnings based on the prediction results. The hazards include well leakage, well kick, and well blowout.

6. The swarm intelligence hazard assessment and early warning device according to claim 5, characterized in that, The model training module specifically includes: The individual accuracy calculation unit is used to traverse each drilling data point, treating each individual as a prediction model. Each drilling data point is input into each prediction model to obtain a prediction result. The prediction result is then compared with the actual result, and the accuracy of each individual is calculated based on the comparison result. The accuracy is calculated using the following formula: In the formula, TP is the number of correctly predicted positive class samples, FP is the number of incorrectly predicted positive class samples, TN is the number of correctly predicted negative class samples, and FN is the number of incorrectly predicted negative class samples. The first judgment unit is used to iterate through the accuracy of each individual and check if there exists an accuracy ≥ 1. individuals, This is a preset value; if it exists, the accuracy will be ≥ The hyperparameters of the individual are used as the optimal hyperparameters, and the optimal parameter output unit is triggered; if they do not exist, the mutation operation unit is triggered. The mutation unit is used to traverse every individual in the population. Each individual undergoes the same mutation operation to obtain a new individual. After each individual has obtained a new individual, the original population... Becoming a new population , For the individual The mutation operations include: Three different individuals were randomly selected from the population. , and , And obtain the first one according to the following formula. individual New individuals after mutation : In the formula, Represents a new individual The regularization coefficient C, Represents a new individual The kernel parameter g, This represents the maximum value of the correlation coefficient. This represents the minimum value of the correlation coefficient. Indicates the current iteration number. Indicates the maximum number of iterations. Represents the correlation coefficient of the current iteration; The crossover unit is used to iterate through each individual in the new population Mind, performing the same crossover operation on each individual to obtain the crossover population CId. The first in individual Its crossover operations include: new population In the middle, a different individual is randomly selected. , The crossover probability of individual iterations is calculated as follows. : In the formula, Represents an individual The regularization coefficient C and kernel parameter g, Represents an individual The regularization coefficient C and kernel parameter g, This represents the maximum value of the crossover probability. This represents the minimum crossover probability. Indicates the attenuation coefficient; Select the update unit to traverse the crossover population. For each individual, calculate the crossover population. The accuracy of each individual, in relation to the population. and cross populations Individuals are sorted by accuracy from smallest to largest, and the top-ranked individuals are selected. One individual, the remainder Individuals are randomly generated to obtain an updated crossover population. The updated cross population The total number of individuals remains at M; The iterative control unit is used to repeatedly trigger the individual accuracy calculation unit, the first judgment unit, the mutation operation unit, the crossover operation unit, and the selection update unit until the current iteration number r ≥ the maximum iteration number MaxGen, and then trigger the optimal parameter output unit. The optimal parameter output unit is used to iterate through the accuracy of each individual and select the individual with the highest accuracy as the optimal individual. Optimal individual , The optimal hyperparameters; The model update unit is used to update the optimal individual Optimal hyperparameters The regularization coefficient C and kernel parameter g in the support vector machine (SVM) are used to obtain the updated support vector machine (SVM), which serves as a drilling hazard assessment and early warning model.

7. The swarm intelligence hazard assessment and early warning device according to claim 6, characterized in that, The device further includes: The model maintenance module is used to collect the latest field drilling data after the model training module is completed and before the prediction and early warning module is executed. Based on the latest field drilling data, it determines whether the drilling hazard assessment and early warning model needs to be updated. If not, the current drilling hazard assessment and early warning model continues to be used to predict drilling operation hazards. If so, the target parameters of the current drilling hazard assessment and early warning model are reset and the model training module is triggered.

8. The swarm intelligence risk assessment and early warning device according to claim 7, characterized in that, The model maintenance module specifically includes: The data acquisition and prediction unit is used to acquire the latest field drilling data and input the latest field drilling data into the drilling hazard assessment and early warning model; The data filtering and correction unit is used to add the field drilling data with correct prediction results to the qualified data set according to the prediction results, and to add the field drilling data with incorrect prediction results to the qualified data set after manual correction. The qualified data set is initially an empty set. The iteration and statistics unit is used to repeatedly trigger the data acquisition and prediction unit and the data filtering and correction unit. Each loop is an iteration, and the iteration count is incremented by 1 to update the iteration count until the iteration count reaches the second maximum iteration count OMaxGen. The calculated accuracy is added to a queue A, and the standard deviation StdAccuracy of the accuracy is continuously calculated. The second judgment unit is used to trigger the data acquisition and prediction unit if the number of iterations does not reach the second maximum number of iterations OMaxGen; and to judge the standard deviation StdAccuracy if the number of iterations is greater than or equal to the second maximum number of iterations OMaxGen. The size relationship, if StdAccuracy ≥ Then proceed to step 11. If StdAccuracy < If so, the parameter reset unit will be triggered; The parameter reset unit is used to reset the target parameters of the current drilling hazard assessment and early warning model. The target parameters include the parameters of the differential evolution algorithm (DE), the relevant parameters of the support vector machine (SVM), the second maximum number of iterations (OMaxGen), and the queue A. After the reset, the population initialization module in the model training module is triggered.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the swarm intelligence risk assessment and early warning method as described in any one of claims 1-4.

10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the swarm intelligence risk assessment and early warning method as described in any one of claims 1-4.