An abnormality prediction method, device, electronic equipment and medium for oil and gas pipeline
By combining SVM, ARIMA and MA methods, multiple prediction models are established to comprehensively process the detection parameters of oil and gas pipelines, solving the accuracy and robustness problems of oil and gas pipeline anomaly detection in the existing technology, and realizing efficient anomaly detection of oil and gas pipelines. predict.
Patent Information
- Application Number
- CN202210482464.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-05
- Publication Date
- 2024-09-24
- Estimated Expiration
- 2042-05-05
AI Technical Summary
Existing oil and gas pipeline anomaly detection methods are difficult to accurately identify outliers when faced with complex pressure, temperature and flow data, and it is difficult for a single method to achieve high accuracy, especially when there is noise and difficulty in capturing data patterns.
Combined with the support vector machine (SVM), autoregressive integrated moving average (ARIMA) and moving average (MA) methods, multiple prediction models are established through multiple detection parameters to perform abnormal prediction respectively, and the final target abnormal prediction is determined through the voting method result. SVM is used for feature extraction, ARIMA is used for stationary sequence processing of historical data, and MA is used to reflect time trends, comprehensively improving the accuracy and robustness of detection.
It achieves more accurate and robust prediction of oil and gas pipeline anomalies, can effectively eliminate random fluctuations, improves the adaptability and accuracy of the model, and is suitable for complex oil and gas pipeline network environments.
Smart Images

Figure CN115081673B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of oil and gas and machine learning technology, and in particular to an abnormality prediction method, device, electronic equipment and medium for an oil and gas pipeline. Background Art
[0002] The oil and gas pipeline network that spans east and west, runs north and south, and connects overseas has become an energy artery that promotes economic development and benefits people's livelihood. The safe operation of in-service pipelines has gradually become the focus of the industry. In particular, the monitoring of important parameters such as pressure, temperature, and flow at key nodes in the pipeline network (nodes refer to oil and gas pipelines in the pipeline network), predicting faults and carrying out repairs and maintenance in a timely manner are prerequisites for the healthy operation of the pipeline network.
[0003] However, due to factors such as lightning strikes, cable damage, sensor failure, human interference and other factors affecting the monitoring values of pipeline pressure, flow, etc., the closure or leakage of the root valve of the pressure transformer will cause pressure changes in the process area or the inlet and outlet areas. Insufficient insertion depth of the temperature transformer sleeve, closure or leakage of the root valve, and the influence of external heat sources will cause changes in the temperature of the process area, making the monitoring values abnormal. Not only can it not accurately reflect the actual operating conditions of the on-site working conditions, it can also easily cause misjudgment by the operation and maintenance personnel, and safety hazards cannot be eliminated in time.
[0004] For the above reasons, it is necessary to build a robust method that can accurately identify outliers in pressure or temperature data. Currently, the commonly used outlier detection methods include neural network method, support vector machine, information theory method, self-organizing map method, principal component analysis method, physical model method, statistical method, etc. Model-based anomaly detection method estimates the system by building a mathematical model that is sensitive to specific pattern anomalies, and realizes anomaly detection through the deviation between estimation and measurement, but this method is not scalable and the model can only be used for specific systems.
[0005] The method based on prior knowledge does not rely on mathematical or physical models, but determines the diagnosis results based on expert experience, which is greatly affected by subjectivity. The data-driven method mainly uses various data mining techniques to extract historical data features, and achieves the purpose of anomaly detection by determining the consistency of current data with historical data features. It mainly includes statistical analysis, signal processing and machine learning methods. Among them, the classical statistical analysis method has a mature theoretical basis, a reliable and stable model, and a high algorithm efficiency, but the hyperparameters of the statistical model do not have the ability to update incrementally, and it is difficult to adapt to the changes in nonlinear sequence patterns. Machine learning methods such as multi-layer perceptrons and support vector machines make up for some defects of statistical models, can fit nonlinear data, reduce parameter sensitivity, improve generalization ability, and make the modeling process more intuitive. However, most models still directly fit the function mapping relationship between historical sequence values and predicted values, ignoring the problems of data correlation and fixed window scale in time series. The signal processing method divides the anomaly detection problem into several problems such as signal decomposition, signal enhancement, and signal fitting, and further refines each sub-problem under assumptions, and conducts rigorous physical and mathematical principle derivation. It is the crystallization of wisdom of inductive deduction. However, due to the various strict usage scenarios it sets, it is often not ideal in practical applications. The deep learning method sets the model as a complex nonlinear system, which will have better robustness under the conditions of good design and sufficient training data. Its disadvantages are poor interpretability, and it requires a large amount of labeled data for training, large amount of calculation, and high hardware requirements.
[0006] Therefore, given the complex data response of parameters such as pressure, temperature, flow, etc. in the currently operating oil and gas pipeline network, the presence of a large amount of noise, and the difficulty in capturing data patterns, a single detection method is unlikely to achieve a relatively high level of accuracy. Summary of the invention
[0007] The technical problem to be solved by the present invention is to provide an abnormality prediction method, device, electronic equipment and medium for oil and gas pipelines, aiming to solve at least one of the above problems.
[0008] In the first aspect, the technical solution of the present invention to solve the above technical problem is as follows: a method for predicting abnormality of an oil and gas pipeline, the method comprising:
[0009] Acquire multiple detection parameters of the oil and gas pipeline, the multiple detection parameters including current detection parameters and detection parameters collected multiple times before the current detection parameters;
[0010] According to the plurality of detection parameters, a first abnormality prediction result is obtained by using a first prediction model pre-established based on the SVM method;
[0011] According to the plurality of detection parameters, a second abnormality prediction result is obtained by using a second prediction model pre-established based on the ARIMA method;
[0012] According to the multiple detection parameters, a third abnormality prediction result is obtained by using the MA method;
[0013] A target abnormality prediction result of the oil and gas pipeline at the current time is determined according to the first abnormality prediction result, the second abnormality prediction result and the third abnormality prediction result.
[0014] The beneficial effects of the present invention are as follows: the first prediction model established based on the SVM method has the characteristics of small calculation amount, small storage amount and stable algorithm; the second prediction model established based on the ARIMA method can predict abnormal prediction results based on historical data, and the second prediction model can be updated based on the detection parameters collected after the current time, which further improves the accuracy of the model, making the second abnormal prediction result determined based on the second prediction model more accurate; the MA method can reflect the changing trends of multiple detection parameters within a certain period of time, covering the sudden jump of detection data in most cases, etc., and can effectively eliminate random volatility in the prediction, and can more accurately predict the abnormal prediction results of the oil and gas pipeline based on multiple detection parameters. Therefore, in the present application scheme, the abnormal prediction results obtained by combining the three prediction models can predict the abnormalities of the oil and gas pipeline from different angles, and the obtained target abnormal prediction results are more accurate.
[0015] Based on the above technical solution, the present invention can also be improved as follows.
[0016] Furthermore, the second abnormality prediction result is obtained by using a second prediction model pre-established based on the ARIMA method according to the multiple detection parameters, including:
[0017] Determine whether the multiple detection parameters are a stationary sequence. If the multiple detection parameters are a stationary sequence, obtain a second abnormality prediction result according to the multiple detection parameters through a second prediction model pre-established based on the ARIMA method;
[0018] If the multiple detection parameters are not a stationary sequence, the multiple detection parameters are differentially processed to obtain multiple detection parameters after differential processing, and a second abnormality prediction result is obtained based on the multiple detection parameters after differential processing through a second prediction model pre-established based on the ARIMA method.
[0019] The beneficial effect of adopting the above further solution is that converting multiple detection parameters into a stationary sequence first can more accurately reflect the abnormal characteristics in the detection parameters, so that the second abnormality prediction result can be determined more accurately.
[0020] Furthermore, the above-mentioned differential processing is performed on the multiple detection parameters to obtain the multiple detection parameters after differential processing, including:
[0021] The plurality of detection parameters are differentially processed by means of first-order difference or second-order difference to obtain the plurality of detection parameters after differential processing.
[0022] The beneficial effect of adopting the above further scheme is that the multiple detection parameters can be differentially processed by using the first-order difference or the second-order difference method, and the multiple detection parameters of the non-stationary sequence can be converted into a stationary sequence. The first-order difference or the second-order difference method is simple and effective.
[0023] Furthermore, the first prediction model is trained in the following way:
[0024] Acquire a first training sample, wherein the first training sample includes a plurality of first sample data groups and at least one second sample data group, each first sample data group includes three first sample data that are continuous in time, each sample data in the first training sample is a detection parameter of an oil and gas pipeline, and each first sample data group corresponds to a labeling result, and the labeling result indicates whether the detection parameter of the oil and gas pipeline corresponding to the first sample data group is normal or abnormal;
[0025] Input the first training sample data into the initial SVM model to obtain the predicted abnormality prediction result corresponding to each sample data;
[0026] Determine the first loss value of the initial SVM model according to each predicted abnormal prediction result and the labeling result corresponding to each sample data;
[0027] When the first loss value satisfies a preset first training end condition, the initial SVM model corresponding to the first training end condition is used as the first prediction model; when the first loss value does not meet the first training end condition, the parameters of the initial SVM model are adjusted, and the initial SVM model is retrained according to the adjusted parameters until the first loss value meets the first training end condition;
[0028] The second prediction model is trained in the following way:
[0029] Acquire a second training sample, wherein the second training sample includes a plurality of time-continuous third sample data, the plurality of time-continuous third sample data are stationary sequences, and each third sample data is a detection parameter of an oil and gas pipeline;
[0030] Determine the time correlation between the third sample data according to the third sample data;
[0031] Input the second training sample and each time correlation into the initial ARIMA model to obtain the prediction detection parameter at the next moment corresponding to each third sample data;
[0032] Determine, based on each predicted detection parameter and each third sample data, a difference between each predicted detection parameter and a corresponding true detection parameter;
[0033] Based on each difference, determine the second loss value of the initial ARIMA model;
[0034] When the second loss value meets the preset second training end condition, the initial ARIMA model corresponding to the time when the second training end condition is met is used as the second prediction model. When the second loss value does not meet the second training end condition, the parameters of the initial ARIMA model are adjusted, and the initial ARIMA model is retrained according to the adjusted parameters until the second loss value meets the second training end condition.
[0035] The beneficial effect of adopting the above further scheme is that when the first prediction model is trained, the first training sample selects three time-continuous first sample data and three time-continuous second sample data. It has been verified by experiments that the training is based on three time-continuous first sample data and three time-continuous second sample data. No matter where the abnormal value is in the three sample data, the change of data can be well learned. If more than 3 second sample data are selected, the data change curve may not be obvious, other useless features will be learned, and the difference of abnormal values cannot be highlighted, that is, the first prediction model obtained by training cannot accurately obtain the first abnormal prediction result. The second prediction model can learn the correlation between each third sample data during training, and adopt an unsupervised training method to complete the training of the second prediction model through the difference between each third sample data and the real detection parameter corresponding to the third sample data.
[0036] Furthermore, the method further comprises:
[0037] Acquire fourth sample data acquired after the second training sample;
[0038] updating the second training sample according to the fourth sample data to obtain an updated second training sample;
[0039] The initial ARIMA model is trained according to the updated second training sample to obtain a new second prediction model.
[0040] The beneficial effect of adopting the above further scheme is that the second prediction model can be updated based on the continuous updating of the second training samples, so that the second prediction model continues to learn, and then the second abnormality prediction result can be obtained more accurately based on the updated second prediction model, that is, the new second prediction model.
[0041] Furthermore, the first abnormality prediction result is obtained by using a first prediction model pre-established based on the SVM method according to the multiple detection parameters, including:
[0042] For each detection parameter, extracting a feature vector of the detection parameter through a first prediction model;
[0043] Determine a first abnormality prediction result through a first prediction model according to each feature vector;
[0044] The second abnormality prediction result is obtained by using a second prediction model pre-established based on the ARIMA method according to the multiple detection parameters, including:
[0045] Determine, according to the plurality of detection parameters, a first correlation relationship between the detection parameters corresponding to different times;
[0046] Determine a second abnormality prediction result by a second prediction model according to the plurality of detection parameters and the first association relationship;
[0047] The third abnormality prediction result obtained by the MA method based on multiple detection parameters includes:
[0048] averaging multiple detection parameters to obtain an average value;
[0049] The average value is used as the prediction detection parameter corresponding to the current time;
[0050] A third abnormality prediction result is determined based on the prediction detection parameters.
[0051] The beneficial effect of adopting the above further scheme is that, in the process of predicting the first abnormal prediction result based on the first prediction model, the abnormal characteristics can be reflected based on the characteristic vector of each detection parameter, so that the first abnormal prediction result determined based on the characteristic vector of each detection parameter more accurately reflects the abnormal situation of the oil and gas pipeline, and in the process of predicting the second abnormal prediction result based on the second prediction model, the first correlation between the detection parameters obtained at different times can be taken into account, so that the second abnormal prediction result determined based on the first correlation and the detection parameters is more accurate; in the process of determining the third abnormal prediction result based on the MA method, by averaging multiple detection parameters, the average value obtained can reflect the change trend of each detection parameter over a period of time, so that the third abnormal prediction result determined based on the average value can be more accurate.
[0052] Further, the above-mentioned determination of the target abnormality prediction result of the oil and gas pipeline at the current time according to the first abnormality prediction result, the second abnormality prediction result and the third abnormality prediction result includes:
[0053] According to the first abnormality prediction result, the second abnormality prediction result and the third abnormality prediction result, a target abnormality prediction result of the oil and gas pipeline at the current time is determined by a voting method.
[0054] The beneficial effect of adopting the above further scheme is that the target anomaly prediction result is determined by voting, which can more objectively determine the target anomaly prediction result from various aspects.
[0055] In a second aspect, in order to solve the above technical problems, the present invention further provides an abnormality prediction device for oil and gas pipelines, the device comprising:
[0056] An acquisition module, used to acquire multiple detection parameters of the oil and gas pipeline, wherein the multiple detection parameters include current detection parameters and detection parameters collected multiple times before the current detection parameters;
[0057] A first prediction module, used to obtain a first abnormality prediction result according to a plurality of detection parameters by using a first prediction model pre-established based on a SVM method;
[0058] A second prediction module is used to obtain a second abnormality prediction result according to the plurality of detection parameters by using a second prediction model pre-established based on the ARIMA method, wherein the second prediction model is updated based on the detection parameters collected after the current time;
[0059] A third prediction module, used for obtaining a third abnormality prediction result by using the MA method according to the multiple detection parameters;
[0060] The target abnormality prediction result determination module is used to determine the target abnormality prediction result of the oil and gas pipeline at the current time according to the first abnormality prediction result, the second abnormality prediction result and the third abnormality prediction result.
[0061] In a third aspect, in order to solve the above-mentioned technical problem, the present invention also provides an electronic device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and when the processor executes the computer program, the oil and gas pipeline abnormality prediction method of the present application is implemented.
[0062] In a fourth aspect, in order to solve the above-mentioned technical problem, the present invention further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the oil and gas pipeline abnormality prediction method of the present application is implemented.
[0063] Additional aspects and advantages of the present application will be partially given in the following description, which will become apparent from the following description, or will be understood through the practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0064] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for describing the embodiments of the present invention are briefly introduced below.
[0065] Figure 1A schematic flow chart of an abnormality prediction method for an oil and gas pipeline provided by an embodiment of the present invention;
[0066] Figure 2 A sample number selection diagram for a first prediction model provided by an embodiment of the present invention;
[0067] Figure 3 A schematic diagram of selecting parameters p and q based on BIC provided by one embodiment of the present invention;
[0068] Figure 4 A schematic diagram of a process for determining d and p values using an autocorrelation function and a partial autocorrelation function provided by one embodiment of the present invention;
[0069] Figure 5 A schematic flow chart of another method for predicting abnormality of an oil and gas pipeline provided by an embodiment of the present invention;
[0070] Figure 6 A schematic diagram of the structure of an abnormality prediction device for an oil and gas pipeline provided by one embodiment of the present invention;
[0071] Figure 7 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0072] The principles and features of the present invention are described below. The examples given are only used to explain the present invention and are not used to limit the scope of the present invention.
[0073] The technical solution of the present invention and how the technical solution of the present invention solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present invention will be described below in conjunction with the accompanying drawings.
[0074] The solution provided by the embodiment of the present invention can be applied to any application scenario that requires abnormal prediction of oil and gas pipelines. The solution provided by the embodiment of the present invention can be executed by any electronic device, for example, it can be a user's terminal device, and the terminal device can be any terminal device that can install applications and access web pages through applications, including at least one of the following: smart phones, tablet computers, laptops, desktop computers, smart speakers, smart watches, smart TVs, and smart car devices.
[0075] The embodiment of the present invention provides a possible implementation method, such as Figure 1As shown, a flowchart of an abnormality prediction method for an oil and gas pipeline is provided. The scheme can be executed by any electronic device, for example, a terminal device, or a terminal device and a server (hereinafter referred to as a file server) are jointly executed. For the convenience of description, the method provided by the embodiment of the present invention will be described below by taking the server as the execution subject as an example. Figure 1 The method may include the following steps:
[0076] Step S110, acquiring multiple detection parameters of the oil and gas pipeline, the multiple detection parameters including the current detection parameter and detection parameters collected multiple times before the current detection parameter;
[0077] Step S120, obtaining a first abnormality prediction result according to the plurality of detection parameters by using a first prediction model pre-established based on the SVM method;
[0078] Step S130, obtaining a second abnormality prediction result according to the plurality of detection parameters by using a second prediction model pre-established based on the ARIMA method, wherein the second prediction model is updated based on the detection parameters collected after the current time;
[0079] Step S140, obtaining a third abnormality prediction result by using the MA method according to the multiple detection parameters;
[0080] Step S150, determining a target abnormality prediction result of the oil and gas pipeline at the current time according to the first abnormality prediction result, the second abnormality prediction result and the third abnormality prediction result.
[0081] Through the method of the present invention, the first prediction model established based on the SVM method has the characteristics of small calculation amount, small storage amount and stable algorithm. The second prediction model established based on the ARIMA method can predict abnormal prediction results based on historical data, and the second prediction model can be updated based on the detection parameters collected after the current time, which further improves the accuracy of the model, making the second abnormal prediction result determined based on the second prediction model more accurate. The MA method can reflect the changing trends of multiple detection parameters within a certain period of time, covering the sudden jump of detection data in most cases, etc., and can effectively eliminate random volatility in the prediction, and can more accurately predict the abnormal prediction results of the oil and gas pipeline based on multiple detection parameters. Therefore, in the present application scheme, the abnormal prediction results obtained by combining the three prediction models can predict the abnormalities of the oil and gas pipeline from different angles, and the obtained target abnormal prediction results are more accurate.
[0082] The solution of the present invention is further described below in conjunction with the following specific embodiments. In this embodiment, the abnormality prediction method of the oil and gas pipeline may include the following steps:
[0083] Step S110, acquiring multiple detection parameters of the oil and gas pipeline, the multiple detection parameters including the current detection parameter and detection parameters collected multiple times before the current detection parameter;
[0084] Among them, each detection parameter may include parameters such as pressure, temperature, and flow of an oil and gas pipeline. An oil and gas pipeline refers to a pipeline for transporting oil and gas such as natural gas and petroleum. The detection parameters collected each time may be the same or different. Each collection corresponds to a collection time, and each collection time is before the current time. The detection parameters can be obtained through the sensor corresponding to the oil and gas pipeline. Optionally, the above-mentioned multiple detection parameters can be time-continuous detection parameters collected multiple times before the current time. For example, the multiple detection parameters include detection parameter A and detection parameter B. The collection time corresponding to detection parameter A is t1, and the collection time corresponding to detection parameter B is t2. t1 and t2 are continuous times. Continuous time means that no other detection parameter collections are performed at t1 and t2.
[0085] Step S120, obtaining a first abnormality prediction result according to the plurality of detection parameters through a first prediction model pre-established based on the SVM method.
[0086] Among them, the first abnormality prediction result includes whether the oil and gas pipeline is normal or abnormal. The first abnormality prediction result can be expressed by a percentage. The larger the percentage, the greater the possibility that the oil and gas pipeline is abnormal. Conversely, the smaller the percentage, the smaller the possibility that the oil and gas pipeline is abnormal. The first abnormality prediction result can also be expressed by a classification mark. For example, the classification mark is 0, indicating that the first abnormality prediction result of the oil and gas pipeline is abnormal, and the classification mark is 1, indicating that the first abnormality prediction result of the oil and gas pipeline is normal. The above-mentioned representation method of the first abnormality prediction result is only an example, and other methods of first abnormality prediction results are also included, all of which are within the protection scope of the present invention.
[0087] Optionally, the above step S120 specifically includes: for each detection parameter, extracting a feature vector of the detection parameter through the first prediction model, and determining a first abnormality prediction result through the first prediction model according to each feature vector.
[0088] If the detection parameter includes multiple parameters, a feature vector is extracted for each parameter. The first prediction model can be trained in the following way:
[0089] Acquire a first training sample, wherein the first training sample includes a plurality of first sample data groups, each of which includes three first sample data that are continuous in time, each sample data in the first training sample is a detection parameter of an oil and gas pipeline, and each of which corresponds to a labeling result, and the labeling result indicates whether the detection parameter of the oil and gas pipeline corresponding to the first sample data group is normal or abnormal;
[0090] Inputting the first training sample data into the initial SVM model to obtain the predicted abnormality prediction result corresponding to each sample data group;
[0091] Determine the first loss value of the initial SVM model according to each predicted abnormal prediction result and the labeling result corresponding to each sample data group;
[0092] When the first loss value meets the preset first training end condition, the initial SVM model corresponding to the first training end condition is used as the first prediction model. When the first loss value does not meet the first training end condition, the parameters of the initial SVM model are adjusted, and the initial SVM model is retrained according to the adjusted parameters until the first loss value meets the first training end condition.
[0093] Among them, the selection of the first training sample can be determined based on the detection parameters collected at each time. Among the detection parameters collected at different times, changes in external environment such as temperature or pressure will eventually cause changes in pressure values, which will be reflected in the pressure curve corresponding to the oil and gas pipeline, and fluctuate to varying degrees. Therefore, the change in pressure value is of great significance to the abnormal analysis of oil and gas pipelines. The detection parameters corresponding to the pressure values under abnormal conditions can be used as the second sample data, i.e., negative samples, and the detection parameters corresponding to the pressure values under normal conditions can be used as the first sample data, i.e., positive samples.
[0094] In order to reflect the sequence of sample data, the detection parameters of continuous time can be selected as the first training sample. In the present application scheme, since the SVM method can be used for classification, regression and outlier detection, it has a strong generalization ability for unknown data, especially when the amount of data is small, it has better performance than other traditional machine learning algorithms. Therefore, in order to reduce the amount of data of the first training sample, it has been experimentally verified that each first sample data group in the scheme of the present invention selects 3 time-continuous first sample data. Based on multiple groups of first sample data groups for training, no matter where the outlier is in the three first sample data, the change of data can be well learned. If each group of first sample data groups selects more than 3 first sample data, the data change curve may not be obvious, other useless features will be learned, and the difference of outliers cannot be highlighted, that is, the first prediction model obtained by training cannot accurately obtain the first abnormal prediction result.
[0095] As an example, see Figure 2 As shown, different numbers of first sample data are selected as the broken line of the first sample data group reflecting the jitter of the detection parameter, Figure 2 The value in the horizontal axis represents the first sample data. For example, the value 1 represents the first sample data, and the value 2 represents the second first sample data. The vertical axis represents the sample value. Figure 2 Each first sample data corresponds to a value, and each value corresponds to a value on the vertical axis. The change of the broken line reflects abnormal jitters such as sudden rise or fall of the first sample data. Figure 2 The broken lines a, b and c are the corresponding broken lines when three time-continuous first sample data are selected as a first sample data group. Figure 2 The middle broken line d is the corresponding broken line when 7 time-continuous first sample data are selected as a first sample data group. Figure 2 It can be seen from the broken lines in that, compared with 7 time-continuous first sample data, 3 time-continuous first sample data are sufficient to express abnormal jitters such as sudden rise or fall of sample data, while the sample data corresponding to values 1 to 3 in the 7 time-continuous first sample data have no effect on abnormal judgment. Therefore, in the SVM model, only 3 consecutive first sample data need to be judged to achieve a better abnormal prediction effect.
[0096] In the present application, the first prediction model can be trained by a support vector machine, which is a supervised machine learning algorithm that can be used for classification or regression problems. It uses a technique called kernel technique to transform data, and then finds an optimal boundary between possible outputs based on these transformed data. For each sample data in the first training sample, based on the feature vector corresponding to the sample data and the set threshold (optimal boundary), determine whether the sample data is a positive sample or a negative sample. Specifically, the hyperplane equation on which the linear classifier depends is the following formula (1):
[0097] W T X+b (1)
[0098] The above formula 1 represents the relationship between the feature vector X corresponding to a sample data and the set threshold b, where W is the weight vector, W T represents the transpose of W.
[0099] If the feature vector corresponding to a sample data satisfies the following formula (2), the sample data is determined to be a positive sample, otherwise, the sample data is a negative sample, where formula (2) is:
[0100] W T X+b≥0 (2)
[0101] The first training end condition may be configured based on actual needs, for example, the first loss value is less than a set value.
[0102] The goal of the SVM algorithm is to find a classification hyperplane that can not only correctly classify each sample, but also make the distance between the sample closest to the hyperplane in each category as far as possible. That is, the difference between two sample data of the same type must be maintained, so that the generalization ability of the model is stronger and the robustness is better.
[0103] Step S130, according to the plurality of detection parameters, a second abnormality prediction result is obtained by using a second prediction model pre-established based on the ARIMA method, wherein the second prediction model is updated based on the detection parameters collected after the current time.
[0104] Among them, the second abnormal prediction result may also include whether the oil and gas pipeline is normal or abnormal, and the second abnormal prediction result may also be expressed by a percentage. The larger the percentage, the greater the possibility that the oil and gas pipeline is abnormal. Conversely, the smaller the percentage, the smaller the possibility that the oil and gas pipeline is abnormal. The second abnormal prediction result can also be expressed by a classification mark. For example, the classification mark is 0, indicating that the second abnormal prediction result of the oil and gas pipeline is abnormal, and the classification mark is 1, indicating that the second abnormal prediction result of the oil and gas pipeline is normal. The above-mentioned representation method of the second abnormal prediction result is only an example, and other methods of second abnormal prediction results are also included, all of which are within the protection scope of the present invention.
[0105] The second abnormality prediction result is obtained by using a second prediction model pre-established based on the ARIMA method according to the multiple detection parameters, including:
[0106] Determine whether the multiple detection parameters are a stationary sequence. If the multiple detection parameters are a stationary sequence, obtain a second abnormality prediction result according to the multiple detection parameters through a second prediction model pre-established based on the ARIMA method;
[0107] If the multiple detection parameters are not a stationary sequence, the multiple detection parameters are differentially processed to obtain multiple detection parameters after differential processing, and a second abnormality prediction result is obtained based on the multiple detection parameters after differential processing through a second prediction model pre-established based on the ARIMA method.
[0108] Among them, a stationary sequence refers to a sequence that basically does not have a trend. The observed values in this type of sequence basically fluctuate at a fixed level. Although the degree of fluctuation varies in different time periods, there is no certain pattern, and the fluctuation can be regarded as random. Converting each detection parameter into a stationary sequence can reflect the overall characteristics of each detection parameter through the stationary sequence, thereby more comprehensively reflecting the abnormal information of the oil and gas pipeline.
[0109] In an optional solution of the present invention, the above-mentioned differential processing is performed on multiple detection parameters to obtain multiple detection parameters after differential processing, including:
[0110] The plurality of detection parameters are differentially processed by means of first-order difference or second-order difference to obtain the plurality of detection parameters after differential processing.
[0111] Optionally, the above-mentioned determination of whether the multiple detection parameters are stationary sequences includes:
[0112] The ADF (Augment Dickey-Fuller) unit root test is used to determine whether multiple detection parameters are stationary sequences.
[0113] The second abnormality prediction result is obtained by using a second prediction model pre-established based on the ARIMA method according to the multiple detection parameters, including:
[0114] Determine, according to the plurality of detection parameters, a first correlation relationship between the detection parameters corresponding to different times;
[0115] Determine a second abnormality prediction result by a second prediction model according to the plurality of detection parameters and the first association relationship;
[0116] Among them, the first correlation relationship between each detection parameter, that is, the correlation relationship between the detection parameters obtained at the first time and the detection parameters obtained at the second time can be learned through the second prediction model, wherein the first time is earlier than the second time, so that when the second abnormality prediction result is determined by the second prediction model based on multiple detection parameters and the first correlation relationship, the determined second abnormality prediction result is made more accurate.
[0117] In an optional solution of the present invention, the second prediction model is trained in the following manner:
[0118] Acquire a second training sample, wherein the second training sample includes a plurality of time-continuous third sample data, the plurality of time-continuous third sample data are stationary sequences, and each third sample data is a detection parameter of an oil and gas pipeline;
[0119] Determine the time correlation between the third sample data according to the third sample data;
[0120] Input the second training sample and each time correlation into the initial ARIMA model to obtain the prediction detection parameter at the next moment corresponding to each third sample data;
[0121] Determine, based on each predicted detection parameter and each third sample data, a difference between each predicted detection parameter and a corresponding true detection parameter;
[0122] Based on each difference, determine the second loss value of the initial ARIMA model;
[0123] When the second loss value meets the preset second training end condition, the initial ARIMA model corresponding to the time when the second training end condition is met is used as the second prediction model. When the second loss value does not meet the second training end condition, the parameters of the initial ARIMA model are adjusted, and the initial ARIMA model is retrained according to the adjusted parameters until the second loss value meets the second training end condition.
[0124] The second training sample may include multiple time-continuous third sample data, such as the detection data obtained three months before the current time. The basic idea of the ARIMA model is to regard the data sequence formed by the prediction object over time as a random sequence (time-continuous detection parameters), perform differential integration on it, and then use autoregression plus moving average to fit it to obtain a stationary sequence, and use a mathematical method to predict the future value of the time series based on the stationary sequence.
[0125] As an example, there are three stationary sequences, a1, a2 and a3, a1 is the stationary sequence corresponding to time t1, a2 is the stationary sequence corresponding to time t2, a3 is the stationary sequence corresponding to time t3, t1 is earlier than t2, t2 is earlier than t3, the next moment of t1 is t2, and the next moment of t2 is t3. The predicted detection parameter of a1 at the next moment obtained through the initial ARIMA model is b1, and a2 is the actual detection parameter of a1 at the next moment. The difference between the two detection parameters can be determined based on a2 and b1.
[0126] The above initial ARIMA model can be expressed as ARIMA (p, d, q), where p is the autoregressive term, q is the moving average term, and d is the number of differences made when the time series becomes stable. In the experiment, since the data sequence is tested to be a stable sequence, d is set to 0. In the present application, the autocorrelation function and the partial autocorrelation function are used to determine the values of p and q, and the BIC statistic is used to verify it.
[0127] As an example, see Figure 3 The BIC graph shown, Figure 3 The horizontal axis is the q value, and the vertical axis is the p value. MA0 means q=0, MA1 means q=1, AR0 means p=0, and AR1 means p=1. Figure 3 In the coordinates corresponding to the horizontal and vertical axes, the smaller the value corresponding to the coordinate, the better. Figure 3 From the coordinates in , we can see that the value corresponding to the coordinate (MA0, AR1) is the smallest, so in this solution, q and p are selected as 0 and 1 respectively.
[0128] In the experiment, the autocorrelation function (ACF) can be used to determine the values of p and q. The autocorrelation function can describe the linear correlation between the time series observations and their past observations. Formula (3) is as follows:
[0129]
[0130] Among them, k represents the lag period, y t It represents the first stationary sequence corresponding to time t, y t-k It represents the second stationary sequence corresponding to the tk time, and cov() represents the linear correlation between the first stationary sequence and the second stationary sequence. k represents the autocorrelation coefficient, var(y t ) represents the variance corresponding to the first stationary series.
[0131] From formula (3), we can see that the current value y t is through the historical value y t-k To predict, it reflects the correlation of the same sequence in different time series. Optionally, the autocorrelation function can select the partial autocorrelation function (PACF). By using the partial autocorrelation function, the influence of the random variables between the two stationary sequences can be ignored, and the two variables are strictly considered. At the same time, in the present application scheme, the two indicators of Akaike Information Criterion (AIC) and Bayesian Information Criterion (BIC) can also be used to further confirm the model parameters, and the root mean square error (RMSE) is used to verify the model with different parameters to measure the difference between the value predicted by the ARIMA model and the actual value, and determine the optimal values of the parameters p, d, and q. The experimental results are shown in Table 1. When p=1, d=0, and q=0, RMSE=0.0311 has the smallest mean square error, so the parameters finally selected by the present invention are p=1, d=0, and q=0.
[0132] Table 1 Comparison of model root mean square error under different parameters
[0133] frequency Guidelines p d q Root mean square error 1 ACF、PACF 1 0 0 0.0311 2 AIC 2 0 4 0.0312 3 BIC 1 0 0 0.0311
[0134] Finally, the ARIMA model is used for real-time training, and the trained model is used to make interval predictions for future data. If the actual data is outside the interval, it returns 0 for abnormal data, otherwise it returns 1 for normal data.
[0135] As an example, see Figure 4 The schematic diagram of the process of determining the d and p values corresponding to the autocorrelation function and the partial autocorrelation function shown in FIG. 1 shows the horizontal axis representing the lag value and the vertical axis representing the correlation coefficient value. Figure 4 It can be seen that whether the autocorrelation function ( Figure 4 Autocorrelation as shown in ), or partial autocorrelation function ( Figure 4 PartialAutocorrelation) shown in , when the parameters p, d, q are (1, 0, 0), Figure 4 It can be seen from the horizontal axis that after 0, the data fluctuates around 0, so the values of the parameters d and p are determined to be 0 and 0.
[0136] ARIMA is a time series model that makes predictions based on historical data. The trained model predicts the value of the next moment, and determines whether the monitoring value is abnormal by comparing the confidence interval of the actual value (real detection parameter) with the predicted value (predicted detection parameter). On the basis of the moving average model (MA method), the relationship between the current value and the historical value is added. After converting the non-stationary time series into a stationary time series, the model is established by regressing the dependent variable on its lagged value and the present value and lagged value of the random error term.
[0137] During the training of the second prediction model, as the detection parameters are continuously collected, the second training sample can be updated, thereby updating the second prediction model. Based on this, the method further includes:
[0138] Acquire fourth sample data acquired after the second training sample; update the second training sample according to the fourth sample data to obtain an updated second training sample; train the initial ARIMA model according to the updated second training sample to obtain a new second prediction model.
[0139] Among them, since the sample data in the second training sample have time series, when updating the second training sample, the sample data in the second training sample can be updated with the latest acquired detection parameters (the fourth sample data acquired after the second training sample). As an example, for example, the second training sample is the detection parameters acquired 3 months before the current time. As time goes by, with the new data (new detection parameters) added every day, the queue principle is adopted to remove the first (the earliest) data, and the new data is added to the end of the data list (the data list corresponding to the second sample data, the sample data in the data list is sorted according to the acquisition time, and the first acquired sample data is at the top of the data list) to form a new data set (updated second training sample). In the experiment, the data of the first three months can be selected as the original data set (second training sample), and the new data is replaced every day, that is, the data of the first day is removed, the data of the latest day is added, and the data set (updated second training sample) is reconstructed, and the data is tested for stable serialization, that is, the initial ARIMA model is trained according to the updated second training sample to obtain a new second prediction model.
[0140] Step S140: obtaining a third abnormality prediction result through the MA method according to the multiple detection parameters.
[0141] Optionally, the above step S140 specifically includes: averaging multiple detection parameters to obtain an average value; using the average value as the predicted detection parameter corresponding to the current time; and determining a third abnormality prediction result based on the predicted detection parameter.
[0142] Among them, MA determines whether the monitoring value is an abnormal value by calculating the average value between the data in adjacent areas (the adjacent areas can refer to the time-continuous inspection parameters), and comparing the difference between the new data (referring to the predicted detection parameters obtained based on the average value) and the average value. This can effectively eliminate the random volatility in the prediction and cover the sudden jumps in data in most cases.
[0143] The collected data is used as the training set. The moving average represents the average situation over a period of time, reflecting the trend of the data over a certain period of time. It is calculated based on the time series, item by item, and the time average of a certain number of items is calculated in sequence. The calculation formula (4) of the moving average method used is as follows:
[0144]
[0145] In the formula, Ft represents the predicted value of the next time from the current time (predicted detection parameter), n represents the number of periods of moving average, that is, the number of times the detection parameters are collected before the current time, and a t-n It represents the actual value (real detection parameter) of the previous n periods, and t represents the current time.
[0146] In addition, it should be noted that the execution order of the above steps S120 to S140 is not limited.
[0147] Step S150, determining a target abnormality prediction result of the oil and gas pipeline at the current time according to the first abnormality prediction result, the second abnormality prediction result and the third abnormality prediction result.
[0148] Among them, after obtaining the three abnormal prediction results, the target abnormal prediction result can be determined based on the three abnormal prediction results, for example, according to the preset weight corresponding to each abnormal prediction result, the target abnormal prediction result can be determined by weighted fusion. Alternatively, the target abnormal prediction result of the oil and gas pipeline at the current time can also be determined by voting method based on the first abnormal prediction result, the second abnormal prediction result and the third abnormal prediction result.
[0149] As an example, when the abnormal prediction result is normal, the corresponding identifier is 1, and when the abnormal prediction result is abnormal, the corresponding identifier is 0. If the number of 1s in the three abnormal prediction results is greater than the number of 0s, the target abnormal prediction result is normal. If the number of 0s is greater than the number of 1s, the target abnormal prediction result is abnormal.
[0150] The solution of the present invention does not limit the specific implementation method of determining the target abnormal prediction result according to the first abnormal prediction result, the second abnormal prediction result and the third abnormal prediction result.
[0151] In order to better illustrate and understand the principle of the method provided by the present invention, the scheme of the present invention is described below in conjunction with an optional specific embodiment. It should be noted that the specific implementation of each step in the specific embodiment should not be understood as a limitation to the scheme of the present invention. On the basis of the principle of the scheme provided by the present invention, other implementations that can be thought of by those skilled in the art should also be considered within the scope of protection of the present invention.
[0152] See also Figure 5 The flowchart of the abnormality prediction method for oil and gas pipelines shown in the figure shows that before executing the solution of the present invention, the first prediction model and the second prediction model are firstly trained according to the method described above, wherein the first training sample corresponding to the SVM method requires the annotation of positive and negative samples, and a supervised learning method is adopted, and the second training sample of the ARIMA method does not require any annotation, and an unsupervised learning method is adopted, and the MA method can be used without training; the abnormality prediction method for oil and gas pipelines may include the following steps:
[0153] Step 1: Acquire multiple detection parameters of the oil and gas pipeline, wherein the multiple detection parameters include the current detection parameter and the detection parameters collected multiple times before the current detection parameter, corresponding to Figure 5Alternatively, the time corresponding to the detection parameter to be predicted is taken as the starting point, and the detection parameters corresponding to a period of time are intercepted in the direction of historical data.
[0154] Step 2: According to the plurality of detection parameters, a first prediction model pre-established based on the SVM method is used to obtain a first abnormality prediction result.
[0155] Step 3: According to the multiple detection parameters, a second abnormality prediction result is obtained by using a second prediction model pre-established based on the ARIMA method, wherein the second prediction model is updated based on the detection parameters collected after the current time.
[0156] Step 3 specifically includes the following steps:
[0157] Step 31, perform data preprocessing on multiple detection parameters to obtain preprocessed detection parameters; in this scheme, performing data preprocessing on multiple detection parameters refers to updating the data sets corresponding to the multiple detection parameters. When the latest time data arrives, the earliest time data is removed and the latest time data is added, in order to keep the data set with real-time data.
[0158] Step 32, determine whether the multiple pre-processed detection parameters are a stationary sequence, corresponding to Figure 5 Are the data shown in stationary?
[0159] Step 33: If the multiple pre-processed detection parameters are not stationary sequences, each of the multiple pre-processed detection parameters is subjected to differential processing by means of first-order difference or second-order difference to obtain multiple differentially processed detection parameters, corresponding to Figure 5 The data are differentiated as shown in ;
[0160] Step 34, based on the multiple detection parameters after the difference processing, use ACF or PACF to determine the first correlation relationship between the detection parameters corresponding to different times, corresponding to Figure 5 Pricing the model based on ACF and PACF as shown in;
[0161] Among them, in the second prediction model training process, the Akaike Information Criterion (AIC) and Bayesian Information Criterion (BIC) can be used to further confirm the model parameters, and the root mean square error (RMSE) can be used to verify the model with different parameters to measure the difference between the value predicted by the ARIMA model and the actual value, and determine the optimal values of the parameters p, d, and q. Figure 5Model parameter optimization and model testing shown in .
[0162] Step 35: Determine a second abnormality prediction result according to the first association relationship and the plurality of detection parameters after differential processing.
[0163] Step 4: Based on multiple detection parameters, the MA method ( Figure 5 The MA model shown in ) obtains the third abnormal prediction result;
[0164] Step 5: According to the first abnormal prediction result, the second abnormal prediction result and the third abnormal prediction result, the target abnormal prediction result of the oil and gas pipeline at the current time (corresponding to Figure 5 The final result is obtained by voting on the three model results as shown in ).
[0165] Based on the comprehensive application of three models (the first prediction model, the second prediction model and the MA model), a multi-level recognition model from coarse to fine is realized, and finally the final result is obtained according to the voting principle of minority obeys majority. The integrated method comprehensively considers various situations such as data remaining unchanged for a long time, data jump, data interruption, etc., and obtains satisfactory experimental results. Table 2 shows the results of anomaly detection on test sets with data volumes of 1000, 2000, and 3000. Accuracy is used as the evaluation index, where
[0166] Table 2
[0167] Test data volume SVM MA ARIMA Ensemble methods 1000 85% 91% 90% 92% 2000 88% 92% 91% 93% 3000 88% 90% 90% 92%
[0168] It can be seen from Table 2 that the integrated method has the highest accuracy, wherein the integrated method refers to the scheme of determining the target anomaly prediction result through the first prediction model, the second prediction model and the MA method in the scheme of the present invention.
[0169] The method of the present invention uses Windows service program to extract temperature, pressure, instantaneous flow, opening and other data, and automatically collects the above parameters into SQL Server database through Ethernet in accordance with OPC interface. Use the constructed integrated learning method to judge or predict the data, and judge whether the data is an abnormal value according to the returned 0 or 1 identification value. The method of the present invention uses multiple models for diagnosis from different angles, fully considering multiple factors such as data remaining unchanged for a period of time, data suddenly jumping, data changes, etc., improves the accuracy and generalization of the model, and at the same time, the entire process of data collection, data processing, and data diagnosis is fully automated, which greatly saves manpower, material resources and other resources.
[0170] This method adopts a multi-level abnormal data recognition model, comprehensively considers various situations such as data remaining unchanged for a long time, data jump, data interruption, etc., applies MA and ARIMA methods to the field of abnormal detection of important parameters of oil and gas pipeline networks, and proposes an open integrated learning method that can integrate multiple detection methods to achieve the distribution law of fitting real data from different feature spaces and dimensions, overcoming the limitations of a single method. Based on real data, three groups of experiments showed that the average accuracy of abnormal data diagnosis was 92.3%. Each anomaly detection method has its own advantages and disadvantages, but a single method is difficult to cope with the complex data distribution in the pipeline network. Through integrated learning, three "good and different" learners are combined together, which not only ensures the "accuracy" of individual learners, but also increases the "diversity" of integrated methods. Taking advantage of each other's strengths and avoiding weaknesses and complementing each other are conducive to improving the robustness of the model.
[0171] Based on Figure 1 Based on the same principle as the method shown in , the embodiment of the present invention also provides an abnormality prediction device 20 for oil and gas pipelines, such as Figure 6 As shown in , the abnormality prediction device 20 for the oil and gas pipeline may include an acquisition module 210, a first prediction module 220, a second prediction module 230, a third prediction module 240 and a target abnormality prediction result determination module 250, wherein:
[0172] An acquisition module 210 is used to acquire multiple detection parameters of the oil and gas pipeline, wherein the multiple detection parameters include a current detection parameter and detection parameters collected multiple times before the current detection parameter;
[0173] A first prediction module 220, configured to obtain a first abnormality prediction result according to a plurality of detection parameters by using a first prediction model pre-established based on the SVM method;
[0174] A second prediction module 230, configured to obtain a second abnormality prediction result according to the plurality of detection parameters by using a second prediction model pre-established based on the ARIMA method, wherein the second prediction model is updated based on the detection parameters collected after the current time;
[0175] A third prediction module 240, configured to obtain a third abnormality prediction result by using the MA method according to the multiple detection parameters;
[0176] The target abnormality prediction result determination module 250 is used to determine the target abnormality prediction result of the oil and gas pipeline at the current time according to the first abnormality prediction result, the second abnormality prediction result and the third abnormality prediction result.
[0177] Optionally, when the second prediction module 230 obtains the second abnormality prediction result according to the plurality of detection parameters through a second prediction model pre-established based on the ARIMA method, it is specifically used to:
[0178] Determine whether the multiple detection parameters are stationary sequences. If the multiple detection parameters are stationary sequences, obtain a second abnormal prediction result based on the multiple detection parameters by using a second prediction model pre-established based on the ARIMA method; if the multiple detection parameters are not stationary sequences, perform differential processing on the multiple detection parameters to obtain multiple detection parameters after differential processing, and obtain a second abnormal prediction result based on the multiple detection parameters after differential processing by using a second prediction model pre-established based on the ARIMA method.
[0179] Optionally, when the second prediction module 230 performs differential processing on multiple detection parameters to obtain multiple detection parameters after differential processing, it is specifically used to: perform differential processing on multiple detection parameters by first-order differential or second-order differential method to obtain multiple detection parameters after differential processing.
[0180] Optionally, the device further includes a first training module and a second training module, wherein:
[0181] The first training module is used to obtain a first training sample, wherein the first training sample includes multiple groups of first sample data groups and at least one group of second sample data groups, each group of first sample data groups includes three time-continuous first sample data, each sample data in the first training sample is a detection parameter of an oil and gas pipeline, and each group of first sample data groups corresponds to a labeling result, which characterizes whether the detection parameter of the oil and gas pipeline corresponding to the group of first sample data groups is normal or abnormal; the first training sample data is input into the initial SVM model to obtain a predicted abnormality prediction result corresponding to each sample data; according to each predicted abnormality prediction result and the labeling result corresponding to each sample data, a first loss value of the initial SVM model is determined; when the first loss value meets a preset first training end condition, the initial SVM model corresponding to the first training end condition is used as the first prediction model; when the first loss value does not meet the first training end condition, the parameters of the initial SVM model are adjusted, and the initial SVM model is retrained according to the adjusted parameters until the first loss value meets the first training end condition;
[0182] The second training module is used to obtain a second training sample, wherein the second training sample includes a plurality of time-continuous third sample data, the plurality of time-continuous third sample data are stationary sequences, and each third sample data is a detection parameter of an oil and gas pipeline; according to each third sample data, the time correlation between each third sample data is determined; the second training sample and each time correlation are input into the initial ARIMA model to obtain the predicted detection parameter of the next moment corresponding to each third sample data; according to each predicted detection parameter and each third sample data, the difference between each predicted detection parameter and the corresponding true detection parameter is determined; according to each difference, the second loss value of the initial ARIMA model is determined; when the second loss value meets the preset second training end condition, the initial ARIMA model corresponding to the time when the second training end condition is met is used as the second prediction model, and when the second loss value does not meet the second training end condition, the parameters of the initial ARIMA model are adjusted, and the initial ARIMA model is retrained according to the adjusted parameters until the second loss value meets the second training end condition.
[0183] Optionally, the device also includes an updating module for obtaining fourth sample data obtained after the second training sample; updating the second training sample according to the fourth sample data to obtain an updated second training sample; and training the initial ARIMA model according to the updated second training sample to obtain a new second prediction model.
[0184] Optionally, when the first prediction module 220 obtains the first abnormality prediction result according to the plurality of detection parameters through the first prediction model pre-established based on the SVM method, it is specifically used to: for each detection parameter, extract a feature vector of the detection parameter through the first prediction model; and determine the first abnormality prediction result through the first prediction model according to each feature vector;
[0185] When the second prediction module 230 obtains the second abnormality prediction result according to the multiple detection parameters through the second prediction model pre-established based on the ARIMA method, it is specifically used to: determine the first correlation relationship between the detection parameters corresponding to different times according to the multiple detection parameters; determine the second abnormality prediction result through the second prediction model according to the multiple detection parameters and the first correlation relationship;
[0186] When the third prediction module 240 obtains the third abnormality prediction result through the MA method based on multiple detection parameters, it is specifically used to: average the multiple detection parameters to obtain the average value; use the average value as the predicted detection parameter corresponding to the current time; and determine the third abnormality prediction result based on the predicted detection parameters.
[0187] Optionally, when the target abnormality prediction result determination module 250 determines the target abnormality prediction result of the oil and gas pipeline at the current time based on the first abnormality prediction result, the second abnormality prediction result and the third abnormality prediction result, it is specifically used to: determine the target abnormality prediction result of the oil and gas pipeline at the current time by a voting method based on the first abnormality prediction result, the second abnormality prediction result and the third abnormality prediction result.
[0188] The abnormality prediction device for the oil and gas pipeline of the embodiment of the present invention can execute the abnormality prediction method for the oil and gas pipeline provided by the embodiment of the present invention, and its implementation principle is similar. The actions performed by each module and unit in the abnormality prediction device for the oil and gas pipeline in each embodiment of the present invention correspond to the steps in the abnormality prediction method for the oil and gas pipeline in each embodiment of the present invention. For the detailed functional description of each module of the abnormality prediction device for the oil and gas pipeline, please refer to the description of the corresponding abnormality prediction method for the oil and gas pipeline shown in the previous text, which will not be repeated here.
[0189] Among them, the above-mentioned oil and gas pipeline abnormality prediction device can be a computer program (including program code) running in a computer device, for example, the oil and gas pipeline abnormality prediction device is an application software; the device can be used to execute the corresponding steps in the method provided in the embodiment of the present invention.
[0190] In some embodiments, the abnormality prediction device for the oil and gas pipeline provided by the embodiment of the present invention can be implemented in a combination of software and hardware. As an example, the abnormality prediction device for the oil and gas pipeline provided by the embodiment of the present invention can be a processor in the form of a hardware decoding processor, which is programmed to execute the abnormality prediction method for the oil and gas pipeline provided by the embodiment of the present invention. For example, the processor in the form of a hardware decoding processor can adopt one or more application-specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field programmable gate arrays (FPGAs) or other electronic components.
[0191] In other embodiments, the abnormality prediction device for oil and gas pipelines provided by the embodiments of the present invention can be implemented in software. Figure 6An abnormality prediction device for an oil and gas pipeline stored in a memory is shown, which can be software in the form of a program and a plug-in, and includes a series of modules, including an acquisition module 210, a first prediction module 220, a second prediction module 230, a third prediction module 240 and a target abnormality prediction result determination module 250, for implementing the abnormality prediction method for an oil and gas pipeline provided in an embodiment of the present invention.
[0192] The modules involved in the embodiments of the present invention may be implemented by software or hardware, wherein the name of a module does not limit the module itself in some cases.
[0193] Based on the same principle as the method shown in the embodiments of the present invention, an electronic device is also provided in the embodiments of the present invention, which may include but is not limited to: a processor and a memory; the memory is used to store a computer program; the processor is used to execute the method shown in any embodiment of the present invention by calling the computer program.
[0194] In an alternative embodiment, an electronic device is provided, such as Figure 7 As shown, Figure 7 The electronic device 4000 shown includes: a processor 4001 and a memory 4003. The processor 4001 and the memory 4003 are connected, such as through a bus 4002. Optionally, the electronic device 4000 may also include a transceiver 4004, which may be used for data interaction between the electronic device and other electronic devices, such as data transmission and / or data reception. It should be noted that in actual applications, the transceiver 4004 is not limited to one, and the structure of the electronic device 4000 does not constitute a limitation on the embodiments of the present invention.
[0195] Processor 4001 may be a CPU (Central Processing Unit), a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array) or other programmable logic devices, transistor logic devices, hardware components or any combination thereof. It may implement or execute various exemplary logic blocks, modules and circuits described in conjunction with the disclosure of the present invention. Processor 4001 may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, etc.
[0196] The bus 4002 may include a path to transmit information between the above components. The bus 4002 may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus. The bus 4002 may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 7 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0197] The memory 4003 can be a ROM (Read Only Memory) or other types of static storage devices that can store static information and instructions, a RAM (Random Access Memory) or other types of dynamic storage devices that can store information and instructions, or an EEPROM (Electrically Erasable Programmable Read Only Memory), a CD-ROM (Compact Disc Read Only Memory) or other optical disk storage, optical disk storage (including compressed optical disk, laser disk, optical disk, digital versatile disk, Blu-ray disk, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited to this.
[0198] The memory 4003 is used to store the application code (computer program) for executing the solution of the present invention, and the execution is controlled by the processor 4001. The processor 4001 is used to execute the application code stored in the memory 4003 to implement the content shown in the above method embodiment.
[0199] The electronic device may also be a terminal device. Figure 7 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0200] An embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored. When the computer-readable storage medium is run on a computer, the computer can execute the corresponding contents of the aforementioned method embodiment.
[0201] According to another aspect of the present invention, a computer program product or a computer program is also provided, the computer program product or the computer program comprising computer instructions, the computer instructions being stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the methods provided in the implementation modes of the above-mentioned various embodiments.
[0202] Computer program code for performing the operations of the present invention may be written in one or more programming languages, or a combination thereof, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).
[0203] It should be understood that the flow charts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the method and computer program product according to various embodiments of the present invention. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the module, the program segment, or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a sequence different from that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flow chart, and the combination of the boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0204] The computer-readable storage medium provided by the embodiment of the present invention may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to, an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in conjunction with an instruction execution system, device, or device.
[0205] The computer-readable storage medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device executes the method shown in the above embodiment.
[0206] The above description is only a preferred embodiment of the present invention and an explanation of the technical principles used. Those skilled in the art should understand that the disclosure scope involved in the present invention is not limited to the technical solution formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present invention (but not limited to) by each other.
Claims
1. A method for predicting abnormality of oil and gas pipelines. It is characterized in that The following steps are involved: Acquire multiple detection parameters of the oil and gas pipeline, wherein the multiple detection parameters include a current detection parameter and detection parameters acquired multiple times before the current detection parameter; According to the plurality of detection parameters, a first abnormality prediction result is obtained by using a first prediction model pre-established based on the SVM method; According to the plurality of detection parameters, a second abnormality prediction result is obtained by using a second prediction model pre-established based on the ARIMA method, wherein the second prediction model is updated based on the detection parameters collected after the current time; According to the plurality of detection parameters, obtaining a third abnormality prediction result by using the MA method; Determine a target abnormality prediction result of the oil and gas pipeline at the current time according to the first abnormality prediction result, the second abnormality prediction result and the third abnormality prediction result; The first prediction model is trained in the following way: Acquire a first training sample, wherein the first training sample includes a plurality of first sample data groups and at least one second sample data group, each of the first sample data groups includes three first sample data that are continuous in time, each sample data in the first training sample is a detection parameter of an oil and gas pipeline, each of the first sample data groups corresponds to a labeling result, and the labeling result indicates whether the detection parameter of the oil and gas pipeline corresponding to the first sample data group is normal or abnormal; Inputting the first training sample data into the initial SVM model to obtain a predicted abnormality prediction result corresponding to each sample data; Determining a first loss value of the initial SVM model according to each of the predicted abnormality prediction results and the labeling results corresponding to each of the sample data; When the first loss value satisfies a preset first training end condition, the initial SVM model corresponding to the first training end condition is used as the first prediction model; when the first loss value does not meet the first training end condition, the parameters of the initial SVM model are adjusted, and the initial SVM model is retrained according to the adjusted parameters until the first loss value meets the first training end condition; The second prediction model is trained by: Acquire a second training sample, wherein the second training sample includes a plurality of time-continuous third sample data, the plurality of time-continuous third sample data are stationary sequences, and each of the third sample data is a detection parameter of an oil and gas pipeline; Determining the time correlation between each of the third sample data according to each of the third sample data; Inputting the second training sample and each of the time correlations into the initial ARIMA model to obtain the prediction detection parameter at the next moment corresponding to each of the third sample data; Determine, according to each of the predicted detection parameters and each of the third sample data, a difference between each of the predicted detection parameters and a corresponding true detection parameter; Determining a second loss value of the initial ARIMA model according to each of the differences; When the second loss value satisfies a preset second training end condition, the initial ARIMA model corresponding to the time when the second training end condition is satisfied is used as the second prediction model; when the second loss value does not satisfy the second training end condition, the parameters of the initial ARIMA model are adjusted, and the initial ARIMA model is retrained according to the adjusted parameters until the second loss value satisfies the second training end condition; Determining a target abnormality prediction result of the oil and gas pipeline at the current time according to the first abnormality prediction result, the second abnormality prediction result and the third abnormality prediction result includes: According to the first abnormality prediction result, the second abnormality prediction result and the third abnormality prediction result, a target abnormality prediction result of the oil and gas pipeline at the current time is determined by a voting method.
2. The method according to claim 1, It is characterized in that The second abnormality prediction result is obtained according to the plurality of detection parameters by using a second prediction model pre-established based on the ARIMA method, including: Determine whether the plurality of detection parameters are stationary sequences. If the plurality of detection parameters are stationary sequences, obtain a second abnormality prediction result according to the plurality of detection parameters by using a second prediction model pre-established based on the ARIMA method; If the multiple detection parameters are not a stationary sequence, the multiple detection parameters are differentially processed to obtain multiple detection parameters after differential processing, and based on the multiple detection parameters after differential processing, a second prediction model pre-established based on the ARIMA method is used to obtain a second abnormality prediction result.
3. The method according to claim 2, It is characterized in that The step of performing differential processing on the plurality of detection parameters to obtain a plurality of detection parameters after differential processing includes: The plurality of detection parameters are differentially processed by means of first-order difference or second-order difference to obtain a plurality of detection parameters after differential processing.
4. The method according to claim 1, It is characterized in that Also includes: Acquire fourth sample data acquired after the second training sample; According to the fourth sample data, updating the second training sample to obtain an updated second training sample; The initial ARIMA model is trained according to the updated second training samples to obtain a new second prediction model.
5. The method according to any one of claims 1 to 3, It is characterized in that The first abnormality prediction result is obtained according to the plurality of detection parameters by using a first prediction model pre-established based on the SVM method, including: For each of the detection parameters, extracting a feature vector of the detection parameter by using the first prediction model; Determining the first abnormality prediction result by using the first prediction model according to each of the feature vectors; The second abnormality prediction result is obtained according to the plurality of detection parameters by using a second prediction model pre-established based on the ARIMA method, including: Determining, according to the plurality of detection parameters, a first correlation relationship between the detection parameters corresponding to different times; Determining the second abnormality prediction result by the second prediction model according to the plurality of detection parameters and the first association relationship; The step of obtaining a third abnormality prediction result by using the MA method according to the plurality of detection parameters includes: averaging the plurality of detection parameters to obtain an average value; Using the average value as the prediction detection parameter corresponding to the current time; The third abnormality prediction result is determined according to the prediction detection parameter.
6. An abnormality prediction device for oil and gas pipelines, It is characterized in that The method according to any one of claims 1 to 5, wherein the device comprises: An acquisition module, used to acquire multiple detection parameters of the oil and gas pipeline, wherein the multiple detection parameters include a current detection parameter and detection parameters acquired multiple times before the current detection parameter; A first prediction module, used to obtain a first abnormality prediction result according to a plurality of detection parameters by using a first prediction model pre-established based on a SVM method; A second prediction module is used to obtain a second abnormality prediction result according to the plurality of detection parameters by using a second prediction model pre-established based on the ARIMA method, wherein the second prediction model is updated based on the detection parameters collected after the current time; A third prediction module, used for obtaining a third abnormality prediction result by using the MA method according to the multiple detection parameters; The target abnormality prediction result determination module is used to determine the target abnormality prediction result of the oil and gas pipeline at the current time according to the first abnormality prediction result, the second abnormality prediction result and the third abnormality prediction result.
7. An electronic device, It is characterized in that The invention comprises a memory, a processor and a computer program stored in the memory and executable on the processor, and the method according to any one of claims 1 to 5 is implemented when the processor executes the computer program.
8. A computer-readable storage medium, It is characterized in that A computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the method of any one of claims 1 to 5 is implemented.
