Prediction method and device for external corrosion depth of pipeline, electronic equipment and storage medium

CN118897943APending Publication Date: 2024-11-05CHINA PETROLEUM & CHEMICAL CORP +2
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310486169.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-05-04
Publication Date
2024-11-05

AI Technical Summary

Technical Problem

[0005]本发明提供一种管道外腐蚀深度的预测方法、装置、电子设备及存储介质,用以解决现有技术中实测的方法效率低下,且具有很大的局限性,对于不同土壤腐蚀因素的情况下试验结果不具有普适性,且当土壤因素随着季节等情况变化时,无法判断主导因素的影响的问题

Benefits of technology

[0026] The present invention also provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the computer program implements any one of the above methods for predicting the corrosion depth outside the pipeline.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118897943A_ABST
    Figure CN118897943A_ABST
Patent Text Reader

Abstract

The invention provides a method and a device for predicting the external corrosion depth of a pipeline, electronic equipment and a storage medium. The method comprises the following steps: acquiring soil index data corresponding to a to-be-predicted pipeline; on the basis of a corrosion depth prediction model and soil index data, performing pipeline external corrosion depth prediction on the to-be-predicted pipeline; the corrosion depth prediction model is obtained by training based on sample soil index data corresponding to a sample pipeline and the label external corrosion depth of the sample pipeline. According to the method, the device, the electronic equipment and the storage medium provided by the invention, the accuracy and the reliability of predicting the external corrosion depth of the pipeline are improved, and the method does not need to calculate the corrosion rate by actually measuring and observing the corrosion condition, so that the test time of predicting the external corrosion rate of the pipeline is greatly shortened, and the efficiency of predicting the external corrosion rate of the pipeline is improved. And prediction results under the condition of different soil corrosion factors have universality, and the application range of pipeline external corrosion depth prediction can be widened.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of pipeline safety evaluation, and in particular to a method, device, electronic equipment and storage medium for predicting pipeline external corrosion depth. Background Art

[0002] Soil corrosion is the main cause of external corrosion of long-distance pipelines. Due to its different components and characteristics, it causes corrosion on the outer surface of pipeline materials. Soil is a complex system composed of solid, liquid and gas multiphase substances, inhabited by various microorganisms, and often disturbed by stray currents; it is also a colloidal system with electrolytic solution characteristics (ionic conductivity), an electrolyte (conductive medium), which can cause electrochemical corrosion, and the various salts and organic matter it contains can also cause chemical corrosion of pipelines. Because it has multiple physical properties such as water content, porosity, and particle size, and the movement speed of electrolyte ions through the soil is affected by the different resistance changes caused by soil diversity, it leads to the variability of electrochemical reaction speed and the randomness of soil corrosion cells.

[0003] In the prior art, the impact of soil on the external corrosion rate of pipelines is mostly evaluated through the hanging test method, that is, a specific point is selected to bury the raw material sample of the pipe, and the corrosion rate is calculated by observing the corrosion situation after a certain period of time (1-2 years or longer).

[0004] However, this field measurement method is inefficient and has great limitations. The test results are not universal for different soil corrosion factors, and when soil factors change with seasons and other conditions, it is impossible to determine the influence of the dominant factors. Summary of the invention

[0005] The present invention provides a method, device, electronic device and storage medium for predicting the external corrosion depth of a pipeline, so as to solve the problems that the actual measurement method in the prior art is inefficient and has great limitations, the test results are not universal under different soil corrosion factors, and when the soil factors change with the seasons and other conditions, the influence of the dominant factors cannot be determined.

[0006] The present invention provides a method for predicting the external corrosion depth of a pipeline, comprising:

[0007] Obtain soil index data corresponding to the pipeline to be predicted;

[0008] Based on the corrosion depth prediction model and the soil index data, predicting the external corrosion depth of the pipeline to be predicted;

[0009] The corrosion depth prediction model is trained based on sample soil indicator data corresponding to the sample pipeline and the off-label corrosion depth of the sample pipeline.

[0010] According to a method for predicting the external corrosion depth of a pipeline provided by the present invention, the training steps of the corrosion depth prediction model include:

[0011] Inputting the sample soil index data corresponding to the sample pipeline into the initial depth prediction model to obtain the predicted external corrosion depth of the sample pipeline output by the initial depth prediction model;

[0012] Based on the difference between the predicted external corrosion depth and the labeled external corrosion depth, the objective function of the multi-objective optimization algorithm is determined, and based on the objective function and the multi-objective optimization algorithm, the initial depth prediction model is iterated to obtain the corrosion depth prediction model.

[0013] According to a method for predicting the external corrosion depth of a pipeline provided by the present invention, the objective function is determined based on the difference between the predicted external corrosion depth and the labeled external corrosion depth, including:

[0014] Based on the difference between the predicted outer corrosion depth and the labeled outer corrosion depth, a mean square error loss and a standard deviation loss are determined, and the mean square error loss and the standard deviation loss are used as objective functions of the multi-objective optimization algorithm.

[0015] According to a method for predicting the external corrosion depth of a pipeline provided by the present invention, the corrosion depth prediction model is obtained, and then the method further includes:

[0016] Based on the test soil index data and the test external corrosion depth corresponding to the test pipeline, the corrosion depth prediction model is tested.

[0017] According to a method for predicting pipeline external corrosion depth provided by the present invention, the multi-objective optimization algorithm is a multi-objective slime mold algorithm.

[0018] According to a method for predicting the external corrosion depth of a pipeline provided by the present invention, the corrosion depth prediction model is a support vector regression model.

[0019] According to a method for predicting the external corrosion depth of a pipeline provided by the present invention, the soil index data includes soil pH data, oxidation-reduction potential data, soil resistivity data, soil moisture content data, bulk density data, dissolved chloride data, carbonate ion concentration data, sulfate ion concentration data and soil potential data.

[0020] The present invention also provides a device for predicting the external corrosion depth of a pipeline, comprising:

[0021] An acquisition unit, used for acquiring soil index data corresponding to the pipeline to be predicted;

[0022] An external corrosion depth prediction unit, used to predict the external corrosion depth of the pipeline to be predicted based on the corrosion depth prediction model and the soil index data;

[0023] The corrosion depth prediction model is trained based on sample soil indicator data corresponding to the sample pipeline and the off-label corrosion depth of the sample pipeline.

[0024] The present invention also provides an electronic device, comprising a memory, a processor and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the method for predicting the external corrosion depth of a pipeline as described above is implemented.

[0025] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the method for predicting the external corrosion depth of a pipeline as described in any one of the above is implemented.

[0026] The present invention also provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the method for predicting the external corrosion depth of a pipeline as described above is implemented.

[0027] The method, device, electronic device and storage medium for predicting the external corrosion depth of a pipeline provided by the present invention obtain soil index data corresponding to the pipeline to be predicted, and predict the external corrosion depth of the pipeline to be predicted based on a corrosion depth prediction model and the soil index data. The corrosion depth prediction model is obtained by training based on sample soil index data corresponding to the sample pipeline and the labeled external corrosion depth of the sample pipeline, thereby improving the accuracy and reliability of the prediction of the external corrosion depth of the pipeline, and the method does not need to calculate the corrosion rate by observing the corrosion condition through actual measurement, which greatly reduces the test time of the prediction of the external corrosion rate of the pipeline, improves the efficiency of the prediction of the external corrosion rate of the pipeline, and the prediction results are universal under different soil corrosion factors, which helps to broaden the application scope of the prediction of the external corrosion depth of the pipeline. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0029] Figure 1 This is one of the flow diagrams of the method for predicting the pipeline external corrosion depth provided by the present invention;

[0030] Figure 2It is a schematic diagram of the process of training the corrosion depth prediction model provided by the present invention;

[0031] Figure 3 This is the second flow chart of the method for predicting the pipeline external corrosion depth provided by the present invention;

[0032] Figure 4 It is a schematic diagram of the structure of the device for predicting the external corrosion depth of a pipeline provided by the present invention;

[0033] Figure 5 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION

[0034] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0035] The terms "first", "second", etc. in the specification and claims of the present invention are used to distinguish similar objects, rather than to describe a specific order or precedence. It should be understood that the terms used in this way can be interchangeable where appropriate, so that the embodiments of the present application can be implemented in an order other than those illustrated or described herein, and the objects distinguished by "first", "second", etc. are generally of the same type.

[0036] In the relevant technology, the main characteristics of soil corrosion are: regionality and unevenness, colloid and multiphase, conductivity and porosity, and relative fixity. The corrosion of soil on long-distance pipelines is mainly electrochemical corrosion, followed by local corrosion of pipelines caused by stray currents. Due to the wide geographical area and long distance of long-distance pipelines, the soil properties, soil types and environmental conditions in different regions are also different, resulting in different corrosion speeds and degrees. In addition, the uneven corrosion along the buried direction of the pipeline will also deepen the electrochemical corrosion of the soil on the pipeline.

[0037] In the prior art, the impact of soil on the external corrosion rate of pipelines is mostly evaluated through the hanging test method, that is, a specific point is selected to bury the raw material sample of the pipe, and the corrosion rate is calculated by observing the corrosion situation after a certain period of time (1-2 years or longer).

[0038] However, this field measurement method is inefficient and has great limitations. The test results are not universal for different soil corrosion factors, and when soil factors change with seasons and other conditions, it is impossible to determine the influence of the dominant factors.

[0039] Based on the above problems, the present invention provides a method for predicting the corrosion depth of pipeline exterior. Figure 1 This is one of the flow diagrams of the method for predicting the external corrosion depth of a pipeline provided by the present invention, such as Figure 1 As shown, the method includes:

[0040] Step 110, obtaining soil index data corresponding to the pipeline to be predicted.

[0041] Specifically, the soil index data corresponding to the pipeline to be predicted can be obtained. The pipeline to be predicted here is the pipeline for which the external corrosion depth of the pipeline needs to be predicted later. The soil index data corresponding to the pipeline to be predicted here refers to the soil index data corresponding to the soil where the pipeline to be predicted is currently located. The soil index data may include soil pH (PH) data, oxidation-reduction potential (PP) data, soil resistivity (RE) data, soil water content (WC) data, bulk density (BD) data, dissolved chloride (CC) data, carbonate ion concentration (BC) data, sulfate ion concentration (SC) data and soil potential (RP) data.

[0042] Step 120, predicting the external corrosion depth of the pipeline to be predicted based on the corrosion depth prediction model and the soil index data;

[0043] The corrosion depth prediction model is trained based on sample soil indicator data corresponding to the sample pipeline and the off-label corrosion depth of the sample pipeline.

[0044] Specifically, after obtaining the soil index data corresponding to the pipeline to be predicted, in order to be able to predict the external corrosion depth of the pipeline to be predicted, it is necessary to obtain a corrosion depth prediction model through the following steps before step 120:

[0045] The sample soil index data corresponding to the sample pipeline and the off-label corrosion depth of the sample pipeline can be collected in advance, and an initial depth prediction model can be pre-constructed. The parameters of the initial depth prediction model here can be pre-set or randomly generated, and the embodiment of the present invention does not specifically limit this.

[0046] Subsequently, the initial depth prediction model can be trained based on the sample soil indicator data corresponding to the sample pipeline and the off-label corrosion depth of the sample pipeline, and the initial depth prediction model after training is used as the corrosion depth prediction model.

[0047] The initial depth prediction model here can be a support vector regression (SVR) model, a random forest regression (RFR) model, or a linear regression (LR) model, etc., which is not specifically limited in the embodiment of the present invention. In addition, the initial depth prediction model can be obtained by pre-training.

[0048] First, the sample soil index data corresponding to the sample pipeline can be input into the initial depth prediction model, and the initial depth prediction model outputs the prediction result of the external corrosion depth of the sample pipeline.

[0049] After outputting the prediction result of the external corrosion depth of the sample pipeline based on the initial depth prediction model, the prediction result of the external corrosion depth of the sample pipeline can be compared with the pre-collected external corrosion depth of the label of the sample pipeline, and the fitness value of the slime mold individual can be calculated according to the degree of difference between the two. The initial depth prediction model is iterated based on the fitness value, and the initial depth prediction model after the parameter iteration is recorded as the corrosion depth prediction model.

[0050] It can be understood that the greater the difference between the predicted result of the external corrosion depth of the sample pipeline and the labeled external corrosion depth of the sample pipeline collected in advance, the greater the fitness value; the smaller the difference between the predicted result of the external corrosion depth of the sample pipeline and the labeled external corrosion depth of the sample pipeline collected in advance, the smaller the fitness value.

[0051] That is, during the training of the initial depth prediction model, the ability to predict the corrosion depth outside the pipeline was learned.

[0052] The method provided by the embodiment of the present invention obtains soil index data corresponding to the pipeline to be predicted, and predicts the external corrosion depth of the pipeline to be predicted based on the corrosion depth prediction model and the soil index data. The corrosion depth prediction model is obtained by training based on the sample soil index data corresponding to the sample pipeline and the labeled external corrosion depth of the sample pipeline. Therefore, the accuracy and reliability of the prediction of the external corrosion depth of the pipeline are improved. In addition, the method does not need to calculate the corrosion rate by observing the corrosion situation through actual measurement, which greatly reduces the test time of the prediction of the external corrosion rate of the pipeline, improves the efficiency of the prediction of the external corrosion rate of the pipeline, and the prediction results are universal under different soil corrosion factors, which helps to broaden the application scope of the prediction of the external corrosion depth of the pipeline.

[0053] Based on the above embodiment, the training step of the corrosion depth prediction model includes:

[0054] Step 210, inputting the sample soil index data corresponding to the sample pipeline into the initial depth prediction model to obtain the predicted external corrosion depth of the sample pipeline output by the initial depth prediction model;

[0055] Step 220, based on the difference between the predicted external corrosion depth and the labeled external corrosion depth, determine the objective function of the multi-objective optimization algorithm, and iterate the parameters of the initial depth prediction model based on the objective function and the multi-objective optimization algorithm to obtain the corrosion depth prediction model.

[0056] Specifically, before obtaining the corrosion depth prediction model, the sample soil index data corresponding to the sample pipeline can be input into the initial depth prediction model in advance to obtain the predicted external corrosion depth of the sample pipeline output by the initial depth prediction model. After obtaining the predicted external corrosion depth of the sample pipeline output by the initial depth prediction model, the objective function can be determined based on the difference between the predicted external corrosion depth and the labeled external corrosion depth.

[0057] It can be understood that the greater the difference between the predicted external corrosion depth and the labeled external corrosion depth, the greater the objective function value; the smaller the difference between the predicted external corrosion depth and the labeled external corrosion depth, the smaller the objective function value.

[0058] In addition, the sample soil index data corresponding to the sample pipeline and the label corrosion depth (d max (mm)) can constitute a corrosion data set, where part of the corrosion data set is shown in Table 1.

[0059] Table 1. Corrosion data set (partially shown)

[0060]

[0061] Figure 2 FIG. 1 is a flow chart of the corrosion depth prediction model training provided by the present invention, such as Figure 2 As shown in the figure, after obtaining the sample soil index data corresponding to the sample pipeline and the corrosion data set consisting of the unlabeled corrosion depth of the sample pipeline, data preprocessing can be performed, that is, the corrosion data set is dimensionless processed using the data normalization method, and all data can be compressed to the interval [-1,1]. Then, 70% of the total number of original data sets are randomly divided into training sets, and the remaining 30% are divided into test sets for model prediction effect verification.

[0062] The specific process of the multi-objective optimization algorithm is as follows:

[0063] You can initialize the optimization parameters, i.e., the population size n, the maximum number of iterations M, the number of optimization parameters, and define the lower bounds L of the parameters c and g to be optimized. b and upper bound Ub , as shown in Table 2.

[0064] Table 2. Parameter settings

[0065]

[0066] Then, the slime mold individuals can be initialized, n slime mold individuals can be randomly generated in the feasible solution space, that is, within the value range of the hyperparameters c and g, the positions of the slime mold individuals can be initialized, and the population fitness can be calculated according to the objective function to construct the first generation parent population P0. The objective function here can be constructed with the goal of minimizing the mean square error and minimizing the standard deviation of the training set.

[0067] Then solve the non-dominated solution of P0 and get the Pareto frontier, and calculate the crowding distance (CD) of the non-dominated solution. The crowding distance of the non-dominated solution represents the sum of the Euclidean distances of the two solutions before and after a non-dominated solution in each objective function direction. According to the crowding mechanism, the individuals are sorted non-dominatedly to get the non-dominated ranking:

[0068]

[0069] Among them, f j i represents the objective function value corresponding to the i-th individual, f j max and f j min They respectively represent the maximum and minimum values ​​of the individual optimization objective function under the same Pareto level.

[0070] Then, the population position can be calculated, and a new population P can be generated based on the Slime Mould Algorithm (SMA) j . And the fitness value of the updated population position is calculated according to the objective function of the multi-objective optimization algorithm.

[0071] Furthermore, the new and old populations are merged to generate a new population P i , the merged population is sorted by the elite strategy, and the n individuals that meet the conditions are selected as the new generation parent population according to the individual level and its crowding degree to enter the next round of algorithm iteration, that is, multi-objective parameter optimization.

[0072] Finally, the population is iteratively updated continuously until the maximum iteration condition is met, and the current optimal slime mold position is output as the optimization parameter of the initial depth prediction model.

[0073] After obtaining the optimized parameters, the optimized parameters can be substituted into the initial depth prediction model to obtain the corrosion depth prediction model.

[0074] That is, during the training process of the initial depth prediction model, the optimal parameters were obtained, and the optimized parameters were substituted into the initial depth prediction model to obtain the corrosion depth prediction model, which further improved the accuracy and reliability of predicting the external corrosion depth of the pipeline.

[0075] The method provided by the embodiment of the present invention determines the objective function based on the difference between the predicted external corrosion depth and the labeled external corrosion depth, and iterates the parameters of the initial depth prediction model based on the objective function and the multi-objective optimization algorithm to obtain the corrosion depth prediction model, which can improve the accuracy and reliability of the prediction of the external corrosion depth of the pipeline.

[0076] Based on the above embodiment, step 220 includes:

[0077] Step 221, based on the difference between the predicted external corrosion depth and the labeled external corrosion depth, determine the mean square error loss and the standard deviation loss, and use the mean square error loss and the standard deviation loss as the objective function of the multi-objective optimization algorithm.

[0078] Specifically, the root mean square error loss (MSE) and the standard deviation loss can be determined based on the difference between the predicted outer corrosion depth and the labeled outer corrosion depth.

[0079] The formula for the mean square error loss f1 here is as follows:

[0080]

[0081] Among them, y i represents the true value of the input sample, Represents the predicted value of the model output.

[0082] The formula for the standard deviation loss f2 here is as follows:

[0083] in

[0084] Among them, y i represents the true value of the input sample, Represents the predicted value of the model output.

[0085] It can be understood that the smaller the mean square error loss is, the better the accuracy of the corrosion depth prediction model in fitting the corrosion depth data is.

[0086] After obtaining the mean square error loss and the standard deviation loss, the mean square error loss and the standard deviation loss can be used as the objective function of the multi-objective optimization algorithm. That is, the mean square error loss and the standard deviation loss can be used as the objective function at the same time. Here, the goal can be to minimize the mean square error loss and the standard deviation loss, that is:

[0087]

[0088] Among them, y i represents the true value of the input sample, Represents the predicted value of the model output.

[0089] It can be understood that the idea of ​​the multi-objective optimization algorithm is to find a set of optimal parameter combinations so that both the mean square error loss and the standard deviation loss are minimized.

[0090] By minimizing the mean square error loss, the deviation of the prediction model can be controlled to achieve high precision. By minimizing the standard deviation loss, overfitting caused by excessive model variance can be avoided, thereby improving the model's goodness of fit to the data.

[0091] In addition, after the corrosion depth prediction model outputs the pipeline external corrosion depth prediction result, the pipeline external corrosion depth prediction result can be denormalized, and then the denormalized result is substituted into the formula of each objective function to calculate the result.

[0092] In addition, the mean absolute percentage error (MAPE) can be used as an evaluation indicator for the quality of the corrosion depth prediction model, and the determination coefficient R2 (R Square) can also be used as an evaluation indicator for the quality of the corrosion depth prediction model. The embodiment of the present invention does not make specific limitations on this.

[0093] The mean absolute percentage error here is also a measure of model accuracy, with a value range of [0, +∞), which reflects the comparison process between the predicted data and the original data, and is often used to compare the prediction effects of different models on the same data set. When MAPE is close to 0, it means that the prediction accuracy of the model is good, and vice versa; if MAPE is greater than 100%, it means that the model is a poor model.

[0094] The formula for mean absolute percentage error is as follows:

[0095]

[0096] Among them, y i represents the true value of the input sample, Represents the predicted value of the model output.

[0097] The coefficient of determination here reflects the degree of fit of the model to the dependent variable. The formula of the coefficient of determination is as follows:

[0098]

[0099] Among them, y i represents the true value of the input sample, Indicates the predicted value of the model output. In formula (2), the numerator is the difference between the true value of the sample and the predicted value of the model, indicating the total amount of information that the model has not fitted, and the denominator indicates the amount of information carried by the true label. Therefore, the determination coefficient R of the model is 2 The closer it is to 1, the more sample information the model fits. The model will have better generalization performance and higher prediction accuracy on unknown data sets.

[0100] Based on the above embodiment, step 220 further includes:

[0101] Based on the test soil index data and the test external corrosion depth corresponding to the test pipeline, the corrosion depth prediction model is tested.

[0102] Specifically, after obtaining the corrosion depth prediction model, the corrosion depth prediction model can be tested based on the test soil index data and the test external corrosion depth corresponding to the test pipeline. The test pipeline here refers to the pipeline used to perform model testing on the corrosion depth prediction model later, the soil index data corresponding to the test pipeline here refers to the soil index data corresponding to the soil where the test pipeline is currently located, and the test external corrosion depth here refers to the external corrosion depth of the test pipeline.

[0103] The embodiment of the present invention predicts the external corrosion depth of the pipeline by four single algorithms, namely, support vector regression (SVR) algorithm, random forest regression (RFR) algorithm, linear regression (LR) algorithm and BP (Back Propagation) neural network algorithm. Table 3 shows the average absolute percentage error of the prediction results of the external corrosion depth of the pipeline output by the four algorithms, as shown in Table 3.

[0104] Table 3. Prediction error results of a single model

[0105]

[0106]

[0107] The results in Table 3 show that the average absolute percentage error of SVR is smaller, which shows that SVR has better accuracy for the small sample problem of multivariate nonlinear regression such as the prediction of pipeline external corrosion.

[0108] In addition, each optimization algorithm can be combined with SVR, and the optimal parameter combination obtained by different optimization algorithms can be input into SVR to establish four hybrid prediction models: MOSMA-SVR (Multi-Objective Slime Mold Algorithm-Support Vector Regression), WOA-SVR (Whale Optimization Algorithm-Support Vector Regression), GWO-SVR (Grey Wolf Optimizer-Support Vector Regression), and AOA-SVR (Archimedes optimization algorithm-Support Vector Regression) for data training and prediction. The mean square error, mean absolute percentage error and model determination coefficient of each combination model in the training set and test set are calculated respectively. The results are shown in Table 4.

[0109] Table 4. Evaluation results of each hybrid model

[0110]

[0111]

[0112] As shown in Table 4, by comparing the evaluation index results of each model, the mean square error (MSE) of the MOSMA-SVR model in both the training set and the test set is 0.002; the MAPE of the training set is 3.601%, and the MAPE of the test set is 3.659%, which is the smallest error compared with other combination models; the R 2 All reached 0.999, indicating that the model fits most of the data well, and has a high goodness of fit for unknown data sets. In contrast, the three models WOA-SVR, GWO-SVR, and AOA-SVR performed well in the accuracy results of the training set, with MSE of 0.412, 0.006, and 0.391, respectively, but showed large errors in the test set, with MSE of 2.470, 3.134, and 2.241, respectively, and the MAPE value was also high; the three hybrid models had R 2 is closer to 1, while the R 2 They are all below 0.5, which means that the model has a serious overfitting phenomenon, that is, the model explains too much of the dependent variables in the training set, and the prediction effect is poor when facing unknown test set data.

[0113] Based on the above embodiment, the multi-objective optimization algorithm is a multi-objective slime mold algorithm.

[0114] Specifically, the multi-objective optimization algorithm may be a Multi-Objective SlimeMold Algorithm (MOSMA).

[0115] That is, after obtaining the sample soil index data corresponding to the sample pipeline and the corrosion data set consisting of the unlabeled corrosion depth of the sample pipeline, data preprocessing can be performed, that is, the corrosion data set is dimensionless processed using the data normalization method, and all data can be compressed to the interval [-1,1]. Then, 70% of the total number of original data sets is randomly divided into a training set, and the remaining 30% is divided into a test set for model prediction effect verification.

[0116] The specific process of the multi-objective optimization algorithm is as follows:

[0117] You can initialize the optimization parameters, i.e., the population size n, the maximum number of iterations M, the number of optimization parameters, and define the lower bounds L of the parameters c and g to be optimized. b and upper bound U b .

[0118] The slime mold individuals can be initialized, that is, n slime mold individuals are randomly generated in the feasible solution space, that is, within the value range of the hyperparameters c and g, the positions of the slime mold individuals are initialized, and the population fitness is calculated according to the objective function to construct the first generation parent population P0. The objective function here can be constructed with the goal of minimizing the mean square error and minimizing the standard deviation of the training set.

[0119] Then solve the non-dominated solution of P0 and get the Pareto frontier, and calculate the crowding distance (CD) of the non-dominated solution. The crowding distance of the non-dominated solution represents the sum of the Euclidean distances of the two solutions before and after a non-dominated solution in each objective function direction. According to the crowding mechanism, the individuals are sorted non-dominatedly to get the non-dominated ranking:

[0120]

[0121] Among them, f j i represents the objective function value corresponding to the i-th individual, f j max and f j min They respectively represent the maximum and minimum values ​​of the individual optimization objective function under the same Pareto level.

[0122] Then, the population position can be calculated, and a new population P can be generated based on the Slime Mould Algorithm (SMA) j . And calculate the fitness value of the updated population position according to the objective function.

[0123] Furthermore, the new and old populations are merged to generate a new population P i , the merged population is sorted by the elite strategy, and the n individuals that meet the conditions are selected as the new generation parent population according to the individual level and its crowding degree to enter the next round of algorithm iteration, that is, multi-objective parameter optimization.

[0124] Finally, the population is updated iteratively until the maximum iteration condition is met and the current optimal slime mold position is output.

[0125] Based on the above embodiment, the corrosion depth prediction model is a support vector regression model.

[0126] Specifically, the corrosion depth prediction model may be a support vector regression model, a random forest regression model, a linear regression model, etc., which is not specifically limited in the embodiment of the present invention.

[0127] Based on the above embodiment, the soil index data includes soil pH data, redox potential data, soil resistivity data, soil moisture content data, bulk density data, dissolved chloride data, carbonate ion concentration data, sulfate ion concentration data and soil potential data.

[0128] Specifically, soil indicator data may include soil pH data, oxidation-reduction potential (PP) data, soil resistivity (RE) data, soil water content (WC) data, bulk density (BD) data, dissolved chloride (CC) data, carbonate ion concentration (BC) data, sulfate ion concentration (SC) data, and soil potential (RP) data.

[0129] The soil pH here refers to the general term for soil acidity and alkalinity, and is usually used to measure the strength of the soil acid-base reaction. Soil pH is mainly determined by the concentration of hydrogen ions and hydroxide ions in the soil solution, expressed as pH. Soil with a pH between 6.5 and 7.5 is neutral soil; soil below 6.5 is acidic soil; and soil above 7.5 is alkaline soil.

[0130] The redox potential here is used to reflect the macroscopic redox properties of all substances in the aqueous solution. The higher the redox potential, the stronger the oxidizing property, and the lower the redox potential, the stronger the reducing property.

[0131] The soil resistivity here is the product of the average value of the soil resistance per unit length and the cross-sectional area.

[0132] The soil moisture content here generally refers to the absolute soil moisture content, that is, the number of grams of water contained in 100g of dried soil, also known as soil moisture content.

[0133] The bulk density data here refers to the mass or weight of the unit volume of soil in the natural compacted state in the field (g / cm3). Generally, loose and porous soil with high organic matter content and good structure has a smaller bulk density, and vice versa.

[0134] The dissolved chloride data here refers to the content data of soluble chloride in the soil, the carbonate ion concentration data refers to the content data of carbonate ion concentration in the soil, and the sulfate ion concentration data refers to the content data of sulfate ion concentration in the soil. The soil potential data here refers to the soil potential data.

[0135] Based on any of the above embodiments, the present invention provides a method for predicting the corrosion depth of a pipeline. Figure 3 FIG. 2 is a flow chart of the method for predicting the external corrosion depth of a pipeline provided by the present invention. Figure 3 As shown, the method includes:

[0136] S1, inputting the sample soil index data corresponding to the sample pipeline into the initial depth prediction model to obtain the predicted external corrosion depth of the sample pipeline output by the initial depth prediction model;

[0137] S2, based on the difference between the predicted external corrosion depth and the labeled external corrosion depth, the mean square error loss and the standard deviation loss are determined, the mean square error loss and the standard deviation loss are used as the objective function of the multi-objective optimization algorithm, and the parameters of the initial depth prediction model are iterated based on the objective function and the multi-objective optimization algorithm to obtain the corrosion depth prediction model. The multi-objective optimization algorithm here is the multi-objective slime mold algorithm.

[0138] S3, based on the test soil index data corresponding to the test pipeline and the test external corrosion depth, the corrosion depth prediction model is tested.

[0139] After the corrosion depth prediction model is trained and tested, the corrosion depth prediction model can be used to predict the external corrosion depth of the pipeline to be predicted.

[0140] S4, obtaining soil index data corresponding to the pipeline to be predicted.

[0141] The soil index data here may include soil pH data, redox potential data, soil resistivity data, soil moisture data, bulk density data, dissolved chloride data, carbonate ion concentration data, sulfate ion concentration data and soil potential data. S5, based on the corrosion depth prediction model and the soil index data, predict the external corrosion depth of the pipeline to be predicted. The corrosion depth prediction model here may be a support vector regression model.

[0142] The device for predicting the external corrosion depth of a pipeline provided by the present invention is described below. The device for predicting the external corrosion depth of a pipeline described below and the method for predicting the external corrosion depth of a pipeline described above can be referred to each other.

[0143] Based on any of the above embodiments, the present invention provides a device for predicting the corrosion depth of the pipeline. Figure 4 Schematic diagram of the structure of the device for predicting the external corrosion depth of a pipeline provided by the present invention. Figure 4 As shown, the device comprises:

[0144] An acquisition unit 410 is used to acquire soil index data corresponding to the pipeline to be predicted;

[0145] The external corrosion depth prediction unit 420 is used to predict the external corrosion depth of the pipeline to be predicted based on the corrosion depth prediction model and the soil index data;

[0146] The corrosion depth prediction model is trained based on sample soil indicator data corresponding to the sample pipeline and the off-label corrosion depth of the sample pipeline.

[0147] The device provided by the embodiment of the present invention obtains soil index data corresponding to the pipeline to be predicted, and predicts the external corrosion depth of the pipeline to be predicted based on the corrosion depth prediction model and the soil index data. The corrosion depth prediction model is obtained by training based on the sample soil index data corresponding to the sample pipeline and the labeled external corrosion depth of the sample pipeline. Therefore, the accuracy and reliability of the prediction of the external corrosion depth of the pipeline are improved. In addition, the method does not need to calculate the corrosion rate by observing the corrosion situation through actual measurement, which greatly reduces the test time of the prediction of the external corrosion rate of the pipeline, improves the efficiency of the prediction of the external corrosion rate of the pipeline, and the prediction results are universal under different soil corrosion factors, which helps to broaden the application scope of the prediction of the external corrosion depth of the pipeline.

[0148] Based on any of the above embodiments, the training step of the corrosion depth prediction model includes:

[0149] A prediction unit, used for inputting the sample soil index data corresponding to the sample pipeline into an initial depth prediction model to obtain a predicted external corrosion depth of the sample pipeline output by the initial depth prediction model;

[0150] A parameter iteration unit is used to determine the objective function of the multi-objective optimization algorithm based on the difference between the predicted external corrosion depth and the labeled external corrosion depth, and to perform parameter iteration on the initial depth prediction model based on the objective function and the multi-objective optimization algorithm to obtain the corrosion depth prediction model.

[0151] Based on any of the above embodiments, the parameter iteration unit is specifically used for:

[0152] The objective function determination unit is used to determine the mean square error loss and the standard deviation loss based on the difference between the predicted external corrosion depth and the labeled external corrosion depth, and use the mean square error loss and the standard deviation loss as the objective function of the multi-objective optimization algorithm.

[0153] Based on any of the above embodiments, the parameter iteration unit is further used for:

[0154] Based on the test soil index data and the test external corrosion depth corresponding to the test pipeline, the corrosion depth prediction model is tested.

[0155] Based on any of the above embodiments, the multi-objective optimization algorithm is a multi-objective slime mold algorithm.

[0156] Based on any of the above embodiments, the corrosion depth prediction model is a support vector regression model.

[0157] Based on any of the above embodiments, the soil indicator data includes soil pH data, redox potential data, soil resistivity data, soil moisture content data, bulk density data, dissolved chloride data, carbonate ion concentration data, sulfate ion concentration data and soil potential data.

[0158] Figure 5 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 5 As shown, the electronic device may include: a processor 510, a communication interface 520, a memory 530 and a communication bus 540, wherein the processor 510, the communication interface 520 and the memory 530 communicate with each other through the communication bus 540. The processor 510 may call the logic instructions in the memory 530 to execute a method for predicting the external corrosion depth of a pipeline, the method comprising: obtaining soil index data corresponding to the pipeline to be predicted; predicting the external corrosion depth of the pipeline to be predicted based on a corrosion depth prediction model and the soil index data; the corrosion depth prediction model is obtained by training based on sample soil index data corresponding to the sample pipeline and the label external corrosion depth of the sample pipeline.

[0159] In addition, the logic instructions in the above-mentioned memory 530 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.

[0160] On the other hand, the present invention also provides a computer program product, which includes a computer program. The computer program can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the prediction method of the external corrosion depth of the pipeline provided by the above-mentioned methods, and the method includes: obtaining soil indicator data corresponding to the pipeline to be predicted; predicting the external corrosion depth of the pipeline to be predicted based on a corrosion depth prediction model and the soil indicator data; the corrosion depth prediction model is obtained by training based on sample soil indicator data corresponding to the sample pipeline and the label external corrosion depth of the sample pipeline.

[0161] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, it is implemented to execute the method for predicting the external corrosion depth of a pipeline provided by the above-mentioned methods, the method comprising: obtaining soil index data corresponding to the pipeline to be predicted; predicting the external corrosion depth of the pipeline to be predicted based on a corrosion depth prediction model and the soil index data; the corrosion depth prediction model is trained based on sample soil index data corresponding to the sample pipeline and the label external corrosion depth of the sample pipeline.

[0162] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0163] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0164] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for predicting the depth of external corrosion of a pipeline, characterized in that: include: Obtain soil index data corresponding to the pipeline to be predicted; Based on the corrosion depth prediction model and the soil index data, predicting the external corrosion depth of the pipeline to be predicted; The corrosion depth prediction model is trained based on sample soil indicator data corresponding to the sample pipeline and the off-label corrosion depth of the sample pipeline.

2. The method for predicting the external corrosion depth of a pipeline according to claim 1, characterized in that: The training steps of the corrosion depth prediction model include: Inputting the sample soil index data corresponding to the sample pipeline into the initial depth prediction model to obtain the predicted external corrosion depth of the sample pipeline output by the initial depth prediction model; Based on the difference between the predicted external corrosion depth and the labeled external corrosion depth, the objective function of the multi-objective optimization algorithm is determined, and based on the objective function and the multi-objective optimization algorithm, the initial depth prediction model is iterated to obtain the corrosion depth prediction model.

3. The method for predicting the external corrosion depth of a pipeline according to claim 2, characterized in that: The determining of the objective function based on the difference between the predicted external corrosion depth and the labeled external corrosion depth comprises: Based on the difference between the predicted outer corrosion depth and the labeled outer corrosion depth, a mean square error loss and a standard deviation loss are determined, and the mean square error loss and the standard deviation loss are used as objective functions of the multi-objective optimization algorithm.

4. The method for predicting the external corrosion depth of a pipeline according to claim 2, characterized in that: The method further comprises: obtaining the corrosion depth prediction model; Based on the test soil index data and the test external corrosion depth corresponding to the test pipeline, the corrosion depth prediction model is tested.

5. The method for predicting the external corrosion depth of a pipeline according to any one of claims 2 to 4, characterized in that: The multi-objective optimization algorithm is a multi-objective slime mold algorithm.

6. The method for predicting the external corrosion depth of a pipeline according to any one of claims 1 to 4, characterized in that: The corrosion depth prediction model is a support vector regression model.

7. The method for predicting the external corrosion depth of a pipeline according to any one of claims 1 to 4, characterized in that: The soil index data include soil pH data, redox potential data, soil resistivity data, soil moisture content data, bulk density data, dissolved chloride data, carbonate ion concentration data, sulfate ion concentration data and soil potential data.

8. A device for predicting the depth of external corrosion of a pipeline, characterized in that: include: An acquisition unit, used for acquiring soil index data corresponding to the pipeline to be predicted; An external corrosion depth prediction unit, used to predict the external corrosion depth of the pipeline to be predicted based on the corrosion depth prediction model and the soil index data; The corrosion depth prediction model is trained based on sample soil indicator data corresponding to the sample pipeline and the off-label corrosion depth of the sample pipeline.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the method for predicting the external corrosion depth of a pipeline as claimed in any one of claims 1 to 7 is implemented.

10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for predicting the external corrosion depth of a pipeline as claimed in any one of claims 1 to 7 is implemented.