Power consumption abnormity diagnosis method based on multi-element composite feature collaborative machine learning

Through the multi-complex feature collaborative machine learning method, the secondary features of power grid data are extracted and algorithms such as clustering and neural networks are used to solve the shortcomings of traditional diagnostic methods in the identification and prediction of abnormal power consumption, and achieve efficient and accurate power consumption. Abnormal diagnosis improves power grid stability and management efficiency.

CN118535853APending Publication Date: 2024-08-23黄志春
View PDF 0 Cites 22 Cited by

Patent Information

Application Number
CN202410504636.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-04-25
Publication Date
2024-08-23

AI Technical Summary

Technical Problem

Traditional power consumption abnormality diagnosis methods are difficult to efficiently process and analyze large amounts of structured and unstructured data, cannot monitor power system status in real time, and have shortcomings in accurately diagnosing power consumption abnormalities, resulting in increased power grid operation risks and loss of economic benefits.

Method used

The multi-composite feature collaborative machine learning method is used to preprocess power grid data, extract secondary features of electric energy indicators, use cluster analysis and support vector machine models to identify power consumption behavior patterns, and optimize predictions through neural networks and decision tree algorithms. and handle abnormal events.

Benefits of technology

It achieves high-accuracy analysis of power grid data, improves the accuracy and efficiency of power consumption abnormality diagnosis, enhances the stability and security of power grid operation, reduces operation and maintenance costs, and provides technical support for intelligent management.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118535853A
    Figure CN118535853A
Patent Text Reader

Abstract

The invention provides an electricity consumption abnormity diagnosis method based on multi-element composite feature collaborative machine learning. The method comprises the steps of obtaining current, voltage, power, frequency and temperature structured electric energy indexes in a power grid and equipment log and operation record unstructured information, and storing the unstructured information in a data warehouse in a time sequence mode; after the data is preprocessed, a principal component analysis method is adopted to simplify the data, information related to abnormality diagnosis is reserved, and meanwhile, the calculation complexity of subsequent processing is reduced; performing logic judgment and classification on the abnormal power consumption behaviors by using a decision tree algorithm, and outputting corresponding exception handling suggestions and measures according to different exception types; potential influence factors of abnormal power consumption are quantified through a regression analysis algorithm, causes of abnormal power consumption are analyzed, and diagnosis decision is assisted.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of information technology, and in particular to a method for diagnosing abnormal power consumption based on multi-component composite features and collaborative machine learning. Background Art

[0002] In the power industry, ensuring the stability and security of the power system is crucial. With the advancement of technology and the increase in the requirements for data analysis, traditional power consumption anomaly diagnosis methods have exposed multiple deficiencies, mainly reflected in the inability to efficiently process and analyze a large amount of structured and unstructured data, the difficulty in real-time monitoring of the power system status, and the obvious shortcomings in accurately diagnosing power consumption anomalies. In actual business scenarios, these deficiencies may lead to increased risks in power grid operation and economic losses for power companies. On the one hand, the data types generated in the power system are diverse, including current, voltage, power, frequency, and temperature, and may also be combined with unstructured information such as equipment logs and operation records. Traditional diagnostic methods such as current imbalance analysis and phase angle anomaly analysis are difficult to integrate these data, not only with insufficient diagnostic accuracy, but also difficult to adapt to the rapid growth and diversification of data volume. Therefore, the technical contradiction faced is how to obtain high accuracy and comprehensiveness when processing large data sets from multiple sources while maintaining sufficient real-time and computational efficiency. On the other hand, in the data preprocessing stage, how to ensure data quality and avoid inaccurate analysis caused by noise, missing values, and inconsistent formats has become a challenge. In addition, how to derive features with more diagnostic value from the original power indicators, such as the power factor change rate and load fluctuation rate, and ensure that these indicators can accurately reflect abnormal power consumption behavior, is a technical bottleneck for improving diagnostic efficiency. As for how to design an intelligent diagnostic system that can self-optimize and adapt to changes in the power system environment, the problems that need to be solved are the model's adaptive ability and continuous learning mechanism. Considering the technical contradictions of the above business scenarios, the core technical issues can be summarized as how to perform intelligent power consumption anomaly diagnosis, which requires real-time processing and analysis of large-scale structured and unstructured data sets, ensuring data quality, deriving features with diagnostic value, selecting and optimizing efficient machine learning algorithms, and having the ability to continuously learn and adapt, thereby ensuring the stable operation of the power system while improving the power company's ability to accurately diagnose power consumption anomalies. Summary of the invention

[0003] The present invention provides a method for diagnosing abnormal power consumption based on multivariate composite features and collaborative machine learning, which mainly includes:

[0004] Obtain structured power indicators such as current, voltage, power, frequency and temperature in the power grid, as well as unstructured information such as equipment logs and operation records, and store them in a data warehouse in a time series format;

[0005] After preprocessing the data, principal component analysis was used to simplify the data, retaining information relevant to abnormal diagnosis while reducing the computational complexity of subsequent processing;

[0006] Based on the simplified data, the secondary characteristics of the power indicators are extracted through statistical analysis methods, including the power factor change rate and the load fluctuation rate. The secondary indicators are used as key features for diagnosing abnormal power consumption.

[0007] The extracted key features are classified using a cluster analysis algorithm to identify different electricity consumption behavior patterns in the power grid, the results of the cluster analysis are obtained, a support vector machine model is constructed for pattern recognition, and the support vector machine model is trained to distinguish between normal and abnormal electricity consumption behaviors;

[0008] Use the neural network model to conduct deep learning on the pattern recognition results of the support vector machine model, and optimize the support vector machine model's ability to predict future abnormal events by learning from historical abnormal cases;

[0009] Use decision tree algorithm to make logical judgments and classifications on abnormal power consumption behaviors, and output corresponding abnormal handling suggestions and measures according to different abnormal types;

[0010] The potential influencing factors of abnormal power consumption are quantified through regression analysis algorithms, the causes of abnormal power consumption are analyzed, and diagnostic decisions are assisted.

[0011] In some embodiments, the step of obtaining structured electric energy indicators of current, voltage, power, frequency and temperature in the power grid and unstructured information of equipment logs and operation records and storing them in a data warehouse in a time series manner includes:

[0012] Use sensors and data acquisition equipment to obtain structured power indicators such as current, voltage, power, frequency and temperature in the power grid to obtain real-time power data; use log collection tools to obtain unstructured information of equipment logs and operation records to determine the equipment operating status and operation history; if the power indicator data and unstructured information are collected, they are organized and stored in a time series manner to form time series data; according to the characteristics of time series data, use time series database or time series database for storage to ensure efficient access and query of data; if the data volume is greater than the preset threshold, use distributed database for storage, and improve data storage and query efficiency through data sharding and parallel processing; import time series data into the data warehouse, model and organize the data according to the architecture and design of the data warehouse to form a structured data model; use ETL (data extraction, transformation, loading) tools to clean, transform and load the data to ensure the quality and consistency of the data and prepare for subsequent data analysis and mining.

[0013] In some embodiments, after the data is preprocessed, principal component analysis is used to simplify the data, retain information related to abnormal diagnosis, and reduce the computational complexity of subsequent processing, including:

[0014] Obtain the original data, perform preprocessing operations such as cleaning, denoising and normalization on the data to obtain a standardized data set; determine the outliers and missing values ​​in the data through correlation analysis and statistical tests, and use interpolation, deletion or filling methods to process them; construct a covariance matrix or correlation coefficient matrix based on the preprocessed data, and calculate the correlation and variance between the data; perform eigenvalue decomposition on the covariance matrix to obtain eigenvalues ​​and eigenvectors, and determine the number and direction of principal components; if the eigenvalue is greater than the threshold, the corresponding eigenvector is used as the principal component, and the original data is projected onto the principal component space to achieve data dimensionality reduction; determine the number of principal components to be retained through the contribution rate and cumulative contribution rate of the principal components to ensure that sufficient information is retained while reducing the data dimension; reconstruct and restore the original data based on the retained principal components to obtain a simplified data set for abnormal diagnosis and subsequent analysis and processing to reduce computational complexity.

[0015] In some embodiments, the secondary characteristics of the electric energy index are extracted by statistical analysis method based on the simplified data, including the power factor change rate and the load fluctuation rate. The secondary indicators are used as key features for diagnosing abnormal power consumption, including:

[0016] Obtain simplified electric energy data, including time series data of current, voltage, and power indicators, as input for statistical analysis; calculate the average power factor in each time window through a sliding window algorithm to obtain a time series of power factor; perform first-order difference on the power factor time series, calculate the rate of change between two adjacent time points, and obtain a power factor change rate sequence; if the power factor change rate exceeds a preset threshold, it is judged as a potential power consumption anomaly, and the abnormal time point and change amplitude are recorded; calculate the average load in each time window to obtain a load time series, and then perform first-order difference to obtain a load fluctuation rate sequence; determine the load fluctuation characteristics based on the size and frequency of the load fluctuation rate, and if the fluctuation rate frequently exceeds the threshold, it is judged as a potential power consumption anomaly; use the power factor change rate and load fluctuation rate as secondary features of the electric energy indicator, and input them into the abnormal diagnosis model together with the original indicator to improve the accuracy and reliability of the diagnosis.

[0017] In some embodiments, the cluster analysis algorithm is used to classify the extracted key features to identify different power consumption behavior patterns in the power grid, obtain the results of the cluster analysis, construct a support vector machine model for pattern recognition, and train the support vector machine model to distinguish between normal power consumption behavior and abnormal power consumption behavior, including:

[0018] The secondary features of the electric energy index, including the power factor change rate and the load fluctuation rate, are obtained as the input data for cluster analysis; the K-means clustering algorithm is used to divide the sample points into K clusters according to the Euclidean distance between the feature vectors, and the cluster centers and category labels are obtained; the clustering quality under different K values ​​is evaluated by the elbow rule or the silhouette coefficient method, the optimal number of clusters is determined, and the clustering results are obtained; the samples in each cluster are analyzed, and the characteristics of their power consumption behavior patterns are summarized, including the shape of the load curve and the power factor level, to determine whether it is an abnormal power consumption behavior; the normal power consumption behavior and the abnormal power consumption behavior are labeled according to the clustering results, and a training data set for the support vector machine model is constructed; the Gaussian kernel function is selected as the kernel function of the support vector machine, and the hyperparameters, regularization coefficients or kernel function parameters of the model are optimized through grid search and cross-validation; the support vector machine model is trained using the training data set to obtain the optimal decision boundary, which is used to distinguish normal power consumption behavior from abnormal power consumption behavior, and realize real-time power consumption behavior recognition and abnormal diagnosis.

[0019] In some embodiments, the use of a neural network model to perform deep learning on the pattern recognition results of a support vector machine model, and optimizing the support vector machine model's ability to predict future abnormal events by learning from historical abnormal cases, includes:

[0020] The pattern recognition results of the support vector machine model on historical data, including the predicted category labels and confidence scores, are obtained as the input of the neural network model; a multilayer perceptron neural network (MLP) is used to design the number of neurons and activation functions in the input layer, hidden layer, and output layer, and to construct the architecture of the neural network; supervised learning of the neural network model is performed based on the real labels of historical abnormal cases, and the weights and biases of the neurons are optimized using the back propagation algorithm and the gradient descent method to minimize the prediction error; the training process of the neural network model is controlled through cross-validation and early stopping methods to avoid overfitting and improve the generalization ability of the model; the trained neural network model is integrated with the support vector machine model, and the prediction results of the two models are combined to obtain the final abnormal event recognition result; if the prediction confidence of the neural network model is higher than that of the support vector machine model, the prediction result of the neural network model shall prevail; otherwise, the prediction result of the support vector machine model shall prevail.

[0021] In some embodiments, the decision tree algorithm is used to perform logical judgment and classification on abnormal power consumption behaviors, and output corresponding abnormality handling suggestions and measures according to different abnormality types, including:

[0022] The abnormal power consumption behavior data predicted by the support vector machine model and the neural network model are obtained, and the key features are extracted, including power consumption, current, and voltage indicators, as the input of the decision tree model; the ID3 or C4.5 algorithm is used to select the optimal feature as the root node of the decision tree according to the information gain or information gain rate of the feature, and the child nodes of the decision tree are recursively constructed; in the process of building the decision tree, the depth of the tree and the number of leaf nodes are controlled by pre-pruning or post-pruning methods to avoid overfitting and improve the generalization ability of the model; starting from the root node of the decision tree, the abnormal power consumption behavior is gradually judged and classified according to the characteristic value of each node until the leaf node is reached to obtain the final abnormal type; for each abnormal type, its characteristics and possible causes are summarized, and corresponding abnormal processing suggestions and measures are formulated, including power equipment fault maintenance and power load adjustment; the judgment rules of the decision tree are extracted to form a series of IF-THEN rules to identify and process abnormal power consumption behavior in real time; the decision tree model is regularly updated and optimized, and the tree structure and judgment rules are adjusted according to new abnormal case data to improve the recognition accuracy and processing efficiency of abnormal power consumption behavior.

[0023] In some embodiments, the method of quantifying potential influencing factors of abnormal power consumption by using a regression analysis algorithm, analyzing the causes of abnormal power consumption and assisting in diagnosis and decision-making includes:

[0024] Obtain historical abnormal power consumption data and related influencing factors data, including weather, temperature, humidity, and holidays, clean, convert, and standardize the data, and construct the input data set of the regression analysis model; adopt a multivariate linear regression model, take the abnormal power consumption index as the dependent variable, and the influencing factors as the independent variables, and establish the regression equation y=β0+β1x1+β2x2+...+βnxn+ε, where y is the abnormal power consumption index, x1, x2,..., xn are influencing factors, β0, β1, β2,..., βn are regression coefficients, and ε is a random error term; estimate the regression coefficients by the least squares method to minimize the residual sum of squares Where yi is the actual value, =The predicted value is used to obtain the estimated values ​​of the regression coefficients b0, b1, b2, ..., bn; the determination coefficient R^2 and the adjusted determination coefficient AR^2 of the regression model are calculated to evaluate the goodness of fit and explanatory power of the model, R^2 = (SSR / SST), where SSR is the regression sum of squares and SST is the total sum of squares; the regression coefficients are subjected to t-test and F-test to determine the significance level of the influencing factors on the abnormal power consumption index, with the confidence level set to 95%. If the p-value is less than 0.05, it is considered that the influencing factors have a significant impact on the abnormal power consumption index; according to the sign and size of the regression coefficient, the direction and degree of the impact of the influencing factors on the abnormal power consumption index are explained, a positive value indicates a positive correlation, a negative value indicates a negative correlation, and a larger absolute value indicates a stronger impact; the results of the regression analysis are applied to the diagnosis and decision-making of abnormal power consumption, and targeted prevention and treatment measures are taken for the factors that significantly affect abnormal power consumption, such as adjusting the power load and optimizing the power consumption period, to assist in the identification and diagnosis of abnormal power consumption;

[0025] It also includes: regularly mining the potential relationships between electricity usage behaviors through association rule algorithms to provide data support for abnormal electricity usage diagnosis.

[0026] The potential relationship between electricity consumption behaviors is mined regularly through association rule algorithms to provide data support for abnormal electricity consumption diagnosis, specifically including:

[0027] Obtain historical electricity consumption behavior data, including electricity consumption time, location, equipment, and electricity attributes, clean, transform, and integrate the data, and construct a transaction data set for association rule mining. Use the Apriori or FP-growth algorithm to scan the transaction data set, determine frequent 1-item sets, frequent 2-item sets, and frequent 3-item sets based on the minimum support threshold, and obtain all frequent patterns. For each frequent pattern, generate association rules based on the minimum confidence threshold, such as {electricity consumption time = night, power equipment = air conditioning} => {electricity consumption = high}, indicating that when air conditioning is used at night, electricity consumption is often high. Calculate the support and confidence of each association rule, support = rule support count / total number of transactions, confidence = rule support count / left frequent pattern support count, to measure the importance and reliability of the rule. According to the evaluation indicators of the association rules, including promotion and utilization, sort and filter the rules to obtain strong association rules, revealing the potential relationship and pattern between electricity consumption behaviors. Association rules are applied to abnormal power consumption diagnosis. If certain power consumption behaviors are found to co-occur frequently, but the actual data does not conform to the rules, it is determined to be abnormal power consumption and further analysis of the cause is required.

[0028] The technical solution provided by the embodiment of the present invention may have the following beneficial effects:

[0029] The present invention discloses a method for diagnosing abnormal electricity consumption based on multivariate composite features and collaborative machine learning. The present invention can effectively process and analyze electric energy data in a power grid, simplify the data analysis process, identify and classify electricity consumption behavior patterns, improve the diagnostic accuracy of abnormal electricity consumption behavior, optimize the ability to predict potential abnormal events in the future, and assist in formulating targeted abnormal processing suggestions and measures, enhance the stability and safety of power grid operation, improve the efficiency of power grid operation, reduce operation and maintenance costs, and provide technical support for the intelligent and automated management of power grids in the future. In addition, the present invention uses a decision tree algorithm to perform logical judgment and classification on abnormal electricity consumption behaviors, and outputs corresponding processing suggestions and measures for different abnormal types. At the same time, the potential influencing factors of abnormal electricity consumption are quantitatively analyzed through a regression analysis algorithm to help understand the causes of abnormal electricity consumption and assist in diagnostic decisions. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] Figure 1 The present invention is a flow chart of a method for diagnosing abnormal electricity consumption based on multi-component composite features and collaborative machine learning.

[0031] Figure 2 A schematic diagram of a method for diagnosing abnormal electricity consumption based on multi-component composite features and collaborative machine learning of the present invention.

[0032] Figure 3 This is another schematic diagram of the abnormal power consumption diagnosis method based on multi-component composite features and collaborative machine learning of the present invention. DETAILED DESCRIPTION

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

[0034] like Figure 1-3 In this embodiment, a method for diagnosing abnormal power consumption by using multi-component composite features and collaborative machine learning may specifically include:

[0035] Step S101, obtain the structured power indicators of current, voltage, power, frequency and temperature in the power grid and the unstructured information of equipment logs and operation records and store them in a data warehouse in a time series manner.

[0036] Sensors and data acquisition equipment are used to obtain structured power indicators such as current, voltage, power, frequency and temperature in the power grid to obtain real-time power data. Log collection tools are used to obtain unstructured information of equipment logs and operation records to determine the equipment operation status and operation history. If the power indicator data and unstructured information are collected, they are organized and stored in a time series manner to form time series data. According to the characteristics of time series data, time series databases or time series databases are used for storage to ensure efficient access and query of data. If the amount of data is greater than the preset threshold, a distributed database is used for storage, and data storage and query efficiency are improved through data sharding and parallel processing. Time series data is imported into the data warehouse, and the data is modeled and organized according to the architecture and design of the data warehouse to form a structured data model. The data is cleaned, converted and loaded through ETL (data extraction, transformation, loading) tools to ensure the quality and consistency of the data and prepare for subsequent data analysis and mining.

[0037] Specifically, in the power grid system, smart meters and sensors can be used to collect power indicators such as current, voltage, power, frequency, and temperature. For example, smart meters collect data every 5 minutes, with a current range of 0-100A, a voltage range of 0-220V, a power range of 0-22kW, a frequency of 50Hz, and a temperature range of -20℃ to 80℃. Through log collection tools such as Fluentd or Logstash, device logs and operation records such as circuit breaker status changes and equipment failure alarms can be collected. These unstructured data can be stored in time series together with power indicator data to form a complete historical data record. Considering the high concurrent writing and query requirements of power system data, time series databases such as InfluxDB or OpenTSDB can be selected for storage. These databases support efficient time series data writing and aggregate query, and are suitable for processing large-scale power grid monitoring data. If the amount of data is extremely large, a distributed time series database such as Druid or TimescaleDB can be used to improve performance through data sharding and parallel query. The data can be sharded according to the time range and device ID. Each shard stores one month's data. Different shards can be distributed on different nodes to achieve horizontal expansion. In order to facilitate data analysis and mining, time series data needs to be imported into the data warehouse. ETL tools such as Apache NiFi or Kettle can be used to extract data from the time series database, clean, transform and load it, and finally store it in the data warehouse. The data cleaning process includes deduplication, filling missing values, and outlier processing to ensure the accuracy and consistency of the data. The data conversion process maps the original data to the target table structure of the data warehouse, such as converting the timestamp to date format and normalizing the numeric data to between 0 and 1. The converted data is written into the fact table and dimension table of the data warehouse by batch loading or incremental loading to form a star or snowflake data model. The power indicator data can be stored in the "meter reading" fact table, including fields such as timestamp, meter ID, current, voltage, power, frequency and temperature. At the same time, dimension tables such as "electricity meter", "substation", and "power supply area" are created to store the attribute information of electricity meter, substation, and power supply area respectively. By setting foreign keys in the fact table and associating them with each dimension table, multi-dimensional data analysis can be achieved. The average voltage and maximum current of each substation can be counted, or the power consumption trend of different power supply areas can be analyzed.

[0038] Step S102, after preprocessing the data, principal component analysis is used to simplify the data, retaining information related to abnormal diagnosis and reducing the computational complexity of subsequent processing.

[0039] Obtain the original data, perform cleaning, denoising and normalization preprocessing operations on the data to obtain a standardized data set. Through correlation analysis and statistical tests, determine the outliers and missing values ​​in the data, and use interpolation, deletion or filling methods to process them. Based on the preprocessed data, construct a covariance matrix or correlation coefficient matrix to calculate the correlation and variance between the data. Perform eigenvalue decomposition on the covariance matrix to obtain eigenvalues ​​and eigenvectors, and determine the number and direction of the principal components. If the eigenvalue is greater than the threshold, the corresponding eigenvector is used as the principal component, and the original data is projected onto the principal component space to achieve data dimensionality reduction. The number of principal components retained is determined by the contribution rate and cumulative contribution rate of the principal component to ensure that sufficient information is retained while reducing the data dimension. Based on the retained principal components, the original data is reconstructed and restored to obtain a simplified data set for abnormal diagnosis and subsequent analysis and processing to reduce computational complexity.

[0040] Specifically, there is a monitoring data set of industrial equipment, including multiple variables such as temperature, pressure, flow, vibration, etc., with a total of 1000 samples. The data is preprocessed and converted into a distribution with a mean of 0 and a standard deviation of 1 through Z-score standardization. The formula is z = (x-μ) / σ, where x is the original data, μ is the mean, and σ is the standard deviation. The Cooley-Tukey Algorithm is used to detect outliers for each variable, and the data that exceeds 1.5 times the interquartile range of the upper and lower quartiles are marked as outliers and replaced with the median. The Pearson correlation coefficient matrix R between the variables is calculated, where the element r_ij in the i-th row and j-th column represents the correlation coefficient between the i-th variable and the j-th variable, and the value range is [-1,1]. The correlation coefficient matrix is ​​decomposed by eigenvalue to obtain the eigenvalues ​​λ_1≥λ_2≥...≥λ_p and the corresponding eigenvectors v_1,v_2,...,v_p, where p is the number of variables. Select the first k principal components according to the size of the eigenvalue, usually requiring the cumulative contribution rate

[0041] ∑_{i=1}^kλ_i / ∑_{i=1}^pλ_i reaches more than 80%. If the cumulative contribution rate of the first three eigenvalues ​​exceeds 80%, only the first three principal components need to be retained. Multiply the original data X(1000p) by the transpose of the eigenvector matrix V(pk) to obtain the principal component score matrix Z(1000k), that is, Z=XV^T. The principal component score reflects the projection length of the original data in the principal component direction and can be used for subsequent abnormal diagnosis and fault analysis. The original data can be reconstructed according to the principal component score, and the formula is X'=ZV, where X' is the reconstructed data matrix. The reconstruction error can be used to evaluate the effect of principal component analysis. The smaller the error, the more the retained principal component can represent the characteristics of the original data. Simplifying the original 1000p-dimensional data into 1000*k-dimensional principal component scores greatly reduces the dimension and computational complexity of the data while retaining most of the useful information.

[0042] Step S103, based on the simplified data, secondary features of the electric energy index are extracted by statistical analysis method, including the power factor change rate and the load fluctuation rate, and the secondary index is used as the key feature for diagnosing abnormal power consumption.

[0043] Obtain simplified electric energy data, including time series data of current, voltage, and power indicators, as input for statistical analysis. Calculate the average power factor in each time window through the sliding window algorithm to obtain the time series of power factor. Perform first-order difference on the power factor time series, calculate the rate of change between two adjacent time points, and obtain the power factor change rate sequence. If the power factor change rate exceeds the preset threshold, it is judged as a potential power consumption anomaly, and the abnormal time point and change amplitude are recorded. Calculate the average load in each time window to obtain the load time series, and then perform first-order difference to obtain the load fluctuation rate sequence. Determine the fluctuation characteristics of the load according to the size and frequency of the load fluctuation rate. If the fluctuation rate frequently exceeds the threshold, it is judged as a potential power consumption anomaly. The power factor change rate and load fluctuation rate are used as secondary features of the electric energy indicators and input into the abnormal diagnosis model together with the original indicators to improve the accuracy and reliability of the diagnosis.

[0044] Specifically, the simplified electric energy data includes indicators such as current, voltage, and power. The time granularity is 1 minute and the data length is 1000 points. Use a sliding window with a length of 10 to calculate the average power factor in each window. The power factor is equal to the ratio of active power to apparent power, and the formula is PF=P / S, where P is active power and S is apparent power. Apparent power can be calculated from current and voltage using the formula S=UI, where U is the effective value of voltage and I is the effective value of current. The power factor time series PF_t is calculated using the sliding window method, where t=1, 2,..., 990. Next, perform a first-order difference on PF_t to calculate the rate of change between two adjacent time points. The formula is:

[0045] ΔPF_t=(PF_{t+1}-PF_t) / PF_t,t=1,2,...,989. If ΔPF_t exceeds the threshold of 0.05, then the time point t+1 is judged as a potential power consumption anomaly, and the timestamp and change rate of the anomaly are recorded. If at t=100, PF_100=0.95, PF_101=0.90, then

[0046] ΔPF_100=(0.90-0.95) / 0.95≈-0.053, exceeding the threshold, t=101 is judged as an abnormal point. For the calculation of load fluctuation rate, a similar sliding window method can be used. Calculate the average load L_t in each window, t=1,2,...,990, and then perform a first-order difference to obtain the load fluctuation rate ΔL_t=(L_{t+1}-L_t) / L_t, t=1,2,...,989. If ΔL_t frequently exceeds the threshold of 0.1, it is judged that the load fluctuation in this time period is abnormal. If there are more than 5 time points with ΔL_t greater than 0.1 in the interval from t=200 to t=220, it is judged that the load fluctuation in this interval is abnormal. The power factor change rate ΔPF_t and the load fluctuation rate ΔL_t are used as secondary features of the electric energy index and input into the abnormal diagnosis model together with the original current, voltage, power and other indicators. The abnormal diagnosis model can use statistical methods, such as the three-sigma criterion or Mahalanobis distance, or machine learning methods, such as support vector machines or anomaly forest algorithms. Taking the three-sigma criterion as an example, ΔPF_t obeys the normal distribution N(μ,σ^2), where μ is the mean and σ is the standard deviation. If the ΔPF_t at a certain time point t exceeds the range of μ±3σ, that is, |ΔPF_t-μ|>3σ, then the time point is judged to be abnormal. The Mahalanobis distance takes into account the correlation between multiple indicators and calculates the normalized distance from the observation point to the distribution center. The larger the distance, the higher the degree of abnormality. By comprehensively considering the original values ​​and secondary features of multiple indicators, the abnormal pattern of electricity consumption behavior can be more comprehensively characterized, and the accuracy and reliability of diagnosis can be improved.

[0047] Step S104, using a cluster analysis algorithm to classify the extracted key features to identify different electricity consumption behavior patterns in the power grid, obtain the results of the cluster analysis, build a support vector machine model for pattern recognition, and train the support vector machine model to distinguish normal electricity consumption behavior from abnormal electricity consumption behavior.

[0048] The secondary features of the electric energy index, including the power factor change rate and the load fluctuation rate, are obtained as the input data for cluster analysis. The K-means clustering algorithm is used to divide the sample points into K clusters according to the Euclidean distance between the feature vectors, and the cluster centers and category labels are obtained. The clustering quality under different K values ​​is evaluated by the elbow rule or the silhouette coefficient method, and the optimal number of clusters is determined to obtain the clustering results. The samples in each cluster are analyzed to summarize the characteristics of their power consumption behavior patterns, including the shape of the load curve and the power factor level, and to determine whether they are abnormal power consumption behaviors. According to the clustering results, normal power consumption behaviors and abnormal power consumption behaviors are labeled, and a training data set for the support vector machine model is constructed. The Gaussian kernel function is selected as the kernel function of the support vector machine, and the model hyperparameters, regularization coefficients or kernel function parameters are optimized through grid search and cross-validation. The support vector machine model is trained using the training data set to obtain the optimal decision boundary, which is used to distinguish normal power consumption behaviors from abnormal power consumption behaviors, and to achieve real-time power consumption behavior recognition and abnormal diagnosis.

[0049] Specifically, key features such as power factor change rate, load fluctuation rate, harmonic distortion rate, etc. are selected from the secondary features of the electric energy indicators to form an N-dimensional feature vector as the input of cluster analysis. There are 1000 samples in total, each containing 10 features, forming a 1000*10 data matrix X. The K-means clustering algorithm is used to randomly select K samples as the initial cluster centers, calculate the Euclidean distance between each sample and the cluster center, and divide the samples into the clusters with the closest distance. The Euclidean distance formula is d(x,y)=√(∑_{i=1}^n(x_i-y_i)^2), where x and y are two n-dimensional feature vectors. The cluster centers and cluster labels of the samples are iteratively updated until the clustering results converge or the maximum number of iterations is reached. When K=3, three clusters may be obtained, representing the power consumption modes of high load, low load, and normal load, respectively. In order to determine the optimal number of clusters, clustering quality indicators such as silhouette coefficient can be calculated under different K values. The value range of the silhouette coefficient is [-1,1]. The closer it is to 1, the better the clustering effect. For the i-th sample, its silhouette coefficient s_i = (b_i-a_i) / max(a_i,b_i), where a_i is the average distance between sample i and other samples in the same cluster, and b_i is the average distance between sample i and the samples in the nearest other clusters. By comparing the average silhouette coefficients under different K values, the K value with the largest coefficient is selected as the optimal number of clusters. When K = 2, the average silhouette coefficient is 0.6; when K = 3, the average silhouette coefficient is 0.8; when K = 4, the average silhouette coefficient is 0.7, then K = 3 is selected as the optimal number of clusters. According to the clustering results, the samples in each cluster are analyzed to extract the common characteristics of their electricity consumption behavior patterns. For high-load clusters, their load curves may present a bimodal shape with morning and evening peaks, with an average load level higher than 100kW and a peak-to-valley difference greater than 50kW; for low-load clusters, their load curves may be relatively flat, with an average load level lower than 50kW and a peak-to-valley difference less than 20kW; for normal-load clusters, their load curves may present a unimodal shape, with an average load level between 50-100kW and a peak-to-valley difference between 20-50kW. Based on business knowledge and expert experience, high-load and low-load clusters are judged as potential abnormal power consumption behaviors, and normal load clusters are judged as normal power consumption behaviors, and the sample data are labeled. Using the labeled sample data, a support vector machine model is constructed to identify power consumption behaviors. The goal of the support vector machine is to find a maximum margin hyperplane in the feature space to separate samples of different categories. Using the Gaussian kernel function, the samples are mapped from the original space to the high-dimensional feature space, and the linear decision boundary is found in the high-dimensional space. By minimizing the objective function

[0050] ∑_{i=1}^nmax(0,1-y_i(w·x_i+b))+λ||w||^2, solve for the optimal hyperplane parameters w and b, where x_i is the feature vector of the i-th sample, y_i∈{-1,1} is the class label of the sample, and λ is the regularization coefficient. Use grid search and 5-fold cross validation to optimize the regularization coefficient λ and the Gaussian kernel function parameter σ to obtain the support vector machine model with the best performance. Apply the trained model to new sample data, and determine the power consumption behavior category to which the sample belongs based on the distance between the feature vector and the hyperplane, so as to achieve real-time power consumption behavior recognition and abnormal diagnosis.

[0051] Step S105, using the neural network model to perform deep learning on the pattern recognition results of the support vector machine model, and optimizing the support vector machine model's prediction ability for future abnormal events by learning from historical abnormal cases.

[0052] Obtain the pattern recognition results of the support vector machine model on historical data, including the predicted category label and confidence score, as the input of the neural network model. Use a multilayer perceptron neural network (MLP) to design the number of neurons and activation functions in the input layer, hidden layer, and output layer, and build the architecture of the neural network. According to the real labels of historical abnormal cases, supervise the neural network model, and use the back propagation algorithm and gradient descent method to optimize the weights and biases of neurons to minimize the prediction error. Through cross-validation and early stopping methods, control the training process of the neural network model to avoid overfitting and improve the generalization ability of the model. Integrate the trained neural network model with the support vector machine model, and combine the prediction results of the two models to obtain the final abnormal event recognition result. If the prediction confidence of the neural network model is higher than that of the support vector machine model, the prediction result of the neural network model shall prevail; otherwise, the prediction result of the support vector machine model shall prevail.

[0053] Specifically, for the pattern recognition results of the support vector machine model on historical data, there are 10,000 samples in total, each of which contains 10 features and 1 category label (normal or abnormal), as well as the confidence score given by the support vector machine model (a real number between 0 and 1). These data are used as the input of the neural network model to construct a three-layer MLP network. The input layer contains 10 neurons corresponding to the features of the sample; the hidden layer contains 20 neurons, using the ReLU activation function; the output layer contains 1 neuron, using the Sigmoid activation function, and predicts the probability that the sample belongs to the abnormal category. The network parameters include the weight matrix W1 (1020) and bias vector b1 (201) from the input layer to the hidden layer, and the weight matrix W2 (201) and bias vector b2 (11) from the hidden layer to the output layer. The forward propagation process is: h = ReLU (x·W1+b1), y = Sigmoid (h·W2+b2), where x is the input feature vector, h is the hidden layer output, and y is the predicted probability. Use the binary cross entropy loss function L(y,t)=-, where t is the true label (0 or 1), y is the predicted probability, calculate the gradient of the loss function with respect to the network parameters, use the stochastic gradient descent method to update the parameters, set the learning rate to 0.01, the batch size to 100, and iterate 1000 times. Evaluate the model performance on the validation set every 100 iterations. If the loss function value on the validation set does not decrease after 5 consecutive iterations, stop training in advance to avoid overfitting. Integrate the trained MLP network with the support vector machine model to predict new sample data. The support vector machine model predicts that a sample is an abnormal category with a confidence score of 0.6; the MLP network predicts that the probability of the sample being an abnormal category is 0.8. Since the prediction confidence of the MLP network is higher than that of the support vector machine model, the sample is finally determined to be an abnormal category. For another sample, the support vector machine model predicts that it is a normal category with a confidence score of 0.9; the MLP network predicts that it is an abnormal category with a probability of 0.4. Since the prediction confidence of the support vector machine model is higher, the sample is finally determined to be in the normal category. Continuously collect and update historical abnormal case data, such as adding 1,000 labeled samples every month, adding them to the original training set, retraining the MLP network, and optimizing network parameters. At the same time, you can also try different network architectures and hyperparameter settings, such as increasing the number of hidden layers and neurons, adjusting the learning rate and regularization coefficient, etc., and find the model with the best performance through grid search and cross-validation.

[0054] Step S106, using a decision tree algorithm to perform logical judgment and classification on abnormal power consumption behaviors, and output corresponding abnormality handling suggestions and measures according to different abnormality types.

[0055] The abnormal power consumption behavior data predicted by the support vector machine model and the neural network model are obtained, and the key features are extracted, including power consumption, current, and voltage indicators, as the input of the decision tree model. The ID3 or C4.5 algorithm is used to select the optimal feature as the root node of the decision tree according to the information gain or information gain rate of the feature, and the child nodes of the decision tree are recursively constructed. In the process of building the decision tree, the depth of the tree and the number of leaf nodes are controlled by pre-pruning or post-pruning methods to avoid overfitting and improve the generalization ability of the model. Starting from the root node of the decision tree, the abnormal power consumption behavior is gradually judged and classified according to the characteristic value of each node until the leaf node is reached to obtain the final abnormal type. For each abnormal type, its characteristics and possible causes are summarized, and corresponding abnormal handling suggestions and measures are formulated, including fault inspection and repair of power equipment and power load adjustment. The judgment rules of the decision tree are extracted to form a series of IF-THEN rules to identify and handle abnormal power consumption behavior in real time. Regularly update and optimize the decision tree model, adjust the tree structure and judgment rules according to new abnormal case data, and improve the recognition accuracy and processing efficiency of abnormal power consumption behavior.

[0056] Specifically, from the abnormal power consumption behavior data predicted by the support vector machine and neural network model, key features such as power consumption, current, voltage, and power factor are extracted to construct the training set of the decision tree model. The power consumption of a residential user is 800 degrees, the current is 150 amperes, the voltage is 220 volts, and the power factor is 0.5, which is judged as abnormal power consumption behavior. These features are used as the input attributes of the decision tree, and the abnormal type is used as the target attribute. There are 10,000 samples in total. The C4.5 algorithm is used to calculate the information gain rate of each attribute, such as the information gain rate of power consumption is 0.8, the information gain rate of current is 0.6, the information gain rate of voltage is 0.2, and the information gain rate of power factor is 0.4. The power consumption with the largest information gain rate is selected as the root node, and the sample set is divided into two subsets: the sample set with power consumption>500 and the sample set with power consumption≤500. For the subset with power consumption>500, continue to select the attribute with the largest information gain rate as the child node, and recursively construct the decision tree until all samples belong to the same category or cannot be divided any further. In the process of decision tree construction, the minimum number of samples of leaf nodes is set to 100 to avoid overfitting. For the case where the number of samples in the leaf nodes exceeds 100 but is impure, post-pruning is performed to merge them into the parent node to reduce the complexity of the tree. A decision tree is obtained, which contains 8 leaf nodes, corresponding to 8 types of abnormal power consumption behaviors, such as equipment failure, power reverse flow, voltage abnormality, etc. For each abnormal type, its characteristics and causes are analyzed, and treatment suggestions and measures are formulated. For the equipment failure type, it is recommended to check the operating status of the power-consuming equipment and repair or replace the faulty equipment in time; for the power reverse flow type, it is recommended to check whether the meter wiring is correct and check for power theft; for the voltage abnormal type, it is recommended to check the operating status of the power supply line and transformer and adjust the power supply voltage. The judgment rules of the decision tree are extracted into IF-THEN form, such as "IF power consumption>800AND current>100THEN abnormal type=equipment failure". For the new power consumption behavior data, starting from the root node, judgment is made according to the attribute value, and the decision tree is recursively traversed until the leaf node is reached to obtain the abnormal type. A user's electricity consumption is 900 kWh, the current is 120 amperes, the voltage is 220 volts, and the power factor is 0.6. According to the judgment rules of the decision tree, the abnormal type of this user is equipment failure. According to the abnormal type, the corresponding processing suggestions and measures are output, such as "it is recommended to check the operating status of the electrical equipment and repair or replace the faulty equipment in time." Regularly collect new abnormal electricity consumption behavior data, update the decision tree model, recalculate the information gain rate of the attribute, adjust the tree structure and judgment rules, and improve the accuracy of abnormal identification and processing. At the same time, you can also try other decision tree algorithms, such as random forest, GBDT, etc., to improve the robustness and generalization ability of the model through ensemble learning.

[0057] Step S107, quantifying potential influencing factors of abnormal power consumption through regression analysis algorithm, analyzing the causes of abnormal power consumption and assisting in diagnosis and decision-making.

[0058] Obtain historical abnormal power consumption data and related influencing factors data, including weather, temperature, humidity, and holidays, clean, convert, and standardize the data, and construct the input data set for the regression analysis model. Use a multivariate linear regression model, take the abnormal power consumption index as the dependent variable, and the influencing factors as the independent variables, and establish the regression equation y=β0+β1x1+β2x2+...+βnxn+ε, where y is the abnormal power consumption index, x1, x2,..., xn are influencing factors, β0, β1, β2,..., βn are regression coefficients, and ε is a random error term. Estimate the regression coefficients using the least squares method to minimize the residual sum of squares. Where yi is the actual value, As the predicted value, the estimated values ​​of the regression coefficients b0, b1, b2, ..., bn are obtained. The determination coefficient R^2 and the adjusted determination coefficient AR^2 of the regression model are calculated to evaluate the goodness of fit and explanatory power of the model. R^2 = (SSR / SST), where SSR is the regression sum of squares and SST is the total sum of squares. The regression coefficients are subjected to t-test and F-test to determine the significance level of the influencing factors on the abnormal power consumption index. The confidence level is set to 95%. If the p-value is less than 0.05, it is considered that the influencing factors have a significant impact on the abnormal power consumption index. According to the sign and size of the regression coefficient, the direction and degree of the influence of the influencing factors on the abnormal power consumption index are explained. A positive value indicates a positive correlation, a negative value indicates a negative correlation, and a larger absolute value indicates a stronger impact. The results of the regression analysis are applied to the diagnosis and decision-making of abnormal power consumption. For the factors that significantly affect abnormal power consumption, targeted prevention and treatment measures are taken to adjust the power load, optimize the power consumption period, and assist in the identification and diagnosis of abnormal power consumption.

[0059] Specifically, from the historical abnormal electricity consumption data, extract abnormal electricity consumption indicators, such as average electricity consumption, peak electricity consumption, valley electricity consumption, etc., as well as potential influencing factors, such as average daily temperature, average daily humidity, whether it is a holiday, etc. Preprocess the data, such as removing missing values ​​and outliers, normalizing continuous variables, and encoding discrete variables as dummy variables. Construct a multivariate linear regression model, such as average electricity consumption = β0 + β1 average daily temperature + β2 average daily humidity + β3 * whether it is a holiday + ε, where average electricity consumption is the dependent variable, average daily temperature, average daily humidity, whether it is a holiday are independent variables, β0 is the intercept term, β1, β2, β3 are regression coefficients, and ε is the random error term. Use the least squares method to estimate the regression coefficient. For example, for a data set with a sample size of 1000, the estimated values ​​of the regression coefficients are b0=50, b1=2.5, b2=-1.8, and b3=10. Then the regression equation is average power consumption=50+2.5 average daily temperature-1.8 average daily humidity+10*whether it is a holiday. Calculate the coefficient of determination R^2 and the adjusted coefficient of determination AR^2 of the regression model. If R^2=0.8, it means that the regression model can explain 80% of the variation of the dependent variable, and the goodness of fit is good;

[0060] AR^2=0.78, taking into account the influence of the number of independent variables, it is more robust. Perform hypothesis tests on the regression coefficients, such as performing a t test on b1, assuming H0:β1=0, H1:β1≠0, significance level α=0.05, degrees of freedom are 996, and the critical value t is 0.025=1.96 from the t distribution table. If |t|>1.96, the null hypothesis is rejected, and it is believed that the average daily temperature has a significant effect on the average electricity consumption. Similarly, a t test is performed on b2 and b3 to determine their significance. Perform an F test on the entire regression model, assuming H0:β1=β2=β3=0, H1: at least one βi≠0, significance level α=0.05, degrees of freedom are (3,996), and the critical value F0.05=2.60 from the F distribution table. If F>2.60, the null hypothesis is rejected, and the regression model is considered to be significant overall. According to the sign and size of the regression coefficient, explain the impact of the independent variable on the dependent variable. For example, b1=2.5>0, it means that the average daily temperature is positively correlated with the average electricity consumption. For every 1°C increase in the average daily temperature, the average electricity consumption increases by 2.5 degrees; b2=-1.8<0, it means that the average daily humidity is negatively correlated with the average electricity consumption. For every 1% increase in the average daily humidity, the average electricity consumption decreases by 1.8 degrees; b3=10>0, it means that the average electricity consumption on holidays is 10 degrees higher than that on non-holidays. The results of regression analysis are used for the diagnosis and prediction of abnormal electricity consumption. If the average daily temperature on a certain day is 30°C and the average daily humidity is 60%, and it is a holiday, then the average electricity consumption is predicted.

[0061] =50+2.530-1.860+10*1=76 degrees. If the actual average power consumption is 100 degrees, which is much higher than the predicted value, it is judged as abnormal power consumption, and it is necessary to analyze the reasons and take measures. For example, if the power consumption during holidays is significantly higher than the predicted value, it may be caused by factors such as the gathering of people and the increase in entertainment activities. It is necessary to strengthen power management and safety inspection. For another example, the regression coefficient shows that the average daily temperature has the greatest impact on power consumption. We can focus on monitoring power consumption in high temperature weather, predict peak power consumption, allocate power resources in advance, and avoid problems such as line overload and equipment damage caused by abnormal power consumption. At the same time, nonlinear regression models of temperature and power consumption, such as quadratic functions and logarithmic functions, can also be established to capture more complex relationships and improve prediction accuracy.

[0062] The potential relationship between electricity consumption behaviors is regularly mined through association rule algorithms to provide data support for abnormal electricity consumption diagnosis.

[0063] Obtain historical electricity consumption behavior data, including electricity consumption time, location, equipment, and electricity attributes, clean, transform, and integrate the data, and construct a transaction data set for association rule mining. Use the Apriori or FP-growth algorithm to scan the transaction data set, determine frequent 1-item sets, frequent 2-item sets, and frequent 3-item sets based on the minimum support threshold, and obtain all frequent patterns. For each frequent pattern, generate association rules based on the minimum confidence threshold, such as {electricity consumption time = night, power equipment = air conditioning} => {electricity consumption = high}, indicating that when air conditioning is used at night, electricity consumption is often high. Calculate the support and confidence of each association rule, support = rule support count / total number of transactions, confidence = rule support count / left frequent pattern support count, to measure the importance and reliability of the rule. According to the evaluation indicators of the association rules, including promotion and utilization, sort and filter the rules to obtain strong association rules, revealing the potential relationship and pattern between electricity consumption behaviors. Association rules are applied to abnormal power consumption diagnosis. If certain power consumption behaviors are found to co-occur frequently, but the actual data does not conform to the rules, it is determined to be abnormal power consumption and further analysis of the cause is required.

[0064] Specifically, from the massive historical electricity consumption behavior data, attributes such as electricity consumption time, location, equipment, and electricity consumption are extracted to construct a transaction data set. For example, each transaction record contains attribute values ​​such as {electricity consumption time = night, electricity consumption location = residential, electricity consumption equipment = air conditioning, electricity consumption = high}. The transaction data set is preprocessed, such as discretizing continuous attributes, filling missing values, and removing noise data to ensure data quality. The Apriori algorithm is used, and the minimum support is set to 10%. The transaction data set is scanned to generate frequent item sets. For example, the frequent 1-item set is {{electricity consumption time = night}: 50%, {electricity consumption equipment = air conditioning}: 40%, {electricity consumption = high}: 30%}, the frequent 2-item set is {{electricity consumption time = night, electricity consumption equipment = air conditioning}: 20%, {electricity consumption equipment = air conditioning, electricity consumption = high}: 15%}, and the frequent 3-item set is {{electricity consumption time = night, electricity consumption equipment = air conditioning, electricity consumption = high}: 10%}. Generate association rules based on frequent item sets, and set the minimum confidence level to 60%. Generate association rules {Electricity time = night, electrical equipment = air conditioner, power consumption = high} from frequent item sets {Electricity time = night, electrical equipment = air conditioner} => {power consumption = high}, with support level = 10% and confidence level

[0065] =10% / 20%=50%, which does not meet the minimum confidence requirement, so the rule is discarded. However, the support of the association rule {electrical equipment = air conditioner}=>{power consumption = high}=15%, and the confidence=15% / 40%=37.5%, which meet the requirements, so the rule is retained. Calculate the evaluation indicators of the association rules, such as lift=rule confidence / consequent support, and utilization=rule support / precursor support. The lift of the rule {electrical equipment = air conditioner}=>{power consumption = high}=37.5% / 30%=1.25, which means that the probability of high power consumption when using air conditioner is 1.25 times the average level; utilization=15% / 40%=0.375, which means that among users who use air conditioner, 37.5% of the power consumption is high. Sort and filter the association rules according to the evaluation indicators to obtain strong association rules, revealing the association pattern between power consumption behaviors. Apply association rules to abnormal electricity consumption diagnosis. For example, if a user is found to frequently use high-power electrical appliances at night, but the actual electricity consumption is lower than the rule prediction value, it is judged as abnormal electricity consumption behavior, and the reasons need to be analyzed, such as meter failure, electricity theft, etc. For another example, if it is found that users in a certain area generally have abnormally high electricity consumption in summer, but the association rules show that users in this area rarely use air conditioners, there may be illegal electricity consumption behavior, which requires on-site inspection. Update association rules regularly, such as conducting data mining once a month to discover new electricity consumption patterns and abnormal behaviors. At the same time, association rules can also be combined with other data analysis methods, such as cluster analysis and predictive analysis, to explore the characteristics and laws of electricity consumption behavior from multiple angles, and provide more comprehensive and accurate data support for abnormal electricity consumption diagnosis.

[0066] Based on the above embodiments of the present invention, relevant personnel can make various changes and modifications without departing from the technical concept of the present invention through the above description. The technical scope of the present invention is not limited to the content in the specification, and its technical scope must be determined according to the scope of the claims.

Claims

1. A method for diagnosing abnormal power consumption based on multi-component composite features and collaborative machine learning, characterized in that: The method comprises: Obtain structured power indicators such as current, voltage, power, frequency and temperature in the power grid, as well as unstructured information such as equipment logs and operation records, and store them in a data warehouse in a time series format; After preprocessing the data, principal component analysis was used to simplify the data, retaining information relevant to abnormal diagnosis while reducing the computational complexity of subsequent processing; Based on the simplified data, the secondary characteristics of the power indicators are extracted through statistical analysis methods, including the power factor change rate and the load fluctuation rate. The secondary indicators are used as key features for diagnosing abnormal power consumption. The extracted key features are classified using a cluster analysis algorithm to identify different electricity consumption behavior patterns in the power grid, the results of the cluster analysis are obtained, a support vector machine model is constructed for pattern recognition, and the support vector machine model is trained to distinguish between normal and abnormal electricity consumption behaviors; Use the neural network model to conduct deep learning on the pattern recognition results of the support vector machine model, and optimize the support vector machine model's ability to predict future abnormal events by learning from historical abnormal cases; Use decision tree algorithm to make logical judgments and classifications on abnormal power consumption behaviors, and output corresponding abnormal handling suggestions and measures according to different abnormal types; The potential influencing factors of abnormal power consumption are quantified through regression analysis algorithms, the causes of abnormal power consumption are analyzed, and diagnostic decisions are assisted.

2. The method according to claim 1, wherein: The method of obtaining structured electric energy indicators of current, voltage, power, frequency and temperature in the power grid and unstructured information of equipment logs and operation records and storing them in a data warehouse in a time series manner includes: Use sensors and data acquisition equipment to obtain structured power indicators such as current, voltage, power, frequency and temperature in the power grid to obtain real-time power data; Obtain unstructured information of device logs and operation records through log collection tools to determine the device operating status and operation history; If the power index data and unstructured information are collected, they are organized and stored in a time series manner to form time series data; According to the characteristics of time series data, time series database or temporal database is used for storage to ensure efficient access and query of data; If the amount of data is greater than the preset threshold, a distributed database is used for storage, and data storage and query efficiency are improved through data sharding and parallel processing; Import time series data into the data warehouse, model and organize the data according to the architecture and design of the data warehouse to form a structured data model; Use ETL (data extraction, transformation, loading) tools to clean, transform and load data to ensure data quality and consistency, and prepare for subsequent data analysis and mining.

3. The method according to claim 1, wherein: After the data is preprocessed, principal component analysis is used to simplify the data, retain information related to abnormal diagnosis, and reduce the computational complexity of subsequent processing, including: Obtain the original data, perform cleaning, denoising and normalization preprocessing operations on the data to obtain a standardized data set; Through correlation analysis and statistical tests, outliers and missing values ​​in the data are identified and processed using interpolation and deletion or filling methods; According to the preprocessed data, a covariance matrix or a correlation coefficient matrix is ​​constructed to calculate the correlation and variance between the data; Perform eigenvalue decomposition on the covariance matrix to obtain eigenvalues ​​and eigenvectors, and determine the number and direction of principal components; If the eigenvalue is greater than the threshold, the corresponding eigenvector is used as the principal component, and the original data is projected onto the principal component space to achieve data dimensionality reduction; The number of principal components to be retained is determined by the contribution rate and cumulative contribution rate of the principal components to ensure that sufficient information is retained while reducing the data dimension. According to the retained principal components, the original data is reconstructed and restored to obtain a simplified data set for abnormal diagnosis and subsequent analysis and processing, reducing computational complexity.

4. The method according to claim 1, wherein: According to the simplified data, the secondary characteristics of the electric energy index are extracted by statistical analysis method, including the power factor change rate and the load fluctuation rate. The secondary indicators are used as key features for diagnosing abnormal power consumption, including: Obtain simplified electric energy data, including time series data of current, voltage and power indicators, as input for statistical analysis; The average power factor in each time window is calculated by the sliding window algorithm to obtain the time series of the power factor; Perform the first-order difference on the power factor time series, calculate the change rate between two adjacent time points, and obtain the power factor change rate series; If the power factor change rate exceeds the preset threshold, it is judged as a potential power consumption anomaly, and the abnormal time point and change range are recorded; Calculate the average load in each time window to obtain the load time series, and then perform first-order difference to obtain the load volatility series; Determine the load fluctuation characteristics based on the size and frequency of the load fluctuation rate. If the fluctuation rate frequently exceeds the threshold, it is judged as a potential power consumption anomaly. The power factor change rate and load fluctuation rate are used as secondary features of electric energy indicators and input into the abnormal diagnosis model together with the original indicators to improve the accuracy and reliability of diagnosis.

5. The method according to claim 1, wherein: The cluster analysis algorithm is used to classify the extracted key features to identify different power consumption behavior patterns in the power grid, obtain the results of the cluster analysis, build a support vector machine model for pattern recognition, and train the support vector machine model to distinguish normal power consumption behavior from abnormal power consumption behavior, including: Obtain secondary features of electric energy indicators, including power factor change rate and load fluctuation rate, as input data for cluster analysis; The K-means clustering algorithm is used to divide the sample points into K clusters according to the Euclidean distance between the feature vectors, and the cluster centers and category labels are obtained; Through the elbow rule or silhouette coefficient method, the clustering quality under different K values ​​is evaluated, the optimal number of clusters is determined, and the clustering results are obtained; Analyze the samples in each cluster and summarize the characteristics of their power consumption patterns, including the load curve shape and power factor level, to determine whether they are abnormal power consumption behaviors; According to the clustering results, normal power consumption behaviors and abnormal power consumption behaviors are labeled, and a training data set for the support vector machine model is constructed; Select the Gaussian kernel function as the kernel function of the support vector machine, and optimize the model's hyperparameters, regularization coefficients or kernel function parameters through grid search and cross-validation; The support vector machine model is trained using the training data set to obtain the optimal decision boundary, which is used to distinguish normal power consumption behavior from abnormal power consumption behavior, and realize real-time power consumption behavior recognition and abnormal diagnosis.

6. The method according to claim 1, wherein: The method of using a neural network model to perform deep learning on the pattern recognition results of the support vector machine model and optimizing the prediction capability of the support vector machine model for future abnormal events by learning from historical abnormal cases includes: Obtain the pattern recognition results of the support vector machine model on the historical data, including the predicted category labels and confidence scores, as input to the neural network model; Use a multi-layer perceptron neural network (MLP) to design the number of neurons and activation functions in the input layer, hidden layer, and output layer, and build the architecture of the neural network; Based on the real labels of historical abnormal cases, supervised learning is performed on the neural network model, and the weights and biases of neurons are optimized using the back-propagation algorithm and gradient descent method to minimize the prediction error. Through cross-validation and early stopping methods, the training process of the neural network model is controlled to avoid overfitting and improve the generalization ability of the model; Integrate the trained neural network model with the support vector machine model, combine the prediction results of the two models, and obtain the final abnormal event recognition result; If the prediction confidence of the neural network model is higher than that of the support vector machine model, the prediction result of the neural network model shall prevail; Otherwise, the prediction results of the support vector machine model shall prevail.

7. The method according to claim 1, wherein: The decision tree algorithm is used to perform logical judgment and classification on abnormal power consumption behaviors, and output corresponding abnormal handling suggestions and measures according to different abnormal types, including: Obtain the abnormal power consumption behavior data predicted by the support vector machine model and the neural network model, and extract key features, including power consumption, current, and voltage indicators, as input to the decision tree model; Using ID3 or C4.5 algorithm, according to the information gain or information gain rate of the feature, the optimal feature is selected as the root node of the decision tree, and the child nodes of the decision tree are recursively constructed; In the process of building a decision tree, the depth of the tree and the number of leaf nodes are controlled through pre-pruning or post-pruning methods to avoid overfitting and improve the generalization ability of the model; Starting from the root node of the decision tree, the abnormal power consumption behavior is gradually judged and classified according to the characteristic value of each node until the leaf node is reached to obtain the final abnormal type; For each abnormality type, summarize its characteristics and possible causes, and formulate corresponding abnormality handling suggestions and measures, including electrical equipment fault inspection and repair and electrical load adjustment; Extract the judgment rules of the decision tree to form a series of IF-THEN rules to identify and handle abnormal power consumption behavior in real time; Regularly update and optimize the decision tree model, adjust the tree structure and judgment rules according to new abnormal case data, and improve the recognition accuracy and processing efficiency of abnormal electricity consumption behavior.

8. The method according to claim 1, wherein: The potential influencing factors of abnormal power consumption are quantified by the regression analysis algorithm, the causes of abnormal power consumption are analyzed and diagnostic decisions are aided, including: Obtain historical abnormal electricity consumption data and related influencing factors data, including weather, temperature, humidity, and holidays, clean, convert, and standardize the data, and build the input data set for the regression analysis model; A multivariate linear regression model is adopted, with abnormal power consumption index as the dependent variable and influencing factors as the independent variables, to establish the regression equation y=β0+β1x1+β2x2+...+βnxn+ε, where y is the abnormal power consumption index, x1, x2,..., xn are influencing factors, β0, β1, β2,..., βn are regression coefficients, and ε is the random error term; The regression coefficients are estimated by the least squares method, minimizing the residual sum of squares Where yi is the actual value, is the predicted value, and the estimated values ​​of the regression coefficients b0, b1, b2, ..., bn are obtained; The coefficient of determination R^2 and adjusted coefficient of determination AR^2 of the regression model were calculated to evaluate the goodness of fit and explanatory power of the model, R^2 = (SSR / SST), where SSR is the regression sum of squares and SST is the total sum of squares; The regression coefficients were subjected to t-test and F-test to determine the significance level of the influencing factors on the abnormal power consumption index. The confidence level was set at 95%. If the p-value was less than 0.05, it was considered that the influencing factors had a significant impact on the abnormal power consumption index. According to the sign and size of the regression coefficient, explain the direction and degree of influence of the influencing factors on the abnormal power consumption index. A positive value indicates a positive correlation, a negative value indicates a negative correlation, and a larger absolute value indicates a stronger influence. Apply the results of regression analysis to the diagnosis and decision-making of abnormal power consumption. For factors that significantly affect abnormal power consumption, take targeted prevention and treatment measures, adjust power load and optimize power consumption time periods, and assist in the identification and diagnosis of abnormal power consumption. It also includes: regularly mining the potential relationships between electricity usage behaviors through association rule algorithms to provide data support for abnormal electricity usage diagnosis.

9. The method according to claim 8, wherein: The potential relationship between electricity consumption behaviors is regularly mined through association rule algorithms to provide data support for abnormal electricity consumption diagnosis, including: Obtain historical electricity consumption behavior data, including electricity consumption time, location, equipment, and power attributes, clean, convert, and integrate the data, and build a transaction data set for association rule mining; Use Apriori or FP-growth algorithm to scan the transaction data set, determine frequent 1-item sets, frequent 2-item sets, and frequent 3-item sets according to the minimum support threshold, and obtain all frequent patterns; For each frequent pattern, generate association rules based on the minimum confidence threshold, such as {power consumption time = night, power equipment = air conditioner}=>{power consumption = high}, which means that when the air conditioner is used at night, the power consumption is often high; calculate the support and confidence of each association rule, support = support count of the rule / total number of transactions, confidence = support count of the rule / support count of the frequent pattern on the left, to measure the importance and reliability of the rule; According to the evaluation indicators of association rules, including promotion degree and utilization degree, the rules are sorted and screened to obtain strong association rules, revealing the potential relationship and pattern between electricity consumption behaviors; Association rules are applied to abnormal power consumption diagnosis. If certain power consumption behaviors are found to co-occur frequently, but the actual data does not conform to the rules, it is determined to be abnormal power consumption and further analysis of the cause is required.

Citation Information

Cited By

  • User electric energy data acquisition and analysis terminal based on Internet of Things

    CN118735469A

  • A user power data collection and analysis terminal based on the Internet of Things

    CN118735469B

  • New energy automobile charging pile transformer operation state monitoring method

    CN118914929A

  • Air conditioner load regulation and control system

    CN119022397A

  • Pipeline non-excavation repair process

    CN119084696A