Public building load anomaly identification method and device, storage medium and equipment
By constructing a load anomaly identification model for public buildings and utilizing multi-manifold spectrum and Transformer mask reconstruction techniques, the problems of low efficiency and insufficient accuracy in load anomaly identification of public buildings are solved, achieving efficient and accurate load anomaly detection.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-28
- Publication Date
- 2026-04-07
AI Technical Summary
Existing technologies for identifying abnormal loads in public buildings are inefficient and have low accuracy. Traditional methods cannot adapt to dynamic changes, and machine learning algorithms are computationally time-consuming and difficult to parallelize.
Based on historical load data, sample daily load curves are constructed, and anomaly identification is performed through mask reconstruction. Combining multi-manifold spectrum algorithm and Transformer mask reconstruction model, anomaly identification models are constructed for different load types.
It improves the accuracy and efficiency of load anomaly identification, reduces computation time, adapts to the needs of different application scenarios, and achieves efficient and accurate anomaly detection.
Smart Images

Figure CN115618248B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer technology, and more specifically, to a method, apparatus, storage medium, and device for identifying load anomalies in public buildings. Background Technology
[0002] As one of the three major sources of energy consumption, public buildings are characterized by high energy consumption per unit area and complex electricity usage patterns. On the one hand, the impact of abnormal electricity consumption in public buildings is relatively greater than that of ordinary residents, placing higher demands on the detection of abnormal electricity consumption. Effective monitoring information on abnormal energy consumption needs to be provided to energy-consuming units and personnel to help them quickly identify existing energy consumption anomalies. On the other hand, the collection of electricity information for public buildings may be affected by various factors, requiring effective methods for detecting and verifying abnormal data. This helps data collection departments to promptly identify problems during the collection process and avoid impacting building operation management, energy-saving diagnosis, and energy efficiency evaluation.
[0003] Public buildings differ significantly from residential buildings in that their load characteristic curves require different anomaly classification criteria and corresponding algorithm parameters. Current public building classifications primarily focus on their functions, but within the same functional building, electrical equipment, power consumption patterns, and pedestrian traffic all influence load characteristics. Currently, anomaly identification in the power industry mainly involves manual inspection and model-based algorithms. Traditional manual inspections of abnormal power consumption are inefficient and inaccurate, failing to identify load anomalies promptly. In contrast, model-based algorithms offer higher accuracy and efficiency for load identification. Common methods include traditional anomaly identification methods and machine learning algorithms. Traditional methods, such as box plots, the 3σ criterion, and threshold methods, are computationally simple but limited by specific conditions and cannot adapt to dynamic changes. Machine learning algorithms that directly identify anomalies, such as isolated forests and LOF algorithms, ignore the context of the time series, resulting in poor performance for public building power load data. Prediction-based machine learning algorithms, such as LSTM, are difficult to parallelize, significantly increasing computation time, especially as data volume grows exponentially; excessive training time can hinder timely model updates.
[0004] There is currently no effective solution to the above problems. Summary of the Invention
[0005] This invention provides a method, apparatus, storage medium, and device for identifying load anomalies in public buildings, thereby at least addressing the technical problems of low detection efficiency and low accuracy in existing load anomaly identification methods.
[0006] According to one aspect of the present invention, a method for identifying load anomalies in public buildings is provided, comprising: constructing sample daily load curves based on historical load data of the public buildings; determining typical daily load curves based on the sample daily load curves and preset target load characteristic indicators; performing clustering processing on the typical daily load curves to determine the load curve type; and using a mask reconstruction method to identify load anomalies in the load data according to the load curve type to obtain anomaly identification results.
[0007] Optionally, the above-mentioned construction of sample daily load curves based on the historical load data of the acquired public buildings includes: obtaining initial load data within a first preset time period from multiple public buildings; preprocessing the initial load data to obtain historical load data; dividing the historical load data into peak season load datasets and off-peak season load datasets according to whether it is a peak season for load use; constructing a first sample daily load curve based on the first load data of the peak season load dataset, and constructing a second sample daily load curve based on the second load data of the off-peak season load dataset.
[0008] Optionally, the above-mentioned preprocessing of the initial load data to obtain historical load data includes: determining missing data values generated during the transmission of the initial load data, wherein the missing data values include: discrete missing values and consecutive missing values; when the missing data value is a discrete missing value, filling it with the average data value within a second preset time period to determine first historical load data; when the missing data value is a consecutive missing value, filling it with the average data value within a third preset time period to determine second historical load data; and determining the historical load data based on the first historical load data and the second historical load data.
[0009] Optionally, the determination of the typical daily load curve based on the sample daily load curve and the preset target load characteristic index includes: extracting the preset target load characteristic index from the sample daily load curve to determine the sample daily load characteristic index vector; performing probability density fitting on the preset target load characteristic index using nonparametric kernel density estimation to obtain the typical daily load index vector; calculating the Euclidean distance between the sample daily load characteristic index vector and the typical daily load index vector to determine the weight value of the sample daily load curve; and performing weighted superposition processing on the sample daily load curve based on the weight value to determine the typical daily load curve.
[0010] Optionally, the above-mentioned clustering process for the typical daily load curves to determine the load curve type includes: clustering the typical daily load curves based on the multi-manifold spectrum algorithm to determine the number of cluster points; and completing the type classification of the load curves based on the number of cluster points.
[0011] Optionally, the above-mentioned method of using mask reconstruction to identify anomalies in load data based on the load curve type and obtain anomaly identification results includes: determining the time series dataset of the load data based on the load curve type; determining the reconstruction time step in the time series dataset, performing mask reconstruction processing on the reconstruction time step to obtain the target time series dataset; performing data encoding and decoding processing on the target time series dataset to obtain the output sequence; calculating the outlier value of the output sequence according to the dynamic threshold segmentation algorithm, and updating the dynamic threshold to complete one anomaly identification operation; repeating the above anomaly identification operation multiple times to obtain the above anomaly identification results.
[0012] According to another aspect of the present invention, a load anomaly identification device for public buildings is also provided, comprising: a construction module for constructing a sample daily load curve based on acquired historical load data of the public building; a determination module for determining a typical daily load curve based on the sample daily load curve and a preset target load characteristic index; a processing module for performing clustering processing on the typical daily load curve to determine the load curve type; and an identification module for performing anomaly identification on the load data according to the load curve type using a mask reconstruction method to obtain anomaly identification results.
[0013] According to another aspect of the present invention, a non-volatile storage medium is also provided, which stores a plurality of instructions adapted for a processor to load and execute any one of the above-described methods for identifying load anomalies in public buildings.
[0014] According to another aspect of the present invention, a processor is also provided, which is configured to run a program, wherein the program is configured to execute any of the above-described methods for identifying load anomalies in public buildings during runtime.
[0015] According to another aspect of the present invention, an electronic device is also provided, including a memory and a processor, wherein the memory stores a computer program and the processor is configured to run the computer program to perform any of the above-described methods for identifying load anomalies in public buildings.
[0016] In this embodiment of the invention, a sample daily load curve is constructed based on the historical load data of the acquired public buildings; a typical daily load curve is determined based on the sample daily load curve and a preset target load characteristic index; the typical daily load curve is clustered to determine the load curve type; and anomaly identification of the load data is performed on the load curve type using a mask reconstruction method to obtain anomaly identification results. This achieves the goal of constructing anomaly identification models based on mask reconstruction for different load types, thereby making the construction of anomaly identification models more targeted and effectively improving the accuracy of anomaly identification. This solves the technical problems of low detection efficiency and low accuracy in existing load anomaly identification methods. Attached Figure Description
[0017] The accompanying drawings, which are included to provide a further understanding of the invention and form part of this application, illustrate exemplary embodiments of the invention and, together with their description, serve to explain the invention and do not constitute an undue limitation thereof. In the drawings:
[0018] Figure 1 This is a flowchart of a method for identifying load anomalies in public buildings according to an embodiment of the present invention;
[0019] Figure 2 This is a flowchart of an optional mask reconstruction method for identifying load anomalies in public buildings according to an embodiment of the present invention;
[0020] Figure 3 This is a flowchart of an optional load type identification method according to an embodiment of the present invention;
[0021] Figure 4 This is a schematic diagram of an optional mask reconstruction timing method according to an embodiment of the present invention;
[0022] Figure 5 This is a structural schematic diagram of a load anomaly identification device for a public building according to an embodiment of the present invention. Detailed Implementation
[0023] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0024] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0025] Example 1
[0026] According to an embodiment of the present invention, an embodiment of a method for identifying load anomalies in public buildings is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.
[0027] Figure 1 This is a flowchart of a method for identifying load anomalies in public buildings according to an embodiment of the present invention, as follows: Figure 1 As shown, the method includes the following steps:
[0028] Step S102: Based on the obtained historical load data of public buildings, construct the sample daily load curve;
[0029] Step S104: Based on the above sample daily load curves and preset target load characteristic indicators, determine the typical daily load curve;
[0030] Step S106: Perform clustering on the above typical daily load curves to determine the load curve type;
[0031] Step S108: Using mask reconstruction, anomalies are identified in the load data based on the above-mentioned load curve types to obtain anomaly identification results.
[0032] In this embodiment of the invention, the execution entity of the public building load anomaly identification method provided in steps S102 to S108 above is a load anomaly identification system. This system obtains historical load data required for load anomaly identification through different channels, transforms and divides the obtained data into a raw sample set suitable for subsequent algorithms, and constructs sample daily load curves. Load characteristic indicators for each public building are extracted, including five items: daily load rate, daily peak-to-valley difference rate, peak load rate, etc., to determine a typical daily load curve. Based on the typical daily load curves, a clustering method based on multi-manifold spectrum (SMMC) is used to cluster the typical load curves of each building, resulting in multiple building load curve types. For different load curve types, anomaly identification models based on Transformer mask reconstruction are constructed to perform anomaly identification, obtaining anomaly identification results.
[0033] It should be noted that different types of load characteristic curves should have different anomaly classification criteria, and the corresponding algorithm parameters should be different. By extracting load characteristic indicators and performing probability density fitting, and combining the clustering method based on multi-manifold spectrum (SMMC), the category classification of public building load curves is obtained. For different load curve types, anomaly recognition models based on Transformer mask reconstruction are constructed to solve the problems of insufficient algorithm accuracy, low efficiency, and limited application scenarios in current related application algorithms.
[0034] As an optional embodiment, such as Figure 2The flowchart shown is for the public building load anomaly identification method based on mask reconstruction. First, the time series data of public buildings is divided into peak and off-peak electricity consumption seasons according to the months of electricity consumption. Based on this, load characteristic indicators for each public building are extracted, including five items: daily load rate, daily peak-valley difference rate, peak load rate, etc. Probability density fitting is performed on these indicators, and then the load curves of the sample days are weighted and superimposed to obtain the final typical daily load curve, so as to ensure that the load curve can reflect the electricity consumption characteristics and patterns of the buildings to the greatest extent. Based on the typical daily load curve, the typical load curves of each building are clustered using a clustering method based on SMMC to obtain multiple building load curve types. For different types, anomaly identification models based on Transformer mask reconstruction are constructed respectively. By adding a load curve classification module, the anomaly detection model is made more targeted, effectively improving the accuracy of anomaly detection. The choice of Transformer mask reconstruction for anomaly detection avoids the drawback of sequential advancement under the recurrent neural network (RNN) framework, which cannot be parallelized, and significantly reduces the time required for anomaly detection. In addition, this method utilizes information from both sides of the current step, avoiding information waste. Furthermore, the model parameters can be set according to the actual application scenario requirements, balancing model accuracy and latency, making it more flexible and solving the problems of insufficient algorithm accuracy, low efficiency, and limited application scenarios in current related application algorithms.
[0035] As an optional implementation, load identification is performed based on the electricity consumption months and load curve characteristics of public buildings, which greatly improves the accuracy of anomaly identification.
[0036] It should be noted that, compared to residential buildings, the load of public buildings is affected by a variety of complex factors, resulting in significant inter-class differences. This invention first divides the time series into peak and off-peak electricity consumption seasons according to the months of electricity consumption. By extracting load characteristic indicators and performing probability density fitting, the load curves of sample days are then weighted and superimposed to obtain the final typical daily load curve. Based on this, a clustering method based on SMMC is used to cluster the typical load curves of each building, making the corresponding anomaly identification algorithms for different types of load curves more targeted, thereby greatly improving the accuracy of anomaly detection and identification.
[0037] As an optional implementation, the Transformer mask reconstruction anomaly detection method is more efficient and accurate than existing methods. The Transformer mask reconstruction anomaly detection method abandons the sequential progression of the RNN framework; its attention mechanism enables parallel operation. Even when high accuracy is required and multiple steps of information before and after a given time point are needed, time can be compressed and latency reduced. Compared to mainstream deep learning algorithms such as LSTM, it is faster and more efficient. Furthermore, this anomaly detection method can capture cross-distance dependencies, taking into account information on both sides of the current time step, making it suitable for anomaly detection in public building load sequences.
[0038] As an optional implementation, two modes of load anomaly data identification models can be implemented by setting model parameters to meet the application requirements of different scenarios. By setting L_(i+) (i.e., the required information step size after the current time point), two anomaly detection methods can be achieved: online detection and high-precision detection with delay. If L_(i+) = 0, the detection of the current time point does not need to use subsequent time-series information; it can be completed using only previous information. Although some accuracy will be lost, it can meet the application requirements of online detection. If L_(i+) > 0, subsequent time-series information needs to be used. The use of bilateral information can improve the model accuracy. Moreover, with a fixed L_(i-), the larger the value of L_(i+), the higher the accuracy, meeting the application requirements of high-latency and high-precision detection.
[0039] Through the embodiments of the present invention, the accurate and efficient method for detecting abnormal electricity consumption data can not only identify abnormal electricity consumption behavior in a timely manner, but also improve the value of the data, thereby facilitating energy planning and the formulation of energy-saving measures, effectively reducing energy waste, and providing theoretical support and implementation path for energy conservation in large public buildings.
[0040] In one optional embodiment, the above-mentioned construction of a sample daily load curve based on the acquired historical load data of public buildings includes: acquiring initial load data within a first preset time period from multiple public buildings; preprocessing the initial load data to obtain historical load data; dividing the historical load data into peak season load datasets and off-peak season load datasets according to whether it is a peak season for load use; constructing a first sample daily load curve based on the first load data of the peak season load dataset, and constructing a second sample daily load curve based on the second load data of the off-peak season load dataset.
[0041] In this embodiment of the invention, the data required for load anomaly identification is obtained through different channels, including 15-minute historical total load data of public buildings, to obtain a dataset Q of historical total load data. The preprocessed dataset is then divided according to whether it is a peak electricity consumption season, resulting in a load dataset Q1 for peak electricity consumption seasons and a load dataset Q2 for off-peak electricity consumption seasons.
[0042] It should be noted that the above-mentioned preprocessing of the initial load data to obtain historical load data includes: determining the missing data values generated during the transmission of the initial load data, wherein the missing data values include: discrete missing values and continuous missing values; when the missing data value is a discrete missing value, filling it with the average data value within a second preset time period to determine the first historical load data; when the missing data value is a continuous missing value, filling it with the average data value within a third preset time period to determine the second historical load data; and determining the historical load data based on the first historical load data and the second historical load data.
[0043] As an optional implementation, missing values caused during data transmission are recorded as missing value anomalies; discrete missing values are filled with the arithmetic mean of the two hours before and after the data transmission, and continuous missing values are filled with the arithmetic mean of each point on the same day of the week before and after the data transmission, to obtain dataset Q, which is convenient for subsequent algorithm use.
[0044] In an optional embodiment, determining the typical daily load curve based on the sample daily load curve and the preset target load characteristic index includes: extracting the preset target load characteristic index from the sample daily load curve to determine the sample daily load characteristic index vector; performing probability density fitting on the preset target load characteristic index using nonparametric kernel density estimation to obtain the typical daily load index vector; calculating the Euclidean distance between the sample daily load characteristic index vector and the typical daily load index vector to determine the weight value of the sample daily load curve; and performing weighted superposition processing on the sample daily load curve based on the weight value to determine the typical daily load curve.
[0045] In this embodiment of the invention, features required for load type identification are extracted. For a single public building, five indicators are extracted from the daily load curve: daily load rate, daily peak-to-valley difference rate, peak load rate, off-peak load rate, and valley load rate, to obtain the daily load characteristic index vector Y for each sample day. i =[X i1 ,X i2 ,X i3 ,X i4 ,X i5 ], i = 1, 2, ..., T.
[0046] It should be noted that the meanings of each indicator are as follows: Daily load factor: X1 = P av / P max The time period is the entire day; daily peak-to-valley difference rate: X2 = (P max -P min ) / P max The time period is the entire day; peak load factor: X3 = P av.peak / P av Time period: 08:00-11:00, 18:00-22:00; Off-peak load factor: X4 = P av.val / P av Time period: 0:00-6:00, 22:00-24:00; Off-peak load factor: X5 = P av.flat / P av The time periods are 6:00-8:00 and 11:00-18:00; where P is the load, max, min, and av represent the maximum, minimum, and average values, respectively, and peak, val, and flat represent the peak, trough, and flat periods, respectively.
[0047] As an optional implementation, nonparametric kernel density estimation is used to perform probability density fitting on the load characteristic index to obtain the typical daily load index vector Y. c ; Calculate Y i With Y c Euclidean distance d i This is used to determine the load curve weight w for sample day i. i (i = 1, 2, ..., T), to ensure that the larger the Euclidean distance, the smaller the weight of the curve, the following calculation formula is defined:
[0048]
[0049]
[0050] In the formula, λ is an adjustable parameter in the interval [0,1], used to adjust d. i For w i To assess the degree of impact, we take λ = 0.5 to calculate the typical daily load curve.
[0051] As an optional implementation, the daily load curves of the sample days are weighted and superimposed to obtain the desired typical daily load curve. Let the daily load data of sample day i be L. i =[l i1 ,l i2 ,…,l i24 Typical daily load data is L c =[l c1 ,l c2 ,…,l c24 ], where l ctThe formula for calculating (t=1,2,…,24) is:
[0052] In one optional embodiment, the above-mentioned clustering process of the typical daily load curves to determine the load curve type includes: clustering the typical daily load curves based on the multi-manifold spectrum algorithm to determine the number of cluster points; and completing the type classification of the load curves based on the number of cluster points.
[0053] In embodiments of the present invention, such as Figure 3 The flowchart shown illustrates the load type identification method, which clusters public buildings based on their typical daily load curves, dividing the dataset into Q groups. 11 Q 12 ,…,Q 1r and Q 21 Q 22 ,…,Q 2g (Assuming that the Q1 and Q2 datasets are clustered into classes r and g respectively), this will serve as the data basis for subsequent outlier detection.
[0054] As an optional implementation, the load curves are clustered based on the SMMC algorithm. A KNN clustering graph is constructed using the nearest neighbor algorithm. The Gaussian kernel function is used to calculate the local similarity of sampling points, the distance between sampling points is calculated, a similarity matrix is constructed, the feature vectors are solved, and KMeans is used to cluster the data points. The Calinski-Harabasz index is selected to determine the optimal number of clusters. The D1 step is repeated iteratively, and the number of clusters that maximizes this index is selected as the final number of clusters. The dataset is divided into Q... 11 Q 12 ,…,Q 1r and Q 21 Q 22 ,…,Q 2g The dataset is divided (Q1 and Q2 datasets can be clustered into r and g classes respectively) to serve as the data basis for subsequent outlier detection.
[0055] In an optional embodiment, the above-mentioned method of using mask reconstruction to identify anomalies in load data based on the load curve type and obtain anomaly identification results includes: determining the time series dataset of the load data based on the load curve type; determining the reconstruction time step in the time series dataset, performing mask reconstruction processing on the reconstruction time step to obtain a target time series dataset; performing data encoding and decoding processing on the target time series dataset to obtain an output sequence; calculating the outlier value of the output sequence according to a dynamic threshold segmentation algorithm, and updating the dynamic threshold to complete one anomaly identification operation; repeating the above anomaly identification operation multiple times to obtain the above anomaly identification results.
[0056] In embodiments of the present invention, such as Figure 4 The diagram shown illustrates a mask reconstruction time series method. It uses Transformer mask reconstruction to identify anomalies in the load data. The process involves cyclically masking, encoding, and decoding the time series data at each time step to complete the anomaly identification task in the time series and then evaluating the model based on the labeled data.
[0057] As an optional implementation, annotated abnormal data can be obtained by combining expert knowledge with traditional anomaly detection methods, serving as a reference for determining the reasonableness of subsequent anomaly detection results; for the input sequence X = [X1, X2, ..., X...] n (Here, n is Q) 11 Q 12 ,…,Q 1r ∈Q1, Q 21 Q 22 ,…,Q 2g The length of ∈Q2 is used to select the time step to be reconstructed (e.g., X2), which is replaced with the [mask] flag and masked in the subsequent model. After a layer of position embedding, it enters the Transformer encoder, and through the attention calculation mechanism, feedforward neural network, and summation regularization process, the encoded sequence is obtained. This encoder is designed for different inputs x. i Mapping different implicit codes c i The nonlinear mapping is defined as follows:
[0058]
[0059] Among them, the implicit code c i It utilizes an attention mechanism, using different weight vectors at different time steps to calculate c. i At time t, the t-th input x i For y i The formula for calculating the weight is: in, To accelerate the convergence coefficient (n is the number of channels).
[0060] Optionally, the decoder can be used to process c. i-1 Perform decoding to obtain the output sequence Y, where y is the value at time i. i According to c i-1 and y1, y2, ..., y before time i i-1 ,c i-1 To generate it, its corresponding nonlinear mapping function is defined as:
[0061] y i=g(y1,y2,…,y i-1 ,c i-1 );
[0062] Optionally, calculate the reconstructed error sequence e. i =y i -y′ i By using a dynamic threshold segmentation method, based on e i The dynamic threshold ε is calculated as follows: ε = μ(e i )+zσ(e i ), where μ(·) is the mean, σ(·) is the standard deviation, and z is the weighting coefficient, and the threshold is updated after an anomaly is detected.
[0063] It should be noted that the specific calculation formula is as follows: Wherein, Δσ(e i )=σ(e i )-σ({e i ∈e i |e i <ε}), Δμ(e i )=μ(e i )-μ({e i ∈e i |e i <ε}),e a ={e i ∈e i |e i <ε} represents all normal sequences following the occurrence of the previous anomaly, P j ={e a} represents all normal sequences. Repeat the above steps until anomaly detection is completed for all time points in the time series.
[0064] Optionally, the model evaluation uses a range bias metric, adding an OverlapReward value to the Point-based evaluation, where Ri is the true outlier. i The OverlapReward with the predicted value set P is calculated as follows:
[0065]
[0066]
[0067] Where w(·) is the overlap size function, which measures the overlap between the true anomaly subsequence and the predicted anomaly subsequence; γ(·) is the overlap cardinality function, which measures how many predicted anomaly subsequences correspond to a true anomaly subsequence. Generally, the more predicted values that overlap with the true anomaly, the lower the score; δ(·) is the position bias function. For example, when prioritizing the leading edge, the closer the leading edge of the predicted anomaly is to the leading edge of the true anomaly, the higher the score. When prioritizing the center, the closer the center of the predicted anomaly is to the center of the true anomaly, the higher the score.
[0068] Through the above steps, anomaly detection models based on Transformer mask reconstruction can be constructed for different types of anomalies. By adding a load curve classification module, the construction of the anomaly detection model becomes more targeted, effectively improving the accuracy of anomaly detection. Choosing Transformer mask reconstruction for anomaly detection avoids the drawback of sequential advancement under the (Recurrent Neural Network) framework, which cannot be parallelized, significantly reducing the time required for anomaly detection. In addition, the embodiments of this application also utilize the information from both sides of the current step, avoiding information waste. Furthermore, model parameters can be set according to the actual application scenario requirements, balancing model accuracy and latency, making it more flexible and solving the problems of insufficient algorithm accuracy, low efficiency, and limited application scenarios in current related application algorithms.
[0069] Example 2
[0070] According to an embodiment of the present invention, an apparatus embodiment for implementing the above-described method for identifying load anomalies in public buildings is also provided. Figure 5 This is a structural schematic diagram of a load anomaly identification device for a public building according to an embodiment of the present invention, as shown below. Figure 5 As shown, the above-mentioned device includes: a construction module 50, a determination module 52, a processing module 54, and an identification module 56, wherein:
[0071] Module 50 is used to construct sample daily load curves based on the acquired historical load data of public buildings;
[0072] The determination module 52 is used to determine the typical daily load curve based on the above sample daily load curve and the preset target load characteristic index;
[0073] Processing module 54 is used to perform clustering processing on the above typical daily load curves to determine the load curve type;
[0074] The identification module 56 is used to identify anomalies in the load data based on the above-mentioned load curve type by using a mask reconstruction method, and to obtain the anomaly identification result.
[0075] It should be noted that the above-mentioned construction module 50, determination module 52, processing module 54 and identification module 56 correspond to steps S102 to S108 in Embodiment 1. The four modules and the corresponding steps implement the same instances and application scenarios, but are not limited to the content disclosed in Embodiment 1.
[0076] It should be noted that the preferred implementation of this embodiment can be found in the relevant description in Embodiment 1, and will not be repeated here.
[0077] According to an embodiment of the present invention, an embodiment of a computer-readable storage medium is also provided. Optionally, in this embodiment, the computer-readable storage medium can be used to store the program code executed by the public building load anomaly identification method provided in Embodiment 1 above.
[0078] Optionally, in this embodiment, the computer-readable storage medium may be located in any computer terminal in a group of computer terminals in a computer network, or in any mobile terminal in a group of mobile terminals.
[0079] Optionally, in this embodiment, the computer-readable storage medium is configured to store program code for performing the following steps: constructing a sample daily load curve based on the acquired historical load data of public buildings; determining a typical daily load curve based on the sample daily load curve and a preset target load characteristic index; performing clustering processing on the typical daily load curve to determine the load curve type; and using a mask reconstruction method to identify anomalies in the load data according to the load curve type to obtain anomaly identification results.
[0080] Optionally, the aforementioned computer-readable storage medium is configured to store program code for performing the following steps: obtaining initial load data within a first preset time period from multiple of the aforementioned public buildings; preprocessing the aforementioned initial load data to obtain historical load data; dividing the aforementioned historical load data into peak season load datasets and off-peak season load datasets according to whether it is a peak season for load usage; constructing a first sample daily load curve based on the first load data of the aforementioned peak season load dataset, and constructing a second sample daily load curve based on the second load data of the aforementioned off-peak season load dataset.
[0081] Optionally, the aforementioned computer-readable storage medium is configured to store program code for performing the following steps: determining missing data values generated during the initial load data transmission process, wherein the missing data values include discrete missing values and consecutive missing values; when the missing data value is a discrete missing value, filling it with the average data value within a second preset time period to determine first historical load data; when the missing data value is a consecutive missing value, filling it with the average data value within a third preset time period to determine second historical load data; and determining the historical load data based on the first historical load data and the second historical load data.
[0082] Optionally, the aforementioned computer-readable storage medium is configured to store program code for performing the following steps: extracting the aforementioned preset target load characteristic index from the aforementioned sample daily load curve to determine the sample daily load characteristic index vector; performing probability density fitting on the aforementioned preset target load characteristic index using nonparametric kernel density estimation to obtain the typical daily load index vector; calculating the Euclidean distance between the aforementioned sample daily load characteristic index vector and the aforementioned typical daily load index vector to determine the weight value of the aforementioned sample daily load curve; and performing weighted superposition processing on the aforementioned sample daily load curve based on the aforementioned weight value to determine the aforementioned typical daily load curve.
[0083] Optionally, the aforementioned computer-readable storage medium is configured to store program code for performing the following steps: clustering the aforementioned typical daily load curves based on a multi-manifold spectrum algorithm to determine the number of cluster points; and classifying the aforementioned load curves according to the number of cluster points.
[0084] Optionally, the aforementioned computer-readable storage medium is configured to store program code for performing the following steps: determining the time series dataset of the load data based on the aforementioned load curve type; determining the reconstruction time step in the aforementioned time series dataset, performing mask reconstruction processing on the aforementioned reconstruction time step to obtain the target time series dataset; performing data encoding and data decoding processing on the aforementioned target time series dataset to obtain the output sequence; calculating the outlier value of the aforementioned output sequence according to the dynamic threshold segmentation algorithm, and updating the dynamic threshold to complete one anomaly identification operation; repeating the aforementioned anomaly identification operation multiple times to obtain the aforementioned anomaly identification result.
[0085] According to an embodiment of the present invention, an embodiment of a processor is also provided. Optionally, in this embodiment, the computer-readable storage medium described above can be used to store the program code executed by the public building load anomaly identification method provided in Embodiment 1 above.
[0086] This application provides an electronic device, which includes a processor, a memory, and a program stored in the memory and executable on the processor. When the processor executes the program, it performs the following steps: constructing a sample daily load curve based on the acquired historical load data of public buildings; determining a typical daily load curve based on the sample daily load curve and a preset target load characteristic index; performing clustering processing on the typical daily load curve to determine the load curve type; and using a mask reconstruction method to identify anomalies in the load data according to the load curve type to obtain anomaly identification results.
[0087] This application also provides a computer program product, which, when executed on a data processing device, is suitable for executing an initialization program with the following method steps: constructing sample daily load curves based on the acquired historical load data of public buildings; determining typical daily load curves based on the sample daily load curves and preset target load characteristic indicators; performing clustering processing on the typical daily load curves to determine the load curve type; and using a mask reconstruction method to identify anomalies in the load data according to the load curve type to obtain anomaly identification results.
[0088] The sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0089] In the above embodiments of the present invention, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0090] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units can be a logical functional division, and in actual implementation, there may be other division methods. For instance, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual coupling, direct coupling, or communication connection may be through some interfaces; the indirect coupling or communication connection between units or modules may be electrical or other forms.
[0091] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0092] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0093] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or 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 the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.
[0094] The above description is only a preferred embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.
Claims
1. A method for identifying load anomalies in public buildings, characterized in that, include: Based on the historical load data of the public buildings obtained, a sample daily load curve is constructed; Based on the sample daily load curve and the preset target load characteristic index, a typical daily load curve is determined, wherein the preset target load characteristic index includes: daily load rate, daily peak-to-valley difference rate, peak period load rate, flat period load rate, and valley period load rate. Clustering is performed on the typical daily load curves to determine the load curve type; Anomaly identification results are obtained by using a mask reconstruction method to identify anomalies in the load data based on the load curve type. The method of using mask reconstruction to identify anomalies in load data based on the load curve type and obtaining anomaly identification results includes: determining the time series dataset of the load data based on the load curve type; determining the reconstruction time step in the time series dataset, performing Transformer mask reconstruction processing on the reconstruction time step to obtain a target time series dataset; performing data encoding and decoding processing on the target time series dataset to obtain an output sequence; calculating the outlier value of the output sequence according to a dynamic threshold segmentation algorithm, updating the dynamic threshold, and completing one anomaly identification operation; repeating the anomaly identification operation multiple times to obtain the anomaly identification result.
2. The method according to claim 1, characterized in that, The process of constructing sample daily load curves based on the acquired historical load data of public buildings includes: Initial load data for a first preset time period is obtained from multiple public buildings; The initial load data is preprocessed to obtain historical load data; The historical load data is divided into peak season load datasets and off-peak season load datasets based on whether it is a peak season for load usage. A first sample daily load curve is constructed based on the first load data of the peak season load dataset, and a second sample daily load curve is constructed based on the second load data of the off-peak season load dataset.
3. The method according to claim 2, characterized in that, The preprocessing of the initial load data to obtain historical load data includes: Determine the missing data values generated during the initial load data transmission process, wherein the missing data values include: discrete missing values and consecutive missing values; In the case where the missing data value is the discrete missing value, the average value of the data within the second preset time period is used for filling to determine the first historical load data; In the case of consecutive missing data values, the average data value within a third preset time period is used for filling to determine the second historical load data; The historical load data is determined based on the first historical load data and the second historical load data.
4. The method according to claim 1, characterized in that, The process of determining a typical daily load curve based on the sample daily load curve and the preset target load characteristic index includes: Extract the preset target load characteristic index from the sample daily load curve to determine the sample daily load characteristic index vector; Nonparametric kernel density estimation is used to perform probability density fitting on the preset target load characteristic index to obtain a typical daily load index vector; Calculate the Euclidean distance between the sample daily load characteristic index vector and the typical daily load index vector, and determine the weight value of the sample daily load curve; The sample daily load curves are weighted and superimposed based on the weight values to determine the typical daily load curve.
5. The method according to claim 1, characterized in that, The clustering process for the typical daily load curves to determine the load curve type includes: The typical daily load curves are clustered using a multi-manifold spectrum algorithm to determine the number of cluster points. Based on the number of cluster points, the type classification of the load curve is completed.
6. A load anomaly identification device for public buildings, characterized in that, include: The module is used to construct sample daily load curves based on the acquired historical load data of public buildings; The determination module is used to determine a typical daily load curve based on the sample daily load curve and the preset target load characteristic indicators, wherein the preset target load characteristic indicators include: daily load rate, daily peak-valley difference rate, peak period load rate, flat period load rate, and valley period load. The processing module is used to perform clustering processing on the typical daily load curves to determine the load curve type; The identification module is used to identify anomalies in the load data based on the load curve type using a mask reconstruction method, and to obtain the anomaly identification result. The identification module is further configured to: determine the time series dataset of the load data based on the load curve type; determine the reconstruction time step in the time series dataset; perform Transformer mask reconstruction processing on the reconstruction time step to obtain the target time series dataset; perform data encoding and decoding processing on the target time series dataset to obtain the output sequence; calculate the outlier value of the output sequence according to the dynamic threshold segmentation algorithm, and update the dynamic threshold to complete one anomaly identification operation; repeat the anomaly identification operation multiple times to obtain the anomaly identification result.
7. A non-volatile storage medium, characterized in that, The non-volatile storage medium stores multiple instructions, which are adapted to be loaded by a processor and executed by the load anomaly identification method for public buildings according to any one of claims 1 to 5.
8. A processor, characterized in that, The processor is used to run a program, wherein the program is configured to execute the load anomaly identification method for public buildings according to any one of claims 1 to 5 when running.
9. An electronic device comprising a memory and a processor, characterized in that, The memory stores a computer program, and the processor is configured to run the computer program to perform the load anomaly identification method for public buildings as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Living state detection method based on electricity consumption behavior
CN114661783A
Public building load identification method and device and computer readable storage medium
CN115018052A