Method, system and equipment for predicting corrosion rate of buried pipeline and medium

Through the principal component analysis method and particle swarm optimization algorithm combined with the support vector machine model, the correlation function and weight are adaptively selected, which solves the deviation problem caused by artificial parameters in the existing technology, and improves the accuracy and robustness of pipeline corrosion rate prediction.

CN119939136APending Publication Date: 2025-05-06PETROCHINA CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202311456698.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-11-03
Publication Date
2025-05-06

AI Technical Summary

Technical Problem

In the prior art, the pipeline corrosion rate prediction method requires artificial setting of parameters such as correlation function and weight, resulting in a deviation in the result.

Method used

The principal component analysis method is used to extract and reduce the influence data, combine the particle swarm optimization algorithm and support vector machine model, adaptively select the correlation function and weight to build a pipeline corrosion rate prediction model.

Benefits of technology

Eliminate the influence of artificial participation, improve the accuracy of prediction, better deal with nonlinear problems, and enhance the robustness and generalization capabilities of the prediction model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119939136A_ABST
    Figure CN119939136A_ABST
Patent Text Reader

Abstract

The invention discloses a buried pipeline corrosion rate prediction method, system, equipment and medium. The method comprises the following steps: acquiring related influence data in a buried pipeline corrosion process; performing feature extraction and dimension reduction processing on the influence data by using a principal component analysis method, and constructing a total data set; inputting the to-be-processed data in the total data set into a pre-constructed pipeline corrosion rate prediction model to obtain a preset result; wherein the pipeline corrosion rate prediction model is obtained on the basis of an initial prediction model through iteration by using a particle swarm optimization algorithm; the initial prediction model is obtained by learning according to the training set, the test set and the actual corrosion rate in the influence data by using a support vector machine model; a training set and a test set are selected from the total data set. The self-adaptive selection of the correlation function, the weight and other parameters of the prediction model is realized, errors caused by manual setting of the correlation function, the weight and other parameters are avoided, and the accuracy of pipeline corrosion rate prediction is improved.
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 corrosion, and in particular to a method, system, equipment and medium for predicting the corrosion rate of a buried pipeline. Background Art

[0002] The corrosion of pipelines in soil is mainly the corrosion of metals in soil. Soil is a special solid electrolyte with capillary porosity. The cathode process of soil corrosion is oxygen depolarization, specifically oxygen penetrates the solid microporous electrolyte to reach the cathode. This corrosion is an important factor threatening the safety of buried oil pipelines. Predicting the external corrosion rate of metal pipelines will help related companies formulate reasonable measures to ensure the safe operation of pipelines.

[0003] The methods for establishing corrosion rate prediction models in the prior art include probability statistics, regression analysis, and gray system theory. The probability statistics method is based on the probability statistics method to conduct statistical analysis on corrosion data samples, establish a distribution model of corrosion data, determine the correctness of the model through distribution test, and then grasp the range of corrosion data variation. The regression analysis method is based on the regression analysis method to determine the optimal regression equation between the main factors affecting corrosion and the corrosion rate to achieve the purpose of corrosion prediction. Gray system theory is a discipline that developed rapidly in the early 1980s. It is mainly used to solve problems with little data and uncertainty. The characteristics of gray system theory are to weaken randomness and enhance regularity.

[0004] However, the drawback of the above existing methods is that they all require manual setting of parameters such as correlation functions and weights, and the setting of these parameters is often subjective, which may lead to deviations in the results. Summary of the invention

[0005] The embodiments of the present invention provide a method, system, device and medium for predicting the corrosion rate of buried pipelines, which at least partially solve the technical problem in the prior art that artificial setting of parameters such as correlation functions and weights leads to deviation in the results in pipeline corrosion rate prediction, realizes adaptive selection of parameters such as correlation functions and weights, eliminates the influence of human participation, and improves the accuracy of prediction.

[0006] In order to solve the above technical problems, the present invention provides the following technical solutions:

[0007] In a first aspect, the present invention discloses a method for predicting the corrosion rate of a buried pipeline, comprising:

[0008] Obtain relevant impact data on the above buried pipeline corrosion process;

[0009] The principal component analysis method was used to extract features and reduce the dimension of the above impact data to construct the total data set;

[0010] The data to be processed in the total data set is input into a pre-constructed pipeline corrosion rate prediction model to obtain a preset result; wherein the pipeline corrosion rate prediction model is obtained by iteratively using a particle swarm optimization algorithm on the initial prediction model; the initial prediction model is obtained by learning the actual corrosion rates in a training set, a test set and the influencing data using a support vector machine model; the training set and the test set are selected from the total data set.

[0011] Optionally, the principal component analysis method is used to extract features from the above-mentioned influencing data, specifically including:

[0012] The above-mentioned impact data are standardized to obtain standard data;

[0013] Calculate the covariance matrix of the above standard data to obtain the change relationship between multiple variables;

[0014] Perform eigenvalue decomposition on the above covariance matrix to obtain eigenvalues ​​and corresponding eigenvectors.

[0015] Optionally, the principal component analysis method is used to perform dimensionality reduction processing on the above-mentioned influencing data, specifically including:

[0016] Selecting, in descending order, the eigenvectors corresponding to a preset number of the eigenvalues ​​as principal components;

[0017] According to the above principal components, the corresponding above influence data are projected into the space corresponding to the above principal components to construct the above total data set.

[0018] Optionally, the above initial prediction model is constructed according to the following steps:

[0019] Select multiple samples from the above total data set as training sets;

[0020] Based on the test set and the actual corrosion rate, the initial prediction model is obtained by classification learning on the support vector machine constructed in advance.

[0021] Optionally, the above pipeline corrosion rate prediction model is obtained by iteratively using a particle swarm optimization algorithm on the initial prediction model, specifically including:

[0022] The training data is classified using the above support vector machine model to obtain an initial prediction model;

[0023] According to the value range of parameters in the support vector machine model, the parameters of a preset number of particles are randomly initialized;

[0024] The regression error of the above total data set is used as the objective function to calculate the fitness value of each of the above particles;

[0025] Based on the comparison result of the global extreme value of the particle and the fitness value of the current position, the preset update rule is used to iterate and find the target particle that reaches the target fitness value;

[0026] The parameters corresponding to the current position of the target particle are used as parameters of the initial prediction model to obtain the pipeline corrosion rate prediction model.

[0027] Optionally, after obtaining the pipeline corrosion rate prediction model, the method further includes:

[0028] The above test set is brought into the above pipeline corrosion rate prediction model to obtain the predicted value;

[0029] According to the preset evaluation index, the error between the predicted value and the measured value is calculated. If the error is within the preset range, the pipeline corrosion rate prediction model is used to predict the external corrosion rate of the pipeline; otherwise, the pipeline corrosion rate prediction model is retrained.

[0030] Optionally, the above preset evaluation indicators include: root mean square error, mean absolute error and correlation coefficient.

[0031] In a second aspect, the present invention discloses a buried pipeline corrosion rate prediction system, comprising:

[0032] A data acquisition module, used to acquire relevant impact data during the above-mentioned buried pipeline corrosion process;

[0033] The data preprocessing module uses the principal component analysis method to perform feature extraction and dimension reduction on the above-mentioned influencing data to construct a total data set;

[0034] The prediction module is used to input the data to be processed in the above-mentioned total data set into the pre-constructed pipeline corrosion rate prediction model to obtain a preset result; wherein the above-mentioned pipeline corrosion rate prediction model is obtained by iteratively using a particle swarm optimization algorithm on the initial prediction model; the above-mentioned initial prediction model is obtained by learning the actual corrosion rate in the training set, the test set and the above-mentioned influencing data using a support vector machine model; the above-mentioned training set and the above-mentioned test set are selected from the above-mentioned total data set.

[0035] In a third aspect, the present invention discloses an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps corresponding to the method of the first aspect when executing the computer program.

[0036] In a fourth aspect, the present invention discloses a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps corresponding to the above-mentioned method in the first aspect.

[0037] One or more technical solutions provided in the present invention have at least the following technical effects or advantages:

[0038] The technical solution of the present invention uses a support vector machine to train and learn the influencing data in the process of buried pipeline corrosion, thereby obtaining a prediction model, realizing the adaptive selection of parameters such as correlation functions and weights of the prediction model, and avoiding errors caused by artificially setting parameters such as correlation functions and weights. At the same time, because the influencing data of the buried pipeline has a strong nonlinear relationship, the particle swarm optimization algorithm can better handle nonlinear problems, and optimizing the support vector machine based on the particle swarm optimization algorithm can establish a more accurate prediction model. In addition, the principal component analysis method is used to compress high-dimensional data into low-dimensional data, while retaining most of the information of the original data, thereby improving the robustness and generalization ability of the prediction model. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. 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 creative work.

[0040] Figure 1 A flowchart of a method for predicting the corrosion rate of a buried pipeline provided by the present invention;

[0041] Figure 2 It is a relationship diagram between fitness value and evolutionary generation in the present invention;

[0042] Figure 3 A comparison chart of multiple model results in the present invention;

[0043] Figure 4 A schematic diagram of the structure of a buried pipeline corrosion rate prediction system provided by the present invention;

[0044] Figure 5 The present invention provides a schematic structural diagram of an electronic device. DETAILED DESCRIPTION

[0045] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Generally, the components of the embodiments of the present invention described and shown in the drawings here can be arranged and designed in various different configurations.

[0046] Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the invention claimed for protection, but merely represents selected embodiments of the present invention. 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.

[0047] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, further definition and explanation thereof is not required in subsequent drawings.

[0048] It should be understood that the embodiments of the present invention and the specific features in the embodiments are detailed descriptions of the technical solutions of the present application, rather than limitations of the technical solutions of the present application. In the absence of conflict, the embodiments of the present application and the technical features in the embodiments may be combined with each other.

[0049] The technical solution of the embodiment of the present invention is to solve the above technical problems, and the overall idea is as follows:

[0050] The training and learning of support vector machines can avoid errors caused by artificially setting parameters such as correlation functions and weights. At the same time, the particle swarm optimization algorithm is used to optimize the support vector machine to establish a more accurate prediction model. In addition, the principal component analysis method is used to compress high-dimensional data into low-dimensional data to improve the robustness and generalization ability of the prediction model.

[0051] In an embodiment of the present invention, there is provided Figure 1 A method for predicting the corrosion rate of a buried pipeline is shown, the method comprising steps S101 to S103:

[0052] Step S101, obtaining relevant impact data during the corrosion process of the buried pipeline.

[0053] It should be noted that during the corrosion process of buried pipelines, the influencing data mainly include pH value, dissolved oxygen content, self-corrosion potential, total salt content, redox potential, nitrate ion Content, sulfate Ion content and chloride ion Cl - Eight influencing factors such as content.

[0054] Step S102, using principal component analysis to perform feature extraction and dimensionality reduction processing on the influencing data to construct a total data set.

[0055] The purpose of feature extraction is to convert raw data into feature vectors that can better represent the problem. These feature vectors can be used to train machine learning models or perform other types of analysis. By extracting important and relevant features, feature extraction can help reduce the complexity of data and improve the performance of the model. Specifically, the influencing data is standardized so that the mean of each variable is 0 and the standard deviation is 1 to obtain standard data; the covariance matrix of the standard data is calculated to obtain the change relationship between multiple variables, thereby measuring the linear relationship between variables; the covariance matrix is ​​eigenvalue decomposed to obtain the eigenvalue and the corresponding eigenvector.

[0056] The purpose of dimensionality reduction is to compress high-dimensional data into low-dimensional data using principal component analysis, while retaining most of the original data information, which helps to improve the robustness and generalization ability of the prediction model. Specifically, in order from large to small, select the eigenvectors corresponding to the preset number of eigenvalues ​​as the principal components, that is, arrange the selected principal components from large to small according to the size of the eigenvalues, and combine them into a new set of variables; according to the selected principal components, project the corresponding influencing data into the space corresponding to the principal components to achieve data dimensionality reduction and construct a total data set. Take the influencing data of an oil pipeline in a certain place as an example, as shown in Table 1 below.

[0057]

[0058] Table 1

[0059] According to the data in Table 1, pH, Content, Cl - content, The cumulative contribution rate of factors such as pH, content and self-corrosion potential to buried oil pipelines exceeds 90%, so pH, Content, Cl - content, Content and self-corrosion potential are taken as the main components, and the other three influencing data are ignored to construct the sample data set.

[0060] Step S103, input the data to be processed in the total data set into the previously constructed pipeline corrosion rate prediction model to obtain a preset result; wherein the pipeline corrosion rate prediction model is obtained by iteratively using the particle swarm optimization algorithm on the initial prediction model; the initial prediction model is obtained by learning the actual corrosion rate in the training set, the test set and the influencing data using the support vector machine model; the training set and the test set are selected from the total data set. The initial prediction model is constructed according to the following steps:

[0061] Select multiple samples from the total data set as training sets, and the rest as test sets.

[0062] Based on the test set and the actual corrosion rate, the initial prediction model is obtained by classification learning on the support vector machine built in advance. Specifically, the basic principle of the support vector machine model is to use a nonlinear kernel function to map the data and convert the data into a high-dimensional feature space so that the data can be linearly separable in the new feature space. In this way, a linear hyperplane can be applied to fit the new feature space. After training with the training set, the mathematical model of the function after the support vector machine fitting is obtained as follows:

[0063]

[0064] Among them, x is the input variable of the sample, f(x) is the predicted value, and w T (x) is the transposed variable of the output layer, is the kernel function, b is the deviation variable of the sample, b∈R.

[0065] Furthermore, based on the initial prediction model, the particle swarm optimization algorithm is used to iteratively obtain the pipeline corrosion rate prediction model, which specifically includes:

[0066] The training data is classified using a support vector machine model to obtain an initial prediction model. The parameters of a preset number of particles are randomly initialized according to the value range of the parameters in the support vector machine model. The particle parameters include initialization parameters such as the position, speed, local parameter search capability, and maximum population size of each particle.

[0067] The regression error of the total data set is used as the objective function to calculate the fitness value of each particle;

[0068] Based on the comparison result of the global extreme value of the particle and the fitness value of the current position, the preset update rules are used for iteration to find the target particle that reaches the target fitness value. Specifically, for a single particle, the fitness value is compared with the individual extreme value. If its fitness value is better than the historical optimal value of the previous round, the current position replaces the historical optimal position and becomes the new individual extreme value; for multiple particles, each particle's fitness value is compared with the global extreme value. If its fitness value is better than the global optimal fitness value of the previous round, the current position replaces the global optimal position and becomes the new global extreme value. Among them, the better here means closer to the actual result or the preset threshold. Based on the above comparison results, the preset update rules are used for iteration to find the target particle that reaches the target fitness value, where the fitness and evolutionary generations are as follows: Figure 2 As shown. Among them, the preset update rules are:

[0069]

[0070]

[0071] Where V is the velocity of the particle, t is the number of iterations, c1 and c2 are learning constants, r1 and r2 are random variables, is the current position of the particle, is the individual extreme value, Gbest t is the global extreme value.

[0072] Determine whether the termination condition is met. If not, recalculate the fitness value of the particle and continue iterating. Otherwise, stop the calculation and use the parameters corresponding to the current position of the target particle as the parameters of the initial prediction model to obtain the pipeline corrosion rate prediction model.

[0073] Furthermore, after obtaining the pipeline corrosion rate prediction model, its accuracy needs to be verified, so the above method also includes:

[0074] The test set is brought into the pipeline corrosion rate prediction model to obtain the predicted value;

[0075] According to the preset evaluation indicators, including root mean square error RMSE, mean absolute error MAE and correlation coefficient R 2 , calculate the error between the predicted value and the measured value. If the error is within the preset range, the pipeline corrosion rate prediction model is used to predict the external corrosion rate of the pipeline; otherwise, the pipeline corrosion rate prediction model is retrained.

[0076] It should be noted that the present invention adopts a method combining principal component analysis, particle swarm optimization algorithm and support vector machine (referred to as PCA-PSO-SVM). For the prediction of the external corrosion rate of buried pipelines, the composite method of principal component analysis and back propagation (referred to as PCA-BP) and the method combining principal component analysis and support vector machine (referred to as PCA-SVM) can also be used; however, the accuracy of these two methods is lower than that of the present invention. The above models are compared with the data of Shenfu buried oil pipeline. Figure 3 And as shown in Table 2.

[0077]

[0078]

[0079] Table 2

[0080] from Figure 3 As can be seen from Table 2, the PCA-PSO-SVM prediction model is compared with the other two models. It can be found that the prediction evaluation index of PCA-PSO-SVM is improved compared with the other two prediction models, indicating that the prediction accuracy of the present invention is higher than that of the other two models, indicating that the prediction model established by combining principal component analysis, particle swarm optimization algorithm and support vector machine has better prediction performance in predicting the corrosion rate of oil pipelines.

[0081] Based on the same inventive concept, an embodiment of the present invention provides a buried pipeline corrosion rate prediction system, such as Figure 4 As shown, including:

[0082] A data acquisition module 201 is used to acquire relevant impact data during the corrosion process of the buried pipeline;

[0083] The data preprocessing module 202 uses the principal component analysis method to perform feature extraction and dimension reduction processing on the impact data to construct a total data set;

[0084] The prediction module 203 is used to input the data to be processed in the total data set into a pre-constructed pipeline corrosion rate prediction model to obtain a preset result; wherein the pipeline corrosion rate prediction model is obtained by iteratively using a particle swarm optimization algorithm on the initial prediction model; the initial prediction model is obtained by learning the actual corrosion rate in the training set, the test set and the influencing data using a support vector machine model; the training set and the test set are selected from the total data set.

[0085] Based on the same inventive concept, an embodiment of the present invention provides an electronic device, such as Figure 5 As shown, it includes: a memory 302, a processor 301, and a computer program stored in the memory 302 and executable on the processor 301. When the processor 301 executes the computer program, the above-mentioned buried pipeline corrosion rate prediction method is implemented.

[0086] Based on the same inventive concept, this embodiment provides a computer-readable storage medium on which a computer program is stored, characterized in that when the program is executed by a processor, the above-mentioned method for predicting the corrosion rate of a buried pipeline is implemented.

[0087] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0088] Although the preferred embodiments of the present invention have been described, those skilled in the art may make other changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention.

[0089] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.

Claims

1. A method for predicting the corrosion rate of buried pipelines, characterized in that: The method comprises: Obtain relevant impact data during the corrosion process of the buried pipeline; Using principal component analysis to extract features and reduce dimension of the impact data, and constructing a total data set; The data to be processed in the total data set is input into a pre-constructed pipeline corrosion rate prediction model to obtain a preset result; wherein the pipeline corrosion rate prediction model is obtained by iteratively using a particle swarm optimization algorithm on an initial prediction model; the initial prediction model is obtained by learning based on a training set, a test set and actual corrosion rates in the influencing data using a support vector machine model; the training set and the test set are selected from the total data set.

2. The method according to claim 1, characterized in that The extracting features of the influencing data by using the principal component analysis method specifically includes: Performing standardization processing on the impact data to obtain standard data; Calculating the covariance matrix of the standard data to obtain the variation relationship between multiple variables; Perform eigenvalue decomposition on the covariance matrix to obtain eigenvalues ​​and corresponding eigenvectors.

3. The method according to claim 2, characterized in that The dimensionality reduction processing of the influencing data by using the principal component analysis method specifically includes: Selecting, in descending order, the eigenvectors corresponding to a preset number of the eigenvalues ​​as principal components; According to the principal component, the corresponding influencing data is projected into the space corresponding to the principal component to construct the total data set.

4. The method according to any one of claims 1 to 3, characterized in that: The initial prediction model is constructed according to the following steps: Selecting multiple samples from the total data set as training sets; Based on the test set and the actual corrosion rate, the initial prediction model is obtained by classification learning on the support vector machine constructed in advance.

5. The method according to claim 4, characterized in that The pipeline corrosion rate prediction model is obtained by iteratively using a particle swarm optimization algorithm based on the initial prediction model, and specifically includes: Using the support vector machine model to classify the training data to obtain an initial prediction model; According to the value range of parameters in the support vector machine model, the parameters of a preset number of particles are randomly initialized; Taking the regression error of the total data set as the objective function, calculating the fitness value of each particle; Based on the comparison result between the global extreme value of the particle and the fitness value of the current position, iterate using a preset update rule to find a target particle that reaches the target fitness value; The parameters corresponding to the current position of the target particle are used as parameters of the initial prediction model to obtain the pipeline corrosion rate prediction model.

6. The method according to claim 5, characterized in that After obtaining the pipeline corrosion rate prediction model, the method further includes: Bringing the test set into the pipeline corrosion rate prediction model to obtain a predicted value; According to the preset evaluation index, the error between the predicted value and the measured value is calculated. If the error is within the preset range, the pipeline corrosion rate prediction model is used to predict the external corrosion rate of the pipeline; otherwise, the pipeline corrosion rate prediction model is retrained.

7. The method according to claim 6, characterized in that The preset evaluation indicators include: root mean square error, mean absolute error and correlation coefficient.

8. A buried pipeline corrosion rate prediction system, characterized in that: The system comprises: A data acquisition module, used to acquire relevant impact data during the corrosion process of the buried pipeline; A data preprocessing module uses principal component analysis to perform feature extraction and dimensionality reduction on the impact data to construct a total data set; The prediction module is used to input the data to be processed in the total data set into a pre-constructed pipeline corrosion rate prediction model to obtain a preset result; wherein the pipeline corrosion rate prediction model is obtained by iteratively using a particle swarm optimization algorithm on the initial prediction model; the initial prediction model is obtained by learning the actual corrosion rate in the training set, the test set and the influencing data using a support vector machine model; the training set and the test set are selected from the total data set.

9. An electronic device, characterized in that: The electronic device comprises: a memory, a processor and a computer program stored in the memory and executable on the processor, and the processor implements the method steps described in any one of claims 1 to 7 when executing the computer program.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps corresponding to the method according to any one of claims 1 to 7 are implemented.

Citation Information

Cited By

  • Streaming data-based buried pipeline corrosion rate risk assessment method and system

    CN121117468A