Electric power abnormal fluctuation detection method and system fused with time sequence modeling

By integrating time series modeling and fully connected networks to generate adaptive dynamic threshold ranges, the problems of industry differences and time misalignment in power anomaly detection are solved, enabling precise anomaly monitoring and forward-looking early warning of macro-industry power consumption, and reducing system maintenance costs.

CN121682584APending Publication Date: 2026-03-17国网福建省电力有限公司营销服务中心 +1
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202511826684.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-05
Publication Date
2026-03-17

AI Technical Summary

Technical Problem

Existing technologies rely on manually setting fixed thresholds for detecting abnormal power fluctuations. This fails to consider the differences in electricity consumption characteristics across different industries, making it difficult to adapt to changes in power consumption patterns. Consequently, false alarms and missed alarms occur frequently, and there is a lack of mechanisms to handle the impact of special events and time misalignments.

Method used

A time series modeling approach is adopted, which constructs a time series model through the L-BFGS quasi-Newton method and combines it with a fully connected network to generate an adaptive dynamic threshold range. Considering industry characteristics and external risks, a CNN-LSTM-Attention architecture is used for short-term prediction, and the threshold is dynamically adjusted to adapt to changes in electricity consumption patterns.

Benefits of technology

It enables precise anomaly monitoring of power consumption across macro-industries, reduces false alarm and missed alarm rates, improves the foresight of power fluctuation detection and system maintenance costs, and has cross-industry generalization capabilities.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121682584A_ABST
    Figure CN121682584A_ABST
Patent Text Reader

Abstract

The invention discloses an abnormal power fluctuation detection method and system fused with time sequence modeling. The method comprises the following steps: acquiring daily electric quantity year-on-year data of each industry and an industry power consumption data set; the method comprises the following steps: constructing a time sequence model based on year-on-year data of daily electric quantity of each industry, calculating posterior distribution of a predicted value of the time sequence model through an L-BFGS quasi-Newton method, and calculating a data basic confidence interval of a next time point; inputting each characteristic value of the time sequence model one day before the date to be predicted, the mean absolute error of the predicted value of the short-term historical window time sequence model, the residual standard deviation and the industry power consumption data set into a full-connection network to obtain a heteroscedasticity confidence interval; and calculating a final threshold interval based on the two confidence intervals to carry out industry electricity consumption abnormity judgment. According to the method, the problem that the phenomena of false alarm and missing report occur frequently due to the fact that the power utilization characteristic difference between different industries is not considered and the change of the electric quantity rule along with time is difficult to adapt in the prior art is solved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The application belongs to the technical field of power data anomaly detection, and particularly relates to a power abnormal fluctuation detection method and system fusing time series modeling. BACKGROUND

[0002] In the field of power anomaly detection, existing technologies are mostly focused on micro power consumption behavior analysis on the user side, and the adaptive threshold method still relies on manual intervention and labeling for threshold correction, lacking a solution that is completely data-driven, applicable to macro industry daily power data and has cross-industry generalization capability. For example, the Chinese patent with the publication number CN120262702B discloses an intelligent power meter abnormal power consumption detection method and system based on data analysis. The invention enhances complex pattern recognition capability through three-layer clustering and probability density function, and identifies individual user abnormalities. The Chinese patent with the publication number CN120296640B discloses a power consumption anomaly detection method based on big data. The invention introduces multi-scale fusion and concept drift detection. When an anomaly occurs, individual anomalies and group mode changes are distinguished by combining multi-scale anomaly scores and group deviation rates. Then, threshold correction is performed through manual intervention and labeling. The Chinese patent with the publication number CN120449070A discloses a power marketing business online auditing integrated machine digital auditing system and method. The invention proposes dynamic threshold and curve curvature analysis. The threshold setting and adjustment are based on historical curvature data (mean, standard deviation). For macro-level industry daily power, the industry generally uses fixed thresholds based on experience or historical rules to trigger daily power anomaly fluctuation alarms.

[0003] In addition, existing solutions have difficulty in triggering threshold update mechanisms, or rely on threshold setting based on fixed statistics, which makes them lack adaptive ability to differences between different industries and makes it difficult to respond flexibly to dynamic changes over time. The static fixed threshold method based on experience often cannot adapt to the generalization requirements of multiple industries, fails to fully reflect the differences in power consumption characteristics of different industries, and is highly dependent on expert knowledge or manual adjustment, with high maintenance cost and delayed response. For example, the Chinese patent with the publication number CN117689083A discloses a daily power management method, device, system and medium. The invention uses a fixed preset threshold to judge power consumption deviation, and ignores the differences in industry power consumption characteristics, which can easily cause abnormal fluctuation misjudgment. In addition, existing methods generally lack effective processing mechanisms for special major events, multi-mode periodic changes caused by time misalignment of same period data due to leap years, etc. SUMMARY

[0004] The purpose of the present application is to provide a power abnormal fluctuation detection method and system fusing time series modeling, so as to solve the problem that the prior art generally relies on manual setting of fixed threshold, neither considers the difference in power consumption characteristics between different industries, nor adapts to the change of power law over time, resulting in frequent false positives and false negatives, improve the accuracy and foresight of power abnormal fluctuation detection, effectively reduce misjudgment and reduce system maintenance cost.

[0005] The technical scheme of the present application is as follows: In one aspect, the present application provides a power abnormal fluctuation detection method fusing time series modeling, comprising the following steps: Obtain the daily electricity consumption data of each industry and the industry electricity consumption dataset including the standard deviation of the daily electricity consumption data of each industry and the data skewness, industry name, predicted day temperature same period, holiday information; Based on the daily electricity consumption data of each industry, a time series model is constructed, and the maximum a posteriori estimation of the unknown parameters of each feature value in the time series model is calculated and integrated by L-BFGS quasi-Newton method to obtain the posterior distribution of the time series model prediction value; Based on the posterior distribution of the time series model prediction value, the data-based confidence interval of the next time point is obtained, and the time series model of the previous day of the predicted date, the average absolute error of the short-term historical window time series model prediction value, the residual standard deviation and the industry electricity consumption dataset are input into the fully connected network to obtain the heteroscedastic confidence interval, and the final threshold interval is calculated based on the data-based confidence interval and the heteroscedastic confidence interval, and the industry electricity consumption abnormality is judged based on the final threshold interval.

[0006] Preferably, the time series model based on the daily electricity consumption data of each industry is specifically:

[0007] In the formula, represents the daily electricity consumption data of the industry; is a trend item, used to fit the non-periodic change of time series data; is a seasonal item, used to fit the periodic change; is an event item, used to fit the effect of major events lasting for one to several days occurring at irregular time points; is a same-period weekly seasonal adaptive item, used to fit the weekly seasonal change with the same period but different patterns; is an error term, used to represent special changes that have not been fitted, and the error term is set to follow a homoscedastic normal distribution.

[0008] Preferably, the calculation of the trend item is represented as:

[0009] where, is the trend term; is the base growth rate, assuming a trend change point occurs at time , ; is the vector representing the amount of change in growth rate, , represents the amount of change in growth rate at time , which follows a prior distribution with prior parameters directly controlling the flexibility of trend change; the growth rate at any time is the sum of the base growth rate and all the change amounts before that time point, is used to simplify the expression, and satisfies ; represents the growth rate at time , is the base offset; is the smooth transition parameter at the trend change point, whose components ensure the continuity of the function; The calculation of the seasonal term is represented as:

[0010] where, is the seasonal term; is the Fourier series truncation order, ; and are the Fourier coefficients to be learned; is the period length, represents the annual seasonal effect, represents the weekly seasonal effect, and the parameter vector is denoted as , which follows a prior distribution , is the standard deviation of the seasonal term prior distribution; The calculation of the event term is represented as:

[0011] where, is the event term; is the event feature matrix, ; is the total number of events; assuming that the effects of each event are independent, is the impact time window of the th event, which is the set of historical dates of the event and future dates to be predicted, The event effect coefficient that needs to be learned. The prior distribution as a parameter, These are the default prior parameters; The calculation of the year-on-year weekly seasonal adaptive term is expressed as follows:

[0012] In the formula, This is a year-on-year weekly seasonal adaptive term; , used to characterize periodic features; For the parameter matrix, , , , The year-on-year weekly seasonal adaptive effect coefficient needs to be learned; , , Unfold and merge into a one-dimensional parameter vector, denoted as ,but , Follows prior distribution ; , This is used to identify whether the corresponding date falls within the leap year's influence period, which is the period from February 29th of the leap year to February 28th of the following year.

[0013] Preferably, the loss function of the fully connected network is expressed as:

[0014] In the formula, The loss function; Total number of industries; The significance level; The actual daily electricity consumption on the forecast date is the same as the previous year. and Industry predictions for fully connected networks The confidence level is The lower and upper bounds of the heteroscedasticity confidence interval; This is the threshold interval width regularization parameter, which is adjusted empirically based on industry needs.

[0015] Preferably, the calculation of the final threshold interval based on the basic confidence interval and the heteroscedasticity confidence interval is as follows: Calculate the population standard deviation based on historical data patterns using the aforementioned confidence intervals:

[0016]

[0017]

[0018] In the formula, , These are the upper and lower bounds of the basic confidence interval for the data, respectively; These are predictions from a time series model; It is a standard normal distribution quantiles; The overall standard deviation is based on historical data patterns. Calculate the population standard deviation considering external risk based on the aforementioned heteroscedasticity confidence interval:

[0019] In the formula, , These are the upper and lower bounds of the heteroscedasticity threshold interval predicted by the fully connected network, respectively. The population standard deviation of the threshold interval is then expressed as:

[0020] Taking into account both historical data and future external risks, the final threshold range is expressed as follows:

[0021] The mechanism by which the fully connected network judges abnormal electricity consumption in the industry based on a threshold range is as follows: If the actual year-on-year value of industry electricity consumption at the next time point exceeds the final threshold range, it will be judged as an abnormal value and an alarm will be issued; at the same time, if the month-on-month difference of industry electricity consumption judged as an abnormal value is within the set range, the alarm will not be repeated for consecutive abnormal values.

[0022] Preferably, the method further includes: constructing a time-series network model based on multi-level feature fusion to predict daily electricity consumption in various industries for the coming week and provide year-on-year warnings on daily electricity consumption. The temporal network model is constructed based on the CNN-LSTM-Attention architecture. The structure of the temporal network model specifically includes: an input layer, a convolutional layer, an LSTM layer, an attention mechanism layer, a fully connected layer, and an output layer.

[0023] Preferably, the time-series network model predicts and provides year-on-year warnings for daily electricity consumption in various industries over the next week, specifically as follows: Using industry daily electricity consumption time series data, daily maximum temperature data and daily minimum temperature data as objects, extract 7N consecutive days of data as historical observation period to form a single training sample. With a sliding step of 1 day, shift the window composed of the historical observation period and the prediction target period backward, and repeatedly generate training samples to form a multi-source multi-channel input sequence. Use the industry daily electricity consumption of the next 7 days immediately adjacent to the 7N-day period as the prediction target. Multi-source, multi-channel input sequences are simultaneously input into a convolutional layer. The convolutional layer adopts a parallel three-branch structure. The three parallel convolutional branches use convolutional kernels of three different scales: large, medium, and small. Each branch captures bi-weekly periodic patterns, weekly periodic patterns, and short-term fluctuation patterns through convolution and pooling operations. The feature maps extracted by the convolutional branches are spliced ​​and fused along the channel dimension, and then input into two LSTM layers to obtain the complete hidden state sequence. The attention mechanism layer receives the complete hidden state sequence output by the LSTM layer. , For the first The hidden state at each time step Calculate the attention score for the length of the input sequence. , It is a learnable weight matrix. It is a bias term. It is a context vector; Simultaneously, based on holiday information, dates are categorized into regular workdays, weekends, statutory holidays, adjusted workdays, the day before a holiday, and the day after a holiday, each corresponding to an integer from 0 to 5. A date embedding vector is then formed by passing this vector through a fully connected layer. Then, it is converted into a date prior bias score through a fully connected layer. , It is a learnable weight matrix, which fuses the attention score with the date prior bias score to obtain the fused score: The final attention weights are then obtained through the softmax function. , To combine the sum of fractions, Given the length of the input sequence; calculate the context vector for weighted fusion. The context vector is passed through a fully connected layer to output the predicted daily electricity consumption of various industries for the next week. Based on the predicted daily electricity consumption of each industry for the coming week, and the corresponding Gregorian and Lunar calendar dates, the year-on-year predicted daily electricity consumption for each industry is calculated. If the year-on-year predicted daily electricity consumption for each industry exceeds the upper limit of the final threshold range, an overly high year-on-year warning is generated. If the year-on-year predicted daily electricity consumption for each industry is less than zero, a negative year-on-year warning is generated.

[0024] On the other hand, the present invention provides a power anomaly fluctuation detection system that integrates time series modeling, including a data acquisition module, a time series modeling module, and an industry power consumption anomaly judgment module; The data acquisition module is used to acquire year-on-year daily electricity consumption data for various industries, as well as industry electricity consumption datasets including the standard deviation and skewness of year-on-year daily electricity consumption values ​​in long-term historical windows of the industry, industry name, year-on-year temperature of the day to be predicted, and holiday information; The time series modeling module is used to build time series models based on year-on-year daily electricity consumption data of various industries. It calculates and integrates the maximum a posteriori estimate of the unknown parameters of each feature value in the time series model using the L-BFGS quasi-Newton method to obtain the posterior distribution of the predicted values ​​of the time series model. The industry electricity consumption anomaly detection module is used to obtain the basic confidence interval of the data for the next time point based on the posterior distribution of the predicted values ​​of the time series model. It inputs the feature values ​​of the time series model of the day before the predicted date, the mean absolute error and residual standard deviation of the predicted values ​​of the short-term historical window time series model, and the industry electricity consumption dataset into a fully connected network to obtain the heteroscedasticity confidence interval. Based on the basic confidence interval and the heteroscedasticity confidence interval, the final threshold interval is calculated, and the industry electricity consumption anomaly detection is performed based on the final threshold interval.

[0025] In another aspect, the present invention also provides an electronic device, the electronic device comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the power anomaly fluctuation detection method fused with time series modeling as described in any embodiment of the present invention.

[0026] In another aspect, the present invention also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the power anomaly fluctuation detection method fused with time series modeling as described in any embodiment of the present invention.

[0027] Compared with the prior art, the present invention has the following technical effects: 1. This invention elevates the focus of power anomaly detection from the micro-user level to the macro-industry level, filling a technological gap in this field. Existing technologies largely rely on high-frequency sampled user electricity consumption data to identify individual behaviors such as electricity theft and equipment failure, which cannot effectively address industry electricity consumption trend analysis that reflects overall economic operation on a daily basis. This invention focuses on year-on-year daily electricity consumption data for the industry, achieving automated and precise anomaly monitoring of the macro-power economic situation.

[0028] 2. This invention addresses the challenge of dual-cycle analysis of macro-level electricity year-on-year data, which is caused by calendar date misalignment and results in "leap year-non-leap year" dual-cycle problems. It breaks through the limitation of traditional time series models that only use a single cycle mode and innovatively proposes a year-on-year weekly seasonal adaptive module to fit the seasonal effects of different modes in the same cycle. This fundamentally solves the problem of year-on-year value distortion caused by cycle misalignment and significantly improves the accuracy of cycle modeling.

[0029] 3. This invention introduces industry-embedded representation technology, enabling the model to automatically learn and adapt to the inherent volatility characteristics of different industries, generating threshold ranges of varying widths for industries with vastly different volatility. This design endows the system with powerful cross-industry generalization capabilities, completely avoiding misjudgments caused by a "one-size-fits-all" approach.

[0030] 4. This invention proposes an adaptive dynamic threshold generation and decision-making mechanism that integrates external risks. This mechanism not only considers historical fluctuation patterns but also innovatively incorporates external risk characteristics. It can sense the evolution of electricity consumption patterns and the impact of the external environment in real time, dynamically generating an adaptive dynamic threshold range that combines industry characteristics with time sensitivity. This fully automatic closed-loop mechanism is forward-looking and dynamic, significantly reducing false alarm and false negative rates.

[0031] 5. This invention proposes a power anomaly fluctuation detection system and method based on electricity and temperature data, which integrates time series modeling with short-term prediction using deep neural networks. This system can generate adaptive dynamic threshold ranges and provide early warning information on the year-on-year comparison of daily electricity consumption for the next week. The data-driven adaptive dynamic threshold effectively reduces misjudgments and missed detections caused by industry differences, time misalignments, and evolving patterns. The fully data-driven threshold generation and adaptive model updates significantly reduce system maintenance costs. Furthermore, the short-term prediction method provides forward-looking potential warning information, improving the initiative and efficiency of electricity monitoring. It also provides more accurate anomaly detection and early warning, enhancing the reliability and quality of basic power grid electricity data. Attached Figure Description

[0032] Figure 1 This is a schematic diagram showing the year-on-year threshold range of daily electricity consumption for a specific day in 31 manufacturing industries in Fujian Province. Figure 2 This is a schematic diagram of dynamic threshold range anomaly detection for a specific industry in Fujian Province. Detailed Implementation

[0033] To make the objectives, technical solutions, and advantages of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below in conjunction with specific embodiments of the present application and with reference to the accompanying drawings.

[0034] Example 1 This embodiment provides a method for detecting abnormal power fluctuations by incorporating time series modeling. (See attached document.) Figure 1 As shown, it includes the following steps: Acquire year-on-year daily electricity consumption data for various industries, including industry-specific long-term historical data on the standard deviation and skewness of year-on-year daily electricity consumption, industry name, year-on-year temperature for the predicted day, and holiday information. Specifically, obtain actual electricity consumption and temperature data for each industry through the marketing business system and data platform, and aggregate them into daily electricity consumption data for each industry through certain business logic. Then, use the daily electricity consumption data of each industry and the corresponding Gregorian calendar date to calculate the Gregorian calendar year-on-year value of daily electricity consumption for each industry. To eliminate the time misalignment caused by the fluctuation of the Spring Festival date and avoid the year-on-year value being too high or too low due to different Gregorian calendar dates of the Spring Festival, the year-on-year value of the lunar calendar for one month before and after the Spring Festival can be used instead of the Gregorian calendar year-on-year value.

[0035] A time series model is constructed based on the year-on-year daily electricity consumption data of various industries. The posterior distribution of the predicted values ​​of the time series model is obtained by calculating and combining the maximum a posteriori estimates of the unknown parameters of each feature value in the time series model using the L-BFGS quasi-Newton method.

[0036] As a preferred implementation method in this embodiment, the time series model is constructed based on the year-on-year daily electricity consumption data of various industries as follows:

[0037] In the formula, This indicates year-on-year data on daily electricity consumption in the industry; This is the trend term, used to fit the non-periodic changes in time series data; This is a seasonal term used to fit periodic changes; For event terms, used to fit the effects of major events that occur at irregular time points and last for one to several days; This is a year-on-year weekly seasonal adaptive term, used to fit weekly seasonal variations that exist in different patterns within the same period; The error term is used to represent special variations that are not fitted, and the error term is assumed to follow a normal distribution with homoscedasticity.

[0038] In a preferred embodiment of this invention, the trend term is calculated as follows:

[0039] In the formula, This is a trend item; It is the base growth rate, assuming The trend change point occurred at time [time]. , ; It represents the change in the growth rate. dimensional vector, Indicates that it occurred The change in the growth rate at any given time follows a prior distribution. Prior parameters To directly control the flexibility of changing point trends, this embodiment preferably sets the default value to 0.05, which can be modified according to the flexibility of changes in electricity consumption trends. The larger the value, the more flexible the model's fit; at any given time... The growth rate is the base growth rate The sum of all changes up to that point in time, i.e. , Used to simplify expressions. and satisfy ; express Growth rate at any given moment It is the base offset; The components are the smooth transition parameters for the trend change points. This is to ensure the continuity of the function.

[0040] The seasonal term provides a flexible model of periodic effects through Fourier series, where the sequence in... Truncation at this point is equivalent to filtering the seasonality of the sequence, increasing... The value of can identify faster seasonal patterns, and the calculation of the seasonal item is expressed as:

[0041] in, For seasonal items; To truncate the order of a Fourier series, ; and The Fourier coefficients that need to be learned; The period length, Indicates annual seasonal effects. To represent the weekly seasonal effect, the parameter vector is... Recorded as , follows a prior distribution , The standard deviation of the prior distribution of the seasonal term is 10. In this embodiment, the default value is preferably set to 10. Setting a larger value will fit stronger seasonal fluctuations.

[0042] The event term is used to fit the effect of major events occurring at irregular times and lasting one to several days. These events may not conform to a fixed periodic pattern, such as the holiday effect, especially lunar festivals. The calculation of the event term is expressed as follows:

[0043] In the formula, For event items; The event feature matrix, ; The total number of events; the effects of each event are assumed to be independent of each other. It is the first The impact time window of an event is a set of historical dates and future dates that need to be predicted for that event. The event effect coefficient that needs to be learned. The prior distribution as a parameter, As the default prior parameter, this embodiment preferably sets the default value to 10. The larger the value, the stronger the fit of its corresponding effect.

[0044] For year-on-year data, the year-on-year seasonal adaptive term identifies and determines whether the corresponding date falls within the period of influence of leap years on year-on-year data, and then adaptively selects the appropriate mode from two different weekly seasonal modes. The calculation of the year-on-year weekly seasonal adaptive term is expressed as follows:

[0045] In the formula, This is a year-on-year weekly seasonal adaptive term; , used to characterize periodic features; For the parameter matrix, , , , The year-on-year weekly seasonal adaptive effect coefficient needs to be learned; , , Unfold and merge into a one-dimensional parameter vector, denoted as ,but , Follows prior distribution ; , This is used to identify whether the corresponding date falls within the leap year's influence period, which is the period from February 29th of the leap year to February 28th of the following year.

[0046] The L-BFGS quasi-Newton method is a numerical iterative optimization technique. Let the optimization function be... First, set the parameters. , ,in This refers to the geometric decay factor used for progressively reducing the step size in the Armijo conditional line search. These are Armijo condition parameters, used to ensure that the function value at the new iteration point decreases sufficiently; then proceed to the iteration step, setting... It is the first Step-by-step iterative solution, calculate the function to be optimized in gradient If the magnitude of the gradient is less than the termination threshold (a positive number much less than 1, such as 0.000001), then... As an approximate optimal solution, otherwise through a system of linear equations Find the search direction for the next iteration solution. ,in Initialize it as an identity matrix, i.e. , It is the Hessian matrix of the approximate optimization function, used to ensure numerical computation stability. The next step is to find the inequality that satisfies it. The smallest non-negative integer Recorded as ,remember ,but The step size is the distance along the search direction. The distance traveled, and the final update of the next iteration solution. and updating through the correction formula ,in , for the function to be optimized in the th... Step-by-step iterative solution and the first step The gradient difference of the solutions in each iteration. , for the first Step-by-step iterative solution and the first step The numerical difference between the solutions is calculated step by step until the gradient of the optimized function obtained from the approximate solution is less than the termination threshold.

[0047] The basic confidence interval for the next time point is obtained based on the posterior distribution of the predicted values ​​from the time series model. Then, the feature values ​​of the time series model from the day before the predicted date, the mean absolute error and residual standard deviation of the predicted values ​​from the short-term historical window (e.g., 7 days), and the industry electricity consumption dataset are input into a fully connected network to obtain the heteroscedasticity confidence interval. Based on the basic confidence interval and the heteroscedasticity confidence interval, a final threshold interval is calculated. Anomalies in industry electricity consumption are then judged based on the final threshold interval. Specifically, the mean absolute error is calculated as follows: , It is the first 2-day time series model prediction value, No. The predicted true value of the time series model on day 1; the calculation of the residual standard deviation is as follows: assuming the first day... The residual of the day is ,but The standard deviation of the residuals over 7 days can be calculated using the standard deviation formula as follows: By calculating the industry's daily electricity consumption year-on-year data, we can obtain the standard deviation of the daily electricity consumption year-on-year value for a long-term historical window (e.g., 90 days), the skewness of the daily electricity consumption year-on-year data for a long-term historical window (e.g., 90 days), and the industry name. By obtaining temperature data and holiday date data from the marketing business system, we can calculate the year-on-year temperature for the predicted day and holiday information. The industry name is mapped to a low-dimensional variable through an embedding layer to learn the inherent fluctuation patterns of different industries, and then input into a fully connected neural network of 2 to 3 layers.

[0048] As a preferred embodiment of this practice, in order to balance coverage accuracy and interval compactness, and to consider both accuracy and business rationality, a regularization term related to interval width is introduced. Furthermore, to optimize the implementation, the loss function of the fully connected network is expressed as:

[0049] In the formula, The loss function; Total number of industries; The significance level; The actual daily electricity consumption on the forecast date is the same as the previous year. and Industry predictions for fully connected networks The confidence level is The lower and upper bounds of the heteroscedasticity confidence interval; This is the threshold interval width regularization parameter, which can be adjusted empirically based on industry needs.

[0050] As a preferred embodiment of this practice, the calculation of the final threshold interval based on the basic confidence interval and the heteroscedasticity confidence interval is specifically as follows: Calculate the population standard deviation based on historical data patterns using the aforementioned confidence intervals:

[0051]

[0052]

[0053] In the formula, , These are the upper and lower bounds of the basic confidence interval for the data, respectively; These are predictions from a time series model; It is a standard normal distribution quantiles; This represents the overall standard deviation based on historical patterns in the data.

[0054] Calculate the population standard deviation considering external risk based on the aforementioned heteroscedasticity confidence interval:

[0055] In the formula, , These are the upper and lower bounds of the heteroscedasticity threshold interval predicted by the fully connected network, respectively. The population standard deviation of the threshold interval is then expressed as:

[0056] Taking into account both historical data and future external risks, the final threshold range is expressed as follows:

[0057] The mechanism by which the fully connected network judges abnormal electricity consumption in the industry based on a threshold range is as follows: If the actual year-on-year value of industry electricity consumption at the next time point exceeds the final threshold range, it is judged as an anomaly and an alarm is triggered. Simultaneously, if the month-on-month difference in industry electricity consumption judged as an anomaly is within the set range, alarms will not be repeated for consecutive anomalies. Furthermore, for each new year-on-year observation of daily electricity consumption in the industry, it is used as incremental data for time series modeling, updating the anomaly detection parameters. The prior distribution of each parameter in the time series model is replaced by the posterior distribution of the previous time point, ensuring that the method described in this embodiment can capture and adapt to new data patterns while fully utilizing historical information.

[0058] As a preferred embodiment of this practice, the method further includes: constructing a time-series network model based on multi-level feature fusion to predict daily electricity consumption in various industries for the next week and provide year-on-year warnings on daily electricity consumption. The temporal network model is constructed based on the CNN-LSTM-Attention architecture. The structure of the temporal network model specifically includes: an input layer, a convolutional layer, an LSTM layer, an attention mechanism layer, a fully connected layer, and an output layer.

[0059] As a preferred embodiment of this practice, the time-series network model predicts and provides year-on-year warnings for daily electricity consumption in various industries over the next week, specifically as follows: Using industry daily electricity consumption time series data, daily maximum temperature data, and daily minimum temperature data as objects, a continuous 7N days (e.g., 56 days) of data is extracted as a historical observation period to form a single training sample. The window composed of the historical observation period and the prediction target period is shifted backward with a sliding step of 1 day, and the training sample is repeatedly generated to form a multi-source, multi-channel input sequence. The industry daily electricity consumption of the next 7 days immediately following the 7N-day period is used as the prediction target.

[0060] Multi-source, multi-channel input sequences are simultaneously fed into a convolutional layer. This convolutional layer employs a parallel three-branch structure, with three parallel convolutional branches using large, medium, and small kernel sizes (e.g., 14, 7, 3). Each branch, through convolution and pooling operations, transforms the original features into high-level features and compresses the temporal dimension, capturing bi-weekly cyclical patterns, weekly cyclical patterns, and short-term fluctuation patterns. Specifically, the weekly cycle represents the cyclical characteristic of electricity load; the weekly cyclical pattern reflects the regular fluctuations of a weekday followed by the weekend; and the short-term fluctuation pattern can be understood as extracting microscopic, rapidly changing local fluctuation features, such as the transition from Friday to the weekend and from the weekend to Monday.

[0061] The feature maps extracted by the convolutional branches, representing different time scales, are concatenated and fused along the channel dimension to form a comprehensive feature representation rich in multi-period information. This representation is then input into two LSTM layers to obtain the complete hidden state sequence, thereby modeling its deep temporal dependencies. The LSTM layers transmit information through three learnable gating units: a forget gate to determine which previous information to discard, an input gate to determine which new information to store, and an output gate to determine the output at that time step. This effectively learns and captures long-term dependencies that are far apart in the time series.

[0062] The attention mechanism layer receives the complete hidden state sequence output by the LSTM layer. , For the first The hidden state at each time step Calculate the attention score for the length of the input sequence. , It is a learnable weight matrix. It is a bias term. It is a context vector.

[0063] Simultaneously, based on holiday information, dates are categorized into regular workdays, weekends, statutory holidays, adjusted workdays, the day before a holiday, and the day after a holiday, each corresponding to an integer from 0 to 5. These are then mapped to a low-dimensional dense vector through a fully connected layer, forming a date embedding vector. Then, it is converted into a date prior bias score through a fully connected layer, i.e. , It is a learnable weight matrix, which fuses the attention score with the date prior bias score to obtain the fused score: The final attention weights are then obtained through the softmax function. , To combine the sum of fractions; Given the length of the input sequence; calculate the context vector for weighted fusion. The context vector is then passed through a fully connected layer to output the predicted electricity consumption for each industry for the coming week. The attention mechanism dynamically weighs the importance of different time points in historical data and incorporates external prior knowledge such as holidays as adjustment factors into the weight calculation, allowing the model to give higher attention to key dates and ultimately output more accurate electricity consumption predictions for the coming week.

[0064] Based on the predicted daily electricity consumption of each industry for the coming week, and the corresponding Gregorian and Lunar calendar dates, the year-on-year predicted daily electricity consumption for each industry is calculated. If the year-on-year predicted daily electricity consumption for each industry exceeds the upper limit of the final threshold range, an overly high year-on-year warning is generated. If the year-on-year predicted daily electricity consumption for each industry is less than zero, a negative year-on-year warning is generated.

[0065] To verify the effectiveness and superiority of the method provided in this embodiment, some specific examples are provided below: Taking the daily electricity consumption of various industries in Fujian Province from January 1, 2020 to December 31, 2024 as an example, according to... Figure 1 This visually demonstrates the differences in the year-on-year thresholds for daily electricity consumption generated by the abnormal fluctuation detection system across various industries. Due to the different patterns of daily electricity consumption across industries, some industries have smaller year-on-year threshold ranges, while others have larger ranges. Some industries have higher year-on-year daily electricity consumption, while others have lower year-on-year daily electricity consumption. According to... Figure 2 It displays the dynamic changes of the industry's daily electricity consumption year-on-year threshold range over time and the anomaly detection effect.

[0066] As shown in Tables 1 and 2, this embodiment provides examples of daily electricity consumption forecasts and early warnings for various industries over the next week.

[0067] Table 1. Example of short-term daily electricity consumption forecast results for some industries in Fujian Province in the first week of April 2024.

[0068] Table 2 shows the corresponding early warning information for some industries in Fujian Province during the first week of April 2024.

[0069] Example 2 Accordingly, this embodiment provides a power anomaly fluctuation detection system that integrates time series modeling, used to implement the power anomaly fluctuation detection method that integrates time series modeling as described in Embodiment 1, including a data acquisition module, a time series modeling module, and an industry power consumption anomaly judgment module.

[0070] The data acquisition module is used to acquire year-on-year daily electricity consumption data for various industries, as well as industry electricity consumption datasets including the standard deviation and skewness of year-on-year daily electricity consumption values ​​in long-term historical windows of the industry, industry name, year-on-year temperature of the day to be predicted, and holiday information.

[0071] The time series modeling module is used to construct time series models based on year-on-year daily electricity consumption data of various industries. It calculates and integrates the maximum a posteriori estimates of the unknown parameters of each feature value in the time series model using the L-BFGS quasi-Newton method to obtain the posterior distribution of the predicted values ​​of the time series model.

[0072] The industry electricity consumption anomaly detection module is used to obtain the basic confidence interval of the data for the next time point based on the posterior distribution of the predicted values ​​of the time series model. It inputs the feature values ​​of the time series model of the day before the predicted date, the mean absolute error and residual standard deviation of the predicted values ​​of the short-term historical window time series model, and the industry electricity consumption dataset into a fully connected network to obtain the heteroscedasticity confidence interval. Based on the basic confidence interval and the heteroscedasticity confidence interval, the final threshold interval is calculated, and the industry electricity consumption anomaly detection is performed based on the final threshold interval.

[0073] Example 3 This embodiment provides an electronic device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the power anomaly fluctuation detection method based on fusion time series modeling as described in Embodiment 1 of this invention.

[0074] Example 4 This embodiment provides a computer-readable storage medium storing a computer program thereon. When the computer program is executed by a processor, it implements the power anomaly fluctuation detection method fused with time series modeling as described in Embodiment 1 of the present invention.

[0075] In this application embodiment, "at least one" refers to one or more, and "more than one" refers to two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent the existence of A alone, A and B simultaneously, or B alone. A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one of the following" and similar expressions refer to any combination of these items, including any combination of singular or plural items. For example, at least one of a, b, and c can represent: a, b, c, a and b, a and c, b and c, or a and b and c, where a, b, and c can be single or multiple.

[0076] Those skilled in the art will recognize that the units and algorithm steps described in the embodiments disclosed herein can be implemented using electronic hardware, computer software, or a combination of electronic hardware and software. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0077] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0078] In the several embodiments provided in this application, any function, if implemented as a software functional unit and sold or used as an independent product, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0079] The above description is merely an embodiment of the present invention and does not limit the patent scope of the present invention. Any equivalent structural or procedural transformations made based on the content of the present invention's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of the present invention.

Claims

1. A method of power anomaly fluctuation detection fusing time series modeling, characterized in that, The method comprises the following steps: obtaining daily electricity consumption same-period data of each industry and an industry electricity consumption dataset comprising a standard deviation of daily electricity consumption same-period values of a long-term historical window of the industry, data skewness, an industry name, daily temperature same-period values to be predicted, and holiday information; constructing a time series model based on the daily electricity consumption same-period data of each industry, calculating and comprehensively integrating maximum a posteriori estimates of unknown parameters of each characteristic value in the time series model by using an L-BFGS quasi-Newton method to obtain a posterior distribution of a prediction value of the time series model; obtaining a data-based confidence interval of a next time point based on the posterior distribution of the prediction value of the time series model, inputting each characteristic value of the time series model of the day to be predicted, a mean absolute error of a short-term historical window time series model prediction value, a residual standard deviation, and the industry electricity consumption dataset into a fully connected network to obtain a heteroscedasticity confidence interval, calculating a final threshold interval based on the data-based confidence interval and the heteroscedasticity confidence interval, and performing industry electricity consumption anomaly judgment based on the final threshold interval.

2. The method of claim 1, wherein the method of detecting power anomaly fluctuation by fusion time series modeling is characterized by, The time series model is constructed based on the daily electricity consumption same-period data of each industry, and the construction comprises the following steps: wherein, represents the industry daily electricity consumption year-on-year data; is a trend term, used to fit the non-periodic changes of the time series data; is a seasonal term, used to fit the periodic changes; is an event term, used to fit the effects of major events lasting for one to several days occurring at irregular time points; is a year-on-year week seasonal adaptive term, used to fit the week seasonality changes with the same period but different patterns; is an error term, used to represent the special changes not fitted, and the error term is set to follow a normal distribution with homoscedasticity.

3. The method of claim 2, wherein the method further comprises: the calculation of the trend term is represented as: where is the trend term; is the base growth rate, assuming a trend change point occurs at time , ; is a dimensional vector representing the amount of change in the growth rate, represents the amount of change in the growth rate that occurs at time , which follows a prior distribution , with prior parameters directly controlling the flexibility of the change in the trend. The growth rate at any time point is the sum of the basic growth rate and all the changes before that time point, For simplifying the expression, And meet ; Indicates The growth rate at the time point, Is the basic offset; The smooth transition parameter of the trend change point, its component To ensure the continuity of the function;​ the calculation of the seasonal term is represented as: where is a seasonal term; is a Fourier series truncation order, ; and are Fourier coefficients to be learned; is a period length, denotes annual seasonal effects, denotes weekly seasonal effects, and the parameter vector is denoted by and is subject to a prior distribution , is a seasonal term prior distribution standard deviation; the calculation of the event term is represented as: wherein, is the event item; is the event feature matrix, ; is the total number of events; it is assumed that the effects of individual events are independent, is the impact time window of the th event, which is the set of historical dates of the event and future dates that need to be predicted, is the event effect coefficient to be learned, is the prior distribution of the parameters, is the default prior parameter; the calculation of the same-period week seasonal adaptive term is represented as: wherein is the same-week seasonality adaptive term; , for characterizing the periodic feature; is a parameter matrix, , , , is the same-week seasonality adaptive effect coefficient to be learned; will be , , is expanded and merged into a one-dimensional parameter vector denoted as then , obeys the prior distribution ; , , for identifying whether the corresponding date is in the leap year influence period, the leap year influence period is the date range from February 29 of the leap year to February 28 of the next year.

4. The method of claim 1, wherein the method of detecting power anomaly fluctuation by fusion time series modeling is characterized by, the loss function of the fully connected network is represented as: wherein, is the loss function; is the total number of industries; is the significance level; is the actual daily electricity consumption of the day to be predicted compared with the same period last year; and are the confidence levels of the industry predicted by the full connection network, respectively; are the lower and upper bounds of the heteroscedastic confidence interval of is the threshold interval width regularization parameter, which is empirically adjusted according to the industry demand.

5. The method of claim 4, wherein the method further comprises: the final threshold interval is calculated based on the data-based confidence interval and the heteroscedasticity confidence interval, and the calculation comprises the following steps: the overall standard deviation based on data historical rules is calculated based on the data-based confidence interval: wherein , are the upper and lower bounds of the data-based confidence interval, respectively; is the time series model prediction value; is the quantile of the standard normal distribution; is the population standard deviation based on the historical pattern of the data;​ the overall standard deviation considering external risks is calculated based on the heteroscedasticity confidence interval: In the formula, , are respectively the upper and lower bounds of the heteroscedastic threshold interval predicted by the fully connected network. the overall standard deviation of the threshold interval is represented as: the final threshold interval is obtained by fusing the consideration of historical data and future external risks: the mechanism of the fully connected network for performing industry electricity consumption anomaly judgment based on the threshold interval is as follows: if the real same-period value of the industry electricity consumption at the next time point exceeds the final threshold interval, it is determined as an abnormal value for alarm; meanwhile, if the relative difference of the industry electricity consumption determined as an abnormal value is within a set range, the continuous abnormal values are not repeatedly alarmed.

6. The method of claim 1, wherein the method of detecting power anomaly fluctuation by fusion time series modeling is characterized by, The method further comprises constructing a time series network model based on multi-level feature fusion to predict future weekly industry daily electricity consumption and perform daily electricity consumption same-period early warning: The time series network model is constructed based on a CNN-LSTM-Attention architecture, and the structure of the time series network model comprises an input layer, a convolutional layer, an LSTM layer, an attention mechanism layer, a fully connected layer, and an output layer.

7. The method of claim 6, wherein the method further comprises: The time series network model predicts future weekly industry daily electricity consumption and performs daily electricity consumption same-period early warning, and the prediction and early warning comprise the following steps: industry daily electricity consumption time series data, daily maximum temperature data, and daily minimum temperature data are taken as objects, 7N consecutive days of data are intercepted as a historical observation period to constitute a single training sample, a window composed of the historical observation period and a prediction target period is shifted backward by 1 day as a sliding step, training samples are repeatedly generated, a multi-source multi-channel input sequence is formed, and 7N days of industry daily electricity consumption immediately following the 7N days are taken as a prediction target. Multi-source multi-channel input sequences are simultaneously input to a convolutional layer, which adopts a parallel three-branch structure, and three parallel convolutional branches respectively adopt three different scale convolution kernels of large, medium and small, and each branch captures a two-week periodic pattern, a one-week periodic pattern and a short-term fluctuation pattern through convolution and pooling operations; The feature maps extracted by the convolutional branches are spliced and fused in the channel dimension, and input to two LSTM layers to obtain the entire hidden state sequence; The attention mechanism layer receives the entire sequence of hidden states output by the LSTM layer , is the hidden state for the th time step, is the length of the input sequence, the attention score is computed as , is a learnable weight matrix, is a bias term, is the context vector; At the same time, according to the holiday information, the date is divided into ordinary working days, weekends, statutory holidays, adjusted working days, the day before the holiday, the day after the holiday, and corresponds to integers 0 to 5 respectively, and passes through a full connection layer to form a date embedding vector , and then through a full connection layer to convert into a date prior bias score, that is , is a learnable weight matrix, and the attention score and the date prior bias score are fused to obtain a fusion score: , and then through a softmax function to obtain the final attention weight , is the sum of the fusion scores, is the input sequence length; calculate the weighted fusion context vector , pass the context vector through a full connection layer to output the prediction value of each industry daily electricity consumption in the next week; Based on the predicted values of the daily electricity consumption of each industry in the future week, the new calendar same period and the lunar calendar same period date, the corresponding daily electricity consumption of each industry is calculated, if the daily electricity consumption of each industry is more than the upper limit of the final threshold interval, the same period is generated, if the daily electricity consumption of each industry is less than zero, the same period is generated.

8. A power anomaly fluctuation detection system fusing time series modeling, characterized by, The system is used to realize the power abnormal fluctuation detection method of fusion time series modeling as claimed in any one of claims 1 to 7, comprising a data acquisition module, a time series modeling module and an industry electricity consumption anomaly judgment module; The data acquisition module is used to acquire daily electricity consumption of each industry and industry electricity data set including industry long-term historical window daily electricity consumption same period standard deviation and data skewness, industry name, predicted day temperature same period, holiday information; The time series modeling module is used to construct a time series model based on the daily electricity consumption of each industry, and to calculate and integrate the maximum a posteriori estimation of the unknown parameters of each feature value in the time series model to obtain the posterior distribution of the time series model prediction value by L-BFGS quasi-Newton method; The industry electricity consumption anomaly judgment module is used to obtain the data-based confidence interval of the next time point based on the posterior distribution of the time series model prediction value, and input the time series model feature values of the predicted date, the mean absolute error of the short-term historical window time series model prediction value, the residual standard deviation and the industry electricity data set into a fully connected network to obtain the heteroscedastic confidence interval, and calculate the final threshold interval based on the data-based confidence interval and the heteroscedastic confidence interval, and judge the industry electricity consumption anomaly based on the final threshold interval.

9. An electronic device, comprising: Memory, processor and computer program stored on the memory and executable on the processor, characterized in that the processor executes the computer program to realize the power abnormal fluctuation detection method of fusion time series modeling as claimed in any one of claims 1 to 7.

10. A computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to realize the power abnormal fluctuation detection method of fusion time series modeling as claimed in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Daily electric quantity management method, device and system and medium

    CN117689083A

  • Abnormal power consumption detection method and system for smart meters based on data analysis

    CN120262702B

  • Power anomaly detection method based on big data

    CN120296640B

  • Electric power marketing business online auditing all-in-one machine digital auditing system and method

    CN120449070A