Power grid load interaction data anomaly detection method, device, equipment, medium and product

By extracting the feature of the grid load interaction data and robust principal component analysis combined with the clustering algorithm, the problems of low abnormal detection efficiency and poor safety in the grid load information interaction are solved, efficient and accurate abnormal detection is achieved, and power is improved System security and reliability.

CN119128737APending Publication Date: 2024-12-13INFORMATION & COMM BRANCH OF STATE GRID JIANGSU ELECTRIC POWER +2
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202411078385.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-07
Publication Date
2024-12-13

AI Technical Summary

Technical Problem

With the intelligence of power systems and the increase in distributed energy, the abnormal detection efficiency and safety in grid load information interaction are difficult to meet the needs of new power systems, and there are problems of low data abnormal detection efficiency and high safety risks.

Method used

Feature extraction and robust principal component analysis methods are used to initially classify the grid load interaction data, and the outliers are removed in combination with the clustering algorithm to realize abnormal detection of grid load information interaction.

Benefits of technology

It improves the abnormal detection efficiency and accuracy of grid load information interaction, enhances the safety and reliability of the power system, provides reliable data support, and provides guarantees for the scheduling and control of the new power system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119128737A_ABST
    Figure CN119128737A_ABST
Patent Text Reader

Abstract

The invention discloses a power grid load interaction data anomaly detection method, device and equipment, a medium and a product. The method comprises the following steps: acquiring to-be-detected power grid load interaction data generated by at least two load main bodies; performing feature extraction on the to-be-detected power grid load interaction data to obtain target power grid load interaction data with power utilization mode features; performing initial classification on the target power grid load interaction data based on a preset robust principal component analysis method to obtain an initial classification result; performing outlier removal on the first power utilization load mode data set and the second power utilization load mode data set according to a preset clustering algorithm to obtain corresponding anomaly detection results; according to the embodiment of the invention, through the technical scheme, the abnormal data detection of the power grid load information interaction can be realized, and the detection efficiency and accuracy are improved, so that the safety interaction protection capability among the power grid load information is realized, and the improvement of the safety and reliability of a power system is facilitated.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of power grid data anomaly detection, and in particular to a power grid load interaction data anomaly detection method, device, equipment, medium and product. Background Art

[0002] The power supply structure of the traditional power system mainly relies on centralized power supply and large-capacity units, and the cross-access capabilities of the power supply side, grid side and load side services are relatively weak. On the load side, the access subject and access method of the power information network on the load side of the power grid are relatively simple, and the number of accesses is relatively small. The interaction between different access subjects and the power grid business system is mainly based on traditional one-way data collection, and there is less sensitive information related to the control of the power grid in the data interaction content.

[0003] However, with the improvement of living standards, residents' demand for electricity has increased significantly. The rapid growth of electricity consumption has become an important part of the peak load and even peak load of the power grid. In addition, with the continuous development of the power market and the widespread application of intelligent technology, sensor technology can collect real-time load data of the load subject power grid, making the cross-access capability of the power supply side, power grid measurement and load side business in the power structure of the power system stronger. The load side access subjects, methods and numbers are increasing. The interaction between different access subjects and the power grid business system has changed the status quo of the one-way flow of power flow and information flow in the traditional power network, and provided a platform and technical support for the two-way and comprehensive interaction between the load subject and the power grid.

[0004] As the construction of new power systems gradually deepens, more and more energy storage devices on the load side and distributed renewable energy are added to the power system through third-party aggregation platforms. These multi-source, heterogeneous, and distributed resource accesses have generated a massive amount of grid load information interaction. Especially under the power Internet of Things architecture, the widespread access to massive IoT terminals in the power distribution system has made the original security boundary blurred and gradually extended to the terminals. The attackers' network attacks on the power Internet of Things system have diversified methods and channels, resulting in increasing security risks of grid load information interaction. In order to ensure the safe and stable operation of the power system, it is necessary to perform real-time, safe, and efficient anomaly detection on the grid load interaction information, so as to timely discover abnormal data and abnormal nodes, and provide reliable data support for the dispatching and control of the new power system. Summary of the invention

[0005] In view of this, the present invention provides a method, device, equipment, medium and product for detecting anomalies in power grid load interaction data, which can realize abnormal data detection of power grid load information interaction, improve the efficiency and accuracy of detection, thereby realizing the safe interaction protection capability between power grid load information, and helping to improve the safety and reliability of the power system.

[0006] According to one aspect of the present invention, an embodiment of the present invention provides a method for detecting abnormality in power grid load interaction data, the method comprising:

[0007] Acquire the to-be-detected grid load interaction data generated by at least two load entities;

[0008] Extracting features of the to-be-detected grid load interaction data to obtain target grid load interaction data having power consumption pattern features;

[0009] Based on a preset robust principal component analysis method, the target power grid load interaction data is initially classified to obtain an initial classification result; wherein the initial classification result includes a first power load pattern data set and a second power load pattern data set;

[0010] Outliers are removed from the first power load pattern data set and the second power load pattern data set respectively according to a preset clustering algorithm to obtain corresponding anomaly detection results.

[0011] According to another aspect of the present invention, an embodiment of the present invention further provides a device for detecting abnormality in power grid load interaction data, the device comprising:

[0012] A data acquisition module, used to acquire the to-be-detected grid load interaction data generated by at least two load entities;

[0013] A feature extraction module, used for extracting features from the to-be-detected grid load interaction data to obtain target grid load interaction data having power consumption pattern features;

[0014] A classification module, configured to perform initial classification on the target power grid load interaction data based on a preset robust principal component analysis method to obtain an initial classification result; wherein the initial classification result includes a first power load pattern data set and a second power load pattern data set;

[0015] The detection module is used to remove outliers from the first power load pattern data set and the second power load pattern data set respectively according to a preset clustering algorithm to obtain corresponding abnormality detection results.

[0016] According to another aspect of the present invention, an embodiment of the present invention further provides an electronic device, the electronic device comprising:

[0017] at least one processor; and

[0018] a memory communicatively connected to the at least one processor; wherein,

[0019] The memory stores a computer program that can be executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the power grid load interaction data anomaly detection method described in any embodiment of the present invention.

[0020] According to another aspect of the present invention, an embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the power grid load interaction data anomaly detection method described in any embodiment of the present invention when executed.

[0021] According to another aspect of the present invention, an embodiment of the present invention further provides a computer program product, characterized in that the computer program product includes a computer program, and when the computer program is executed by a processor, it implements the power grid load interaction data anomaly detection method described in any embodiment of the present invention.

[0022] The technical effect of the present invention is that, by extracting features from the grid load interaction data to be detected and performing initial classification on the feature-extracted data based on a preset robust principal component analysis method, it is possible to effectively obtain abnormal classification, improve the accuracy and efficiency of principal component extraction, and provide convenience for subsequent data processing; the results of the initial classification are respectively subjected to outlier removal by a preset clustering algorithm to obtain corresponding abnormal detection results, so as to realize abnormal data detection of grid load information interaction, improve the efficiency and accuracy of detection, thereby realizing the safe interaction protection capability between grid load information, and contributing to improving the safety and reliability of the power system.

[0023] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative work.

[0025] Figure 1 A flowchart of a method for detecting abnormality in power grid load interaction data provided by one embodiment of the present invention;

[0026] Figure 2 A flowchart of another method for detecting abnormality in power grid load interaction data provided by an embodiment of the present invention;

[0027] Figure 3 A flow chart of another method for detecting abnormality in power grid load interaction data provided by an embodiment of the present invention;

[0028] Figure 4 A structural block diagram of a power grid load interaction data anomaly detection device provided by an embodiment of the present invention;

[0029] Figure 5 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0030] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0031] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0032] In one embodiment, Figure 1 A flow chart of a method for detecting anomalies in power grid load interaction data provided by one embodiment of the present invention. This embodiment can be applied to the situation when anomalies are detected in power grid load interaction data of a third-party aggregation platform. The method can be executed by a power grid load interaction data anomaly detection device. The power grid load interaction data anomaly detection device can be implemented in the form of hardware and / or software. The power grid load interaction data anomaly detection device can be configured in an electronic device.

[0033] like Figure 1 As shown, the power grid load interaction data anomaly detection method in this embodiment specifically includes the following steps:

[0034] S110, obtaining the to-be-detected grid load interaction data generated by at least two load entities.

[0035] The load subject can be understood as multiple load terminals of a third-party aggregation platform. The grid load interaction data to be detected refers to the grid load interaction data of multiple load terminals in the third-party aggregation platform, which may include but is not limited to the power load mode and power load fluctuation data corresponding to each load subject in different power generation modes such as wind power generation and photovoltaic power generation.

[0036] In this embodiment, in order to conveniently represent the load interaction data of the power grid to be detected, in this embodiment, the load data of the nth load subject in the load interaction data of the power grid to be detected is expressed by the formula: n ={a ny ,y=1,2,...,Y}; where a ny It represents the grid load power consumption pattern of the nth load subject in the yth month, where Y is the number of months.

[0037] In this embodiment, in order to better obtain the interactive data of the power grid load to be detected generated by multiple load entities, the power grid load data of the load entity can be collected and analyzed by using devices such as smart terminals. For example, active monitoring of the power grid side is performed, and the data of parameters such as current and voltage in the power grid load information on the load entity side are analyzed for interactive differences. For example, there are differences such as multi-source and heterogeneous between wind power and photovoltaic power generation data, so there may be differences in mechanisms, methods, protocols, etc. in the interaction. For this reason, a suitable preprocessing mechanism can be established for data from different sources, and corresponding processing methods can be designed for the difference analysis in data collection and transmission. In this embodiment, the operations of preprocessing the interactive data of the power grid load to be detected include but are not limited to data filtering, completion, data dimensionality reduction, missing value processing, standardization processing, etc., thereby realizing the collection and preprocessing of power grid load data.

[0038] S120 , extracting features from the grid load interaction data to be detected to obtain target grid load interaction data having power consumption pattern features.

[0039] The target grid load interaction data refers to the grid load interaction data after feature extraction.

[0040] In this embodiment, the target power grid load interaction data is represented in the form of an original feature data matrix, and the original feature data matrix is ​​represented by Y n×p , Y n×pEach row in the matrix represents the grid load power consumption pattern of different load entities, and each column represents the grid load power consumption pattern of the same load entity in different time periods; wherein n is the number of load entities, and p is the number of power consumption pattern characteristics corresponding to each load entity. The grid load power consumption pattern in this embodiment can be understood as the power consumption behavior pattern of power users in different time periods. These patterns can include characteristics such as user's power consumption habits, load fluctuations, and power consumption peaks and valleys. Of course, the grid load power consumption pattern can be determined by analyzing the load data of different time periods in the grid load interaction data to be detected.

[0041] In this embodiment, the method of extracting features from the grid load interaction data to be detected may include but is not limited to mathematical transformation, function transformation or neural network methods. Feature extraction of the grid load interaction data to be detected can be understood as a process of extracting the essential features of the grid load interaction data to be detected, which can reduce the data dimension and reduce computing resources. In the process of artificial and asynchronous collection of power data, data errors or losses may occur, and feature extraction can also minimize these effects. In this embodiment, the target grid load interaction data with power consumption mode characteristics includes at least one of the following: the average grid load and grid load variance values ​​corresponding to each load subject in a preset time period; the maximum mean value difference and variance difference between each month; the maximum difference value of KL divergence between each consecutive month; the length of the maximum flat interval in each month; the distance numerical measurement between the data real value points in the load data corresponding to each load subject.

[0042] For example, in order to better understand the target power grid load interaction data with power consumption pattern characteristics obtained by extracting features from the power grid load interaction data to be detected, Table 1 is a target power grid load interaction data with power consumption pattern characteristics provided by an embodiment of the present invention;

[0043] Table 1: Target grid load interaction data with power consumption pattern characteristics

[0044]

[0045] Among them, the two most important features are Canberra distance and flat points. Canberra distance is considered to be a weighted version of Manhattan distance and is calculated as follows: In the formula, x i and i Indicates two load data a nx and a nyThe corresponding real-valued data point in the data set, i = 1, 2, ..., Y. Among them, the real-valued data point refers to the specific data in the data set, such as a specific value in the power load data, and i represents the number of data values. In this embodiment, the Canberra distance is an important sample difference measurement indicator, which can directly reflect the abnormal situation between samples without complex calculations. Generally, sample platforms with large Canberra distances may exhibit inconsistent power behavior. However, its limitation is that it is impossible to classify different types by simply setting thresholds. Typically, the calculation method for flat points includes dividing the given time series sample space into intervals of equal size, and then calculating the maximum run length in each interval. This metric can be used to detect frequently occurring low data points in historical data, which are usually caused by malicious modifications of actual metering results by certain platforms.

[0046] S130. Performing initial classification on the target power grid load interaction data based on a preset robust principal component analysis method to obtain an initial classification result; wherein the initial classification result includes a first power load pattern data set and a second power load pattern data set.

[0047] Among them, the preset robust principal component analysis method is a method for decomposing a matrix into low-rank components and sparse components. The preset robust principal component analysis method can also be called ROBPCA algorithm. Since normal data forms a low-rank structure and abnormal data is sparse, these anomalies can be detected and separated through the ROBPCA algorithm.

[0048] In this embodiment, the initial classification result includes a first power load pattern data set and a second power load pattern data set, wherein the first power load pattern data set may also be referred to as a suspected normal power load pattern data set, which may be understood as relevant data of the load subject's power load data within a preset demarcation range; the second power load pattern data set may also be referred to as a suspected abnormal power load pattern data set, which may be understood as relevant data of the load subject's power load data not within a preset demarcation range. It should be noted that in this embodiment, the target power grid load interaction data is initially classified by a preset robust principal component analysis method, and the power grid load data is preliminarily classified into suspected abnormal power grid load patterns and suspected normal power grid load patterns.

[0049] In this embodiment, since the target power grid load interaction data is represented in the form of an original feature data matrix, the singular value decomposition method can be first used to reduce the dimension of the original feature data matrix to obtain the corresponding affine space. Since the affine space includes multiple data points, the abnormal index corresponding to each data point can be obtained through the abnormal index calculation formula, and the data points whose abnormal index reaches the preset index threshold value form an abnormal index set, calculate the first mean matrix and the first covariance matrix corresponding to the abnormal index set, and perform eigenvalue decomposition on the first covariance matrix to obtain k0 principal components composed of eigenvectors, and project each data point in the abnormal index set onto the subspace affine of the k0 principal component matrices composed of eigenvectors to obtain the projected affine subspace; use the preset minimum covariance determinant method to obtain a robust principal component matrix with a robust affine subspace, determine the first demarcation value and the second demarcation value based on the robust principal component matrix, and perform initial classification on the power grid load interaction data to be detected according to the first demarcation value and the second demarcation value to obtain a first power load pattern data set and a second power load pattern data set.

[0050] S140. Remove outliers from the first power load pattern data set and the second power load pattern data set respectively according to a preset clustering algorithm to obtain corresponding anomaly detection results.

[0051] Among them, the preset clustering algorithm can be understood as dividing a data set into different classes or clusters according to a specific standard (such as distance), so that the similarity of data objects in the same cluster is as large as possible, and the difference of data objects not in the same cluster is as large as possible. That is, after clustering, data of the same class are clustered together as much as possible, and data of different classes are separated as much as possible. In this embodiment, the preset clustering algorithm can be improved K-Means, K-Medoids, GaussianMixture Model, Spectral Clustering, etc. Outliers refer to one or more values ​​in the data that are significantly different from other values.

[0052] In this embodiment, since the power grid load pattern is divided into two categories, the first power load pattern data set and the second power load pattern data set, there may still be a slight overlap between the two types of patterns. Therefore, it is necessary to use an improved clustering algorithm to remove outliers from the load bodies of the first power load pattern data set and the second power load pattern data set divided in the previous stage, so as to obtain corresponding anomaly detection results, thereby generating different power grid load pattern types with very obvious boundaries. It can be understood that the improved K-means algorithm is used for clustering, and the results are further optimized by removing data points far away from the cluster center. Specifically, for the first power load pattern data set and the second power load pattern data set, the first power load pattern data set and the second power load pattern data set can be used as target data sets in turn, and for the target data sets, the distance between any two data points in the target data sets is calculated respectively, and the density of the data points contained in the target data sets and the corresponding average density are determined based on the distance between any two data points, and the data point with the maximum density is selected from each density, and the data point with the maximum density is used as the initial clustering center, and the optimal clustering center of the cluster corresponding to each initial clustering center is determined, and then the outlier factors of the data points contained in each cluster are calculated respectively, and based on the outlier factor and the preset outlier threshold, the data points respectively contained in the first power load pattern data set and the second power load pattern data set are determined as outliers, and the outliers are used as anomaly detection results.

[0053] The technical solution of the embodiment of the present invention can reduce data dimension and computing resources by extracting features from the grid load interaction data to be detected, and can effectively obtain abnormal classification by performing initial classification on the feature-extracted data through a preset robust principal component analysis method, thereby improving the accuracy and efficiency of principal component extraction and facilitating subsequent data processing; outliers are removed from the results of the initial classification through a preset clustering algorithm to obtain corresponding abnormal detection results, so as to realize abnormal data detection of grid load information interaction, improve detection efficiency and accuracy, thereby realizing the ability to protect safe interaction between grid load information, and helping to improve the safety and reliability of the power system.

[0054] In one embodiment, Figure 2 A flow chart of another method for detecting anomaly in power grid load interaction data provided by an embodiment of the present invention. Based on the above embodiments, this embodiment performs feature extraction on the power grid load interaction data to be detected to obtain target power grid load interaction data with power consumption pattern characteristics; performs initial classification on the target power grid load interaction data based on a preset robust principal component analysis method to obtain initial classification results; and removes outliers from the first power consumption pattern data set and the second power consumption pattern data set respectively according to a preset clustering algorithm to further refine the corresponding anomaly detection results.

[0055] like Figure 2 As shown, the power grid load interaction data anomaly detection method in this embodiment may specifically include the following steps:

[0056] S210. Obtaining the to-be-detected grid load interaction data generated by at least two load entities.

[0057] S220. Use a singular value decomposition method to reduce the dimension of the original feature data matrix to obtain a first decomposition matrix; wherein the first decomposition matrix represents an affine space.

[0058] The singular value decomposition method is a commonly used matrix decomposition method in the prior art. In this embodiment, the singular value decomposition method is used to decompose the original feature data matrix. The first decomposition matrix is ​​the original feature data matrix after dimensionality reduction processing.

[0059] In this embodiment, the dimensionality reduction process of the original feature data matrix can also be understood as converting the original feature data matrix into the form of an affine space, wherein the affine space is an abstract geometric structure, which is a generalization of the affine property in the Euclidean space. In this embodiment, since the target power grid load interaction data is represented in the form of an original feature data matrix, the original feature data matrix is ​​represented as Y n×p , Y n×p Each row in the matrix represents the grid load power consumption pattern of the load subject, and each column represents the grid load power consumption pattern of the load subject in different time periods; where n is the total number of load subjects, and p is the number of power consumption pattern characteristics corresponding to each load subject. It can be understood that the complex target grid load interaction data is simplified and represented into a value that can form the original feature data matrix. Each row of the matrix represents the load pattern of a load subject, and each column represents the pattern of this load subject in different time periods. To this end, the affine space obtained after dimensionality reduction processing is expressed by the formula: Where Y n×p is the original feature data matrix, 1 n is a vector of all 1s, is the transpose of the mean vector, r0 represents the number of load entities, the maximum value is n, D is an r0×r0 diagonal matrix, and U and V are orthogonal matrices.

[0060] S230, determining the abnormality index corresponding to each data point in the first decomposition matrix according to a preset abnormality index formula, and forming an abnormality index set for the data points whose abnormality indexes reach a preset index threshold.

[0061] Among them, each data point represents the power consumption mode of the grid load corresponding to each load subject;. The abnormal index can be understood as whether the power consumption mode of the grid load of the load subject is in an abnormal state. The preset index threshold is an index threshold set manually.

[0062] In this embodiment, the preset abnormality indicator formula is expressed as: In the formula, y i is represented by the i-th data point, i = 1, 2, ..., n; v is represented by the non-zero vector in the direction of two random data points, a MCD and MCD They are respectively represented as the mean and standard deviation corresponding to each data point in the first decomposition matrix, and are respectively represented as the location parameter and scale estimation parameter; in all s MCD ≠0, then calculate the abnormal index out(y i ), select h out(y i ) reaches the preset data point threshold and constitutes an abnormal indicator set; when there is any s MCD = 0, project each data point onto v and continue to search for s MCD = 0, until the dimension of the data set is reduced to r1, and h out(y i )The data points that reach the minimum preset data point threshold constitute the abnormal indicator set H0.

[0063] S240, storing the abnormal indicator set, calculating the first mean matrix and the first covariance matrix corresponding to the abnormal indicator set, and performing eigenvalue decomposition on the first covariance matrix to obtain k0 principal component matrices composed of eigenvectors.

[0064] Among them, the first mean matrix and the first covariance matrix are the mean matrix and covariance matrix corresponding to each data point in the abnormal indicator set.

[0065] In this embodiment, the abnormal indicator set with the smallest out(y i ) values, and calculate the first mean matrix of the abnormal indicator set H0 And the first covariance matrix S0, where the first covariance matrix S0 can be expressed as: In the formula, It is expressed as an eigenvalue matrix, p0 is an orthogonal matrix with r1 rows and r columns. The first covariance matrix S0 is subjected to eigenvalue decomposition to obtain k0 principal components composed of eigenvectors. It can be understood that after S0 is subjected to eigenvalue decomposition, k0 (k0<r) principal components are retained.

[0066] S250, projecting each data point in the abnormal indicator set onto a subspace affine with k0 principal component matrices composed of eigenvectors to obtain a projected affine subspace.

[0067] In this embodiment, each data point in the abnormal indicator set is projected onto the subspace affine by the k0 principal component matrices composed of eigenvectors, that is, the data is projected onto the affine subspace affine by the first k0 eigenvectors of S0, that is, That is the affine subspace, which can be expressed as: In the formula, Represented as the first decomposition matrix; 1 n is a vector of all 1s; is the transpose of the first mean matrix; r1 is the number of load entities in the affine subspace; It is composed of the first k0 columns of p0, and p0 is represented as an orthogonal matrix with r1 rows and r columns.

[0068] S260, using a preset minimum covariance determinant method to obtain a robust principal component matrix using a robust affine subspace.

[0069] In this embodiment, the robust principal component matrix is ​​expressed by the formula: Among them, Y n×p Represented as the original feature data matrix, P p×k is the robust eigenvector matrix, 1 n is a vector of all 1s, is the transpose of the robust mean matrix.

[0070] In the present embodiment, the minimum covariance determinant method is preset as a method for obtaining more robust mean and covariance estimates. In the present embodiment, more robust mean and covariance estimates can be obtained by using the minimum covariance determinant calculation. Specifically, for any two data points in the affine subspace, the Mahalanobis distance formula is used to calculate the Mahalanobis distance between any two data points, and the data points whose Mahalanobis distance reaches the preset distance threshold are selected based on each Mahalanobis distance to obtain the corresponding data set, and the data set is screened for anomalies using a fast anomaly detection algorithm to obtain a screened data set, a consistency factor is determined based on the screened data set, and a weight factor is determined based on the consistency factor, and a principal component analysis matrix is ​​obtained by calculating a weighted mean and a weighted covariance matrix, and performing eigenvalue decomposition on the weighted mean and the weighted covariance matrix, so as to finally obtain a robust principal component matrix.

[0071] In one embodiment, S260 may further include: S2601-S2607:

[0072] S2601. For any two data points in the affine subspace, use the Mahalanobis distance formula to calculate the Mahalanobis distance between the two data points to obtain a Mahalanobis distance result.

[0073] In this embodiment, the Mahalanobis distance can be used to reflect the distance between a data point and the entire data set. For any two data points in the affine subspace, the Mahalanobis distance formula can be used to calculate the Mahalanobis distance between any two data points. Specifically, the formula for calculating the Mahalanobis distance is: in for The data points in are the data points in the affine subspace, and m0 is the mean matrix corresponding to the data points in the affine subspace, which is the first mean matrix. C0 is the covariance matrix corresponding to the data points in the affine subspace, which is the first covariance matrix S0. The iterative calculation selects The smallest data, update the subscript set H, and finally get a data set k1<k0, and the subscript set H1 of the h subset.

[0074] S2602: Select data points whose Mahalanobis distance reaches a preset distance threshold from the Mahalanobis distance results to obtain a corresponding data set.

[0075] In this embodiment, data points whose Mahalanobis distance reaches a preset distance threshold are selected from the Mahalanobis distance results to obtain a corresponding data set; wherein the data set is expressed by the formula: k1<k0, where the data set includes h subsets.

[0076] S2603. Use a fast anomaly detection algorithm to filter anomalies in the data set to obtain a filtered data set

[0077] Among them, the screening data set There are h subsets in it, and the h subsets correspond to the corresponding second covariance matrix and second mean matrix.

[0078] The second covariance matrix and the second mean matrix refer to the covariance matrix and the mean matrix corresponding to each subset in the screening data set. It can be understood that each subset corresponds to the corresponding second covariance matrix and the second mean matrix.

[0079] In this embodiment, a fast anomaly detection algorithm is used to filter anomalies in a data set to obtain a filtered data set. Specifically, select the basic distribution: first, select an appropriate basic distribution, usually Gaussian distribution is selected as the basic distribution. Generate samples: Generate a sample data set from the selected basic distribution, containing N samples. Construct K subsets: Divide the data set into K subsets. Different methods can be used to implement this, such as the k-means algorithm. Estimate subset parameters: For each subset, estimate its parameters. For Gaussian distribution, the mean vector and covariance matrix can be estimated. Calculate subset weight factors: Calculate the weight factor of each subset, usually calculated using the number of samples in the subset or other relevant indicators. Combine subset parameters: According to the weight factors of the subsets, combine the parameters of the subsets to obtain the parameters of the final multivariate distribution.

[0080] S2604, comparing the determinant of the second covariance matrix with the determinant of the first covariance matrix to obtain a comparison result, and replacing the second covariance matrix and the second mean matrix according to the comparison result to obtain a replacement result.

[0081] In this embodiment, the comparison result is obtained by comparing the determinant of the second covariance matrix and the determinant of the second mean matrix. In this embodiment, the second covariance matrix S1 and the second mean matrix express The covariance matrix and mean matrix corresponding to the h subsets of . Here, the first covariance matrix is ​​represented by S2. If det(S1)<det(S2), let On the contrary That is, by comparing the two determinants, we can perform the permutation. It represents the covariance matrix and the mean matrix, and the corresponding positions are transposed by comparing the size of the determinants.

[0082] S2605. Determine a consistency factor based on the replacement result, and determine a weight factor based on the consistency factor.

[0083] In this embodiment, the consistency factor is determined according to the replacement result, and the weight factor is determined according to the consistency factor. S3 is used to calculate the weighted mean and covariance matrix; is the mean matrix after permutation in the permutation result, S3 is the covariance matrix after permutation in the permutation result, where the consistency factor is expressed by the formula: in, It is expressed as the square of the Mahalanobis distance between the second mean matrix and the second covariance matrix of the h subsets, It is expressed as the square of the Mahalanobis distance of any one of the h subsets; Represented as the first The inner product of the row vector; h is the number of subsets; n is the total number of data points; let the calculation formula of the Mahalanobis distance after multiplying the i-th consistency factor be expressed as: i=1,2,...,n, will is the weight factor.

[0084] S2606. Calculate the weighted mean and weighted covariance matrix based on the weight factors.

[0085] In this embodiment, after the weight factors are obtained, the weighted mean and the weighted covariance matrix can be calculated by the weight factors. Specifically, the weighted mean is expressed by the formula: In the formula, Expressed as The matrix corresponds to the conjugate matrix, It is represented by the i-th data point, n is represented by the number of data points; the weighted covariance matrix is ​​expressed by the formula: In the formula, w i Expressed as a weight factor, Expressed as The matrix corresponds to the conjugate matrix, Represented as the i-th data point, is the weighted mean, and n is the number of data points.

[0086] S2607. Perform eigenvalue decomposition on the weighted mean and weighted covariance matrix to obtain a principal component analysis matrix, and convert the principal component analysis matrix to the original affine space to obtain a robust principal component matrix.

[0087] In this embodiment, the weighted mean and weighted covariance matrix are subjected to eigenvalue decomposition to obtain a principal component analysis matrix, and the principal component analysis matrix is ​​converted to the original affine space to obtain a robust principal component matrix. Specifically, the weighted covariance matrix is ​​subjected to eigenvalue decomposition to obtain S4=P2L2P2 T , where P2 is a k-row, k-column matrix consisting of eigenvectors; L2 is a k-row, k-column diagonal matrix consisting of eigenvalues. The principal component analysis matrix is ​​expressed as: In the formula, Represented by Y n×k The conjugate matrix of n is a vector of all 1s; for The matrix corresponds to the transpose of the conjugate matrix; P2 is represented as a k-row, k-column matrix consisting of eigenvectors. After obtaining the principal component analysis matrix, replace and P2 are transformed back to the original space to obtain the robust mean matrix and the robust eigenvector matrix P p×k , and the final robust covariance matrix So the robust principal component matrix Tn×k Rewrite as

[0088] S270. Determine a first cutoff value and a second cutoff value based on a robust principal component matrix.

[0089] In this embodiment, in order to generate a threshold that can separate outliers from normal observations, two different distance metrics, namely, orthogonal distance (ODD) and i ) and Score Distance (SD i ), where the orthogonal distance is defined as the distance between each data point in the original feature data matrix and its projection on the robust principal component matrix, i.e., the new k-dimensional subspace; in this embodiment, each data point in the original feature data matrix is ​​projected onto the robust principal component matrix to obtain the corresponding projected data point, and then the OD between the projected data point and each data point in the original feature data matrix is ​​calculated. i and score distance SD i , and obtain the corresponding cutoff value.

[0090] In one embodiment, S270 may further include: S2701-S2703:

[0091] S2701. For each data point in the original feature data matrix, project each data point into a robust principal component matrix to obtain a corresponding projected data point.

[0092] In this embodiment, for each data point in the original feature data matrix, each data point is projected into the robust principal component matrix to obtain a corresponding projected data point.

[0093] S2702. Use the orthogonal distance formula to calculate the orthogonal distance between each data point and its corresponding projection data point, and obtain an orthogonal distance set.

[0094] In this embodiment, the orthogonal distance formula is used to calculate the orthogonal distance between each data point and its corresponding projection data point to obtain an orthogonal distance set; wherein the orthogonal distance formula is expressed as: In the formula, y i is the i-th data point, i=1,2,...,n, is the projected data point onto the robust principal component matrix; where the robust principal component matrix represents the robust affine subspace.

[0095] S2703. Use the score distance formula to calculate the score distance between each data point and its corresponding projection data point to obtain a score distance set.

[0096] In this embodiment, the score distance formula is used to calculate the score distance between each data point and its corresponding projection data point to obtain a score distance set; wherein the score distance formula is expressed as: In the formula, It is represented as the projected data points on the robust principal component matrix; Expressed as The matrix corresponds to the conjugate matrix, Expressed as a weighted mean, Expressed as the inverse of the weighted covariance matrix.

[0097] S2704. Determine the first and second cutoff values ​​corresponding to the orthogonal distance set and the score distance set, respectively, according to a preset cutoff value formula.

[0098] In this embodiment, the first and second cutoff values ​​corresponding to the orthogonal distance set and the score distance set are determined according to a preset cutoff value formula; wherein the preset cutoff value formula includes: the first cutoff value formula: In the formula, represents the mean matrix, Represents the covariance matrix; the second cutoff value formula is: In the formula, Expressed as the Mahalanobis distance between the mean matrix and the covariance matrix.

[0099] S280. Divide the to-be-detected power grid load interaction data into a first power load pattern data set and a second power load pattern data set according to a first demarcation value and a second demarcation value.

[0100] In this embodiment, the power grid load interaction data to be detected is divided into a suspected normal power load pattern data set and a suspected abnormal power load pattern data set according to a first dividing value and a second dividing value; in one embodiment, the power grid load interaction data to be detected is divided into a first power load pattern data set and a second power load pattern data set according to the first dividing value and the second dividing value, including: determining the power grid load interaction data to be detected between the first dividing value and the second dividing value as the first power load pattern data set; determining the power grid load interaction data to be detected exceeding the first dividing value and the second dividing value as the second power load pattern data set.

[0101] S290: Use the first power load pattern data set and the second power load pattern data set as target data sets in sequence.

[0102] The target data set is represented as: X = {x1, x2, ..., x i ,...,x n}; x i represents the i-th data point, n represents the total number of data points; the distance between any two data points in the target data set is expressed as: l(xi ,x j ).

[0103] In this embodiment, since the first power load pattern data set and the second power load pattern data set both need to be clustered using the improved K-means algorithm, the first power load pattern data set and the second power load pattern data set can be used as target data sets in turn, and the results can be further optimized by removing data points far away from the cluster center from the target data sets, so as to generate different power grid load pattern types with very obvious boundaries.

[0104] S2100: For the target data set, respectively calculate the distance between any two data points in the target data set.

[0105] The distance between any two data points in the target data set is expressed as: l(x i ,x j ), x j Represents the j-th data point, i≠j.

[0106] In this embodiment, the target data set is represented as: X = {x1, x2, x3, ..., x n}, first calculate the distance l(x i ,x j ), where i ≥ 1 and j ≤ n.

[0107] S2110 , determining the density corresponding to each data point included in the target data set and the average density of all data points in the target data set based on the distance.

[0108] Density usually refers to the compactness or concentration of data distribution. In statistics and machine learning, density can be used to describe the distribution of data points in feature space. The average density is the density of all data points D(x i ) to calculate the average.

[0109] In this embodiment, according to the distance l(x i ,x j ) Determine the density D(x) of the data points contained in the target data set i ) and the corresponding average density D; the density is expressed by the formula: In the formula, l(x i ,x j ) is the distance between any two data points, G t (x i ) is represented as a set containing the distance x i The most recent t elements.

[0110] S2120, selecting data points whose density reaches a preset density threshold from each density, and taking the data points reaching the preset density threshold as the initial clustering center c i .

[0111] In this embodiment, the preset density threshold is a user-defined density threshold, and the data points reaching the preset density threshold can be understood as the data points with the maximum density. By comparing the density D(x i ), select the data point with the largest density from it, and use the data point with the largest density as the initial cluster center c i .

[0112] S2130, the initial cluster center c i The corresponding density is compared with the average density to obtain the comparison result, and the initial cluster center c is selected based on the comparison result. i The corresponding threshold value is used to continuously delete the initial cluster center c i The corresponding cluster S i The process continues until K optimal cluster centers are selected.

[0113] Among them, S i Represented as the i-th cluster; cluster S i is the initial cluster center c i The set of all data points within the maximum nearest neighbor radius, 1≤i≤K.

[0114] In this embodiment, it is assumed that c i The density is D i , when D i When ≥D, the threshold δ1 of the first cluster center c1 selected is: If n data points are divided equally into K clusters, then each cluster has data points, however, in reality, the number of data points in each cluster is different, so the number of data points in each cluster needs to be set according to its data density. i It is c i The set of data points in the maximum neighbor radius. After deleting S1, there are n-|S1| data points left in the data set. Then these data points are evenly divided into K-1 clusters. At this time, each cluster has data, the threshold is: threshold δ i for: i=2,3,...,K; at density D i When the average density D is less than the above, Keep deleting c i The corresponding S iThe data points in , where 1≤i≤K, stop when K initial cluster centers are selected. Apply the K-means algorithm based on the selected cluster centers until it converges to the optimal K value.

[0115] In this embodiment, each iteration needs to delete c i The corresponding S i This is because in reality, the number of data points in each cluster is different, so the number of data points in each cluster needs to be set according to its data density. Therefore, to set the number of each data in the set according to the data density, the corresponding data in the set must be deleted, and the remaining data is calculated to be evenly distributed to the threshold of k-1 clusters.

[0116] In one embodiment, the initial cluster center c is selected according to the comparison result. i The corresponding thresholds include: when the density is greater than or equal to the average density, the i-th initial cluster center c i The threshold δ i It is expressed as: Where n represents the data point, D i represents the density of the i-th data point, D represents the average density, K represents the number of clusters, S j Represented as the jth cluster; in the density D i When the average density D is less than the average density D, the i-th initial cluster center c i The threshold δ i It is expressed as: In the formula, n represents the data point, D i represents the density of the i-th data point, D represents the average density, K represents the number of clusters, S j Denoted as the jth cluster.

[0117] S2140 . For each cluster corresponding to the K optimal clustering centers, respectively calculate the outlier factors corresponding to the data points contained in each cluster.

[0118] Among them, the outlier factor can also be called an abnormal factor, which can be used to determine whether a data point is an abnormal value or an outlier.

[0119] In this embodiment, for each cluster corresponding to the K optimal clustering centers, the outlier factors of the data points contained in each cluster are calculated respectively. Specifically, the maximum distance from each data point contained in each cluster to the corresponding cluster seat at the optimal clustering center is determined, and the outlier factor corresponding to each data point is determined based on the maximum distance.

[0120] In one embodiment, for each cluster corresponding to the K optimal clustering centers, the outlier factors corresponding to the data points contained in each cluster are calculated respectively, including: determining the maximum distance from each data point contained in each cluster to the optimal clustering center; wherein the maximum distance is expressed by the formula: d max =max{||x i -c pi ||}, where c pi Represented as data point x i The corresponding cluster center, i=1,2,...,n; the outlier factor corresponding to each of the data points is determined according to the maximum distance; wherein the outlier factor is expressed by the formula: x i Represented as the i-th data point, c pi Represented as data point x i The corresponding cluster center, i = 1, 2, ..., n; o i The value is between 0 and 1.

[0121] S2150: When the outlier factor exceeds a preset outlier threshold, determine that the data point is an outlier value; when the outlier factor does not exceed the preset outlier threshold, determine that the data point is a normal value.

[0122] In this embodiment, when the outlier factor exceeds the preset outlier threshold, the data points respectively included in the first power load pattern data set and the second power load pattern data set are determined to be outliers, and the outliers are used as the abnormality detection results. Exemplarily, the preset outlier threshold is 0.95, then all outlier factors o i Data with a value of 0.95 or above are considered outliers and separated from other data. Therefore, the above algorithm is used to remove outliers for the two types of load subjects obtained in the previous stage, and the data with a value of more than o in the suspected normal power grid load mode and the suspected abnormal power grid load mode are separated. i The data above the threshold are regarded as abnormal grid load patterns, and the rest are regarded as normal grid load patterns.

[0123] S2160: taking each outlier as an abnormal detection result, and taking each normal value as a normal detection result.

[0124] The technical solution of the embodiment of the present invention can reduce the data dimension and computing resources by extracting features from the power grid load interaction data to be detected, determine the data points whose abnormal indicators of each data point in the first decomposition matrix reach a preset indicator threshold by performing dimensionality reduction processing on the feature data matrix, calculate the mean matrix and the covariance matrix of the abnormal indicator set, and perform eigenvalue decomposition on the covariance matrix to obtain the principal component, project each data point in the abnormal indicator set onto the subspace affine with the principal component to obtain the projected affine subspace, use the preset minimum covariance determinant method to robustly obtain the affine subspace to obtain a robust principal component matrix, determine the first demarcation value and the second demarcation value based on the robust principal component matrix, and divide the power grid load interaction data to be detected into a first power load pattern data set and a second power load pattern data set according to the first demarcation value and the second demarcation value. The target power load pattern data set can effectively obtain abnormal classification, improve the accuracy and efficiency of principal component extraction, and provide convenience for subsequent data processing; by respectively calculating the distance between any two data points in the target data set, as well as the density of the data points contained in the target data set and the corresponding average density, the initial clustering center is iterated to obtain the optimal clustering center corresponding to each cluster, and for each cluster corresponding to the K optimal clustering centers, the outlier factor of the data points contained in each cluster is calculated respectively, and the data points respectively contained in the first power load pattern data set and the second power load pattern data set are determined as outliers through the outlier factor, so as to realize abnormal data detection of power grid load information interaction, improve the efficiency and accuracy of detection, thereby realizing the safe interaction protection capability between power grid load information, and helping to improve the safety and reliability of the power system.

[0125] In one embodiment, in order to better understand the power grid load interaction data anomaly detection method, Figure 3 A flow chart of another method for detecting abnormality of power grid load interaction data provided by an embodiment of the present invention is as follows: Figure 3 As shown, the power grid load interaction data anomaly detection method specifically includes the following steps:

[0126] a1. The first stage: collect data, pre-process the grid load information interaction data, generate the grid load pattern according to the load information and perform feature extraction.

[0127] a2. Second stage: The extracted features are preliminarily classified into suspected abnormal power usage patterns and suspected normal power usage patterns using the robust principal component analysis method.

[0128] a3. The third stage: In order to solve the problem that the power grid load pattern was divided into two categories in the previous stage, but there is still a slight overlap between the two types of patterns, an improved K-means clustering algorithm that removes outliers is used for the two types of load entities divided in the previous stage to produce different types of power grid load patterns with very obvious boundaries. First, the improved K-means algorithm is used for clustering, and then the results are further optimized by removing data points far away from the cluster center to realize abnormal data detection in power grid load information interaction.

[0129] The embodiment of the present invention combines principal component analysis (PCA) with a clustering algorithm to realize anomaly detection of power grid load information interaction and improve the efficiency and accuracy of detection. Its main steps include preprocessing and feature extraction of power grid load information interaction data, robust principal component analysis based on ROBPCA, and anomaly detection based on clustering algorithm K-Means. The method of the present invention has broad application prospects in the field of power grid anomaly detection and helps to improve the safety and reliability of power systems.

[0130] In one embodiment, Figure 4 This is a structural block diagram of a power grid load interaction data anomaly detection device provided in one embodiment of the present invention. The device is suitable for detecting anomalies in power grid load interaction data of a third-party aggregation platform. The device can be implemented by hardware / software. It can be configured in an electronic device to implement a power grid load interaction data anomaly detection processing method in an embodiment of the present invention.

[0131] like Figure 4 As shown, the device includes: a data acquisition module 410, a feature extraction module 420, a classification module 430 and a detection module 440;

[0132] The data acquisition module 410 is used to acquire the to-be-detected grid load interaction data generated by at least two load entities;

[0133] A feature extraction module 420 is used to extract features from the to-be-detected grid load interaction data to obtain target grid load interaction data having power consumption pattern features;

[0134] A classification module 430 is used to perform initial classification on the target power grid load interaction data based on a preset robust principal component analysis method to obtain an initial classification result; wherein the initial classification result includes a first power load pattern data set and a second power load pattern data set;

[0135] The detection module 440 is used to remove outliers from the first power load pattern data set and the second power load pattern data set respectively according to a preset clustering algorithm to obtain corresponding abnormality detection results.

[0136] In the embodiment of the present invention, the feature extraction module extracts features from the power grid load interaction data to be detected, and the classification module performs initial classification on the feature-extracted data based on a preset robust principal component analysis method, so as to effectively obtain abnormal classification, improve the accuracy and efficiency of principal component extraction, and provide convenience for subsequent data processing; the detection module removes outliers from the results of the initial classification through a preset clustering algorithm to obtain corresponding abnormal detection results, so as to realize abnormal data detection of power grid load information interaction, improve the efficiency and accuracy of detection, thereby realizing the safe interaction protection capability between power grid load information, and helping to improve the safety and reliability of the power system.

[0137] In one embodiment, the load data of the nth load subject in the to-be-detected power grid load interaction data is expressed by the formula: n ={a ny ,y=1,2,...,Y}; where a ny It represents the grid load power consumption pattern of the nth load subject in the yth month, where Y is the number of months;

[0138] The target power grid load interaction data with power consumption pattern characteristics includes at least one of the following: the average power grid load and power grid load variance value corresponding to each of the load subjects in a preset time period; the maximum average value difference and variance difference between months; the maximum difference value of the KL divergence between each consecutive month; the length of the maximum flat interval in each month; the numerical measurement of the distance between the data real value points in the load data corresponding to each of the load subjects.

[0139] In one embodiment, the target power grid load interaction data is represented in the form of an original characteristic data matrix, and the original characteristic data matrix is ​​represented as Y n×p , the Y n×p The matrix includes at least two data points, each of which represents the power consumption mode of the grid load corresponding to each load subject; n×p Each row in the matrix represents the power consumption pattern of the grid load of different load entities, and each column represents the power consumption pattern of the grid load of the same load entity in different time periods; where n is the total number of load entities, and p is the number of power consumption pattern characteristics corresponding to each load entity;

[0140] Accordingly, the feature extraction module 420 includes:

[0141] A dimension reduction unit, used for performing dimension reduction processing on the original feature data matrix by using a singular value decomposition method to obtain a first decomposition matrix; wherein the first decomposition matrix represents an affine space;

[0142] An indicator determination unit, used to determine the abnormal indicator corresponding to each data point in the first decomposition matrix according to a preset abnormal indicator formula, and form an abnormal indicator set for the data points whose abnormal indicators reach the preset indicator threshold; wherein each of the data points represents the power consumption mode of the power grid load corresponding to each load subject;

[0143] An eigenvalue decomposition unit, used to store the abnormal indicator set, calculate a first mean matrix and a first covariance matrix corresponding to the abnormal indicator set, and perform eigenvalue decomposition on the first covariance matrix to obtain k0 principal component matrices composed of eigenvectors;

[0144] A projection unit, used for projecting each data point in the abnormal indicator set onto the subspace affine by the k0 principal component matrices composed of eigenvectors to obtain the projected affine subspace;

[0145] A robust unit, used for obtaining a robust principal component matrix by robustly transforming the affine subspace using a preset minimum covariance determinant method;

[0146] A cutoff value determination unit, configured to determine a first cutoff value and a second cutoff value based on the robust principal component matrix;

[0147] A data set determination unit is used to divide the to-be-detected power grid load interaction data into a first power load pattern data set and a second power load pattern data set according to the first dividing value and the second dividing value.

[0148] In one embodiment, the affine space is expressed by the formula: Where Y n×p is the original feature data matrix, 1 n is a vector of all 1s, is the transpose of the mean vector, r0 is the number of users, the maximum value is n, D is a diagonal matrix of r0×r0, and U and V are orthogonal matrices;

[0149] The affine subspace is expressed by the formula: In the formula, Represented as the first decomposition matrix; 1 n is a vector of all 1s; is the transpose of the first mean matrix; r1 is the number of users; It is composed of the first k0 columns of p0, and p0 is represented as an orthogonal matrix with r1 rows and r columns;

[0150] The robust principal component matrix is ​​expressed as follows: Among them, Y n×p Represented as the original feature data matrix, P p×k is the robust eigenvector matrix, 1 nis a vector of all 1s, is the transpose of the robust mean matrix.

[0151] In one embodiment, the preset abnormality indicator formula is expressed as: In the formula, y i is represented by the i-th data point, i = 1, 2, ..., n; v is represented by the non-zero vector in the direction of two random data points, a MCD and MCD are respectively represented as the mean and standard deviation corresponding to each data point in the first decomposition matrix, and are respectively represented as the position parameter and the scale estimation parameter;

[0152] In all s MCD ≠0, then calculate the abnormal index out(y i ), select h out(y i ) data points that reach a preset data point threshold and form an abnormal indicator set;

[0153] In the presence of any s MCD = 0, project each data point onto v and continue to search for s MCD = 0, until the dimension of the data set is reduced to r1, and h out(y i )The data points that reach the minimum preset data point threshold constitute the abnormal indicator set.

[0154] In one embodiment, a robust unit comprises:

[0155] A distance determination subunit, for calculating the Mahalanobis distance between any two data points in the affine subspace using a Mahalanobis distance formula to obtain a Mahalanobis distance result;

[0156] The data set determination subunit is used to select data points whose Mahalanobis distance reaches a preset distance threshold from the Mahalanobis distance results to obtain a corresponding data set; wherein the data set is expressed by the formula: k1<k0, wherein the data set includes h subsets;

[0157] A screening subunit is used to use a fast anomaly detection algorithm to screen the data set for anomalies to obtain a screened data set. k<k1; wherein the screening data set includes h subsets, and the h subsets correspond to the corresponding second covariance matrix and second mean matrix;

[0158] a substitution subunit, configured to compare the determinant of the second covariance matrix with the determinant of the first covariance matrix to obtain a comparison result, and to permute the second covariance matrix and the second mean matrix according to the comparison result to obtain a permutation result;

[0159] A weight factor determination subunit, used to determine a consistency factor according to the replacement result, and to determine a weight factor according to the consistency factor;

[0160] A weighted result determination subunit, used to calculate a weighted mean and a weighted covariance matrix according to the weight factors;

[0161] The conversion subunit is used to perform eigenvalue decomposition on the weighted mean and the weighted covariance matrix to obtain a principal component analysis matrix, and convert the principal component analysis matrix to an original affine space to obtain a robust principal component matrix.

[0162] In one embodiment, the consistency factor is expressed by the formula: in, denoted as the square of the Mahalanobis distance between the second mean matrix and the second covariance matrix of the h subsets, It is expressed as the square of the Mahalanobis distance of any one of the h subsets; Represented as the first The inner product of the row vector; h is the number of subsets; n is the total number of matrix rows; the calculation formula of the Mahalanobis distance after multiplying the i-th consistency factor is expressed as: i=1,2,...,n, will is the weight factor;

[0163] The weighted mean is expressed by the formula: In the formula, Expressed as The matrix corresponds to the conjugate matrix, It is represented as the i-th data point, and n is represented as the total number of data points;

[0164] The weighted covariance matrix is ​​expressed by the formula: In the formula, w i Expressed as a weight factor, Expressed as The matrix corresponds to the conjugate matrix, Represented as the i-th data point, is the weighted mean, and n is the total number of data points.

[0165] The principal component analysis matrix is ​​expressed as: In the formula, Represented by Y n×k The conjugate matrix of n is a vector of all 1s; for The matrix corresponds to the transpose of the conjugate matrix; P2 is represented as a k-row, k-column matrix consisting of eigenvectors.

[0166] In one embodiment, the demarcation value determination unit includes:

[0167] A projection point determination subunit is used to project each data point in the original feature data matrix into the robust principal component matrix to obtain a corresponding projection data point;

[0168] The orthogonal distance determination subunit is used to calculate the orthogonal distance between each of the data points and its corresponding projection data point using an orthogonal distance formula to obtain an orthogonal distance set; wherein the orthogonal distance formula is expressed as: In the formula, y i is the i-th data point, i=1,2,...,n, is the projected data point on the robust principal component matrix;

[0169] The score distance determination subunit is used to calculate the score distance between each of the data points and its corresponding projection data point using a score distance formula to obtain a score distance set; wherein the score distance formula is expressed as: In the formula, denoted as the projected data points on the robust principal component matrix; Expressed as The matrix corresponds to the conjugate matrix, Expressed as a weighted mean, Expressed as the inverse of the weighted covariance matrix;

[0170] A demarcation value determination subunit, configured to determine a first demarcation value and a second demarcation value corresponding to the orthogonal distance set and the score distance set, respectively, according to a preset demarcation value formula;

[0171] Wherein, the preset demarcation value formula includes: the first demarcation value formula: In the formula, represents the mean matrix, represents the covariance matrix;

[0172] The second cut-off value formula: In the formula, Expressed as the Mahalanobis distance between the mean matrix and the covariance matrix.

[0173] In one embodiment, the data set determination unit includes:

[0174] A first data set determining subunit, configured to determine the to-be-detected power grid load interaction data between the first demarcation value and the second demarcation value as a first power load pattern data set;

[0175] The second data set determination subunit is used to determine the to-be-detected power grid load interaction data exceeding the first dividing value and the second dividing value as a second power load pattern data set.

[0176] In one embodiment, the detection module 430 includes:

[0177] The target data set determining unit is used to sequentially use the first power load pattern data set and the second power load pattern data set as target data sets; wherein the target data set is expressed as: X = {x1, x2, ..., x i ,...,x n}; x i represents the i-th data point, and n represents the total number of data points;

[0178] A distance determination unit is used to calculate the distance between any two data points in the target data set for the target data set; wherein the distance between any two data points in the target data set is expressed as: l(x i ,x j ), x j represents the jth data point, i≠j;

[0179] A density determination unit is used to determine the density corresponding to each of the data points contained in the target data set and the average density of all data points in the target data set according to the distance; wherein the density is expressed by the formula: In the formula, l(x i ,x j ) is the distance between any two data points, G t (x i ) is represented as a set containing the distance x i The most recent t elements;

[0180] A cluster center determination unit is used to select data points whose density reaches a preset density threshold from each of the densities, and use the data points reaching the preset density threshold as initial cluster centers c i ;

[0181] The optimal center determination unit is used to determine the initial cluster center c i The corresponding density is compared with the average density to obtain a comparison result, and the initial cluster center c is selected according to the comparison result. i The corresponding threshold value is used to continuously delete the initial cluster center c i The corresponding cluster S i The data points in the cluster are sorted until K optimal cluster centers are selected; where S iRepresented as the i-th cluster; cluster S i is the initial cluster center c i The set of all data points in the maximum neighbor radius, 1≤i≤K;

[0182] An outlier factor determination unit, used for calculating, for each cluster corresponding to the K optimal clustering centers, the outlier factors corresponding to the data points contained in each cluster;

[0183] an outlier determination unit, configured to determine that the data point is an outlier when the outlier factor exceeds a preset outlier threshold, and to determine that the data point is a normal value when the outlier factor does not exceed the preset outlier threshold;

[0184] The result determination unit is used to take each of the outliers as an abnormal detection result and take each of the normal values ​​as a normal detection result.

[0185] In one embodiment, the optimal center determination unit includes:

[0186] The first case processing subunit is used to, when the density is greater than or equal to the average density, the i-th initial cluster center c i The threshold δ i It is expressed as: Where n represents the data point, D i represents the density of the i-th data point, D represents the average density, K represents the number of clusters, S j Represented as the jth cluster;

[0187] The second case processing subunit is used for the density D i When the average density D is less than the above average density, the i-th initial cluster center c i The threshold δ i It is expressed as: In the formula, n represents the data point, D i represents the density of the i-th data point, D represents the average density, K represents the number of clusters, S j Denoted as the jth cluster.

[0188] In one embodiment, the outlier factor determination subunit is specifically configured to:

[0189] Determine the maximum distance from each data point in each cluster to the optimal cluster center; wherein the maximum distance is expressed by the formula: d max =max{||x i -c pi ||}, where c pi Represented as data point x iThe corresponding cluster center, i = 1, 2, ..., n;

[0190] The outlier factor corresponding to each of the data points is determined according to the maximum distance; wherein the outlier factor is expressed by the formula: x i Represented as the i-th data point, c pi Represented as data point x i The corresponding cluster center, i = 1, 2, ..., n; o i The value is between 0 and 1.

[0191] The power grid load interaction data anomaly detection device provided in the embodiment of the present invention can execute the power grid load interaction data anomaly detection method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.

[0192] In one embodiment, Figure 5 A schematic diagram of the structure of an electronic device provided for an embodiment of the present invention. The electronic device 10 is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.

[0193] like Figure 5 As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0194] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0195] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The processor 11 executes the various methods and processes described above, such as a method for detecting abnormality in power grid load interaction data.

[0196] In some embodiments, the power grid load interaction data anomaly detection method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the power grid load interaction data anomaly detection method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to execute the power grid load interaction data anomaly detection method in any other appropriate manner (e.g., by means of firmware).

[0197] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0198] The computer programs for implementing the method of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable power grid load interaction data anomaly detection device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine as a stand-alone software package and partially on a remote machine, or entirely on a remote machine or server.

[0199] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0200] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).

[0201] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0202] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.

[0203] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.

[0204] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A method for detecting abnormality of power grid load interaction data, characterized in that: The method comprises: Acquire the to-be-detected grid load interaction data generated by at least two load entities; Extracting features of the to-be-detected grid load interaction data to obtain target grid load interaction data having power consumption pattern features; Based on a preset robust principal component analysis method, the target power grid load interaction data is initially classified to obtain an initial classification result; wherein the initial classification result includes a first power load pattern data set and a second power load pattern data set; Outliers are removed from the first power load pattern data set and the second power load pattern data set respectively according to a preset clustering algorithm to obtain corresponding anomaly detection results.

2. The method according to claim 1, characterized in that The load data of the nth load subject in the load interaction data of the power grid to be detected is expressed by the formula: n ={a ny ,y=1,2,...,Y}; Among them, a ny It represents the grid load power consumption pattern of the nth load subject in the yth month, where Y is the number of months; The target power grid load interaction data with power consumption pattern characteristics includes at least one of the following: the average power grid load and power grid load variance value corresponding to each of the load subjects in a preset time period; the maximum average value difference and variance difference between months; the maximum difference value of the KL divergence between each consecutive month; the length of the maximum flat interval in each month; the numerical measurement of the distance between the data real value points in the load data corresponding to each of the load subjects.

3. The method according to claim 1, characterized in that The target power grid load interaction data is represented in the form of an original characteristic data matrix, and the original characteristic data matrix is ​​represented as Y n×p , the Y n×p Each row in the matrix represents the power consumption pattern of the grid load of different load entities, and each column represents the power consumption pattern of the grid load of the same load entity in different time periods; where n is the total number of load entities, and p is the number of power consumption pattern characteristics corresponding to each load entity; Accordingly, the initial classification of the target power grid load interaction data based on the preset robust principal component analysis method to obtain the initial classification result includes: Using a singular value decomposition method to perform dimensionality reduction processing on the original feature data matrix to obtain a first decomposition matrix; wherein the first decomposition matrix represents an affine space; Determine the abnormal index corresponding to each data point in the first decomposition matrix according to a preset abnormal index formula, and form an abnormal index set for the data points whose abnormal index reaches a preset index threshold; wherein the data point represents the power consumption mode of the power grid load corresponding to the load subject; The abnormal indicator set is stored, a first mean matrix and a first covariance matrix corresponding to the abnormal indicator set are calculated, and the first covariance matrix is ​​subjected to eigenvalue decomposition to obtain k0 principal component matrices composed of eigenvectors; Projecting each data point in the abnormal indicator set onto the affine subspace of the k0 principal component matrices composed of eigenvectors to obtain a projected affine subspace; Using a preset minimum covariance determinant method to robustly map the affine subspace to obtain a robust principal component matrix; Determining a first cutoff value and a second cutoff value based on the robust principal component matrix; The to-be-detected power grid load interaction data is divided into a first power load pattern data set and a second power load pattern data set according to the first dividing value and the second dividing value.

4. The method according to claim 3, characterized in that The affine space is expressed by the formula: Where Y n×p is the original feature data matrix, 1 n is a vector of all 1s, Yes n×p The corresponding mean vector The transpose of , r0 represents the number of load subjects, the maximum value is n, D is a diagonal matrix of r0×r0, U and V are orthogonal matrices; The affine subspace is expressed by the formula: In the formula, Represented as the first decomposition matrix; 1 n is a vector of all 1s; is the transpose of the first mean matrix; r1 is the number of load entities in the affine subspace; It is composed of the first k0 columns of p0, and p0 is represented as an orthogonal matrix with r1 rows and r columns; The robust principal component matrix is ​​expressed as follows: Among them, Y n×p Represented as the original feature data matrix, P p×k is the robust eigenvector matrix, 1 n is a vector of all 1s, is the transpose of the robust mean matrix.

5. The method according to claim 3, characterized in that: The preset abnormal index formula is expressed as: In the formula, y i is represented by the i-th data point, i = 1, 2, ..., n; v is represented by the non-zero vector in the direction of two random data points, a MCD and MCD are respectively represented as the mean and standard deviation corresponding to each data point in the first decomposition matrix, and are respectively represented as the position parameter and the scale estimation parameter; In all s MCD ≠0, then calculate the abnormal index out(y i ), select h out(y i ) data points that reach a preset data point threshold and form an abnormal indicator set; In the presence of any s MCD = 0, project each data point onto v and continue to search for s MCD = 0, until the dimension of the data set is reduced to r1, and h out(y i )The data points that reach the minimum preset data point threshold constitute the abnormal indicator set.

6. The method according to claim 3, characterized in that: The method of using a preset minimum covariance determinant method to robustly obtain a robust principal component matrix in the affine subspace includes: For any two data points in the affine subspace, the Mahalanobis distance between the two data points is calculated using the Mahalanobis distance formula to obtain a Mahalanobis distance result; Data points whose Mahalanobis distance reaches a preset distance threshold are selected from the Mahalanobis distance results to obtain a corresponding data set; wherein the data set is expressed by the formula: k1<k0, wherein the data set includes h subsets; Use a fast anomaly detection algorithm to filter the data set for anomalies to obtain a filtered data set k<k1; wherein the screening data set includes h subsets, and the h subsets correspond to the corresponding second covariance matrix and second mean matrix; Comparing the determinant of the second covariance matrix with the determinant of the first covariance matrix to obtain a comparison result, and replacing the second covariance matrix and the second mean matrix according to the comparison result to obtain a replacement result; Determining a consistency factor according to the replacement result, and determining a weight factor according to the consistency factor; Calculating a weighted mean and a weighted covariance matrix according to the weight factors; Performing eigenvalue decomposition on the weighted mean and the weighted covariance matrix to obtain a principal component analysis matrix, and converting the principal component analysis matrix to an original affine space to obtain a robust principal component matrix.

7. The method according to claim 6, characterized in that The consistency factor is expressed by the formula: in, denoted as the square of the Mahalanobis distance between the second mean matrix and the second covariance matrix of the h subsets, It is expressed as the square of the Mahalanobis distance of any one of the h subsets; Represented as the first The inner product of the row vector; h is the number of subsets; n is the total number of data points; let the calculation formula of the Mahalanobis distance after multiplying the i-th consistency factor be expressed as: i=1,2,...,n, will is the weight factor; The weighted mean is expressed by the formula: In the formula, Expressed as The matrix corresponds to the conjugate matrix, It is represented as the i-th data point, and n is represented as the total number of data points; The weighted covariance matrix is ​​expressed as: In the formula, w i Expressed as a weight factor, Expressed as The matrix corresponds to the conjugate matrix, Represented as the i-th data point, is the weighted mean, and n represents the total number of data points; The principal component analysis matrix is ​​expressed as: In the formula, Represented by Y n×k The conjugate matrix of n is a vector of all 1s; for The matrix corresponds to the transpose of the conjugate matrix; P2 is represented as a k-row, k-column matrix consisting of eigenvectors.

8. The method according to claim 3, characterized in that The determining of the first cutoff value and the second cutoff value based on the robust principal component matrix comprises: For each data point in the original feature data matrix, project each data point into the robust principal component matrix to obtain a corresponding projected data point; The orthogonal distance formula is used to calculate the orthogonal distance between each data point and its corresponding projection data point to obtain an orthogonal distance set; wherein the orthogonal distance formula is expressed as: In the formula, y i is the i-th data point, i=1,2,...,n, is the projected data point on the robust principal component matrix; wherein the robust principal component matrix represents a robust affine subspace; The score distance formula is used to calculate the score distance between each data point and its corresponding projection data point to obtain a score distance set; wherein the score distance formula is expressed as: In the formula, denoted as the projected data points on the robust principal component matrix; Expressed as The matrix corresponds to the conjugate matrix, Expressed as a weighted mean, Expressed as the inverse of the weighted covariance matrix; Determine the first and second cutoff values ​​corresponding to the orthogonal distance set and the score distance set respectively according to a preset cutoff value formula; Wherein, the preset demarcation value formula includes: the first demarcation value formula: In the formula, represents the mean matrix, represents the covariance matrix; The second cut-off value formula: In the formula, Expressed as the Mahalanobis distance between the mean matrix and the covariance matrix.

9. The method according to claim 3, characterized in that: The step of dividing the to-be-detected power grid load interaction data into a first power load pattern data set and a second power load pattern data set according to the first demarcation value and the second demarcation value comprises: Determine the to-be-detected power grid load interaction data within the range of the first demarcation value and the second demarcation value as a first power load pattern data set; The to-be-detected power grid load interaction data that is not within the range of the first demarcation value and the second demarcation value is determined as a second power load pattern data set.

10. The method according to claim 1, characterized in that The removing outliers from the first power load pattern data set and the second power load pattern data set respectively according to a preset clustering algorithm to obtain an abnormality detection result includes: The first power load pattern data set and the second power load pattern data set are used as target data sets in sequence; wherein the target data set is represented as: X = {x1, x2, ..., x i ,...,x n }; x i represents the i-th data point, and n represents the total number of data points; For the target data set, the distance between any two data points in the target data set is calculated respectively; wherein the distance between any two data points in the target data set is expressed as: l(x i ,x j ), x j represents the jth data point, i≠j; Determine the density corresponding to each of the data points in the target data set and the average density of all the data points in the target data set according to the distance; wherein the density is expressed by the formula: In the formula, l(x i ,x j ) is the distance between any two data points, G t (x i ) is represented as a set containing the distance x i The most recent t elements; Select a data point whose density reaches a preset density threshold from each of the densities, and use the data point reaching the preset density threshold as the initial cluster center c i ; The initial cluster center c i The corresponding density is compared with the average density to obtain a comparison result, and the initial cluster center c is selected according to the comparison result. i The corresponding threshold value is used to continuously delete the initial cluster center c i The corresponding cluster S i The data points in the cluster are sorted until K optimal cluster centers are selected; where S i Represented as the i-th cluster; cluster S i is the initial cluster center c i The set of all data points in the maximum neighbor radius, 1≤i≤K; For each cluster corresponding to the K optimal clustering centers, respectively calculate the outlier factors corresponding to the data points contained in each cluster; When the outlier factor exceeds the preset outlier threshold, the data point is determined to be an outlier value, and when the outlier factor does not exceed the preset outlier threshold, the data point is determined to be a normal value; Each of the outliers is taken as an abnormal detection result, and each of the normal values ​​is taken as a normal detection result.

11. The method according to claim 10, characterized in that The initial cluster center c is selected according to the comparison result. i The corresponding thresholds include: When the density is greater than or equal to the average density, the i-th initial cluster center c i The threshold δ i It is expressed as: Where n represents the data point, D i represents the density of the i-th data point, D represents the average density, K represents the number of clusters, S j Represented as the jth cluster; At the density D i When the average density D is less than the above average density, the i-th initial cluster center c i The threshold δ i It is expressed as: In the formula, n represents the data point, D i represents the density of the i-th data point, D represents the average density, K represents the number of clusters, S j Denoted as the jth cluster.

12. The method according to claim 10, characterized in that For each cluster corresponding to the K optimal clustering centers, respectively calculating the outlier factors corresponding to the data points contained in each cluster, including: Determine the maximum distance from each data point in each cluster to the optimal cluster center; wherein the maximum distance is expressed by the formula: d max =max{||x i -c pi ||}, where c pi Represented as data point x i The corresponding cluster center, i = 1, 2, ..., n; The outlier factor corresponding to each of the data points is determined according to the maximum distance; wherein the outlier factor is expressed by the formula: x i Represented as the i-th data point, c pi Represented as data point x i The corresponding cluster center, i = 1, 2, ..., n; o i The value is between 0 and 1.

13. A device for detecting abnormality of power grid load interaction data, characterized in that: The device comprises: A data acquisition module, used to acquire the to-be-detected grid load interaction data generated by at least two load entities; A feature extraction module, used for extracting features from the to-be-detected grid load interaction data to obtain target grid load interaction data having power consumption pattern features; A classification module, configured to perform initial classification on the target power grid load interaction data based on a preset robust principal component analysis method to obtain an initial classification result; wherein the initial classification result includes a first power load pattern data set and a second power load pattern data set; The detection module is used to remove outliers from the first power load pattern data set and the second power load pattern data set respectively according to a preset clustering algorithm to obtain corresponding abnormality detection results.

14. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the power grid load interaction data anomaly detection method as described in any one of claims 1-12.

15. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the power grid load interaction data anomaly detection method described in any one of claims 1-12 when executed.

16. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the computer program implements the method for detecting anomalies in power grid load interaction data according to any one of claims 1 to 12.

Citation Information

Cited By

  • Regional wind power plant multi-device real-time data processing method and system

    CN120873409A

  • A regional wind farm multi-device real-time data processing method and system

    CN120873409B