Oil well overflow detection method and device based on ensemble learning of feature fusion

Through the feature fusion integrated learning method, a gradient improvement and integrated learning model is built, which solves the timeliness and accuracy of overflow risk prediction in well pressing operations, improves the accuracy and stability of oil well overflow detection, and ensures operation safety.

CN118606751BActive Publication Date: 2024-12-10CHONGQING ENERGY BIG DATA CENT CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410670434.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-05-28
Publication Date
2024-12-10
Estimated Expiration
2044-05-28

AI Technical Summary

Technical Problem

The prior art has problems such as poor timeliness, inaccurate prediction and insufficient model complexity in well pressing operations, especially when dealing with the mutual influence between complex nonlinear relationships and multivariables, resulting in limited overflow risk prediction capabilities.

Method used

Using an integrated learning method based on feature fusion, the feature evaluation model and feature prediction model are constructed by collecting and preprocessing the feature data of the oil well, and the gradient enhancement and ensemble learning algorithm are used for iterative training, the scores and accuracy of the fusion are evaluated, and the feature sequences are generated for overflow. Detection and early warning.

Benefits of technology

It improves the prediction accuracy and stability of oil well overflow detection, ensures the timeliness and accuracy of the model, can effectively deal with complex oil well environment changes, and enhances the safety of operations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118606751B_ABST
    Figure CN118606751B_ABST
Patent Text Reader

Abstract

The present invention discloses an integrated learning oil well overflow detection method and device based on feature fusion, the method comprising collecting oil well feature data of an oil well and preprocessing the oil well feature data to obtain a feature data set; constructing a feature evaluation model, iteratively training the feature evaluation model using the feature data set, and predicting the evaluation score of each feature and the evaluation accuracy of the feature evaluation model based on the feature evaluation model; fusing the evaluation score and the evaluation accuracy to obtain a feature sequence; constructing a feature prediction model, iteratively training the feature prediction model using the feature sequence, and outputting feature prediction data; and detecting and warning the overflow of the oil well according to the feature prediction data. Compared with the prior art, the present invention comprehensively considers the importance of each feature in a single model and the overall prediction ability of the model, and the prediction accuracy of the model is high.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of oil and gas exploration and development, and in particular to an integrated learning oil well overflow detection method and device based on feature fusion. Background Art

[0002] As a key link in the oil and gas production process, the safety of well killing operations is crucial to preventing overflow incidents. In recent years, with the rapid development of artificial intelligence and big data technologies, machine learning technology has gradually been introduced into the prediction and optimization of well killing operations to seek more efficient and safer operation methods. However, early explorations mainly focused on statistical methods, such as regression analysis and time series analysis. Although these methods have improved the prediction ability of well killing operations to a certain extent, they still expose many deficiencies in practical applications.

[0003] First, traditional methods tend to rely on static models. During well-killing operations, formation pressure and wellbore conditions may change in real time due to various factors, and static models cannot capture these changes in time, resulting in deviations between the model's prediction results and the actual situation, resulting in insufficient timeliness of model predictions, which in turn reduces the safety of operations. Secondly, traditional methods usually rely on historical data for analysis and prediction. However, in the field of oil and gas production, historical data may not fully reflect the current and future operating environment. With the deepening of oil field development, new geological conditions, wellbore conditions, and operating processes continue to emerge. These factors may affect the safety of well-killing operations. Therefore, relying solely on historical data for predictions may lead to inaccurate prediction results and even mislead operational decisions.

[0004] In addition, methods such as regression analysis and time series analysis are unable to cope with complex nonlinear relationships and the mutual influence of multiple variables. In well-killing operations, there are often complex interactions between various factors. These relationships may be nonlinear and difficult to describe with simple mathematical models. Therefore, traditional methods often cannot achieve ideal results when dealing with these complex relationships, resulting in limited predictive capabilities of the model. Summary of the invention

[0005] In view of this, the purpose of the present invention is to provide an integrated learning oil well overflow detection method and device based on feature fusion, so as to solve the problems of poor timeliness, inaccurate prediction and insufficient model complexity in the prior art when dealing with the overflow risk of well killing operation.

[0006] To achieve the above object, a technical solution of the present invention provides an integrated learning oil well overflow detection method based on feature fusion, comprising the following steps:

[0007] The step of collecting oil well characteristic data of the oil well and preprocessing the oil well characteristic data to obtain a characteristic data set includes the following sub-steps:

[0008] Collecting oil well characteristic data of the oil well, wherein the oil well characteristic data includes historical characteristic data and real-time characteristic data of multiple characteristics, and the oil well characteristic data carries corresponding overflow tag information;

[0009] Cleaning the oil well characteristic data based on the overflow tag information and the value of the oil well characteristic data;

[0010] The cleaned oil well characteristic data are standardized to obtain a characteristic data set;

[0011] The specific method for cleaning the oil well characteristic data is as follows:

[0012] Traversing each oil well characteristic data and corresponding overflow label information, and obtaining the value of each oil well characteristic data and overflow label information, wherein the value of the overflow label information includes a null value, an overflow value, and a normal value;

[0013] The null values, negative values ​​in the oil well characteristic data, and non-numeric values ​​are uniformly replaced with normal values, or the normal values, negative values ​​in the oil well characteristic data are uniformly replaced with null values;

[0014] Constructing a feature evaluation model, iteratively training the feature evaluation model using the feature data set, and obtaining an evaluation score of each feature based on the prediction of the feature evaluation model, and determining the evaluation accuracy of the feature evaluation model according to the evaluation results of the feature evaluation model;

[0015] The evaluation score and the evaluation accuracy are combined to obtain a feature sequence;

[0016] Constructing a feature prediction model, iteratively training the feature prediction model using the feature sequence, and outputting feature prediction data;

[0017] The overflow situation of the oil well is detected and warned based on the characteristic prediction data.

[0018] Further, in the step of constructing a feature evaluation model, iteratively training the feature evaluation model using the feature data set, obtaining an evaluation score of each feature based on the prediction of the feature evaluation model, and determining the evaluation accuracy of the feature evaluation model according to the evaluation situation of the feature evaluation model, the feature data set includes a first feature data set and a second feature data set divided according to a preset ratio, including the following sub-steps:

[0019] Based on gradient boosting and ensemble learning, a gradient boosting sub-model and an ensemble learning sub-model are constructed respectively;

[0020] Inputting the first feature data set into the gradient boosting sub-model and the ensemble learning sub-model respectively to iteratively train the gradient boosting sub-model and the ensemble learning sub-model, and outputting first evaluation data through the trained gradient boosting sub-model and the ensemble learning sub-model;

[0021] Integrate the first evaluation data into evaluation scores corresponding to each feature and each sub-model;

[0022] Inputting the second feature data set into the gradient boosting sub-model and the ensemble learning sub-model respectively to iteratively train the gradient boosting sub-model and the ensemble learning sub-model, and outputting second evaluation data through the trained gradient boosting sub-model and the ensemble learning sub-model;

[0023] The second evaluation data is integrated into the evaluation accuracy when each sub-model evaluates the first evaluation data of each feature respectively.

[0024] Furthermore, the gradient boosting sub-model includes multiple first base models, and the specific method of iteratively training the gradient boosting sub-model using the first feature data set and the second feature data set includes:

[0025] Initializing each first base model respectively;

[0026] Inputting the first feature data set and the second feature data set into the initialized first base model respectively, and iteratively training each first base model until the first base model converges or reaches a set maximum number of iterations;

[0027] The iterative training process of the first base model includes:

[0028] For the feature data in the first feature data set and the second feature data set of each iteration round, respectively calculate the residual between each feature data and the predicted value of the first base model of the current round;

[0029] defining a weak learner, and fitting the weak learner to the calculated residual;

[0030] The first base model is iteratively updated using the weak learner until the first base model converges or reaches a set maximum number of iterations to obtain a trained first base model.

[0031] Furthermore, the ensemble learning sub-model includes a plurality of second base models, and the specific method of iteratively training the ensemble learning sub-model using the first feature data set and the second feature data set respectively includes:

[0032] Initialize each second base model, and assign the same weight coefficient to each feature data in the first feature data set and the second feature data set;

[0033] Define a number of weak classifiers, and use the first feature data set and the second feature data set to train each weak classifier, output the error rate of each weak classifier in the prediction of the corresponding feature data, and update the weight coefficient of each feature data according to the error rate and then input it into the corresponding weak classifier again for iterative training until each weak classifier converges or reaches a set maximum number of iterations;

[0034] Combine several trained weak classifiers into a strong classifier.

[0035] Further, in the step of integrating the first evaluation data into evaluation scores corresponding to each feature and each sub-model, the first evaluation data includes a plurality of first scores predicted by a plurality of first base models based on the first feature data set and a plurality of second scores predicted by a plurality of second base models based on the first feature data set, and the integrated evaluation score is expressed as:

[0036]

[0037] Among them, score i Output the evaluation score for the i-th base model; is the i-th base model when the model is trained with the first feature data set, including the first base model and the second base model; X train Y is the model input of the i-th base model when the model is trained with the first feature data set; train is the model output of the i-th base model when the model is trained with the first feature data set;

[0038] In the step of integrating the second evaluation data into the evaluation accuracy when each sub-model evaluates the first evaluation data of each feature respectively, the second evaluation data includes a plurality of first prediction results predicted by a plurality of first base models based on a second feature data set and a plurality of second prediction results predicted by a plurality of second base models based on a second feature data set. The evaluation accuracy is obtained by integrating the correct rates of the first prediction results and the second prediction results. The integrated evaluation accuracy is expressed as:

[0039]

[0040] Among them, ACC i is the evaluation accuracy of the i-th base model; is the i-th base model when the model is trained with the second feature data set, including the first base model and the second base model; X test Y is the model input of the i-th base model when the model is trained with the second feature data set; test is the model output of the i-th base model when the model is trained with the second feature data set.

[0041] Furthermore, in the step of fusing the evaluation score and the evaluation accuracy to obtain a feature sequence, the following sub-steps are included:

[0042] According to the evaluation score and evaluation accuracy corresponding to each base model, a weighted score matrix corresponding to each feature of each base model is obtained, where the weighted score of each base model corresponding to each feature is expressed as:

[0043] W i,j =S i,j ×ACC i ;

[0044] Among them, W i,j is the weighted score of the jth feature corresponding to the ith base model, S i,j is the j-th feature evaluation score corresponding to the i-th base model, score i ={S i,j}(i=1,2,...,I;j=1,2,...,J), I is the number of base models, J is the number of features, ACC i is the evaluation accuracy of the i-th base model;

[0045] The weighted scores in the weighted score matrix are integrated to obtain the total score of each feature, where the total score is expressed as:

[0046]

[0047] Among them, K j is the total score of the jth feature;

[0048] Arrange each feature in descending order according to the total score to obtain a feature sequence.

[0049] Furthermore, in the step of constructing a feature prediction model, iteratively training the feature prediction model using the feature sequence, and outputting feature prediction data, the following sub-steps are included:

[0050] Construct a feature prediction model based on the gradient boosting algorithm;

[0051] Extracting total scores corresponding to a preset number of features in the feature sequence according to a preset rule;

[0052] The total scores of the preset number of extractions are input into the feature prediction model to iteratively train the feature prediction model and output feature prediction data, wherein the feature prediction data includes the number of features and the optimal accuracy rate obtained by taking the total score of the features of the number of features as input.

[0053] Furthermore, in the step of inputting the extracted preset number of total scores into the feature prediction model to iteratively train the feature prediction model and outputting feature prediction data, the preset number of the total scores is N, and the specific method includes:

[0054] The first total score is sequentially taken from the N total scores and input into the feature prediction model for iterative training, and the first prediction accuracy is output. Then, the first two total scores are sequentially taken and input into the feature prediction model for iterative training, and the second prediction accuracy is output. This cycle is repeated until N total scores are taken to perform iterative training on the feature prediction model, and the Nth prediction accuracy is output.

[0055] Comparing the first to Nth prediction accuracy rates, and determining the best accuracy rate among the first to Nth prediction accuracy rates;

[0056] The number of features involved in feature prediction model training is determined according to the optimal accuracy.

[0057] To achieve the above object, another technical solution of the present invention provides an integrated learning oil well overflow detection device based on feature fusion, which is characterized by comprising:

[0058] A data acquisition module is used to collect oil well characteristic data of an oil well and pre-process the oil well characteristic data into a characteristic data set, wherein the oil well characteristic data includes historical characteristic data and real-time characteristic data of multiple characteristics, and the oil well characteristic data carries corresponding overflow label information, and the data acquisition module is also used to clean the oil well characteristic data based on the overflow label information and the value of the oil well characteristic data, and perform standardization processing on the cleaned oil well characteristic data to obtain a characteristic data set, wherein the data acquisition module cleans the oil well characteristic data specifically by: traversing each oil well characteristic data and the corresponding overflow label information, and obtaining the value of each oil well characteristic data and the overflow label information, wherein the value of the overflow label information includes a null value, an overflow value and a normal value; uniformly replacing the null value, the negative value and the non-numeric value in the oil well characteristic data with a normal value or uniformly replacing the normal value and the negative value in the oil well characteristic data with a null value;

[0059] The first model building and training module is used to build a feature evaluation model, and iteratively train the feature evaluation model using the feature data set, and obtain the evaluation score of each feature based on the feature evaluation model prediction and determine the evaluation accuracy of the feature evaluation model according to the evaluation situation of the feature evaluation model;

[0060] A feature fusion module, used to fuse the evaluation scores and evaluation accuracy to obtain a feature sequence;

[0061] A second model building and training module is used to build a feature prediction model, iteratively train the feature prediction model using the feature sequence, and output feature prediction data; and

[0062] The detection and early warning module is used to detect and warn the overflow of the oil well based on the characteristic prediction data.

[0063] The present invention cleans the oil well characteristic data, replaces the value of the oil well characteristic data and the value of the overflow label information carried therein, so as to ensure the accuracy and consistency of the oil well characteristic data, and then in the subsequent model training process, ensures that the model can accurately process the data, avoids the model from incorrectly interpreting the potential relationship between the data, thereby achieving the purpose of improving the prediction accuracy and stability of the model. At the same time, the present invention also sets a two-layer model, the first layer of the feature evaluation model takes the collected historical oil well characteristic data and real-time path characteristic data as input, evaluates the importance of each feature to obtain the evaluation score of each feature and the evaluation accuracy of each base model when evaluating the evaluation score of each feature, and merges the evaluation score of each feature with the evaluation accuracy of each base model when evaluating the feature, to obtain the total score of each feature, and uses the total score as the input of the second layer of the feature prediction model to obtain the most influential feature quantity and corresponding feature type in model prediction, not only considering the importance of each feature in a single model, but also considering the overall prediction ability of the model, thereby further improving the prediction accuracy of the model.

[0064] In addition, the historical feature data collected by the present invention and the real-time feature data at the current moment include the long-term dynamic changes of the oil well, and in the subsequent training process, the model will be dynamically updated according to the new data generated at the moment to ensure the prediction accuracy of the model, provide important data support for oil well overflow detection and early warning, and ensure safe operation. BRIEF DESCRIPTION OF THE DRAWINGS

[0065] Figure 1 The present invention is a flowchart of an integrated learning method for oil well overflow detection based on feature fusion according to an embodiment of the present invention.

[0066] Figure 2 This is a flowchart of step S1.

[0067] Figure 3 This is a flowchart of step S2.

[0068] Figure 4 This is a flowchart of step S3.

[0069] Figure 5 This is a flowchart of step S4.

[0070] Figure 6This is a flow chart of an oil well overflow detection device based on integrated learning of feature fusion according to another embodiment of the present invention.

[0071] Figure 7 This is a comparison chart of the prediction accuracy of the fusion prediction model of the detection method and device of the present invention and other models used alone.

[0072] Figure 8 This is a comparison chart of the F1 scores of the fusion prediction model of the detection method and device of the present invention and other models used alone.

[0073] Fig. 9 This is a comparison chart of the F2 scores of the fusion prediction model of the detection method and device of the present invention and other models used alone. DETAILED DESCRIPTION

[0074] The following is further described in detail through specific implementation methods:

[0075] Example 1

[0076] Please refer to Figure 1 The present invention provides an integrated learning oil well overflow detection method based on feature fusion, which predicts the current state and future state of important parameters of oil well overflow detection by using a two-layer prediction model to improve the prediction accuracy of oil well overflow state. Specifically, the integrated learning oil well overflow detection method based on feature fusion of this embodiment includes the following steps:

[0077] S1: Data collection and preprocessing.

[0078] The oil well characteristic data of the oil well is collected and preprocessed into characteristic data, and the characteristic data set is used as the input of the subsequent model. The characteristic data set contains data of several characteristics at various times as the input of the subsequent model.

[0079] Please refer to Figure 2 , this step includes the following sub-steps:

[0080] S101: Collect oil well characteristic data.

[0081] Collect oil well characteristic data of the oil well. In this embodiment, the oil well characteristic data is derived from the logging data collected by the logging instrument and the state parameters of the oil well at various times collected by various measuring instruments in the oil well during the operation, such as temperature, carbon dioxide content, pressure, humidity, etc.; the oil well characteristic data includes historical characteristic data and real-time characteristic data of multiple characteristics, and the oil well characteristic data carries corresponding overflow label information, and the overflow label information is used to determine whether overflow occurs under the current oil well characteristic data. In specific implementation, the value of the oil well characteristic data includes a normal value, a negative value and a non-numeric value. The normal value indicates that the oil well characteristic data is normal, and the negative value and the non-numeric value indicate that the oil well characteristic data is abnormal; the value of the overflow label information includes a null value, an overflow value and a normal value. The null value of the overflow label information is defined as "0", the overflow value is defined as "1" and the normal value is defined as "2", so as to facilitate the subsequent cleaning of the oil well characteristic data.

[0082] S102: Cleaning the oil well characteristic data.

[0083] The oil well characteristic data is cleaned based on the overflow tag information and the value of the oil well characteristic data to ensure the consistency and validity of the data.

[0084] When performing data cleaning, first, traverse each oil well characteristic data and the corresponding overflow label information, and obtain the value of each oil well characteristic data and the value of the overflow label information; then, replace the negative values ​​and non-numeric values ​​in the values ​​of the oil well characteristic data and the empty values ​​in the overflow label information with normal values, that is, replace the negative values ​​and non-numeric values ​​in the oil well characteristic data and the "0" in the overflow label information with "2". In some other embodiments, the negative values ​​and non-numeric values ​​in the values ​​of the oil well characteristic data and the normal values ​​in the overflow label information may also be replaced with empty values, that is, replace the negative values ​​and non-numeric values ​​in the oil well characteristic data and the "2" in the overflow label information with "0".

[0085] After such replacement, the cleaned oil well characteristic data only contains "0" after replacing normal values ​​and abnormal values, which ensures the validity of the oil well characteristic data, eliminates the impact of abnormal data on model training, and thus improves the training precision and accuracy of the model. Moreover, after replacing negative values ​​and abnormal values, it can ensure that the data is within the acceptable range of model input, which is beneficial to improving the stability of model training. At the same time, the overflow label information after cleaning also only contains "1" indicating overflow and "0" indicating no overflow, to ensure data consistency and prevent the model from incorrectly interpreting the potential relationship between multiple label information, which can further improve the training precision and accuracy of the model.

[0086] S103: Standardize the oil well characteristic data.

[0087] The cleaned oil well characteristic data is standardized to obtain a characteristic data set, which is used as the input of the subsequent model to train the model. Specifically, first, the mean and standard deviation of the corresponding data of each feature in the cleaned oil well characteristic data are calculated respectively; then, each data of the feature is demeaned according to the mean of each feature, that is, the mean of each feature is subtracted from each value of each feature; finally, each demeaned data is divided by the standard deviation of the corresponding feature to normalize the data of each feature, and finally a characteristic data set is obtained, which contains several characteristic sequences, and each characteristic sequence contains multiple values ​​of the feature.

[0088] S2: Construct a feature evaluation model to predict the evaluation score of the feature and the evaluation accuracy of the model.

[0089] A feature evaluation model is constructed, the feature evaluation model is iteratively trained using the feature data set, and an evaluation score of each feature is obtained based on the prediction of the feature evaluation model, and an evaluation accuracy of the feature evaluation model is determined according to the evaluation results of the feature evaluation model. In this embodiment, the feature evaluation model includes a plurality of first base models constructed based on a gradient boosting algorithm and a plurality of second base models constructed based on an ensemble learning algorithm.

[0090] Before model training, the feature data set is divided into a first feature data set and a second feature data set according to a preset ratio. The first feature data set is used to train the first base model and the second base model to obtain evaluation scores corresponding to each feature. If the evaluation score of a feature is higher, it indicates that the feature contributes more to the prediction result, and the weight should be increased in the subsequent prediction process; the second feature data set is used to train the first base model and the second base model to obtain the prediction results corresponding to each feature, and determine the evaluation accuracy of each base model when evaluating each feature according to the number of feature data input and output of the base model. If the evaluation accuracy of a base model is higher, it indicates that the model contributes more to the evaluation process of the feature. In this way, the importance of the feature in a single model and the overall prediction ability of the model are taken into account, so as to provide influential features for the final model training (i.e., the feature prediction model of the second layer).

[0091] Please refer to Figure 3 , this step includes the following sub-steps:

[0092] S201: Construct gradient boosting sub-model and ensemble learning sub-model.

[0093] A gradient boosting sub-model is constructed based on a gradient boosting algorithm, wherein the gradient boosting sub-model includes multiple first base models, and the gradient boosting algorithm may be GBM, LGB, XGB, CatBoost or other algorithms; an integrated learning sub-model is constructed based on an integrated learning algorithm, wherein the integrated learning sub-model includes multiple second base models, and the integrated learning algorithm may be RF, ADA or other algorithms.

[0094] S202: Perform model training using the first feature data.

[0095] The first feature data set is input into the gradient boosting sub-model and the ensemble learning sub-model respectively to iteratively train the gradient boosting sub-model and the ensemble learning sub-model, and the first evaluation data is output through the trained gradient boosting sub-model and the ensemble learning sub-model. During training, the first feature data set can be synchronously input into the gradient boosting sub-model and the ensemble learning sub-model, so that the gradient boosting sub-model and the ensemble learning sub-model can synchronously predict and process the first feature data set, so as to improve the training and prediction efficiency.

[0096] When the gradient boosting sub-model is trained using the first feature data set, the specific method is as follows:

[0097] First, each first base model is initialized respectively, and the initialized first base model is expressed as:

[0098]

[0099] Wherein, F0(x) is the initialized first base model; x is the input of each first base model; is the predicted value output by the i1th first base model; i1=1,2,...,I1, I1 is the number of first base models; The loss function of the i1th first base model; The first base model predicts in the direction of minimizing the loss function; γ is the initial value of the predicted value in the first base model; the initial value is usually a custom constant or a custom statistical value (such as the mean) based on the first feature data set.

[0100] Second, the first feature data set is synchronously input into each initialized first base model, and each first base model is iteratively trained until the first base model converges or reaches a set maximum number of iterations.

[0101] When iteratively training the first base model, first, for the feature data in the first feature data set of each iteration round, the residual between each feature data and the predicted value output by the first base model in the current round is calculated respectively. In this embodiment, the residual is expressed as:

[0102]

[0103] in, is the residual of the i1th first base model at the t1th iteration round; t1=1,2,...,T1, T1 is the total iteration rounds during the training of the first base model; is the i1th first base model in the t1th iteration round; The i1th first base model in the t1-1th iteration round; is the input of the i1th first basis model.

[0104] Then, a weak learner is defined and the weak learner is fitted to the calculated residual. In the present embodiment, a decision tree is selected to fit the parameters to minimize the residual and improve the prediction accuracy of the first base model. The specific process of fitting the residual using a weak learner is a prior art and will not be described in detail here.

[0105] Finally, the first base model is iteratively updated using the weak learner, that is, the fitted weak learner is added to the first base model of the current round, until the first base model converges or reaches the set maximum number of iterations to obtain the trained first base model; the first base model of the current round contains the weak learners added in all previous rounds of iterations. In this embodiment, the first base model is updated using the following formula:

[0106]

[0107] Among them, v is the learning rate of the first base model; is the i1th weak learner in the t1th iteration round.

[0108] In this way, the first base model is updated through each round of iterations, so that the first base model can better fit the training first feature data set, thereby improving the prediction performance of the first base model.

[0109] Third, the first feature data sets are predicted based on the trained first base models, and the first scores corresponding to the features in the first feature data sets are output.

[0110] When the first feature data set is used to train the ensemble learning sub-model, this embodiment takes the Adaboost algorithm as an example for explanation, and the specific method is as follows:

[0111] First, each second base model is initialized, and each feature data in the first feature data set is assigned the same weight coefficient.

[0112] Second, define several weak classifiers, and use the first feature data set to train each weak classifier, output the error rate of each weak classifier in the corresponding feature data prediction, and update the weight coefficient of each feature data according to the error rate and then input it into the corresponding weak classifier for iterative training again until each weak classifier converges or reaches the set maximum number of iterations.

[0113] When training the weak classifier, first, in the t2th round of iterative training, a weak learner G is introduced i2,t2 , and calculate the error rate of the weak classifier on the current iteration round distribution of the weight coefficient:

[0114]

[0115] in, is the error rate of the i2th second base model at the t2th iteration round, i2=1,2,...,I2, I2 is the number of second base models, t2 is the iteration round of the second base model, t2=1,2,...,T2, T2 is the total iteration round of the second base model training; is the weight coefficient of the jth feature in the first feature data set at the t2th iteration round, j = 1, 2, ..., J, J is the number of features in the first feature data set; P is an indicator function, which returns 1 when the condition in it is true, otherwise it returns 0; is the weak learner of the i2th second base model in the t2th iteration round; B j is the label of the jth feature in the first feature dataset.

[0116] Next, the weight of the weak classifier in the final strong classifier is calculated:

[0117]

[0118] in, is the weight of the weak classifier of the i2th second base model in its final strong classifier.

[0119] Finally, the weight coefficient of the training sample (i.e., the first feature data set) is updated according to the weight of the weak classifier in the final strong classifier for the next iteration until the second base model converges or reaches the set maximum iteration round. In this embodiment, the weight coefficient of the training sample is updated using the following formula:

[0120]

[0121] in, is the weight coefficient of the jth feature in the first feature data set in the t2+1th iteration round of the i2th second base model, that is, the weight coefficient of the updated training sample.

[0122] Third, several trained weak classifiers are combined into a strong classifier. After the training of each weak classifier is completed, each weak classifier is combined according to the weight coefficient of each weak classifier. When combining, the weight of the weak classifier with a small classification error rate is increased so that it plays a larger decisive role in the final strong classifier, and the weight of the weak classifier with a large classification error rate is reduced so that it plays a smaller decisive role in the final strong classifier, so as to obtain a strong classifier and achieve the purpose of the second base model training. In this embodiment, the weak classifiers are combined using the sign function, and the combined strong classifier is expressed as:

[0123]

[0124] in, is the i2th strong classifier, that is, the trained i2th second base model.

[0125] Fourth, the first feature data sets are predicted based on the trained second base models, and the second scores corresponding to the features in the first feature data sets are output.

[0126] It is understandable that in some other embodiments, a random forest algorithm based on ensemble learning may also be used to predict the second score. The specific algorithm can be found in the prior art and will not be described in detail here.

[0127] S203: Integrate the first evaluation data to obtain an evaluation score for each feature.

[0128] The first evaluation data is integrated into evaluation scores corresponding to each feature and each sub-model; the first evaluation data includes multiple first scores predicted by multiple first base models based on the first feature data set and multiple second scores predicted by multiple second base models based on the first feature data set.

[0129] Specifically, define each base model as Feature_ext i , the evaluation score output by each feature after prediction by each base model is score i , where i = 1, 2, ..., I, I = I1 + I2, I is the number of all base models, including the first base model and the second base model, for each base model Feature_ext i , the evaluation score corresponding to each feature is obtained through the forward transfer of the model, which can be directly obtained from the trained model output. Therefore, the integrated evaluation score is expressed as:

[0130]

[0131] Among them, score iOutput the evaluation score for the i-th base model; is the i-th base model when the model is trained with the first feature data set, including the first base model and the second base model; X train Y is the model input of the i-th base model when the model is trained with the first feature data set; train is the model output of the i-th base model when the model is trained with the first feature data set.

[0132] S204: Perform model training using the second feature data set.

[0133] Specifically, the second feature data set is respectively input into the gradient boosting sub-model and the ensemble learning sub-model to iteratively train the gradient boosting sub-model and the ensemble learning sub-model, and the second evaluation data is output through the trained gradient boosting sub-model and the ensemble learning sub-model. During training, the second feature data set can be synchronously input into the gradient boosting sub-model and the ensemble learning sub-model, so that the gradient boosting sub-model and the ensemble learning sub-model can synchronously predict and process the second feature data set to improve the training and prediction efficiency.

[0134] In this embodiment, the specific process of training the gradient boosting sub-model and the ensemble learning sub-model with the second feature data set is the same as the process of training the gradient boosting sub-model and the ensemble learning sub-model with the first feature data set. For details, please refer to the relevant records of step S202, which will not be repeated here.

[0135] In this way, the second feature data set can be predicted by the trained gradient extraction sub-model and the integrated learning sub-model to obtain the first prediction result and the second prediction result respectively.

[0136] S205: Integrate the second evaluation data to obtain the evaluation accuracy of each base model.

[0137] The second evaluation data is integrated into the evaluation accuracy when each sub-model evaluates the first evaluation data of each feature respectively. The second evaluation data includes a plurality of first prediction results predicted by a plurality of first base models based on the second feature data set and a plurality of second prediction results predicted by a plurality of second base models based on the second feature data set.

[0138] Specifically, the number of correct results in the first prediction results and the second prediction results output by each base model is counted, and the proportion of the number of correct results in the total prediction results output by the corresponding base model is counted to obtain the accuracy of each base model. Thus, the evaluation accuracy of each base model obtained by integration is expressed as:

[0139]

[0140] Among them, ACCi is the evaluation accuracy of the i-th base model; is the i-th base model when the model is trained with the second feature data set, including the first base model and the second base model; X test Y is the model input of the i-th base model when the model is trained with the second feature data set; test is the model output of the i-th base model when the model is trained with the second feature data set.

[0141] S3: Fusion evaluation score and evaluation accuracy.

[0142] The evaluation scores and evaluation accuracy rates are combined to obtain a feature sequence, and the feature sequence is obtained by sorting the total scores of the features from high to low.

[0143] Please refer to Figure 4 , this step includes the following sub-steps:

[0144] S301: Weighted integration of evaluation scores and evaluation accuracy.

[0145] According to the evaluation score and evaluation accuracy corresponding to each base model, a weighted integration is performed to obtain the weighted score matrix of each feature corresponding to each base model. Specifically, the evaluation score of the jth feature predicted by the i-th base model is recorded as S i,j , that is, score i ={S i,j}(i=1,2,...,I;j=1,2,...,J), therefore, the weighted score of each base model corresponding to each feature is expressed as:

[0146] W i,j =S i,j ×ACC i (10)

[0147] Among them, W i,j is the weighted score of the jth feature corresponding to the i-th base model; S i,j is the jth feature evaluation score corresponding to the ith base model, where I is the number of base models and J is the number of features; ACC i is the evaluation accuracy of the i-th base model.

[0148] S302: Integrate the weighted scores of each feature.

[0149] The weighted scores in the weighted score matrix are integrated to obtain the total score of each feature. The total score is expressed as:

[0150]

[0151] Among them, K j is the total score of the jth feature;

[0152] S303: Sort the features to obtain a feature sequence.

[0153] According to the total score of each feature, all features are sorted in descending order to obtain a feature sequence. In the feature sequence, the higher the ranking of the feature, the higher its contribution to the model prediction, and the higher the accuracy of the model prediction, which is used as the input of the subsequent model.

[0154] S4: Build a feature prediction model and output feature prediction data.

[0155] A feature prediction model is constructed, and the feature prediction model is iteratively trained using the feature sequence to output feature prediction data. In this embodiment, the feature prediction model is implemented based on a gradient boosting algorithm, preferably a GBM algorithm.

[0156] Since the feature sequence contains the total scores corresponding to all the original features, and the purpose of this embodiment is to find a certain number of features that contribute more to the model prediction as prediction input, therefore, before model training, it is necessary to extract a certain number of top-ranked features for model training. During training, the extracted features are used as model data one by one in an increasing order, and feature prediction data of feature prediction models under different numbers of features are obtained by training respectively. By comparing the feature prediction data corresponding to different numbers of inputs, the optimal number of features and the optimal accuracy obtained by taking the total score of the features of the number of features as input are determined, which takes into account the overall accuracy of the model and is beneficial to improving the prediction accuracy of the model.

[0157] Please refer to Figure 5 , this step includes the following sub-steps:

[0158] S401: Construct a feature prediction model.

[0159] A feature prediction model is constructed based on a gradient boosting algorithm, and the gradient boosting algorithm may be GBM, LGB, XGB, CatBoost or other algorithms. Preferably, this embodiment adopts the GBM algorithm to construct the feature prediction model.

[0160] S402: Extracting the total score corresponding to the preset quantity features.

[0161] In the feature sequence, extract the total scores of the top preset number of features. In this embodiment, the preset number is N, that is, extract the top N total scores of features in the feature sequence to obtain the feature prediction model training sample K' j , where N is a positive integer. For example, if the preset number is 10, the total scores of the top 10 features in the feature sequence are taken.

[0162] S403: Train the feature prediction model and output feature prediction data.

[0163] The total score of the preset number of extracted samples (i.e., the feature prediction model training sample K' j ) input the feature prediction model to iteratively train the feature prediction model, and output feature prediction data through the trained feature prediction model, in which the output feature prediction data includes the number of input features and the prediction accuracy obtained by taking the total score of each feature corresponding to the number of features as input, and determine the optimal accuracy and the number of total feature scores used to obtain the optimal accuracy by comparing the accuracy rates.

[0164] Specifically, first, the first total score is taken from the extracted N total scores and input into the feature prediction model for iterative training, and the first prediction accuracy is output. Then, the first two total scores are taken and input into the feature prediction model for iterative training, and the second prediction accuracy is output. This cycle is repeated until N total scores are taken to perform iterative training on the feature prediction model, and the Nth prediction accuracy is output. The prediction accuracy is expressed as:

[0165] Q n =f GBM_n (X K ) (12)

[0166] Among them, Q n is the nth prediction accuracy of the feature prediction model output when the total scores of the previous n features are used as input, n = 1, 2, ..., N; f GBM_n (X K ) is the feature sequence X K The first n feature total scores are taken and put into the feature prediction model for training. The training process is the same as the training process of the gradient boosting sub-model (the first base model) in step S202, and will not be repeated here.

[0167] For example, when n = 1, Q1 = f GBM_1 (X K ) means that in the feature prediction model training sample K' j The prediction accuracy obtained by taking the total score of the first feature for model training. For example, when n = 4, Q4 = f GBM_4 (X K ) means that in the feature prediction model training sample K' j The total score of the first four features is taken to train the model to get the prediction accuracy, and so on, to get N prediction accuracy rates.

[0168] Then, the first to Nth prediction accuracy rates are compared, and the best accuracy rate among the first to Nth prediction accuracy rates is determined, and the best accuracy rate is expressed as:

[0169] best_acc=max{Q n},(n=1,2,...,N) (13)

[0170] Among them, best_acc is the best accuracy.

[0171] Finally, the number of features involved in the feature prediction model training is determined according to the optimal accuracy. The number of features used for model training at the optimal accuracy is expressed as:

[0172]

[0173] Among them, n * ACC is the number of features involved in feature prediction model training corresponding to the optimal accuracy; GBM,n is the nth prediction accuracy output by the feature prediction model; The prediction is made in the direction of finding the maximum prediction accuracy output by the feature prediction model.

[0174] In this way, the optimal accuracy rate best_acc of model training and the number of features n used at this accuracy are obtained through two-layer prediction. * , in order to better predict the characteristic data of oil wells.

[0175] S5: Oil well overflow detection and early warning.

[0176] The overflow of the oil well is detected and warned based on the characteristic prediction data to ensure safe operation.

[0177] The integrated learning oil well overflow detection method based on feature fusion of this embodiment sets up a two-layer model. The feature evaluation model of the first layer takes the collected historical oil well feature data and real-time path feature data as input, evaluates the importance of each feature to obtain the evaluation score of each feature and the evaluation accuracy of each base model when evaluating the evaluation score of each feature, and fuses the evaluation score of each feature with the evaluation accuracy of each base model when evaluating the feature to obtain the total score of each feature, and uses the total score as the input of the feature prediction model of the second layer to obtain the number of features and corresponding feature types that are most influential in model prediction. Not only the importance of each feature in a single model is considered, but also the overall prediction ability of the model is considered, thereby further improving the prediction accuracy of the model.

[0178] Example 2

[0179] Please refer to Figure 6, is a control block diagram of the integrated learning oil well overflow detection device based on feature fusion of this embodiment. The integrated learning oil well overflow detection device based on feature fusion of this embodiment is mainly used to implement the integrated learning oil well overflow detection method based on feature fusion of the embodiment, so as to predict and warn the state of the oil well to ensure safe operation. Specifically, the integrated learning oil well overflow device based on feature fusion of this embodiment includes a data acquisition module 601, a first model construction and training module 602, a feature fusion module 603, a second model construction and training module 604 and a detection and warning module 605. Among them:

[0180] The data acquisition module 601 is used to acquire oil well characteristic data of the oil well and pre-process the oil well characteristic data into a characteristic data set to serve as a model input of the first model building and training module 602 to train the model built by it. In this embodiment, the oil well characteristic data includes historical characteristic data and real-time characteristic data of multiple characteristics.

[0181] The first model construction and training module 602 is used to construct a feature evaluation model, and iteratively train the feature evaluation model using the feature data set collected by the data collection module 601, and obtain the evaluation score of each feature and the evaluation accuracy of the feature evaluation model based on the feature evaluation model prediction. Specifically, the first model construction and training module 602 iteratively trains the feature evaluation model using the feature data set, and obtains the evaluation score of each feature based on the feature evaluation model prediction and determines the evaluation accuracy of the feature evaluation model according to the evaluation situation of the feature evaluation model, and transmits it to the feature fusion module 603. In this embodiment, the feature evaluation model includes multiple first base models constructed based on the gradient boosting algorithm and multiple second base models constructed based on the ensemble learning algorithm.

[0182] The feature fusion module 603 is used to fuse the evaluation scores and evaluation accuracy output by the first model building and training module 602 to obtain a feature sequence, and the feature sequence is sorted from high to low according to the total score of each feature. The feature training is used as the model input of the second model building and training module 604 to perform model training on the second model building and training module 604.

[0183] The second model building and training module 604 is used to build a feature prediction model, and iteratively train the feature prediction model using the feature sequence fused by the feature fusion module 603, and output feature prediction data for the detection and warning module 605 to detect and warn of oil well overflow based on the feature prediction data.

[0184] The detection and warning module 605 is used to detect and warn the overflow of the oil well according to the feature prediction data output by the second model building and training module 604.

[0185] In this embodiment, the data acquisition module 601, the first model construction and training module 602, the feature fusion module 603, the second model construction and training module 604 and the detection and early warning module 605 correspond one by one to steps S1 to S5 in Example 1. For the specific implementation process, please refer to the relevant records of each step in Example 1, which will not be repeated in this embodiment.

[0186] In order to verify the performance of the two-layer fusion prediction model used in the integrated learning oil well overflow detection method and device based on feature fusion of the present invention, and determine its effectiveness in processing logging instrument data, the fusion prediction model of the present invention is experimentally compared with other models used alone, and the prediction accuracy, F1 score and F2 score of the model are compared. Among them, the prediction accuracy represents the proportion of model predictions, the F1 score represents the harmonic mean of precision and recall, which is used to measure the accuracy and robustness of the model, and the F2 score takes into account the relative importance of recall to precision. When conducting experiments, in order to ensure fairness, the hyperparameters used by the fusion prediction model of the present invention and other models are consistent with the hyperparameters of the similar model used in the present invention as the base model.

[0187] Please refer to Figure 7 to Figure 9 , which are respectively the comparison diagrams of the accuracy (i.e., Accuracy on the ordinate in the diagram), F1 score (i.e., F1 on the ordinate in the diagram) and F2 score (i.e., F2 on the ordinate in the diagram) of the fusion prediction model of the present invention (i.e., OurMethod on the horizontal axis in the diagram) and only eight models (i.e., GBM, LightGBM, CatBoost, XGBoost, Random Forest, AdaBoost, TabNet, and NODE on the horizontal axis in the diagram) for prediction. Through the diagram, it can be observed that under each indicator, the box plot of the fusion prediction model of the present invention is located above other models, and the median, upper quartile, and lower quartile of the box plot are significantly higher than other models. It can be seen that the fusion prediction model of the present invention has higher accuracy, better precision, and stronger stability in predicting overflow accidents. In addition, the box plot of the fusion prediction model of the present invention also shows a smaller internal variability, which further confirms the robustness and reliability of the fusion prediction model of the present invention.

Claims

1. An integrated learning oil well spill detection method based on feature fusion, characterized in that: The following steps are involved: The step of collecting oil well characteristic data of the oil well and preprocessing the oil well characteristic data to obtain a characteristic data set includes the following sub-steps: Collecting oil well characteristic data of the oil well, wherein the oil well characteristic data includes historical characteristic data and real-time characteristic data of multiple characteristics, and the oil well characteristic data carries corresponding overflow tag information; Cleaning the oil well characteristic data based on the overflow tag information and the value of the oil well characteristic data; The cleaned oil well characteristic data are standardized to obtain a characteristic data set; The specific method for cleaning the oil well characteristic data is as follows: Traversing each oil well characteristic data and corresponding overflow label information, and obtaining the value of each oil well characteristic data and overflow label information, wherein the value of the overflow label information includes a null value, an overflow value, and a normal value; The null values, negative values ​​in the oil well characteristic data, and non-numeric values ​​are uniformly replaced with normal values, or the normal values, negative values ​​in the oil well characteristic data are uniformly replaced with null values; Constructing a feature evaluation model, iteratively training the feature evaluation model using the feature data set, and obtaining an evaluation score of each feature based on the prediction of the feature evaluation model, and determining the evaluation accuracy of the feature evaluation model according to the evaluation results of the feature evaluation model; The evaluation score and the evaluation accuracy are combined to obtain a feature sequence; Constructing a feature prediction model, iteratively training the feature prediction model using the feature sequence, and outputting feature prediction data; The overflow situation of the oil well is detected and warned based on the characteristic prediction data.

2. The method for detecting oil well spills based on integrated learning based on feature fusion according to claim 1, characterized in that: In the step of constructing a feature evaluation model, iteratively training the feature evaluation model using the feature data set, predicting an evaluation score of each feature based on the feature evaluation model, and determining the evaluation accuracy of the feature evaluation model according to the evaluation situation of the feature evaluation model, the feature data set includes a first feature data set and a second feature data set divided according to a preset ratio, including the following sub-steps: Based on gradient boosting and ensemble learning, a gradient boosting sub-model and an ensemble learning sub-model are constructed respectively; Inputting the first feature data set into the gradient boosting sub-model and the ensemble learning sub-model respectively to iteratively train the gradient boosting sub-model and the ensemble learning sub-model, and outputting first evaluation data through the trained gradient boosting sub-model and the ensemble learning sub-model; Integrate the first evaluation data into evaluation scores corresponding to each feature and each sub-model; Inputting the second feature data set into the gradient boosting sub-model and the ensemble learning sub-model respectively to iteratively train the gradient boosting sub-model and the ensemble learning sub-model, and outputting second evaluation data through the trained gradient boosting sub-model and the ensemble learning sub-model; The second evaluation data is integrated into the evaluation accuracy when each sub-model evaluates the first evaluation data of each feature respectively.

3. The method for detecting oil well spills based on integrated learning based on feature fusion according to claim 2, characterized in that: The gradient boosting sub-model includes a plurality of first base models, and the specific method of iteratively training the gradient boosting sub-model using the first feature data set and the second feature data set respectively includes: Initializing each first base model respectively; Inputting the first feature data set and the second feature data set into the initialized first base model respectively, and iteratively training each first base model until the first base model converges or reaches a set maximum number of iterations; The iterative training process of the first base model includes: For the feature data in the first feature data set and the second feature data set of each iteration round, respectively calculate the residual between each feature data and the predicted value of the first base model of the current round; defining a weak learner, and fitting the weak learner to the calculated residual; The first base model is iteratively updated using the weak learner until the first base model converges or reaches a set maximum number of iterations to obtain a trained first base model.

4. The method for detecting oil well spills based on integrated learning based on feature fusion according to claim 3 is characterized in that: The integrated learning sub-model includes multiple second base models, and the specific method of iteratively training the integrated learning sub-model using the first feature data set and the second feature data set respectively includes: Initialize each second base model, and assign the same weight coefficient to each feature data in the first feature data set and the second feature data set; Define a number of weak classifiers, and use the first feature data set and the second feature data set to train each weak classifier, output the error rate of each weak classifier in the prediction of the corresponding feature data, and update the weight coefficient of each feature data according to the error rate and then input it into the corresponding weak classifier again for iterative training until each weak classifier converges or reaches a set maximum number of iterations; Combine several trained weak classifiers into a strong classifier.

5. The method for detecting oil well spills based on integrated learning based on feature fusion according to claim 4, characterized in that: In the step of integrating the first evaluation data into evaluation scores corresponding to each feature and each sub-model, the first evaluation data includes a plurality of first scores predicted by a plurality of first base models based on a first feature data set and a plurality of second scores predicted by a plurality of second base models based on the first feature data set, and the integrated evaluation score is expressed as: Among them, score i Output the evaluation score for the i-th base model; is the i-th base model when the model is trained with the first feature data set, including the first base model and the second base model; X train Y is the model input of the i-th base model when the model is trained with the first feature data set; train is the model output of the i-th base model when the model is trained with the first feature data set; In the step of integrating the second evaluation data into the evaluation accuracy when each sub-model evaluates the first evaluation data of each feature respectively, the second evaluation data includes a plurality of first prediction results predicted by a plurality of first base models based on a second feature data set and a plurality of second prediction results predicted by a plurality of second base models based on a second feature data set. The evaluation accuracy is obtained by integrating the correct rates of the first prediction results and the second prediction results. The integrated evaluation accuracy is expressed as: Among them, ACC i is the evaluation accuracy of the i-th base model; is the i-th base model when the model is trained with the second feature data set, including the first base model and the second base model; X test Y is the model input of the i-th base model when the model is trained with the second feature data set; test is the model output of the i-th base model when the model is trained with the second feature data set.

6. The method for detecting oil well spills based on integrated learning based on feature fusion according to claim 5, characterized in that: The step of fusing the evaluation score and the evaluation accuracy to obtain a feature sequence includes the following sub-steps: According to the evaluation score and evaluation accuracy corresponding to each base model, a weighted score matrix corresponding to each feature of each base model is obtained, where the weighted score of each base model corresponding to each feature is expressed as: W i,j =S i,j ×ACC i ; Among them, W i,j is the weighted score of the jth feature corresponding to the i-th base model, S i,j is the jth feature evaluation score corresponding to the i-th base model, score i ={S i,j }(i=1,2,...,I;j=1,2,...,J), I is the number of base models, J is the number of features, ACC i is the evaluation accuracy of the i-th base model; The weighted scores in the weighted score matrix are integrated to obtain the total score of each feature, where the total score is expressed as: Among them, K j is the total score of the jth feature; Arrange each feature in descending order according to the total score to obtain a feature sequence.

7. The method for detecting oil well spills based on integrated learning based on feature fusion according to claim 6, characterized in that: The step of constructing a feature prediction model, iteratively training the feature prediction model using the feature sequence, and outputting feature prediction data includes the following sub-steps: Construct a feature prediction model based on the gradient boosting algorithm; Extracting total scores corresponding to a preset number of features in the feature sequence according to a preset rule; The total scores of the preset number of extractions are input into the feature prediction model to iteratively train the feature prediction model and output feature prediction data, wherein the feature prediction data includes the number of features and the optimal accuracy rate obtained by taking the total score of the features of the number of features as input.

8. The method for detecting oil well spills based on integrated learning based on feature fusion according to claim 7, characterized in that: In the step of inputting the extracted preset number of total scores into the feature prediction model to iteratively train the feature prediction model and outputting feature prediction data, the preset number of the total scores is N, and the specific method includes: The first total score is sequentially taken from the N total scores and input into the feature prediction model for iterative training, and the first prediction accuracy is output. Then, the first two total scores are sequentially taken and input into the feature prediction model for iterative training, and the second prediction accuracy is output. This cycle is repeated until N total scores are taken to perform iterative training on the feature prediction model, and the Nth prediction accuracy is output. Comparing the first to Nth prediction accuracy rates, and determining the best accuracy rate among the first to Nth prediction accuracy rates; The number of features involved in feature prediction model training is determined according to the optimal accuracy.

9. An integrated learning oil well overflow detection device based on feature fusion, characterized in that: include: A data acquisition module is used to collect oil well characteristic data of an oil well and pre-process the oil well characteristic data into a characteristic data set, wherein the oil well characteristic data includes historical characteristic data and real-time characteristic data of multiple characteristics, and the oil well characteristic data carries corresponding overflow label information, and the data acquisition module is also used to clean the oil well characteristic data based on the overflow label information and the value of the oil well characteristic data, and perform standardization processing on the cleaned oil well characteristic data to obtain a characteristic data set, wherein the data acquisition module cleans the oil well characteristic data specifically by: traversing each oil well characteristic data and the corresponding overflow label information, and obtaining the value of each oil well characteristic data and the overflow label information, wherein the value of the overflow label information includes a null value, an overflow value and a normal value; uniformly replacing the null value, the negative value and the non-numeric value in the oil well characteristic data with a normal value or uniformly replacing the normal value and the negative value in the oil well characteristic data with a null value; The first model building and training module is used to build a feature evaluation model, and iteratively train the feature evaluation model using the feature data set, and obtain the evaluation score of each feature based on the feature evaluation model prediction and determine the evaluation accuracy of the feature evaluation model according to the evaluation situation of the feature evaluation model; A feature fusion module, used to fuse the evaluation scores and evaluation accuracy to obtain a feature sequence; A second model building and training module is used to build a feature prediction model, iteratively train the feature prediction model using the feature sequence, and output feature prediction data; and The detection and early warning module is used to detect and warn the overflow of the oil well based on the characteristic prediction data.