A method for processing abnormal power consumption behavior based on power consumption in substations
By adopting the abnormal behavior of power consumption in the station area in the anti-power stolen equipment, including data collection, preprocessing, abnormal detection and clustering analysis, the problems of complex installation and poor identification of traditional anti-power stolen equipment are solved, and efficient Improved power theft identification and power grid management.
Patent Information
- Application Number
- CN202411368957.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-29
- Publication Date
- 2025-01-14
- Estimated Expiration
- 2044-09-29
AI Technical Summary
Traditional anti-powered power theft equipment is complex and costly, making it difficult to comprehensively and accurately identify power theft behavior, and is difficult to maintain. It neglects in-depth mining and analysis of power consumption data, resulting in poor monitoring results.
Using an abnormal electricity behavior processing method based on electricity consumption in the station area, data is collected through the electricity consumption information collection system, pre-processing, deduplication, abnormality detection and screening are carried out to form similar clusters and repair missing data, and the user's typical daily load curve and Cluster analysis, abnormal identification and monitoring.
It improves the accuracy of identifying abnormal electricity use behaviors, reduces false alarms and missed reports, reduces the cost of anti-power theft, promotes the intelligent development of power grids, and improves the management level and operational efficiency of power grid enterprises.
Smart Images

Figure CN118861536B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of anti-electricity theft monitoring, and in particular to a method for processing abnormal electricity consumption behavior based on electricity consumption in a transformer area. Background Art
[0002] During the installation process of traditional anti-electricity theft equipment, the power grid system needs to be complicatedly modified and wired, which not only increases the technical difficulty of installation, but also may interfere with the normal operation of the power grid. At the same time, the installation process requires the participation of professional technicians, which increases labor costs.
[0003] The purchase, installation, maintenance, and subsequent data processing and analysis of monitoring equipment require a large amount of capital investment. Due to the continuous updating and increasing concealment of electricity theft methods, it is difficult for traditional monitoring equipment to fully and accurately identify electricity theft. Some electricity thieves may use blind spots or loopholes in the equipment to steal electricity, resulting in poor monitoring results. During long-term use, monitoring equipment may malfunction or performance degradation. Due to the complexity and professionalism of the equipment, it is relatively difficult to maintain, and a large amount of manpower and material resources are required for inspection and replacement.
[0004] Traditional anti-electricity theft technology only focuses on the monitoring function of the equipment, but ignores the in-depth mining and analysis of electricity consumption data. This results in a large amount of valuable electricity consumption information being wasted and cannot provide strong data support for anti-electricity theft work. Summary of the invention
[0005] The technical problem to be solved by the present invention is to provide a method for processing abnormal electricity consumption behavior based on electricity consumption in a substation, thereby reducing the cost of anti-electricity theft and improving the monitoring effect.
[0006] In order to solve the above technical problems, the technical solution of the present invention is as follows:
[0007] In a first aspect, a method for processing abnormal power consumption behavior based on power consumption in a substation area is provided, the method comprising:
[0008] The original data set related to the abnormal power consumption behavior analysis is collected through the power consumption information collection system, and the original data set is preprocessed to obtain a processed data set;
[0009] De-duplicate the processed data set, and detect and screen abnormal data based on the de-duplicated data set, including wavelet decomposition, soft threshold denoising, signal reconstruction, and calculation of abnormal scores to identify abnormal data;
[0010] Fuzzy classification is performed on the data set after anomaly detection and screening to form multiple similar clusters, and the missing data is repaired in the similar clusters to obtain the repaired data set;
[0011] Calculate the typical daily load curve of the user based on the patched data set;
[0012] The typical daily load curve of the user is used as the sample data of cluster analysis, and the sample data is clustered to obtain the cluster analysis results;
[0013] Based on the cluster analysis results and the similarity between the data, the user's electricity usage behavior is anomaly identified and monitored.
[0014] Furthermore, the processed data set is deduplicated, and based on the deduplicated data set, abnormal data is detected and screened, including wavelet decomposition, soft threshold denoising, signal reconstruction, and calculation of anomaly scores to identify abnormal data, including:
[0015] Traverse the data samples in the processed data set and check whether the data samples already exist in a deduplicated record set to obtain a deduplicated data set;
[0016] Decompose each data point in the deduplicated data set by coupling wavelet to obtain the result of wavelet decomposition;
[0017] According to the result of wavelet decomposition, a threshold is set, and each frequency component obtained by wavelet decomposition is denoised to obtain a denoised frequency component;
[0018] For the denoised frequency components, the signal is reconstructed by inverse wavelet transform to obtain the denoised data points;
[0019] Based on the denoised data points, the anomaly score of each data point is calculated, and a threshold is set based on the distribution of the anomaly score; when the anomaly score of a data point exceeds the threshold, it will be identified as abnormal data.
[0020] Furthermore, the anomaly score calculation formula for each data point is:
[0021] ;
[0022] in, represents the anomaly score; Represents the weight coefficient is the normalized similarity between a data point and its neighboring data points; Represents data points The local outlier factor of and Respectively represent the minimum and maximum values of the outlier factors of all data points in the data set; , and is the weight coefficient; Represents data points and data points The distance between is the number of nearest neighbors; Represents the average distance of all pairs of data points in the entire data set; Represents data points The center value of the category The median of all the categories in the dataset The absolute value of the difference; Represents the range of central values of all categories in the entire data set; where
[0023] ;
[0024] in, Represents data points The k-nearest neighbor set contains the data points The k closest points; It is a data point The local reachable density is expressed at the data point The inverse of the average reachable distance among the k-nearest neighbors; It is a data point The local reachable density is expressed at the data point The inverse of the average reachable distance among the k-nearest neighbors; and Represents an index.
[0025] Furthermore, the data set after anomaly detection and screening is fuzzy classified to form multiple similar clusters, and the missing data is repaired in the similar clusters to obtain a repaired data set, including:
[0026] Import the data set after anomaly detection and screening into the data analysis platform, set the number of clusters according to the characteristics of the data set, and randomly initialize the cluster centers;
[0027] Calculate the membership value of each data point in the data set to all clusters, and update the location of the cluster center through the membership matrix and data point information; repeat the iteration until the preset stop condition is met to obtain the membership value of each data point to all clusters and the final cluster center;
[0028] Assign data points according to the membership matrix and the cluster membership to obtain multiple clusters consisting of similar data points;
[0029] In each similar cluster, missing data are patched, and for each missing data point in the cluster, the Euclidean distance with the remaining data points in the cluster is calculated, and the value of the missing data point is inferred;
[0030] Merge the patched data points with the original data points to get the patched dataset
[0031] Furthermore, it is characterized in that the calculation formula of the user's typical daily load curve is:
[0032] ;
[0033] in, Indicates at a point in time Typical daily load value of users under Indicates the number of days of load curve data; An index representing the day; Indicates Day time point The load value; Indicates The weight of the daily data; Indicates the total number of time points in a day; is an adjustment factor; Indicates the index of a time point.
[0034] Furthermore, the typical daily load curve of the user is used as sample data for cluster analysis, and cluster analysis is performed on the sample data to obtain cluster analysis results, including:
[0035] Using the typical daily load curve of users as sample data for cluster analysis, and determining the number of clusters, and using the typical daily load curve of users as sample data for cluster analysis, and determining the number of clusters, and the colony parameters of the global artificial bee colony algorithm, including the colony size, the maximum number of iterations, and the number of limits;
[0036] Define a fitness function to evaluate the quality of cluster centers and randomly generate a set of initial cluster centers;
[0037] Optimizing the initial cluster centers to obtain a set of optimized initial cluster centers;
[0038] The optimized initial cluster center is used as the starting cluster center to perform cluster analysis on the sample data;
[0039] Iteratively update the cluster center and redistribute data points to the nearest cluster center until the cluster center no longer changes to obtain the cluster analysis result.
[0040] Furthermore, it is characterized in that the calculation formula of the fitness function is:
[0041] ;
[0042] in, Representation clustering The fitness value of Indicates the number of clusters; Indicates All data points in a cluster to its cluster center The average distance of Indicates the All data points in a cluster to its cluster center The average distance of Indicates The cluster centers and The distance between cluster centers; , Represents the index variable that identifies different clusters.
[0043] In a second aspect, a system for processing abnormal power consumption behavior based on power consumption in a substation area includes:
[0044] The acquisition module is used to collect the original data set related to the analysis of abnormal power consumption behavior through the power consumption information collection system, and pre-process the original data set to obtain a processed data set; perform deduplication processing on the processed data set, and detect and screen abnormal data based on the deduplication data set, including wavelet decomposition, soft threshold denoising, signal reconstruction, and calculate anomaly scores to identify abnormal data; perform fuzzy classification on the data set after anomaly detection and screening to form multiple similar clusters, and in the similar clusters, repair the missing data to obtain a repaired data set;
[0045] The processing module is used to calculate the typical daily load curve of the user according to the repaired data set; use the typical daily load curve of the user as sample data for cluster analysis, and perform cluster analysis on the sample data to obtain cluster analysis results; and identify and monitor abnormalities in the user's electricity consumption behavior according to the similarity between the cluster analysis results and the data.
[0046] According to a third aspect, a computing device includes:
[0047] one or more processors;
[0048] The storage device is used to store one or more programs. When the one or more programs are executed by the one or more processors, the one or more processors implement the method described.
[0049] In a fourth aspect, a computer-readable storage medium stores a program, and when the program is executed by a processor, the method described is implemented.
[0050] The above solution of the present invention includes at least the following beneficial effects:
[0051] The original data set collected by the electricity consumption information collection system can effectively eliminate noise and interference, retain real electricity consumption information, improve the accuracy of identifying abnormal electricity consumption behavior, and reduce false alarms and missed alarms through multiple steps such as preprocessing, deduplication, anomaly detection and screening.
[0052] The use of advanced data processing technologies such as wavelet decomposition and soft threshold denoising can quickly process large-scale data sets and improve the efficiency of data processing. At the same time, the application of methods such as fuzzy classification and cluster analysis has further simplified the data processing process and reduced the computational complexity. Repairing missing data in similar clusters can restore data missing due to various reasons and improve the integrity and reliability of data. This helps to more accurately reflect the user's electricity consumption behavior and provide more powerful data support for abnormal identification and monitoring. By calculating the user's typical daily load curve and performing cluster analysis on the sample data, the characteristics and laws of the user's electricity consumption behavior can be deeply explored. This helps power grid companies to have a more comprehensive understanding of the user's electricity consumption.
[0053] Compared with traditional anti-electricity theft measures, this method mainly relies on data mining and intelligent analysis technology, and does not require the installation of a large number of monitoring equipment, thereby reducing the cost of anti-electricity theft. At the same time, due to its high accuracy and efficiency, it can also reduce economic losses caused by false alarms and missed alarms. It is helpful to promote the intelligent development of the power system and improve the management level and operational efficiency of power grid companies. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] Figure 1 It is a flow chart of a method for processing abnormal electricity consumption behavior based on power consumption in a substation provided by an embodiment of the present invention.
[0055] Figure 2 It is a schematic diagram of a system for processing abnormal electricity consumption behavior based on power consumption in a substation provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0056] The exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments described herein. On the contrary, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art. Figure 1 As shown, an embodiment of the present invention proposes a method for processing abnormal power consumption behavior based on power consumption in a substation, and the method includes the following steps:
[0057] Step 1: collect original data sets related to abnormal power consumption behavior analysis through the power consumption information collection system, and pre-process the original data sets to obtain processed data sets;
[0058] Step 2, deduplication processing is performed on the processed data set, and abnormal data detection and screening is performed based on the deduplication data set, including wavelet decomposition, soft threshold denoising, signal reconstruction, and calculation of anomaly scores to identify abnormal data;
[0059] Step 3, fuzzy classification is performed on the data set after anomaly detection and screening to form multiple similar clusters, and the missing data is repaired in the similar clusters to obtain a repaired data set;
[0060] Step 4, calculating the typical daily load curve of the user according to the repaired data set;
[0061] Step 5: Use the typical daily load curve of the user as sample data for cluster analysis, and perform cluster analysis on the sample data to obtain cluster analysis results;
[0062] Step 6: Based on the cluster analysis results and the similarity between the data, abnormalities in the user's electricity usage behavior are identified and monitored.
[0063] In the embodiment of the present invention, the original data set is preprocessed and deduplicated, which effectively eliminates duplicate, invalid and erroneous data and improves the quality and reliability of the data. Advanced technologies such as wavelet decomposition, soft threshold denoising and signal reconstruction are used to detect and filter abnormal data in the deduplicated data set. It can accurately identify abnormal points in the data, such as abnormal power consumption patterns caused by electricity theft, and improve the accuracy and sensitivity of abnormal identification. Multiple similar clusters are formed by fuzzy classification, and missing data is repaired in similar clusters, which effectively solves the problem of incomplete data. This makes the repaired data set more complete and accurate.
[0064] Calculating the typical daily load curve of users based on the patched data set can accurately reflect the users' electricity consumption behavior and habits. This helps power grid companies to have a deeper understanding of users' electricity demand and provide a basis for formulating more reasonable power supply plans and service strategies. The typical daily load curve of users is used as sample data for cluster analysis, and the electricity consumption behavior patterns of different users are obtained through cluster analysis. This helps power grid companies to classify and manage users, formulate differentiated electricity management strategies for different user groups, and improve management efficiency and user satisfaction. According to the similarity between the cluster analysis results and the data, the user's electricity consumption behavior is monitored and warned in real time. Once abnormal electricity consumption behavior, such as electricity theft or illegal electricity use, is found, measures can be taken immediately to deal with it, effectively curbing the occurrence of abnormal electricity consumption behavior and ensuring the safe and stable operation of the power grid.
[0065] In a preferred embodiment of the present invention, the above step 1, collecting the original data set related to the abnormal power consumption behavior analysis through the power consumption information collection system, and preprocessing the original data set to obtain a processed data set, may include:
[0066] The system master station sends data collection instructions to the collection terminal according to the preset collection plan or real-time needs.
[0067] After receiving the command, the collection terminals (including concentrators, collectors, smart meters and dedicated transformer collection terminals, etc.) will start collecting the user's electricity consumption data according to the command requirements. The collected data will be encrypted and uploaded to the system master station through the communication channel (optical fiber private network, wireless private network, GPRS / CDMA wireless public network, etc.).
[0068] After receiving the encrypted data, the system master station will decrypt it and store the decrypted data in the database. The system master station will clean the stored data, remove invalid, erroneous or duplicate data, and fill or delete missing data. The cleaned data will be converted into a format suitable for subsequent analysis and processing, such as converting string type data into numeric type, converting timestamps into date format, etc. In order to eliminate the impact of data of different dimensions, the system will normalize the data so that the electricity consumption data of different users are comparable.
[0069] The system will extract features related to abnormal electricity consumption behavior analysis from the pre-processed data, such as the user's electricity consumption, electricity consumption time, electricity load, etc. According to the analysis requirements, the system will filter the data and eliminate interference factors such as non-residential user data and holiday data.
[0070] In a preferred embodiment of the present invention, the above step 2, deduplication processing is performed on the processed data set, and detection and screening of abnormal data are performed based on the deduplication data set, including wavelet decomposition, soft threshold denoising, signal reconstruction, and calculation of abnormal scores to identify abnormal data, which may include:
[0071] Step 24, traverse the data samples in the processed data set, and check whether the data samples already exist in a deduplicated record set to obtain a deduplicated data set;
[0072] Step 25, decomposing each data point in the deduplicated data set by coupling wavelet to obtain a wavelet decomposition result;
[0073] Step 26, according to the result of wavelet decomposition, a threshold is set, and each frequency component obtained by wavelet decomposition is denoised to obtain a denoised frequency component;
[0074] Step 27, reconstructing the denoised frequency components by inverse wavelet transform to obtain denoised data points;
[0075] Step 28, calculate the anomaly score of each data point based on the denoised data points, and set a threshold based on the distribution of the anomaly score; when the anomaly score of a data point exceeds the threshold, it will be identified as abnormal data.
[0076] In the embodiment of the present invention, the original data set is assumed to be , which contains data samples. These data samples can be expressed as: ,in, Represents the original data set Total included data samples; represents a non-repeating data sample, Represents repeated data samples; Indicates the number of non-repeated data samples. Traverse the data samples in the processed data set. For each data sample, check whether it already exists in a deduplicated record set. If the record does not exist in the deduplicated record set, add it; if it already exists, skip it. On the deduplicated data set, calculate the convergence probability of random sampling of data mining samples as: ;in, Represents the number of samples in the original data set; Indicates the number of data samples remaining in the data set after deduplication. Convergence probability The calculation of is based on factors such as the size of the data set, the distribution characteristics of the data, and the mining target. Using the calculated convergence probability , constrains random sampling in the data mining process. This means that when sampling, To adjust the sampling strategy and parameters to ensure the effectiveness and representativeness of the sampling. The constrained random sampling results reconstruct the sample set for data mining. This set will be used for subsequent abnormal data detection and screening.
[0077] For each data point in the reconstructed data mining sample set, coupled wavelet decomposition is performed. The detail coefficient layer obtained by wavelet decomposition is subjected to soft threshold denoising. This means that frequency components greater than the set threshold are retained, while components less than the threshold are suppressed or removed, which helps to reduce noise interference and retain important features of the data. The denoised frequency components are subjected to inverse wavelet transform to reconstruct the denoised data points, which can obtain data closer to the true value, and the noise is also effectively suppressed. In order to calculate the anomaly score of each data point, the normalized local anomaly factor of each data is first calculated as:
[0078] ;in, represents the normalized local anomaly factor; Represents data points The local outlier factor of , They represent the minimum and maximum outlier factors of all data points in the dataset, respectively.
[0079] Specifically, for each data point in the dataset , calculate its local outlier factor for: ;in, Represents data points The k-nearest neighbor set contains the data points The k closest points; It is a data point The local reachable density is expressed at the data point The inverse of the average reachable distance among the k-nearest neighbors; It is a data point The local reachable density is expressed at the data point The inverse of the average reachable distance among the k-nearest neighbors; and Represents an index. It is a measure of the degree of abnormality of a data point. It evaluates the abnormality of a point by comparing the local density difference between a data point and its neighboring points. If the local density of a data point is lower than that of its neighbors, then its The value will be relatively high, indicating that it may be an outlier. After the values are found, find the minimum and maximum of these values, using and These two values are used in the subsequent normalization process to ensure that the anomaly scores of all data points can be unified into a fixed range.
[0080] For each data point The value is normalized to obtain the normalized local anomaly factor This formula converts the original value Linearly map it to between 0 and 1. The purpose of this is to eliminate the differences between different data sets or different scales. The difference in values makes the comparison of anomaly scores more fair and consistent. The closer the value is to 1, the more abnormal the data point is; the closer the value is to 0, the less abnormal the data point is. value, it is easier to identify which data points are abnormal. Set a threshold (such as 0.5) when the data point When the value exceeds this threshold, it is marked as abnormal data.
[0081] In order to obtain more accurate anomaly assessment, a weighted fusion method is used to perform weighted fusion on the calculated normalized local anomaly factors. Set to 0.5 to balance the impact of the two. The calculation formula for the anomaly score of each data point after fusion is:
[0082] ;
[0083] in, represents the anomaly score; Represents the weight coefficient is the normalized similarity between a data point and its neighboring data points; Represents data points The local outlier factor of and Respectively represent the minimum and maximum values of the outlier factors of all data points in the data set; , and is the weight coefficient; Represents data points and data points The distance between is the number of nearest neighbors; Represents the average distance of all pairs of data points in the entire data set; Represents data points The center value of the category The median of all the categories in the dataset The absolute value of the difference; Represents the range of central values of all categories in the entire data set; where
[0084] ;
[0085] in, Represents data points The k-nearest neighbor set contains the data points The k closest points; It is a data point The local reachable density is expressed at the data point The inverse of the average reachable distance among the k-nearest neighbors; It is a data point The local reachable density is expressed at the data point The inverse of the average reachable distance among the k-nearest neighbors; and Represents an index.
[0086] For data points , first calculate the similarity between it and its neighboring data points for: ;in, Represents the similarity between a data point and its neighboring data points; Represents data points and The Euclidean distance between them. Similarity The higher it is, the more similar the data point is to its neighbors, which may reduce its anomaly score. It is normalized, that is, it is linearly transformed to between 0 and 1. The purpose of this is to eliminate the differences between different data sets or different scales. Normalization is done by using the The minimum and maximum values are used. is a weight coefficient used to balance the contribution of similarity and local outlier factor in the calculation of anomaly score. The value range of is between 0 and 1. When it is close to 1, the similarity has a greater weight in the calculation of the anomaly score; when When it is close to 0, the weight of the local outlier factor is large. The anomaly score is calculated by weighted summation The anomaly score takes into account the similarity between the data point and its neighbors and the local outlier factor, so it can more comprehensively evaluate the degree of anomaly of the data point. The higher the anomaly score, the higher the degree of anomaly of the data point. Finally, 3 Guidelines for filtering abnormal data: ; When the anomaly score of a data point exceeds this threshold, it is identified as anomaly data.
[0087] Iterate through the entire processed data set and verify that each record has been stored in a deduplicated record set to ensure the uniqueness of the data set. Eliminating duplicate data can reduce data storage space and avoid repeated false alarms in anomaly detection. Wavelet decomposition can deeply analyze the frequency characteristics in the data points.
[0088] Soft threshold denoising technology can effectively filter out noise interference in the data, improve the overall quality of the data, and make the results of anomaly detection more accurate and reliable. Signal reconstruction allows us to regain clean and accurate data points. By accurately calculating the anomaly score and setting a reasonable threshold, abnormal data points in the data set can be efficiently and accurately identified.
[0089] In a preferred embodiment of the present invention, the above step 3, fuzzy classification of the data set after anomaly detection and screening to form multiple similar clusters, and patching the missing data in the similar clusters to obtain a patched data set, may include:
[0090] Step 31, importing the data set after anomaly detection and screening into the data analysis platform, setting the number of clusters according to the characteristics of the data set, and randomly initializing the cluster centers;
[0091] Step 32, calculate the membership value of each data point in the data set to all clusters, and update the position of the cluster center through the membership matrix and data point information; repeat the iteration until the preset stop condition is met to obtain the membership value of each data point to all clusters and the final cluster center;
[0092] Step 33, allocating data points according to the membership matrix and the membership of the clusters to obtain a plurality of clusters consisting of similar data points;
[0093] Step 34, in each similar cluster, the missing data is repaired, and for each missing data point in the cluster, the Euclidean distance with the remaining data points in the cluster is calculated, and the value of the missing data point is inferred;
[0094] Step 35, merging the repaired data points with the original data points to obtain a repaired data set.
[0095] In the embodiment of the present invention, the processed data set is loaded into the data analysis platform, and the number of clusters is determined according to the size, distribution characteristics and analysis requirements of the data set. Some points in the data set are randomly selected as initial cluster centers. These centers will serve as the starting point of iterative calculations, and the initial selections are evenly distributed in the entire data space to avoid excessive bias in the clustering results.
[0096] For each data point in the data set, its membership value to each cluster is calculated as:
[0097] ; represents the membership value; Indicates the number of clusters; represents the fuzzification parameter; Indicates the first data points; , Respectively represent and The center of the cluster; , Represents data points To cluster center and The distance of membership value It is used to reflect the degree to which a data point belongs to a certain cluster. and each cluster center , calculate the distance from the data point to the cluster center as: ;in, Represents the number of dimensions of the data; Represents data points In the The values in the dimensions; Represents the cluster center In the The value of a dimension.
[0098] From the first dimension ( = 1) to the last dimension ( =n). For each dimension , calculate the data points Cluster Center The difference in this dimension The calculation of membership value depends on the distance from the data point to the cluster center. The smaller the distance, the larger the membership value is usually, indicating that the data point is more likely to belong to the cluster.
[0099] During the iteration process, the membership values and the positions of the cluster centers are continuously updated. Each iteration updates the cluster centers based on the current membership matrix and data point information, and then recalculates the membership values based on the updated cluster centers. This process is repeated until the preset stop condition is met, such as the membership value reaches the maximum number of iterations. Finally, we get a membership matrix that contains the membership values of each data point belonging to each cluster.
[0100] Based on the current membership matrix and data point information, update the cluster center of each cluster. Repeat the membership value calculation and cluster center update until the preset stop condition is met. According to the final membership matrix, analyze the association between data points and clusters. Data points are assigned to the cluster with the highest membership value to form clusters composed of similar data points. The membership matrix is a N × C where N is the number of data points, C is the number of clusters. Each element in the matrix Represents data points Belongs to cluster Analyze the membership matrix to determine the main membership cluster of each data point. In hard clustering, data points are assigned to the cluster with the highest membership; in fuzzy clustering, data points can belong to multiple clusters, but the membership of each cluster is different. For hard clustering, data points are assigned to the corresponding cluster according to the maximum value in the membership matrix. For fuzzy clustering, a threshold is set and data points are assigned to clusters whose membership exceeds the threshold. Analyze the distribution of data points in each cluster, including dense areas, sparse areas and outliers of the data. Identify missing data points in the cluster and analyze the possible value range of the missing data. Consider the distribution and characteristics of the data points in the cluster, as well as the correlation between the data points, to infer the possible values of the missing data. For each missing data point in the cluster, calculate its Euclidean distance to the remaining data points in the cluster as: ;in, Represents the filled data points With the cluster Data points The Euclidean distance between represents the data points after filling; Indicates the first data points; Represents the number of dimensions of the data; Represents data points In the The value of a dimension.
[0101] Based on the calculated distance , as well as the distribution and characteristics of the data points within the cluster, to infer the possible values of the missing data points.
[0102] Specifically, according to the type of missing data points and the distribution of data points within the cluster, the linear interpolation is calculated as: ;
[0103] in,( , )and( , ) represents the known data point, and (x, y) represents the point to be interpolated. , select the nearest non-missing data points are used as interpolation points. The value of can be adjusted according to the actual situation, and 2 to 5 points can be selected for interpolation. If the missing data points are multidimensional, each dimension can be interpolated separately. Use linear interpolation and interpolation points to infer the values of the missing data points. For each missing dimension, calculate the corresponding value according to the interpolation formula. To verify the interpolation results, you can compare the interpolation results with the values of the remaining data points in the cluster to check whether they are consistent or conform to the distribution law of the data. If the interpolation results are unreasonable or abnormal, reselect the interpolation points for recalculation. Update the inferred values of the missing data points to the corresponding positions in the original data set. Output and save the repaired data set to the specified location.
[0104] Through fuzzy classification and missing data patching, the overall quality of the data set is improved, and the impact of missing values on subsequent data analysis is reduced. The patched data set is more complete and can be used for more data analysis and mining tasks, which improves the availability and value of the data. The fuzzy classification algorithm can more accurately reflect the affiliation of data points, form tighter similar clusters, and improve the clustering effect. The patched data set has a clear structure and complete attributes. Through reasonable missing data patching methods, the information loss caused by missing values is reduced, and more useful information in the data set is retained.
[0105] In a preferred embodiment of the present invention, the calculation formula of the typical daily load curve of the user is:
[0106] ;
[0107] in, Indicates at a point in time Typical daily load value of users under Indicates the number of days of load curve data; An index representing the day; Indicates Day time point The load value; Indicates The weight of the daily data; Indicates the total number of time points in a day; is an adjustment factor; Indicates the index of a time point. In the embodiment of the present invention, the collection Daily load data, with several time points each day , each time point corresponds to a load value For every day , for each time point , calculate the sum of the load values of all days at that time point For each time point , the load value of each day The corresponding weight Multiply them together to get the weighted load value. Add these weighted load values to all days Sum the above to get the typical daily load curve at time point Value For all time points Repeat the above steps to obtain a series of These values constitute the user's typical daily load curve.
[0108] The typical daily load curve can be used as a basis for predicting the future load of users. Since it reflects the typical load pattern of users, it can improve the accuracy of load forecasting, especially when there is no real-time data or limited historical data. Grid planning needs to take into account the load demand of users. Through the typical daily load curve, grid operators can better understand the load pattern of users, thereby optimizing the planning and operation of the grid and ensuring the reliability and efficiency of power supply. The typical daily load curve helps to implement demand-side management strategies. For example, by identifying the peak load period, corresponding peak-valley electricity price policies can be formulated to encourage users to use electricity during low-load periods, thereby balancing the grid load and improving the stability of the power system. By understanding the typical load pattern of users, more effective energy-saving and emission reduction strategies can be formulated. For example, equipment maintenance can be arranged or production plans can be adjusted during the low-load period to reduce unnecessary energy consumption and emissions. The typical daily load curve provides strong support for the formulation of energy policies. For power suppliers, understanding the typical load pattern of users helps to improve the quality of user services. For example, personalized power supply plans can be formulated according to the load demand of users to ensure stable and reliable power supply to users.
[0109] In a preferred embodiment of the present invention, the above step 5, using the typical daily load curve of the user as sample data for cluster analysis, and performing cluster analysis on the sample data to obtain cluster analysis results, may include:
[0110] Step 51, using the typical daily load curve of the user as sample data for cluster analysis, and determining the number of clusters, as well as the colony parameters of the global artificial bee colony algorithm, including the colony size, the maximum number of iterations, and the limit number;
[0111] Step 52, defining a fitness function to evaluate the quality of the cluster centers, and randomly generating a set of initial cluster centers;
[0112] Step 53, optimizing the initial cluster centers to obtain a set of optimized initial cluster centers;
[0113] Step 54, using the optimized initial cluster center as the starting cluster center to perform cluster analysis on the sample data;
[0114] Step 55, iteratively updating the cluster center and reallocating data points to the nearest cluster center until the cluster center no longer changes, so as to obtain a cluster analysis result.
[0115] In an embodiment of the present invention, each user's typical daily load curve is regarded as a sample data, and these curves are composed of load values at various time points to form a multidimensional data set. The number of clusters, that is, the number of clusters to be divided, is determined according to actual needs. The parameters of the global artificial bee colony algorithm are determined, including the colony size (that is, the total number of bees), the maximum number of iterations (the maximum number of rounds of the algorithm running), and the number of limits (the number of times the bees turn to other positions after failing to update at a certain position). A fitness function is designed to evaluate the quality of the cluster center. This function is calculated based on the closeness of the data points within the cluster and the separation of the data points between the clusters. The goal of the fitness function is to find a set of cluster centers so that the data points within the cluster are as similar as possible, and the data points between the clusters are as different as possible. A set of initial cluster centers is randomly generated. In the artificial bee colony algorithm, bees are divided into employed bees, spectator bees, and scout bees. Employed bees are responsible for searching new locations near the current cluster center, spectator bees select potential locations for search based on the information shared by employed bees, and scout bees are responsible for randomly searching for new cluster centers globally.
[0116] Through the search behavior of bees, the location of the cluster center is continuously updated to find the clustering solution. After each update, the quality of the new cluster center is evaluated using the fitness function. Repeat the above process until the maximum number of iterations is reached, and the optimized initial cluster center is used as the starting cluster center. According to the principle of the closest distance, the sample data points are assigned to the cluster to which the nearest cluster center belongs. Iteratively update the cluster center and redistribute the data points to the nearest cluster center until the cluster center no longer changes. After the above steps, a set of stable cluster centers and corresponding clusters are finally obtained. Each cluster contains a set of similar typical daily load curves of users.
[0117] By optimizing the initial cluster centers through the global artificial bee colony algorithm, more accurate and representative cluster centers can be found. This helps to reduce misclassification and improve the accuracy of clustering results, thereby more accurately reflecting the user's load pattern. The artificial bee colony algorithm ensures the stability of the clustering results by iteratively updating the cluster centers and redistributing data points until the cluster centers no longer change. This means that the clustering results can remain relatively consistent even in the face of noise or abnormal data. The global artificial bee colony algorithm can find clustering solutions in a shorter time through parallel search and intelligent optimization mechanisms. The artificial bee colony algorithm can automatically adjust the search strategy according to the complexity of the problem and the characteristics of the data. This allows it to perform well when dealing with typical daily load curves of different types of users. Cluster analysis helps to discover potential patterns and laws in user load data. By combining these patterns with actual user behavior, weather conditions, holidays and other factors, users' load demands can be more deeply understood, providing strong support for power supply and demand management. The results of cluster analysis can provide valuable decision support for power suppliers, grid operators and policymakers. For example, differentiated electricity price policies can be formulated based on clustering results, power supply plans can be optimized, and the potential of demand response projects can be evaluated. By understanding users' typical load patterns, power suppliers can more accurately meet users' needs and provide personalized power supply solutions and services.
[0118] In a preferred embodiment of the present invention, the calculation formula of the fitness function is:
[0119] ;
[0120] in, Representation clustering The fitness value of Indicates the number of clusters; Indicates All data points in a cluster to its cluster center The average distance of Indicates the All data points in a cluster to its cluster center The average distance of Indicates The cluster centers and The distance between cluster centers; , Represents the index variable that identifies different clusters.
[0121] In an embodiment of the present invention, and Respectively represent and In each cluster, all data points are located at their respective cluster centers ( and These two values reflect how closely the data points in a cluster are clustered around the cluster center. Indicates The cluster centers and The distance between cluster centers.
[0122] This value measures the degree of separation between different cluster centers. , the function will calculate its relationship with all other clusters ( = ) This ratio takes into account the clustering The tightness of the inner Reflection) and clustering With clustering The separation between It also takes clustering into account The tightness (through The smaller the ratio, the more clustering Compared with other clusters, it has better compactness and separation. For each cluster , select the maximum value from the above ratios to evaluate clustering The worst-case separation from other clusters. Sum these maximum values and divide by the number of clusters , and get an overall evaluation value. This value reflects the average worst-case separation of all clusters. Finally, add 1 to this overall evaluation value and take the reciprocal to get the cluster The fitness value of The larger the fitness value, the better the clustering. The higher the quality under the current cluster center configuration. The artificial bee colony algorithm is used in the cluster optimization process. The goal is to find a set of cluster centers that maximizes the sum of the fitness values of all clusters. By continuously iterating and optimizing the positions of cluster centers, the fitness value of the cluster can be gradually improved. From the fitness function, by comprehensively considering the compactness within the cluster (given by and The separation between clusters is reflected by Reflection, can comprehensively evaluate the quality of cluster centers. When evaluating cluster quality, the fitness function considers the relative relationship between all clusters, not just the internal characteristics of a single cluster.
[0123] This global evaluation method helps to enhance the stability of clustering and reduce the fluctuation of clustering results caused by data noise or outliers. The fitness function provides a clear optimization goal for the optimization algorithm (artificial bee colony algorithm), which is to maximize the fitness value. This enables the optimization algorithm to search and improve the location of cluster centers in a targeted manner, so as to find the optimal solution more efficiently. Through cluster analysis, the fitness function helps to discover potential patterns and laws in the data. The fitness function ensures the accuracy and reliability of the cluster analysis results, thereby improving the effectiveness and accuracy of decision-making. The design of the fitness function takes into account the characteristics and requirements of the clustering problem, so that the algorithm can find solutions more efficiently during the search process. This helps to improve the overall performance of the algorithm, including convergence speed, solution quality and computational efficiency.
[0124] In a preferred embodiment of the present invention, the above step 6, based on the cluster analysis result and the similarity between the data, identifying and monitoring the abnormality of the user's electricity consumption behavior, may include:
[0125] According to the cluster analysis results, the center point of each cluster is determined and recorded as ,in represents the index of the cluster, is the dimension of the feature vector. For each user’s electricity consumption behavior data, , calculate its similarity with each cluster center. Cosine similarity is used as the measurement method, and its calculation formula is: ;in, Indicates user The electricity consumption behavior vector With cluster center Vector The cosine similarity between ; Indicates user In the The value of a feature; Represents the cluster center In the The value of a feature; The number of characteristics of electricity consumption behavior. The electricity consumption behavior is represented as a Dimensional vector ,in Is a user In the The value of the feature. Cluster center Also represented as a Dimensional vector ,in is the cluster center In the Calculate the value of the user The electricity consumption behavior vector With cluster center Vector The dot product is the sum of the multiplication of the corresponding elements of two vectors, expressed as The dot product reflects the degree of similarity between two vectors in direction. If the two vectors have the same direction, the dot product will be a positive number with a larger value; if the directions are opposite, the dot product will be a negative number with a smaller value; if the two vectors are orthogonal (i.e., irrelevant), the dot product will be close to 0.
[0126] Counting users The electricity consumption behavior vector The modulus length is expressed as ; The modulus is a measure of the size of a vector, indicating the length of the vector in space. Similarly, the cluster center is calculated Vector The modulus length is expressed as ; Divide the dot product by the product of the two vector moduli to get the cosine similarity This value measures the cosine of the angle between two vectors and is used to evaluate the user Electricity consumption behavior and cluster centers The cosine similarity ranges from -1 to 1. The closer the value is to 1, the more similar the two vectors are (the same direction); the closer the value is to -1, the less similar the two vectors are (the opposite direction); the closer the value is to 0, the two vectors are orthogonal (irrelevant). By comparing the cosine similarity With the preset threshold, it can be determined whether the electricity consumption behavior of user i is consistent with the cluster center Similar. If A high value of (close to 1) indicates that the user Electricity consumption behavior and cluster centers Similar; if A low value of (close to -1 or 0) indicates that the user Electricity consumption behavior and cluster centers Not similar or orthogonal.
[0127] Based on the similarity distribution of electricity consumption behaviors of users within a cluster and the similarity difference of electricity consumption behaviors of users between clusters, an abnormal threshold is set. T This threshold T It is used to distinguish normal electricity consumption behavior from abnormal electricity consumption behavior. For each user's electricity consumption behavior, its similarity with each cluster center is calculated. The abnormal threshold is set T Compare. If there is For all k, or the user's electricity usage behavior is different from that of other users (the difference threshold is determined by statistics), the user's electricity usage behavior is identified as abnormal. The user's electricity usage behavior is monitored in real time. Each time new electricity usage data is collected, the above similarity calculation and abnormality identification process are repeated. Once abnormal electricity usage behavior is found, an early warning signal is issued in time.
[0128] Assume that there are 100 users' electricity consumption behavior data, and each user has 5 characteristics (such as electricity consumption, electricity consumption duration, peak electricity consumption period, etc.). After cluster analysis, 3 cluster centers are obtained, representing three typical electricity consumption behavior patterns.
[0129] Collect and clean the electricity consumption behavior data of these 100 users. Use the clustering algorithm to perform cluster analysis on the data and obtain three cluster centers. For each user, calculate the cosine similarity between its electricity consumption behavior vector and the three cluster centers. For example, the similarity between user A and cluster center 1 is 0.85, the similarity between user A and cluster center 2 is 0.70, and the similarity between user A and cluster center 3 is 0.65. After analyzing the similarity distribution of the electricity consumption behaviors of users in the cluster, set the abnormal threshold T to 0.60. This means that if the similarity between the user's electricity consumption behavior vector and all cluster centers is less than 0.60, it will be identified as abnormal. Monitor the electricity consumption behavior of user A in real time. In a certain monitoring, it was found that the similarity between user A's electricity consumption behavior vector and the three cluster centers was 0.55, 0.50, and 0.45, respectively, which were all less than the abnormal threshold T. Therefore, user A's electricity consumption behavior was identified as abnormal and an early warning signal was issued. An early warning signal is sent to user A or relevant management personnel through SMS or APP push, indicating abnormal power consumption behavior. The early warning signal should include specific information such as user A's ID, abnormal time, abnormal characteristics, etc.
[0130] like Figure 2 As shown, an embodiment of the present invention further provides an abnormal power consumption behavior monitoring system 20 based on power consumption collection and data mining in a substation, comprising:
[0131] The acquisition module 21 is used to collect the original data set related to the abnormal power consumption behavior analysis through the power consumption information collection system, and pre-process the original data set to obtain a processed data set; perform deduplication processing on the processed data set, and detect and screen abnormal data based on the deduplication data set, including wavelet decomposition, soft threshold denoising, signal reconstruction, and calculation of abnormal scores to identify abnormal data; perform fuzzy classification on the data set after abnormal detection and screening to form multiple similar clusters, and in the similar clusters, repair the missing data to obtain a repaired data set;
[0132] The processing module 22 is used to calculate the typical daily load curve of the user based on the repaired data set; use the typical daily load curve of the user as sample data for cluster analysis, and perform cluster analysis on the sample data to obtain cluster analysis results; and identify and monitor abnormalities in the user's electricity consumption behavior based on the similarity between the cluster analysis results and the data.
[0133] It should be noted that the system is a system corresponding to the above method, and all implementation methods in the above method embodiment are applicable to this embodiment and can achieve the same technical effect.
[0134] The embodiment of the present invention further provides a computing device, comprising: a processor, a memory storing a computer program, wherein when the computer program is executed by the processor, the method described above is executed. All implementations in the above method embodiment are applicable to this embodiment and can achieve the same technical effect.
[0135] The embodiment of the present invention also provides a computer-readable storage medium storing instructions, which, when executed on a computer, enable the computer to execute the method described above. All implementations in the above method embodiment are applicable to this embodiment and can achieve the same technical effect.
[0136] The above is a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A method for processing abnormal power consumption behavior based on power consumption in a substation, characterized in that: The method comprises: The original data set related to the abnormal power consumption behavior analysis is collected through the power consumption information collection system, and the original data set is preprocessed to obtain a processed data set; De-duplicate the processed data set, and detect and screen abnormal data based on the de-duplicated data set, including wavelet decomposition, soft threshold denoising, signal reconstruction, and calculation of abnormal scores to identify abnormal data; Fuzzy classification is performed on the data set after anomaly detection and screening to form multiple similar clusters, and the missing data is repaired in the similar clusters to obtain the repaired data set; Calculate the typical daily load curve of the user based on the patched data set; The typical daily load curve of the user is used as the sample data of cluster analysis, and the sample data is clustered to obtain the cluster analysis results; Based on the cluster analysis results and the similarity between the data, abnormalities in the user's electricity usage behavior can be identified and monitored; The processed data set is deduplicated, and based on the deduplicated data set, abnormal data is detected and screened, including wavelet decomposition, soft threshold denoising, signal reconstruction, and calculation of anomaly scores to identify abnormal data, including: Traverse the data samples in the processed data set and check whether the data samples already exist in a deduplicated record set to obtain a deduplicated data set; Decompose each data point in the deduplicated data set by coupling wavelet to obtain the result of wavelet decomposition; According to the result of wavelet decomposition, a threshold is set, and each frequency component obtained by wavelet decomposition is denoised to obtain a denoised frequency component; For the denoised frequency components, the signal is reconstructed by inverse wavelet transform to obtain the denoised data points; Based on the denoised data points, the anomaly score of each data point is calculated, and a threshold is set based on the distribution of the anomaly score. When the anomaly score of a data point exceeds the threshold, it will be identified as abnormal data. The anomaly score for each data point is calculated as: ; in, represents the anomaly score; represents the weight coefficient; is the normalized similarity between a data point and its neighboring data points; Represents data points The local outlier factor of and Respectively represent the minimum and maximum values of the outlier factors of all data points in the data set; , and is the weight coefficient; Represents data points and data points The distance between is the number of nearest neighbors; Represents the average distance of all pairs of data points in the entire data set; Represents data points The center value of the category The median of all the categories in the dataset The absolute value of the difference; Represents the range of central values of all categories in the entire data set; where ; in, Represents data points The k-nearest neighbor set contains the data points The k closest points; It is a data point The local reachable density is expressed at the data point The inverse of the average reachable distance among the k-nearest neighbors; It is a data point The local reachable density is expressed at the data point The inverse of the average reachable distance among the k-nearest neighbors; and Represents an index.
2. The method for processing abnormal power consumption behavior based on power consumption in a substation according to claim 1 is characterized in that: Fuzzy classification is performed on the data set after anomaly detection and screening to form multiple similar clusters. In the similar clusters, the missing data is repaired to obtain the repaired data set, including: Import the data set after anomaly detection and screening into the data analysis platform, set the number of clusters according to the characteristics of the data set, and randomly initialize the cluster centers; Calculate the membership value of each data point in the data set to all clusters, and update the location of the cluster center through the membership matrix and data point information; repeat the iteration until the preset stop condition is met to obtain the membership value of each data point to all clusters and the final cluster center; Assign data points according to the membership matrix and the cluster membership to obtain multiple clusters consisting of similar data points; In each similar cluster, missing data are patched, and for each missing data point in the cluster, the Euclidean distance with the remaining data points in the cluster is calculated, and the value of the missing data point is inferred; The patched data points are merged with the original data points to obtain the patched dataset.
3. The method for processing abnormal power consumption behavior based on power consumption in a substation according to claim 2 is characterized in that: The calculation formula for the typical daily load curve of a user is: ; in, Indicates at a point in time Typical daily load value of users under Indicates the number of days of load curve data; An index representing the day; Indicates Day time point The load value; Indicates The weight of the daily data; Indicates the total number of time points in a day; is an adjustment factor; Indicates the index of a time point.
4. The method for processing abnormal power consumption behavior based on power consumption in a substation according to claim 3 is characterized in that: The typical daily load curve of the user is used as the sample data for cluster analysis, and cluster analysis is performed on the sample data to obtain cluster analysis results, including: The typical daily load curve of users is used as sample data for cluster analysis, and the number of clusters and the colony parameters of the global artificial bee colony algorithm, including colony size, maximum number of iterations, and limit number, are determined; Define a fitness function to evaluate the quality of cluster centers and randomly generate a set of initial cluster centers; Optimizing the initial cluster centers to obtain a set of optimized initial cluster centers; The optimized initial cluster center is used as the starting cluster center to perform cluster analysis on the sample data; Iteratively update the cluster center and redistribute data points to the nearest cluster center until the cluster center no longer changes to obtain the cluster analysis result.
5. The method for processing abnormal power consumption behavior based on power consumption in a substation according to claim 4 is characterized in that: The calculation formula of the fitness function is: ; in, Representation clustering The fitness value of Indicates the number of clusters; Indicates All data points in a cluster to its cluster center The average distance of Indicates the All data points in a cluster to its cluster center The average distance of Indicates The cluster centers and The distance between cluster centers; , Represents the index variable that identifies different clusters.
6. A system for processing abnormal power consumption behavior based on power consumption in a substation, characterized in that: Applied to the method according to any one of claims 1 to 5, comprising: The acquisition module is used to collect the original data set related to the analysis of abnormal power consumption behavior through the power consumption information collection system, and pre-process the original data set to obtain a processed data set; perform deduplication processing on the processed data set, and detect and screen abnormal data based on the deduplication data set, including wavelet decomposition, soft threshold denoising, signal reconstruction, and calculate anomaly scores to identify abnormal data; perform fuzzy classification on the data set after anomaly detection and screening to form multiple similar clusters, and in the similar clusters, repair the missing data to obtain a repaired data set; The processing module is used to calculate the typical daily load curve of the user according to the repaired data set; use the typical daily load curve of the user as sample data for cluster analysis, and perform cluster analysis on the sample data to obtain cluster analysis results; and identify and monitor abnormalities in the user's electricity consumption behavior according to the similarity between the cluster analysis results and the data.
7. A computing device, characterized in that include: one or more processors; A storage device for storing one or more programs, when the one or more programs are executed by the one or more processors, the one or more processors implement the method as claimed in any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a program, which implements the method according to any one of claims 1 to 5 when executed by a processor.
Citation Information
Patent Citations
Electricity stealing identification method based on curve similarity and ensemble learning algorithm
CN113033598A