Pipeline corrosion rate mapping method and device, electronic equipment and storage medium

By acquiring data on various corrosion influencing factors, using correlation analysis and machine learning algorithms to train a prediction model, and drawing a pipeline corrosion rate map, the problem of inaccurate corrosion rate prediction in existing technologies is solved, achieving higher prediction accuracy and flexibility, and supporting pipeline corrosion monitoring and safety management.

CN122153266APending Publication Date: 2026-06-05PETROCHINA CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
PETROCHINA CO LTD
Filing Date
2024-12-03
Publication Date
2026-06-05

AI Technical Summary

Technical Problem

Existing corrosion mapping methods only consider meteorological conditions, leading to inaccurate corrosion rate predictions and failing to fully reflect the correlation between metal corrosion rate and influencing factors.

Method used

By acquiring data on various corrosion-influencing factors, a prediction model is trained using correlation analysis and machine learning algorithms. The factors with the highest correlation are selected to draw a pipeline corrosion rate map, including temperature, H2S partial pressure, CO2 partial pressure, pipeline flow velocity, and in-situ pH value, thereby improving prediction accuracy.

Benefits of technology

It improves the accuracy and flexibility of corrosion rate prediction, and can intuitively reflect the pipeline corrosion rate under different operating conditions, providing useful data support for corrosion degree, remaining service monitoring and safety protection, and reducing the risk of pipeline failure.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122153266A_ABST
    Figure CN122153266A_ABST
Patent Text Reader

Abstract

The present application relates to a kind of oil and gas field pipeline monitoring technical field, it is a kind of pipeline corrosion rate atlas drawing method, device, electronic equipment and storage medium, including obtaining the corrosion influencing factor set in the set time period of predicted pipeline;Corrosion influencing factor set is input into the model of highest prediction accuracy in prediction model set, obtain corrosion rate prediction value set;In the corrosion influencing factor, select the two corrosion influencing factors with the highest correlation with corrosion rate, draw pipeline corrosion rate atlas.The present application fully considers various corrosion influencing factors related to pipeline corrosion rate, and the model of highest prediction accuracy selected in the multiple prediction sub-model trained to predict corrosion rate, improve the accuracy of corrosion rate prediction, and select the two corrosion influencing factors with the highest correlation with corrosion rate to draw corrosion rate atlas, intuitively reflect the pipeline corrosion rate under different operating conditions, provide useful data support for pipeline maintenance.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of oil and gas field pipeline monitoring technology, specifically a method, apparatus, electronic device, and storage medium for plotting pipeline corrosion rate maps. Background Technology

[0002] Corrosion rate is a crucial factor in measuring the degree and speed of metal corrosion. Rapid and accurate acquisition and prediction of corrosion rate are key to determining the service life of metals. Corrosion rate is primarily obtained through actual monitoring and calculation using corrosion dipsticks and corrosion probes. Corrosion dipsticks can realistically reflect the corrosion situation, clearly showing pitting and uniform corrosion, but actual field operation is complex and the testing cycle is long. Corrosion probes are simple and fast, suitable for gaseous, liquid, conductive, and non-conductive media, and can continuously measure the corrosion rate of a specific location. However, the data fluctuates significantly and has a certain degree of deviation. They are suitable for uniform corrosion, but for pitting, stress corrosion cracking, or other localized corrosion conditions, the measurement results have some deviation. Specimen processing is more stringent, and the probe wire is a consumable, making it more expensive.

[0003] Therefore, obtaining corrosion rates quickly, accurately, and economically is crucial. Corrosion rates are influenced by a variety of factors, each with varying degrees of impact. The combination of these factors constitutes different operating conditions, under which the corrosion rate range also differs. Therefore, it is necessary to accurately obtain corrosion rates under different operating conditions by plotting corrosion maps, providing guidance for assessing the corrosion level, remaining service life, and safety protection of metal equipment or pipelines.

[0004] Existing methods for drawing corrosion maps include patent document CN114199750A, which discloses a method for drawing metal corrosion maps, obtaining the measured metal corrosion rate at the initial location within time t, as well as meteorological environmental data (annual average temperature, annual average relative humidity, annual average SO2 deposition rate, annual average Cl...). - The deposition rate is used as the objective function to minimize the difference between the predicted and measured values ​​of metal corrosion. A modified dose-response function is constructed. Meteorological environmental data of multiple other locations in the area to be mapped are obtained and substituted into the modified dose-response function to obtain the predicted metal corrosion rate at different locations. By combining the measured and predicted metal corrosion rate data, spatial interpolation is performed based on the Kriging method to draw the metal corrosion map.

[0005] The corrosion maps generated by the above methods are corrosion distribution maps, and can only use meteorological environmental data to predict metal corrosion rates. The types of influencing factors on metal corrosion rates are limited, so the accuracy of metal corrosion rate prediction is not ideal. Furthermore, when using annual average temperature, annual average relative humidity, annual average SO2 deposition rate, and annual average Cl- deposition rate to construct the dose-response function, it cannot cover all meteorological conditions, which also affects the accuracy of metal corrosion rate prediction. Moreover, because the types of influencing factors on metal corrosion rates are limited, the generated metal corrosion maps cannot well reflect the correlation between metal corrosion rates and influencing factors. Summary of the Invention

[0006] This invention provides a corrosion rate map plotting method, apparatus, electronic device, and storage medium, which overcomes the shortcomings of the prior art. It can effectively solve the problem that the types of corrosion rate influencing factors used in the existing corrosion rate plotting methods only involve meteorological conditions, but meteorological conditions are complex and changeable, which can easily lead to inaccurate corrosion rate predictions.

[0007] One of the technical solutions of this invention is achieved through the following measures: a method for plotting pipeline corrosion rate maps, comprising:

[0008] Obtain the set of corrosion influencing factors for the pipeline to be predicted within a specified time period. This set includes multiple data groups for each corrosion influencing factor, with each group containing data on temperature, H2S partial pressure, CO2 partial pressure, pipeline flow velocity, and Cl-. - Ion content, in-situ pH value;

[0009] The set of corrosion influencing factors is input into the corrosion rate prediction model to obtain a set of corrosion rate prediction values. The corrosion rate prediction model is the model with the highest prediction accuracy in the prediction model set. The prediction model set includes multiple prediction sub-models. Each prediction sub-model is trained using several samples on multiple machine learning algorithms. Each sample in the sample set includes a set of historical corrosion influencing factor data and the corresponding corrosion rate label.

[0010] Among the factors affecting corrosion, the two factors with the highest correlation to corrosion rate were selected, and a corrosion rate map of the pipeline was drawn using the combination of the two factors and the predicted corrosion rate values.

[0011] The following are further optimizations and / or improvements to the above-mentioned technical solution:

[0012] The above-mentioned corrosion influencing factors were selected, and the two factors with the highest correlation to corrosion rate were used to draw a pipeline corrosion rate map using the set of corrosion rate prediction values, including:

[0013] Based on the set of corrosion influencing factors and the set of predicted corrosion rate values, the correlation analysis algorithm is used to analyze the correlation between each corrosion influencing factor and the corrosion rate, and the correlation coefficient of each corrosion influencing factor is obtained;

[0014] Select two corrosion influencing factors with the largest absolute value of the correlation coefficient;

[0015] Partition the predicted corrosion rate values in the set of predicted corrosion rate values based on the corrosion rate partition conditions;

[0016] Draw a pipeline corrosion rate map based on the partitioning results and the two corrosion influencing factors with the largest absolute value of the correlation coefficient.

[0017] The above-mentioned determination of the corrosion rate prediction model includes:

[0018] Obtain a number of samples, and divide the samples into a training sample set and a test sample set according to a certain proportion. Each sample in the number of samples includes a historical corrosion influencing factor data group and the corresponding corrosion rate identifier. The historical corrosion influencing factor data group includes temperature, H2S partial pressure, CO2 partial pressure, pipeline flow velocity, Cl - ion content, in-situ pH value;

[0019] Use the training sample set to train various machine learning algorithms respectively to obtain multiple prediction sub-models;

[0020] Use the test sample set to test each prediction sub-model, and evaluate the test results of each prediction sub-model based on the regression model evaluation index;

[0021] Select the prediction sub-model with the best evaluation result as the corrosion rate prediction model.

[0022] When using the training sample set to train various machine learning algorithms respectively above, the hyperparameter optimization of the machine learning algorithm is completed by using grid search.

[0023] When obtaining a number of samples above, each corrosion influencing factor in the historical corrosion influencing factor data group needs to meet the corresponding acquisition range conditions, where the acquisition range conditions include 20°C < temperature < 100°C, 0 kPa < H2S partial pressure < 1600 kPa, 0 MPa < CO2 partial pressure < 3.5 MPa, 0 m / s < flow velocity < 3 m / s, 55 mg / L < Cl - content < 150000 mg / L, 3 < in-situ pH value < 7.

[0024] The above-mentioned various machine learning algorithms include K-nearest neighbor algorithm, support vector machine algorithm, gradient boosting decision tree algorithm and random forest algorithm.

[0025] The second technical solution of the present invention is achieved through the following measures: a pipeline corrosion rate mapping device, comprising:

[0026] The data acquisition unit acquires a set of corrosion influencing factors for the pipeline within a specified time period. This set includes multiple data groups for each corrosion influencing factor, with each group containing data on temperature, H2S partial pressure, CO2 partial pressure, pipeline flow velocity, and Cl-. - Ion content, in-situ pH value;

[0027] The prediction unit inputs the set of corrosion influencing factors into the corrosion rate prediction model to obtain a set of corrosion rate prediction values. The corrosion rate prediction model is the model with the highest prediction accuracy in the prediction model set. The prediction model set includes multiple prediction sub-models. Each prediction sub-model is trained using several samples on multiple machine learning algorithms. Each sample in the several samples includes a set of historical corrosion influencing factor data and the corresponding corrosion rate label.

[0028] The plotting unit selects the two corrosion influencing factors with the highest correlation to the corrosion rate from among the corrosion influencing factors, and uses them and the set of corrosion rate prediction values ​​to plot the pipeline corrosion rate map.

[0029] The following are further optimizations and / or improvements to the above-mentioned technical solution:

[0030] The above drawing unit includes:

[0031] The correlation analysis module, based on the set of corrosion influencing factors and the set of corrosion rate prediction values, uses a correlation analysis algorithm to perform correlation analysis between each corrosion influencing factor and the corrosion rate, and obtains the correlation coefficient of each corrosion influencing factor.

[0032] The filtering module selects the two corrosion-influencing factors with the largest absolute values ​​of their correlation coefficients.

[0033] The partitioning module partitions the corrosion rate prediction values ​​in the corrosion rate prediction value set based on corrosion rate partitioning conditions.

[0034] The mapping module generates a pipeline corrosion rate map based on the partitioning results and the two corrosion influencing factors with the largest absolute values ​​of the correlation coefficient.

[0035] The aforementioned prediction unit includes:

[0036] The corrosion rate prediction model acquisition module includes:

[0037] Several samples were obtained and proportionally divided into a training sample set and a test sample set. Each sample included a set of historical corrosion influencing factors and a corresponding corrosion rate identifier. The historical corrosion influencing factors data set included temperature, H2S partial pressure, CO2 partial pressure, pipeline flow velocity, and Cl-. - Ion content, in-situ pH value;

[0038] Multiple machine learning algorithms are trained using a training sample set to obtain multiple prediction sub-models;

[0039] Each prediction sub-model is tested using a test sample set, and the test results of each prediction sub-model are evaluated based on regression model evaluation metrics.

[0040] The prediction sub-model with the best evaluation results was selected as the corrosion rate prediction model.

[0041] The corrosion rate prediction module inputs the set of corrosion influencing factors into the corrosion rate prediction model to obtain a set of corrosion rate prediction values.

[0042] The third technical solution of the present invention is achieved through the following measures: an electronic device, characterized in that it includes a processor and a memory, wherein the memory stores a computer program, and the computer program is loaded and executed by the processor to implement the steps in the method for drawing pipeline corrosion rate maps.

[0043] The fourth technical solution of the present invention is achieved through the following measures: a storage medium, characterized in that the storage medium stores a computer program that can be read by a computer, the computer program being configured to execute the steps in the pipeline corrosion rate map drawing method when running.

[0044] This invention fully considers various corrosion influencing factors related to pipeline corrosion rate. It uses data sets of corrosion influencing factors at multiple time points within a set time period of the pipeline to be predicted as input values ​​for corrosion rate prediction, thereby obtaining predicted corrosion rate values. Based on the richness of features, this effectively improves the accuracy of corrosion rate prediction. Furthermore, it selects the two corrosion influencing factors with the highest correlation to corrosion rate to create a corrosion rate map, thus intuitively reflecting the relationship between the two most correlated corrosion influencing factors and the corrosion rate. This provides valuable data support for monitoring pipeline corrosion levels, remaining service life, and safety protection, thereby effectively reducing pipeline failure rates and ensuring the normal transportation of oil and gas. Moreover, the corrosion rate prediction model used is the model with the highest prediction accuracy selected from multiple prediction sub-models obtained by training various machine learning algorithms on several samples. Therefore, it can further improve the accuracy of corrosion rate prediction and increase the flexibility and application scope of this invention. Attached Figure Description

[0045] Appendix Figure 1 This is a schematic diagram of the implementation environment provided for one embodiment of the present invention.

[0046] Appendix Figure 2 This is a schematic diagram of a pipeline corrosion rate mapping method provided in one embodiment of the present invention.

[0047] Appendix Figure 3 This is a schematic flowchart of a method for selecting corrosion influencing factors and plotting pipeline corrosion rate maps according to an embodiment of the present invention.

[0048] Appendix Figure 4 This is a schematic flowchart of a method for determining a corrosion rate prediction model according to an embodiment of the present invention.

[0049] Appendix Figure 5 Test results R of the SVM prediction sub-model provided in one embodiment of the present invention 2 A schematic diagram of the fitting of the evaluation results.

[0050] Appendix Figure 6 Test results R of the KNN prediction sub-model provided in one embodiment of the present invention 2 A schematic diagram of the fitting of the evaluation results.

[0051] Appendix Figure 7 Test results R of the GBDT prediction sub-model provided in one embodiment of the present invention 2 A schematic diagram of the fitting of the evaluation results.

[0052] Appendix Figure 8 Test results R of the RF prediction sub-model provided in one embodiment of the present invention 2 A schematic diagram of the fitting of the evaluation results.

[0053] Appendix Figure 9 This is a schematic diagram of a pipeline corrosion rate spectrum provided in one embodiment of the present invention.

[0054] Appendix Figure 10 This is a schematic diagram of a pipeline corrosion rate mapping device provided in one embodiment of the present invention. Detailed Implementation

[0055] The present invention is not limited to the following embodiments, and the specific implementation can be determined according to the technical solution of the present invention and the actual situation.

[0056] Those skilled in the art will understand that, unless specifically stated otherwise, in the embodiments of the present invention, a "module" or "unit" refers to a computer program or part of a computer program with a predetermined function, which works together with other related parts to achieve a predetermined goal, and can be implemented wholly or partially using software, hardware (such as processing circuitry or memory), or a combination thereof. Similarly, a processor (or multiple processors or memory) can be used to implement one or more modules or units. Furthermore, each module or unit can be part of an overall module or unit that includes the functionality of that module or unit.

[0057] In addition, in the embodiments of the present invention, "multiple" refers to two or more, and "first" and "second" are used to distinguish descriptions and should not be construed as implying relative importance.

[0058] This invention provides a method, apparatus, electronic device, and storage medium for plotting corrosion rate maps. The method acquires a set of corrosion influencing factors for a pipeline within a specified time period. This set of corrosion influencing factors includes multiple data groups, each containing temperature, H2S partial pressure, CO2 partial pressure, pipeline flow velocity, and Cl... - Ion content and in-situ pH value; input the set of corrosion influencing factors into the corrosion rate prediction model to obtain the set of corrosion rate prediction values, where the corrosion rate prediction model is the model with the highest prediction accuracy in the prediction model set; select the two corrosion influencing factors with the highest correlation to corrosion rate from the corrosion influencing factors, and use them and the set of corrosion rate prediction values ​​to draw the pipeline corrosion rate map.

[0059] The method provided in this embodiment of the invention may involve artificial intelligence (AI) technology and may be implemented based on artificial intelligence technology, such as using deep learning to train a corresponding model using samples.

[0060] Machine Learning (ML) is a multidisciplinary field involving probability theory, statistics, approximation theory, convex analysis, and algorithm complexity theory, among others. It specifically studies how computers can simulate or implement human learning behavior to acquire new knowledge or skills and reorganize existing knowledge structures to continuously improve their performance. Machine learning is the core of artificial intelligence and the fundamental way to endow computers with intelligence; its applications span all areas of artificial intelligence.

[0061] The aforementioned machine learning typically includes techniques such as neural networks, belief networks, reinforcement learning, transfer learning, inductive learning, and instructional learning.

[0062] As attached Figure 1The diagram illustrates an implementation environment provided by an embodiment of the present invention. This implementation environment may include: training equipment and usage equipment.

[0063] Both the training equipment and the equipment used are computer devices; optionally, the computer device is a terminal device, such as a mobile phone, tablet computer, PC (Personal Computer) or other electronic devices; or, the computer device is a server, which can be a single server, a server cluster composed of multiple servers, or a cloud computing service center. This embodiment of the invention does not limit this.

[0064] Training equipment refers to computer equipment with machine learning capabilities. Optionally, the training equipment has the ability to acquire machine learning algorithms and train and learn them according to application requirements. For example, the training equipment acquires machine learning algorithms from other devices via a network and then trains them with training samples according to application requirements, so that the machine learning algorithm has the ability to predict corrosion rates. Optionally, the training equipment has the ability to build machine learning algorithms. It can build machine learning algorithms on its own according to application requirements and then train and learn them. For example, in order to obtain corrosion rate prediction values ​​based on corrosion influencing factors, the training equipment builds its own machine learning algorithm and then trains and learns it with samples according to application requirements.

[0065] The device being used refers to a computer device that has the capability to use machine learning algorithms. Optionally, the device being used can acquire machine learning algorithms from other devices via the network according to application requirements. For example, if the device being used has the capability to predict corrosion rates, it can acquire machine learning algorithms that have been trained and learned to predict corrosion rates from other devices via the network, and then use these machine learning algorithms to predict corrosion rates.

[0066] Based on this, the technical solution of the present invention will be described and explained below with reference to several examples.

[0067] Example 1: As shown in the attached document Figure 2 As shown in the figure, an embodiment of the present invention discloses a method for drawing a pipeline corrosion rate map, including:

[0068] Step S110: Obtain the set of corrosion influencing factors for the pipeline to be predicted within a set time period. This set includes multiple corrosion influencing factor data groups, each containing temperature, H2S partial pressure, CO2 partial pressure, pipeline flow velocity, and Cl... - Ion content, in-situ pH value.

[0069] In this embodiment, the factors affecting pipeline corrosion rate are analyzed based on field measurement data from oil and gas fields, laboratory simulation test data, and reference data to determine the types of corrosion influencing factors required for prediction.

[0070] In this embodiment, the set of corrosion influencing factors for the pipeline to be predicted within a set time period is obtained. This means collecting corrosion influencing factors at various time points within the set time period according to the set time interval, forming a corrosion influencing factor data group. All corrosion influencing factor data groups within the set time period constitute the corrosion influencing factor set.

[0071] Step S120: Input the set of corrosion influencing factors into the corrosion rate prediction model to obtain a set of corrosion rate prediction values. The corrosion rate prediction model is the model with the highest prediction accuracy in the prediction model set. The prediction model set includes multiple prediction sub-models. Each prediction sub-model is trained using several samples on multiple machine learning algorithms. Each sample in the sample set includes a set of historical corrosion influencing factor data and the corresponding corrosion rate identifier.

[0072] Step S130: Select the two corrosion influencing factors that have the highest correlation with the corrosion rate from the corrosion influencing factors, and use them and the corrosion rate prediction value set to draw the pipeline corrosion rate map.

[0073] This invention discloses a method for plotting pipeline corrosion rate maps. It fully considers various corrosion influencing factors related to pipeline corrosion rate, using data sets of corrosion influencing factors at multiple time points within a set time period as input values ​​for corrosion rate prediction. This yields predicted corrosion rate values, effectively improving the accuracy of corrosion rate prediction based on the richness of features. Furthermore, it selects the two corrosion influencing factors with the highest correlation to corrosion rate for corrosion rate map plotting, thus intuitively reflecting the relationship between the two most correlated corrosion influencing factors and the corrosion rate. This provides valuable data support for monitoring pipeline corrosion levels, remaining service life, and safety protection, thereby effectively reducing pipeline failure rates and ensuring the normal transportation of oil and gas.

[0074] It should also be noted that the corrosion rate prediction model used in this invention is the model with the highest prediction accuracy selected from multiple prediction sub-models obtained by training various machine learning algorithms with several samples. Therefore, it can further improve the accuracy of corrosion rate prediction and increase the flexibility and application scope of this invention.

[0075] Example 2: As shown in the attached document Figure 3As shown, this embodiment of the invention is a further optimization of the above embodiment, wherein the two corrosion influencing factors with the highest correlation to the corrosion rate are selected from the corrosion influencing factors, and a pipeline corrosion rate map is drawn using them and the corrosion rate prediction value set, including:

[0076] Step S210: Based on the set of corrosion influencing factors and the set of corrosion rate prediction values, a correlation analysis algorithm is used to perform correlation analysis between each corrosion influencing factor and the corrosion rate to obtain the correlation coefficient of each corrosion influencing factor.

[0077] The correlation analysis algorithm used in this step can be selected according to the needs, and may include, but is not limited to, the Spearman correlation coefficient.

[0078] Step S220: Select the two corrosion influencing factors with the largest absolute value of the correlation coefficient.

[0079] The larger the absolute value of the correlation coefficient in this step, the higher the correlation between the corresponding corrosion influencing factor and the corrosion rate. Therefore, in order to facilitate the drawing, the two corrosion influencing factors with the largest absolute values ​​of the correlation coefficient are selected for the subsequent drawing of the pipeline corrosion rate map in this embodiment of the invention.

[0080] Step S230: The corrosion rate prediction values ​​in the corrosion rate prediction value set are partitioned based on the corrosion rate partitioning conditions.

[0081] In this step, the corrosion rate partitioning condition is multiple corrosion rate prediction value intervals, and each corrosion rate prediction value interval corresponds to a corrosion rate zone.

[0082] Step S240: Draw a corrosion rate map of the pipeline based on the partitioning results and the two corrosion influencing factors with the largest absolute values ​​of the correlation coefficient.

[0083] The pipeline corrosion rate map obtained in this step is the two corrosion influencing factors with the largest absolute values ​​of the correlation coefficient on the horizontal and vertical axes, respectively, and the area between the horizontal and vertical axes is the corrosion rate zoning result.

[0084] Example 3: As shown in the attached document Figure 4 As shown, the embodiments of the present invention are further optimizations of the above embodiments, wherein determining the corrosion rate prediction model includes:

[0085] Step S310: Obtain several samples and divide them into a training sample set and a test sample set according to a certain ratio. Each sample in the set includes a historical corrosion influencing factor data group and a corresponding corrosion rate identifier. The historical corrosion influencing factor data group includes temperature, H2S partial pressure, CO2 partial pressure, pipeline flow velocity, Cl... - Ion content, in-situ pH value.

[0086] In this step, samples are obtained from data such as on-site measured data of oil and gas fields, laboratory simulation test data, and reference data. After obtaining a number of samples, the samples are preprocessed, and samples that do not meet the acquisition range conditions are deleted. The acquisition range conditions are determined according to the range values of effective corrosion influencing factors. In this embodiment, it may include 20°C < temperature < 100°C, 0 kPa < H2S partial pressure < 1600 kPa, 0 MPa < CO2 partial pressure < 3.5 MPa, 0 m / s < flow velocity < 3 m / s, 55 mg / L < Cl - content < 150000 mg / L, 3 < in-situ pH value < 7.

[0087] Step S320: Use the training sample set to train multiple machine learning algorithms respectively to obtain multiple prediction submodels.

[0088] In this step, multiple machine learning algorithms can include but are not limited to the K-nearest neighbor algorithm, support vector machine algorithm, gradient boosting decision tree algorithm, and random forest algorithm.

[0089] During specific training, hyperparameter optimization needs to be performed on each machine learning algorithm. The hyperparameter optimization method in this embodiment can include but is not limited to grid search. The basic principle of grid search is to define a parameter grid, each parameter has multiple possible values, traverse all combinations of parameters, perform model training and evaluation on each combination, and finally select the parameter combination with the best performance.

[0090] The hyperparameters that need to be optimized in each machine learning algorithm of this embodiment are as follows:

[0091] Hyperparameter optimization of the K-nearest neighbor algorithm: the nearest neighbor number K and distance metric.

[0092] Hyperparameter optimization of the support vector machine algorithm: the penalty coefficient C and the parameter gamma自带 by the Gaussian radial basis function.

[0093] Hyperparameter optimization of the gradient boosting decision tree algorithm: subsampling ratio subsample, maximum number of iterations n_estimators of weak learners, and weight reduction coefficient learning_rate of each weak learner.

[0094] Hyperparameter optimization of the random forest algorithm: number of decision trees n_estimators, P, and minimum number of samples min_samples_leaf at leaf nodes.

[0095] Step S330: Use the test sample set to test each prediction submodel and evaluate the test results of each prediction submodel based on regression model evaluation metrics.

[0096] In this step, the evaluation metrics of the regression model include the mean absolute percentage error (MARE), the root mean square error (RMSE), and the coefficient of determination (R 2 ), and the specific analysis formulas are as follows. The smaller the MAPE and RMSE are, the better the model prediction result. The closer the R 2 (value range [0, 1]) is to 1, the better the prediction result of the algorithm model;

[0097]

[0098] Among them, y i is the experimental value, is the predicted value, is the average value of the experimental values.

[0099] Step S340: Select the prediction sub-model with the best evaluation result as the corrosion rate prediction model.

[0100] When selecting the prediction sub-model with the best evaluation result in this step, one regression model evaluation metric or multiple regression model evaluation metrics can be selected for comprehensive analysis.

[0101] Example 4: Introduce a specific example to illustrate the pipeline corrosion rate map drawing method disclosed in the present invention as follows:

[0102] (1) Obtain a number of samples, and divide the samples into a training sample set and a test sample set according to a ratio of 4:1. The acquisition range conditions are set as 20°C < temperature < 100°C, 0 kPa < H2S partial pressure < 1600 kPa, 0 MPa < CO2 partial pressure < 3.5 MPa, 0 m / s < flow rate < 3 m / s, 55 mg / L < Cl - content < 150000 mg / L, 3 < in-situ pH value < 7, 72 h < experimental period < 360 h. The samples are shown in Table 1:

[0103] Table 1 Sample data table

[0104]

[0105]

[0106]

[0107]

[0108] (2) Use the training sample set to train multiple machine learning algorithms respectively to obtain multiple prediction sub-models. The hyperparameter optimization results obtained after optimizing the hyperparameters of the machine learning algorithms using grid search are as follows:

[0109] K-Nearest Neighbors (KNN) algorithm hyperparameter optimization: Select 2 for the number of neighbors K and 5 for the distance metric.

[0110] Optimization of hyperparameters for Support Vector Machine (SVM) algorithm: The penalty parameter C is set to 4250, and the gamma parameter of the Gaussian radial basis function is set to 0.0001.

[0111] Optimization of hyperparameters for Gradient Boosting Decision Tree (GBDT) algorithm: The maximum number of iterations is set to 20, the subsampling ratio is set to 0.6, and the weight reduction factor learning_rate is set to 0.2.

[0112] Random Forest (RF) algorithm hyperparameter optimization: The maximum number of iterations is set to 10, and the minimum sample size of leaf nodes (min_samples_leaf) is set to 2.

[0113] (3) Each prediction sub-model was tested using the test sample set, and the test results of each prediction sub-model were evaluated based on the regression model evaluation index. The evaluation results are shown in Table 2 and Appendix 3. Figure 5 , 6 As shown in Figures 7 and 8.

[0114] Table 2. Errors between the predictions and actual values ​​of the four models (Mean Absolute Percentage Error (MARE))

[0115]

[0116]

[0117] As can be seen from Table 2, for the 20 sets of data in the test set, the RF prediction sub-model has the smallest average error, at only 0.298, followed by the KNN prediction sub-model with an average error of 0.317. The GBDT prediction sub-model and the SVM prediction sub-model have slightly larger average errors, at 0.594 and 0.619, respectively.

[0118] From the appendix Figure 5 , 6 As can be seen from Figures 7 and 8, the fitted RF prediction sub-model has a high R-value for the test set. 2 For best results, R 2 The R-value reached 0.988 for both the GBDT prediction sub-model and the KNN prediction sub-model. 2 The scores were 0.942 and 0.911 respectively, indicating that the SVM model performed the worst in predicting the test set. 2 It is 0.851.

[0119] (4) The applicability ranking of the four prediction sub-models based on Mean Absolute Percentage Error (MARE) is: RF > KNN > SVM > GBDT. Based on R...2 The applicability ranking of the four prediction sub-models is: RF > GBDT > KNN > SVM. Therefore, this embodiment selects the prediction sub-model trained with RF as the corrosion rate prediction model.

[0120] (5) Obtain the set of corrosion influencing factors for the pipeline to be predicted within a set time period, input the set of corrosion influencing factors into the corrosion rate prediction model, and obtain the set of corrosion rate prediction values.

[0121] (6) Select the two corrosion influencing factors that have the highest correlation with the corrosion rate, namely temperature and pH value;

[0122] (7) Determine the corrosion rate partitioning conditions, and partition the corrosion rate prediction values ​​in the corrosion rate prediction value set based on the corrosion rate partitioning conditions, wherein the corrosion rate partitioning conditions are as follows:

[0123] The corrosion rate in Zone I is greater than 0.5 mm / y, the corrosion rate in Zone II is 0.5 mm / y to 0.4 mm / y, the corrosion rate in Zone III is 0.4 mm / y to 0.3 mm / y, the corrosion rate in Zone IV is 0.3 mm / y to 0.2 mm / y, the corrosion rate in Zone V is 0.2 mm / y to 0.1 mm / y, the corrosion rate in Zone VI is 0.1 mm / y to 0.05 mm / y, and the corrosion rate in Zone VII is less than 0.05 mm / y.

[0124] (8) Based on the zoning results and the two corrosion influencing factors with the largest absolute values ​​of correlation coefficients, a pipeline corrosion rate map was plotted, as shown in the appendix. Figure 9 As shown.

[0125] The resulting pipeline corrosion rate map is clear and concise, and can intuitively reflect the pipeline corrosion rate under different operating conditions, providing useful data support for the degree of pipeline corrosion, remaining service life, and safety protection.

[0126] Example 5, as shown in the appendix Figure 10 As shown, an embodiment of the present invention discloses a device for plotting pipeline corrosion rate maps, comprising:

[0127] The data acquisition unit acquires a set of corrosion influencing factors for the pipeline within a specified time period. This set includes multiple data groups for each corrosion influencing factor, with each group containing data on temperature, H2S partial pressure, CO2 partial pressure, pipeline flow velocity, and Cl-. - Ion content, in-situ pH value;

[0128] The prediction unit inputs the set of corrosion influencing factors into the corrosion rate prediction model to obtain a set of corrosion rate prediction values. The corrosion rate prediction model is the model with the highest prediction accuracy in the prediction model set. The prediction model set includes multiple prediction sub-models. Each prediction sub-model is trained using several samples on multiple machine learning algorithms. Each sample in the several samples includes a set of historical corrosion influencing factor data and the corresponding corrosion rate label.

[0129] The plotting unit selects the two corrosion influencing factors with the highest correlation to the corrosion rate from among the corrosion influencing factors, and uses them and the set of corrosion rate prediction values ​​to plot the pipeline corrosion rate map.

[0130] The drawing unit includes:

[0131] The correlation analysis module, based on the set of corrosion influencing factors and the set of corrosion rate prediction values, uses a correlation analysis algorithm to perform correlation analysis between each corrosion influencing factor and the corrosion rate, and obtains the correlation coefficient of each corrosion influencing factor.

[0132] The filtering module selects the two corrosion-influencing factors with the largest absolute values ​​of their correlation coefficients.

[0133] The partitioning module partitions the corrosion rate prediction values ​​in the corrosion rate prediction value set based on corrosion rate partitioning conditions.

[0134] The mapping module generates a pipeline corrosion rate map based on the partitioning results and the two corrosion influencing factors with the largest absolute values ​​of the correlation coefficient.

[0135] The prediction unit includes:

[0136] The corrosion rate prediction model acquisition module includes:

[0137] Several samples were obtained and proportionally divided into a training sample set and a test sample set. Each sample included a set of historical corrosion influencing factors and a corresponding corrosion rate identifier. The historical corrosion influencing factors data set included temperature, H2S partial pressure, CO2 partial pressure, pipeline flow velocity, and Cl-. - Ion content, in-situ pH value;

[0138] Multiple machine learning algorithms are trained using a training sample set to obtain multiple prediction sub-models;

[0139] Each prediction sub-model is tested using a test sample set, and the test results of each prediction sub-model are evaluated based on regression model evaluation metrics.

[0140] The prediction sub-model with the best evaluation results was selected as the corrosion rate prediction model.

[0141] The corrosion rate prediction module inputs the set of corrosion influencing factors into the corrosion rate prediction model to obtain a set of corrosion rate prediction values.

[0142] The specific implementation steps of each unit / module in this embodiment are the same as those in Embodiments 1 to 4, so they will not be repeated here.

[0143] Example 6: This embodiment of the invention discloses a storage medium storing a computer program that can be read by a computer. The computer program is configured to execute a method for drawing pipeline corrosion rate maps when it runs.

[0144] The aforementioned storage media may include, but are not limited to, USB flash drives, read-only memory, portable hard drives, magnetic disks, optical disks, and other media capable of storing computer programs.

[0145] Example 7: This embodiment of the invention discloses an electronic device, including a processor and a memory. The memory stores a computer program, which is loaded and executed by the processor to implement a method for drawing pipeline corrosion rate maps.

[0146] The processor described above can be a central processing unit (CPU), a general-purpose processor, a digital signal processor (DSP), an ASIC, an FPGA, or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It can implement or execute the various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of this invention. It can also be a combination that implements computational functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, etc. The memory can include, but is not limited to, various media capable of storing computer programs, such as USB flash drives, read-only memory, portable hard drives, magnetic disks, or optical disks.

[0147] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code. The solutions in the embodiments of the present invention can be implemented using various computer languages, such as the object-oriented programming language Java and the interpreted scripting language JavaScript.

[0148] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0149] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0150] The above content is only a specific embodiment of the present invention, which has strong adaptability and implementation effect. However, the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be covered within the protection scope of the present invention. Therefore, equivalent changes made in accordance with the claims of the present invention are still within the scope of the present invention.

Claims

1. A method for plotting pipeline corrosion rate maps, characterized in that, include: Obtain the set of corrosion influencing factors for the pipeline to be predicted within a specified time period. This set includes multiple corrosion influencing factor data groups, each containing temperature, H2S partial pressure, CO2 partial pressure, pipeline flow velocity, and Cl-. - Ion content, in-situ pH value; The set of corrosion influencing factors is input into the corrosion rate prediction model to obtain a set of corrosion rate prediction values. The corrosion rate prediction model is the model with the highest prediction accuracy in the prediction model set. The prediction model set includes multiple prediction sub-models. Each prediction sub-model is trained using several samples on multiple machine learning algorithms. Each sample in the sample set includes a set of historical corrosion influencing factor data and the corresponding corrosion rate label. Among the factors affecting corrosion, the two factors with the highest correlation to corrosion rate were selected, and a corrosion rate map of the pipeline was drawn using the combination of the two factors and the predicted corrosion rate values.

2. The method for plotting pipeline corrosion rate maps according to claim 1, characterized in that, The process of selecting the two corrosion influencing factors with the highest correlation to the corrosion rate from among the corrosion influencing factors, and using them and the set of predicted corrosion rate values ​​to draw a pipeline corrosion rate map, includes: Based on the set of corrosion influencing factors and the set of corrosion rate prediction values, a correlation analysis algorithm is used to analyze the correlation between each corrosion influencing factor and the corrosion rate, and the correlation coefficient of each corrosion influencing factor is obtained. Select the two corrosion-influencing factors with the largest absolute values ​​of their correlation coefficients; The corrosion rate prediction values ​​in the corrosion rate prediction value set are partitioned based on the corrosion rate partitioning conditions. A pipeline corrosion rate map was drawn based on the partitioning results and the two corrosion influencing factors with the largest absolute values ​​of the correlation coefficient.

3. The method for plotting pipeline corrosion rate maps according to claim 1 or 2, characterized in that, The corrosion rate prediction model includes: Several samples were obtained and proportionally divided into a training sample set and a test sample set. Each sample included a set of historical corrosion influencing factors and a corresponding corrosion rate identifier. The historical corrosion influencing factors data set included temperature, H2S partial pressure, CO2 partial pressure, pipeline flow velocity, and Cl-. - Ion content, in-situ pH value; Multiple machine learning algorithms are trained using a training sample set to obtain multiple prediction sub-models; Each prediction sub-model is tested using a test sample set, and the test results of each prediction sub-model are evaluated based on regression model evaluation metrics. The prediction sub-model with the best evaluation results was selected as the corrosion rate prediction model.

4. The method for plotting pipeline corrosion rate maps according to claim 3, characterized in that, When training multiple machine learning algorithms using the training sample set, grid search is used to optimize the hyperparameters of the machine learning algorithms.

5. The method for plotting pipeline corrosion rate maps according to claim 3 or 4, characterized in that, When obtaining a number of samples, each corrosion influencing factor in the historical corrosion influencing factor data group needs to meet the corresponding acquisition range conditions, where the acquisition range conditions include 20°C < temperature < 100°C, 0 kPa < H2S partial pressure < 1600 kPa, 0 MPa < CO2 partial pressure < 3.5 MPa, 0 m / s < flow velocity < 3 m / s, 55 mg / L < Cl - content < 150000 mg / L, 3 < in-situ pH value < 7.

6. The method for plotting pipeline corrosion rate maps according to any one of claims 1 to 5, characterized in that, The various machine learning algorithms include K-nearest neighbors, support vector machine, gradient boosting decision tree, and random forest.

7. A device for plotting pipeline corrosion rate maps using the method described in any one of claims 1 to 6, characterized in that, include: The data acquisition unit acquires a set of corrosion influencing factors for the pipeline within a specified time period. This set includes multiple data groups for each corrosion influencing factor, with each group containing data on temperature, H2S partial pressure, CO2 partial pressure, pipeline flow velocity, and Cl-. - Ion content, in-situ pH value; The prediction unit inputs the set of corrosion influencing factors into the corrosion rate prediction model to obtain a set of corrosion rate prediction values. The corrosion rate prediction model is the model with the highest prediction accuracy in the prediction model set. The prediction model set includes multiple prediction sub-models. Each prediction sub-model is trained using several samples on multiple machine learning algorithms. Each sample in the several samples includes a set of historical corrosion influencing factor data and the corresponding corrosion rate label. The plotting unit selects the two corrosion influencing factors with the highest correlation to the corrosion rate from among the corrosion influencing factors, and uses them and the set of corrosion rate prediction values ​​to plot the pipeline corrosion rate map.

8. The pipeline corrosion rate mapping device according to claim 7, characterized in that, The drawing unit includes: The correlation analysis module, based on the set of corrosion influencing factors and the set of corrosion rate prediction values, uses a correlation analysis algorithm to perform correlation analysis between each corrosion influencing factor and the corrosion rate, and obtains the correlation coefficient of each corrosion influencing factor. The filtering module selects the two corrosion-influencing factors with the largest absolute values ​​of their correlation coefficients. The partitioning module partitions the corrosion rate prediction values ​​in the corrosion rate prediction value set based on corrosion rate partitioning conditions. The mapping module generates a pipeline corrosion rate map based on the partitioning results and the two corrosion influencing factors with the largest absolute values ​​of the correlation coefficient. or / and, The prediction unit includes: The corrosion rate prediction model acquisition module includes: Several samples were obtained and proportionally divided into a training sample set and a test sample set. Each sample included a set of historical corrosion influencing factors and a corresponding corrosion rate identifier. The historical corrosion influencing factors data set included temperature, H2S partial pressure, CO2 partial pressure, pipeline flow velocity, and Cl-. - Ion content, in-situ pH value; Multiple machine learning algorithms are trained using a training sample set to obtain multiple prediction sub-models; Each prediction sub-model is tested using a test sample set, and the test results of each prediction sub-model are evaluated based on regression model evaluation metrics. The prediction sub-model with the best evaluation results was selected as the corrosion rate prediction model. The corrosion rate prediction module inputs the set of corrosion influencing factors into the corrosion rate prediction model to obtain a set of corrosion rate prediction values.

9. An electronic device, characterized in that, It includes a processor and a memory, wherein the memory stores a computer program, which is loaded and executed by the processor to implement the steps of the method as claimed in any one of claims 1 to 6.

10. A storage medium, characterized in that, The storage medium stores a computer program that can be read by a computer, the computer program being configured to execute the steps of the method as described in any one of claims 1 to 6 when it is run.