Electric quantity and electricity charge fluctuation abnormity analysis method and system

By dynamically adjusting the data acquisition frequency and multi-scale timing analysis model, the problem of insufficient nonlinear feature capture and real-time performance of electricity and electricity bill fluctuation analysis in the prior art is solved, and higher analysis accuracy and response speed are achieved.

CN119848721APending Publication Date: 2025-04-18NORTH CHINA GRID MEASUREMENT CENT
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411915542.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-24
Publication Date
2025-04-18

AI Technical Summary

Technical Problem

When handling electricity and electricity fluctuations, it is difficult for the prior art to effectively capture nonlinear features and dynamically adjust the data acquisition frequency, resulting in the limitation of the accuracy and real-time nature of the analysis results.

Method used

By collecting electricity and electricity bill data, calculating the change rate, monitoring fluctuations in real time, and using adaptive Pearson correlation coefficient based on core timing to extract key features, dynamically adjusting the data acquisition frequency, and analyzing fluctuation anomalies using a multi-scale timing analysis model.

Benefits of technology

It realizes accurate capture of complex nonlinear features, improves the accuracy and real-time nature of anomaly analysis, and ensures that data can be obtained and effective analysis can be carried out in a timely manner when electricity bills and power fluctuate violently.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119848721A_ABST
    Figure CN119848721A_ABST
Patent Text Reader

Abstract

The invention discloses an electric quantity and electric charge fluctuation abnormity analysis method and system, and relates to the technical field of smart power grid data analysis, and the method comprises the steps: collecting electric quantity and electric charge data through power equipment; calculating the electric quantity and electric charge change rate of the current time period based on the electric quantity and electric charge data; monitoring electric quantity and electric charge fluctuation in real time according to the electric quantity and electric charge change rate; dynamically adjusting the data acquisition frequency through an electric quantity and electricity charge fluctuation self-adaptive acquisition mechanism; key features influencing the change rate of the electric quantity and the electric charge are extracted by adopting a self-adaptive Pearson's correlation coefficient based on a kernel time sequence, and splitting is carried out based on different time scales; and obtaining a multi-scale time sequence analysis model, inputting the split key features into the multi-scale time sequence analysis model, and analyzing fluctuation abnormity of electric quantity and electric charge. According to the method, key features are extracted based on the adaptive Pearson's correlation coefficient of the kernel time sequence, and the real-time performance, the precision and the response speed of electric quantity and electricity charge fluctuation analysis are improved in combination with a multi-scale time sequence analysis model and an adaptive acquisition mechanism. A specified figure 1 is an abstract drawing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of smart grid data analysis, and in particular to a method and system for analyzing abnormal fluctuations in electricity quantity and electricity charges. Background Art

[0002] With the rapid development of smart grid technology and big data technology, the data collection and analysis capabilities in the power system have been greatly improved. Through in-depth mining of electricity consumption data, power companies can more accurately understand the changes in power load and thus optimize power supply scheduling. However, traditional methods for analyzing electricity consumption and electricity charges mainly rely on statistical models or simple time series predictions, such as autoregressive (AR) models and moving average (MA) models. These models perform well when processing linear or single time scale data, but the fluctuations in the power system often have multi-scale characteristics such as short-term and periodicity, and are affected by external factors such as weather and user behavior. Existing technologies lack flexibility when faced with complex multi-scale fluctuations, and it is difficult to fully and accurately extract key features, resulting in limited reliability of the analysis results.

[0003] Existing technologies have two major limitations when dealing with fluctuations in electricity consumption and electricity charges. First, traditional analysis methods usually assume that data has linear time dependence, which makes it difficult to effectively capture the nonlinear characteristics of electricity consumption and electricity charges, resulting in low accuracy in detecting fluctuation anomalies. Second, existing technologies use a fixed data collection frequency and are unable to dynamically adjust the collection frequency according to fluctuations in electricity consumption and electricity charges, resulting in the inability to obtain accurate data in a timely manner when fluctuations are severe, affecting real-time performance and accuracy. Therefore, accurate analysis of abnormal fluctuations in electricity consumption and electricity charges remains a technical challenge in the field of smart grids, and more advanced methods are urgently needed to meet this challenge. Summary of the invention

[0004] In view of the above existing problems, the present invention is proposed.

[0005] Therefore, the present invention provides a method and system for analyzing abnormal fluctuations in electricity quantity and electricity charges to solve the deficiencies of the prior art in terms of nonlinear feature capture and dynamic acquisition frequency adjustment.

[0006] In order to solve the above technical problems, the present invention provides the following technical solutions:

[0007] In a first aspect, the present invention provides a method for analyzing abnormal fluctuations in electricity quantity and electricity charges, which includes collecting electricity quantity and electricity charge data through power equipment; calculating the electricity quantity and electricity charge change rate in the current period based on the electricity quantity and electricity charge data; monitoring the electricity quantity and electricity charge fluctuations in real time according to the electricity quantity and electricity charge change rate; dynamically adjusting the data collection frequency through an adaptive collection mechanism for electricity quantity and electricity charge fluctuations; using an adaptive Pearson correlation coefficient based on kernel time series to extract key features that affect the electricity quantity and electricity charge change rate, and splitting them based on different time scales; obtaining a multi-scale time series analysis model, inputting the split key features into the multi-scale time series analysis model, and analyzing the abnormal fluctuations in electricity quantity and electricity charges.

[0008] As a preferred solution of the method for analyzing abnormal fluctuations in power consumption and electricity charges of the present invention, the specific steps of collecting power consumption and electricity charges data through power equipment are as follows:

[0009] Set the initial collection frequency, and collect electricity consumption and electricity fee data through the smart power equipment on the user side based on the fluctuation pattern of historical data and the initial collection frequency.

[0010] As a preferred solution of the method for analyzing abnormal fluctuation of electric power and electricity charges of the present invention, the specific steps of real-time monitoring of fluctuation of electric power and electricity charges according to the rate of change of electric power and electricity charges are as follows:

[0011] Based on historical data, define low volatility threshold and high volatility threshold;

[0012] The fluctuation of the electricity quantity and electricity price is classified according to the change rate of the electricity quantity and electricity price, the low fluctuation threshold and the high fluctuation threshold to obtain any one of slight fluctuation, medium fluctuation and severe fluctuation.

[0013] As a preferred solution of the method for analyzing abnormal fluctuation of electric power and electricity charges of the present invention, the data collection frequency is dynamically adjusted through the adaptive collection mechanism of electric power and electricity charges fluctuation, and the specific steps are as follows:

[0014] The adjustment levels of data collection frequency are divided into primary frequency, secondary frequency and tertiary frequency;

[0015] When the power consumption and electricity charges fluctuate slightly, adjust the current data collection frequency to the first-level frequency;

[0016] When the power consumption and electricity fee fluctuations are moderate, the current data collection frequency is adjusted to the secondary frequency;

[0017] When the electricity consumption and electricity charges fluctuate severely, the current data collection frequency is adjusted to the third level frequency.

[0018] As a preferred solution of the method for analyzing abnormal fluctuations in electricity consumption and electricity charges of the present invention, the adaptive Pearson correlation coefficient based on kernel time series is used to extract key features that affect the rate of change of electricity consumption and electricity charges, and split them based on different time scales. The specific steps are as follows:

[0019] The power features are extracted from the collected power data, and the kernel time series-based adaptive Pearson correlation coefficient r between each power feature and the power charge change rate is calculated through correlation analysis based on time series nonlinear kernel mapping. i , the expression is:

[0020]

[0021] Among them, X i is the ith power characteristic, Y(X i ) indicates the power characteristic X i The associated electricity charge change rate, φ(X i ) represents the power characteristic X i The value after kernel mapping, ψ(Y(X i )) represents the rate of change of electricity charges Y(X i ) and the value after mapping, α i is the adaptive timing dependency coefficient, All power characteristics X i The mean after kernel mapping, is the rate of change of electricity charges for all electricity consumption Y(X i ) is the mean after kernel mapping, n represents the total number of power features;

[0022] The absolute value of the adaptive Pearson correlation coefficient based on kernel time series between each power feature and the rate of change of power consumption and electricity price | r i ∣, sort the power features from largest to smallest;

[0023] Based on the sorted power features, the first R power features are extracted as the key features that affect the rate of change of power consumption and electricity charges;

[0024] The key features are divided into short-term abnormal power features and periodic abnormal power features according to different time scales.

[0025] As a preferred solution of the method for analyzing abnormal fluctuation of electric power and electricity charges of the present invention, wherein: the multi-scale time series analysis model is obtained, the key features after splitting are input into the multi-scale time series analysis model, and the abnormal fluctuation of electric power and electricity charges is analyzed, and the specific steps are as follows:

[0026] Obtain a multi-scale time series analysis model; the multi-scale time series analysis model includes a short-term fluctuation layer and a periodic fluctuation layer;

[0027] The short-term fluctuation layer uses the memory capacity of LSTM to capture the short-term abnormal power characteristics that affect the rate of change of electricity consumption and electricity charges, and predict the short-term fluctuations of electricity consumption and electricity charges;

[0028] The periodic fluctuation layer uses the autoregression and moving average mechanism of ARIMA to capture the periodic abnormal power characteristics that affect the rate of change of electricity consumption and electricity charges, and eliminates trends and seasonal fluctuations by performing differential processing on historical data to predict the periodic fluctuations of electricity consumption and electricity charges;

[0029] The split key features are input into the multi-scale time series analysis model to predict the fluctuation level of electricity consumption and electricity charges. The expression is:

[0030]

[0031] in, represents the fluctuation level of electricity consumption and electricity price at time t, Y s (t) is the output result of the short-term fluctuation layer at time t, Y c (t) is the output result of the periodic fluctuation layer at time t, γ1 is the weight coefficient of the short-term fluctuation layer, γ2 is the weight coefficient of the periodic fluctuation layer, and γ3 is the weight coefficient of the interaction term between the short-term fluctuation layer and the periodic fluctuation layer;

[0032] Based on historical fluctuation data, define low fluctuation anomaly threshold θ1 and high fluctuation anomaly threshold θ2;

[0033] when When the current electricity consumption and electricity fee fluctuations are considered normal;

[0034] when When the current electricity consumption and electricity fee fluctuations are considered to be slightly abnormal fluctuations;

[0035] when When the current electricity consumption and electricity fee fluctuations are considered to be severe abnormal fluctuations.

[0036] As a preferred solution of the method for analyzing abnormal fluctuation of power consumption and electricity charges of the present invention, the output result Y of the short-term fluctuation at time t is s The expression of (t) is as follows:

[0037] Y s (t) = σ(W s ·h t-1 +U s ·X s (t)+b s );

[0038] Among them, h t-1 is the hidden state at time t-1, W s is the weight matrix of the hidden state, X s(t) is the value of the short-term abnormal power characteristic at time t, b s is the bias term, σ is the activation function, U s is the value of the short-term abnormal power characteristic at time t X s (t) weight matrix;

[0039] The output result Y of the periodic fluctuation layer at time t c The expression of (t) is as follows:

[0040]

[0041] Among them, η k is the autoregressive coefficient, X c (tk) represents the periodic abnormal power characteristics at time (tk), δ j is the moving average coefficient, ∈ t-j represents the forecast error of ARIMA at time tj, ∈ t represents the random error of ARIMA at the current time t, p represents the order of the autoregressive term, q represents the order of the moving average term, k is the time step index of the autoregressive term, and j is the time step index of the moving average term.

[0042] In a second aspect, the present invention provides an abnormal analysis system for fluctuations in electricity quantity and electricity charges, comprising a data acquisition module, an acquisition frequency adjustment module, a feature extraction module and an abnormal fluctuation analysis module; the data acquisition module is used to collect electricity quantity and electricity charge data through power equipment; the acquisition frequency adjustment module is used to calculate the electricity quantity and electricity charge change rate in the current period based on the electricity quantity and electricity charge data; the electricity quantity and electricity charge fluctuations are monitored in real time according to the electricity quantity and electricity charge change rate; the data acquisition frequency is dynamically adjusted through an adaptive acquisition mechanism for electricity quantity and electricity charge fluctuations; the feature extraction module is used to extract key features that affect the electricity quantity and electricity charge change rate using an adaptive Pearson correlation coefficient based on kernel time series, and split them based on different time scales; the abnormal fluctuation analysis module is used to obtain a multi-scale time series analysis model, input the split key features into the multi-scale time series analysis model, and analyze the abnormal fluctuations in electricity quantity and electricity charges.

[0043] In a third aspect, the present invention provides a computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: when the computer program is executed by the processor, any step of the method for analyzing abnormal fluctuations in electricity consumption and electricity charges as described in the first aspect of the present invention is implemented.

[0044] In a fourth aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein: when the computer program is executed by a processor, any step of the method for analyzing abnormal fluctuations in electricity quantity and electricity charges as described in the first aspect of the present invention is implemented.

[0045] The beneficial effects of the present invention are as follows: by using the adaptive Pearson correlation coefficient based on the kernel time series to extract the key features that affect the rate of change of electricity consumption and electricity charges, the accurate capture of complex nonlinear features is achieved, and the accuracy of abnormal analysis is improved; at the same time, by using the multi-scale time series analysis model, the short-term and periodic fluctuation characteristics are input into different fluctuation layers respectively, and the short-term fluctuations are captured by LSTM, and the periodic fluctuations are analyzed by ARIMA, so as to achieve multi-dimensional analysis and prediction of electricity consumption and electricity charge fluctuations. The data collection frequency is dynamically adjusted in combination with the adaptive collection mechanism to ensure that data can be obtained in time and effective analysis can be carried out when the electricity consumption and electricity charges fluctuate violently, thereby improving the real-time, accuracy and response speed of the electricity consumption and electricity charge fluctuation analysis. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0047] Figure 1 This is a flow chart of the method for analyzing abnormal fluctuations in electricity consumption and electricity charges in Example 1.

[0048] Figure 2 This is a system diagram for analyzing abnormal fluctuations in electricity consumption and electricity charges in Example 1. DETAILED DESCRIPTION

[0049] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are described in detail below in conjunction with the accompanying drawings.

[0050] In the following description, many specific details are set forth to facilitate a full understanding of the present invention, but the present invention may also be implemented in other ways different from those described herein, and those skilled in the art may make similar generalizations without violating the connotation of the present invention. Therefore, the present invention is not limited to the specific embodiments disclosed below.

[0051] Secondly, the term "one embodiment" or "embodiment" as used herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation of the present invention. The term "in one embodiment" that appears in different places in this specification does not necessarily refer to the same embodiment, nor does it refer to a separate or selective embodiment that is mutually exclusive with other embodiments.

[0052] Example 1, reference Figure 1 and Figure 2 , which is the first embodiment of the present invention, and provides a method for analyzing abnormal fluctuations in power consumption and electricity charges, comprising the following steps:

[0053] S1: Collect electricity consumption and electricity fee data through power equipment.

[0054] S1.1: Set the initial collection frequency. Based on the fluctuation pattern of historical data and the initial collection frequency, collect power consumption and electricity fee data through the smart power equipment on the user side.

[0055] Furthermore, by analyzing the periodic fluctuations and seasonal changes in users' historical electricity consumption and electricity fee data, combined with short-term and long-term fluctuation trends, the regular pattern of changes in electricity consumption and electricity fees is determined, and the appropriate initial collection frequency is set according to the fluctuation frequency and amplitude to ensure that data collection can cover the main cycles and abnormal fluctuations of electricity fluctuations.

[0056] S2: Calculate the electricity consumption and electricity fee change rate of the current period based on the electricity consumption and electricity fee data; monitor the electricity consumption and electricity fee fluctuations in real time according to the electricity consumption and electricity fee change rate; dynamically adjust the data collection frequency through the electricity consumption and electricity fee fluctuation adaptive collection mechanism, including:

[0057] S2.1: Calculate the electricity consumption and electricity fee change rate of the current period based on the electricity consumption and electricity fee data, including:

[0058] After collecting the electricity consumption and electricity cost data of the current period, the changes in electricity consumption and electricity cost of the current period are calculated by comparing them with those of the previous period.

[0059] S2.2: Real-time monitoring of electricity consumption and electricity fee fluctuations based on the electricity consumption and electricity fee change rate, including:

[0060] S2.2.1: Based on historical data, define low volatility thresholds and high volatility thresholds.

[0061] Furthermore, we first conduct statistical analysis on historical electricity consumption and electricity fee data to calculate the average and standard deviation of the electricity consumption and electricity fee change rate, and then set the low fluctuation threshold to a smaller deviation range where the change rate is close to the average value, and set the high fluctuation threshold to a larger deviation beyond the normal fluctuation range, based on the fluctuation range and distribution of the data, so as to effectively distinguish between mild, moderate and severe fluctuations.

[0062] S2.2.2: Classify the fluctuation of electricity consumption and electricity charges according to the electricity consumption and electricity charge change rate, low fluctuation threshold and high fluctuation threshold, including:

[0063] If the rate of change of electricity consumption and electricity charges is less than the low fluctuation threshold, the fluctuation of electricity consumption and electricity charges is classified as slight fluctuation;

[0064] If the low fluctuation threshold ≤ the electricity consumption and electricity fee change rate < the high fluctuation threshold, the electricity consumption and electricity fee fluctuation is classified as moderate fluctuation;

[0065] If the rate of change of electricity consumption and electricity charges is ≥ the high fluctuation threshold, the fluctuation of electricity consumption and electricity charges is classified as severe fluctuation.

[0066] It should be noted that when it is detected that the rate of change of electricity charges exceeds the pre-set low fluctuation threshold or high fluctuation threshold, the system will classify it according to the magnitude of the change. If the rate of change of electricity charges or electricity charges is less than the low fluctuation threshold, the fluctuation of electricity charges is classified as mild fluctuation, indicating that the fluctuation is small and within the normal range; if the rate of change is between the low fluctuation threshold and the high fluctuation threshold, the fluctuation of electricity charges is classified as moderate fluctuation, indicating that the fluctuation is more significant but still within the controllable range; if the rate of change of electricity charges is equal to or exceeds the high fluctuation threshold, the fluctuation of electricity charges is classified as severe fluctuation, indicating that the fluctuation is large and may require further attention and processing. This classification mechanism helps the power system to quickly identify and respond to fluctuations of different degrees, ensuring the stability and economy of power grid operation.

[0067] S2.3: Dynamically adjust the data collection frequency through the adaptive collection mechanism of electricity consumption and electricity price fluctuations, including:

[0068] S2.3.1: The adjustment levels of data collection frequency are divided into primary frequency, secondary frequency, and tertiary frequency.

[0069] S2.3.2: When the fluctuation of electricity consumption and electricity charges is mild, the current data collection frequency is adjusted to the first-level frequency; when the fluctuation of electricity consumption and electricity charges is moderate, the current data collection frequency is adjusted to the second-level frequency; when the fluctuation of electricity consumption and electricity charges is severe, the current data collection frequency is adjusted to the third-level frequency.

[0070] Furthermore, the adjustment level of the data collection frequency is divided based on the severity of the fluctuation of the power consumption and electricity price, so as to ensure that the collection frequency is reduced to save resources when the fluctuation is small, and the collection frequency is increased to capture more detailed data when the fluctuation is large.

[0071] For example, when the fluctuation of electricity consumption and electricity charges is classified as mild fluctuation, the collection frequency is low (level one frequency), and data may be collected once an hour; when the fluctuation of electricity consumption and electricity charges reaches moderate fluctuation, the collection frequency is increased (level two frequency), and data may be collected every half hour; and when the fluctuation of electricity consumption and electricity charges reaches severe fluctuation, the collection frequency is increased to the highest (level three frequency), and data may be collected every five minutes, so as to better monitor the severe fluctuation.

[0072] S3: Adopt the adaptive Pearson correlation coefficient based on kernel time series to extract the key features that affect the rate of change of electricity consumption and electricity charges, and split them based on different time scales, including:

[0073] S3.1: Extract power features from the collected power data, and calculate the kernel time series-based adaptive Pearson correlation coefficient r between each power feature and the power charge change rate through correlation analysis based on time series nonlinear kernel mapping. i , the expression is:

[0074]

[0075] Among them, X i is the ith power characteristic, Y(X i ) indicates the power characteristic X i The associated electricity charge change rate, φ(X i ) represents the power characteristic X i The value after kernel mapping, ψ(Y(X i )) represents the rate of change of electricity charges Y(X i ) and the value after mapping, α i is the adaptive timing dependency coefficient, All power characteristics X i The mean after kernel mapping, is the rate of change of electricity charges for all electricity consumption Y(X i ) is the mean after kernel mapping, n represents the total number of power features;

[0076] Electricity data include electricity consumption, electricity load, peak and valley electricity prices, electricity consumption periods, etc., which serve as basic data for extracting electricity characteristics and conducting correlation analysis.

[0077] It should be noted that the adaptive timing dependence coefficient α i The expression is:

[0078]

[0079] Among them, β is the parameter that controls the timing dependency, t is the current time, and t v is the vth moment;

[0080] Power Characteristics X i The value φ(X i ) is expressed as:

[0081] φ(X i )=exp(-ρ||X i -X'|| 2 );

[0082] Among them, ρ is the kernel parameter, X' is the reference feature;

[0083] The reference feature specifically refers to other feature points used to compare with the current feature point in the kernel function to calculate the similarity and help map the high-dimensional space.

[0084] ψ(Y(X i ))=exp(-γ||Y(X i )-Y(X')|| 2 );

[0085] Among them, Y(X') represents the rate of change of electricity charges corresponding to the reference feature X';

[0086] S3.2: Absolute value of adaptive Pearson correlation coefficient based on kernel time series | r for each power feature and the rate of change of power consumption and electricity price i ∣, sort the power features from largest to smallest;

[0087] S3.3: Based on the sorted power features, extract the first R power features as key features that affect the rate of change of electricity consumption and electricity charges.

[0088] S3.4: Split the key features into short-term abnormal power features and periodic abnormal power features according to different time scales.

[0089] Furthermore, the specific process of splitting the key features according to different time scales is as follows: First, perform time series analysis on the electricity consumption and electricity bill data to identify the fluctuation patterns in different time periods. Then, based on the characteristics of short-term fluctuations and long-term periodic fluctuations, decompose the data into different time scales. For short-term abnormal features, the focus is on capturing sudden abnormal fluctuations in a shorter period of time (such as hours and days); while periodic abnormal features focus on regular fluctuations and repetitive trends in longer time periods (such as weeks, months or seasonality). Finally, by analyzing the features on these different time scales, abnormal fluctuations in the power system can be more effectively identified and classified.

[0090] After S3.4, it also includes: cleaning, denoising and standardizing the split abnormal power features.

[0091] It should be noted that cleaning refers to removing missing values ​​or unreasonable extreme values ​​in the abnormal power features after splitting, such as deleting abnormal spike data caused by equipment failure.

[0092] Denoising: Use smoothing algorithms (such as moving average or wavelet transform) to remove random noise from abnormal power characteristics, such as eliminating high-frequency fluctuations caused by equipment jitter in the short term.

[0093] Standardization: The abnormal power features are standardized to have the same dimension and range, for example, the values ​​of all features are scaled to between 0 and 1, so that the comparison between different features is more effective.

[0094] S4: Obtain a multi-scale time series analysis model, input the split key features into the multi-scale time series analysis model, and analyze the abnormal fluctuations in electricity consumption and electricity charges.

[0095] S4.1: Obtain a multi-scale time series analysis model; the multi-scale time series analysis model includes a short-term fluctuation layer and a periodic fluctuation layer.

[0096] The short-term fluctuation layer uses the memory capacity of LSTM to capture the short-term abnormal power characteristics that affect the rate of change of electricity consumption and electricity charges, and predict the short-term fluctuations of electricity consumption and electricity charges;

[0097] It should be noted that LSTM (Long Short-Term Memory Network) was selected because of its unique memory ability, which can effectively capture short-term dependencies in time series and avoid the gradient vanishing problem of traditional RNN in long sequences. By introducing forget gates, input gates, and output gates, LSTM can retain important short-term information and forget irrelevant historical data, making it excellent in processing short-term fluctuations in power data and capturing complex time-dependent features, especially suitable for predicting short-term changes in electricity consumption and electricity charges.

[0098] The periodic fluctuation layer uses the autoregression and moving average mechanism of ARIMA to capture the periodic abnormal power characteristics that affect the rate of change of electricity consumption and electricity charges, and eliminates trends and seasonal fluctuations by performing differential processing on historical data to predict the periodic fluctuations of electricity consumption and electricity charges;

[0099] It should be noted that ARIMA (Autoregressive Integrated Moving Average Model) is selected because it is good at dealing with trends and seasonal fluctuations in time series. ARIMA can capture long-term dependencies and cyclical characteristics in data through autoregression (AR) and moving average (MA) mechanisms. At the same time, by performing differential processing on historical data, ARIMA can effectively eliminate trends and seasonal effects in non-stationary data, making it more suitable for predicting cyclical fluctuations in electricity consumption and electricity charges.

[0100] S4.2: Input the split key features into the multi-scale time series analysis model to predict the fluctuation level of electricity consumption and electricity charges. The expression is:

[0101]

[0102] in, Indicates the fluctuation level of electricity consumption and electricity price at time t, Y s (t) is the output result of the short-term fluctuation layer at time t, Y c (t) is the output result of the periodic fluctuation layer at time t, γ1 is the weight coefficient of the short-term fluctuation layer, γ2 is the weight coefficient of the periodic fluctuation layer, and γ3 is the weight coefficient of the interaction term between the short-term fluctuation layer and the periodic fluctuation layer.

[0103] S4.3: Define a low volatility anomaly threshold θ1 and a high volatility anomaly threshold θ2 based on historical volatility data.

[0104] S4.4: judging whether it is abnormal based on the fluctuation level of the power consumption and electricity charges, the low fluctuation abnormal threshold θ1 and the high fluctuation abnormal threshold θ2, specifically including:

[0105] when When the current electricity consumption and electricity fee fluctuations are considered normal;

[0106] when When the current electricity consumption and electricity fee fluctuations are considered to be slightly abnormal fluctuations;

[0107] when When the current electricity consumption and electricity price fluctuations are considered to be severe abnormal fluctuations.

[0108] Furthermore, by analyzing the historical fluctuation range of the electricity consumption and electricity fee change rate, the average value and standard deviation are calculated. θ1 is usually set to a smaller deviation close to the average fluctuation rate to identify slight abnormal fluctuations, while θ2 is set to a larger deviation beyond the normal fluctuation range to capture serious abnormal fluctuations. This threshold setting based on historical data can effectively distinguish between normal fluctuations and abnormal fluctuations, ensuring the sensitivity and accuracy of detection.

[0109] The output result Y of the short-term fluctuation at time t s The expression of (t) is as follows:

[0110] Y s (t) = σ(W s ·h t-1 +U s ·X s (t)+b s );

[0111] Among them, h t-1 is the hidden state at time t-1, W s is the weight matrix of the hidden state, X s (t) is the value of the short-term abnormal power characteristic at time t, b s is the bias term, σ is the activation function, U s is the value of the short-term abnormal power characteristic at time t X s (t) weight matrix;

[0112] It should be noted that the hidden state at time t-1 is used to help the network maintain and utilize the information of the previous time step and capture the temporal dependencies in the sequence.

[0113] The weight matrix W of the hidden state s Used to transform the hidden state h of the previous moment t-1 Converted to the weight parameter matrix of the hidden state at the current moment, this matrix is ​​converted to the weight parameter matrix of the hidden state at the current moment. t-1 Perform a linear transformation to update the current hidden state, learn the temporal dependencies in the sequence, and ensure that the network can effectively capture and utilize the information of the previous time step.

[0114] The output of the periodic fluctuation layer at time t is Yc The expression of (t) is as follows:

[0115]

[0116] Among them, η k is the autoregressive coefficient, X c (tk) represents the periodic abnormal power characteristics at time (tk), δ j is the moving average coefficient, ∈ t-j represents the forecast error of ARIMA at time tj, ∈ t represents the random error of ARIMA at the current time t, p represents the order of the autoregressive term, q represents the order of the moving average term, k is the time step index of the autoregressive term, and j is the time step index of the moving average term.

[0117] It should be noted that the prediction error in the ARIMA model refers to the difference between the actual observed value and the model predicted value when the model makes a prediction at a certain past time tj, that is, ∈ t-j It reflects the prediction accuracy of the model at that moment and is used to adjust the predictions at future moments. By introducing these past prediction errors, the moving average part of the ARIMA model can correct the current prediction and improve the overall prediction effect.

[0118] Random error refers to the random fluctuations that cannot be explained by the ARIMA model when making predictions at the current time t, that is, ∈ t It represents the inherent randomness or noise of the system that the model fails to capture and is usually considered an unpredictable error term that reflects the part of the model that cannot fully fit the data. Random error is an inevitable factor in the prediction process and reflects the inherent uncertainty in the data.

[0119] This embodiment also provides a power consumption and electricity fee fluctuation abnormality analysis system, including: a data acquisition module, an acquisition frequency adjustment module, a feature extraction module and a fluctuation abnormality analysis module;

[0120] Data collection module: used to collect electricity consumption and electricity fee data through power equipment;

[0121] Collection frequency adjustment module: used to calculate the electricity charge change rate of the current period based on the electricity charge data; monitor the electricity charge fluctuation in real time according to the electricity charge change rate; dynamically adjust the data collection frequency through the electricity charge fluctuation adaptive collection mechanism;

[0122] Feature extraction module: used to extract key features that affect the rate of change of electricity consumption and electricity charges by using the adaptive Pearson correlation coefficient based on kernel time series, and split them based on different time scales;

[0123] Fluctuation anomaly analysis module: used to obtain a multi-scale time series analysis model, input the split key features into the multi-scale time series analysis model, and analyze the fluctuation anomalies of electricity consumption and electricity charges.

[0124] This embodiment also provides a computer device, which is suitable for the method for analyzing abnormal fluctuations in electricity consumption and electricity charges, including: a memory and a processor; the memory is used to store computer executable instructions, and the processor is used to execute computer executable instructions to implement the method for analyzing abnormal fluctuations in electricity consumption and electricity charges as proposed in the above embodiment.

[0125] The computer device may be a terminal, and the computer device includes a processor, a memory, a communication interface, a display screen and an input device connected via a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be achieved through WIFI, an operator network, NFC (near field communication) or other technologies. The display screen of the computer device may be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device may be a touch layer covering the display screen, or a key, trackball or touchpad provided on the housing of the computer device, or an external keyboard, touchpad or mouse, etc.

[0126] The present embodiment also provides a storage medium on which a computer program is stored. When the program is executed by a processor, the method for analyzing abnormal fluctuations in electricity quantity and electricity charges proposed in the above embodiment is implemented; the storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (Static Random Access Memory, referred to as SRAM), electrically erasable programmable read-only memory (Electrically Erasable Programmable Read-Only Memory, referred to as EEPROM), erasable programmable read-only memory (Erasable Programmable Read Only Memory, referred to as EPROM), programmable read-only memory (Programmable Red-Only Memory, referred to as PROM), read-only memory (Read-Only Memory, referred to as ROM), magnetic storage, flash memory, magnetic disk or optical disk.

[0127] In summary, the present invention achieves accurate capture of complex nonlinear features and improves the accuracy of abnormal analysis by: using an adaptive Pearson correlation coefficient based on kernel time series to extract key features that affect the rate of change of electricity consumption and electricity charges, and at the same time using a multi-scale time series analysis model to input short-term and periodic fluctuation features into different fluctuation layers, using LSTM to capture short-term fluctuations, and ARIMA to analyze periodic fluctuations, thereby achieving multi-dimensional analysis and prediction of electricity consumption and electricity charge fluctuations. The data collection frequency is dynamically adjusted in combination with an adaptive acquisition mechanism to ensure that data can be obtained in a timely manner and effective analysis can be performed when electricity consumption and electricity charges fluctuate violently, thereby improving the real-time, accuracy and response speed of electricity consumption and electricity charge fluctuation analysis.

[0128] Example 2, referring to Table 1, is the second example of the present invention. To further verify the technical solution of the present invention, experimental simulation data of the method for analyzing abnormal fluctuations in electricity quantity and electricity charges are provided.

[0129] This embodiment aims to verify the effectiveness of the adaptive collection mechanism based on electricity consumption and electricity price fluctuations and the multi-scale time series analysis model for predicting electricity consumption and electricity price fluctuations. The experiment selects the historical electricity consumption and electricity price data of users in a certain area, covering a period of one month, and the collection frequency is every hour. The data includes electricity consumption (kWh), electricity fee amount (yuan), peak-valley electricity price difference (yuan), electricity consumption time period classification (such as peak, valley, and normal period), etc. The initial collection frequency is set to once an hour, and the key parameters collected include electricity consumption, electricity fee, peak-valley electricity price difference, etc.

[0130] First, the fluctuation pattern of electricity consumption and electricity charges is determined by analyzing historical data, and the low fluctuation threshold θ1 and the high fluctuation threshold θ2 are set. The experiment calculates the change rate of electricity consumption and electricity charges of historical data, and the average change rate is 2.3% and the standard deviation is 0.9%. Based on this, the low fluctuation threshold θ1 = 1.4% and the high fluctuation threshold θ2 = 3.5%.

[0131] During the implementation of the experiment, the system dynamically adjusts the collection frequency based on the real-time collected electricity consumption and electricity cost data. Whenever the rate of change of electricity consumption and electricity costs exceeds the set threshold, the system adjusts the data collection frequency according to the severity of the fluctuation (mild, moderate, severe). Based on the multi-scale time series analysis model, the system splits the collected power characteristics into short-term abnormal characteristics and periodic abnormal characteristics according to the time scale, and uses the short-term fluctuation layer and the periodic fluctuation layer for prediction respectively. The short-term fluctuation layer is used to predict short-term fluctuations, and the periodic fluctuation layer is used to deal with periodic fluctuations and long-term trends. Through the combination of these two models, the experiment can make more accurate predictions of future fluctuations in electricity consumption and electricity costs.

[0132] The details are shown in Table 1 below:

[0133] Table 1 Analysis of electricity consumption and electricity fee fluctuation data

[0134]

[0135] Through the analysis of the data in the above table, it can be clearly seen that the adaptive collection mechanism of the present invention can flexibly adjust the collection frequency according to the rate of change of power consumption and electricity charges. For example, in time periods 1 and 4, the rate of change is low (2.1% and 1.9% respectively), so the system sets the collection frequency to once per hour, avoiding unnecessary frequent collection and saving resources. In time periods 3 and 8, the rate of change increased significantly (3.8% and 4.0% respectively), exceeding the high fluctuation threshold θ23.5%, and the collection frequency was immediately adjusted to once every 5 minutes to capture detailed information of the violent fluctuations. This comparison reflects that the system can adjust the collection strategy in time when abnormal fluctuations are detected, conduct in-depth monitoring with a higher collection frequency, ensure the accuracy and real-time nature of the data, and thus reflect the sensitivity and efficiency of the present invention in abnormal judgment.

[0136] The abnormal analysis method of power consumption and electricity fee fluctuations of the present invention can not only effectively capture the sharp fluctuations in the short term, timely adjust the acquisition frequency, and ensure the real-time and accuracy of the data, but also reduce the acquisition frequency when the fluctuation is small, saving system resources and storage space. This reflects the flexibility and efficiency of the present invention in monitoring power consumption and electricity fee fluctuations, which not only ensures a rapid response to abnormal fluctuations, but also realizes the optimization of reasonable resource allocation.

[0137] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present invention may be modified or replaced by equivalents without departing from the spirit and scope of the technical solutions of the present invention, which should all be included in the scope of the claims of the present invention.

Claims

1. A method for analyzing abnormal fluctuations in power consumption and electricity charges, characterized by: include, Collect electricity consumption and electricity fee data through power equipment; Calculate the electricity consumption and electricity fee change rate of the current period based on the electricity consumption and electricity fee data; Monitor the fluctuation of electricity consumption and electricity charges in real time according to the rate of change of electricity consumption and electricity charges; dynamically adjust the data collection frequency through the adaptive collection mechanism of electricity consumption and electricity charges fluctuation; Adopting the adaptive Pearson correlation coefficient based on kernel time series, the key features that affect the rate of change of electricity consumption and electricity charges are extracted, and split based on different time scales; Obtain a multi-scale time series analysis model, input the split key features into the multi-scale time series analysis model, and analyze the abnormal fluctuations in electricity consumption and electricity charges.

2. The method for analyzing abnormal fluctuations in power consumption and electricity charges according to claim 1, characterized in that: The specific steps of collecting electricity consumption and electricity fee data through power equipment are as follows: Set the initial collection frequency, and collect electricity consumption and electricity fee data through the smart power equipment on the user side based on the fluctuation pattern of historical data and the initial collection frequency.

3. The method for analyzing abnormal fluctuations in power consumption and electricity charges according to claim 2, characterized in that: The specific steps of real-time monitoring of the fluctuation of electricity consumption and electricity charges according to the electricity consumption and electricity charges change rate are as follows: Based on historical data, define low volatility threshold and high volatility threshold; The fluctuation of the electricity quantity and electricity price is classified according to the change rate of the electricity quantity and electricity price, the low fluctuation threshold and the high fluctuation threshold to obtain any one of slight fluctuation, medium fluctuation and severe fluctuation.

4. The method for analyzing abnormal fluctuations in power consumption and electricity charges according to claim 3, characterized in that: The data collection frequency is dynamically adjusted through the adaptive collection mechanism for power consumption and electricity fee fluctuations. The specific steps are as follows: The adjustment levels of data collection frequency are divided into primary frequency, secondary frequency and tertiary frequency; When the power consumption and electricity charges fluctuate slightly, adjust the current data collection frequency to the first-level frequency; When the power consumption and electricity fee fluctuations are moderate, the current data collection frequency is adjusted to the secondary frequency; When the electricity consumption and electricity charges fluctuate severely, the current data collection frequency is adjusted to the third level frequency.

5. The method for analyzing abnormal fluctuations in power consumption and electricity charges according to claim 4, characterized in that: The adaptive Pearson correlation coefficient based on kernel time series is used to extract key features that affect the rate of change of electricity consumption and electricity charges, and split them based on different time scales. The specific steps are as follows: The power features are extracted from the collected power data, and the kernel time series-based adaptive Pearson correlation coefficient r between each power feature and the power charge change rate is calculated through correlation analysis based on time series nonlinear kernel mapping. i , the expression is: Among them, X i is the ith power characteristic, Y(X i ) indicates the power characteristic X i The associated electricity price change rate, φ(X i ) represents the power characteristic X i The value after kernel mapping, ψ(Y(X i )) represents the value after the power consumption and electricity price change rate Y(Xi) are mapped, α i is the adaptive timing dependency coefficient, is the mean value of all power characteristics Xi after kernel mapping, is the rate of change of electricity charges for all electricity consumption Y(X i ) is the mean after kernel mapping, n represents the total number of power features; The absolute value of the adaptive Pearson correlation coefficient based on kernel time series between each power feature and the rate of change of power consumption and electricity price|r i |,Sort the power features in order from largest to smallest; Based on the sorted power features, the first R power features are extracted as the key features that affect the rate of change of power consumption and electricity charges; The key features are divided into short-term abnormal power features and periodic abnormal power features according to different time scales.

6. The method for analyzing abnormal fluctuations in power consumption and electricity charges according to claim 5, characterized in that: The multi-scale time series analysis model is obtained, and the split key features are input into the multi-scale time series analysis model to analyze the fluctuation abnormality of the power consumption and electricity charges. The specific steps are as follows: Obtain a multi-scale time series analysis model; the multi-scale time series analysis model includes a short-term fluctuation layer and a periodic fluctuation layer; The short-term fluctuation layer uses the memory capacity of LSTM to capture the short-term abnormal power characteristics that affect the rate of change of electricity consumption and electricity charges, and predict the short-term fluctuations of electricity consumption and electricity charges; The periodic fluctuation layer uses the autoregression and moving average mechanism of ARIMA to capture the periodic abnormal power characteristics that affect the rate of change of electricity consumption and electricity charges, and eliminates trends and seasonal fluctuations by performing differential processing on historical data to predict the periodic fluctuations of electricity consumption and electricity charges; The split key features are input into the multi-scale time series analysis model to predict the fluctuation level of electricity consumption and electricity charges. The expression is: in, represents the fluctuation level of electricity consumption and electricity price at time t, Y s (t) is the output result of the short-term fluctuation layer at time t, Y c (t) is the output result of the periodic fluctuation layer at time t, γ1 is the weight coefficient of the short-term fluctuation layer, γ2 is the weight coefficient of the periodic fluctuation layer, and γ3 is the weight coefficient of the interaction term between the short-term fluctuation layer and the periodic fluctuation layer; Based on historical fluctuation data, define low fluctuation anomaly threshold θ1 and high fluctuation anomaly threshold θ2; when When the current electricity consumption and electricity fee fluctuations are considered normal; when When the current electricity consumption and electricity fee fluctuations are considered to be slightly abnormal fluctuations; when When the current electricity consumption and electricity price fluctuations are considered to be severe abnormal fluctuations.

7. The method for analyzing abnormal fluctuations in power consumption and electricity charges according to claim 6, characterized in that: The short-term fluctuation at time t is the output result Y s The expression of (t) is as follows: Y s (t)=σ(W s ·h t-1 +U s ·X s (t)+b s ); Among them, h t-1 is the hidden state at time t-1, W s is the weight matrix of the hidden state, X s (t) is the value of the short-term abnormal power characteristic at time t, b s is the bias term, σ is the activation function, U s is the value of the short-term abnormal power characteristic at time t X s (t) weight matrix; The output result Y of the periodic fluctuation layer at time t c The expression of (t) is as follows: Among them, η k is the autoregressive coefficient, X c (tk) represents the periodic abnormal power characteristics at time (tk), δ j is the moving average coefficient, ∈ t-j represents the forecast error of ARIMA at time tj, ∈ t represents the random error of ARIMA at the current time t, p represents the order of the autoregressive term, q represents the order of the moving average term, k is the time step index of the autoregressive term, and j is the time step index of the moving average term.

8. A system for analyzing abnormal fluctuations in electric power consumption and electric power charges, based on the method for analyzing abnormal fluctuations in electric power consumption and electric power charges according to any one of claims 1 to 7, characterized in that: Including, data acquisition module, acquisition frequency adjustment module, feature extraction module and fluctuation anomaly analysis module; Data collection module: used to collect electricity consumption and electricity fee data through power equipment; Collection frequency adjustment module: used to calculate the electricity charge change rate of the current period based on the electricity charge data; monitor the electricity charge fluctuation in real time according to the electricity charge change rate; dynamically adjust the data collection frequency through the electricity charge fluctuation adaptive collection mechanism; Feature extraction module: used to extract key features that affect the rate of change of electricity consumption and electricity charges by using the adaptive Pearson correlation coefficient based on kernel time series, and split them based on different time scales; Fluctuation anomaly analysis module: used to obtain a multi-scale time series analysis model, input the split key features into the multi-scale time series analysis model, and analyze the fluctuation anomalies of electricity consumption and electricity charges.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method for analyzing abnormal fluctuations in electricity consumption and electricity charges according to any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method for analyzing abnormal fluctuations in electricity consumption and electricity charges according to any one of claims 1 to 7 are implemented.