A substation equipment anomaly detection method and system based on data enhancement, a computer readable storage medium and a terminal device

By using grey relational analysis and the K-nearest neighbor missing value imputation algorithm to fill in the substation equipment data, and combining data augmentation strategies to train the model, the problems of insufficient and imbalanced samples in substation equipment anomaly detection were solved, achieving more efficient and accurate anomaly detection.

CN119885005BActive Publication Date: 2026-02-17STATE GRID HUBEI ELECTRIC POWER CO XIAOGAN POWER SUPPLY CO
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411825356.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-12
Publication Date
2026-02-17
Estimated Expiration
2044-12-12

AI Technical Summary

Technical Problem

Existing technologies for detecting anomalies in substation equipment suffer from problems such as insufficient sample size, unbalanced data, and inaccurate handling of missing data, resulting in low detection accuracy and efficiency, making it difficult to meet the needs of real-time applications.

Method used

We employ grey relational analysis and the K-nearest neighbor missing value imputation algorithm to fill in missing data. Combined with contrastive learning and data augmentation strategies, we generate a high-level training sample set. This set is then used to train and validate an anomaly detection model, resulting in an efficient anomaly detection model.

Benefits of technology

It improves the accuracy and efficiency of substation equipment anomaly detection, can adapt to the dynamic nature of equipment parameters, extract data features and predict future trends, solves the problems of small and imbalanced sample data, and enhances the model's learning ability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119885005B_ABST
    Figure CN119885005B_ABST
Patent Text Reader

Abstract

The application provides a substation equipment anomaly detection method based on data enhancement, which comprises the following steps: S1, collecting multiple sets of time sequence parameter data; S2, filling in the missing parameter data to obtain a filled parameter data set; S3, dividing the filled parameter data set into a primary positive training sample set, a primary negative training sample set and a verification set; S4, obtaining a positive weighted average vector set and a negative weighted average vector set of the primary positive training sample set and the primary negative training sample set; S5, performing data enhancement on the primary negative training sample set by using an enhancement strategy to generate a senior positive training sample set and a senior negative training sample set; S6, performing comparative training on an anomaly detection model by using the senior positive training sample set and the senior negative training sample set to generate a trained anomaly detection model; and S7, obtaining to-be-detected parameter data and performing anomaly detection on the to-be-detected parameter data by using the trained anomaly detection model to generate a detection result. The application provides an efficient and accurate substation equipment anomaly detection method and system.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of data processing, and in particular to a substation equipment anomaly detection method and system based on data enhancement, a computer readable storage medium and a terminal device. BACKGROUND

[0002] With the development of the times, the demand for electricity in China is increasing, which means that the scale of power plants and substations and the number of power equipment are increasing, and at the same time, the stability of power system equipment becomes more important. The substation is an important part of the power system, mainly used for converting high-voltage electrical energy into low-voltage electrical energy suitable for distribution and use. Due to the complex environment of the substation, equipment failure and other problems often occur, which has a serious impact on the normal operation of the power system and the quality of power supply. Therefore, the research and application of substation anomaly detection technology have important practical significance. Substation anomaly detection refers to real-time monitoring and fault diagnosis of substation equipment, timely detection of abnormal conditions of equipment and giving corresponding processing measures to ensure the stable operation of the power system. This task mainly monitors the surface appearance and internal parameters of the substation equipment, and uses image, data processing and model diagnosis methods to identify the fault and abnormal state of the equipment, so as to realize the fault prediction and advance maintenance of the substation equipment, effectively reduce the failure rate and operation and maintenance cost of the equipment.

[0003] In the prior art, substation anomaly detection methods are mainly divided into statistical method-based anomaly detection and machine learning method-based anomaly detection methods; among them, the statistical method-based anomaly detection includes Gaussian mixture model (GMM), histogram-based method, and kernel function-based method; the machine learning method-based anomaly detection includes density-based method, classification-based anomaly detection and prediction-based method. The statistical method-based anomaly detection is affected by both parametric and non-parametric statistical methods when the distribution of data points is not a known distribution or is relatively complex; for non-parametric statistical methods, the operation is too complex, and the cost performance is low. The distance-based method is more dependent on the current state and local structure of the data, and is less sensitive to the time characteristics and long-term patterns of the data, and at the same time, it is not accurate enough for high-dimensional data processing. The density-based method is relatively complex in high-dimensional space, and may suffer from the curse of dimensionality, which is not suitable for real-time applications with high response requirements; the classification-based method often needs to assume data distribution, and it is difficult to handle atypical data; at the same time, it needs to define the abnormal class in advance, which means complete abnormal types, and if a new abnormal type is encountered, the model needs to be retrained. Secondly, the classification-based method has the problems of high dependence on sample data set and poor interpretability of prediction results.

[0004] It is worth noting that the number of samples of abnormal cases in actual business is often insufficient, so the abnormal identification model training will encounter problems such as lack of sample data amount, richness and sample imbalance of abnormal cases, and a large amount of labeled data is needed to train the abnormal identification model, which consumes a lot of time and resources. In addition, due to uncontrollable factors such as substation equipment failure and transmission channel interference, the abnormal situation of missing substation parameter data is inevitable, which leads to poor accuracy of abnormal detection. Therefore, there is an urgent need for an abnormal detection method for substation equipment that can overcome the above problems and provide more efficient and accurate substation equipment. SUMMARY

[0005] To solve the above technical problems, the present application provides a substation equipment anomaly detection method based on data enhancement, which comprises:

[0006] S1 collects multiple sets of time series parameter data of substation equipment to form a time series parameter data set; the time series parameter data includes parameter data of different time series;

[0007] S2 fills in the missing parameter data in each set of time series parameter data by combining the grey correlation analysis method and the K nearest neighbor missing value imputation algorithm to obtain a filled parameter data set;

[0008] S3 divides the filled parameter data set into a contrast learning training sample set and a validation set; the contrast learning training sample set is divided into a primary positive training sample set and a primary negative training sample set;

[0009] S4 sets weights based on parameter data of different time series, and sequentially performs weighted average on each set of time series parameter data in the primary positive training sample set and the primary negative training sample set to obtain a positive weighted average vector set and a negative weighted average vector set;

[0010] S5 generates a senior positive training sample set and a senior negative training sample set by using an enhancement strategy to perform data enhancement processing on the primary negative training sample set based on the positive weighted average vector set and the negative weighted average vector set, and forms a senior training sample set;

[0011] S6 trains the anomaly detection model using the senior positive training sample set and the senior negative training sample set in the senior training sample set, and verifies it using the validation set to generate a trained anomaly detection model;

[0012] S7 obtains the to-be-detected parameter data of the substation, and performs anomaly detection on it using the trained anomaly detection model to generate a detection result.

[0013] Specifically, the primary positive training sample set in step S3 includes multiple sets of filled normal time series parameter data; and the primary negative training sample set includes multiple sets of filled abnormal time series parameter data.

[0014] Specifically, step S5 further comprises:

[0015] S51, each set of padded abnormal time series parameter data in the primary negative training sample set is converted into a vector form by an encoder to form a primary negative vector set; a fully connected layer is used to map the primary negative vector set into a high-dimensional space d0 to obtain a middle negative vector set;

[0016] S52, a Dropout operation is performed on the middle negative vector set to obtain a high-level negative vector set; wherein the high-level negative vector set The specific formula is:

[0017]

[0018] wherein, is a negative weighted average vector, is a d0xd matrix, d is the initial dimension of the padded time series parameter data, b d is a bias vector, and U is an activation function ReLU, is a dropout operation performed on the middle negative vector set with a probability of

[0019] S53, the high-level negative vector set is reflected mapped to the initial dimension by a decoder to obtain an augmented negative training sample set; the augmented negative training sample set and the primary training sample set constitute a high-level negative training sample set;

[0020] S54, each set of padded normal time series parameter data in the primary positive training sample set is converted into a vector form by an encoder to form a primary positive vector set; a fully connected layer is used to map the primary positive vector set into a high-dimensional space d0 to obtain a high-level positive vector set; wherein the high-level positive vector set The specific formula is:

[0021]

[0022] wherein, is a positive weighted average vector, is a d0xd matrix, d is the initial dimension of the padded time series parameter data, b d is a bias vector, and U is an activation function ReLU;

[0023] S55, the high-level positive vector set is further reflected mapped to the initial dimension by a decoder to obtain a high-level positive training sample set.

[0024] Specifically, step S2 further comprises:

[0025] ​S21 takes a set of time series parameter data containing missing parameter data as a target sequence, and takes the time corresponding to the missing parameter data as a time reference t; takes the time series parameter data corresponding to the time range of t and t+l as a reference sequence, and forms a reference sequence set;

[0026] S22 uses the Euclidean distance formula to calculate the distance between the target sequence and each reference sequence in turn, searches for the K closest sample sequences to the target sequence, and obtains a sample sequence set;

[0027] S23 calculates the grey correlation degree of the target sequence and each sample sequence in turn, and calculates the correlation weight according to the grey correlation degree; wherein the grey correlation degree calculation formula is:

[0028]

[0029] wherein, is the target sequence; is the i-th sample sequence in the K sample sequences; is the grey correlation coefficient of the target sequence and the i-th sample sequence in the K sample sequences; is the average value of the grey correlation coefficient of the i-th sample sequence in the K sample sequences, is the grey correlation coefficient of the target sequence and each sample sequence in the time attribute; j is the sample sequence corresponding to the j-th time slot interval from the time reference t; is the parameter data corresponding to the j-th time slot of the i-th sample sequence in the l time slot range, is the parameter data corresponding to the j-th time slot of the target sequence in the l time slot range;

[0030] wherein the grey correlation coefficient is calculated according to the formula:

[0031]

[0032] wherein, is the resolution coefficient, ; T is the parameter data of the i-th sample sequence in the l time slot range at the T-th time slot;

[0033] S24 further calculates the estimated value of the missing parameter data according to the parameter data of each sample sequence at the time reference t, and combines the correlation weight to obtain the estimated value by weighted average; inserts the estimated value into the time series parameter data set to obtain the filled parameter data set.

[0034] Specifically, the anomaly detection model in step S6 includes a data weighting layer, a full connection layer, and a Softmax prediction layer.

[0035] Specifically, step S6 further includes:

[0036] S61, iteratively contrastively train the anomaly detection model using the advanced positive training sample set and the advanced negative training sample set in the advanced training sample set, and update the model parameters according to the loss value of the contrastive loss function, to generate a trained anomaly detection model;

[0037] S62, verify the trained anomaly detection model using a verification set, obtain each verification set and its corresponding probability prediction value, and calculate the true positive rate value, false positive rate value, precision rate and recall rate of each verification sample;

[0038] S63, according to the false positive rate value and the true positive rate value, draw an ROC curve on a preset two-dimensional coordinate axis; calculate the area surrounded by the ROC curve and the X-axis in the two-dimensional coordinate axis to obtain an ROCAUC score;

[0039] S64, according to the precision rate and the recall rate, draw a PR curve on a preset two-dimensional coordinate axis; calculate the area surrounded by the PR curve and the X-axis in the two-dimensional coordinate axis to obtain a PRAUC score;

[0040] S65, take the ROCAUC score and the PRAUC score as the evaluation result of the prediction ability of the trained anomaly detection model;

[0041] S66, determine whether the evaluation result of the prediction ability meets a preset evaluation threshold, if not, continue to train the trained anomaly detection model until the evaluation result of the prediction ability of the trained anomaly detection model meets the evaluation threshold.

[0042] Specifically, the contrastive loss function Loss in step S61 is:

[0043]

[0044] wherein n is the total number of advanced training samples, is the i-th advanced training sample, is the i-th advanced positive training sample, f() is a plurality of layers of neural networks, is the cosine similarity of two vectors, is used to control the shape of the loss function, and is used to adjust the distinction degree of the advanced positive training sample set and the advanced negative training sample set.

[0045] The second object of the present application is to provide a substation equipment anomaly detection system based on data enhancement, which comprises:

[0046] A data acquisition module is configured to acquire parameter data to be measured of a substation.

[0047] The data filling module fills in the missing parameter data in the parameter data to be measured of the substation by combining a grey correlation analysis method and a K nearest neighbor missing value filling algorithm, and obtains the filled parameter data to be measured.

[0048] The abnormality detection module detects the filled parameter data to be measured by using the trained abnormality detection model, and generates a detection result.

[0049] The third object of the present application is to provide a computer readable storage medium storing one or more programs, which can be executed by one or more processors to implement the steps in the above method.

[0050] The fourth object of the present application is to provide a terminal device, which comprises a processor, a memory, a communication bus and a display screen.

[0051] Compared with the prior art, the present application has the following advantages:

[0052] (1) The present application fills in the missing parameter data in each group of time series parameter data by combining a grey correlation analysis method and a K nearest neighbor missing value filling algorithm, assigns correlation weights according to the correlation size of the grey correlation degree between the K nearest sample sequences and the missing data, adds the influence of entropy weight, and fills in the missing values by combining the space-time characteristics of the device data, so that the filling result is more accurate, and the abnormality detection accuracy of the substation device is improved.

[0053] (2) The present application trains the abnormality detection model by a small amount of labeled data, and uses different data enhancement strategies to enhance the data of positive training samples and negative training samples respectively, so that the distribution of positive training samples is consistent, and the distribution of negative training samples is uniform, and then the similarity between positive samples and negative samples is compared to train the model, which enhances the ability of the model to learn features, solves the problem of small amount of abnormal sample data and uneven sample distribution, and improves the efficiency of model training.

[0054] (3) The present application uses the trained abnormality detection model to better adapt to the dynamics of substation device parameter data, better extract data features, and extract time features of data based on a prediction method, predict the trend of future data according to the time trend of historical data, and thus improve the accuracy and efficiency of detection. BRIEF DESCRIPTION OF DRAWINGS

[0055] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings needed in the embodiments. Obviously, the drawings described below only constitute some embodiments of the present application, and for those skilled in the art, other drawings can also be obtained from these drawings without creative labor.

[0056] Figure 1 A flow chart of a substation equipment anomaly detection method based on data enhancement in an embodiment of the present application;

[0057] Figure 2 A schematic diagram of missing parameter data in a set of time sequence parameter data in an embodiment of the present application;

[0058] Figure 3 A technical flow chart of generating a trained anomaly detection model in an embodiment of the present application;

[0059] Figure 4 An ROC curve diagram of a trained anomaly detection model in an embodiment of the present application;

[0060] Figure 5 A PR curve diagram of a trained anomaly detection model in an embodiment of the present application;

[0061] Figure 6 A system framework diagram of a substation equipment anomaly detection system based on data enhancement in an embodiment of the present application;

[0062] Figure 7 A schematic diagram of a terminal equipment framework in an embodiment of the present application. DETAILED DESCRIPTION

[0063] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments only constitute some embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art belong to the scope of protection of the present application.

[0064] Please refer to Figure 1 , Figure 1 A flow chart of a substation equipment anomaly detection method based on data enhancement in an embodiment of the present application; the method comprises:

[0065] S1 collects a plurality of sets of time sequence parameter data of substation equipment to form a time sequence parameter data set; the time sequence parameter data comprises parameter data of different time sequences;

[0066] S2 fills in missing parameter data in each set of time sequence parameter data by combining a grey correlation analysis method and a K-nearest neighbor missing value imputation algorithm to obtain a filled-in parameter data set.

[0067] Please refer to Figure 2 , Figure 2 is a schematic view of missing parameter data in a set of time sequence parameter data in the embodiment of the application; the transformer oil temperature can effectively reflect the working condition of the power transformer, and the over-high top oil temperature is a serious defect and should be handled as soon as possible. The problem of over-high oil temperature may be transformer component damage, winding short circuit, transformer overload and the like, so the prediction of the transformer oil temperature has important significance. The embodiment of the application takes the transformer data as an example, records the related data of two transformers in a certain place in China, each data point is recorded once per hour or per minute, and each data point contains 8 attributes including the oil temperature, and other attributes such as time, high effective load and high invalid load. When a certain attribute has a missing value, the related values can be interpolated by using the grey correlation analysis to perfect the data. The embodiment of the application takes the oil temperature data of the transformer as the time sequence parameter data, as shown in the figure, the attribute value of“LULL”is missing at 21:00 on July 23, 2017. When the missing value is difficult to recover, it will have a great influence on the training of the model. The commonly used method is to interpolate the data. In the embodiment of the application, the KNN interpolation method combined with the grey correlation analysis is adopted. The basic idea of the grey correlation analysis is to determine the similarity of the reference data sequence and a plurality of comparison data columns to judge whether the contact is close, and the grey correlation degree analysis is suitable for dynamic analysis of a system and provides a quantitative measurement for the development trend.

[0068] In the embodiment of the application, step S2 further comprises:

[0069] S21 takes a set of time sequence parameter data containing missing parameter data as a target sequence, takes the time corresponding to the missing parameter data as a time reference t, takes the time sequence parameter data corresponding to the time interval l time slots around the time reference t as a reference sequence, and forms a reference sequence set;

[0070] S22 uses the Euclidean distance formula to calculate the distance between the target sequence and each reference sequence in turn, searches for K sample sequences closest to the target sequence, and obtains a sample sequence set;

[0071] S23 calculates the grey correlation degree of the target sequence and each sample sequence in turn, and calculates the correlation weight according to the grey correlation degree; wherein the grey correlation degree calculation formula is:

[0072]

[0073] wherein, is the target sequence; is the i th sample sequence in the K sample sequences; is the target sequence and the i th sample sequence; and the average of the grey correlation coefficients of the i th sample sequence, is the grey correlation coefficient of the target sequence and each sample sequence in time attribute; j is the sample sequence corresponding to the time reference t interval j time slots; is the parameter data corresponding to the j th time slot of the i th sample sequence in the range of l time slots, is the parameter data corresponding to the j th time slot of the target sequence in the range of l time slots;

[0074] wherein the grey correlation coefficient The calculation formula is:

[0075]

[0076] wherein, is the resolution coefficient, ; T is the parameter data of the i th sample sequence in the range of l time slots and the T th time slot;

[0077] S24 According to the parameter data of each sample sequence at the time reference t, the estimated value of the missing parameter data is calculated by weighted average calculation combined with the correlation weight; the estimated value is inserted into the time sequence parameter data set to obtain the filled parameter data set.

[0078] ρ is the resolution coefficient, the value range is (0, 1), the smaller ρ is, the greater the correlation coefficient difference is, and the value in the embodiment of the application is 0.5. Finally, the weight of the similar vector is calculated according to and the grey correlation coefficient of each sample sequence, and the missing value is obtained by taking weighted average according to the parameter data of the similar vector at t.

[0079] The basic idea of K-Nearest Neighbor (KNN) classification algorithm is that if most of the k nearest neighbors of a sample belong to a certain class in the same feature space, then the sample also belongs to the class. In the missing value filling technology, the KNN algorithm is used to select K nearest neighbors of the missing data from the complete data set based on the same class similarity theory of the target sample and the nearest neighbor sample. The degree of proximity between two samples is determined according to the distance between them. The present application calculates the attribute weighted gray correlation degree by the gray correlation degree method; calculates the gray correlation coefficient of the non-missing sample and the missing sample, selects K nearest neighbors based on the KNN algorithm, and fills the missing sample attribute by using the weighted average of the attributes of the K nearest neighbors. The introduction of gray correlation analysis is helpful to combine the time and space characteristics of the device data to interpolate the missing values. When a certain feature is found to be missing, first locate the time sequence of the missing data point, measure the Euclidean distance of the sequence and the previous l time slot sequences, find the K samples closest to the sequence; then calculate the gray correlation degree of the missing data point sequence and the K sequences, assign the correlation weight according to the correlation degree, and finally calculate the missing value and interpolate it into the sequence.

[0080] According to the gray correlation analysis interpolation, the k rows of data closest to the current row of data in the first n (for example, n=50) rows of data are calculated, and then the gray correlation degrees of the k rows of data and the missing data are calculated to analyze the time correlation; finally, the interpolation value is calculated according to the weight distribution according to the correlation degree.

[0081] In the embodiment of the present application, the anomaly detection model in step S6 includes a data weighting layer, a fully connected layer and a Softmax prediction layer.

[0082] S3 divides the filled parameter data set into a contrast learning training sample set and a validation set; and divides the contrast learning training sample set into a primary positive training sample set and a primary negative training sample set.

[0083] In the embodiment of the present application, the primary positive training sample set in step S3 includes a plurality of sets of filled normal time series parameter data; and the primary negative training sample set includes a plurality of sets of filled abnormal time series parameter data.

[0084] S4 sets weights based on the parameter data of different time series, and sequentially performs weighted averaging on each group of time series parameter data in the primary positive training sample set and the primary negative training sample set to obtain a positive weighted average vector set and a negative weighted average vector set.

[0085] In the embodiment of the present application, the filled abnormal time series parameter data is input into a data weighted average layer (WA layer), where represents a set of filled abnormal time series parameter data, and after entering the WA layer, the weighted average vector is obtained after weighted averaging , the dimension is kept unchanged.

[0086]

[0087] wherein, represents a weighted average vector of input data, n is the number of parameter data entries, is a weight. The weight here can be manually set in advance, because the importance of each parameter value of the power grid equipment is often different, and the importance of data at different times is also different, and the weight can be manually set accordingly. In the process of model calculation, these parameters will also participate in training and be updated constantly. The substation equipment data set is often time-dependent, and the purpose of weighted average is to retain the time details in the sequence.

[0088] S5, based on the set of positive weighted average vectors and the set of negative weighted average vectors, adopts an enhancement strategy to perform data enhancement processing on the primary negative training sample set to generate a senior positive training sample set and a senior negative training sample set, forming a senior training sample set.

[0089] In the embodiments of the present application, step S5 further comprises:

[0090] S51 converts each set of filled abnormal time series parameter data in the primary negative training sample set into a vector form through an encoder to form a primary negative vector set; and maps the primary negative vector set to a high-dimensional space d0 through a fully connected layer to obtain an intermediate negative vector set.

[0091] First, the parameter data in the primary negative training sample set is mapped to a low-dimensional space d1, the information contained in the data vector is compressed, the information density is improved, and the cost of iterative calculation is reduced.

[0092] S52 performs a Dropout operation on the intermediate negative vector set to obtain a senior negative vector set; wherein the senior negative vector set The specific formula is:

[0093]

[0094] wherein, is a negative weighted average vector, is a matrix of d0xd, d is the initial dimension of the filled time series parameter data, b d is a bias vector, and U is an activation function ReLU, is a dropout operation on the intermediate negative vector set with a probability of

[0095] S53 reflects the senior negative vector set to the initial dimension through a decoder to obtain an augmented negative training sample set; the augmented negative training sample set and the primary training sample set constitute the senior negative training sample set;​

[0096] S54 The filled normal time series parameter data in each group in the primary positive training sample set is converted into a vector form by an encoder to form a primary positive vector set; a fully connected layer is used to map the primary positive vector set into a high-dimensional space d0 to obtain a high-level positive vector set; wherein the high-level positive vector set is obtained The specific formula is:

[0097]

[0098] wherein, is a positive weighted average vector, is a matrix of d0xd, d is the initial dimension of the filled time series parameter data, b d is a bias vector, and U is an activation function ReLU;

[0099] S55 The high-level positive vector set is further mapped to the initial dimension by a decoder to obtain a high-level positive training sample set.

[0100] S6 The abnormal detection model is trained by using the high-level positive training sample set and the high-level negative training sample set in the high-level training sample set, and the trained abnormal detection model is verified by using a verification set.

[0101] Please refer to Figure 3 , Figure 3 is a technical flowchart for generating the trained abnormal detection model in the embodiment of the application. In the embodiment of the application, step S6 further includes:

[0102] S61 The abnormal detection model is iteratively trained by using the high-level positive training sample set and the high-level negative training sample set in the high-level training sample set, and the model parameters are updated according to the loss value of the comparative loss function to generate the trained abnormal detection model;

[0103] S62 The trained abnormal detection model is verified by using a verification set, each verification set and the corresponding probability prediction value thereof are obtained, and the true positive rate value, the false positive rate value, the precision rate and the recall rate of each verification sample are calculated;

[0104] S63 The ROC curve is plotted on the preset two-dimensional coordinate axis according to the false positive rate value and the true positive rate value; the surrounding area of the ROC curve and the X-axis in the two-dimensional coordinate axis is calculated to obtain the ROCAUC score;

[0105] S64 The PR curve is plotted on the preset two-dimensional coordinate axis according to the precision rate and the recall rate; the surrounding area of the PR curve and the X-axis in the two-dimensional coordinate axis is calculated to obtain the PRAUC score;

[0106] S65 takes the ROC AUC score and the PRAUC score as the evaluation result of the prediction ability of the trained anomaly detection model;

[0107] S66 judges whether the evaluation results of the prediction ability meet the preset evaluation threshold value, and if not, continues to train the trained anomaly detection model until the evaluation results of the prediction ability of the trained anomaly detection model meet the evaluation threshold value.

[0108] The calculation formula of the true positive rate TPR is:

[0109]

[0110] The calculation formula of the false positive rate FPR is:

[0111]

[0112] The calculation formula of the precision P is:

[0113]

[0114] Wherein, TP represents the number of true positive results, FP represents the number of false positive results. TPR is the true positive rate, which indicates how many of all positive samples are correctly predicted, FPR is the false positive rate, which indicates how many negative samples in the true sample are predicted as positive samples. For a model, the higher the TPR is, the lower the FPR is, and the better the model is. Taking TPR as the vertical axis and FPR as the horizontal axis, the obtained curve is the ROC curve. According to the foregoing analysis, the more the ROC curve protrudes to the left and upper, the better the model performance is. In order to measure the degree of protrusion, the area surrounded by the ROC curve and the horizontal axis is used to quantify this concept. The larger the area is, the better the model is. The vertical coordinate of the PR curve is the precision P, which represents the proportion of all true positive samples predicted as positive samples. R is the recall rate, which is the horizontal coordinate of the PR curve, and it is equal to TPR.

[0115] In the embodiment of the application, the contrast loss function Loss in step S61 is:

[0116]

[0117] Wherein, n is the total number of high-level training samples, is the i th high-level training sample, is the i th high-level positive training sample, f() is a plurality of layers of neural networks, is the cosine similarity of two vectors, is used to control the shape of the loss function.

[0118] The model makes the positive sample distribution as consistent as possible, and the loss function aims to maximize the similarity between positive examples and minimize the similarity between negative sample pairs. The numerator of the loss function contains the cosine similarity of the prediction and the original label of the positive sample in the validation set, and the denominator contains the cosine similarity of all examples, which means that the minimization of the loss function can make the positive examples close to each other and the negative examples far away from each other, so as to achieve the purpose of "consistent positive example distribution and uniform negative example distribution". The loss function itself is a cross-entropy loss function, which can be optimized by some classic algorithms such as SGD or ADAM algorithm in implementation.

[0119] Please refer to Figure 4 and Figure 5 , Figure 4 is an ROC curve diagram of the trained anomaly detection model in the embodiment of the application. Figure 5 is a PR curve diagram of the trained anomaly detection model in the embodiment of the application. It can be known from Figure 5 that the ROC-AUC score is 0.90, which indicates that the model performs well in distinguishing between abnormal and normal samples; the PR-AUC score is 0.86, which indicates that the model can accurately identify abnormal samples.

[0120] S7 obtains the to-be-tested parameter data of the substation, and uses the trained anomaly detection model to perform anomaly detection on the to-be-tested parameter data to generate a detection result.

[0121] Please refer to Figure 6 , Figure 6 is a framework diagram of a substation equipment anomaly detection system based on data enhancement in the embodiment of the application; the embodiment of the application also provides a substation equipment anomaly detection system 100 based on data enhancement, which comprises:

[0122] A data acquisition module 101 is configured to acquire to-be-tested parameter data of a substation.

[0123] A data filling module 102 is configured to fill in missing parameter data in the to-be-tested parameter data of the substation by combining a grey correlation analysis method and a K-nearest neighbor missing value imputation algorithm to obtain filled to-be-tested parameter data.

[0124] An anomaly detection module 103 is configured to use a trained anomaly detection model to perform anomaly detection on the filled to-be-tested parameter data to generate a detection result.

[0125] The embodiment of the application also provides a computer readable storage medium, which stores one or more programs, and the one or more programs can be executed by one or more processors to implement the steps in the above method.

[0126] Please refer to Figure 7 , Figure 7This is a schematic diagram of the framework of a terminal device according to an embodiment of the present invention. The present invention also provides a terminal device 200, which includes: a processor 201, a memory 202, a communication bus 203, and a display screen 204; the memory stores a computer-readable program executable by the processor; the communication bus enables communication between the processor and the memory; when the processor executes the computer-readable program, it implements the steps in the above-described method.

[0127] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product implemented on one or more computer-usable storage media (including, but not limited to, disk storage and optical storage) containing computer-usable program code.

[0128] Obviously, those skilled in the art can make various modifications and variations to this application without departing from the spirit and scope of this application. Therefore, if such modifications and variations fall within the scope of the claims of this application and their equivalents, this application also intends to include such modifications and variations.

Claims

1. A data augmentation based substation equipment anomaly detection method, characterized in that, The method comprises: S1 collecting oil temperature data of multiple groups of transformers of substation equipment, taking the oil temperature data of the transformers as time sequence parameter data to form a time sequence parameter data set; the time sequence parameter data comprises parameter data of different time sequences; S2 filling in missing parameter data in each group of time sequence parameter data by combining a grey correlation analysis method and a K-nearest neighbor missing value imputation algorithm to obtain a filled parameter data set; S3 dividing the filled parameter data set into a contrast learning training sample set and a verification set; dividing the contrast learning training sample set into a primary positive training sample set and a primary negative training sample set; S4 setting weights based on the parameter data of different time sequences, and sequentially performing weighted averaging on each group of time sequence parameter data in the primary positive training sample set and the primary negative training sample set to obtain a positive weighted average vector set and a negative weighted average vector set; S5 performing data enhancement processing on the primary negative training sample set by using an enhancement strategy based on the positive weighted average vector set and the negative weighted average vector set to generate a senior positive training sample set and a senior negative training sample set, and forming a senior training sample set; S6 performing contrast training on an anomaly detection model by using the senior positive training sample set and the senior negative training sample set in the senior training sample set, and performing verification by using the verification set to generate a trained anomaly detection model; S7 obtaining to-be-detected parameter data of a substation, performing anomaly detection on the to-be-detected parameter data by using the trained anomaly detection model, and generating a detection result; Further, step S5 comprises: S51 converting each group of filled abnormal time sequence parameter data in the primary negative training sample set into a vector form by using an encoder to form a primary negative vector set; and mapping the primary negative vector set to a high-dimensional space d0 by using a fully connected layer to obtain an intermediate negative vector set; S52 performs a Dropout operation on the intermediate negative vector set to obtain a high-level negative vector set; wherein the high-level negative vector set is obtained The specific formula is: wherein, is a negative weighted average vector, is a d0xd matrix, d is the initial dimension of the padded time series parameter data, b d is a bias vector, U is an activation function ReLU, is a d0xd matrix, d is the initial dimension of the padded time series parameter data, b dropout operation is performed on the intermediate negative vector set with a probability of S53 reflecting the senior negative vector set to the initial dimension by using a decoder to obtain an augmented negative training sample set; and combining the augmented negative training sample set and the primary training sample set to form the senior negative training sample set; S54 The filled normal timing parameter data of each group in the primary positive training sample set is converted into a vector form by an encoder to form a primary positive vector set; a fully connected layer is used to map the primary positive vector set into a high-dimensional space d0 to obtain a high-level positive vector set; wherein the high-level positive vector set The specific formula is: wherein, is a positive weighted average vector, is a d0xd matrix, d is the initial dimension of the padded time series parameter data, b d is a bias vector, U is an activation function ReLU; S55 reflecting the senior positive vector set to the initial dimension by using the decoder to obtain the senior positive training sample set.

2. The method of claim 1, wherein, The primary positive training sample set in step S3 comprises multiple groups of filled normal time sequence parameter data; and the primary negative training sample set comprises multiple groups of filled abnormal time sequence parameter data.

3. The method of claim 1, wherein, Further, step S2 comprises: S21 taking a group of time sequence parameter data containing missing parameter data as a target sequence, taking a time corresponding to the missing parameter data as a time reference t, and taking time sequence data corresponding to a time interval l of the time reference t as a reference sequence to form a reference sequence set; S22 sequentially calculating distances between the target sequence and each reference sequence by using a Euclidean distance formula, searching for K sample sequences closest to the target sequence, and obtaining a sample sequence set; S23 sequentially calculating grey correlation degrees of the target sequence and each sample sequence, and calculating correlation weights according to the grey correlation degrees; wherein a grey correlation degree calculation formula is: wherein, is a target sequence; is the i-th sample sequence in K sample sequences; is a target sequence and is an average value of the grey correlation coefficient of the i-th sample sequence in K sample sequences, is a grey correlation coefficient of a target sequence and each sample sequence in time attribute; j is a sample sequence corresponding to a time interval of j time slots from a time reference t; is parameter data corresponding to the j-th time slot of the i-th sample sequence in the range of l time slots, is parameter data corresponding to the j-th time slot of a target sequence in the range of l time slots; where the grey correlation coefficient is calculated by the formula: wherein, is a resolution coefficient, ; T is the parameter data of the i-th sample sequence at the T-th time slot within the l time slots; S24 calculating an estimated value of the missing parameter data by using parameter data of each sample sequence at the time reference t and combining the correlation weights for weighted averaging; and inserting the estimated value into the time sequence parameter data set to obtain the filled parameter data set.

4. The method of claim 1, wherein, The anomaly detection model in step S6 includes a data weighting layer, a full connection layer, and a Softmax prediction layer.

5. The method of claim 1, wherein, Step S6 further includes: S61 iteratively contrastively train the anomaly detection model using the advanced positive training sample set and the advanced negative training sample set in the advanced training sample set, and update the model parameters according to the loss value of the contrastive loss function, to generate a trained anomaly detection model; S62 verify the trained anomaly detection model using a verification set, obtain each verification set and its corresponding probability prediction value, and calculate the true positive rate value, false positive rate value, precision rate, and recall rate of each verification sample; S63 draw an ROC curve on a preset two-dimensional coordinate axis according to the false positive rate value and the true positive rate value; calculate the area enclosed by the ROC curve and the X-axis of the two-dimensional coordinate axis to obtain an ROCAUC score; S64 draw a PR curve on a preset two-dimensional coordinate axis according to the precision rate and the recall rate; calculate the area enclosed by the PR curve and the X-axis of the two-dimensional coordinate axis to obtain a PRAUC score; S65 take the ROCAUC score and the PRAUC score as the evaluation result of the prediction ability of the trained anomaly detection model; S66 determine whether the evaluation result of the prediction ability meets a preset evaluation threshold, and if not, continue to train the trained anomaly detection model until the evaluation result of the prediction ability of the trained anomaly detection model meets the evaluation threshold.

6. The method of claim 5, wherein, The contrastive loss function Loss in step S61 is: where n is the total number of high-level training samples, is the i-th high-level training sample, is the i-th high-level positive training sample, f() is a number of layers of neural network, is the cosine similarity of two vectors, is the adjustment of the difference between the high-level positive training sample set and the high-level negative training sample set, which is used to control the shape of the loss function.

7. A system for the data-augmentation-based substation equipment anomaly detection method of any one of claims 1-6, characterized in that, The system includes: A data acquisition module configured to acquire the parameter data to be measured of the substation; A data filling module configured to fill in missing parameter data in the parameter data to be measured of the substation by combining a grey correlation analysis method and a K-nearest neighbor missing value imputation algorithm, to obtain filled-in parameter data to be measured; An anomaly detection module configured to perform anomaly detection on the filled-in parameter data to be measured using the trained anomaly detection model, to generate a detection result.

8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores one or more programs that can be executed by one or more processors to implement the steps in the method of any one of claims 1-6.

9. A terminal device, comprising: The terminal device includes a processor, a memory, a communication bus, and a display screen; the memory stores a computer-readable program that can be executed by the processor; the communication bus realizes connection and communication between the processor and the memory; and the processor executes the computer-readable program to implement the steps in the method of any one of claims 1-6.

Citation Information

Patent Citations

  • Method, system and equipment for predicting ash deposition state of boiler and medium

    CN116881715A

  • Short-term load prediction method based on weighted grey correlation projection method

    CN117318025A