Method, device and equipment for screening main control factors of well cementation quality and medium
By pre-processing and feature screening of the initial data of the cementing project, and combining the random forest algorithm to calculate the important characteristics, the main control factors for cementing quality were screened out, which solved the problem of difficult-to-deterministic influence of factors in cementing project, and improved cementing quality and construction safety.
Patent Information
- Application Number
- CN202311352246.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-18
- Publication Date
- 2025-04-18
AI Technical Summary
In cementing projects, it is difficult to determine the degree of impact of various factors on cementing quality, resulting in the inability to effectively improve cementing quality, and the measures are not targeted.
By obtaining the initial data, pre-processing and dimensionless processing, feature screening is performed using variance filtration method and correlation analysis method, and the important value of each feature is calculated in combination with the random forest algorithm to screen out the main control factors for cementing quality.
The degree of impact of each influencing factor on cementing quality is calculated, and the key factors affecting cementing quality are selected to provide a basis for the cementing scheme parameter design, improve cementing quality, reduce resource waste and improve construction safety.
Smart Images

Figure CN119848494A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of petroleum drilling engineering, and in particular to a method, device, equipment and medium for screening main control factors of cementing quality. Background Art
[0002] Cementing is an important part of oil and gas well construction, and it is also the key to ensure the production life of oil and gas wells. The main purpose is to support and protect the casing in the well, and to perform actions such as plugging oil, gas, water and other substances in the formation. The impact of cementing quality is affected by the combined effects of many different factors, including formation conditions, wellbore conditions, fluid properties, cementing parameters, etc. Too many factors and their mutual constraints and correlations, that is, following the "barrel principle", increase the difficulty of data mining, making it difficult to establish an analytical model for cementing quality evaluation.
[0003] By establishing standards and systems, conducting quality evaluation, analysis and cementing bottleneck technology research, the cementing quality is guaranteed to continue to improve; however, the current status of cementing technology in some fault blocks with complex formation pressure is "there are countermeasures, but no certainty", that is, the main control factors have not been found, and the measures are not targeted, resulting in the stagnation of cementing quality. In addition, by searching for relevant patents, it is found that most of them are general feature selection methods for data, but there are no feature extraction methods for cementing engineering data. Most of them are evaluation methods for cementing quality. Summary of the invention
[0004] The purpose of the present invention is to provide a method, device, equipment and medium for screening the main control factors of cementing quality to improve the above problems. In order to achieve the above purpose, the technical solution adopted by the present invention is as follows:
[0005] In a first aspect, the present application provides a method for screening main control factors of cementing quality, comprising:
[0006] Acquire initial data of the wells to be screened for cementing, the initial data including multiple influencing factors, the influencing factors including geological factors, drilling factors, basic parameter factors and quality factors related to the wells to be screened for cementing, wherein the geological factors include the maximum oil and gas rushing up velocity and the oil and gas rushing up velocity before cementing, the drilling factors include the well inclination angle, the full angle change rate, the wellbore expansion rate and the bentonite content in the drilling fluid, the basic parameter factors include the drilling fluid density before cementing, the drilling fluid pH value before cementing, the drilling fluid flowability index before cementing and the drilling fluid viscosity coefficient before cementing, and the quality factors include the high quality rate of cementation and sealing quality of the interface of the oil and gas layer section;
[0007] Preprocessing the initial data to obtain preprocessed initial data, and performing dimensionless processing on the preprocessed initial data to obtain processed standardized data;
[0008] Using a variance filtering method to perform feature screening on the standardized data to obtain first screened data, including removing data with a calculation result of 0 in the first screened data;
[0009] Calculating the first screening data using a correlation analysis method to obtain second screening data, including eliminating data in the second screening data whose calculation result is greater than 0.5;
[0010] According to the random forest algorithm, the second screening data is calculated, and the importance value of each feature is obtained by calculation, and the data are sorted according to the importance values, and then the importance values with the highest ranking are screened out, and the importance values with the highest ranking are recorded as the main controlling factors related to cementing quality.
[0011] Preferably, the initial data is preprocessed to obtain preprocessed initial data, which includes:
[0012] Encoding the data related to the text part in the initial data, and converting the encoded data of the text part into numerical data;
[0013] Based on the numerical data, selectively delete the data missing part in the initial data to obtain the deleted first initial data;
[0014] Filling missing feature values in the initial data according to the first initial data and the average value method to obtain filled second initial data;
[0015] According to the second initial data, abnormal data correction is performed on each initial data contained in the initial data to obtain the final processed initial data, which is recorded as the pre-processed initial data, wherein the abnormal data correction includes performing outlier detection calculation on each initial data through absolute distance, and judging the absolute value of the calculation result. If the absolute value of the calculation result is greater than 2, it is determined to be an outlier, and the initial data corresponding to the outlier is deleted, and the average value method in the above process is used again to fill it, so as to obtain the final processed initial data, wherein the calculation formula of the absolute distance is as follows:
[0016]
[0017] In the formula, For any two different initial data values under the same initial data item, x ik 、x jk are any two different initial data values under the initial data item k, and p is the number of single initial data.
[0018] Preferably, the method of calculating the first screening data using a correlation analysis method to obtain the second screening data includes eliminating data with a calculation result of 0.5 in the second screening data, including:
[0019] The corrplot function in the machine learning visualization library is used to calculate the correlation coefficient of each feature in the first screening data to obtain a first result, wherein the calculation formula of the correlation coefficient is as follows:
[0020]
[0021] In the formula, Corr(x, y) is the correlation coefficient of the initial data of any two different items, x i ,y i are the initial data of any two different projects, is the average value of the initial data of any two different projects, s x 、s y is the standard deviation of the initial data of any two different items;
[0022] Visualize the first result according to the heatmap function to form a correlation coefficient heat map of the features;
[0023] Based on the correlation coefficient heat map of the features, the correlation coefficients between the features in the first result are calculated, and it is determined whether the calculated result is greater than 5. If it is greater than 5, it is eliminated; if it is less than or equal to 5, it is retained.
[0024] Preferably, the importance value of each feature is obtained by calculation, sorted according to the importance value, and then the importance values with the highest ranking are selected, and the importance values with the highest ranking are recorded as the main control factors related to cementing quality, including:
[0025] The importance value of each feature is extracted using the quantitative feature contribution function in the machine learning sklearn library, where the importance value is calculated as follows:
[0026]
[0027] In the formula, Gini(t) is the importance value of a given node t, t is a given node, i is any classification of the label, and p(i|t) is the proportion of label classification i on node t;
[0028] According to the order of the importance value of each feature, the importance value is sorted in ascending order;
[0029] The first three importance values with the highest importance value ranking are selected, and the first three importance values are recorded as the main control factors related to cementing quality.
[0030] In a second aspect, the present application also provides a screening device for main control factors of cementing quality, comprising an acquisition module, a preprocessing module, a first screening module, a second screening module and a sorting module, wherein:
[0031] Acquisition module: used to acquire initial data of cementing to be screened, the initial data includes multiple influencing factors, the influencing factors include geological factors, drilling factors, basic parameter factors and quality factors related to cementing to be screened, wherein geological factors include the maximum oil and gas upwelling velocity and the oil and gas upwelling velocity before cementing, drilling factors include well inclination angle, full angle change rate, well diameter expansion rate and bentonite content in drilling fluid, basic parameter factors include drilling fluid density before cementing, drilling fluid pH value before cementing, drilling fluid fluidity index before cementing and drilling fluid viscosity coefficient before cementing, quality factors include high quality rate of cementation and sealing quality of oil and gas layer interface;
[0032] Preprocessing module: used for preprocessing the initial data to obtain preprocessed initial data, and performing dimensionless processing on the preprocessed initial data to obtain processed standardized data;
[0033] A first screening module: used to perform feature screening on the standardized data using a variance filtering method to obtain first screening data, including removing data with a calculation result of 0 in the first screening data;
[0034] A second screening module: used to calculate the first screening data using a correlation analysis method to obtain second screening data, including eliminating data in the second screening data whose calculation result is greater than 0.5;
[0035] Sorting module: used to calculate the second screening data according to the random forest algorithm, and obtain the importance value of each feature by calculation, sort according to the importance value, and then screen out the importance values with the highest ranking, and record the importance values with the highest ranking as the main controlling factors related to cementing quality.
[0036] In a third aspect, the present application also provides a screening device for main control factors of cementing quality, including:
[0037] Memory for storing computer programs;
[0038] A processor is used to implement the steps of the method for screening the main controlling factors of cementing quality when executing the computer program.
[0039] In a fourth aspect, the present application further provides a readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of the above-mentioned screening method based on the main controlling factors of cementing quality are implemented.
[0040] The beneficial effects of the present invention are:
[0041] 1. Aiming at the problem that the influence degree of each factor cannot be determined in cementing engineering, the present invention provides a method for screening the main control factors of cementing quality. The present invention can calculate the influence degree of each influencing factor on cementing quality, select the key factors affecting cementing quality, provide a basis for cementing scheme parameter design, thereby improving cementing quality, reducing unnecessary waste of resources and improving construction safety.
[0042] 2. The present invention obtains basic data by preprocessing the initial data of cementing engineering, and then performs feature selection on the processed data to extract important features, and optimizes the factors that have a greater impact on cementing quality, laying a foundation for subsequent calculations.
[0043] 3. The present invention can organize and analyze complex cementing data through the process of data preprocessing. Based on the integrated research of geology, drilling and cementing, it takes into account the influence of various factors on the cementing quality, making the results more reliable. It studies the linear relationship between the characteristics and the importance of the influencing factors on the cementing quality, providing a basis for the design of cementing schemes, thereby improving the cementing quality and reducing resource waste.
[0044] Other features and advantages of the present invention will be described in the following description, and partly become apparent from the description, or be understood by implementing the embodiments of the present invention. The purpose and other advantages of the present invention can be realized and obtained by the structures particularly pointed out in the written description, claims, and drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.
[0046] Figure 1 Schematic diagram of the process of screening the main control factors of cementing quality described in an embodiment of the present invention;
[0047] Figure 2 It is a schematic diagram of the structure of a screening device for main control factors of cementing quality described in an embodiment of the present invention;
[0048] Figure 3 It is a schematic diagram of the structure of the screening device for the main control factors of cementing quality described in an embodiment of the present invention;
[0049] Figure 4 Schematic diagram of outliers in the method for screening the main control factors of cementing quality described in an embodiment of the present invention;
[0050] Figure 5 It is a thermodynamic diagram of characteristic correlation coefficients of the screening method of the main control factors of cementing quality described in an embodiment of the present invention;
[0051] Figure 6 It is a schematic diagram of the feature importance ranking of the method for screening the main control factors of cementing quality described in an embodiment of the present invention.
[0052] In the figure: 701, acquisition module; 702, preprocessing module; 7021, encoding unit; 7022, deletion unit; 7023, filling unit; 7024, acquisition unit; 703, first screening module; 704, second screening module; 7041, first calculation unit; 7042, visualization unit; 7043, second calculation unit; 705, sorting module; 7051, extraction unit; 7052, sorting unit; 7053, selection unit; 800, screening device for main control factors of cementing quality; 801, processor; 802, memory; 803, multimedia component; 804, I / O interface; 805, communication component. DETAILED DESCRIPTION
[0053] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all of the embodiments. The components of the embodiments of the present invention generally described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present invention provided in the drawings is not intended to limit the scope of the claimed invention, but merely represents selected embodiments of the present invention. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0054] It should be noted that similar reference numerals and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in the subsequent drawings. At the same time, in the description of the present invention, the terms "first", "second", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.
[0055] Embodiment 1:
[0056] This embodiment provides a method for screening main control factors of cementing quality.
[0057] See also Figure 1, the figure shows that the method includes step S100, step S200, step S300, step S400 and step S500.
[0058] S100, obtaining initial data of cementing to be screened, the initial data including multiple influencing factors, the influencing factors including geological factors, drilling factors, basic parameter factors and quality factors related to the cementing to be screened, wherein the geological factors include the maximum oil and gas rushing up velocity and the oil and gas rushing up velocity before cementing, the drilling factors include the well inclination angle, the full angle change rate, the wellbore expansion rate and the bentonite content in the drilling fluid, the basic parameter factors include the density of the drilling fluid before cementing, the pH value of the drilling fluid before cementing, the fluidity index of the drilling fluid before cementing and the viscosity coefficient of the drilling fluid before cementing, and the quality factors include the high quality rate of cementation and sealing quality of the interface of the oil and gas layer.
[0059] It is understandable that in this step, the single well data to be screened for cementing must be obtained first. Each single well data includes 4 aspects of data, including geological factors, drilling factors, basic parameter factors and quality factors, totaling 21 items, as initial data. Among them, geological factors include the highest oil and gas upwelling velocity and the oil and gas upwelling velocity before cementing; drilling factors include well inclination angle, full angle change rate, well diameter expansion rate, and bentonite content in drilling fluid; basic parameter factors include engineering accidents, the difference between the bottom hole equivalent density and the density of the completed drilling fluid during weightlessness, the ratio of the length of the sealing section to the depth of the completed drilling, the ratio of the amount of pre-fluid to the volume of the sealing section, the difference between the thickening time and the construction time, the density of the drilling fluid before cementing, the pH value of the drilling fluid before cementing, the fluidity index of the drilling fluid before cementing, the viscosity coefficient of the drilling fluid before cementing, the dynamic shear force of the drilling fluid before cementing, the density of the leading slurry formula, the proportion of small displacement displacement, the SPN value of the tail slurry, and the size of the well drilling tool; quality factors include the high-quality rate of cementation and sealing quality at the interface of the oil and gas layer.
[0060] Specifically, in this embodiment, geological, drilling, cementing and cementing quality data of a certain oil field are obtained, with a total of 1989 wells, and each well has a total of 20 initial data items.
[0061] S200, preprocessing the initial data to obtain preprocessed initial data, and performing dimensionless processing on the preprocessed initial data to obtain processed standardized data.
[0062] It can be understood that the step S200 includes S201, S202, S203 and S204, wherein:
[0063] S201, encoding the data related to the text part in the initial data, and converting the encoded data of the text part into numerical data;
[0064] Specifically, in this embodiment, the classification rule is defined as: "Good" values greater than or equal to 90% are classified as "Good"; "Bad" values greater than or equal to 30% are classified as "Bad"; the rest are "Medium". The LabelEncoder function in the sklearn library is used in the Python algorithm. It is a label-specific function that can convert classifications into classification values, and the label value of "Bad" is recorded as "0"; the label value of "Medium" is recorded as "1"; the label value of "Good" is recorded as "2". All text feature labels in the data are converted into numerical data sets that can be used by the model algorithm, so that these feature labels can be counted, compared and analyzed, which is convenient for subsequent feature screening.
[0065] S202, based on the numerical data, selectively delete the data missing part in the initial data to obtain first initial data after deletion;
[0066] It should be noted that the single well data in the initial data with missing data are selectively deleted, and the data with a total number of missing feature values of the single well data ≥ 10 are deleted;
[0067] Specifically, in this embodiment, samples with a total number of missing feature values greater than or equal to 10 are deleted. However, manual deletion is troublesome, so it can be solved with the help of Python code. After deletion, 1982 samples remain. For missing data, the mean value can be used to fill it and then outlier detection can be performed.
[0068] According to the factors affecting cementing quality, the K value is set to 3, and the results are visualized to obtain an outlier map. It can be seen that a total of 110 outliers were detected this time, and the sample numbers are shown in Table 1. The outlier map is formed. Figure 4 .
[0069] The serial numbers corresponding to the outlier samples (Table 1)
[0070] 1 227 426 700 1242 1400 1520 1581 1656 1803 9 240 453 718 1247 1402 1524 1582 1660 1815 35 241 458 728 1267 1414 1535 1583 1662 1827 60 242 471 768 1271 1419 1538 1586 1665 1838 68 306 523 794 1281 1450 1544 1595 1669 1891 90 328 535 825 1347 1452 1545 1596 1690 1907 105 335 587 860 1355 1453 1547 1599 1709 1932 120 336 588 978 1357 1457 1561 1601 1741 1933 141 384 660 1003 1381 1498 1567 1637 1751 1941 168 394 670 1220 1382 1501 1570 1639 1771 1947 187 424 687 1225 1383 1507 1578 1647 1777 1952 ... ... ... ... ... ... ... ... ... ...
[0071] Finally, the data after deleting the outlier samples were re-mean-filled to obtain a processed complete data set, which further improved the quality and accuracy of the data set. A total of 1,872 data were used for subsequent research.
[0072] S203, filling the missing feature values in the initial data according to the first initial data and the average value method to obtain filled second initial data;
[0073] S204, based on the second initial data, performing abnormal data error correction on each initial data included in the initial data to obtain the final processed initial data, recorded as the pre-processed initial data, wherein the abnormal data error correction includes performing outlier detection calculation on each initial data by absolute distance, and judging the absolute value of the calculation result, if the absolute value of the calculation result is greater than 2, it is determined to be an outlier, and the initial data corresponding to the outlier is deleted, and the average value method in the above process is used to fill it again to obtain the final processed initial data, wherein the calculation formula of the absolute distance is as follows:
[0074]
[0075] In the formula, For any two different initial data values under the same initial data item, x ik 、x jk are any two different initial data values under the initial data item k, and p is the number of single initial data.
[0076] It should be noted that in S204, the missing initial data in the single well data where the total number of missing feature values of the initial data is ≥1 and <10 needs to be filled with the average value of the initial data.
[0077] Specifically, in step S200, the preprocessed initial data is dimensionally processed to obtain processed standardized data, and the data standardization formula is as follows:
[0078]
[0079]
[0080] Among them, z i is the dimensionless value of each initial data, x i is the initial data of each well, μ i is the average value of each initial data under single well data, σ i is the standard deviation of each initial data under single well data, and n is the number of initial data.
[0081] Specifically, in this embodiment, the StandardScaler function in sklearn.preprocessing is used to standardize the features in the data set. The results of some of the processed data are shown in Table 2 below. After the various factors affecting the cementing quality are standardized, it is convenient to visualize and interpret the features.
[0082] Some data after standardization (Table 2)
[0083] Serial number hashtag Ratio of pre-fluid volume to sealing section volume Difference between tailings thickening time and construction time Drilling fluid density before cementing Drilling fluid PH before cementing 1 Well 1 -0.30621 0.615052 -0.11569 -0.08574 2 Well 2 0.964845 0.535237 -0.07996 0.19466 3 Well 3 -0.30621 0.156115 -0.11894 0.19466 4 Well 4 -0.23362 0.255884 -0.11244 0.19466 5 Well 5 -0.3028 -0.06338 -0.07346 -0.36613 ... ... ... ... ... ...
[0084] S300, using a variance filtering method to perform feature screening on the standardized data to obtain first screened data, including removing data with a calculation result of 0 in the first screened data.
[0085] It is understandable that this step S300 includes using the variance filtering method to perform feature screening on the standardized data in the above steps, and deleting the initial data items with a calculation result of 0 as no influencing factors. The calculation formula of the variance is as follows:
[0086]
[0087] Among them, Var(x) is the variance of a certain initial data set, x i is some initial data, is the average value of a certain initial data.
[0088] It should be noted that the VarianceThreshold function in Python's sklearn.feature_selection is used to implement it, and a new feature matrix is obtained after deleting the variance of 0. It is found that there are still 20 features, that is, the variance in these features is greater than zero, that is, there are differences in each feature of the samples, so the features are temporarily retained.
[0089] S400, calculating the first screening data using a correlation analysis method to obtain second screening data, including eliminating data in the second screening data whose calculation results are greater than 0.5.
[0090] It can be understood that the step S400 includes S401, S402 and S403, wherein:
[0091] S401. Calculate the correlation coefficient of each feature in the first screening data using the corrplot function in the machine learning visualization library to obtain a first result, wherein the calculation formula of the correlation coefficient is as follows:
[0092]
[0093] In the formula, Corr(x, y) is the correlation coefficient of the initial data of any two different items, x i ,y i are the initial data of any two different projects, is the average value of the initial data of any two different projects, s x 、s y is the standard deviation of the initial data of any two different items;
[0094] S402, visualizing the first result according to a heatmap function to form a correlation coefficient heat map of the features;
[0095] Specifically, in this embodiment, the corrplot function in the seaborn library is used to calculate the correlation coefficient of each feature and the heatmap function is used to visualize it to form a feature correlation coefficient heat map, see Figure 5 Because some feature names are long, in order to facilitate display, the features are first numbered. The processing method is shown in Table 3 below.
[0096] Feature number (Table 3)
[0097] feature serial number feature serial number Well inclination angle <![CDATA[X1]]> Drilling fluid dynamic shear force before cementing YP <![CDATA[X 11 ]]> Engineering Accidents <![CDATA[X2]]> Full angle rate of change <![CDATA[X 12 ]]> The difference between the equivalent density at the bottom of the hole and the density of the drilling fluid after drilling when the weight is lost <![CDATA[X3]]> Well diameter expansion rate <![CDATA[X 13 ]]> Ratio of sealing section length to completed drilling depth <![CDATA[X4]]> Maximum oil and gas upstroke speed <![CDATA[X 14 <!-- 7 -->]]> Ratio of pre-fluid volume to sealing section volume <![CDATA[X5]]> Oil and gas upwelling speed before cementing <![CDATA[X 15 ]]> Difference between tailings thickening time and construction time <![CDATA[X6]]> Density of pulp formula <![CDATA[X 16 ]]> Drilling fluid density before cementing <![CDATA[X7]]> Bentonite content in drilling fluid <![CDATA[X 17 ]]> Drilling fluid PH before cementing <![CDATA[X8]]> Tail slurry SPN value <![CDATA[X 18 ]]> Drilling fluid flow index before cementing n <![CDATA[X9]]> Small displacement replacement ratio <![CDATA[X 19 ]]> Drilling fluid viscosity coefficient K before cementing <![CDATA[X 10 ]]> Drilling tool size <![CDATA[X 20 ]]>
[0098] Specifically, from steps S200-S400, it can be obtained that the correlation coefficient between the full angle change rate and the well inclination angle is 0.59, indicating that the full angle change rate and the well inclination angle are moderately positively correlated; the correlation coefficient between the pre-fluid volume ratio of the cementing section and the cementing section length and the completed well depth ratio is -0.52, indicating that the pre-fluid volume ratio of the cementing section and the cementing section length and the completed well depth ratio are moderately negatively correlated. Therefore, the two features of the full angle change rate and the cementing section length and the completed well depth ratio are deleted. The correlation coefficients between the remaining features are small, indicating that the correlation is not great, and they can be temporarily retained. So far, there are 18 features that affect the cementing quality.
[0099] S403. Based on the correlation coefficient heat map of the features, the correlation coefficients between the features in the first result are calculated, and it is determined whether the calculated result is greater than 5. If it is greater than 5, it is eliminated and not used as an influencing factor. If it is less than or equal to 5, it is retained.
[0100] S500. According to the random forest algorithm, the second filtered data is calculated, and the importance value of each feature is obtained by calculation, and the importance values with the highest order are sorted, and then the importance values with the highest order are screened out, and the importance values with the highest order are recorded as the main controlling factors related to cementing quality.
[0101] It can be understood that step S500 includes S501, S502 and S503, wherein:
[0102] S501. The importance value of each feature is extracted using the quantitative feature contribution function in the machine learning sklearn library, where the importance value is calculated using the following formula:
[0103]
[0104] In the formula, Gini(t) is the importance value of a given node t, t is a given node, i is any classification of the label, and p(i|t) is the proportion of label classification i on node t;
[0105] S502, sorting the importance values of each feature in ascending order according to the importance value of each feature;
[0106] S503, selecting the first three importance values with the highest importance value ranking, and recording the first three importance values as the main control factors related to cementing quality.
[0107] Specifically, in this embodiment, the feature_importance_ function in the sklearn library is used to successfully obtain the importance of each feature. By sorting the results, the important coefficients of the features affecting the cementing quality are obtained as shown in Table 4 below, and they are plotted into a feature importance ranking diagram in descending order of importance, see Figure 6 For the convenience of display, the feature names are represented by capital letters AR from small to large according to the importance. It should be noted that by calculating the importance value of each feature, the higher the importance value, the greater its impact. Therefore, it is possible to sort by importance and filter out the main control factors of cementing quality that are ranked first.
[0108] Feature importance (Table 4)
[0109] feature serial number Importance feature serial number Importance Engineering Accidents A 0.005584 Drilling tool size J 0.06429 Density of pulp formula B 0.017576 Maximum oil and gas upstroke speed K 0.064685 Drilling fluid PH before cementing C 0.026075 Difference between tailings thickening time and construction time L 0.065307 Drilling fluid flow index before cementing n D 0.04314 Oil and gas upwelling speed before cementing M 0.065847 Drilling fluid viscosity coefficient K before cementing E 0.049013 Well diameter expansion rate N 0.066026 Drilling fluid dynamic shear force before cementing YP F 0.052914 Ratio of pre-fluid volume to sealing section volume O 0.066559 Bentonite content in drilling fluid G 0.058713 Difference between bottom hole equivalent density and drilling fluid density P 0.068639 Drilling fluid density before cementing H 0.058759 Small displacement replacement ratio Q 0.076307 Well inclination angle I 0.06234 Tail slurry SPN value R 0.088226
[0110] In summary, in this embodiment, it can be seen that according to the importance calculation results, there are 10 features with importance greater than 0.06: well inclination angle, through-hole drilling tool size, maximum oil and gas rushing velocity, difference between tail slurry thickening time and construction time, oil and gas rushing velocity before cementing, well diameter expansion rate, pre-fluid volume ratio of cementing section, bottom hole equivalent density and drilling fluid density difference, small displacement displacement ratio, tail slurry SPN value. Among them, the top three factors with the highest importance are tail slurry SPN value, small displacement displacement ratio and bottom hole equivalent density and drilling fluid density difference, which are recorded as the main control factors related to cementing quality, so they can be focused on in the cementing optimization plan.
[0111] Therefore, the present invention can calculate the influence degree of each influencing factor on the cementing quality, optimize the key factors affecting the cementing quality, provide a basis for the parameter design of cementing scheme, thereby improving the cementing quality, reducing unnecessary waste of resources and improving the safety of construction; obtain basic data by preprocessing the initial data of the cementing project, and then perform feature selection on the processed data to extract important features, optimize the factors that have a greater impact on the cementing quality, and lay a foundation for subsequent calculations; through the process of data preprocessing, the present invention can organize and analyze complex cementing data, consider the influence of various factors on the cementing quality, and make the results more reliable; study the linear relationship between the features and the importance of the influencing factors to the cementing quality, thereby improving the cementing quality and reducing the waste of resources.
[0112] Embodiment 2:
[0113] like Figure 2 As shown, this embodiment provides a screening device for the main control factors of cementing quality, see Figure 2 The device includes an acquisition module 701, a preprocessing module 702, a first screening module 703, a second screening module 704 and a sorting module 705, wherein:
[0114] Acquisition module 701: used to acquire initial data of cementing to be screened, the initial data includes multiple influencing factors, the influencing factors include geological factors, drilling factors, basic parameter factors and quality factors related to cementing to be screened, wherein geological factors include the maximum oil and gas upwelling velocity and the oil and gas upwelling velocity before cementing, drilling factors include well inclination angle, full angle change rate, well diameter expansion rate and bentonite content in drilling fluid, basic parameter factors include drilling fluid density before cementing, drilling fluid pH value before cementing, drilling fluid fluidity index before cementing and drilling fluid viscosity coefficient before cementing, quality factors include high quality rate of cementation and sealing quality of oil and gas layer interface;
[0115] Preprocessing module 702: used to preprocess the initial data to obtain preprocessed initial data, and perform dimensionless processing on the preprocessed initial data to obtain processed standardized data;
[0116] The first screening module 703 is used to perform feature screening on the standardized data using a variance filtering method to obtain first screened data, including removing data with a calculation result of 0 in the first screened data;
[0117] The second screening module 704 is used to calculate the first screening data using a correlation analysis method to obtain second screening data, including eliminating data in the second screening data whose calculation result is greater than 0.5;
[0118] Sorting module 705: used to calculate the second filtered data according to the random forest algorithm, and obtain the importance value of each feature by calculation, sort according to the importance value, and then screen out the importance values with the highest ranking, and record the importance values with the highest ranking as the main controlling factors related to cementing quality.
[0119] Specifically, the preprocessing module 702 includes a coding unit 7021, a deleting unit 7022, a padding unit 7023 and an obtaining unit 7024, wherein:
[0120] Coding unit 7021: used for encoding the data related to the text part in the initial data, and converting the encoded data of the text part into numerical data;
[0121] Deletion unit 7022: used for selectively deleting the data missing part in the initial data based on the numerical data to obtain the first initial data after deletion;
[0122] A filling unit 7023 is used to fill the missing feature values in the initial data according to the first initial data and the average value method to obtain filled second initial data;
[0123] The obtaining unit 7024 is used to perform abnormal data error correction on each initial data contained in the initial data according to the second initial data, and obtain the final processed initial data, which is recorded as the pre-processed initial data, wherein the abnormal data error correction includes performing outlier detection calculation on each initial data by absolute distance, and judging the absolute value of the calculation result. If the absolute value of the calculation result is greater than 2, it is determined to be an outlier, and the initial data corresponding to the outlier is deleted, and the average value method in the above process is used to fill it again, so as to obtain the final processed initial data, wherein the calculation formula of the absolute distance is as follows:
[0124]
[0125] In the formula, For any two different initial data values under the same initial data item, x ik 、x jk are any two different initial data values under the initial data item k, and p is the number of single initial data.
[0126] Specifically, the second screening module 704 includes a first calculation unit 7041, a visualization unit 7042 and a second calculation unit 7043, wherein:
[0127] The first calculation unit 7041 is used to calculate the correlation coefficient of each feature in the first screening data by using the corrplot function in the machine learning visualization library to obtain a first result, wherein the calculation formula of the correlation coefficient is as follows:
[0128]
[0129] In the formula, Corr(x, y) is the correlation coefficient of the initial data of any two different items, x i ,y i are the initial data of any two different projects, is the average value of the initial data of any two different projects, s x 、s y is the standard deviation of the initial data of any two different items;
[0130] Visualization unit 7042: used to visualize the first result according to the heatmap function to form a correlation coefficient heat map of the features;
[0131] The second calculation unit 7043 is used to calculate the correlation coefficient between each feature in the first result based on the correlation coefficient heat map of the features, and determine whether the calculation result is greater than 5. If it is greater than 5, it will be eliminated; if it is less than or equal to 5, it will continue to be retained.
[0132] Specifically, the sorting module 705 includes an extraction unit 7051, a sorting unit 7052 and a selection unit 7053, wherein:
[0133] Extraction unit 7051: used to extract the importance value of each feature using the quantitative feature contribution function in the machine learning sklearn library, where the calculation formula of the importance value is as follows:
[0134]
[0135] In the formula, Gini(t) is the importance value of a given node t, t is a given node, i is any classification of the label, and p(i|t) is the proportion of label classification i on node t;
[0136] Sorting unit 7052: used to sort the importance values of each feature in ascending order according to the importance value of each feature;
[0137] The selection unit 7053 is used to select the first three importance values with the highest importance value ranking, and record the first three importance values as the main control factors related to cementing quality.
[0138] It should be noted that, regarding the device in the above embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment of the method, and will not be elaborated here.
[0139] Embodiment 3:
[0140] Corresponding to the above method embodiment, this embodiment also provides a screening device for main controlling factors of cementing quality. The screening device for main controlling factors of cementing quality described below and the screening method for main controlling factors of cementing quality described above can refer to each other.
[0141] Figure 3 FIG. 8 is a block diagram of a screening device 800 for main control factors of cementing quality according to an exemplary embodiment. Figure 3 As shown, the device 800 for screening the main control factors of cementing quality includes: a processor 801 and a memory 802. The device 800 for screening the main control factors of cementing quality also includes one or more of a multimedia component 803, an I / O interface 804, and a communication component 805.
[0142] The processor 801 is used to control the overall operation of the screening device 800 for the main control factors of cementing quality, so as to complete all or part of the steps in the above-mentioned screening method for the main control factors of cementing quality. The memory 802 is used to store various types of data to support the operation of the screening device 800 for the main control factors of cementing quality, such as instructions for any application or method used to operate on the screening device 800 for the main control factors of cementing quality, and application-related data, such as contact data, sent and received messages, pictures, audio, video, etc. The memory 802 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, disk or optical disk. The multimedia component 803 may include a screen and an audio component. The screen may be, for example, a touch screen, and the audio component is used to output and / or input audio signals. For example, the audio component may include a microphone, which is used to receive external audio signals. The received audio signal may be further stored in the memory 802 or sent via the communication component 805. The audio component also includes at least one speaker for outputting audio signals. The I / O interface 804 provides an interface between the processor 801 and other interface modules, and the above-mentioned other interface modules can be a keyboard, a mouse or a button, etc. These buttons can be virtual buttons or physical buttons. The communication component 805 is used for wired or wireless communication between the screening device 800 for the main control factors of cementing quality and other devices. Wireless communication, such as Wi-Fi, Bluetooth, Near Field Communication (NFC), 2G, 3G or 4G, or a combination of one or more of them, so the corresponding communication component 805 can include: a Wi-Fi module, a Bluetooth module or an NFC module.
[0143] In an exemplary embodiment, the screening device 800 for the main controlling factors of cementing quality can be implemented by one or more application specific integrated circuits (ASIC), digital signal processors (DSP), digital signal processing devices (DSPD), programmable logic devices (PLD), field programmable gate arrays (FPGA), controllers, microcontrollers, microprocessors or other electronic components to execute the above-mentioned screening method for the main controlling factors of cementing quality.
[0144] In another exemplary embodiment, a computer-readable storage medium including program instructions is also provided, and when the program instructions are executed by a processor, the steps of the above-mentioned method for screening the main controlling factors of cementing quality are implemented. For example, the computer-readable storage medium can be the above-mentioned memory 802 including program instructions, and the above-mentioned program instructions can be executed by the processor 801 of the screening device 800 for screening the main controlling factors of cementing quality to complete the above-mentioned method for screening the main controlling factors of cementing quality.
[0145] Embodiment 4:
[0146] Corresponding to the above method embodiment, a readable storage medium is also provided in this embodiment. The readable storage medium described below and the method for screening the main controlling factors of cementing quality described above can refer to each other.
[0147] The readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method for screening the main controlling factors of cementing quality in the above method embodiment are implemented.
[0148] The readable storage medium may specifically be a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, or other readable storage medium that can store program codes.
[0149] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
[0150] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.
Claims
1. A method for screening main control factors of cementing quality, characterized in that: include: Acquire initial data of the wells to be screened for cementing, the initial data including multiple influencing factors, the influencing factors including geological factors, drilling factors, basic parameter factors and quality factors related to the wells to be screened for cementing, wherein the geological factors include the maximum oil and gas rushing up velocity and the oil and gas rushing up velocity before cementing, the drilling factors include the well inclination angle, the full angle change rate, the wellbore expansion rate and the bentonite content in the drilling fluid, the basic parameter factors include the drilling fluid density before cementing, the drilling fluid pH value before cementing, the drilling fluid flowability index before cementing and the drilling fluid viscosity coefficient before cementing, and the quality factors include the high quality rate of cementation and sealing quality of the interface of the oil and gas layer section; Preprocessing the initial data to obtain preprocessed initial data, and performing dimensionless processing on the preprocessed initial data to obtain processed standardized data; Using a variance filtering method to perform feature screening on the standardized data to obtain first screened data, including removing data with a calculation result of 0 in the first screened data; Calculating the first screening data using a correlation analysis method to obtain second screening data, including eliminating data in the second screening data whose calculation result is greater than 0.5; According to the random forest algorithm, the second screening data is calculated, and the importance value of each feature is obtained by calculation, and the data are sorted according to the importance values, and then the importance values with the highest ranking are screened out, and the importance values with the highest ranking are recorded as the main controlling factors related to cementing quality.
2. The method for screening the main controlling factors of cementing quality according to claim 1, characterized in that: The initial data is preprocessed to obtain preprocessed initial data, which includes: Encoding the data related to the text part in the initial data, and converting the encoded data of the text part into numerical data; Based on the numerical data, selectively delete the data missing part in the initial data to obtain the deleted first initial data; Filling missing feature values in the initial data according to the first initial data and the average value method to obtain filled second initial data; According to the second initial data, abnormal data correction is performed on each initial data contained in the initial data to obtain the final processed initial data, which is recorded as the pre-processed initial data, wherein the abnormal data correction includes performing outlier detection calculation on each initial data through absolute distance, and judging the absolute value of the calculation result. If the absolute value of the calculation result is greater than 2, it is determined to be an outlier, and the initial data corresponding to the outlier is deleted, and the average value method in the above process is used again to fill it, so as to obtain the final processed initial data, wherein the calculation formula of the absolute distance is as follows: In the formula, For any two different initial data values under the same initial data item, x ik 、x jk are any two different initial data values under the initial data item k, and p is the number of single initial data.
3. The method for screening the main controlling factors of cementing quality according to claim 1, characterized in that: The method of using the correlation analysis method to calculate the first screening data to obtain the second screening data includes eliminating the data with a calculation result of 0.5 in the second screening data, including: The corrplot function in the machine learning visualization library is used to calculate the correlation coefficient of each feature in the first screening data to obtain a first result, wherein the calculation formula of the correlation coefficient is as follows: In the formula, Corr(x, y) is the correlation coefficient of the initial data of any two different items, x i ,y i are the initial data of any two different projects, is the average value of the initial data of any two different projects, s x 、s y is the standard deviation of the initial data of any two different items; Visualize the first result according to the heatmap function to form a correlation coefficient heat map of the features; Based on the correlation coefficient heat map of the features, the correlation coefficients between the features in the first result are calculated, and it is determined whether the calculated result is greater than 5. If it is greater than 5, it is eliminated; if it is less than or equal to 5, it is retained.
4. The method for screening the main controlling factors of cementing quality according to claim 1, characterized in that: The importance value of each feature is obtained by calculation, and the features are sorted according to the importance values, and then the importance values with the highest ranking are selected, and the importance values with the highest ranking are recorded as the main control factors related to cementing quality, including: The importance value of each feature is extracted using the quantitative feature contribution function in the machine learning sklearn library, where the importance value is calculated as follows: In the formula, Gini(t) is the importance value of a given node t, t is a given node, i is any classification of the label, and p(i|t) is the proportion of label classification i on node t; According to the order of the importance value of each feature, the importance value is sorted in ascending order; The first three importance values with the highest importance value ranking are selected, and the first three importance values are recorded as the main control factors related to cementing quality.
5. A screening device for main control factors of cementing quality, characterized in that: include: Acquisition module: used to acquire initial data of cementing to be screened, the initial data includes multiple influencing factors, the influencing factors include geological factors, drilling factors, basic parameter factors and quality factors related to cementing to be screened, wherein geological factors include the maximum oil and gas rushing up velocity and the oil and gas rushing up velocity before cementing, drilling factors include well inclination angle, full angle change rate, well diameter expansion rate and bentonite content in drilling fluid, basic parameter factors include drilling fluid density before cementing, drilling fluid pH value before cementing, drilling fluid fluidity index before cementing and drilling fluid viscosity coefficient before cementing, quality factors include high quality rate of cementation sealing quality of oil and gas layer interface; Preprocessing module: used for preprocessing the initial data to obtain preprocessed initial data, and performing dimensionless processing on the preprocessed initial data to obtain processed standardized data; A first screening module: used to perform feature screening on the standardized data using a variance filtering method to obtain first screening data, including removing data with a calculation result of 0 in the first screening data; A second screening module: used to calculate the first screening data using a correlation analysis method to obtain second screening data, including eliminating data in the second screening data whose calculation result is greater than 0.5; Sorting module: used to calculate the second screening data according to the random forest algorithm, and obtain the importance value of each feature by calculation, sort according to the importance value, and then screen out the importance values with the highest ranking, and record the importance values with the highest ranking as the main controlling factors related to cementing quality.
6. The device for screening the main controlling factors of cementing quality according to claim 5, characterized in that: The pre-processing module includes: Coding unit: used for encoding the data related to the text part in the initial data, and converting the encoded data of the text part into numerical data; A deleting unit: used for selectively deleting the data missing part in the initial data based on the numerical data to obtain the first initial data after deletion; A filling unit: used for filling the missing feature values in the initial data according to the first initial data and the average value method to obtain filled second initial data; The obtaining unit is used to perform abnormal data error correction on each initial data contained in the initial data according to the second initial data, and obtain the final processed initial data, which is recorded as the pre-processed initial data, wherein the abnormal data error correction includes performing outlier detection calculation on each initial data by absolute distance, and judging the absolute value of the calculation result. If the absolute value of the calculation result is greater than 2, it is determined to be an outlier, and the initial data corresponding to the outlier is deleted, and the average value method in the above process is used to fill it again, so as to obtain the final processed initial data, wherein the calculation formula of the absolute distance is as follows: In the formula, For any two different initial data values under the same initial data item, x ik 、x jk are any two different initial data values under the initial data item k, and p is the number of single initial data.
7. The device for screening the main controlling factors of cementing quality according to claim 5, characterized in that: The second screening module includes: The first calculation unit is used to calculate the correlation coefficient of each feature in the first screening data by using the corrplot function in the machine learning visualization library to obtain a first result, wherein the calculation formula of the correlation coefficient is as follows: In the formula, Corr(x, y) is the correlation coefficient of the initial data of any two different items, x i ,y i are the initial data of any two different projects, is the average value of the initial data of any two different projects, s x 、s y is the standard deviation of the initial data of any two different items; A visualization unit: used for visualizing the first result according to a heatmap function to form a heat map of correlation coefficients of features; The second calculation unit is used to calculate the correlation coefficient between each feature in the first result based on the correlation coefficient heat map of the feature, and determine whether the calculation result is greater than 5. If it is greater than 5, it will be eliminated; if it is less than or equal to 5, it will continue to be retained.
8. The device for screening the main controlling factors of cementing quality according to claim 5, characterized in that: The sorting module includes: Extraction unit: used to extract the importance value of each feature using the quantitative feature contribution function in the machine learning sklearn library, where the calculation formula of the importance value is as follows: In the formula, Gini(t) is the importance value of a given node t, t is a given node, i is any classification of the label, and p(i|t) is the proportion of label classification i on node t; Sorting unit: used to sort the importance values of each feature in order from small to large; Selection unit: used for selecting the top three importance values with the highest importance value ranking, and recording the top three importance values as the main control factors related to cementing quality.
9. A screening device for main control factors of cementing quality, characterized in that: include: Memory for storing computer programs; A processor is used to implement the method for screening the main controlling factors of cementing quality as claimed in any one of claims 1 to 4 when executing the computer program.
10. A readable storage medium, characterized in that: The readable storage medium stores a computer program, and when the computer program is executed by a processor, the method for screening the main controlling factors of cementing quality according to any one of claims 1 to 4 is implemented.