Oil tank leakage detection method for integrated energy supply station based on real-time learning and adaptive threshold

By adopting instant learning and adaptive threshold methods in oil tank leakage detection in integrated energy supply stations, the problems of global modeling complexity and fixed threshold fault detection delay in the prior art are solved, and higher detection accuracy and timeliness are achieved.

CN113849479BActive Publication Date: 2025-03-25ZHEJIANG UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111044449.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-09-07
Publication Date
2025-03-25
Estimated Expiration
2041-09-07

AI Technical Summary

Technical Problem

The existing oil tank leakage detection method of comprehensive energy supply stations has problems such as high global modeling complexity, fixed threshold fault detection delay, and high fault leakage detection rate.

Method used

The oil tank leakage detection method of the integrated energy supply station based on real-time learning and adaptive thresholds is adopted. The oil high soft measurement model is established through the real-time learning modeling method to match the samples with the closest mode from the historical data, and the data characteristics are dynamically adapted to the changes in the adaptive thresholds.

Benefits of technology

The model is simplified, the prediction accuracy is improved, the false alarm rate is effectively reduced, and the applicability, accuracy and timeliness of fault detection are improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113849479B_ABST
    Figure CN113849479B_ABST
Patent Text Reader

Abstract

The present invention discloses a method for detecting oil tank leakage in an integrated energy supply station based on real-time learning and adaptive thresholds. The present invention adopts a non-parametric modeling method of real-time learning. When it is necessary to make a leakage judgment on an online real-time data stream, the local data set that best matches the online data modality is first searched and constructed from the historical database to establish a leakage detection model based on oil height soft measurement, and the detection threshold is adaptively updated according to the detection results to continuously adapt to small fluctuations in data characteristics. After running for a period of time, the above steps are repeated to update the model to adapt to the problem of changes in data characteristics caused by large changes in factors such as oil volume and temperature. When establishing a local model, an exponentially weighted average method is used to post-process and fuse multiple prediction results of query samples, effectively improving the prediction performance of oil height. Finally, experiments based on real oil tank data prove that the present invention can effectively improve the accuracy, applicability and timeliness of leakage detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention discloses a method for detecting oil tank leakage in an integrated energy supply station based on real-time learning and adaptive thresholds. The invention belongs to the field of industrial system fault detection, and is particularly aimed at detecting leakage faults in oil tank systems of integrated energy supply stations. Background Art

[0002] In complex industrial processes, the safe operation of production equipment and systems is related to production efficiency, product quality, production process safety, and environmental and personal safety. With the development of modern industry, the operation of industrial equipment is becoming more and more complex, and the influencing factors are becoming more and more numerous. The safety and reliability requirements of equipment have made fault detection technology highly valued. There are three main methods for industrial equipment fault diagnosis, namely, mechanism-based, knowledge-based, and data-driven methods. The mechanism-based method requires an accurate mathematical model. However, in actual industrial processes, due to the many and complex uncertainties, it is very difficult to establish the corresponding mechanism model. Knowledge-based methods such as neural networks and expert systems do not require accurate mathematical modeling, but in reality, there are often problems such as difficulty in learning parameters and poor adaptability. The data-driven method transforms the process operation data from the measurement space to the feature space before analyzing it, without the need to establish a complex mathematical model.

[0003] With the deployment of a large number of sensors, intelligent instruments, distributed control systems and computer storage technology on industrial platforms, a huge amount of data has accumulated in industrial systems. It is usually difficult to extract valuable information from a small amount of data, but a large amount of data contains inestimable value, and corresponding value can be extracted from it through mining and analysis. Data-driven methods are one of the hot research directions at present. Previous researchers have made a lot of research on data-based fault detection and fault diagnosis. For example, multivariate statistical analysis methods such as principal component analysis (PCA), partial least squares (PLS) and linear discriminant analysis (LDA) have been widely used in the field of data-based process monitoring.

[0004] Oil tank leakage detection in integrated energy supply stations is one of the applications of industrial equipment fault detection. At present, the common method for oil tank leakage detection in various integrated energy supply stations is to directly use sensors to detect whether there is liquid at the bottom of the oil tank. If there is, a leakage alarm will be issued. The liquid may often be water in the process of unloading and refueling, which will cause false alarms and increase maintenance costs; some methods are to predict the height of the oil level through complex mechanism formulas and stored historical data. Complex mechanism formulas often cause coefficients and a large number of parameters to be difficult to determine due to environmental changes or equipment degradation. In addition, a data-driven oil level soft measurement early warning method has been proposed. The invention uses a global modeling method. This global model often encounters problems such as difficulty in confirming the model structure, difficulty in parameter optimization, difficulty in model updating, and decreased accuracy caused by data nonlinearity. Compared with global modeling and traditional local modeling methods, the basic modeling framework based on instant learning uses local modeling to find similar samples that best match the modality of the current query sample from historical accumulated data, thereby obtaining better modeling accuracy. In addition, the current warning threshold setting methods are mostly fixed thresholds set according to global models, without considering the impact of changes in online working conditions or operating environment, and the probability of false alarms and missed alarms is relatively high. Summary of the invention

[0005] The purpose of the present invention is to address the problems of high global modeling complexity, fixed threshold fault detection delay, high fault missed detection rate, etc. in the existing oil tank leakage detection method based on oil height soft measurement, and propose a comprehensive energy supply station oil tank leakage detection method based on real-time learning and adaptive threshold. The modeling method of real-time learning can match the historical samples with the closest modality for the online real-time data stream and establish a fault warning model based on oil height soft measurement to achieve real-time warning of online data. At the same time, the present invention adds the method of adaptive threshold to the real-time learning model, which can dynamically adapt to the characteristics of small fluctuations in data. After running for a period of time, in order to adapt to the problem of changes in data characteristics caused by large changes in factors such as oil volume and temperature, it is necessary to update similar samples and local modeling. The comprehensive energy supply station oil tank leakage detection method based on real-time learning and adaptive threshold can simplify the model, improve the prediction accuracy, and effectively reduce the false alarm rate caused by fixed thresholds. Overall, the applicability, accuracy and timeliness of the fault detection method are improved.

[0006] The objective of the present invention is achieved through the following technical solutions:

[0007] A method for detecting oil tank leakage in an integrated energy supply station based on real-time learning and adaptive thresholds, the method comprising the following steps:

[0008] (1) Collect the current operating status data of the integrated energy supply station in real time and save and collect the historical operating status data of the oil tanks of the integrated energy supply station, wherein the historical operating status data of the oil tanks of the integrated energy supply station collected is the operating data under a normal and stable state without leakage, including multiple sets of oil height H, temperature T, reading time t in the liquid level meter system and the oil volume V in the tank in the station transaction information system. The collected current operating status data includes the oil height, temperature and oil volume in the tank at the current moment.

[0009] (2) Nq consecutive real-time operating status data are combined into a query sample set, and N query samples are selected from the historical operating status data according to the query samples. train The training set is composed of similar samples with similar time and oil volume to construct an oil-high prediction soft-sensing model for real-time learning. The oil-high soft-sensing model is specifically expressed as:

[0010] H q =f(T q , H j , T j , V q -V j )

[0011] In the formula, the subscript q represents the index of the query sample, j represents the index of the similar sample at the corresponding historical moment used for prediction, and H q , T q 、V q are the oil height, temperature and oil volume of the query sample respectively, j , T j 、V j are the oil height, temperature, and oil volume of similar samples respectively.

[0012] (3) In the historical running status data, select a group of N consecutive test The samples are used as test samples together with the corresponding query samples and input into the oil height soft sensor model to predict and obtain N for each query sample. test Predicted oil high The superscript i represents the index of the query sample corresponding to the test sample. test The predicted oil heights are post-processed and fused by exponential weighted average as the final predicted oil height for each query sample.

[0013] (4) Adaptively updating the threshold according to each query sample, specifically including the following sub-steps:

[0014] (4.1) The initial training set prediction residual is obtained by the oil height soft measurement model. The residual is the difference between the predicted oil height and the actual oil height. The residual vector can be expressed as:

[0015]

[0016] N train =N v +N t

[0017] Kernel density estimation (KDE) is performed on the residual vector, and the lower quantile with a confidence level of 0.95 is taken as the initial threshold Thre0.

[0018] (4.2) The residual of each query sample and the corresponding test set residual are obtained by the oil height soft measurement model, where the test set residual is expressed as:

[0019]

[0020] in,

[0021] The residual vector of the query sample can be expressed as:

[0022] (4.3) The following update strategy is used to update the threshold of each query sample:

[0023] If the residual of query sample k Greater than the threshold Thre k-1 , then the threshold is not updated, let Thre k = Thre k-1 , and output alarm; Thre k It represents the threshold value corresponding to the kth sample, and Thre0 is the initial threshold value.

[0024] If the residual of query sample k is less than or equal to the threshold Thre k-1 , then update the threshold:

[0025] Will With E train The new residual vector Re-estimate the probability density of the residual distribution and take the lower quantile with a confidence level of 0.95 as the updated threshold Thre k .

[0026] Furthermore, the step 1 is specifically as follows:

[0027] Use the level meter system to obtain the oil height H, temperature T, and reading time t; use the site transaction information system to obtain the gun lifting time t t , gun hanging time t g , the sales volume of each refueling, that is, the change in the amount of oil in the tank ΔV.

[0028] The time of picking up guns through the site transaction information system tt , Gun hanging time t g The corresponding situation with the sampling time of the liquid level meter system is to remove the refueling data from the liquid level meter data, that is, the data between the time of lifting the gun and the time of hanging the gun; remove the data segment of the oil unloading operation, that is, the data segment with obvious increase in oil height; remove the abnormal points (the part of the data with sudden changes). Finally, the multi-segment oil conservation data after removing the oil unloading segment and the refueling segment is obtained, which is the operation data under the stable state.

[0029] The historical operating status data of the integrated energy supply station is divided into multiple stable states S1, S2…S according to the oil volume. l Each steady state includes one or more operating state data at different times. The oil volume in each steady state is different. The first steady state S1 is taken as the reference starting point. Given an oil volume of zero as the initial value, the oil volume in the second steady state S2 is And so on, the kth stable state S k The amount of oil is Among them, m k In the steady state S k The number of running state data contained in the following, k = 1, 2, ..., 1. The characteristic state matrix is ​​reconstructed according to the steady state number S and the time sequence, and the characteristic state matrix contains the variable steady state number S, oil height H, temperature T and the oil volume V in the steady state.

[0030] Furthermore, the steps of removing outliers are as follows:

[0031] (a) Divide the historical operating status data into N group Group.

[0032] (b) Sort the data of each group obtained in (a) by KNN Euclidean distance:

[0033]

[0034] Then the Euclidean distance vector between the jth sample in the group and the remaining samples except itself can be expressed as:

[0035]

[0036] where j = 1, 2, ..., (N batch ), -j represents all samples except j in the group, D j The dimension is 1×(N batch -1).

[0037] (c) 3σ criterion for noise extraction: By D j For each element in , calculate the standard deviation and mean of the group distance:

[0038] average value:

[0039] Standard Deviation:

[0040] According to the 3δ criterion, if there is Then the j-th sample is an outlier and should be removed.

[0041] Furthermore, in step 2, N are selected from the historical running status data according to each query sample. train Similar samples with similar time and oil volume, specifically:

[0042] Based on the Euclidean distance calculation, similar samples with similar oil volume to the query sample are obtained:

[0043] d j,q =|v j -v q |

[0044] Among them, v j represents the oil volume of the jth historical sample, v q Indicates the oil volume of the query sample, and selects N according to the threshold v samples are used as similar samples with similar oil content to the query sample.

[0045] Select the N consecutive samples before the query sample t samples as similar samples with similar time.

[0046] N train =N v +N t

[0047] Furthermore, in step 3, N test The predicted oil heights are post-processed and fused by exponential weighted average as the final predicted oil height for each query sample. The details are as follows:

[0048]

[0049] in represents the final output of the query sample, and β represents The weight coefficient is an adjustable hyperparameter, with the superscript (N test -i) represents the exponent of the weight.

[0050] Furthermore, in step 4, With E train The new residual vector The probability density of the re-estimated residual distribution is specifically:

[0051] Approximate the residuals to a normal distribution and use the recursive method to calculate the mean and variance of the distribution:

[0052]

[0053]

[0054] Among them, μ k and δ k are the probability density mean and variance of the re-estimated k-th query sample residual, μ 0 , δ 0 are the probability density mean and variance of all query sample residuals obtained from the training set; μ test,k , δ test,k are the residuals obtained from the k-th query sample test set. The mean and variance of the probability density of .

[0055] The beneficial effects of the present invention are as follows: in view of the problems of complex parameters, weak generalization ability of detection methods, global nonlinearity, high false alarm rate, etc. existing oil tank leakage detection methods based on mechanism models and global fixed thresholds. The present invention proposes a comprehensive energy supply station oil tank leakage detection method based on real-time learning and adaptive thresholds. The present invention adopts a real-time learning modeling method. When it is necessary to make a leakage judgment on an online real-time data stream, the local data set that best matches the online data modality is first searched and constructed from the historical database to establish a leakage detection model based on oil height soft measurement, and the detection threshold is adaptively updated according to the detection results to continuously adapt to the small fluctuations of data characteristics. At the same time, when establishing a local model, the exponential weighted average method is used to post-process and fuse multiple prediction results of the query sample, effectively improving the prediction performance of oil height. Overall, the present invention effectively reduces the false alarm rate of oil tank leakage detection in the comprehensive energy supply station, and improves the applicability, accuracy and timeliness of the detection algorithm. BRIEF DESCRIPTION OF THE DRAWINGS

[0056] Figure 1 It is an overall framework for oil tank leakage detection based on real-time learning and adaptive thresholds;

[0057] Figure 2 It is based on the detection data division of the oil tank data of a comprehensive energy supply station;

[0058] Figure 3 It is the leakage detection result curve of the global model using fixed threshold and adaptive threshold;

[0059] Figure 4 It is the leakage detection result curve of the instant learning model using fixed threshold and adaptive threshold. DETAILED DESCRIPTION

[0060] The present invention is further described in detail below with reference to the accompanying drawings and specific examples of actual data of oil storage tanks in integrated energy supply stations.

[0061] The safety of oil storage tanks is related to the overall safety of integrated energy supply stations. Oil tank leakage is the most likely to occur in oil storage tanks, and it is also the fuse for subsequent fires, explosions and other accidents. Therefore, oil tank leakage detection is of great significance. And the relevant leakage detection strategy must meet the characteristics of real-time and accuracy. The present invention takes the liquid level meter and site transaction system data of a distributed system of a comprehensive energy supply station in Zhejiang Province as an example, and extracts seven key variables such as oil height, temperature, gun lifting time, hanging grab time, and refueling amount.

[0062] like Figure 1 As shown, the present invention is a method for detecting oil tank leakage in an integrated energy supply station based on real-time learning and adaptive thresholds, comprising the following steps:

[0063] (1) Collect the current operating status data of the integrated energy supply station in real time and save and collect the historical operating status data of the integrated energy supply station, where the collected historical operating status data include multiple sets of oil height H, temperature T, reading time t in the liquid level meter system and the oil volume V in the tank in the station transaction information system, and the collected current operating status data include the current oil height (obtained by sensor measurement), temperature and oil volume in the tank.

[0064] (2) Data processing of historical data collected from integrated energy supply stations: using the liquid level meter system to obtain oil height H, temperature T, and reading time t; using the station transaction information system to obtain the gun lifting time t t , gun hanging time t g , the sales volume of each refueling, that is, the change in the amount of oil in the tank ΔV.

[0065] The time of picking up guns through the site transaction information system t t , Gun hanging time t g Corresponding to the sampling time of the liquid level meter system, the refueling data, i.e. the data between the gun lifting time and the gun hanging time, are removed from the liquid level meter data; the data segment of the oil unloading operation, i.e. the data segment where the oil height increases significantly, is eliminated;

[0066] Cleaning and removing abnormal points: Since there are obvious outliers and outliers in the raw data collected in the distributed operating system of the integrated energy supply station, in order to establish subsequent feature engineering and improve model accuracy, the data denoising algorithm based on the KNN-3δ criterion is used to remove abnormal samples in the data. This step includes the following sub-steps:

[0067] (2.1) Grouping: The station-level historical data has the characteristics of large data volume and obvious periodicity, so the data is grouped according to the sampling order, and the noise reduction algorithm is applied to each group separately, which reduces the calculation amount of the KNN algorithm. The principle of grouping is to reduce the amount of calculation and eliminate abnormal data at one time as much as possible. If the number of samples in each group is N batch is 200, the total number of samples N is 10000, then the number of groups N group is 50.

[0068] (2.2) KNN Euclidean distance sorting: The data of each group obtained in the first step is:

[0069]

[0070] Then the Euclidean distance vector between the jth sample and the rest of the samples except itself can be expressed as:

[0071]

[0072] where j = 1, 2, ..., (N batch ), -j represents all samples except j in this group.

[0073] (2.3) 3σ criterion for noise extraction: D obtained in sub-step (1.2) j is a 1×(N batch -1) vector, given by D j For each element in , calculate the standard deviation and mean of this set of distances:

[0074] average value:

[0075] Standard Deviation:

[0076] According to the 3δ criterion, the values ​​of the distance data are almost all concentrated in the interval (μ-3σ, μ+3σ)], and the possibility of exceeding this range is only less than 0.27%. Then the measured value is an outlier and should be eliminated.

[0077] (3) Feature matrix: The historical operating status data of the integrated energy supply station is divided into multiple stable states S1, S2…S according to the oil volume. l The basis for the division is that the state without oil unloading and refueling operations is regarded as a stable state through the time of the lifting and hanging in the system. Each stable state includes one or more operating state data at different moments. The oil volume between each stable state is different. The first stable state S1 after the oil unloading operation is taken as the reference starting point. Given an oil volume of zero as the initial value, the oil volume of the second stable state S2 is And so on, the kth stable state Sk The amount of oil is When the oil unloading operation is encountered, the current oil volume plus the unloading volume is used as the current oil volume. k In the steady state S k The number of running status data contained in the following, k = 1, 2, ..., l. The characteristic state matrix is ​​reconstructed according to the steady state number S and the time sequence, and the characteristic state matrix contains the variable steady state number S, oil height H, temperature T and the oil volume V in the steady state. In the actual process of the integrated energy supply station It is a negative value, that is, the amount of refueling, and the amount of oil unloading, that is, the amount of oil added to the tank, is a positive value.

[0078] At this time, the operation matrix can be expressed as:

[0079] X={x1,x2,…,x N}

[0080] Each sample includes oil height, temperature and oil volume in the tank. N represents the number of historical data samples obtained. A prediction sample pair is formed between two sample points, such as samples x1 and x2, forming a feature matrix {H2, T1, H1, T1, V1-V2}. The time order needs to be considered in actual online sample prediction.

[0081] (4) Soft sensor model for oil height prediction based on real-time learning. This step is implemented by the following sub-steps:

[0082] (4.1) Selection based on similar samples with similar oil volume and time.

[0083] First, based on similar samples with similar oil volume, the Euclidean distance is calculated. The Euclidean distance formula for a single variable is as follows:

[0084] d j,q =|v j -v q |

[0085] Among them, v j represents the oil volume of the jth historical sample, v q Indicates the oil volume of the query sample to be predicted. If the distance between the sample oil volumes is d j,q The smaller the value, the higher the similarity of oil quantity between the samples. v The samples were taken as similar samples with similar oil content.

[0086] Secondly, the selection of similar samples with similar time: Since the samples are arranged in chronological order, we only need to take the query sample x q Previous continuous N t A sample is enough.

[0087] At this time, similar samples can be expressed as:

[0088]

[0089] (4.2) Local online modeling:

[0090] The similar samples obtained in sub-step (3.1) form a training set, and a data-driven soft sensor model is established. The oil height soft sensor model is specifically expressed as:

[0091] H q =f(T q , H j , T j , V q -V j )

[0092] In the formula, the subscript q represents the index of the query sample, j represents the index of the query sample at the corresponding historical moment used for prediction, and H q , T q 、V q are the oil height, temperature and oil volume of the query sample respectively, j , T j 、V j are the oil height, temperature and oil volume of similar samples respectively. f(·) is the oil height soft sensing model based on partial least squares regression (PLS).

[0093] (4.3) Oil height prediction: After the local model is established in sub-step (3), the output of the query sample can be predicted. Two points should be noted when making predictions:

[0094] a. Since the oil level in the oil tank changes slowly in a short period of time without oil unloading, multiple consecutive query samples can share the same similar samples, that is, N consecutive query samples. g The query is input into the same oil height prediction model to obtain the predicted oil height;

[0095] b. The influence of historical samples on query samples decreases from recent to distant in time, but if the input samples are too close, the output will completely follow the trend of the input data. Therefore, if the input is fault data, it will not be possible to detect whether a fault has occurred in time. In order to balance the contradiction between the two, the selection of input variables should be separated from the query samples by a certain period of time, and multiple samples with similar time should be taken continuously, such as 100 samples before the moment and N samples before that. test = 50 samples are used as samples for constructing input variables. The predicted value of each query sample is post-processed and fused by exponential weighted average as the final prediction output. The weighted formula is as follows:

[0096]

[0097] in represents the final output of the query sample, and β represents The weight coefficient is an adjustable hyperparameter. Denotes the predicted value of the i-th test sample as input, N test Indicates the number of input samples, the superscript (N test -i) represents the exponent of the weight. The exponentially weighted average is essentially a moving average with exponentially decreasing weights. The weight of each value decreases exponentially over time. The more recent the data, the heavier the weight, but the older data is also given a certain weight. This is consistent with the prediction relationship in the actual oil tank. We believe that the closer the point to the query sample, the higher the credibility, but the impact of samples at a distant time cannot be ignored.

[0098] Once the output prediction is completed, the model is immediately discarded until the next set of query samples arrives, and similar sample selection and local modeling are performed again.

[0099] (5) Oil tank leakage detection method based on adaptive threshold update, this step is implemented by the following sub-steps:

[0100] (5.1) The initial training set prediction residual is obtained by the oil height soft measurement model. The residual comes from the difference between the predicted oil height and the actual oil height. The residual vector can be expressed as:

[0101]

[0102]

[0103] Perform kernel density estimation (KDE) on the residual vector, and take the lower quantile with a confidence level of 0.95 as the initial threshold Thre0. This means that 95% of the residual distribution is a credible interval, and 5% of the samples exceeding this interval are considered outliers.

[0104] In order to improve computational efficiency, the probability density estimation can use normal distribution, so the initial mean and variance θ0 = {μ 0 , δ 0}.

[0105] (5.2) For the query sample, a set of test set residuals will be obtained before exponential weighted fusion, which can be expressed as:

[0106]

[0107] in, Similarly, exponential averaging is performed to obtain the residual of the query sample The residual vector of the query sample can be expressed as:

[0108] Depend on We can calculate θ k ={μ test,k , δ test,k}, where μ test,k , δ test,k They are The mean and variance of .

[0109] (5.3) The threshold is updated adaptively according to each online data (query sample). In order to avoid the threshold of the algorithm adaptively changing with the fault data, the following update strategy is adopted:

[0110] If the residual of query sample k Greater than the threshold Thre k-1 , then the threshold is not updated, let Thre k = Thre k-1 , and output alarm; Thre k It represents the threshold value corresponding to the kth sample, and Thre0 is the initial threshold value.

[0111] If the residual of query sample k is less than or equal to the threshold Thre k-1 , then update the threshold.

[0112] Taking updating the first threshold as an example, if the weighted threshold of the first query sample is greater than the initial threshold, that is, Then the threshold is not updated, Thre1=Thre0, and an alarm is output;

[0113] if Then update the threshold, the updating method is as follows:

[0114] and E train The new residual vector Re-estimate the probability density of the residual distribution and take the lower quantile with a confidence level of 0.95 as the updated threshold Thre1. If it is the kth sample, With E train The new residual vector Re-estimate the probability density of the residual distribution and take the lower quantile with a confidence level of 0.95 as the updated threshold Thre k .

[0115] In order to reduce storage space and computational complexity, the residual can be approximated as a normal distribution and the mean and variance of the distribution can be calculated using a recursive method:

[0116]

[0117]

[0118] The update strategy of each online sample is then deduced in the same way, thus achieving real-time and adaptive threshold update.

[0119] (6) Detection model performance evaluation: Since there is very little fault data in the actual operation state of the integrated energy supply station and there is an obvious problem of class imbalance, it is not possible to simply use the false alarm rate and false negative rate indicators to measure the quality of the model. Therefore, the Matthews correlation coefficient (MCC) is chosen. MCC is the correlation coefficient between the true value and the predicted value in binary classification. The value range is [-1, 1]. The closer the value is to 1, the more accurate the model prediction is. The specific calculation formula is as follows:

[0120]

[0121] Where TP is the number of correct predictions for positive samples; TN is the number of correct predictions for negative samples; FN is the number of incorrect predictions for positive samples; and FP is the number of incorrect predictions for negative samples. The Matthews correlation coefficient is widely used to evaluate classification problems in machine learning, especially classification problems with an imbalance of positive and negative samples. Some scientists claim that the Matthews correlation coefficient is the most informative single score for establishing the prediction quality of a binary classifier in the context of a confusion matrix.

[0122] Regression index R of training set in soft sensor model for oil height prediction using global model and just-in-time learning framework 2 The results are 99.969% and 99.741% respectively, and the RMSE are 2.410 and 1.732 respectively. It can be seen that the accuracy of the two methods in oil height prediction performance is comparable.

[0123] Table 1 shows the test results of this method for the level meter and site transaction system data of a distributed system of a comprehensive energy supply station in Zhejiang Province. In actual operation, there is very little or even no fault data, so random noise is artificially added from the 1500th sample point of the test data to simulate the oil tank leakage scenario that may occur in the actual process, such as Figure 2 The dotted line below the curve to the right of the center vertical line.

[0124] Figure 3 and Figure 4 The detection curves of the global model and the real-time learning model using fixed thresholds and adaptive thresholds are shown respectively. It can be seen from the curves that the global model can detect the fault after a period of time starting from the 1500th sample, while the real-time learning framework can detect the fault immediately when it occurs. This verifies the timeliness of fault detection of real-time learning in this scenario.

[0125] It can also be seen from the curve that the adaptive threshold significantly improves the problem of high false positives and false negatives of the fixed threshold.

[0126] In addition, Table 1 is the statistics of leakage fault detection results. It can be seen that the MCC comprehensive index performs best in the detection strategy using adaptive thresholds in the instant learning framework. The global model uses a dynamic threshold, although the false alarm rate is zero, but the false alarm rate is high. This is because the global model has more training data. When the threshold is updated using the above adaptive threshold method, it is more affected by the training set residuals, and the impact of the test set residuals on the distribution is weakened. This also proves the rationality of the instant learning model in this scenario. It can alleviate the contradiction between the decline in model accuracy caused by too small a training set and the insensitivity of the threshold update caused by too large a training set.

[0127] Table 1 Leakage fault detection results

[0128]

[0129] The superiority of the method of the present invention lies not only in the use of a data-driven approach to avoid the complexity of mechanism modeling, but also in the use of an instant learning framework and an adaptive threshold fault detection strategy, which significantly improves the false alarm rate, missed alarm rate and timeliness of leak detection in oil tanks.

Claims

1. A comprehensive energy supply station oil tank leakage detection method based on real-time learning and adaptive threshold, characterized in that: The method comprises the following steps: (1) collecting the current operation status data of the integrated energy supply station in real time and saving and collecting the historical operation status data of the oil tank of the integrated energy supply station; wherein the historical operation status data of the oil tank of the integrated energy supply station collected is the operation data in a normal stable state without leakage, including multiple groups of oil height H, temperature T, reading time t in the liquid level meter system and the oil volume V in the tank in the station transaction information system, and the current operation status data collected includes the oil height, temperature and oil volume in the tank at the current moment; (2) Nq consecutive real-time operating status data are combined into a query sample set, and N query samples are selected from the historical operating status data according to the query samples. train The training set is composed of similar samples with similar time and oil volume to construct an oil height soft measurement model for real-time learning; the oil height soft measurement model is specifically expressed as: H q =f(T q ,H j ,T j ,V q -V j ) In the formula, the subscript q represents the index of the query sample, j represents the index of the similar sample at the corresponding historical moment used for prediction, and H q , T q 、V q are the oil height, temperature and oil volume of the query sample respectively, j , T j 、V j are the oil height, temperature, and oil volume of similar samples, respectively; (3) In the historical running status data, select a group of N consecutive test The samples are used as test samples together with the corresponding query samples and input into the oil height soft sensor model to predict and obtain N for each query sample. test Predicted oil high The superscript i represents the index of the query sample corresponding to the test sample. test The predicted oil heights are post-processed and fused by exponential weighted average as the final predicted oil height for each query sample. (4) Adaptively updating the threshold according to each query sample, specifically including the following sub-steps: (4.1) The initial training set prediction residual is obtained by the oil height soft measurement model. The residual is the difference between the predicted oil height and the actual oil height. The residual vector can be expressed as: N train =N v +N t Among them, N v N represents the number of similar samples selected according to the threshold with oil volume close to the query sample; t Indicates the number of consecutive samples before the selected query sample as similar samples with similar time; performs kernel density estimation on the residual vector, and takes the lower quantile with a confidence level of 0.95 as the initial threshold Thre0; (4.2) The residual of each query sample and the corresponding test set residual are obtained by the oil height soft measurement model, where the test set residual is expressed as: in, The residual vector of the query sample is expressed as: (4.3) The following update strategy is used to update the threshold of each query sample one by one: If the residual of query sample k Greater than the threshold Thre k-1 , then the threshold is not updated, let Thre k =Thre k-1 , and output alarm; Thre k represents the threshold corresponding to the kth sample, Thre0 is the initial threshold; If the residual of query sample k is less than or equal to the threshold Thre k-1 , then update the threshold: Will With E train The new residual vector Re-estimate the probability density of the residual distribution and take the lower quantile with a confidence level of 0.95 as the updated threshold Thre k .

2. The oil tank leakage detection method for integrated energy supply station based on real-time learning and adaptive threshold according to claim 1 is characterized in that: The step 1 is specifically as follows: Use the level meter system to obtain the oil height H, temperature T, and reading time t; use the site transaction information system to obtain the gun lifting time t t , gun hanging time t g , the sales volume of each refueling, that is, the change in the amount of oil in the tank ΔV; The time of picking up the gun through the site transaction information system t t , Gun hanging time t g Corresponding to the sampling time of the liquid level meter system, the refueling data, i.e. the data between the time of lifting the gun and the time of hanging the gun, are removed from the liquid level meter data; the data segment of the oil unloading operation, i.e. the data segment with obvious increase in oil height, is eliminated; the abnormal points are removed; finally, the multi-segment oil conservation data after removing the oil unloading segment and the refueling segment are obtained, i.e. the operation data under the stable state; The historical operating status data of the integrated energy supply station is divided into multiple stable states S1, S2…S according to the oil volume. l Each steady state includes one or more operating state data at different times. The oil volume in each steady state is different. The first steady state S1 is taken as the reference starting point. Given an oil volume of zero as the initial value, the oil volume in the second steady state S2 is And so on, the kth stable state S k The amount of oil is Among them, m k In the steady state S k The number of operating status data contained below, k = 1, 2, ..., l; reconstruct the characteristic state matrix according to the stable state number S and the time sequence, and the characteristic state matrix contains the variable stable state number S, oil height H, temperature T and the oil volume V in the stable state.

3. The oil tank leakage detection method for integrated energy supply station based on real-time learning and adaptive threshold according to claim 2 is characterized in that: The specific steps to remove outliers are: (a) Divide the historical operating status data into N graup Group; (b) Sort the data of each group obtained in (a) by KNN Euclidean distance: Then the Euclidean distance vector between the jth sample in the group and the rest of the samples except itself is expressed as: where j = 1, 2, ..., (N batch ), -j represents all samples except j in the group, D j The dimension is 1×(N batch -1); (c) 3σ criterion for noise extraction: By D j For each element in , calculate the standard deviation and mean of the group distance: average value: Standard Deviation: According to the 3δ criterion, if there is Then the j-th sample is an outlier and should be removed.

4. The oil tank leakage detection method for integrated energy supply station based on real-time learning and adaptive threshold according to claim 1 is characterized in that: In step 2, N are selected from the historical running status data according to each query sample. train Similar samples with similar time and oil volume, specifically: Based on the Euclidean distance calculation, similar samples with similar oil volume to the query sample are obtained: d j,q =|v j -v q | Among them, v j represents the oil volume of the jth historical sample, v q Indicates the oil volume of the query sample, and selects N according to the threshold v samples are used as similar samples with similar oil content to the query sample; Select the N consecutive samples before the query sample t samples as similar samples with similar time; N train =N v +N t 。 5. The oil tank leakage detection method for integrated energy supply station based on real-time learning and adaptive threshold according to claim 1 is characterized in that: In step 3, N test The predicted oil heights are post-processed and fused by exponential weighted average as the final predicted oil height for each query sample. The details are as follows: in represents the final output of the query sample, and β represents The weight coefficient is an adjustable hyperparameter, with the superscript (N test -i) represents the exponent of the weight.

6. The oil tank leakage detection method for integrated energy supply station based on real-time learning and adaptive threshold according to claim 1 is characterized in that: In step 4, With E train The new residual vector The probability density of the re-estimated residual distribution is specifically: Approximate the residuals to a normal distribution and use the recursive method to calculate the mean and variance of the distribution: Among them, μ k and δ k are the probability density mean and variance of the re-estimated k-th query sample residual, μ 0 , δ 0 are the probability density mean and variance of all query sample residuals obtained from the training set; μ test,k , δ test, k are the residuals obtained from the k-th query sample test set The mean and variance of the probability density of .

Citation Information

Patent Citations

  • Gas station oil tank leakage detection and early warning method based on oil height soft measurement prediction

    CN113326610A

  • Method for building adaptive soft sensor

    US20110295777A1