Prediction method for corrosion rate in pipeline, storage medium and device

Through the support vector regression model optimized by principal component analysis and chaotic particle swarm algorithm, the problem of low prediction accuracy in the pipeline is solved, and higher prediction accuracy and accuracy are achieved.

CN119203705APending Publication Date: 2024-12-27PETROCHINA CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310762129.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-06-26
Publication Date
2024-12-27

AI Technical Summary

Technical Problem

The prior art has low accuracy when predicting the corrosion rate in the pipeline, and there is measurement error in traditional ultrasonic wall thickness measurement, and it is difficult to accurately judge the internal corrosion of long-distance conveying pipelines.

Method used

The main variables of corrosion influencing factors were screened through principal component analysis, a prediction model was established based on support vector regression, and the model was optimized using the chaotic particle swarm algorithm to construct a PCA-CPSO-SVR prediction model.

Benefits of technology

It improves the prediction accuracy of corrosion rate in the pipeline, reduces the average absolute error, and enhances the accurate judgment of corrosion conditions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119203705A_ABST
    Figure CN119203705A_ABST
Patent Text Reader

Abstract

The invention provides a method, a storage medium and a device for predicting the corrosion rate in a pipeline, which can improve the prediction precision. A PCA-CPSO-SVR prediction model is provided on the basis of conclusion of corrosion factors, finding out main variables in original data by using principal component analysis, constructing a support vector regression prediction model and optimizing the prediction model through a chaos particle swarm algorithm, and the problem that the prediction precision of the corrosion rate in the pipeline is not high is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of gas pipeline safety, and in particular relates to a method, storage medium and device for predicting the corrosion rate in a pipeline. Background Art

[0002] Combustible mixed gases such as shale gas and natural gas are transported through pipelines, which are usually buried below the ground or installed overhead. Since shale gas and natural gas both contain substances such as carbon dioxide and water, these substances will corrode the inner wall of the pipeline. When the corrosion inside the pipeline is more serious, it is very easy to cause pipeline leakage, which poses a great safety hazard.

[0003] The traditional way to judge the internal corrosion rate of pipelines is to regularly measure and calculate the wall thickness of the pipeline through ultrasonic wall thickness measurement. This method relies on manual operation, has certain measurement errors, and is not easy to judge accurately. Especially for long-distance transmission pipelines, the internal corrosion of the unmeasured parts is easy to be ignored, which makes it impossible to accurately judge the internal corrosion rate of the pipeline. Furthermore, it also has the defect of wasting manpower and material resources. In response to the above technical problems, the internal corrosion rate of pipelines is predicted by algorithms, and the judgment accuracy is greatly improved.

[0004] For example, the Chinese patent document with application number 202010942642.9 discloses a method for simulating and analyzing corrosion in a long-distance natural gas pipeline, which includes: (1) collecting basic data of the target long-distance natural gas pipeline; (2) dividing the flow pattern, calculating the liquid holdup, calculating the friction pressure drop, the elevation pressure drop, and the acceleration pressure drop, and constructing a corresponding combined model to accurately calculate the multiphase flow parameters along the long-distance natural gas pipeline; (3) conducting a simulation experiment of the corrosion environment in the pipeline, and using the Apriori correlation algorithm to determine the main controlling factors affecting the corrosion in the pipeline; (4) combining the analysis results of the main controlling factors, establishing a semi-theoretical and semi-empirical model of the corrosion rate in the pipeline. The corrosion of the pipeline can be predicted by truly reflecting the flow state inside the pipeline.

[0005] For another example, a Chinese patent document with application number 201810884314.0 discloses a method for predicting the internal corrosion rate of a natural gas pipeline, the method comprising: obtaining internal corrosion factor data and internal corrosion rate data of a target natural gas pipeline as sample data; analyzing the sample data by a grey correlation analysis method to determine sensitive factors affecting the internal corrosion of the target natural gas pipeline; normalizing the sensitive factor data; optimizing the connection weights, scaling factors, and translation factors of a wavelet neural network using a genetic algorithm based on the sensitive factors after the data normalization; using the optimized connection weights, scaling factors, and translation factors as initial values ​​of the wavelet neural network, performing wavelet neural network training based on the sensitive factors after the data normalization, determining the final values ​​of the connection weights, scaling factors, and translation factors, and obtaining a natural gas pipeline internal corrosion rate prediction model; and predicting the internal corrosion rate based on the natural gas pipeline internal corrosion rate prediction model.

[0006] The prediction methods described in the above two patents have greatly improved prediction accuracy compared to the traditional ultrasonic wall thickness measurement method. However, in actual application, there is still a certain error between the prediction results of the two and the actual corrosion situation. Summary of the invention

[0007] The technical problem to be solved by the present invention is to provide a method, storage medium and device for predicting the corrosion rate in a pipeline, which can improve the prediction accuracy.

[0008] The technical solution adopted by the present invention to solve the technical problem is: a method for predicting the corrosion rate in a pipeline, comprising the steps of:

[0009] S1. Screen the main variables of corrosion influencing factors through principal component analysis;

[0010] S2, establish a prediction model based on support vector regression;

[0011] S3. Optimize the prediction model based on chaotic particle swarm algorithm.

[0012] Furthermore, the step S1 comprises the steps of:

[0013] S11. Determine the factors affecting pipeline corrosion;

[0014] S12. Perform principal component analysis on the original data to determine the main variables in the corrosion influencing factors.

[0015] Furthermore, the factors affecting pipeline corrosion in step S11 include temperature, pressure, liquid holdup, CO2 partial pressure, liquid flow rate, wall shear force of gas phase, wall shear force of liquid phase and pH value.

[0016] Furthermore, the step S12 includes the steps of:

[0017] S121, initial matrix normalization;

[0018] The expression of the initial matrix normalization is:

[0019]

[0020] Wherein, i=1, 2, ..., n, n is the number of data samples;

[0021] j = 1, 2, ..., m, where m is the data dimension;

[0022]

[0023] s j is the standard deviation,

[0024] Let the normalized matrix

[0025] S122, correlation matrix R of the standardized matrix;

[0026] The expression of the correlation matrix R of the standardized matrix is:

[0027]

[0028] Where, i, j = 1, 2, ..., m;

[0029]

[0030] S123, eigenvalue λ j ;

[0031] The correlation matrix eigenvalues ​​λ of the normalized matrix j The expression is:

[0032] |R-λ j E|=0;

[0033] Wherein, j = 1, 2, ..., m;

[0034] E is the identity matrix;

[0035] S124, cumulative contribution rate M;

[0036] The expression of the cumulative contribution rate M is:

[0037]

[0038] The cumulative contribution rate M is a measure of how much the principal component has extracted from the original variable;

[0039] S125, eigenvector

[0040] Solve the equation system Rb=λ j b obtains the eigenvalues ​​of the eigenvector and normalizes it;

[0041]

[0042] Conduct principal component analysis on the original data to find out the contribution rate of each influencing factor and determine the main variables of corrosion factors.

[0043] Furthermore, the main variables of the corrosion influencing factors in step S1 include temperature, pressure, liquid holdup and CO2 partial pressure.

[0044] Furthermore, the step S2 comprises the steps of:

[0045] S21, find the corresponding mapping relationship of the support vector machine;

[0046] The corresponding mapping relationship expression of the support vector machine is:

[0047] f(x)=[w T x i ]+b;

[0048] Where w is the normal vector;

[0049] b is a constant;

[0050] S22. There is an error between f(x) and y in the support vector machine. The expression of the error function L(C) is:

[0051]

[0052] Where C is the regularization constant, and is the slack variable;

[0053]

[0054] stf(x i )-y i ≤ε+ξ i ;

[0055] y i -f(x i )≤ε+ξ i * ;

[0056] ε≥0,ξ i ≥0,i=1,2,...,l;

[0057] Among them, ε is the loss amount;

[0058] l is the length of the training data;

[0059] After introducing Lagrange multipliers to evolve the corresponding mapping relationship expression of the support vector machine, the expression is:

[0060]

[0061] in, and α i is the Lagrange multiplier;

[0062] α i is the kernel function.

[0063] Furthermore, the kernel function in step S22 is a Gaussian kernel function, and the expression is:

[0064] K(x i ,x j ) = exp(-γ||x i -x j || 2 );

[0065] Among them, γ is the parameter of the Gaussian kernel function.

[0066] Furthermore, step S3 includes the following steps:

[0067] S31, initializing the position and velocity of the particle swarm;

[0068] S32, calculate the fitness of each particle, compare the values ​​and retain the current position G of the optimal solution in this population best and its own optimal solution current position P best ;

[0069] S33, update the particle group speed and position, the expression is;

[0070] v i,j (t+1)=ωv i,j (t)+c1r1(P _best,i,j -x i,j (t))+c2r2(G _best,i,j -x i,j (t));

[0071] x i,j (t+1)=x i,j (t)+v i,j (t+1);

[0072] Wherein, i = 1, 2, ..., n;

[0073] j=1,2,…,d;

[0074] ω is the inertia weight value, ω∈[0,1];

[0075] c1 and c2 are learning factors, c1, c2∈[0, 2];

[0076] r1 and r2 are random numbers in the interval [0, 1];

[0077] S34, solving the fitness function of the updated particles, calculating the value thereof, and then saving the particles with the best objective function in the group;

[0078] S35, after saving the optimal particle, the population is precociously judged and chaotic search is performed;

[0079] The expression of the precocious coefficient p is:

[0080]

[0081] Among them, f best is the fitness function value of the particle with the best objective function in the group;

[0082] m is the average fitness function value of all particles of the objective function in the group;

[0083] If p≤C, then the number of premature times T increases by 1, otherwise T is set to 0; if T≥T max , then the particle swarm is considered premature and chaotic search is performed. The expression is:

[0084] z i+1 =μz i (1-z i )

[0085] Among them, μ is the control variable, μ∈[0,4];

[0086] S36: When the requirements for the optimal solution are met, the algorithm is stopped and the optimal solution is output; otherwise, the process goes to step S32 for a cyclic search.

[0087] A storage medium stores a computer program, which, when executed by a processor, implements a method for predicting the corrosion rate in a pipeline.

[0088] A device for predicting the corrosion rate in a pipeline comprises a storage medium, wherein the storage medium stores a computer program, and when the computer program is executed by a processor, a method for predicting the corrosion rate in a pipeline is implemented.

[0089] Compared with the prior art, the invention has the following beneficial effects: the invention provides a method, storage medium and device for predicting the corrosion rate in a pipeline, which can improve the prediction accuracy. By summarizing the corrosion factors, using principal component analysis (PCA) to find the main variables in the original data, constructing a support vector regression (SVR) prediction model, optimizing the prediction model through a chaotic particle swarm algorithm (CPSO), and based on this, proposing a PCA-CPSO-SVR prediction model, the problem of low prediction accuracy of the corrosion rate in the pipeline is solved. BRIEF DESCRIPTION OF THE DRAWINGS

[0090] Figure 1 It is a model prediction flow chart of the present invention;

[0091] Figure 2 Information retention and mean absolute error graphs for different dimensions;

[0092] Figure 3 This is a graph of prediction results in different dimensions;

[0093] Figure 4 This is a comparison chart of the prediction results after removing redundant variables and the prediction results when N is 4;

[0094] Figure 5 The time consumption diagram for different dimensions and after removing redundant variables;

[0095] Figure 6 This is a comparison chart between using chaotic particle swarm algorithm and not using chaotic particle algorithm;

[0096] Figure 7 The figure shows how to optimize the model using genetic algorithm and chaotic particle swarm algorithm respectively;

[0097] Figure 8 This is a comparison chart of iteration rates of different algorithms;

[0098] Fig. 9 Time consumption diagram for different algorithms. DETAILED DESCRIPTION

[0099] The present invention is further described below in conjunction with the accompanying drawings and embodiments.

[0100] The method for predicting the corrosion rate in a pipeline includes the following steps:

[0101] S1. Screen the main variables of corrosion influencing factors through principal component analysis (PCA);

[0102] The step S1 comprises the steps of:

[0103] S11. Determine the factors affecting pipeline corrosion;

[0104] Taking shale gas pipelines as an example, based on 60 groups of pipeline inspection data from an oil and gas station in China, eight factors, including temperature, liquid holdup, pressure, CO2 partial pressure, liquid flow rate, wall shear force of the gas phase, wall shear force of the liquid phase and pH value, were determined to be the influencing factors of shale gas pipeline corrosion.

[0105] Where, temperature, TM, °C;

[0106] Liquid holdup, HOL;

[0107] Pressure, PT, KPa;

[0108] CO2 partial pressure, PCO2, KPa;

[0109] Liquid flow rate, UL, m / s;

[0110] The wall shear force of the liquid phase, TAUWWT, Pa;

[0111] Wall shear force of gas phase, TAUWG, Pa.

[0112] S12. Perform principal component analysis (PCA) on the original data to determine the main variables in the corrosion influencing factors.

[0113] The step S12 comprises the steps of:

[0114] S121, initial matrix normalization;

[0115] The expression of the initial matrix normalization is:

[0116]

[0117] Wherein, i=1, 2, ..., n, n is the number of data samples;

[0118] j = 1, 2, ..., m, where m is the data dimension;

[0119]

[0120] s j is the standard deviation,

[0121] Let the normalized matrix

[0122] S122, correlation matrix R of the standardized matrix;

[0123] The expression of the correlation matrix R of the standardized matrix is:

[0124]

[0125] Where, i, j = 1, 2, ..., m;

[0126]

[0127] S123, eigenvalue λ j ;

[0128] The correlation matrix eigenvalues ​​λ of the normalized matrix j The expression is:

[0129] |R-λ j E|=0;

[0130] Wherein, j = 1, 2, ..., m;

[0131] E is the identity matrix;

[0132] S124, cumulative contribution rate M;

[0133] The expression of the cumulative contribution rate M is:

[0134]

[0135] The cumulative contribution rate M is a measure of how much the principal component has extracted from the original variable;

[0136] S125, eigenvector

[0137] Solve the equation system Rb=λ j b obtains the eigenvalues ​​of the eigenvector and normalizes it;

[0138]

[0139] The principal component analysis (PCA) of the original data was performed, as shown in Table 1, to find out the contribution rate of each influencing factor and determine the main variables of the corrosion factors. Among them, the main variables in the corrosion influencing factors include temperature, pressure, liquid holdup and CO2 partial pressure. When retaining the four influencing factors of temperature, pressure, liquid holdup and CO2 partial pressure, the cumulative information retention has reached 96.7%.

[0140] Table 1

[0141]

[0142]

[0143] S2, establish a prediction model based on support vector regression (SVR);

[0144] The step S2 comprises the steps of:

[0145] S21, find the corresponding mapping relationship of support vector machine (SVM);

[0146] The corresponding mapping relationship expression of the support vector machine (SVM) is:

[0147] f(x)=[w T x i ]+b;

[0148] Where w is the normal vector;

[0149] b is a constant;

[0150] S22. There is a certain error between f(x) and y in the support vector machine (SVM). In order to improve the accuracy of model prediction, it is necessary to reduce the error between f(x) and y. The expression of the error function L(C) is:

[0151]

[0152] Where C is the regularization constant, and is the slack variable;

[0153]

[0154] stf(x i )-y i ≤ε+ξ i ;

[0155] y i -f(x i )≤ε+ξ i * ;

[0156] ε≥0,ξ i ≥0,i=1,2,...,l;

[0157] Among them, ε is the loss amount;

[0158] l is the length of the training data;

[0159] After introducing Lagrange multipliers to evolve the corresponding mapping relationship expression of support vector machine (SVM), the expression is:

[0160]

[0161] in, and α i is the Lagrange multiplier;

[0162] α i is the kernel function.

[0163] Specifically, the kernel function uses the Gaussian kernel function, and the expression is:

[0164] K(xi ,x j ) = exp(-γ||x i -x j || 2 );

[0165] Among them, γ is the parameter of the Gaussian kernel function.

[0166] The mean absolute error and SVR parameters under different information accumulation retention degrees are shown in Table 2, as well as the model parameter penalty coefficient C and kernel function parameter γ under different conditions obtained after optimization by the PCA-CPSO-SVR model.

[0167] Table 2

[0168]

[0169] like Figure 2 As shown in the figure, the cumulative information retention increases with the increase of data dimension, and the average absolute error first decreases and then increases. The average absolute errors of different dimensions from small to large are 0.118, 0.097, 0.101, 0.091, 0.097, 0.098, 0.099, and 0.105, respectively. When N is 3, the average absolute error is greater than when N is 2 and N is 4; when N = 4, the average absolute error reaches the minimum, which is 0.091, and the cumulative information contribution rate is 96.7%. After that, the average absolute error gradually increases. From the above analysis, it can be seen that in the collected original data, the main variables of the internal corrosion rate are temperature, pressure and CO2 partial pressure.

[0170] like Figure 3 As shown in the figure, the predicted data results under different dimensions are basically the same as the actual corrosion rate trend, but the error is large at the 56th point, and the maximum error occurs when N is 3, with a difference of 0.22. When N is 4, the predicted result is closest to the actual data, and the maximum error point is also at the 56th point, with an error value of 0.18.

[0171] like Figure 4 As shown in the figure, after eliminating the remaining redundant variables, the three main variables of temperature, pressure and CO2 partial pressure are used for training and prediction. Compared with the case where the redundant variables are not eliminated and the data dimension is four-dimensional, it is closer to the actual corrosion rate. At this time, the average absolute error is 0.083, which is reduced by 8%.

[0172] like Figure 5 As shown in the figure, with the increase of input variables, the algorithm running time gradually decreases, indicating that increasing variables can improve the algorithm running speed. When N is 2 and 3, and when N is 4, 5 and 6, the algorithm running time is close, and the mean absolute error is very close at this time. It can be proved that the existence of redundant variables will not only reduce the prediction accuracy of the model but also increase the algorithm running time.

[0173] S3. Optimize the prediction model based on chaotic particle swarm optimization (CPSO).

[0174] like Figure 1 As shown in the figure, aiming at the shortcomings of particle swarm optimization algorithm, an improved scheme based on chaos optimization algorithm is proposed, and support vector machine (SVM) is optimized.

[0175] The step S3 comprises the steps of:

[0176] S31, initializing the position and velocity of the particle swarm;

[0177] S32, calculate the fitness of each particle, compare the values ​​and retain the current position G of the optimal solution in this population best and its own optimal solution current position P best ;

[0178] S33, update the particle group speed and position, the expression is;

[0179] v i,j (t+1)=ωv i,j (t)+c1r1(P _best,i,j -x i,j (t))+c2r2(G _best,i,j -x i,j (t));

[0180] x i,j (t+1)=x i,j (t)+v i,j (t+1);

[0181] Wherein, i = 1, 2, ..., n;

[0182] j=1,2,…,d;

[0183] ω is the inertia weight value, ω∈[0,1];

[0184] c1 and c2 are learning factors, c1, c2∈[0, 2], generally set to 2;

[0185] r1 and r2 are random numbers in the interval [0, 1].

[0186] S34, solving the fitness function of the updated particles, calculating the value thereof, and then saving the particles with the best objective function in the group;

[0187] S35, after saving the optimal particle, the population is precociously judged and chaotic search is performed;

[0188] The expression of the precocious coefficient p is:

[0189]

[0190] Among them, f best is the fitness function value of the particle with the best objective function in the group;

[0191] m is the average fitness function value of all particles of the objective function in the group.

[0192] If p≤C, then the number of premature times T increases by 1, otherwise T is set to 0; if T≥T max , the particle swarm is considered premature and chaotic search is performed. The chaotic variable in chaos theory is the core of the algorithm. The Logistic mapping method is used and the expression is:

[0193] z i+1 =μz i (1-z i )

[0194] Where μ is the control variable, μ∈[0,4].

[0195] When μ=4, the chaotic system shows great randomness and enters a completely chaotic state. Therefore, μ=4 is preferably selected.

[0196] S36: When the requirements for the optimal solution are met, the algorithm is stopped and the optimal solution is output; otherwise, the process goes to step S32 for a cyclic search.

[0197] The prediction results of principal component analysis (PCA)-chaotic particle swarm optimization (CPSO)-support vector regression (SVR) are compared with those of three different algorithms: SVR, principal component analysis (PCA)-support vector regression (SVR), and particle swarm optimization (PSO)-genetic algorithm (GA)-support vector regression (SVR). Figure 6 , Figure 7 The error comparison of different algorithms is shown in Table 3. The iterative convergence of PCA-PSO-SVR and PCA-GA-SVR is compared. Fig. 9 shown.

[0198] Table 3

[0199]

[0200] like Figure 6 As shown in the figure, it can be seen that after screening out the main variables of corrosion influencing factors, the model is optimized by the chaotic particle swarm algorithm. Compared with PCA-SVR, the prediction accuracy can be improved, and the trend of its curve is closer to the actual corrosion rate. The average absolute error is reduced by 53.6% to 0.009.

[0201] like Figure 7As shown in the figure, the maximum prediction error of the PCA-GA-SVR algorithm occurs at the fifty-sixth point, with an error of 0.20 and an average absolute error of 0.013. In comparison, the maximum error of PCA-CPSO-SVR is 0.17 and the average absolute error is 0.083. It can be proved that PCA-CPSO-SVR has a better performance in predicting corrosion rate.

[0202] As shown in Table 2, among the four different algorithm models, PCA-CPSO-SVR has the smallest mean absolute error, root mean square error, and mean absolute error percentage. However, while achieving higher accuracy, the algorithm time has also increased relatively, to 17.49 seconds, which is still within an acceptable range.

[0203] like Figure 8 As shown in the figure, all three hybrid models converged within 20 generations. The model using the particle swarm optimization algorithm has a smaller average absolute error than the genetic algorithm, and the convergence speed is faster than the genetic algorithm. The model using the chaotic particle swarm optimization algorithm has a better optimization effect. Compared with the standard particle swarm optimization algorithm, the average absolute error is reduced by 3.5%, which has a certain effect.

[0204] like Fig. 9 As shown in the figure, SVR has the shortest running time, PSO-SVR has the longest running time, and PCA-CPSO-SVR has a running time of 17.49 seconds, which is greater than PCA-PSO-SVR and less than PCA-GA-SVR. This shows that the chaotic particle swarm algorithm will increase the algorithm running time in order to escape from the local optimum, but it is still within an acceptable range.

[0205] The above is a specific implementation of the present invention. From the implementation process, it can be seen that the present invention provides a prediction method, storage medium and device for the corrosion rate in a pipeline, which can improve the prediction accuracy. By summarizing the corrosion factors, using principal component analysis (PCA) to find the main variables in the original data, constructing a support vector regression (SVR) prediction model, and optimizing the prediction model through a chaotic particle swarm algorithm (CPSO), a PCA-CPSO-SVR prediction model is proposed based on this, which solves the problem of low prediction accuracy of the corrosion rate in the pipeline.

Claims

1. A method for predicting corrosion rate in pipelines, characterized in that: Includes steps: S1. Screen the main variables of corrosion influencing factors through principal component analysis; S2, establish a prediction model based on support vector regression; S3. Optimize the prediction model based on chaotic particle swarm algorithm.

2. The method for predicting the corrosion rate in a pipeline according to claim 1, characterized in that: The step S1 comprises the steps of: S11. Determine the factors affecting pipeline corrosion; S12. Perform principal component analysis on the original data to determine the main variables in the corrosion influencing factors.

3. The method for predicting the corrosion rate in a pipeline according to claim 2, characterized in that: The factors affecting pipeline corrosion in step S11 include temperature, pressure, liquid holdup, CO2 partial pressure, liquid flow rate, wall shear force of gas phase, wall shear force of liquid phase and pH value.

4. The method for predicting the corrosion rate in a pipeline according to claim 3, characterized in that: The step S12 comprises the steps of: S121, initial matrix normalization; The expression of the initial matrix normalization is: Wherein, i=1, 2, ..., n, n is the number of data samples; j = 1, 2, ..., m, where m is the data dimension; s j is the standard deviation, Let the normalized matrix S122, correlation matrix R of the standardized matrix; The expression of the correlation matrix R of the standardized matrix is: Where, i, j = 1, 2, ..., m; S123, eigenvalue λ j ; The correlation matrix eigenvalues ​​λ of the normalized matrix j The expression is: |R-λ j E|=0; Wherein, j = 1, 2, ..., m; E is the identity matrix; S124, cumulative contribution rate M; The expression of the cumulative contribution rate M is: The cumulative contribution rate M is a measure of how much the principal component has extracted from the original variable; S125, eigenvector Solve the equation system Rb=λ j b obtains the eigenvalues ​​of the eigenvector and normalizes it; Conduct principal component analysis on the original data to find out the contribution rate of each influencing factor and determine the main variables of corrosion factors.

5. The method for predicting the corrosion rate in a pipeline according to claim 4, characterized in that: The main variables of the corrosion influencing factors in step S1 include temperature, pressure, liquid holdup and CO2 partial pressure.

6. The method for predicting the corrosion rate in a pipeline according to claim 1, characterized in that: The step S2 comprises the steps of: S21, find the corresponding mapping relationship of the support vector machine; The corresponding mapping relationship expression of the support vector machine is: f(x)=[w T x i ]+b; Where w is the normal vector; b is a constant; S22. There is an error between f(x) and y in the support vector machine. The expression of the error function L(C) is: Where C is the regularization constant, and is the slack variable; s.t.f(x i )-y i ≤ε+ξ i ; y i -f(x i )≤ε+ξ i * ; ε≥0,ξ i ≥0,i=1,2,...,l; Among them, ε is the loss amount; l is the length of the training data; After introducing Lagrange multipliers to evolve the corresponding mapping relationship expression of the support vector machine, the expression is: in, and α i is the Lagrange multiplier; α i is the kernel function.

7. The method for predicting the corrosion rate in a pipeline according to claim 6, characterized in that: The kernel function in step S22 uses a Gaussian kernel function, and the expression is: K(x i ,x j )=exp(-γ||x i -x j || 2 ); Among them, γ is the parameter of the Gaussian kernel function.

8. The method for predicting the corrosion rate in a pipeline according to claim 1, characterized in that: The step S3 comprises the following steps: S31, initializing the position and velocity of the particle swarm; S32, calculate the fitness of each particle, compare the values ​​and retain the current position G of the optimal solution in this population best and its own optimal solution current position P best ; S33, update the particle group speed and position, the expression is; v i,j (t+1)=ωv i,j (t)+c1r1(P _best,i,j -x i,j (t))+c2r2(G _best,i,j -x i,j (t)); x i,j (t+1)=x i,j (t)+v i,j (t+1); Wherein, i = 1, 2, ..., n; j=1,2,…,d; ω is the inertia weight value, ω∈[0,1]; c1 and c2 are learning factors, c1, c2∈[0, 2]; r1 and r2 are random numbers in the interval [0, 1]; S34, solving the fitness function of the updated particles, calculating the value thereof, and then saving the particles with the best objective function in the group; S35, after saving the optimal particle, the population is precociously judged and chaotic search is performed; The expression of the precocious coefficient p is: Among them, f best is the fitness function value of the particle with the best objective function in the group; m is the average fitness function value of all particles of the objective function in the group; If p≤C, then the number of premature times T increases by 1, otherwise T is set to 0; if T≥T max , then the particle swarm is considered premature and chaotic search is performed. The expression is: z i+1 =μz i (1-z i ) Among them, μ is the control variable, μ∈[0,4]; S36: When the requirements for the optimal solution are met, the algorithm is stopped and the optimal solution is output; otherwise, the process goes to step S32 for a cyclic search.

9. A storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method for predicting the corrosion rate in a pipeline as claimed in any one of claims 1 to 8 is implemented.

10. A device for predicting corrosion rate in pipelines, characterized in that: The invention comprises a storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the method for predicting the corrosion rate in a pipeline as claimed in any one of claims 1 to 8.