A method for detecting anomaly in power dispatching monitoring data based on dynamic and static selection integration
By using the isolated forest to eliminate base detectors with poor performance in anomaly detection of power dispatch monitoring data, and combining multiple evaluation indicators with meta-learning ideas, the problems of inaccurate calculation of false and true values and limited versatility in existing methods are solved. problem, improving detection accuracy.
Patent Information
- Application Number
- CN202210147086.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-02-17
- Publication Date
- 2024-08-27
- Estimated Expiration
- 2042-02-17
AI Technical Summary
The existing power dispatch monitoring data anomaly detection method based on dynamic selection integration is affected by the poor performance of the base detector, resulting in inaccurate calculation of false and true values, and only uses a single evaluation index to measure the performance of the base detector, which has limited versatility, resulting in detection Accuracy is low.
A method based on dynamic and static selection integration is proposed. By using the isolated forest to eliminate base detectors with poor performance before dynamic selection, combined with the idea of meta-learning, the performance of the base detector is comprehensively evaluated, and the base detector is dynamically selected to generate more accurate The false true value.
It improves the accuracy of abnormal detection of power dispatch monitoring data, alleviates the problem of insufficient performance caused by a single indicator, and enhances the versatility and accuracy of the method.
Smart Images

Figure CN114399407B
Abstract
Description
[Technical field]
[0001] The present invention relates to a method for detecting anomaly of power dispatching monitoring data, and in particular to a method for detecting anomaly of power dispatching monitoring data based on dynamic and static selective integration. [Background technology]
[0002] The unified strong smart grid is a new type of power grid based on the physical power grid, which integrates modern advanced sensor measurement technology, communication technology, information technology, computer technology and control technology with the physical power grid. It includes power generation, transmission, transformation, distribution, power consumption and dispatching. In the actual work of the power system, dispatching is responsible for commanding, supervising and managing the operation of power production, and is an important guarantee for the safe operation of the power system. With the increasing scale of the power grid, the requirements for the safe and stable operation of the power grid are also getting higher and higher, and the anomaly detection of the power grid dispatching monitoring data is becoming more and more important. Since the monitoring system will generate a large amount of monitoring data in a short period of time when the power grid is running, it is almost impossible to manually calibrate all positive and abnormal labels for these data by consulting experts. Therefore, these stored historical power grid dispatching monitoring data often lack accurate label information. Therefore, the unsupervised anomaly detection method that does not require the use of training data label information can better deal with the situation where the stored historical data lacks accurate labels. In the existing unsupervised anomaly detection methods based on dynamic selection ensemble, the false true values generated by combining all the initially trained base detectors will be affected by the base detectors with poor performance and produce deviations, resulting in inaccurate performance scores of the base detectors calculated based on the false true values; and the existing dynamic selection ensemble methods only use a single evaluation index to measure the performance of the base detectors, which has limited versatility, resulting in poor performance of the methods when the index used is not applicable. Therefore, a dynamic and static selection ensemble anomaly detection method is proposed, which first eliminates some base detectors with poor performance through static selection to generate more accurate false true values, and then integrates the idea of meta-learning to comprehensively evaluate the performance of the detectors by combining multiple indicators and dynamically selecting the base detectors. This method can improve the accuracy of the anomaly detection method of power dispatch monitoring data based on integration, which is of great significance for strengthening power grid status monitoring and ensuring power grid security. [Summary of the invention]
[0003] In view of this, the present invention proposes a method for detecting anomaly in power dispatching monitoring data based on dynamic and static selection integration to improve the accuracy of anomaly detection in power dispatching monitoring data.
[0004] The present invention proposes a method for detecting abnormality in power dispatching monitoring data based on dynamic and static selective integration, comprising the following steps:
[0005] (1) Use the historical data of power dispatch monitoring to train a certain number of base detectors, specifically:
[0006] All power monitoring historical data is used as training set X TR Based on the training set, different unsupervised anomaly detection algorithms are used to train m base detectors. Generally, m ≥ 50 is taken. The base detector pool composed of all base detectors is denoted as P O The output of each base detector is an anomaly score. The larger the anomaly score, the greater the degree of anomaly of the input data. O The anomaly scores output by each base detector in are converted to Z scores by Z-score standardization. O The i-th base detector in X TR The jth historical data The anomaly score output above is Its Z score for:
[0007]
[0008] Where: i = 1, 2, ..., m, j = 1, 2, ..., n, n is X TR The amount of historical data in is the average value of the anomaly score output by the i-th base detector on all historical data, is the standard deviation of the anomaly score output by the i-th base detector on all historical data.
[0009] The input of each base detector is the real-time resource occupancy data of the processes related to the power dispatching system business collected by the power dispatching monitoring system, including the process CPU occupancy rate, memory occupancy rate, disk IO, network IO, number of threads, and number of network connections. If the Z score output by the i-th base detector is less than The input data is normal; if the Z score output by the i-th base detector is greater than or equal to The input data is abnormal. TR The Z scores of the outputs are sorted from large to small, and the classification threshold of the i-th base detector is R before sorting DA The minimum value among the % Z scores. DA % is the set base detector output conversion ratio, which is generally 10%.
[0010] (2) Use Isolation Forest to eliminate base detectors with poor performance, specifically:
[0011] Using P O All m base detectors in the training set X TR The Z score output on all n historical data in Train an isolation forest consisting of n_itree isolated trees, where n_itree is usually 100. When constructing an isolated tree, The uniform sampling without replacement is used to obtain ψ data. Generally, Score all ψ n-dimensional data ψ×n As the training sample of this isolated tree. In each isolated tree sample, randomly select a dimension and randomly select a value between the maximum and minimum values of the sample on this dimension, perform binary partition on the sample, divide the samples less than this value on this dimension to the left of the node, and divide the samples greater than or equal to this value to the right of the node, and obtain a split condition and left and right data sets. Repeat the above process on the left and right data sets respectively until the termination condition is reached. There are two termination conditions:
[0012] 1) The data set itself contains only one sample, or all samples are the same;
[0013] 2) The height of the tree reaches log2(ψ).
[0014] All trained isolated trees are combined into an isolation forest IForest. The output of the isolation forest IForest is a continuous value. The smaller the output, the greater the abnormality of the input data.
[0015] Will The rth data in As the input of Isolation Forest IForest, r = 1, 2, ..., m, the corresponding output of Isolation Forest is Isolate Forest IForest Sort the m outputs from small to large, and put the first R D % outputs corresponding to the base detectors are marked as abnormal, R D % is generally 10%. O The base detectors marked as abnormal are removed from the filter, and the base detector pool consisting of the remaining m′ base detectors after screening is denoted as P F .
[0016] (3) Use the average method to generate the false true values of the historical data according to the output of the remaining basis detectors, and convert the false true values and the output of the basis detectors into two-category labels, respectively, as follows:
[0017] Note: F All m′ base detectors in the training set X TR The jth historical data The Z-score composition of the output calculate The average of all Z scores in The false truth value Let training set X be TR The set of false and true values corresponding to all historical data in is
[0018] Will The false and true values in are sorted from large to small, and the threshold PScore thr R before sorting GA The minimum value among % false true values, R GA % is the set false-true value conversion ratio, generally 20%. The corresponding false value Greater than or equal to PScore thr , then its false label is 1, otherwise it is 0. TR The false label set corresponding to all historical data in is
[0019] If P F The a-th base detector in the historical data The Z score of the output Greater than or equal to its classification threshold a=1,2,...,m′,then The second class label output is 1, otherwise it is 0. TR The second-class label output is All base detectors in X TR The output two-category label set is
[0020] (4) Eliminate historical data with too small false-true values, and extract meta-features and meta-labels of the base detector on the remaining historical data, specifically:
[0021] The false and true values of all historical data Sort from small to large, remove the first R after sorting S % historical data corresponding to false true values. The remaining n′ historical data are recorded as X STR , and its corresponding false label set and second-class label set are and The residual basis detector in X STR The Z score on
[0022] For X STR The tth historical data Calculate its original training set X TR The jth historical data Euclidean distance
[0023]
[0024] Where: t = 1, 2, ..., n', l = 1, 2, ..., u, u is the dimension of historical data, for The value in the lth dimension, for The value in the lth dimension.
[0025] The original training set X TR All historical data in Sort the Euclidean distances from small to large, and take the K in front RC As historical data Performance evaluation set Generally, 10≤K RC ≤30.
[0026] for Note: F All base detectors in The Z score of the output is for Note: F All base detectors in The Z score of the output is calculate and Euclidean distance
[0027]
[0028] in: P F The a-th base detector in The Z score of the output, P F The a-th base detector in The Z-score of the above output.
[0029] The original training set X TR All historical data in the base detector are compared with the Z score output on it. Sort the Euclidean distances from small to large, and take the K in front SOP As historical data The approximate output set of Generally, 10≤K SOP ≤30.
[0030] Extraction of P F The a-th base detector in The six element features on :
[0031] 1) Calculate the performance evaluation set The number of historical data with the same second-class label and corresponding false label output by the base detector, and its correlation with K RC as the feature; this group contains one feature;
[0032] 2) Calculate the approximate output set The number of historical data with the same second-class label and corresponding false label output by the base detector, and its correlation with K SOP as the feature; this group contains one feature;
[0033] 3) For the performance evaluation set For each historical data in the, whether the base detector can correctly judge its positive anomaly; if the base detector can correctly judge The qth historical data in, q = 1, 2, ..., K RC , then the qth feature in this group is 0, otherwise it is 1; this group contains K RC Features
[0034] 4) For the approximate output set For each historical data in the, whether the base detector can correctly judge its positive anomaly; if the base detector can correctly judge The pth historical data in, p = 1, 2, ..., K SOP , then the pth feature in this group is 0, otherwise it is 1; this group contains K SOP Features
[0035] 5) Computational performance evaluation set The Z score of each historical data output by the base detector and the classification threshold of the base detector itself The absolute value of the difference between RC Features
[0036] 6) Calculate the base detector for the data to extract meta-features The Z score of the output and the positive classification threshold of the base detector itself ; this group contains 1 feature.
[0037] The above six groups contain a total of M meta-features, M = 3 + 2 × K RC +K SOP ; Extract P by the above method F Each base detector in X STR The meta-features on each historical data in constitute the meta-feature set X TRM , X TRM It contains n′×m′ pieces of feature data.
[0038] Compare P F The a-th base detector in The second class label output and Fake labels Are they the same? If they are the same, then the a-th base detector is Meta tags on is 0, indicating that the a-th base detector can correctly judge Otherwise, it is 1, indicating that the a-th base detector cannot correctly judge Calculate P by the above method F Each base detector in X STR The meta-label set L on each historical data TRM , L TRM Contains n′×m′ meta tags.
[0039] (5) Train the random forest using meta-features and meta-labels, specifically:
[0040] Use meta-feature set X TRM and meta tag set L TRM Train a random forest consisting of n_dtree decision trees, where n_dtree is usually 100. When building a decision tree, start from X TRM N data are sampled evenly with replacement As the training sample of this decision tree, N = n'×m' is generally taken. In each decision tree sample, M' dimensions are randomly selected from M dimensions, generally According to the Gini index, the optimal partitioning dimension and partitioning point are selected on the selected M′ dimensions to perform binary partitioning on the samples. Samples with a value less than the value on this dimension are partitioned to the left of the node, and samples with a value greater than or equal to the value are partitioned to the right of the node, thus obtaining a splitting condition and left and right data sets. Repeat the above process on the left and right data sets respectively until the data set itself includes only one sample, or the meta-labels of all samples are the same. All trained decision trees are combined into a random forest RFC, whose output is a two-category label 0 or 1, indicating whether the corresponding base detector can correctly judge the corresponding data.
[0041] (6) Extract the meta-features of the base detector on the data to be detected, input them into the random forest, select the base detector according to the output of the random forest, take the maximum value of the output of the selected base detector as the detection result of the data to be detected, and realize the abnormal detection of power dispatch monitoring data. Specifically:
[0042] For the data to be detected x TE , use the same method as in step (4) to extract P F Each base detector in x TE The M meta-features on the above constitute the detection meta-feature set X TEM . X TEMInput into the random forest RFC trained in step (5) to obtain the detection meta-label set L containing m′ two-category labels TEM .
[0043] For P F For each base detector in , if its corresponding detection meta-label is 0, it means that this detector is considered to be able to correctly judge the data to be detected, then it will be added to the selected base detector pool P S Calculate P S All basis detectors in x TE The maximum value of the Z score outputted above is used as the data to be detected x TE Calculate P S The maximum value of the classification thresholds of all base detectors in is used as the detection threshold for this detection, and the data to be detected x whose detection results are greater than or equal to the detection threshold TE It is judged as abnormal data, realizing abnormal detection of power dispatch monitoring data.
[0044] It can be seen from the above technical solutions that the present invention has the following beneficial effects:
[0045] In the technical solution implemented by the present invention, by using isolation forest to pre-eliminate some base detectors with poor performance on all training data before dynamically selecting base detectors, the accuracy of the generated false true values can be improved and the performance of the base detector can be evaluated more accurately; when dynamically selecting base detectors, the meta-learning idea is used to effectively combine multiple evaluation indicators to comprehensively evaluate the performance of the base detector, which can alleviate the problem that the dynamic selection integration method has poor performance in some cases due to the effective universality of a single indicator, thereby improving the accuracy of anomaly detection of power dispatching monitoring data based on the integration method.
Brief Description of the Drawings
[0046] In order to more clearly illustrate the technical solution of the present invention, the drawings required for use in the present invention will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0047] Figure 1 It is a schematic diagram of the framework flow of the power dispatching monitoring data anomaly detection method based on dynamic and static selection integration proposed by the present invention;
[0048] Figure 2 It is a schematic diagram of the power dispatching monitoring data anomaly detection method based on dynamic and static selective integration proposed by the present invention;
[0049] Figure 3 It is a schematic diagram of input data and output results of the base detector used in the present invention; [Specific implementation method]
[0050] In order to better understand the technical solution of the present invention, the present invention is described in detail below with reference to the accompanying drawings.
[0051] It should be clear that the described embodiments of the invention are only part of the embodiments of the invention, not all of the embodiments. Based on the embodiments of the invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the invention.
[0052] The present invention provides a method for detecting anomalies in power dispatching monitoring data based on dynamic and static selection integration. In order to meet the anomaly detection requirements of power dispatching monitoring data, the present invention uses an isolation forest to screen a base detector, combines multiple evaluation indicators to comprehensively measure the performance of the base detector, and selects a base detector with better performance by random forest to detect the data to be detected.
[0053] Figure 1 The present invention is a schematic diagram of a framework flow of a method for detecting abnormality in power dispatching monitoring data based on dynamic and static selection integration. The method comprises the following steps:
[0054] Step 101: Use historical data of power dispatch monitoring to train a certain number of base detectors.
[0055] Specifically, all power monitoring historical data is used as the training set X TR Based on the training set, different unsupervised anomaly detection algorithms are used to train m base detectors. Generally, m ≥ 50 is taken. The base detector pool composed of all base detectors is denoted as P O The output of each base detector is an anomaly score. The larger the anomaly score, the greater the degree of anomaly of the input data. O The anomaly scores output by each base detector in are converted to Z scores by Z-score standardization. O The i-th base detector in X TR The jth historical data The anomaly score output above is Its Z score for:
[0056]
[0057] Where: i = 1, 2, ..., m, j = 1, 2, ..., n, n is X TR The amount of historical data in is the average value of the anomaly score output by the i-th base detector on all historical data, is the standard deviation of the anomaly score output by the i-th base detector on all historical data.
[0058] The input of each base detector is the real-time resource occupancy data of the processes related to the power dispatching system business collected by the power dispatching monitoring system, including the process CPU occupancy rate, memory occupancy rate, disk IO, network IO, number of threads, and number of network connections. If the Z score output by the i-th base detector is less than The input data is normal; if the Z score output by the i-th base detector is greater than or equal to The input data is abnormal. TR The Z scores of the outputs are sorted from large to small, and the classification threshold of the i-th base detector is R before sorting DA The minimum value among the % Z scores. DA % is the set base detector output conversion ratio, which is generally 10%.
[0059] Step 102: Use the isolation forest to eliminate base detectors with poor performance.
[0060] Specifically, use P O All m base detectors in the training set X TR The Z score output on all n historical data in Train an isolation forest consisting of n_itree isolated trees, where n_itree is usually 100. When constructing an isolated tree, The uniform sampling without replacement is used to obtain ψ data. Generally, Score all ψ n-dimensional data ψ×n As the training sample of this isolated tree. In each isolated tree sample, randomly select a dimension and randomly select a value between the maximum and minimum values of the sample on this dimension, perform binary partition on the sample, divide the samples less than this value on this dimension to the left of the node, and divide the samples greater than or equal to this value to the right of the node, and obtain a split condition and left and right data sets. Repeat the above process on the left and right data sets respectively until the termination condition is reached. There are two termination conditions:
[0061] 1) The data set itself contains only one sample, or all samples are the same;
[0062] 2) The height of the tree reaches log2(ψ).
[0063] All trained isolated trees are combined into an isolation forest IForest. The output of the isolation forest IForest is a continuous value. The smaller the output, the greater the abnormality of the input data.
[0064] Will The rth data in As the input of Isolation Forest IForest, r = 1, 2, ..., m, the corresponding output of Isolation Forest is Isolate Forest IForest Sort the m outputs from small to large, and put the first R D % outputs corresponding to the base detectors are marked as abnormal, R D % is generally 10%. O The base detectors marked as abnormal are removed from the filter, and the base detector pool consisting of the remaining m′ base detectors after screening is denoted as P F .
[0065] Algorithm 1 is the pseudo code for this step:
[0066]
[0067]
[0068] Step 103, using the average method to generate false true values of the historical data according to the outputs of the remaining base detectors, and converting the false true values and the outputs of the base detectors into two-category labels respectively.
[0069] Specifically, note P F All m′ base detectors in the training set X TR The jth historical data The Z-score composition of the output calculate The average of all Z scores in The false truth value Let training set X be TR The set of false and true values corresponding to all historical data in is
[0070] Will The false and true values in are sorted from large to small, and the threshold PScore thr R before sorting GA The minimum value among % false true values, R GA % is the set false-true value conversion ratio, generally 20%. The corresponding false value Greater than or equal to PScore thr , then its false label is 1, otherwise it is 0. TR The false label set corresponding to all historical data in is
[0071] If P F The a-th base detector in the historical data The Z score of the output Greater than or equal to its classification threshold a=1,2,...,m′,then The second class label output is 1, otherwise it is 0. TR The second-class label output is All base detectors in X TR The output two-category label set is
[0072] Step 104 , remove historical data with too small false true values, and extract meta-features and meta-labels of the base detector on the remaining historical data.
[0073] Specifically, the false and true values of all historical data Sort from small to large, remove the first R after sorting S % historical data corresponding to false true values. The remaining n′ historical data are recorded as X STR , and its corresponding false label set and second-class label set are and The residual basis detector in X STR The Z score on
[0074] For X STR The tth historical data Calculate its original training set X TR The jth historical data Euclidean distance
[0075]
[0076] Where: t = 1, 2, ..., n', l = 1, 2, ..., u, u is the dimension of historical data, for The value in the lth dimension, for The value in the lth dimension.
[0077] The original training set X TR All historical data in Sort the Euclidean distances from small to large, and take the K in front RC As historical data Performance evaluation set Generally, 10≤K RC ≤30.
[0078] for Note: F All base detectors in The Z score of the output is for Note: F All base detectors in The Z score of the output is calculate and Euclidean distance
[0079]
[0080] in: P F The a-th base detector in The Z score of the output, P F The a-th base detector in The Z-score of the above output.
[0081] The original training set X TR All historical data in the base detector are compared with the Z score output on it. Sort the Euclidean distances from small to large, and take the K in front SOP As historical data The approximate output set of Generally, 10≤K SOP ≤30.
[0082] Extraction of P F The a-th base detector in The six element features on :
[0083] 1) Calculate the performance evaluation set The number of historical data with the same second-class label and corresponding false label output by the base detector, and its correlation with K RC as the feature; this group contains one feature;
[0084] 2) Calculate the approximate output set The number of historical data with the same second-class label and corresponding false label output by the base detector, and its correlation with K SOP as the feature; this group contains one feature;
[0085] 3) For the performance evaluation set For each historical data in the, whether the base detector can correctly judge its positive anomaly; if the base detector can correctly judge The qth historical data in, q = 1, 2, ..., K RC , then the qth feature in this group is 0, otherwise it is 1; this group contains K RC Features
[0086] 4) For the approximate output set For each historical data in the, whether the base detector can correctly judge its positive anomaly; if the base detector can correctly judge The pth historical data in, p = 1, 2, ..., K SOP , then the pth feature in this group is 0, otherwise it is 1; this group contains K SOP Features
[0087] 5) Computational performance evaluation set The Z score of each historical data output by the base detector and the classification threshold of the base detector itself The absolute value of the difference between RC Features
[0088] 6) Calculate the base detector for the data to extract meta-features The Z score of the output and the positive classification threshold of the base detector itself ; this group contains 1 feature.
[0089] The above six groups contain a total of M meta-features, M = 3 + 2 × K RC +K SOP ; Extract P by the above method F Each base detector in X STR The meta-features on each historical data in constitute the meta-feature set X TRM , X TRM It contains n′×m′ pieces of feature data.
[0090] Compare P F The a-th base detector in The second class label output and Fake labels Are they the same? If they are the same, then the a-th base detector is Meta tags on is 0, indicating that the a-th base detector can correctly judge Otherwise, it is 1, indicating that the a-th base detector cannot correctly judge Calculate P by the above method F Each base detector in X STR The meta-label set L on each historical data TEM , L TRM Contains n′×m′ meta tags.
[0091] Step 105 , training a random forest using the meta-features and meta-labels.
[0092] Specifically, using the meta-feature set X TRM and meta tag set L TRMTrain a random forest consisting of n_dtree decision trees, where n_dtree is usually 100. When building a decision tree, start from X TEM N data are sampled evenly with replacement As the training sample of this decision tree, N = n'×m' is generally taken. In each decision tree sample, M' dimensions are randomly selected from M dimensions, generally According to the Gini index, the optimal partitioning dimension and partitioning point are selected on the selected M′ dimensions to perform binary partitioning on the samples. Samples with a value less than the value on this dimension are partitioned to the left of the node, and samples with a value greater than or equal to the value are partitioned to the right of the node, thus obtaining a splitting condition and left and right data sets. Repeat the above process on the left and right data sets respectively until the data set itself includes only one sample, or the meta-labels of all samples are the same. All trained decision trees are combined into a random forest RFC, whose output is a two-category label 0 or 1, indicating whether the corresponding base detector can correctly judge the corresponding data.
[0093] Algorithm 2 is the pseudo code of steps 103-105:
[0094]
[0095]
[0096]
[0097] Step 106, extract the meta-features of the base detector on the data to be detected, input them into the random forest, select the base detector according to the output of the random forest, take the maximum value of the output of the selected base detector as the detection result of the data to be detected, and realize the abnormal detection of power dispatch monitoring data.
[0098] Specifically, for the data to be detected x TE , extract P using the same method as in step 104 F Each base detector in x TE The M meta-features on the above constitute the detection meta-feature set X TEM . X TEM Input into the random forest RFC trained in step (5) to obtain the detection meta-label set L containing m′ two-category labels TEM .
[0099] For P F For each base detector in , if its corresponding detection meta-label is 0, it means that this detector is considered to be able to correctly judge the data to be detected, then it will be added to the selected base detector pool P S Calculate P S All basis detectors in x TEThe maximum value of the Z score outputted above is used as the data to be detected x TE Calculate P S The maximum value of the classification thresholds of all base detectors in is used as the detection threshold for this detection, and the data to be detected x whose detection results are greater than or equal to the detection threshold TE It is judged as abnormal data, realizing abnormal detection of power dispatch monitoring data.
[0100] Algorithm 3 is the pseudo code of step 106:
[0101]
[0102]
[0103]
[0104] Figure 2 It is a schematic diagram of the power dispatching monitoring data anomaly detection method based on dynamic and static selection integration proposed by the present invention. Firstly, a certain number of base detectors are trained using the historical data of power dispatch monitoring, and the isolation forest is trained according to the Z scores output by all base detectors on all historical data, and the base detectors corresponding to the outputs of the isolation forest with smaller Z scores on all historical data are eliminated; secondly, the false true value of each historical data is generated according to the Z scores output by the remaining base detectors using the average method, and the false true value is converted into a false label; data with smaller false true values are eliminated from all historical data, and the meta-features of each base detector on the remaining historical data are extracted to form a meta-feature set, and a meta-label set is generated according to whether the labels output by the base detector on the remaining historical data and the corresponding false labels are the same; then, the random forest is trained using the meta-feature set and the meta-label set; finally, the detection meta-feature set of each base detector on the data to be detected is extracted, and it is input into the random forest to obtain the detection meta-label set, and the base detector is selected according to the detection meta-label set and the maximum value of the Z score of the selected base detector is taken as the detection result, and the maximum value of the classification threshold of the selected base detector is taken as the detection threshold for this time, and the data to be detected whose detection result is greater than or equal to the detection threshold is judged as abnormal data, so as to realize the abnormal detection of power dispatch monitoring data.
[0105] Figure 3 is a schematic diagram of the input data and output results of the base detector used in the present invention. The input of each base detector is the real-time resource occupancy data of the process related to the power dispatching system business collected by the power dispatching monitoring system, including the process CPU occupancy rate, memory occupancy rate, disk IO, network IO, number of threads, and number of network connections. If the Z score output by the i-th base detector is less than The input data is normal; if the Z score output by the i-th base detector is greater than or equal to Then the input data is abnormal. Sort the Z scores output by the i-th base detector on all training data XTR from large to small, and the classification threshold of the i-th base detector R before sorting DA The minimum value among the % Z scores. DA % is the set base detector output conversion ratio, which is generally 10%.
[0106] For use in a specific embodiment, three abnormal conditions in the smart grid dispatching and control system (referred to as the D5000 system) are used: system monitoring data when data jumps, application disconnection, and telemetry meter failure to refresh occur. Data jump abnormality is for a telemetry point, the process data of the D5000 system is collected periodically. If the value difference of adjacent sampling points is greater than the threshold set manually, it is considered that a data jump abnormality occurs. When a data jump abnormality occurs, the power dispatching department will have deviations when allocating power generation to subordinate power grid companies, affecting the dispatching plan of the power grid, and will also cause deviations in the electricity report, affecting the electricity charge. Application disconnection abnormality is that the network connection of the server running the D5000 system application is interrupted or the network card fails, causing the key process of the D5000 system to run slowly or even stop running, and the business under the application cannot perform tasks normally, affecting the power grid dispatch. The telemetry meter failure to refresh refers to the failure of the power grid automation system to update the telemetry data in a timely manner. Only by receiving real-time and accurate telemetry data can the dispatching personnel adjust the working conditions of the power grid in a timely and accurate manner. When the state of the power grid changes, the corresponding telemetry data should be immediately reflected to the dispatching center. If the telemetry table has not updated the data for a long time, it will affect the dispatching personnel's overall control over the operation status of the power grid.
[0107] The specific information of the system monitoring data corresponding to the three abnormalities is shown in Table 1:
[0108] Table 1 Specific information of system monitoring data when three abnormalities occur
[0109]
[0110]
[0111] Table 2 shows the base detector algorithm and its parameters used in the embodiment of the present invention:
[0112] Table 2 Base detector algorithm and parameters used in specific embodiments
[0113]
[0114] To verify the effectiveness of the proposed algorithm, the embodiments of the present invention compare the dynamic and static selection integrated anomaly detection method with other direct integrated anomaly detection methods Average, Max, AOM, MOA, the anomaly detection methods HEnS, SS-FS, BoostSelect based on static selection integration, and the anomaly detection methods LSCP and ELSCP based on dynamic selection integration.
[0115] The embodiment of the present invention uses the AUC value for evaluation. Usually, the area under the ROC curve (AUC) is used to evaluate the performance of anomaly detection algorithms. The closer the ROC Area is to 1, that is, the larger the AUC value is, the better the performance of the anomaly detection algorithm is.
[0116] In the embodiment of the present invention, the parameter R DA % is set to 10%, R GA % and R S % are set to 20%, K RC and K SOP Both are set to 30, and n_itree and n_dtree are set to 100.
[0117] The AUC results of the embodiments of the present invention and the comparative method on the D5000 monitoring data set are shown in Table 3. It can be seen that the power dispatch monitoring data anomaly detection method based on dynamic and static selection integration of the present invention obtains the highest AUC on data jump anomalies and the highest average AUC on the three anomalies, indicating that the present invention has achieved a higher accuracy rate in dispatch monitoring data anomaly detection than the existing methods.
[0118] Table 3 AUC results on three abnormalities
[0119] Exception name Average Max AOM MOA HkDJ SS-FS BoostSelect LSCP ELSCP The present invention Application disconnection 0.9908 0.9848 0.9872 0.9904 0.9795 0.9862 0.9603 0.9672 0.9757 0.9885 Data jump 0.7571 0.8132 0.7844 0.7604 0.7506 0.7840 0.6099 0.7874 0.8095 0.8575 Telemetry table not refreshing 0.9979 0.9971 0.9971 0.9977 0.5840 0.9978 1.0000 0.9957 0.9966 0.9970 Average AUC value 0.9153 0.9317 0.9229 0.9162 0.7714 0.9227 0.8567 0.9168 0.9272 0.9477
[0120] In summary, the embodiments of the present invention have the following beneficial effects:
[0121] In the technical solution implemented by the present invention, a certain number of base detectors are trained based on the original power dispatch monitoring historical data using different unsupervised anomaly detection algorithms; the base detectors with poor performance in all base detectors are eliminated using the isolation forest; the false true value of each historical data is generated according to the Z score output by the remaining base detectors using the average method, and the false true value is converted into a false label; the data with a small false true value is eliminated from all the historical data, the meta-features of each base detector on the remaining historical data are extracted to form a meta-feature set, and the meta-label set is generated according to whether the label output by the base detector on the remaining historical data and the corresponding false label are the same; then, the random forest is trained using the meta-feature set and the meta-label set; finally, the detection meta-feature set of each base detector on the data to be detected is extracted, and it is input into the random forest to obtain the detection meta-label set, the base detector is selected according to the detection meta-label set and the maximum value of the Z score of the selected base detector is taken as the detection result, the maximum value of the classification threshold of the selected base detector is taken as the detection threshold of this time, and the data to be detected whose detection result is greater than or equal to the detection threshold is judged as abnormal data, thereby realizing the abnormal detection of power dispatch monitoring data. According to the technical solution provided by the embodiment of the present invention, when faced with the problem of anomaly detection of power dispatch monitoring data, this method can achieve higher accuracy compared with other integration-based anomaly detection methods.
[0122] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A method for detecting anomaly in power dispatching monitoring data based on dynamic and static selection integration, characterized in that: The steps include: (1) Use historical data of power dispatch monitoring to train a certain number of base detectors; (2) Use isolation forest to eliminate base detectors with poor performance; (3) Use the average method to generate the false true values of the historical data according to the output of the remaining basis detectors, and convert the false true values and the output of the basis detectors into two-category labels, respectively, as follows: The base detector pool consisting of the remaining m' base detectors after screening in step (2) is denoted as P F , note P F All m' base detectors in the training set X TR The jth historical data The Z-score composition of the output The Z score represents the score after the anomaly score output by the base detector is normalized by the Z score. The average of all Z scores in The false truth value Let training set X be TR The set of false and true values corresponding to all historical data in is Will The false and true values in are sorted from large to small, and the threshold PScore thr R before sorting GA The minimum value among % false true values, R GA % is the set false-true value conversion ratio, which is 20%; If the jth historical data The corresponding false value Greater than or equal to PScore thr , then its false label is 1, otherwise it is 0; record the training set X TR The set of false labels corresponding to all historical data in is PLable XTR ; If P F The a-th base detector in the historical data The Z score of the output Greater than or equal to its classification threshold Then its The second class label output is 1, otherwise it is 0; the classification threshold is the a-th base detector in all training data X TR After sorting the Z scores from large to small on the output, the R DA The minimum value among % Z scores; R DA % is the set base detector output conversion ratio, which is 10%; the a-th base detector is recorded in the training set X TR The second-class label output is All base detectors in X TR The output two-category label set is (4) Eliminate historical data with too small false-true values and extract meta-features and meta-labels of the base detector on the remaining historical data; (5) Train random forests using meta-features and meta-labels; (6) Extract the meta-features of the base detector on the data to be detected, input them into the random forest, select the base detector according to the output of the random forest, take the maximum value of the output of the selected base detector as the detection result of the data to be detected, and realize the anomaly detection of power dispatch monitoring data.
2. According to claim 1, a method for detecting abnormality in power dispatching monitoring data based on dynamic and static selection integration is characterized in that: In the step (1), a certain number of base detectors are trained using historical data of power dispatch monitoring, specifically: All power monitoring historical data is used as training set X TR Based on the training set, different unsupervised anomaly detection algorithms are used to train m base detectors, where m ≥ 50, and the base detector pool composed of all base detectors is denoted as P O ; The output of each base detector is an anomaly score. The larger the anomaly score, the greater the degree of anomaly of the input data. O The anomaly scores output by each base detector in the Z score are normalized and converted into Z scores; O The i-th base detector in X TR The jth historical data The anomaly score outputted above is Its Z score for: Where: i = 1, 2, ..., m, j = 1, 2, ..., n, n is X TR The amount of historical data in is the average value of the anomaly score output by the i-th base detector on all historical data, is the standard deviation of the anomaly score output by the i-th base detector on all historical data; The input of each base detector is the real-time resource occupancy data of the process related to the power dispatching system business collected by the power dispatching monitoring system, including the process CPU occupancy rate, memory occupancy rate, disk IO, network IO, number of threads, and number of network connections; if the Z score output by the i-th base detector is less than The input data is normal; if the Z score output by the i-th base detector is greater than or equal to The input data is abnormal; the i-th base detector is used in all training data X TR The Z scores of the outputs are sorted from large to small, and the classification threshold of the i-th base detector is R before sorting DA The minimum value among % Z scores; R DA % is the set base detector output conversion ratio, which is 10%.
3. The method for detecting abnormality in power dispatching monitoring data based on dynamic and static selective integration according to claim 1 is characterized in that: In step (2), the base detector with poor performance is eliminated using the isolation forest, specifically: Using P O All m base detectors in the training set X TR The Z score output on all n historical data in Train an isolation forest consisting of n_itree isolated trees, n_itree is 100; when building an isolated tree, uniformly sample ψ data without replacement, and take Score all ψ n-dimensional data ψ×n As the training sample of this isolated tree; in each isolated tree sample, randomly select a dimension, and randomly select a value between the maximum and minimum values of the sample on this dimension, and perform binary partition on the sample, dividing the samples less than the value on this dimension to the left of the node, and dividing the samples greater than or equal to the value to the right of the node, thus obtaining a split condition and the left and right data sets; Repeat the above process on the left and right data sets until the termination condition is reached. There are two termination conditions: 1) The data set itself contains only one sample, or all samples are the same; 2) The height of the tree reaches log2(ψ); All trained isolated trees are combined into an Isolation Forest IForest. The output of Isolation Forest IForest is a continuous value. The smaller the output, the greater the abnormality of the input data. Will The rth data in As the input of Isolation Forest IForest, r=1,2,...,m, the corresponding output of Isolation Forest is Isolate Forest IForest Sort the m outputs from small to large, and put the first R D % outputs corresponding to the base detectors are marked as abnormal, R D % Take 10%; from P O Remove the base detectors marked as abnormal, and record the base detector pool composed of the remaining m' base detectors after screening as P F .
4. The method for detecting abnormality in power dispatching monitoring data based on dynamic and static selective integration according to claim 1 is characterized in that: In step (4), historical data with too small false true values are removed, and the meta-features and meta-labels of the base detector on the remaining historical data are extracted, specifically: The false and true values of all historical data Sort from small to large, remove the first R after sorting S % historical data corresponding to false true values; the remaining n' historical data are recorded as X STR , and its corresponding false label set and second-class label set are and The residual basis detector in X STR The Z score on For X STR The tth historical data Calculate its original training set X TR The jth historical data Euclidean distance Where: t=1,2,...,n', l=1,2,...,u, u is the dimension of historical data, for The value in the lth dimension, for The value in the lth dimension; The original training set X TR All historical data in Sort the Euclidean distances from small to large, and take the K in front RC As historical data Performance evaluation set Take 10≤K RC ≤30; for Note: F All base detectors in The Z score of the output is for Note: F All base detectors in The Z score of the output is calculate and Euclidean distance in: P F The a-th base detector in The Z score of the output, P F The a-th base detector in The Z score of the above output; The original training set X TR All historical data in the base detector are compared with the Z score output on it. Sort the Euclidean distances from small to large, and take the K in front SOP As historical data The approximate output set of Take 10≤K SOP ≤30; Extraction of P F The a-th base detector in The six element features on : 1) Calculate the performance evaluation set The number of historical data with the same second-class label and corresponding false label output by the base detector, and its correlation with K RC as the feature; this group contains one feature; 2) Calculate the approximate output set The number of historical data with the same second-class label and corresponding false label output by the base detector, and its correlation with K SOP as the feature; this group contains one feature; 3) For the performance evaluation set For each historical data in, whether the base detector can correctly judge its positive anomaly; if the base detector can correctly judge The qth historical data in, q=1,2,...,K RC , then the qth feature in this group is 0, otherwise it is 1; this group contains K RC Features 4) For the approximate output set For each historical data in, whether the base detector can correctly judge its positive anomaly; if the base detector can correctly judge The pth historical data in, p=1,2,...,K SOP , then the pth feature in this group is 0, otherwise it is 1; this group contains K SOP Features 5) Computational performance evaluation set The Z score of each historical data output by the base detector and the classification threshold of the base detector itself The absolute value of the difference between RC Features 6) Calculate the base detector for the data to extract meta-features The Z score of the output and the positive classification threshold of the base detector itself The absolute value of the difference; this group contains 1 feature; The above six groups contain a total of M meta-features, M = 3 + 2 × K RC +K SOP ; Extract P by the above method F Each base detector in X STR The meta-features on each historical data in constitute the meta-feature set X TRM , X TRM Contains n'×m' pieces of feature data; Compare P F The a-th base detector in The second class label output and Fake labels are the same; if they are the same, then the a-th base detector is Meta tags on is 0, indicating that the a-th base detector can correctly judge Otherwise, it is 1, indicating that the a-th base detector cannot correctly judge Calculate P by the above method F Each base detector in X STR The meta-label set L on each historical data TRM , L TRM Contains n'×m' meta tags.
5. The method for detecting abnormality in power dispatching monitoring data based on dynamic and static selective integration according to claim 1 is characterized in that: In step (5), the random forest is trained by using meta-features and meta-labels, specifically: Use meta-feature set X TRM and meta tag set L TRM Train a random forest consisting of n_dtree decision trees, n_dtree is 100; when building a decision tree, start from X TRM Evenly sample N data with replacement As the training sample of this decision tree, take N = n'×m'; in each decision tree sample, randomly take M' dimensions from M dimensions, and take According to the Gini index, the optimal partitioning dimension and partitioning point are selected on the selected M' dimensions to perform binary partitioning on the samples. Samples with a value less than the value on this dimension are partitioned to the left of the node, and samples with a value greater than or equal to the value are partitioned to the right of the node. Thus, a splitting condition and left and right data sets are obtained. Repeat the above process on the left and right datasets respectively until the dataset itself contains only one sample, or the meta-labels of all samples are the same; all trained decision trees are combined into a random forest RFC, whose output is a binary label of 0 or 1, indicating whether the corresponding base detector can correctly judge the corresponding data.
6. The method for detecting abnormality in power dispatching monitoring data based on dynamic and static selective integration according to claim 1 is characterized in that: In the step (6), the meta-features of the base detector on the data to be detected are extracted and input into the random forest. The base detector is selected according to the output of the random forest, and the maximum value of the output of the selected base detector is taken as the detection result of the data to be detected, so as to realize the abnormal detection of the power dispatch monitoring data, specifically: For the data to be detected x TE , use the same method as in step (4) to extract P F Each base detector in x TE The M meta-features on the above constitute the detection meta-feature set X TEM ; X TEM Input into the random forest RFC trained in step (5) to obtain the detection meta-label set L containing m' two-category labels TEM ; For P F For each base detector in , if its corresponding detection meta-label is 0, it means that this detector is considered to be able to correctly judge the data to be detected, then it will be added to the selected base detector pool P S Calculate P S All basis detectors in x TE The maximum value of the Z score outputted above is used as the data to be detected x TE The test results; calculate P S The maximum value of the classification thresholds of all base detectors in is used as the detection threshold for this detection, and the data to be detected x whose detection results are greater than or equal to the detection threshold TE It is judged as abnormal data, realizing abnormal detection of power dispatch monitoring data.
