CN115081673A - Oil and gas pipeline abnormity prediction method and device, electronic equipment and medium - Google Patents

Oil and gas pipeline abnormity prediction method and device, electronic equipment and medium Download PDF

Info

Publication number
CN115081673A
CN115081673A CN202210482464.5A CN202210482464A CN115081673A CN 115081673 A CN115081673 A CN 115081673A CN 202210482464 A CN202210482464 A CN 202210482464A CN 115081673 A CN115081673 A CN 115081673A
Authority
CN
China
Prior art keywords
prediction result
detection parameters
prediction
abnormal
model
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210482464.5A
Other languages
Chinese (zh)
Inventor
张丽稳
杨喜良
吴张中
张兴
李华
郑洪龙
魏然然
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Oil and Gas Pipeline Network Corp
National Pipe Network Group North Pipeline Co Ltd
Original Assignee
China Oil and Gas Pipeline Network Corp
National Pipe Network Group North Pipeline Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Oil and Gas Pipeline Network Corp, National Pipe Network Group North Pipeline Co Ltd filed Critical China Oil and Gas Pipeline Network Corp
Priority to CN202210482464.5A priority Critical patent/CN115081673A/en
Publication of CN115081673A publication Critical patent/CN115081673A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q10/00Administration; Management
    • G06Q10/04Forecasting or optimisation specially adapted for administrative or management purposes, e.g. linear programming or "cutting stock problem"
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q10/00Administration; Management
    • G06Q10/20Administration of product repair or maintenance
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q50/00Information and communication technology [ICT] specially adapted for implementation of business processes of specific business sectors, e.g. utilities or tourism
    • G06Q50/06Energy or water supply

Landscapes

  • Business, Economics & Management (AREA)
  • Engineering & Computer Science (AREA)
  • Human Resources & Organizations (AREA)
  • Economics (AREA)
  • Strategic Management (AREA)
  • Physics & Mathematics (AREA)
  • General Business, Economics & Management (AREA)
  • Theoretical Computer Science (AREA)
  • Marketing (AREA)
  • Tourism & Hospitality (AREA)
  • General Physics & Mathematics (AREA)
  • Health & Medical Sciences (AREA)
  • Entrepreneurship & Innovation (AREA)
  • Quality & Reliability (AREA)
  • Operations Research (AREA)
  • Public Health (AREA)
  • Water Supply & Treatment (AREA)
  • General Health & Medical Sciences (AREA)
  • Primary Health Care (AREA)
  • Development Economics (AREA)
  • Game Theory and Decision Science (AREA)
  • Testing And Monitoring For Control Systems (AREA)

Abstract

The invention relates to an anomaly prediction method, an anomaly prediction device, electronic equipment and a medium for an oil-gas pipeline, wherein the method comprises the following steps: acquiring a plurality of detection parameters of the oil and gas pipeline, wherein the plurality of detection parameters comprise a current detection parameter and detection parameters acquired for a plurality of times before the current detection parameter; according to the detection parameters, obtaining a first abnormal prediction result through a first prediction model which is established in advance based on an SVM method; according to the detection parameters, a second abnormal prediction result is obtained through a second prediction model which is established in advance based on an ARIMA method; obtaining a third abnormal prediction result by an MA method according to a plurality of detection parameters; and determining a target abnormal prediction result of the oil and gas pipeline at the current time according to the first abnormal prediction result, the second abnormal prediction result and the third abnormal prediction result. According to the method, three different methods are combined to carry out abnormity prediction, and the abnormity of the oil and gas pipeline is predicted from different angles, so that the target abnormity prediction result is more accurate.

Description

Oil and gas pipeline abnormity prediction method and device, electronic equipment and medium
Technical Field
The invention relates to the technical field of oil gas and machine learning, in particular to an abnormity prediction method and device of an oil gas pipeline, electronic equipment and a medium.
Background
The layout of oil and gas pipelines crossing east and west, passing north and south and communicating overseas becomes an energy artery for promoting economic development and benefiting the lives, and the safe operation of in-service pipelines gradually becomes the focus of attention of the industry. Especially, monitoring of important parameters such as pressure, temperature and flow of key nodes (nodes refer to oil and gas pipelines in the pipe network) in the pipe network, prejudging faults and timely maintaining are the precondition for healthy operation of the pipe network.
However, because factors such as lightning strike, cable damage, sensor failure, human interference and the like affect monitoring values such as pressure and flow of a pipeline, the pressure-variable root valve is closed or leaks air, which causes pressure change of a process area or an access station area, the insertion depth of a temperature-variable sleeve is insufficient, the root valve is closed or leaks air, and the influence of an external heat source and the like, which causes temperature change of the process area, so that the monitoring values are abnormal, not only can the actual operation condition of the site operation condition not be accurately reflected, but also misjudgment of operation and maintenance personnel is easily caused, and potential safety hazards cannot be timely eliminated.
Based on the reasons, a method with strong robustness needs to be constructed, and abnormal values of pressure or temperature data can be accurately identified. The current commonly used abnormal value detection methods include a neural network method, a support vector machine, an information theory method, a self-organization mapping method, a principal component analysis method, a physical model method, a statistical method and the like. The model-based anomaly detection method estimates a system by constructing a mathematical model sensitive to a specific pattern anomaly and implements anomaly detection by the deviation between estimation and measurement, but the method is not extensible and the model can only be used for a specific system.
The prior knowledge-based method does not rely on a mathematical or physical model, but determines the diagnosis result according to expert experience, and is influenced by subjectivity greatly. The data-driven method mainly uses various data mining technologies to extract historical data features, achieves the purpose of anomaly detection by judging the consistency of current data and the historical data features, and mainly comprises statistical analysis, signal processing and machine learning methods. The classical statistical analysis method has a mature theoretical basis, the model is reliable and stable, the algorithm efficiency is high, but the hyper-parameters of the statistical model have no incremental updating capability, and the statistical model is difficult to adapt to the change of a nonlinear sequence mode. The machine learning method such as a multilayer perceptron, a support vector machine and other models makes up for some defects of a statistical model, can fit nonlinear data, reduces the sensitivity of parameters, improves the generalization capability, and has a more visual modeling process. But most models still directly fit the functional mapping relation between the historical sequence values and the values to be predicted, and the problems of data correlation and fixed window scale in the time sequence are ignored. The signal processing method divides the abnormal detection problem into a plurality of problems such as signal decomposition, signal enhancement, signal fitting and the like, further refines each subproblem under the assumed condition, and carries out strict derivation of physical and mathematical principles, thereby being an intelligent crystal for inductive deduction. However, since various strict usage scenarios are set, the method is not ideal in practical application. The deep learning method sets the model as a complex nonlinear system, has better robustness under the conditions of good design and sufficient training data, has the defects of poor interpretability, needs a large amount of labeled data for training, and has large computation amount and high requirement on hardware.
Therefore, in view of the characteristics that the data of parameters such as pressure, temperature and flow in the currently operated oil-gas pipe network are complex to deal with, a large amount of noise exists, the data rule is not easy to capture, and the like, a single detection method is difficult to achieve high accuracy.
Disclosure of Invention
The invention aims to solve the technical problem of providing an oil-gas pipeline abnormity prediction method, an oil-gas pipeline abnormity prediction device, electronic equipment and a medium, and aims to solve at least one problem.
In a first aspect, the technical solution for solving the above technical problem of the present invention is as follows: a method of predicting an anomaly in an oil and gas pipeline, the method comprising:
acquiring a plurality of detection parameters of the oil and gas pipeline, wherein the plurality of detection parameters comprise a current detection parameter and detection parameters acquired for a plurality of times before the current detection parameter;
according to the detection parameters, obtaining a first abnormal prediction result through a first prediction model which is established in advance based on an SVM method;
according to the detection parameters, a second abnormal prediction result is obtained through a second prediction model which is established in advance based on an ARIMA method;
obtaining a third abnormal prediction result by an MA method according to a plurality of detection parameters;
and determining a target abnormal prediction result of the oil and gas pipeline at the current time according to the first abnormal prediction result, the second abnormal prediction result and the third abnormal prediction result.
The invention has the beneficial effects that: the first prediction model established based on the SVM method has the characteristics of small calculated amount, small storage amount and stable algorithm, the second prediction model established based on the ARIMA method can predict the abnormal prediction result based on historical data, and can be updated based on the detection parameters acquired after the current time, so that the accuracy of the model is further improved, the second abnormal prediction result determined based on the second prediction model is more accurate, the MA method can reflect the variation trend of a plurality of detection parameters in a certain time, the conditions of sudden jump of the detection data and the like under most of conditions are covered, the random fluctuation in prediction can be effectively eliminated, the abnormal prediction result of the oil and gas pipeline can be predicted more accurately according to the plurality of detection parameters, therefore, the abnormal prediction result obtained by combining three prediction models in the scheme of the application, the method can predict the abnormity of the oil and gas pipeline from different angles, and the obtained target abnormity prediction result is more accurate.
On the basis of the technical scheme, the invention can be further improved as follows.
Further, the obtaining a second anomaly prediction result through a second prediction model established in advance based on the ARIMA method according to the plurality of detection parameters includes:
determining whether the plurality of detection parameters are stable sequences or not, and if the plurality of detection parameters are stable sequences, obtaining a second abnormal prediction result through a second prediction model which is established in advance based on an ARIMA method according to the plurality of detection parameters;
and if the plurality of detection parameters are not stable sequences, carrying out differential processing on the plurality of detection parameters to obtain a plurality of detection parameters after differential processing, and obtaining a second abnormal prediction result through a second prediction model established in advance based on an ARIMA method according to the plurality of detection parameters after differential processing.
The method has the advantages that the detection parameters are converted into the stable sequences, so that the abnormal characteristics in the detection parameters can be reflected more accurately, and the second abnormal prediction result can be determined more accurately.
Further, the performing the difference processing on the plurality of detection parameters to obtain the plurality of detection parameters after the difference processing includes:
and carrying out differential processing on the plurality of detection parameters in a first-order difference or second-order difference mode to obtain a plurality of detection parameters after differential processing.
The method has the advantages that the method can adopt a first-order difference or second-order difference mode to carry out difference processing on a plurality of detection parameters, converts a plurality of detection parameters of a non-stationary sequence into a stationary sequence, adopts the first-order difference or second-order difference mode, and is simple and effective.
Further, the first prediction model is obtained by training in the following way:
acquiring a first training sample, wherein the first training sample comprises a plurality of groups of first sample data groups and at least one group of second sample data group, each group of first sample data groups comprises three first sample data which are continuous in time, each sample data in the first training sample is a detection parameter of an oil and gas pipeline, each group of first sample data groups corresponds to a labeling result, and the labeling result represents that the detection parameter of the oil and gas pipeline corresponding to the group of first sample data groups is normal or abnormal;
inputting first training sample data into an initial SVM model to obtain a prediction abnormity prediction result corresponding to each sample data;
determining a first loss value of the initial SVM model according to each abnormal prediction result and each labeled result corresponding to the sample data;
when the first loss value meets a preset first training end condition, taking the initial SVM model corresponding to the first training end condition as a first prediction model, when the first loss value does not meet the first training end condition, adjusting parameters of the initial SVM model, and retraining the initial SVM model according to the adjusted parameters until the first loss value meets the first training end condition;
the second prediction model is obtained by training in the following way:
acquiring a second training sample, wherein the second training sample comprises a plurality of time-continuous third sample data, the plurality of time-continuous third sample data are stable sequences, and each third sample data is a detection parameter of the oil and gas pipeline;
determining the time correlation among the third sample data according to the third sample data;
inputting the second training sample and each time correlation into the initial ARIMA model to obtain a predicted detection parameter of the next moment corresponding to each third sample data;
determining the difference between each predicted detection parameter and the corresponding real detection parameter according to each predicted detection parameter and each third sample data;
determining a second loss value of the initial ARIMA model according to the differences;
and when the second loss value meets a preset second training end condition, taking the initial ARIMA model corresponding to the second training end condition as a second prediction model, when the second loss value does not meet the second training end condition, adjusting the parameters of the initial ARIMA model, and retraining the initial ARIMA model according to the adjusted parameters until the second loss value meets the second training end condition.
The method has the advantages that when the first prediction model is trained, the first training sample selects three first sample data and three second sample data which are continuous in time, and the training is carried out based on the three first sample data and the three second sample data which are continuous in time through experimental verification, so that the change of data can be well learned no matter where the abnormal value is located in the three sample data, and if a plurality of second sample data which are larger than 3 are selected, the data change curve is possibly unobvious, other useless features can be learned, and the difference of the abnormal value cannot be highlighted, namely the first prediction model obtained through training cannot accurately obtain the first abnormal prediction result. The second prediction model can learn the incidence relation among the third sample data during training, and the training of the second prediction model is completed through the difference between the real detection parameters corresponding to each third sample data and the third sample data by adopting an unsupervised training mode.
Further, the method also includes:
acquiring fourth sample data acquired 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.
The beneficial effect of adopting the above further scheme is that the second prediction model can be updated based on the continuous update of the second training sample, so that the second prediction model can be continuously learned, and further the second abnormal prediction result can be more accurately obtained based on the updated second prediction model, namely the new second prediction model.
Further, the obtaining a first anomaly prediction result through a first prediction model established in advance based on an SVM method according to the plurality of detection parameters includes:
for each detection parameter, extracting a feature vector of the detection parameter through a first prediction model;
determining a first abnormal prediction result through a first prediction model according to each feature vector;
the obtaining of the second abnormal prediction result through the second prediction model established in advance based on the ARIMA method according to the plurality of detection parameters includes:
determining a first association relation between each detection parameter corresponding to different times according to the plurality of detection parameters;
determining a second abnormal prediction result through a second prediction model according to the detection parameters and the first incidence relation;
the obtaining of the third anomaly prediction result by the MA method based on the plurality of detection parameters includes:
averaging a plurality of detection parameters to obtain an average value;
taking the average value as a prediction detection parameter corresponding to the current time;
and determining a third abnormal prediction result according to the prediction detection parameters.
The method has the advantages that in the process of predicting the first abnormal prediction result based on the first prediction model, abnormal features can be reflected based on the feature vectors of all detection parameters, so that the first abnormal prediction result determined based on the feature vectors of all the detection parameters can reflect abnormal conditions of oil and gas pipelines more accurately, and in the process of predicting the second abnormal prediction result based on the second prediction model, the first incidence relation among all the detection parameters obtained at different time can be considered, so that the second abnormal prediction result determined based on all the first incidence relation and all the detection parameters is more accurate; in the process of determining the third abnormal prediction result based on the MA method, the average value of a plurality of detection parameters can reflect the change trend of each detection parameter in a period of time through the obtained average value, so that the third abnormal prediction result determined based on the average value can be more accurate.
Further, the determining a target abnormal prediction result of the oil and gas pipeline at the current time according to the first abnormal prediction result, the second abnormal prediction result and the third abnormal prediction result comprises:
and determining a target abnormal prediction result of the oil and gas pipeline at the current time by a voting method according to the first abnormal prediction result, the second abnormal prediction result and the third abnormal prediction result.
The method has the advantages that the target abnormity prediction result is determined in a voting mode, and the target abnormity prediction result can be determined objectively from various aspects.
In a second aspect, the present invention provides an apparatus for predicting an anomaly of an oil and gas pipeline, the apparatus comprising:
the acquisition module is used for acquiring a plurality of detection parameters of the oil and gas pipeline, wherein the plurality of detection parameters comprise the current detection parameter and detection parameters acquired for a plurality of times before the current detection parameter;
the first prediction module is used for obtaining a first abnormal prediction result through a first prediction model which is established in advance based on an SVM method according to a plurality of detection parameters;
the second prediction module is used for obtaining a second abnormal prediction result through a second prediction model which is established in advance based on an ARIMA method according to the plurality of detection parameters, wherein the second prediction model is updated based on the detection parameters acquired after the current time;
the third prediction module is used for obtaining a third abnormal prediction result through an MA method according to the plurality of detection parameters;
and the target anomaly prediction result determining module is used for determining a target anomaly prediction result of the oil and gas pipeline at the current time according to the first anomaly prediction result, the second anomaly prediction result and the third anomaly prediction result.
In a third aspect, the present invention further provides an electronic device to solve the above technical problem, where the electronic device 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 method for predicting an anomaly of an oil and gas pipeline according to the present application is implemented.
In a fourth aspect, the present invention further provides a computer readable storage medium, which stores a computer program, and when the computer program is executed by a processor, the computer program implements the anomaly prediction method for a hydrocarbon pipeline of the present application.
Additional aspects and advantages of the present application will be set forth in part in the description which follows and, in part, will be obvious from the description, or may be learned by practice of the present application.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings used in the description of the embodiments of the present invention will be briefly described below.
FIG. 1 is a schematic flow chart of a method for predicting an anomaly of an oil and gas pipeline according to an embodiment of the present invention;
FIG. 2 is a diagram illustrating a sample number selection for a first prediction model according to an embodiment of the present invention;
FIG. 3 is a diagram illustrating the selection of parameters p and q based on BIC according to an embodiment of the present invention;
FIG. 4 is a diagram illustrating a process for determining d and p values using an autocorrelation function and a partial autocorrelation function according to an embodiment of the present invention;
FIG. 5 is a schematic flow chart of a further method for predicting anomalies in an oil and gas pipeline according to an embodiment of the present disclosure;
FIG. 6 is a schematic structural diagram of an anomaly prediction device for an oil and gas pipeline according to an embodiment of the invention;
fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The principles and features of this invention are described below in conjunction with examples which are set forth to illustrate, but are not to be construed to limit the scope of the invention.
The technical solution of the present invention and how to solve the above technical problems will be described in detail with specific embodiments below. The following several specific embodiments may be combined with each other, and details of the same or similar concepts or processes may not be repeated in some embodiments. Embodiments of the present invention will be described below with reference to the accompanying drawings.
The scheme provided by the embodiment of the invention can be applied to any application scene needing to carry out abnormity prediction on the oil and gas pipeline. The scheme provided by the embodiment of the invention can be executed by any electronic equipment, for example, the scheme can be a terminal device of a user, the terminal device can be any terminal device which can be installed with an application and can access a webpage through the application, and the scheme comprises at least one of the following items: smart phones, tablet computers, notebook computers, desktop computers, smart speakers, smart watches, smart televisions, and smart car-mounted devices.
An embodiment of the present invention provides a possible implementation manner, and as shown in fig. 1, provides a flowchart of an anomaly prediction method for an oil and gas pipeline, where the method may be executed by any electronic device, for example, may be a terminal device, or may be executed by both the terminal device and a server (hereinafter, may be referred to as a file server). For convenience of description, the method provided by the embodiment of the present invention will be described below by taking a server as an execution subject, and as shown in the flowchart shown in fig. 1, the method may include the following steps:
step S110, acquiring a plurality of detection parameters of the oil and gas pipeline, wherein the plurality of detection parameters comprise a current detection parameter and detection parameters acquired for multiple times before the current detection parameter;
step S120, according to a plurality of detection parameters, obtaining a first abnormal prediction result through a first prediction model established in advance based on an SVM method;
step S130, according to the plurality of detection parameters, obtaining a second abnormal prediction result through a second prediction model established in advance based on an ARIMA method, wherein the second prediction model is updated based on the detection parameters acquired after the current time;
step S140, obtaining a third abnormal prediction result by an MA method according to a plurality of detection parameters;
and S150, determining a target abnormal prediction result of the oil and gas pipeline at the current time according to the first abnormal prediction result, the second abnormal prediction result and the third abnormal prediction result.
By the method, the first prediction model established based on the SVM method has the characteristics of small calculated amount, small storage amount and stable algorithm, the second prediction model established based on the ARIMA method can predict the abnormal prediction result based on historical data, the second prediction model can be updated based on the detection parameters acquired after the current time, the accuracy of the model is further improved, the second abnormal prediction result determined based on the second prediction model is more accurate, the MA method can reflect the change trend of a plurality of detection parameters in a certain time, the conditions of sudden jump of the detection data and the like under most conditions are covered, the random fluctuation in prediction can be effectively eliminated, the abnormal prediction result of the oil and gas pipeline can be predicted more accurately according to the plurality of detection parameters, therefore, the abnormal prediction result obtained by the three prediction models is combined in the scheme of the method, the method can predict the abnormity of the oil-gas pipeline from different angles, and the obtained target abnormity prediction result is more accurate.
The present invention will be further described with reference to the following specific examples, in which the method for predicting the abnormality of the oil and gas pipeline may include the following steps:
step S110, acquiring a plurality of detection parameters of the oil and gas pipeline, wherein the plurality of detection parameters comprise a current detection parameter and detection parameters acquired for multiple times before the current detection parameter;
each detection parameter can comprise parameters such as pressure, temperature and flow of an oil and gas pipeline, the oil and gas pipeline refers to a pipeline for transporting oil and gas such as natural gas and petroleum, and the detection parameters acquired each time can be the same or different. Each acquisition corresponds to one acquisition time, each acquisition time is before the current time, and the detection parameters can be acquired through the sensors corresponding to the oil and gas pipelines. Optionally, the multiple detection parameters may be detection parameters acquired multiple times before the current time, and for example, the multiple detection parameters include a detection parameter a and a detection parameter B, the acquisition time corresponding to the detection parameter a is t1, the acquisition time corresponding to the detection parameter B is t2, and t1 and t2 are continuous times, where the continuous times mean that no other times of detection parameter acquisition is performed at t1 and t 2.
Step S120, according to the plurality of detection parameters, a first abnormal prediction result is obtained through a first prediction model established in advance based on an SVM method.
The first abnormity prediction result comprises whether the oil and gas pipeline is normal or abnormal, the first abnormity prediction result can be represented by a percentage, the larger the percentage is, the higher the possibility that the oil and gas pipeline is abnormal is, and conversely, the smaller the percentage is, the lower the possibility that the oil and gas pipeline is abnormal is. The first anomaly prediction result may also be represented by a classification identifier, for example, the classification identifier is 0, the first anomaly prediction result of the oil and gas pipeline is represented as an anomaly, the classification identifier is 1, the first anomaly prediction result of the oil and gas pipeline is represented as a normal, the representation manner of the first anomaly prediction result is only an example, and the first anomaly prediction result also includes other manners, which are within the protection scope of the present invention.
Optionally, the step S120 specifically includes: and for each detection parameter, extracting a feature vector of the detection parameter through a first prediction model, and determining a first abnormal prediction result through the first prediction model according to each feature vector.
And if the detection parameters comprise a plurality of parameters, extracting a feature vector for each parameter. The first prediction model can be obtained by training in the following way:
acquiring a first training sample, wherein the first training sample comprises a plurality of groups of first sample data groups, each group of first sample data groups comprises three first sample data which are continuous in time, each sample data in the first training sample is a detection parameter of an oil-gas pipeline, each group of first sample data groups corresponds to a labeling result, and the labeling result represents that the detection parameter of the oil-gas pipeline corresponding to the group of first sample data groups is normal or abnormal;
inputting first training sample data into an initial SVM model to obtain a prediction abnormity prediction result corresponding to each sample data set;
determining a first loss value of the initial SVM model according to each abnormal prediction result and the labeling result corresponding to each sample data group;
and when the first loss value meets a preset first training end condition, taking the initial SVM model corresponding to the first training end condition as a first prediction model, when the first loss value does not meet the first training end condition, adjusting parameters of the initial SVM model, and retraining the initial SVM model according to the adjusted parameters until the first loss value meets the first training end condition.
The selection of the first training sample can be determined based on the acquired detection parameters acquired at each time, and in the detection parameters acquired at different times, the pressure value is finally changed due to the change of external environments such as temperature or pressure and the like, and is reflected on the pressure curve corresponding to the oil and gas pipeline, and fluctuation of different degrees occurs, so that the method has important significance for the abnormal analysis of the oil and gas pipeline based on the change of the pressure value, the detection parameter corresponding to the pressure value under the abnormal condition can be used as a second sample data, namely a negative sample, and the detection parameter corresponding to the pressure value under the normal condition can be used as a first sample data, namely a positive sample.
In order to reflect the sequence of sample data, a detection parameter of continuous time can be selected as a first training sample, in the scheme of the application, as the SVM method can be used for classification and can also be used for regression and abnormal value detection, the unknown data has strong generalization capability, and particularly under the condition of less data volume, the method has better performance compared with other traditional machine learning algorithms. Therefore, to reduce the data size of the first training sample, it was experimentally verified that 3 temporally consecutive first sample data were selected for each first sample data set in the inventive scheme. The data change can be well learned no matter where the abnormal value is located in the three first sample data by training based on the multiple groups of first sample data groups, and if the multiple groups of first sample data groups select more than 3 first sample data, the data change curve may be unobvious, other useless features may be learned, the difference of the abnormal value cannot be highlighted, namely, the first abnormal prediction result cannot be accurately obtained by the trained first prediction model.
As an example, referring to a broken line shown in fig. 2, different numbers of first sample data are selected as the first sample data group to reflect the jitter of the detected parameter, a numerical value in the horizontal axis of fig. 2 represents several first sample data, for example, a numerical value 1 represents a first sample data, a numerical value 2 represents a second first sample data, a vertical axis represents a sample value, each first sample data in fig. 2 corresponds to a numerical value, each numerical value corresponds to a numerical value in the vertical axis, and the variation of the broken line reflects the abnormal jitter of the first sample data, such as a sudden rise or a sudden fall. The broken lines a, b and c in fig. 2 are respectively corresponding broken lines when 3 time-continuous first sample data are selected as a first sample data group, and the broken line d in fig. 2 is corresponding broken lines when 7 time-continuous first sample data are selected as a first sample data group, it can be seen from each broken line in fig. 2 that when 3 time-continuous first sample data are selected, compared with the 7 time-continuous first sample data, the 3 time-continuous first sample data are sufficient to express abnormal jitter such as sudden rise or sudden fall, and the sample data corresponding to the value 1 to the value 3 in the 7 time-continuous first sample data do not play any role in abnormal judgment. Therefore, a better abnormal prediction effect can be achieved only by judging continuous 3 first sample data in the SVM model.
In the scheme of the application, the first prediction model can be trained in a support vector machine mode, and the support vector machine is a supervised machine learning algorithm and can be used for classification or regression. It uses a technique called kernel trick to transform the data and then finds an optimal boundary between possible outputs based on the transformed data. For each sample data in the first training sample, determining whether the sample data is a positive sample or a negative sample based on the feature vector corresponding to the sample data and a set threshold (optimal boundary). Specifically, the hyperplane equation that the linear classifier relies on is the following equation (1):
W T X+b (1)
the above formula 1 represents the relationship between the feature vector X corresponding to one sample data and the set threshold b, where W is the weight vector, and W is T Representing the transpose of W.
If the feature vector corresponding to one sample data satisfies the following formula (2), determining that the sample data is a positive sample, otherwise, determining that the sample data is a negative sample, where formula (2) is:
W T X+b≥0 (2)
the first training end condition may be configured based on an actual demand, for example, the first loss value is smaller than a set value.
The objective of the SVM algorithm is to find a classification hyperplane, not only can each sample be correctly classified, but also the distance between the sample closest to the hyperplane in each type of samples and the hyperplane is required to be as far as possible, namely, the difference between two sample data of the same type is required to be kept, so that the generalization capability of the model is stronger, and the robustness is better.
Step S130, according to the plurality of detection parameters, obtaining a second abnormal prediction result through a second prediction model established in advance based on an ARIMA method, wherein the second prediction model is updated based on the detection parameters acquired after the current time.
The second abnormity prediction result can also comprise normal or abnormal oil and gas pipelines, the second abnormity prediction result can also be represented by percentage, the larger the percentage is, the higher the possibility that the oil and gas pipelines are abnormal is, and conversely, the smaller the percentage is, the lower the possibility that the oil and gas pipelines are abnormal is. The second anomaly prediction result may also be represented by a classification identifier, for example, the classification identifier is 0, the second anomaly prediction result of the oil and gas pipeline is represented as anomaly, the classification identifier is 1, the second anomaly prediction result of the oil and gas pipeline is represented as normal, the representation manner of the second anomaly prediction result is only an example, and the second anomaly prediction result also includes other manners, which are within the protection scope of the present invention.
The obtaining of the second abnormal prediction result through the second prediction model established in advance based on the ARIMA method according to the plurality of detection parameters includes:
determining whether the plurality of detection parameters are stable sequences or not, and if the plurality of detection parameters are stable sequences, obtaining a second abnormal prediction result through a second prediction model which is established in advance based on an ARIMA method according to the plurality of detection parameters;
and if the plurality of detection parameters are not stable sequences, carrying out differential processing on the plurality of detection parameters to obtain a plurality of detection parameters after differential processing, and obtaining a second abnormal prediction result through a second prediction model established in advance based on an ARIMA method according to the plurality of detection parameters after differential processing.
Wherein, a plateau sequence refers to a sequence in which there is substantially no tendency. The observed values in such a sequence fluctuate substantially at a fixed level, and although to a different extent over different time periods, there is no regularity, and the fluctuations can be considered random. The detection parameters are converted into stable sequences, and the overall characteristics of the detection parameters can be reflected through the stable sequences, so that the abnormal information of the oil and gas pipeline can be reflected more comprehensively.
In an alternative aspect of the present invention, the performing difference processing on the plurality of detection parameters to obtain a plurality of detection parameters after difference processing includes:
and carrying out differential processing on the plurality of detection parameters in a first-order difference or second-order difference mode to obtain a plurality of detection parameters after differential processing.
Optionally, the determining whether the plurality of detection parameters are a stationary sequence includes:
whether the multiple detection parameters are stationary sequences is determined by ADF (assessment Dickey-Fuller) unit root test.
The obtaining of the second abnormal prediction result through the second prediction model established in advance based on the ARIMA method according to the plurality of detection parameters includes:
determining a first association relation between each detection parameter corresponding to different times according to the plurality of detection parameters;
determining a second abnormal prediction result through a second prediction model according to the plurality of detection parameters and the first incidence relation;
the first incidence relation between the detection parameters can be learned through the second prediction model, namely the incidence relation between the detection parameters acquired at the first time and the detection parameters acquired at the second time, wherein the first time is earlier than the second time, so that when the second abnormal prediction result is determined through the second prediction model based on the plurality of detection parameters and the first incidence relation, the determined second abnormal prediction result is more accurate.
In an alternative aspect of the present invention, the second prediction model is trained by:
acquiring a second training sample, wherein the second training sample comprises a plurality of time-continuous third sample data, the plurality of time-continuous third sample data are stable sequences, and each third sample data is a detection parameter of the oil and gas pipeline;
determining the time correlation among the third sample data according to the third sample data;
inputting the second training sample and each time correlation into the initial ARIMA model to obtain a predicted detection parameter of the next moment corresponding to each third sample data;
determining the difference between each predicted detection parameter and the corresponding real detection parameter according to each predicted detection parameter and each third sample data;
determining a second loss value of the initial ARIMA model according to the differences;
and when the second loss value meets a preset second training end condition, taking the initial ARIMA model corresponding to the second training end condition as a second prediction model, when the second loss value does not meet the second training end condition, adjusting the parameters of the initial ARIMA model, and retraining the initial ARIMA model according to the adjusted parameters until the second loss value meets the second training end condition.
The second training sample may include a plurality of time-continuous third sample data, such as detection data acquired three months before the current time. The ARIMA model has the basic idea that a data sequence formed by a prediction object along with the time is regarded as a random sequence (time continuous detection parameters), the random sequence is subjected to differential integration and then is fitted by autoregression and moving average to obtain a stable sequence, and a mathematical method for predicting future values of the time sequence according to the stable sequence is adopted.
As an example, for example, if the three stationary sequences are 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 time of t1 is t2, the next time of t2 is t3, a1 obtains the predicted detection parameter of the next time by the initial ARIMA model as b1, a2 is the real detection parameter of the next time corresponding to time a1, and the difference between the two detection parameters can be determined based on a2 and b 1.
The initial ARIMA model may be expressed as ARIMA (p, d, q), where p is an autoregressive term, q is a moving average term, and d is the number of differences made when the time series becomes stationary. In the experiment, d was set to 0, since the data sequence was verified to be a stationary sequence. In the scheme of the application, the values of p and q are judged by adopting an autocorrelation function and a partial autocorrelation function, and the BIC statistic is used for verification.
As an example, referring to the BIC diagram shown in fig. 3, the abscissa of fig. 3 represents a q value, the ordinate represents a p value, MA0 represents q being 0, MA1 represents q being 1, AR0 represents p being 0, and AR1 represents p being 1, and in each coordinate corresponding to the abscissa and the ordinate of fig. 3, the smaller the numerical value corresponding to the coordinate, the better the numerical value corresponding to the coordinate is, as can be seen from each coordinate in fig. 3, and the smallest numerical value corresponding to the coordinate (MA0, AR1), the 0 and 1 are selected for q and p, respectively, in this scheme.
In the experiment, the values of p and q can be judged by using an Autocorrelation Function (ACF), wherein the linear correlation between the time-series observed value and the past observed value can be described by the Autocorrelation Function, wherein formula (3) is as follows:
Figure BDA0003628115410000151
wherein k represents the number of lag periods, y t Denoted is a first smoothing sequence, y, for time t t-k The second smoothing sequence corresponding to t-k time is represented, and cov () represents the linear correlation between the first smoothing sequence and the second smoothing sequence. Rho k Represents the autocorrelation coefficient, var (y) t ) The corresponding variance of the first smoothed sequence is indicated.
The current value y can be seen from equation (3) t Is by the historical value y t-k The prediction reflects the correlation of the same sequence at different time sequence values. Optionally, the Autocorrelation Function may be a Partial Autocorrelation Function (PACF), and the Partial Autocorrelation Function may be used to neglect the influence of a random variable between two stationary sequences and strictly consider the influence between two variables. Meanwhile, in the scheme of the application, the model parameters can be further confirmed by selecting two indexes of an Akaike Information Criterion (AIC) and a Bayesian Information Criterion (BIC), and the models with different parameters are verified by using Root Mean Square Error (RMSE) to measure the difference between the predicted value and the actual value of the ARIMA model and determine the optimal values of the parameters p, d and q. As shown in table 1, when p is 1, d is 0, and q is 0, the RMSE is 0.0311, and the mean square error is the smallest, so the parameters finally selected in the present invention are p is 1, d is 0, and q is 0.
TABLE 1 comparison of model root mean square errors under different parameters
Number of times Guideline 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
And finally, performing real-time training by using an ARIMA model, performing interval prediction on future data by using the trained model, returning 0 if the actual data is out of the interval and is abnormal data, and returning 1 if the actual data is normal data.
As an example, referring to a schematic diagram of the determination process of d and p values corresponding to the Autocorrelation function and the Partial Autocorrelation function shown in fig. 4, the horizontal axis represents a hysteresis value, and the vertical axis represents a correlation coefficient value, it can be seen from fig. 4 that, whether the Autocorrelation function (Autocorrelation shown in fig. 4) or the Partial Autocorrelation function (Partial Autocorrelation shown in fig. 4) is used, when the parameters p, d, and q are (1,0,0), it can be seen from the horizontal axis of fig. 4 that data fluctuates around 0 after 0 on the horizontal axis, so the values of d and p are determined to be 0 and 0.
The ARIMA is a time sequence model which predicts based on historical data, a trained model is used for predicting a value at the next moment, the confidence interval of an actual value (a real detection parameter) and a predicted value (a predicted detection parameter) is compared to judge whether the monitored value is abnormal or not, the relation between a current value and a historical value is increased on the basis of a moving average value model (MA method), and after a non-stationary time sequence is converted into a stationary time sequence, a dependent variable is used for carrying out regression on a hysteresis value of the non-stationary time sequence, a current value and a hysteresis value of a random error term.
In the process of training the second prediction model, along with continuous collection of detection parameters, the second training sample can be closer, and then the second prediction model is updated, based on which, the method also comprises:
acquiring fourth sample data acquired 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.
Wherein, due to the time sequence among the sample data in the second training sample, when the second training sample is updated, as an example, the second training sample is the detection parameter acquired 3 months before the current time, and then, with new data (new detection parameters) added every day, the data at the beginning (the most recent) is removed by using the principle of a queue, the new data is added to a data list (a data list corresponding to the second sample data, the sample data in the data list is sorted according to the acquisition time, and the sample data acquired first is arranged at the top of the data list) to form a new data set (the updated second training sample). In the experiment, the data of the previous three months can be selected as an original data set (a second training sample), new data is replaced every day, namely the data of the first day is removed, the data of the last day is added, the data set (an updated second training sample) is reconstructed, and a stable serialization test is carried out on the data, namely the initial ARIMA model is trained according to the updated second training sample to obtain a new second prediction model.
In step S140, a third anomaly prediction result is obtained by the MA method based on the plurality of detection parameters.
Optionally, the step S140 specifically includes: averaging a plurality of detection parameters to obtain an average value; taking the average value as a prediction detection parameter corresponding to the current time; and determining a third abnormal prediction result according to the prediction detection parameters.
The MA judges whether the monitored value is an abnormal value by calculating an average value between adjacent region data (the adjacent region can refer to a time continuous inspection parameter) and comparing a difference value between new data (refer to a prediction detection parameter obtained by predicting according to the average value) and the average value, so that the random fluctuation in prediction can be effectively eliminated, and the conditions of sudden data jump and the like under most conditions are covered.
The collected data is used as a training set, the moving average value represents the average condition in a period of time, reflects the trend of the data in a certain period of time, and is a time-sequence average value containing a certain number of items which is calculated in sequence according to a time sequence and item-by-item transition. The calculation formula (4) of the moving average method used is as follows:
Figure BDA0003628115410000171
where Ft denotes a predicted value (predicted detection parameter) of the next time to the current time, and n denotes the number of periods of the moving averageNumber, i.e. number of times detection parameters were acquired before the current time, a t-n The actual value (real detection parameter) of the previous n periods is represented, and t represents the current time.
Note that the execution sequence of steps S120 to S140 is not limited.
And S150, determining a target abnormal prediction result of the oil and gas pipeline at the current time according to the first abnormal prediction result, the second abnormal prediction result and the third abnormal prediction result.
After the three abnormal prediction results are obtained, the target abnormal prediction result may be determined based on the three abnormal prediction results, for example, the target abnormal prediction result may be determined in a weighted fusion manner according to a preset weight corresponding to each abnormal prediction result. Or the target abnormal prediction result of the oil and gas pipeline at the current time can be determined by a voting method according to the first abnormal prediction result, the second abnormal prediction result and the third abnormal prediction result.
As an example, for example, when the abnormal prediction result is normal, the corresponding flag is 1, when the abnormal prediction result is abnormal, the corresponding flag is 0, if the number of 1 is greater than the number of 0 in the three abnormal prediction results, the target abnormal prediction result is normal, and if the number of 0 is greater than the number of 1, the target abnormal prediction result is abnormal.
The scheme of the invention does not limit the specific implementation mode for determining the target abnormity prediction result according to the first abnormity prediction result, the second abnormity prediction result and the third abnormity prediction result.
For a better illustration and understanding of the principles of the method provided by the present invention, the solution of the invention is described below with reference to an alternative embodiment. It should be noted that the specific implementation manner of each step in this specific embodiment should not be construed as a limitation to the scheme of the present invention, and other implementation manners that can be conceived by those skilled in the art based on the principle of the scheme provided by the present invention should also be considered as within the protection scope of the present invention.
Referring to a flow chart of an anomaly prediction method of an oil and gas pipeline shown in fig. 5, before the scheme of the invention is executed, a first prediction model and a second prediction model are obtained by training according to the method described in the foregoing, wherein a first training sample corresponding to the SVM method needs to be labeled with positive and negative samples, a supervised learning method is adopted, a second training sample of the ARIMA method does not need to be labeled, an unsupervised learning method is adopted, and the MA method can be used without training; the abnormity prediction method of the oil and gas pipeline can comprise the following steps:
step 1, acquiring a plurality of detection parameters of the oil and gas pipeline, wherein the plurality of detection parameters comprise a current detection parameter and a detection parameter acquired for a plurality of times before the current detection parameter, and constructing a data set corresponding to implementation acquisition data shown in fig. 5. Or, taking the time corresponding to the detection parameter needing to be predicted as a starting point, and intercepting the detection parameter corresponding to a period of time towards the historical data direction.
And 2, obtaining a first abnormal prediction result through a first prediction model established in advance based on an SVM method according to the detection parameters.
And 3, obtaining a second abnormal prediction result through a second prediction model established in advance based on an ARIMA method according to the plurality of detection parameters, wherein the second prediction model is updated based on the detection parameters acquired after the current time.
The step 3 specifically comprises the following steps:
step 31, carrying out data preprocessing on a plurality of detection parameters to obtain each preprocessed detection parameter; in the scheme, the step of performing data preprocessing on the plurality of detection parameters refers to updating the data sets corresponding to the plurality of detection parameters, when the latest time data arrives, the data at the earliest time is removed, and the latest time data is added, so that the real-time data in the data sets is maintained.
Step 32, determining whether the plurality of preprocessed detection parameters are stationary sequences, corresponding to whether the data shown in fig. 5 is stationary;
step 33, if the plurality of preprocessed detection parameters are not stationary sequences, performing differential processing on each detection parameter in the plurality of preprocessed detection parameters in a first-order difference or second-order difference mode to obtain a plurality of detection parameters after differential processing, and performing differential processing on data corresponding to the difference processing shown in fig. 5;
step 34, according to the multiple detection parameters after the difference processing, determining a first association relationship between the detection parameters corresponding to different times by using the ACF or the PACF, and pricing the model according to the ACF and the PACF as shown in fig. 5;
in the second prediction model training process, the model parameters can be further confirmed by two indexes, namely an Akaike Information Criterion (AIC) and a Bayesian Information Criterion (BIC), and the models with different parameters are verified by Root Mean Square Error (RMSE) to measure the difference between the predicted value and the actual value of the ARIMA model and determine the optimal values of the parameters p, d and q. Corresponding to the model parameter optimization and model verification shown in fig. 5.
And step 35, determining a second abnormal prediction result according to the first association relation and the plurality of detection parameters after the difference processing.
Step 4, obtaining a third abnormal prediction result through an MA method (an MA model shown in figure 5) according to a plurality of detection parameters;
and step 5, determining a target abnormal prediction result of the oil and gas pipeline at the current time in a voting mode according to the first abnormal prediction result, the second abnormal prediction result and the third abnormal prediction result (corresponding to the final result obtained by voting the three model results shown in fig. 5).
Based on the comprehensive application of three models (a first prediction model, a second prediction model and an MA model), the model of multi-level recognition from coarse to fine is realized, and finally, a final result is obtained according to a majority-obeying voting principle of minority. The integration method comprehensively considers various conditions of data retention time invariance, data jumping, data interruption and the like, and obtains satisfactory experimental results. Table 2 shows the results of anomaly detection performed on test sets with data volumes of 1000, 2000, and 3000. The Accuracy (Accuracy) was used as an evaluation index, wherein,
Figure BDA0003628115410000191
TABLE 2
Amount of test data SVM MA ARIMA Integration method
1000 85% 91% 90% 92%
2000 88% 92% 91% 93%
3000 88% 90% 90% 92%
As can be seen from table 2, the accuracy of the integration method is the highest, where the integration method refers to a 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.
The method of the invention utilizes Windows service program to extract data such as temperature, pressure, instantaneous flow, opening degree and the like, and automatically collects the parameters into an SQL Server database by following an OPC interface through Ethernet. And judging or predicting the data by using a built ensemble learning method, and judging whether the data is an abnormal value according to the returned 0 or 1 identification value. The method of the invention fully considers a plurality of factors such as data keeping unchanged for a period of time, data sudden jump, data change and the like by using a plurality of models from different angles for diagnosis, improves the precision and generalization of the models, simultaneously fully automates the whole process of data acquisition, data processing and data diagnosis, and greatly saves resources such as manpower, material resources and the like.
The method adopts a multi-stage abnormal data identification model, comprehensively considers various conditions such as long-time data retention, data jumping, data interruption and the like, applies the MA and ARIMA methods to the field of abnormal detection of important parameters of oil-gas pipe networks, provides an open integrated learning method, can integrate various detection methods, realizes fitting of the distribution rule of real data from different feature spaces and dimensions, and overcomes the limitation of a single method. 3 groups of experiments based on the real data show that the average accuracy of abnormal data diagnosis is 92.3 percent. Each anomaly detection method has own advantages and disadvantages, but a single method is difficult to cope with complex data distribution in a pipe network, and three good and different learners are combined together through integrated learning, so that the accuracy of the individual learners is ensured, the diversity of the integrated method is increased, the advantages and the disadvantages are brought forward, and the mutual supplementation is beneficial to improving the robustness of the model.
Based on the same principle as the method shown in fig. 1, an embodiment of the present invention further provides an anomaly prediction apparatus 20 for a hydrocarbon pipeline, as shown in fig. 6, the anomaly prediction apparatus 20 for a hydrocarbon pipeline may include an obtaining module 210, a first prediction module 220, a second prediction module 230, a third prediction module 240, and a target anomaly prediction result determination module 250, where:
the obtaining module 210 is configured to obtain a plurality of detection parameters of the oil and gas pipeline, where the plurality of detection parameters include a current detection parameter and a detection parameter acquired multiple times before the current detection parameter;
the first prediction module 220 is configured to obtain a first anomaly prediction result according to a plurality of detection parameters through a first prediction model established in advance based on an SVM method;
a second prediction module 230, configured to obtain a second abnormal prediction result according to the plurality of detection parameters through a second prediction model established in advance based on the ARIMA method, where the second prediction model is updated based on the detection parameters acquired after the current time;
a third prediction module 240, configured to obtain a third abnormal prediction result through an MA method according to the plurality of detection parameters;
and the target abnormal prediction result determining module 250 is used for determining a target abnormal prediction result of the oil and gas pipeline at the current time according to the first abnormal prediction result, the second abnormal prediction result and the third abnormal prediction result.
Optionally, when the second prediction module 230 obtains a second abnormal prediction result according to a plurality of detection parameters through a second prediction model established in advance based on an ARIMA method, the second prediction module is specifically configured to:
determining whether the plurality of detection parameters are stable sequences or not, and if the plurality of detection parameters are stable sequences, obtaining a second abnormal prediction result through a second prediction model which is established in advance based on an ARIMA method according to the plurality of detection parameters; and if the plurality of detection parameters are not stable sequences, carrying out differential processing on the plurality of detection parameters to obtain a plurality of detection parameters after differential processing, and obtaining a second abnormal prediction result through a second prediction model established in advance based on an ARIMA method according to the plurality of detection parameters after differential processing.
Optionally, when the second prediction module 230 performs difference processing on the multiple detection parameters to obtain multiple detection parameters after the difference processing, the second prediction module is specifically configured to: and carrying out differential processing on the plurality of detection parameters in a first-order difference or second-order difference mode to obtain a plurality of detection parameters after differential processing.
Optionally, the apparatus further comprises a first training module and a second training module, wherein,
the first training module is used for obtaining a first training sample, wherein the first training sample comprises a plurality of groups of first sample data groups and at least one group of second sample data groups, each group of first sample data groups comprises three first sample data which are continuous in time, each sample data in the first training sample is a detection parameter of an oil-gas pipeline, each group of first sample data groups corresponds to a labeling result, and the labeling result represents that the detection parameter of the oil-gas pipeline corresponding to the group of first sample data groups is normal or abnormal; inputting first training sample data into an initial SVM model to obtain a prediction abnormity prediction result corresponding to each sample data; determining a first loss value of the initial SVM model according to each abnormal prediction result and each labeled result corresponding to the sample data; when the first loss value meets a preset first training end condition, taking the initial SVM model corresponding to the first training end condition as a first prediction model, when the first loss value does not meet the first training end condition, adjusting parameters of the initial SVM model, and retraining the initial SVM model according to the adjusted parameters until the first loss value meets the first training end condition;
the second training module is used for obtaining a second training sample, the second training sample comprises a plurality of time-continuous third sample data, the plurality of time-continuous third sample data are stable sequences, and each third sample data is a detection parameter of the oil and gas pipeline; determining the time correlation among the third sample data according to the third sample data; inputting the second training sample and each time correlation into the initial ARIMA model to obtain a predicted detection parameter of the next moment corresponding to each third sample data; determining the difference between each predicted detection parameter and the corresponding real detection parameter according to each predicted detection parameter and each third sample data; determining a second loss value of the initial ARIMA model according to the differences; and when the second loss value meets a preset second training end condition, taking the initial ARIMA model corresponding to the second training end condition as a second prediction model, when the second loss value does not meet the second training end condition, adjusting the parameters of the initial ARIMA model, and retraining the initial ARIMA model according to the adjusted parameters until the second loss value meets the second training end condition.
Optionally, the apparatus further includes an updating module, configured to obtain 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.
Optionally, when the first prediction module 220 obtains the first abnormal prediction result according to the plurality of detection parameters through a first prediction model established in advance based on an SVM method, the first prediction module is specifically configured to: for each detection parameter, extracting a feature vector of the detection parameter through a first prediction model; determining a first abnormal prediction result through a first prediction model according to each feature vector;
the second prediction module 230 is specifically configured to, when obtaining a second abnormal prediction result according to a plurality of detection parameters through a second prediction model established in advance based on an ARIMA method: determining a first association relation between each detection parameter corresponding to different times according to the plurality of detection parameters; determining a second abnormal prediction result through a second prediction model according to the plurality of detection parameters and the first incidence relation;
the third prediction module 240 is specifically configured to, when obtaining a third abnormal prediction result by an MA method according to a plurality of detection parameters: averaging a plurality of detection parameters to obtain an average value; taking the average value as a prediction detection parameter corresponding to the current time; and determining a third abnormal prediction result according to the prediction detection parameters.
Optionally, when the target abnormal prediction result determining module 250 determines the target abnormal prediction result of the oil and gas pipeline at the current time according to the first abnormal prediction result, the second abnormal prediction result, and the third abnormal prediction result, the target abnormal prediction result determining module is specifically configured to: and determining a target abnormal prediction result of the oil and gas pipeline at the current time by a voting method according to the first abnormal prediction result, the second abnormal prediction result and the third abnormal prediction result.
The anomaly prediction device for an oil and gas pipeline of the embodiment of the invention can execute the anomaly prediction method for the oil and gas pipeline provided by the embodiment of the invention, the implementation principle is similar, the actions executed by each module and unit in the anomaly prediction device for the oil and gas pipeline in each embodiment of the invention correspond to the steps in the anomaly prediction method for the oil and gas pipeline in each embodiment of the invention, and the detailed function description of each module of the anomaly prediction device for the oil and gas pipeline can be specifically referred to the description in the corresponding anomaly prediction method for the oil and gas pipeline shown in the foregoing, and the detailed description is omitted here.
The anomaly prediction device of the oil and gas pipeline can be a computer program (comprising program codes) running in computer equipment, for example, the anomaly prediction device of the oil and gas pipeline is application software; the apparatus may be used to perform the corresponding steps in the methods provided by the embodiments of the present invention.
In some embodiments, the anomaly prediction Device for an oil and gas pipeline provided by the embodiments of the present invention may be implemented by combining software and hardware, and by way of example, the anomaly prediction Device for an oil and gas pipeline provided by the embodiments of the present invention may be a processor in the form of a hardware decoding processor, which is programmed to execute the anomaly prediction method for an oil and gas pipeline provided by the embodiments of the present invention, for example, the processor in the form of a hardware decoding processor may be implemented by 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.
In other embodiments, the anomaly prediction apparatus for a hydrocarbon pipeline provided by the embodiment of the present invention may be implemented in a software manner, and fig. 6 illustrates the anomaly prediction apparatus for a hydrocarbon pipeline stored in a memory, which may be software in the form of a program, a plug-in, and the like, and includes a series of modules, including an obtaining module 210, a first prediction module 220, a second prediction module 230, a third prediction module 240, and a target anomaly prediction result determining module 250, for implementing the anomaly prediction method for a hydrocarbon pipeline provided by the embodiment of the present invention.
The modules described in the embodiments of the present invention may be implemented by software or hardware. Wherein the name of a module in some cases does not constitute a limitation on the module itself.
Based on the same principle as the method shown in the embodiment of the present invention, an embodiment of the present invention also provides an electronic device, which may include but is not limited to: a processor and a memory; a memory for storing a computer program; a processor for executing the method according to any of the embodiments of the present invention by calling a computer program.
In an alternative embodiment, an electronic device is provided, as shown in fig. 7, the electronic device 4000 shown in fig. 7 comprising: a processor 4001 and a memory 4003. Processor 4001 is coupled to memory 4003, such as via bus 4002. Optionally, the electronic device 4000 may further include a transceiver 4004, and the transceiver 4004 may be used for data interaction between the electronic device and other electronic devices, such as transmission of data and/or reception of data. In addition, the transceiver 4004 is not limited to one in practical applications, and the structure of the electronic device 4000 is not limited to the embodiment of the present invention.
The 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 device, a transistor logic device, a hardware component, or any combination thereof. Which may implement or perform the various illustrative logical blocks, modules, and circuits described in connection with the disclosure. The processor 4001 may also be a combination that performs a computational function, including, for example, a combination of one or more microprocessors, a combination of a DSP and a microprocessor, or the like.
Bus 4002 may include a path that carries information between the aforementioned components. The bus 4002 may be a PCI (Peripheral Component Interconnect) bus, an EISA (Extended Industry Standard Architecture) bus, or the like. The bus 4002 may be divided into an address bus, a data bus, a control bus, and the like. For ease of illustration, only one thick line is shown in FIG. 7, but this is not intended to represent only one bus or type of bus.
The Memory 4003 may be a ROM (Read Only Memory) or other type of static storage device that can store static information and instructions, a RAM (Random Access Memory) or other type of dynamic storage device that can store information and instructions, an EEPROM (Electrically Erasable Programmable Read Only Memory), a CD-ROM (Compact Disc Read Only Memory) or other optical Disc storage, optical Disc storage (including Compact Disc, laser Disc, optical Disc, digital versatile Disc, blu-ray Disc, etc.), a magnetic Disc storage medium or other magnetic storage device, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer, but is not limited thereto.
The memory 4003 is used for storing application program codes (computer programs) for executing the scheme of the present invention, and execution is controlled by the processor 4001. Processor 4001 is configured to execute application code stored in memory 4003 to implement what is shown in the foregoing method embodiments.
The electronic device may also be a terminal device, and the electronic device shown in fig. 7 is only an example, and should not bring any limitation to the functions and the application scope of the embodiment of the present invention.
Embodiments of the present invention provide a computer-readable storage medium, on which a computer program is stored, which, when running on a computer, enables the computer to execute the corresponding content in the foregoing method embodiments.
According to another aspect of the invention, there is also provided a computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions to cause the computer device to perform the methods provided in the various embodiment implementations described above.
Computer program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of 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 the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
It should be understood that the flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The computer readable storage medium provided by the embodiments of the present invention may be, for example but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, 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 disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present invention, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
The computer-readable storage medium carries one or more programs which, when executed by the electronic device, cause the electronic device to perform the methods shown in the above embodiments.
The foregoing description is only exemplary of the preferred embodiments of the invention and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the disclosure herein is not limited to the particular combination of features described above, but also encompasses other embodiments in which any combination of the features described above or their equivalents is encompassed without departing from the spirit of the disclosure. For example, the above features and (but not limited to) features having similar functions disclosed in the present invention are mutually replaced to form the technical solution.

Claims (10)

1. An anomaly prediction method for an oil and gas pipeline is characterized by comprising the following steps:
acquiring a plurality of detection parameters of an oil and gas pipeline, wherein the plurality of detection parameters comprise a current detection parameter and detection parameters acquired for multiple times before the current detection parameter;
according to the detection parameters, obtaining a first abnormal prediction result through a first prediction model established in advance based on an SVM method;
according to the detection parameters, obtaining a second abnormal prediction result through a second prediction model established in advance based on an ARIMA method, wherein the second prediction model is updated based on the detection parameters acquired after the current time;
obtaining a third abnormal prediction result by an MA method according to a plurality of detection parameters;
and determining a target abnormal prediction result of the oil and gas pipeline at the current time according to the first abnormal prediction result, the second abnormal prediction result and the third abnormal prediction result.
2. The method according to claim 1, wherein obtaining a second anomaly prediction result according to a plurality of detection parameters through a second prediction model established in advance based on an ARIMA method comprises:
determining whether the detection parameters are stable sequences or not, and if the detection parameters are stable sequences, obtaining a second abnormal prediction result through a second prediction model established in advance based on an ARIMA method according to the detection parameters;
and if the detection parameters are not stable sequences, carrying out differential processing on the detection parameters to obtain a plurality of detection parameters after differential processing, and obtaining a second abnormal prediction result through a second prediction model established in advance based on an ARIMA method according to the detection parameters after differential processing.
3. The method according to claim 2, wherein the differentiating the plurality of detection parameters to obtain a plurality of detection parameters after differentiating comprises:
and carrying out differential processing on the detection parameters in a first-order difference or second-order difference mode to obtain a plurality of detection parameters after differential processing.
4. The method according to any one of claims 1 to 3, wherein the first predictive model is trained by:
acquiring a first training sample, wherein the first training sample comprises a plurality of groups of first sample data groups and at least one group of second sample data groups, each group of the first sample data groups comprises three first sample data which are continuous in time, each sample data in the first training sample is a detection parameter of an oil and gas pipeline, each group of the first sample data groups corresponds to a labeling result, and the labeling result represents that the detection parameter of the oil and gas pipeline corresponding to the group of the first sample data groups is normal or abnormal;
inputting the first training sample data into an initial SVM model to obtain a prediction abnormity prediction result corresponding to each sample data;
determining a first loss value of the initial SVM model according to each abnormal prediction result and a labeling result corresponding to each sample data;
when the first loss value meets a preset first training end condition, taking an initial SVM model corresponding to the first training end condition as the first prediction model, when the first loss value does not meet the first training end condition, adjusting parameters of the initial SVM model, and retraining the initial SVM model according to the adjusted parameters until the first loss value meets the first training end condition;
the second prediction model is obtained by training in the following way:
acquiring a second training sample, wherein the second training sample comprises 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, determining the time correlation among the third sample data;
inputting the second training sample and each time correlation to an initial ARIMA model to obtain a predicted detection parameter of each third sample data at the next moment;
determining a difference between each of the predicted detection parameters and the corresponding real detection parameter according to each of the predicted detection parameters and each of the third sample data;
determining a second loss value of the initial ARIMA model according to each difference;
and when the second loss value meets a preset second training end condition, taking an initial ARIMA model corresponding to the second training end condition as the second prediction model, when the second loss value does not meet the second training end condition, adjusting parameters of the initial ARIMA model, and retraining the initial ARIMA model according to the adjusted parameters until the second loss value meets the second training end condition.
5. The method of claim 4, further comprising:
acquiring fourth sample data acquired 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.
6. The method according to any one of claims 1 to 3, wherein obtaining a first anomaly prediction result according to a plurality of detection parameters through a first prediction model established in advance based on an SVM method comprises:
for each detection parameter, extracting a feature vector of the detection parameter through the first prediction model;
determining the first abnormal prediction result through the first prediction model according to each feature vector;
the obtaining of a second abnormal prediction result through a second prediction model established in advance based on an ARIMA method according to the plurality of detection parameters includes:
determining a first association relation between the detection parameters corresponding to different times according to the detection parameters;
determining the second abnormal prediction result through the second prediction model according to the detection parameters and the first incidence relation;
the obtaining of the third anomaly prediction result by the MA method according to the plurality of detection parameters includes:
averaging a plurality of detection parameters to obtain an average value;
taking the average value as a prediction detection parameter corresponding to the current time;
and determining the third abnormal prediction result according to the prediction detection parameters.
7. The method of any of claims 1-3, wherein determining a target anomaly prediction result for the hydrocarbon pipeline at the current time based on the first anomaly prediction result, the second anomaly prediction result, and the third anomaly prediction result comprises:
and determining a target abnormal prediction result of the oil and gas pipeline at the current time by a voting method according to the first abnormal prediction result, the second abnormal prediction result and the third abnormal prediction result.
8. An anomaly prediction device for an oil and gas pipeline, comprising:
the acquisition module is used for acquiring a plurality of detection parameters of the oil and gas pipeline, wherein the plurality of detection parameters comprise current detection parameters and detection parameters acquired for a plurality of times before the current detection parameters;
the first prediction module is used for obtaining a first abnormal prediction result through a first prediction model which is established in advance based on an SVM method according to a plurality of detection parameters;
the second prediction module is used for obtaining a second abnormal prediction result through a second prediction model which is established in advance based on an ARIMA method according to the plurality of detection parameters, wherein the second prediction model is updated based on the detection parameters acquired after the current time;
the third prediction module is used for obtaining a third abnormal prediction result through an MA method according to the plurality of detection parameters;
and the target anomaly prediction result determining module is used for determining a target anomaly prediction result of the oil and gas pipeline at the current time according to the first anomaly prediction result, the second anomaly prediction result and the third anomaly prediction result.
9. An electronic device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, the processor implementing the method of any one of claims 1-7 when executing the computer program.
10. A computer-readable storage medium, characterized in that the computer-readable storage medium has stored thereon a computer program which, when being executed by a processor, carries out the method of any one of claims 1 to 7.
CN202210482464.5A 2022-05-05 2022-05-05 Oil and gas pipeline abnormity prediction method and device, electronic equipment and medium Pending CN115081673A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210482464.5A CN115081673A (en) 2022-05-05 2022-05-05 Oil and gas pipeline abnormity prediction method and device, electronic equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210482464.5A CN115081673A (en) 2022-05-05 2022-05-05 Oil and gas pipeline abnormity prediction method and device, electronic equipment and medium

Publications (1)

Publication Number Publication Date
CN115081673A true CN115081673A (en) 2022-09-20

Family

ID=83246697

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210482464.5A Pending CN115081673A (en) 2022-05-05 2022-05-05 Oil and gas pipeline abnormity prediction method and device, electronic equipment and medium

Country Status (1)

Country Link
CN (1) CN115081673A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116625438A (en) * 2023-07-25 2023-08-22 克拉玛依市燃气有限责任公司 Gas pipe network safety on-line monitoring system and method thereof
CN117370917A (en) * 2023-12-07 2024-01-09 城光(湖南)节能环保服务股份有限公司 Urban intelligent street lamp service life prediction method and system

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116625438A (en) * 2023-07-25 2023-08-22 克拉玛依市燃气有限责任公司 Gas pipe network safety on-line monitoring system and method thereof
CN116625438B (en) * 2023-07-25 2023-12-01 克拉玛依市燃气有限责任公司 Gas pipe network safety on-line monitoring system and method thereof
CN117370917A (en) * 2023-12-07 2024-01-09 城光(湖南)节能环保服务股份有限公司 Urban intelligent street lamp service life prediction method and system
CN117370917B (en) * 2023-12-07 2024-02-23 城光(湖南)节能环保服务股份有限公司 Urban intelligent street lamp service life prediction method and system

Similar Documents

Publication Publication Date Title
Cook et al. Anomaly detection for IoT time-series data: A survey
Khelif et al. Direct remaining useful life estimation based on support vector regression
Wang et al. A two-stage data-driven-based prognostic approach for bearing degradation problem
US20210334656A1 (en) Computer-implemented method, computer program product and system for anomaly detection and/or predictive maintenance
US20170314961A1 (en) A data analytic engine towards the self-management of complex physical systems
US20160369777A1 (en) System and method for detecting anomaly conditions of sensor attached devices
CN115081673A (en) Oil and gas pipeline abnormity prediction method and device, electronic equipment and medium
CN113852603B (en) Abnormality detection method and device for network traffic, electronic equipment and readable medium
Mathew et al. Regression kernel for prognostics with support vector machines
US11435736B2 (en) Cause determination of anomalous events
Huang et al. A novel Bayesian deep dual network with unsupervised domain adaptation for transfer fault prognosis across different machines
Tang et al. Multivariable LS-SVM with moving window over time slices for the prediction of bearing performance degradation
CN112213687B (en) Gateway electric energy meter data anomaly detection method and system based on pseudo-anomaly point identification
Yang et al. An intelligent singular value diagnostic method for concrete dam deformation monitoring
Jiang et al. Remaining useful life prediction of rolling bearings based on Bayesian neural network and uncertainty quantification
Li et al. An adaptive prognostics method based on a new health index via data fusion and diffusion process
CN117490948A (en) Cable-stayed bridge health monitoring method and system based on dynamic threshold
Qian et al. Soft sensing model visualization: Fine-tuning neural network from what model learned
Jesmeen et al. Unsupervised anomaly detection for energy consumption in time series using clustering approach
CN112882898B (en) Anomaly detection method, system, device and medium based on big data log analysis
Li et al. An ensembled remaining useful life prediction method with data fusion and stage division
Jiang et al. A timeseries supervised learning framework for fault prediction in chiller systems
Dang et al. seq2graph: Discovering dynamic non-linear dependencies from multivariate time series
CN103475527B (en) Network management fault reliability analyzing system and method
Hu et al. A multi-feature-based fault diagnosis method based on the weighted timeliness broad learning system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination