Big data-based power consumption behavior clustering analysis method and system
By combining multi-window sliding slicing and depth encoder with the Dirichlet process Gaussian mixture dynamic clustering model, the problem of dynamic feature identification of power load in industrial parks was solved, enabling refined analysis of short-term mutations and multi-source coupling behavior, and improving the accuracy of energy efficiency management and demand response.
Patent Information
- Application Number
- CN202511014365.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-23
- Publication Date
- 2025-10-17
- Estimated Expiration
- 2045-07-23
AI Technical Summary
Existing technologies are unable to effectively identify the short-term abrupt changes and multi-source coupling behavior of electricity load in industrial parks. This results in clustering results that cannot accurately reflect key micro-dynamic characteristics such as fast charging start-up and photovoltaic reverse injection. Furthermore, they are difficult to adapt to changes in production rhythm and seasonal differences in photovoltaic output, affecting the accuracy of energy efficiency management and demand response.
The active power time series data is decomposed using multi-window sliding slicing technology, and features are fused with operation and maintenance logs and meteorological monitoring data. Multi-source feature embedding vectors are generated through a deep encoder, and cluster analysis is performed using a Gaussian mixture dynamic clustering model based on Dirichlet process to automatically determine the number of clusters and their centers, and generate typical electricity consumption behavior labels.
It enables dynamic, multi-scale, and multi-source fusion cluster analysis of electricity consumption behavior in industrial parks, accurately identifies short-term abrupt events and multi-source coupling behaviors, improves the model's adaptability and generalization ability, and provides a data foundation for refined energy efficiency management and demand response.
Smart Images

Figure CN120524255B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of data analysis, and in particular to a power consumption behavior clustering analysis method and system based on big data. BACKGROUND
[0002] With the proposal of the "double carbon" goal and the deepening of the green and low-carbon development strategy, a large number of industrial parks have deployed high-power electric vehicle (EV) fast charging stations (power scale is usually 500 kW to 2 MW) and distributed photovoltaic power generation systems (installed capacity can reach 1 MW to 5 MW) within the park, resulting in short-term large fluctuation of park power load on a minute time scale, such as multi-megawatt "fast charging peak" load caused by electric vehicle fast charging, and "reverse injection" phenomenon of reverse power flow to the grid caused by large photovoltaic generation at noon, both of which are coupled in time and have sudden changes.
[0003] In order to achieve accurate support for park energy efficiency management and demand response, unsupervised clustering analysis needs to be performed on massive power consumption time series data to identify typical behavior patterns of users or parks, so as to identify typical power consumption groups and load characteristics. However, the current mainstream clustering method mainly adopts a time series overall vectorization strategy: after dividing the whole day power consumption curve according to a fixed time window, statistical features such as mean, variance, peak time, and time period energy consumption of each time window are extracted, and these features are spliced into a static high-dimensional vector; or the original minute-level power value sequence is directly used as a high-dimensional input vector. Then, K-Means, spectral clustering and other algorithms are applied for grouping.
[0004] However, such clustering method compresses the dynamic fluctuation information of the whole day into a single static vector, and cannot distinguish the peak-valley event characteristics driven by different physical mechanisms (such as fast charging start and large photovoltaic generation), the feature fusion is rough, and the clustering result is difficult to effectively reflect the key micro dynamic characteristics such as "fast charging start transient" and "midday reverse injection". In addition, because the clustering object is fixed as a static vector, the original method cannot adapt to the behavior drift driven by multiple factors such as production rhythm change, operation and maintenance strategy adjustment, and seasonal photovoltaic output difference, and cannot deeply depict the short-time sudden load pattern formed by the coupling of electric vehicle fast charging and distributed photovoltaic power generation in industrial parks, which restricts the realization of fine energy efficiency management and demand response. SUMMARY
[0005] The present application provides a power consumption behavior clustering analysis method and system based on big data, a storage medium, a computer program product and an electronic device, to at least solve the problems of micro dynamic feature loss, unidentifiable behavior physical mechanism and difficulty in adapting to behavior pattern drift caused by static vectorization processing in the related art.
[0006] In a first aspect, an embodiment of the present application provides a method for clustering analysis of electricity consumption behavior based on big data, including: collecting active power time series data, operation and maintenance log data and meteorological monitoring data of each industrial park, standardizing the active power time series data to generate a normalized sequence, sliding window slicing the normalized sequence with a preset step size based on multiple preset window lengths to form a subsequence set, and aligning the operation and maintenance log data and meteorological monitoring data to corresponding subsequences according to time windows; inputting the subsequence set and the aligned operation and maintenance log data and meteorological monitoring data into a pre-trained deep encoder to obtain an embedding vector set that integrates multi-source features; inputting the embedding vector set into a pre-trained Gaussian mixture dynamic clustering model based on the Dirichlet process to automatically determine the number of clusters corresponding to the embedding vector set and the cluster centers of each cluster, and assigning each embedding vector to the corresponding cluster according to the cluster centers of each cluster to generate a cluster label for the embedding vector set; determining the typical electricity consumption behavior category to which each industrial park belongs based on the cluster label, and generating corresponding typical electricity consumption behavior labels.
[0007] In the second aspect, the embodiment of the present application provides a clustering analysis system for electricity consumption behavior based on big data, the system comprising: a data acquisition unit for collecting active power time series data, operation and maintenance log data and meteorological monitoring data of each industrial park, performing standardization processing on the active power time series data to generate a normalized sequence, performing sliding window slicing on the normalized sequence with a preset step size based on multiple preset window lengths to form a subsequence set, and aligning the operation and maintenance log data and meteorological monitoring data to corresponding subsequences according to the time window; a feature encoding unit for aligning the subsequence set and the aligned operation and maintenance log data with the meteorological monitoring data; Data is input into a pre-trained deep encoder to obtain an embedding vector set that integrates multi-source features; a clustering analysis unit is used to input the embedding vector set into a pre-trained Gaussian mixture dynamic clustering model based on the Dirichlet process to automatically determine the number of clusters corresponding to the embedding vector set and the cluster centers of each cluster, and assign each embedding vector to the corresponding cluster according to the cluster centers of each cluster to generate a cluster label for the embedding vector set; a behavior labeling unit is used to determine the typical electricity consumption behavior category of each industrial park according to the cluster label, and generate a corresponding typical electricity consumption behavior label.
[0008] According to a third aspect, an electronic device is provided, comprising: at least one processor, and a memory communicatively connected to the at least one processor, wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can perform the steps of the big data-based electricity consumption behavior clustering analysis method of any embodiment of the present application.
[0009] In a fourth aspect, the embodiments of the present application provide a storage medium having a computer program stored thereon, wherein the program, when executed by a processor, implements the steps of the power consumption behavior clustering analysis method based on big data according to any of the embodiments of the present application.
[0010] In a fifth aspect, the embodiments of the present application provide a computer program product, comprising computer programs / instructions, which, when executed by a processor, implement the steps of the power consumption behavior clustering analysis method based on big data according to any of the embodiments of the present application.
[0011] The power consumption behavior clustering analysis method and system based on big data provided by the present application can at least produce the following technical effects:
[0012] (1) The dynamic fluctuation characteristics of the park power consumption load are fully retained at a minute level. The long time series data is decomposed into sub-sequences covering different time scales by using a multi-window sliding slicing mechanism, which significantly enhances the sensitivity to short-term mutation events (such as fast charging start, photovoltaic reverse injection, etc.) and multi-source coupling behaviors. Compared with static overall vectorization clustering, the proposed sliding window segmentation and multi-source data fusion method effectively avoids the loss of key information caused by time series feature compression, so that the model can accurately distinguish peak and valley events driven by different physical mechanisms, and realize fine-grained description of the power consumption mode of the industrial park.
[0013] (2) The features of each sliding window sub-sequence and the synchronously aligned operation and maintenance logs and meteorological data are fused by a deep encoder, which improves the adaptability of the clustering model to external environment, production rhythm and seasonal changes, so that the typical power consumption behavior categories can dynamically reflect the actual operation state and external influencing factors. The Gaussian mixture dynamic clustering model based on Dirichlet process can adaptively identify diversified power consumption behavior types without pre-specifying the number of clustering clusters, effectively cope with the drift and evolution of park behavior patterns in different periods and different operation stages, and improve the generalization ability and application flexibility of the model.
[0014] Through the technical solution, the bottleneck of the traditional static clustering method is broken, dynamic, multi-scale and multi-source fusion clustering analysis of power consumption behavior is realized, and data basis and decision basis are provided for park-level energy efficiency management and load forecasting, demand response strategy formulation, which significantly improves the ability of fine management and response scheduling. BRIEF DESCRIPTION OF DRAWINGS
[0015] In order to more clearly illustrate the technical solutions of the embodiments of the present application or the prior art, the following will briefly introduce the drawings needed to be used in the embodiments or prior art description. Obviously, the drawings described below are some embodiments of the present application, and those skilled in the art can obtain other drawings according to these drawings without creative labor.
[0016] Figure 1 A flow chart of an example of the power consumption behavior clustering analysis method based on big data according to an embodiment of the present application is shown;
[0017] Figure 2 An operation flow chart of an example of the distributed distance monitoring and concept drift adaptive update according to an embodiment of the present application is shown;
[0018] Figure 3 An operation flow chart of an example of training the deep encoder according to an embodiment of the present application is shown;
[0019] Figure 4 An operation flow chart of an example of training the Gaussian mixture dynamic clustering model based on Dirichlet process according to an embodiment of the present application is shown;
[0020] Figure 5 The NMI performance comparison curves of different clustering methods under sample size change are shown;
[0021] Figure 6 A structural block diagram of an example of the power consumption behavior clustering analysis system based on big data according to an embodiment of the present application is shown. DETAILED DESCRIPTION
[0022] In order to make the purposes, technical solutions and advantages of the embodiments of the present application more clear, the technical solutions of the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are some embodiments of the present application, not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor are within the scope of protection of the present application.
[0023] It should be noted that in the research of some scholars in the related art, a variety of novel clustering methods have been proposed, mainly including the following three directions: density-based clustering method, clustering method based on frequency domain or multi-scale subspace transformation and clustering method based on deep learning driven.
[0024] In the density-based clustering method, DBSCAN (Density-Based Spatial Clustering of Applications with Noise) is often used, which can automatically identify clusters and noise according to sample density, and present multi-level cluster division through hierarchy, but such method is extremely sensitive to distance threshold (ε) and minimum sample number (MinPts), and parameter tuning is difficult. In addition, the park power consumption sequence contains both short-time minute-level fast charging mutations and cross-hour photovoltaic fluctuations, and it is difficult to simultaneously consider multiple time scale events through a single fixed scale density parameter, resulting in limited detection ability of the clustering result for signals of different scales.
[0025] In the clustering based on frequency domain or multi-scale subspace transformation, the power consumption curve is subjected to Fourier transform or wavelet decomposition, the frequency spectrum energy or wavelet coefficients of different scales are extracted, and then clustering is performed in the subspace. This clustering method has an advantage in capturing periodic fluctuations, but it is insufficient for non-stationary, impulse-type fast charging start and photovoltaic reverse injection and other transient mutation signals; at the same time, since only the frequency components of the time sequence are concerned, it is difficult to integrate external operation and maintenance contexts such as production calendar and maintenance log into clustering features, affecting the explainability and practicality of the result.
[0026] In the clustering method based on deep learning, an autoencoder or a variational autoencoder is often used to automatically learn the mapping from high-dimensional power consumption time series to low-dimensional embedding through a neural network, and K-Means algorithm is used to complete clustering. Although this method can extract complex nonlinear features from raw data, it usually inputs the whole-day power consumption curve as a whole tensor, ignoring explicit attention to local mutation events such as fast charging start-stop and injection inflection point. In addition, the deep model is highly dependent on the preset cluster number and training distribution, and once there is an adjustment of the park operation and maintenance strategy or seasonal photovoltaic output difference, it is difficult to realize online adaptive update of the cluster number and cluster center.
[0027] It should be understood that the above description of the prior art is only intended to facilitate the public to better understand the spirit and motivation of the present application, and is not considered as a limitation of the present application. In addition, the technical solutions described in the above prior art are not prior art, but can also be undisclosed technical solutions, such as solutions under research or in the laboratory stage.
[0028] In the technical solutions of the present application, the collection, storage, use, processing, transmission, provision and disclosure of user personal information, etc. comply with the relevant legal regulations and do not violate public order and good customs.
[0029] In the face of the multi-time scale, strong non-stationary and multi-source coupled dynamic characteristics of industrial park power consumption load, traditional clustering analysis is difficult to balance instantaneous mutation and long-term fluctuations, and it is more difficult to flexibly integrate multi-source spatio-temporal data, resulting in limited recognition accuracy and adaptability of typical power consumption behavior. Therefore, starting from the multi-scale, dynamic and multi-source heterogeneous characteristics of power consumption behavior itself, a new clustering analysis method is proposed, which integrates multi-window sliding analysis, cross-domain data alignment and deep embedding expression, aiming to achieve detailed analysis and dynamic adaptation of industrial park power consumption behavior under different time scales and data sources, and provide a solid data foundation and decision support for scientific formulation of energy efficiency management and demand response strategies.
[0030] Further, Figure 1 A flowchart of an example of a power consumption behavior clustering analysis method based on big data according to an embodiment of the present application is shown.
[0031] Regarding the execution subject of the method of the present application, it can be any controller or processor with computing or processing capability. Specifically, it can be implemented by the park energy efficiency management platform, which realizes the classification and label generation of typical power consumption behavior by implementing multi-source embedding and adaptive clustering mechanism, provides a label system with time sequence perception and physical consistency for park-level power consumption mode recognition, and improves the practicality and response ability of the data-driven energy efficiency management system.
[0032] In some examples, it can be integrated in an electronic device or terminal in the form of software, hardware or a combination of software and hardware, and the type of terminal or electronic device can be diverse, such as mobile phones, tablets or desktop computers, etc.
[0033] As Figure 1 As shown in step S110, the active power time series data, operation and maintenance log data and meteorological monitoring data of each industrial park are collected, the active power time series data is standardized to generate a normalized sequence, the normalized sequence is sliced with a preset window length and a preset step to form a subsequence set, and the operation and maintenance log data and meteorological monitoring data are aligned to the corresponding subsequence according to the time window.
[0034] It should be noted that under the background of the "double carbon" strategy, more and more industrial parks deploy photovoltaic power generation systems, charging stations and energy storage equipment, forming various types of power consumption coupling behaviors. These behaviors exhibit obvious dynamic fluctuation characteristics in time sequence, and the load events caused by different devices (such as electric vehicle fast charging and photovoltaic reverse injection) have high mutation in local time, so the traditional whole-day power consumption curve modeling method is difficult to describe this short-time dynamic.
[0035] In some embodiments, the real-time active power is collected by smart meters at each substation, building, factory and charging pile in the industrial park at a frequency of one minute or five minutes to form a ,in Indicates the Parks in time In addition, the park energy management platform and the structured operation and maintenance events in the dispatching system are collected and operation and maintenance log data is collected, such as equipment maintenance, shift adjustment, temporary dispatch, etc. Each log contains key information such as event type, occurrence time, affected objects, and duration, forming a ,in Indicates the Parks in time Use the local weather station in the park or the authoritative weather service API to collect meteorological monitoring data, such as temperature, humidity, light, wind speed and other environmental variables, to ensure that the data sampling frequency is consistent with the power consumption data, and form ,in Indicates the Parks in time Real-time meteorological monitoring values.
[0036] Then, the power time series of each park and each monitoring object is statistically averaged by day or specified period. and standard deviation , and normalize each sampling point:
[0037] , formula (1)
[0038] Where, Indicates the Parks in time Normalized real-time power value.
[0039] In this way, the amplitude differences caused by installed capacity and baseline load between different parks and different monitoring points can be eliminated, the relative change trend can be highlighted, and the subsequent model can focus on the behavior itself rather than the absolute load.
[0040] Subsequently, multi-scale sliding window slicing is performed. Specifically, multiple window lengths can be selected according to business needs. L (such as 30 minutes, 1 hour, 2 hours, etc.), each window uses a sliding step size S (such as 1 minute) to slice the standardized time series:
[0041] , formula (2)
[0042] Where, Indicates the Parks at the moment The starting length is the normalized power sequence within the sliding window. denotes the normalized real-time power value of the th park at time denotes the window length of the sliding window, denotes the normalized real-time power value of the th park at time
[0043] The sliding window is cycled for the whole day and the whole season to capture all potential behavior fluctuations, including load ramping, peaks, sudden drops, and other time series segment characteristics, so that a raw sequence can be cut into a variety of scale and overlapping subsequence sets.
[0044] In addition, for each window, the operation and maintenance logs and weather data within the same time window are retrieved and aggregated. The logs are matched with the window in an interval coverage manner, recording all event types and occurrence times within the time window; the weather data are aggregated in the form of window average, extreme value, and change rate. Each sliding window subsequence is presented in the form of a structured triple , where is the statistical characteristics of all event types within the window, is the weather aggregation characteristics. Thus, through the formation of the multi-scale structured feature input, both short-term mutations such as fast charging and load scheduling can be recorded, and medium and long-term characteristics such as cross-hour / day photovoltaic fluctuations and production shift adjustments can be taken into account; in addition, each segment can be synchronized with the external operation and maintenance and weather context, which is helpful for subsequent model explanation and clustering causes.
[0045] It should be noted that in the industrial park electricity consumption behavior analysis scenario, although the power time series data can reflect the dynamic changes of electricity consumption load, such changes are often significantly affected by park operation (such as maintenance, equipment switching, and load adjustment) and weather conditions (such as temperature, radiation, humidity, etc.). By aligning and supplementing the operation and maintenance log data and weather monitoring data with the power data at the same time window level, the external intervention and environmental context behind each power subsequence can be provided, so that the model can accurately distinguish the same behavior patterns caused by internal load changes and external events. Thus, the multi-source alignment effectively improves the multi-dimensional expression ability of the clustering features, so that the clustering model can better identify electricity consumption behavior differences driven by operation or weather, improve the detection ability and clustering resolution for diversified scenarios (such as load fluctuations under extreme weather, electricity consumption anomalies during a specific operation period, etc.), and also make the final summarized clustering labels and behavior characteristics closer to the real business scenario.
[0046] In step S120, the subsequence set and the aligned operation and maintenance log data and meteorological monitoring data are input into a pre-trained deep encoder to obtain a set of embedding vectors fused with multi-source features.
[0047] It should be noted that the multi-source sliced feature triplets contain behavior time series, operation and maintenance and environmental context, but have high dimensions, complex structure, strong time series correlation and multi-source interaction, and it is difficult to extract their internal rules by relying on artificial rules or shallow mapping alone, so a deep encoder is needed to automatically learn compressed and high-distinguishability embedding vector expressions from a large amount of multi-source data, so that "similar behaviors" are close to each other in the embedding space, and different behaviors are significantly separated, realizing automatic abstract modeling from high-dimensional multi-source original data to compact behavior representation.
[0048] Here, the structure selection of the deep encoder can be diversified, such as one-dimensional convolutional neural network (1D-CNN), gated recurrent unit (GRU), long short-term memory network (LSTM), etc., which should not be limited here. In addition, the network structure design can cover multi-scale receptive fields to ensure sensitivity to local mutations and global trends. The operation and maintenance logs and meteorological features are fused with the main time series features through embedding layers or self-attention mechanisms to improve the global semantic integration capability. Finally, the encoder outputs fixed-length high-dimensional embedding vectors (such as 128 dimensions, 256 dimensions, etc.), each embedding vector comprehensively fuses multi-source information such as time series, operation and maintenance, and meteorological features within the sliding window.
[0049] Regarding the pre-training mechanism of the deep encoder, it can be diversified, such as using self-supervised prediction (such as power prediction of the next time window, anomaly detection), reconstruction loss (such as reconstruction error of autoencoder), or representation optimization based on contrastive learning, etc. Various pre-training methods ensure that the embedding expression has sufficient generalization and discrimination ability for actual behaviors in the park.
[0050] In some examples of the embodiments of the present application, the pre-trained deep encoder includes a plurality of parallel one-dimensional convolutional layers, each one-dimensional convolutional layer having different convolution kernel widths for extracting multi-scale time series features of the input. The output results of the plurality of one-dimensional convolutional layers are spliced and input into at least one residual block containing a dilated convolution and a channel attention mechanism for fusing and strengthening the feature expressions of the power data, the operation and maintenance log data and the meteorological monitoring data. The output of the residual block is processed by global average pooling and a fully connected layer to obtain embedding vectors fused with multi-source features.
[0051] In the multi-scale convolutional layer, parallel 1D convolution kernel groups are used: : a convolutional layer with a convolution kernel width of 3, a channel number of 64, and a stride of 1; ; : a convolutional layer with a convolution kernel width of 5, a channel number of 128, and a stride of 1; ; convolutional layer with a kernel width of 7, the number of channels The feature maps are spliced for each channel group output .
[0052] In the residual stack and channel attention module, a plurality of (such as 3 layers) residual blocks can be set, each block containing: 1x1 convolution dimension reduction, ReLU; context extraction by dilated convolution (dilation rate is 2); channel attention (SE module), adaptive strengthening of operational / weather channel; each layer output is added to the input to enhance the gradient and information flow. Further, the feature map of the last residual block is globally averaged pooled to obtain a vector with a length of After a layer of full connection + LayerNorm, the final embedding vector is output .
[0053] Through the embodiments of the present application, the deep encoder adopts a plurality of parallel one-dimensional convolutional layers with different convolution kernel widths, which can effectively extract key features of input data at different time scales and capture multi-granularity behavior information from short-time fast charging, photovoltaic mutation to long-time production rhythm changes. After splicing the multi-scale features, the residual block containing the dilated convolution and the channel attention mechanism can effectively fuse data features from different sources on the basis of ensuring the diversity of feature information, so that the output embedding vector is more representative and discriminative, and the expression ability of the network to key events and coupling patterns is strengthened.
[0054] In step S130, the embedding vector set is input into a pre-trained Dirichlet process-based Gaussian mixture dynamic clustering model, the number of clusters and cluster center parameters obtained by model training are called, each embedding vector is assigned to the corresponding cluster by a clustering membership inference method, and a clustering label of the embedding vector set is generated.
[0055] It should be noted that in a high-dimensional embedding space, complex industrial park power consumption behaviors can be automatically grouped by clustering, but traditional K-Means or static clustering methods require manual specification of the number of clusters and are difficult to adapt to dynamic changes in behavior patterns. Here, by using a Dirichlet process Gaussian mixture model (DP-GMM), adaptive determination of the number of clusters in the embedding space and estimation of the cluster center are automatically realized. In theory, it allows "infinite clusters", and in practice, a reasonable number of behavior pattern clusters are automatically "activated" according to the data, and each cluster has rich expressions such as mean and variance.
[0056] Here, the trained clustering model is applied to new data as a "knowledge carrier." The training phase uses historical data and adaptive optimization to determine the optimal number of clusters, center locations, and parameters. The inference phase eliminates the need for re-clustering, leveraging learned patterns to quickly assign and label new data, achieving efficient data segmentation and pattern recognition.
[0057] Furthermore, time-series embedded data from industrial parks often has a complex distribution, with overlaps and anomalies. Therefore, probabilistic attribution inference can be used. Cluster attribution inference methods can be diverse, such as Variational Bayesian (VB), Expectation-Maximization (EM), Maximum A Posterior (MAP), or other equivalent probabilistic inference methods, which are not limited here. Compared to using a rigid distance threshold for assignment, this method comprehensively considers global mixing weights and local feature similarities, making the affiliation between each sample and each cluster more scientific and reasonable. This ensures that label assignments are consistent with the data distribution, even in the face of multimodal, outlier, or ambiguous behavior.
[0058] By feeding a set of embedded vectors into a pre-trained Gaussian mixture dynamic clustering model based on the Dirichlet process, the model fully utilizes the a priori clustering parameters obtained during the pre-training phase, such as the number of clusters and the location of cluster centers. This significantly improves the efficiency of batch clustering and label assignment for new data while ensuring high consistency between label assignments and historical data distributions. Furthermore, combining cluster probability attribution inference with cluster label assignment significantly improves the clustering efficiency and robustness of label discrimination for large-scale multi-source electricity consumption data, enabling flexible adaptation to real-world industrial park scenarios such as complex distributions, anomalous behaviors, and multimodal features.
[0059] In step S140 , the typical electricity usage behavior category of each industrial park is determined based on the clustering label, and a corresponding typical electricity usage behavior label is generated.
[0060] It should be noted that the cluster analysis output in step S130 only generates cluster labels for each sliding window subsequence, but actual business needs require typical power usage behavior categories for each campus as a whole. To this end, it is necessary to statistically summarize the labels of all subsequences within the same campus. Through frequency analysis and business mapping, the micro-clustering results are automatically converted into high-level behavior labels for energy efficiency management and policy optimization.
[0061] In some examples of the embodiments of the present application, for all sub-sequences of the same industrial park, the occurrence frequency of each cluster in the industrial park is counted according to the cluster label, and the preset number of cluster corresponding to the highest occurrence frequency is taken as the main cluster of the industrial park. Further, according to the preset mapping relationship between the cluster and the power consumption behavior category, the user behavior category corresponding to the main cluster is set as the typical power consumption behavior label of the corresponding industrial park.
[0062] It should be noted that the sliding window sub-sequence level clustering has grouped a large number of minute-level power consumption segments according to behavior patterns, and each sub-sequence corresponds to a cluster label. For the same industrial park, the labels of all sub-sequences of the park are summarized, which can quantify the most common behavior patterns of the park in all fine-grained time windows. By selecting the preset number (for example, 5) of clusters with the highest occurrence frequency, it can be ensured that these "main clusters" can represent the dominant power consumption characteristics of the park, while the occasional noise clusters or extreme events are naturally excluded.
[0063] Exemplarily, for each park , the cluster labels of all sliding window sub-sequences are collected . represents the cluster label of the 1st sliding window sub-sequence in the 1st park, represents the cluster label of the 1st sliding window sub-sequence in the 1st park, represents the cluster label of the 1st sliding window sub-sequence in the 1st park, represents the cluster label of the 1st sliding window sub-sequence in the 1st park, represents the cluster label of the 1st sliding window sub-sequence in the 1st park, represents the cluster label of the 1st sliding window sub-sequence in the 1st park, represents the total number of all sliding window sub-sequences in the 1st park.
[0064] The occurrence frequency of each cluster in the park is counted:
[0065] , formula (3)
[0066] In the formula, represents the occurrence frequency of the 1st cluster in the 1st park. represents the sequence index of the sliding window sub-sequence in the 1st park, represents the cluster label of the 1st sliding window sub-sequence in the 1st park. represents the cluster label of the 1st sliding window sub-sequence in the 1st park. represents the cluster label of the 1st sliding window sub-sequence in the 1st park. represents the cluster label of the 1st sliding window sub-sequence in the 1st park. represents the cluster label of the 1st sliding window sub-sequence in the 1st park. represents the cluster label of the 1st sliding window sub-sequence in the 1st park.
[0067] The first main clusters with the highest frequency are sorted and selected , to avoid that the occasional extreme cluster dominates the label result.
[0068] It should be noted that the cluster itself is only a digital identifier and cannot directly reflect the business meaning. Therefore, after clustering is completed, a professional analysis tool can be introduced, such as pre-summarizing by domain experts, large model semantic labels, or historical data analysis in the offline stage, to assign a corresponding "behavior category" description (such as "night fast charging peak type") to each cluster number. After selecting the main cluster, the numerical clustering result can be converted into understandable and executable high-level labels through table mapping.
[0069] Specifically, a "cluster number-behavior category" mapping table can be established offline. According to the typical time series curve shape, operation / meteorological background, and expert experience in the cluster, the corresponding business behavior of each cluster (such as "night fast charging peak type" and "midday photovoltaic reverse injection type") can be determined. Thus, the main cluster of the park is mapped to the corresponding behavior category to form a structured label record , i.e., park identification, typical behavior category, and its proportion. represents the number of the cluster, represents the behavior category label of the th cluster, represents the frequency of the th cluster in the th park.
[0070] In the embodiments of the present application, the cluster labels of each sub-sequence are frequency counted in the park dimension, and the main cluster with the highest frequency is selected. This can automatically extract the most representative behavior pattern from the microscopic and massive slice results, effectively filter incidental noise clusters and extreme events, and summarize a large number of fine-grained labels into a small number of high-frequency main clusters, ensuring that the generated typical labels accurately reflect the overall power consumption characteristics of the park. Subsequently, through the cluster-behavior category mapping table, the main cluster is mapped to the high-level typical power consumption behavior label, realizing the connection from data-driven clustering output to business meaning label.
[0071] Further, the clustering labels of each industrial park can be issued to energy efficiency management, time-of-use pricing strategy, load forecasting, and other functional subsystems through system function interfaces, thereby providing decision-making basis for various intelligent scheduling and abnormal monitoring strategies for different industrial parks.
[0072] Through the embodiments of the present application, by utilizing multi-scale multi-source data slicing, deep embedding learning, dynamic adaptive clustering, and intelligent summarization of cluster labels, fine-grained identification, clustering, and automatic label generation of electricity consumption behaviors in industrial parks are achieved. Thus, through the contextual fusion analysis of multi-source features, fine-grained identification of complex behaviors such as short-term fast charging, long-term photovoltaics, and emergency maintenance in industrial parks is achieved, and the causes behind load changes are clear at a glance. In addition, behavioral labels with high representativeness and business interpretability are generated for each park, realizing the closed-loop operation of various business decision-making systems driven by dynamic labels.
[0073] It should be noted that during the ongoing operation of an industrial park, the external environment (such as weather changes), operation and maintenance strategies (such as load control), or equipment configuration (such as the addition of new fast-charging stations) can cause changes in the distribution of electricity usage patterns. Relying solely on fixed cluster centers makes it difficult for the model to adapt to this "concept drift," thus affecting the accuracy of cluster labels. Therefore, it is necessary to regularly evaluate the similarity between the distribution of embedding vectors in new batches and the distribution of historical cluster centers. When a significant distribution shift occurs, an adaptive model update is triggered.
[0074] Regarding the details of the cluster attribution inference in step S130, in some examples of the embodiments of the present application, the cluster attribution inference method softly assigns the attribution of the embedded vector by comprehensively combining the logarithmic probability expectation of the cluster mixing weight and the logarithmic probability expectation of the Gaussian likelihood of the embedded vector relative to each cluster center, thereby generating a cluster label for the set of embedded vectors.
[0075] It should be noted that in the context of industrial park time-series big data, the embedding vectors generated by the deep encoder already incorporate information from multiple sources (power, operations, and weather). However, actual park behavior often exhibits complex distributions with multimodal, overlapping, and abrupt changes. Using the Gaussian mixture dynamic clustering model, each embedding vector must be appropriately assigned a cluster label, ensuring that similar behaviors are grouped together and heterogeneous behaviors are dispersed. Variational Bayesian inference and log-probability expectation methods can efficiently and precisely accomplish this soft-to-hard assignment process.
[0076] Specifically, the cluster labels of the embedding vector set can be generated by the following operations:
[0077] For each embedding vector, calculate its The responsibility of each cluster:
[0078] , formula (4)
[0079] Where, Indicates the The embedding vector of the fusion multi-source features has an embedding dimension of ; Indicates the The embedding vector for The responsibility of a cluster or cluster center satisfies ; Indicates the The mixing weights of the clusters are derived from the broken stick process construction of the truncated Dirichlet process, satisfying ; For the The mean vector of each cluster represents the location of the cluster center; For the The covariance matrix of a cluster, describing the distribution shape of the cluster; Indicates proportional to the sign. represents the Gaussian probability density function.
[0080] In variational Bayesian inference, for each embedding vector ( is a vector index), to mix the weights , Gaussian parameters As a priori, calculate its The responsibility of a cluster , that is, the probability weight of belonging to each cluster.
[0081] In the responsibility calculation formula of formula (4), the first term is the mixed weight The expectation of is used to measure the popularity of the cluster; the second term is the expectation of the Gaussian distribution likelihood, which measures With the cluster center The distance (similarity) between the two clusters is calculated. By combining the expected logarithmic probability of the mixed weights of each cluster with the expected logarithmic probability of the Gaussian likelihood of the embedding vector relative to each cluster center, a soft assignment of the attribution degree to each embedding vector is effectively achieved. This attribution degree not only fully reflects the degree of probabilistic match between the embedding vector and each cluster center, but also incorporates the prior weight information of the clustering model. Thus, the assignment of responsibility fully reflects the match between each embedding vector and each cluster, as well as the importance of the cluster itself, improving the robustness of label assignment in multimodal and multi-distribution clustering scenarios.
[0082] is the expectation of the weight of the folded stick process, which represents the random variable The logarithmic expectation under the variational distribution is used to evaluate the credibility of cluster weights:
[0083] , formula (5)
[0084] Where, Indicates the first The two posterior parameters of the Beta distribution control The shape of the distribution and the probability of generating new clusters; denotes the Digamma function, denotes the cumulative cluster index from the 1st cluster to the cluster. and denotes the two posterior parameters of the th Beta distribution.
[0085] In the above formula (5), the logarithmic probability expectation of the clustering cluster mixing weight is analytically expressed, and the variational inference based on the Dirichlet process is specifically adopted, wherein the mixing weight obeys the Beta distribution, and the two posterior parameters of the Beta distribution are parameterized and solved by using the Digamma function. Thus, not only the prior importance of each clustering cluster in the overall distribution can be quantified, but also the dynamic probability mechanism of new cluster generation can be effectively reflected by accumulating the probability of the previous cluster.
[0086] is the expectation of the Gaussian distribution log-likelihood:
[0087] , formula (6)
[0088] In the formula, the denotes the multivariate Gaussian probability density function described by and ; the denotes the vector transposition operation, is the precision matrix of the th cluster, and is defined as . denotes the number of embedding dimensions of the embedding vector, denotes the expectation value of the logarithmic determinant of the covariance matrix of the th cluster.
[0089] In formula (6), the expectation of the Gaussian distribution log-likelihood is quantitatively expressed, and the distance between each embedding vector and the clustering center, the covariance structure of the clustering cluster, and the precision matrix are comprehensively included in the membership calculation. Not only the dimension of the embedding space, the distribution shape of each clustering cluster, and the Euclidean distance between the sample and the center are fully considered, but also the parameter uncertainty is modeled by using the expectation operator. Through this refined probability evaluation method, the discriminability and stability of clustering membership inference can be effectively improved, so that the model can more accurately distinguish different power consumption modes under complex industrial park multi-source behavior data.
[0090] Each embedding vector is assigned to the clustering cluster that makes :
[0091] , formula (7)
[0092] In the formula, is a mathematical operator, representing selecting the cluster index that makes the membership degree Maximum .
[0093] Until each embedding vector in the embedding vector set is assigned a unique cluster label.
[0094] In the multi-modal clustering scenario, each vector sample is assigned a certain probability among all clusters, but each embedding vector needs to be assigned a unique and deterministic cluster label. Therefore, by maximizing the responsibility degree principle, each vector sample is assigned to the cluster to which it most likely belongs, realizing the conversion from soft probability to hard label.
[0095] Through the embodiments of the present application, in the face of the problems of multi-modal, highly overlapping distribution, and behavior mutation in the industrial park power consumption behavior big data clustering analysis scenario, the responsibility degree distribution method of the Gaussian mixture model based on variational Bayesian inference is adopted, which can combine the mixing weight of each cluster and the multi-dimensional similarity of the embedding vector and each center, and through strict mathematical modeling of the expected log probability, the probability distribution of each embedding vector sample belonging to each cluster is carefully described. Further, by maximizing the responsibility degree principle, the soft assignment is converted into a unique cluster label, realizing the accurate discrimination of mainstream, edge and abnormal power consumption modes. Therefore, the accuracy and robustness of pattern discovery and label assignment of complex industrial park power consumption behavior can be significantly improved.
[0096] It should be noted that in the power consumption behavior clustering analysis scenario of the industrial park, the data distribution will dynamically change with the change of seasons, production rhythm, equipment upgrading or operation and maintenance strategy adjustment, that is, there is a "concept drift" phenomenon. If the clustering model always relies on the clustering centers trained by historical data, it is difficult to capture new behavior patterns, resulting in a gradual disconnection between the clustering label and the actual power consumption behavior. In view of this, Figure 2 An operation flowchart of one example of distribution distance monitoring and concept drift adaptive update according to an embodiment of the present application is shown.
[0097] As Figure 2 shown, in step S210, the distribution distance between the embedding vector set and the historical clustering center is calculated.
[0098] Here, the historical clustering center is the clustering center automatically determined and saved by the Dirichlet process-based Gaussian mixture dynamic clustering model for the embedding vector set of the previous batch.
[0099] In some embodiments, the global difference between the two sets of distributions is measured by a distribution distance, and the distance metric can be diverse, such as JS divergence, relative entropy, maximum mean difference (MMD), etc. The larger the distance, the more the new behavior distribution is separated from the original model, and the model structure or parameters need to be updated.
[0100] It should be noted that in the clustering analysis of the power consumption behavior of the industrial park, the embedded vector set and the historical clustering center are often distributed in a high-dimensional space, and these distribution structures can be multimodal, heteroscedastic, or even nonlinear distribution drift. Therefore, in some examples of the embodiments of the present application, the distribution distance adopts the Wasserstein distance. The Wasserstein distance has the ability to measure the overall shape difference between two probability distributions, and can not only reflect the changes in the mean and variance of the distribution, but also capture the main direction, extension degree and non-overlapping area between the distributions. Therefore, using the Wasserstein distance as the distribution distance metric can more comprehensively and intuitively measure the real difference between the new and old data distributions, which is better than the distance metric based on only the first-order or second-order statistics such as mean or variance.
[0101] Exemplarily, let the new batch of embedded vector set be , and the historical clustering center set be , then the following can be calculated:
[0102] , formula (8)
[0103] In the formula, , represents the distribution distance, , represents the new embedded vector, , and represents the historical clustering center.
[0104] In step S221, if the distribution distance does not exceed the preset distance threshold, only the historical clustering center position is updated.
[0105] Here, when the new batch of data distribution is highly consistent with the historical clustering center, it means that the original clustering model is still effective, and only a small position correction is needed for the clustering center to adapt to slight behavior fluctuations and avoid unnecessary full model retraining.
[0106] Specifically, for each clustering cluster , the embedded vector mean of the new batch assigned to the cluster is used to update the historical center :
[0107] , formula (9)
[0108] , wherein, , represents the updated clustering center of the th cluster, For new batch Cluster mean, For updating weight coefficient (such as 0.9~0.99).
[0109] In addition, the covariance, sample size and other second-order statistics can also be updated synchronously to synchronously describe the cluster distribution shape. Thus, the small fluctuations of the data are quickly responded to, the clustering label continuity is guaranteed, the full model retraining is not needed, and the system resource consumption is reduced.
[0110] In step S223, if the distribution distance exceeds the preset distance threshold, it is determined that the Dirichlet process-based Gaussian mixture dynamic clustering model has a concept drift phenomenon, and the Dirichlet process-based Gaussian mixture dynamic clustering model is fine-tuned based on the embedded vector set.
[0111] It should be noted that if the new data distribution deviates significantly from the historical clustering center, it often means that a new behavior pattern, device upgrade or extreme operation and maintenance event (such as energy saving strategy adjustment) occurs, so that the original clustering structure is no longer applicable, resulting in a “concept drift”, and the model fine-tuning or retraining should be triggered to dynamically adapt to the new scene and ensure the continuous effectiveness of the clustering label.
[0112] Specifically, when the fine-tuning process is entered, and the original DP-GMM model can be quickly iterated by using an incremental EM algorithm, partial parameter unlocking training and the like, represents a concept drift threshold. In addition, in the training data distribution, the new batch embedding is mainly used, but part of the representative historical samples can also be combined to prevent the model from overfitting to abnormal or short-term events. Thus, major behavior changes and new scenes can be effectively dealt with, and the power consumption mode drift caused by sudden events and major strategy adjustments can be timely adapted.
[0113] Through the embodiments of the present application, the distribution distance of the new batch embedding vector and the historical clustering center is monitored, and a distribution distance monitoring and concept drift adaptive updating mechanism is adopted. Thus, the clustering center can be quickly incrementally corrected when the behavior distribution is stable, the model efficiency and the continuity of the clustering label are maintained, and the model fine-tuning or retraining can be triggered in time when the behavior distribution changes significantly, so as to ensure that the clustering label can truly and synchronously reflect the power consumption behavior pattern of the industrial park.
[0114] Figure 3 An operation flowchart of an example of training a deep encoder according to an embodiment of the present application is shown.
[0115] As Figure 3 shown, in step S310, a candidate subsequence set is sampled from the historical subsequence set, and a representative shape subsequence is determined from the candidate subsequence set based on an entropy gain method.
[0116] Here, the shape subsequence refers to the power value segment captured within a sliding window in the power consumption time series curve. Its essence is the shape (or "contour") of the power consumption over time within a certain period of time. For example, a segment that rises sharply and then stabilizes may represent a fast charging startup behavior pattern, and a sudden drop after a midday peak may correspond to a sudden drop in photovoltaic output behavior pattern, and so on.
[0117] It should be noted that electricity consumption in industrial parks exhibits a rich variety of temporal patterns. However, different types of fluctuations, mutations, or periodic changes often occur at disparate rates within a large sample pool, making direct sampling difficult to ensure that the training set covers and represents all types of behavior. Using entropy gain to select representative subsequences with diverse shapes and high pattern discrimination from a set of candidate subsequences helps strengthen the model's ability to identify abnormal behaviors and extreme patterns, improving the encoder's generalization and robustness.
[0118] More specifically, after slicing different time windows, the standardized power subsequences of all parks and all time periods are used as the basic pool to form a historical subsequence set. For each candidate subsequence , using Euclidean distance as the metric, calculate its The optimal alignment distance of all historical subsequences in Divide the history set into two categories and calculate Information entropy And the group entropy, the entropy gain method is expressed by the following formula:
[0119] , formula (10)
[0120] Where, Candidate subsequence The entropy gain value, is the set of historical subsequences, is the information entropy function, Candidate subsequence The optimal partitioning threshold of the Euclidean distance with other subsequences in the historical subsequence set; Representation and candidate subsequence The Euclidean distance is not greater than the optimal partition threshold The set of historical subsequences of Representation and candidate subsequence The Euclidean distance is greater than the optimal partition threshold The set of historical subsequences of Indicates the number of elements in the collection.
[0121] Specifically, The greater, the more significant the subsequence is to the overall information diversity. A number of subsequences with the greatest entropy gain can be selected as representative shape subsequences to enhance the diversity and discriminability of the training samples, significantly improve the representation ability of the encoder for mainstream and abnormal behaviors, and thus cover a wide range of behaviors, maximize diversity with fewer samples, and improve training efficiency.
[0122] In step S320, a positive and negative sample pair is constructed from the historical subsequence set based on the representative shape subsequences, wherein a subsequence pair corresponding to the same shape subsequence is taken as a positive sample pair, and a subsequence pair not containing the same shape subsequence is taken as a negative sample pair.
[0123] Here, the deep contrast learning relies on reasonable division of the positive and negative sample pairs: the positive sample pair requires a high degree of similarity in shape and behavior mode, and the negative sample pair should come from obviously different modes. Through the representative shape subsequences, the subsequence with the smallest Euclidean distance to the same shape is classified as a positive sample pair, and the subsequence not containing the same shape is classified as a negative sample pair, which can maximize the discrimination ability and drive the encoder to learn the essential behavior features.
[0124] In step S330, based on the positive and negative sample pairs, a contrast loss function with a temperature adjustment factor is used to train the deep encoder to determine the network parameters of the pre-trained deep encoder.
[0125] Here, by using the contrast loss function, the positive sample pairs are pushed to be close to each other in the embedding space, and the negative sample pairs are pushed to be far away from each other. In addition, the temperature adjustment factor is used to adjust the sharpness of the distribution and the gradient flow range, so that the model can form a compact and dispersed inter-class / intra-class structure in the high-dimensional space, which is more suitable for the multi-mode and strong dynamic industrial scene.
[0126] Exemplarily, for each pair of positive samples (x ) and negative samples (x ), a contrast loss function with a temperature adjustment factor is defined as :
[0127] , formula (11)
[0128] In the formula, represents the cosine similarity between the positive sample x and the current sample x , represents the cosine similarity between the negative sample x and the current sample x , and T is a temperature hyperparameter. represents the positive sample feature vector belonging to the same representative shape subsequence as the current sample x , represents the negative sample feature vector belonging to the same representative shape subsequence as the current sample x Negative sample feature vectors not belonging to the same representative sub-sequence of shape.
[0129] Input positive and negative samples in each batch, accumulate loss for all sample pairs and back-propagate, and optimize the encoder parameters in batches. Temperature hyperparameter Determined by experience or cross-validation (such as 0.05-0.2) to control the sensitivity of the distance distribution of the sample pairs. Through contrastive learning optimization, the same mode fragment embedding clusters are more closely clustered, different mode fragments are more obviously separated, and the small batch training efficiency is improved.
[0130] Through the embodiments of the present application, the representative sub-sequence that can maximize the information diversity is optimized by using the entropy gain, combined with the automatic construction of positive and negative sample pairs based on the Euclidean distance, and then the deep encoder is trained by using the contrastive loss function with a temperature adjustment factor, which can significantly improve the distinguishing ability of the model for different power consumption behavior modes, and can generate multi-source time series embedding vectors with strong discrimination, structured distribution and sensitivity to abnormal behavior.
[0131] Figure 4 An operation flowchart of an example of training a Dirichlet process-based Gaussian mixture dynamic clustering model is shown.
[0132] As shown in Figure 4 , in step S410, a pre-trained deep encoder is used to generate a set of historical embedding vectors corresponding to a set of historical sub-sequences, and a set of historical embedding vectors is used to analyze and initialize the cluster centers based on the K-Means++ algorithm.
[0133] It should be noted that if the dynamic clustering is directly performed on the high-dimensional embedding vectors, high-quality initialization cluster centers are required, otherwise it is easy to fall into local optimum or produce label drift, and the K-Means++ is an initialization method that can maximize the distance between samples and reasonably distribute the initial center points, which can effectively avoid the performance fluctuations caused by the randomness of clustering initialization.
[0134] In some embodiments, one embedding vector is randomly selected from the set of historical embedding vectors as the first cluster center. Then, for each embedding vector in the set of historical embedding vectors that has not been selected as a cluster center, the probability of being selected as the next cluster center is determined according to the proportion of the square of the minimum distance between the embedding vector and the selected cluster center in all embedding vectors that have not been selected, until M cluster centers are selected, M is the preset number of cluster centers.
[0135] The core of the K-Means++ algorithm is that subsequent centers are no longer randomly selected, but rather tend to be located farther from existing centers. By calculating the square of the minimum distance between each unselected embedding vector and the selected center, the new centers are effectively forced to cover scattered, rare, or extreme patterns in the data space, improving the spatial representativeness and distribution diversity of the initialization, ensuring that the initial centers are highly dispersed and have global coverage.
[0136] In step S420, the student t The distribution calculates the initial soft attribution of each historical embedding vector to the cluster center.
[0137] It should be noted that in high-dimensional space, the "affiliation relationship" between data points and cluster centers should not be divided by hard binary values, but should adopt a probabilistic and smooth soft attribution method, which not only reflects the distance relationship but also is compatible with complex distributions such as overlap and outliers. t The distribution kernel (fat-tailed distribution) is naturally suitable for high-dimensional clustering scenarios. It can adaptively adjust the initial degree of belonging (similarity weight) of samples to each cluster to avoid the adverse effects of outliers or noise on the initial clustering results.
[0138] , formula (12)
[0139] Where, For the History embedding vector For the first Cluster centers The initial soft attribution degree of Indicates the The historical embedding vectors generated by the deep encoder, the total number of historical embedding vectors contained in the historical embedding vector set is ; For the The location vectors of cluster centers, is the number of cluster centers; For students t The degrees of freedom hyperparameter of the distribution is used to adjust the fat-tail characteristics of the distribution; is the Euclidean distance operator, represents the index of any cluster center, For the The location vector of the cluster centers.
[0140] here, The larger the value of is, the closer it is to the normal distribution, and the smaller it is, the more tolerant it is to outliers. In addition, you can also set each For all Center All calculations are performed to form a soft attribution matrix.
[0141] In step S430, a corresponding target soft membership degree is calculated according to the initial soft membership degree, and the target soft membership degree is The initial soft membership degree is squared and then normalized to obtain.
[0142] Here, the square of the initial soft membership degree is used to improve the discrimination of the membership degree distribution (i.e., to enhance the confidence of high membership degrees and suppress the influence of low membership degrees), and normalization is performed to ensure that the sum of the target soft membership degrees of all clusters is 1. The target soft membership degree not only numerically strengthens high membership degree clusters and suppresses low membership degree clusters, but also, after normalization, can describe the global probability distribution characteristics, realizing guidance based on global probability distribution.
[0143] In step S440, the cluster center position is optimized by minimizing the KL divergence loss function between the initial soft membership degree and the target soft membership degree.
[0144] The target soft membership degree obtained by squaring and then normalizing the initial soft membership degree essentially constructs an ideal probability distribution that is more concentrated and has higher discrimination, as the "learning goal" in the model optimization process. Here, to make the model adaptively aggregate similar behaviors and separate different behaviors, the initial soft membership degree (based on distance) and the target soft membership degree (based on global probability distribution) need to be as close as possible.
[0145] Here, the initial soft membership degree is regarded as the model's current prediction distribution of the membership relationship of each embedding vector, and the target soft membership degree is regarded as the "teacher distribution" expected by the model to converge.
[0146] The KL divergence loss is taken as the optimization target:
[0147] , equation (13)
[0148] In the equation, represents the KL divergence value; represents the membership degree probability of the th embedding vector corresponding to the th cluster center; represents the total number of historical embedding vectors contained in the historical embedding vector set, is the number of cluster centers; is the index of the embedding vector, is the index of the cluster center.
[0149] By using optimization methods such as gradient descent, the cluster center is adjusted, and iteration is continuously performed until convergence.
[0150] The KL divergence loss function is used to measure the distance between the model prediction distribution and the target distribution, which can effectively guide the optimization direction of the model clustering center, make the actual output distribution gradually approach a more clear and discriminative target distribution, and thus improve the accuracy and robustness of the clustering label assignment.
[0151] According to the target attribution weight, the vector of all samples is weighted and averaged to update the new position of each clustering center:
[0152] , formula (14)
[0153] In the formula, represents the historical embedding vector generated by the depth encoder, represents the total number of historical embedding vectors contained in the historical embedding vector set, is the index of the embedding vector; represents the target soft attribution of the th historical embedding vector to the th clustering center, represents the updated position of the th clustering center.
[0154] Through multiple rounds of iteration, the clustering center converges from the initial value to the real dense area of data. Thus, the attribution and clustering center are synchronously and adaptively updated, which improves the clustering quality and discriminability, while avoiding the misclassification of transition samples in hard label clustering, and improving the adaptability to abnormal behaviors and mode drift.
[0155] In step S450, a Dirichlet process is used to recursively assign each embedding vector to a cluster number, and the number of non-empty clusters is used as the cluster number of the clustering model.
[0156] Specifically, the Dirichlet process is represented by the following Chinese restaurant process (CRP):
[0157] , formula (15)
[0158] In the formula, represents the cluster label of the th embedding vector, represents the index of the clustering cluster to which the th embedding vector is finally assigned, and the clustering cluster corresponding to the clustering cluster has the maximum assignment probability; is the clustering cluster assignment probability, which represents the probability that the th embedding vector is assigned to the th cluster, provided that the cluster assignments of the previous th embedding vectors are known; represents the cluster assignment probability of the The number of samples allocated to the i-th cluster in the i-th embedding vector The number of samples allocated to the i-th cluster in the i-th embedding vector The concentration hyperparameter representing the Dirichlet process, used to adjust the probability of new cluster emergence.
[0159] It should be noted that the industrial park power consumption behavior pattern itself is not fixed, and the number of clustering clusters should be able to automatically grow or shrink with the data scene. As a typical method of non-parametric Bayesian clustering, the Dirichlet process (DP) allows the final cluster number to be determined in a data-driven manner. The Chinese restaurant process is a specific implementation thereof: with each sample, according to the "popularity" of the existing clusters or the innovation probability, it is decided whether to be allocated to an old cluster or a new cluster, thereby adaptively depicting the number and composition of clustering clusters. Thus, without pre-setting the number of clustering clusters, new power consumption behavior patterns are automatically discovered, and changes in patterns caused by seasonal changes, strategy adjustments, etc. can be dynamically captured.
[0160] In step S460, a preset distance threshold is determined according to the distribution distance between the embedding vector set of the historical batch and the clustering center θ .
[0161] Specifically, the Wasserstein distance between the historical embedding vector set of each historical batch and the clustering center is calculated, and the preset distance threshold is updated according to the 95% quantile of the distance distribution of all historical batches θ .
[0162] It should be noted that with the dramatic temporal changes in distributed photovoltaic output and EV fast charging consumption, the behavior pattern in the industrial scene may change significantly over time, so the clustering model cannot be "one-time-for-all". By statistically calculating the Wasserstein distance between the embedding distribution of each batch and the clustering center distribution, and dynamically updating the distribution distance threshold, it can be determined whether the current clustering model is invalid or needs to be updated, thereby realizing online self-maintenance and self-evolution of the model.
[0163] In addition, if the distance of the new batch exceeds the threshold, the model retraining or fine-tuning (such as resetting the center, adding a new cluster, etc.) is automatically triggered; otherwise, only a small amount of position parameter updating of the clustering center is performed.
[0164] Through the embodiments of the present application, a Gaussian mixture dynamic clustering model based on Dirichlet process is adopted, without pre-setting the number of clusters, but through the Chinese restaurant process, the clustering clusters are adaptively expanded or merged according to the actual structure of the data. The non-parametric Bayesian strategy enables the model to flexibly capture newly emerging power consumption patterns and automatically merge them after the patterns disappear, continuously reflecting the concept drift or behavior mutation in the real business of the real industrial park, thereby strengthening the adaptive and evolutionary ability of the clustering model.
[0165] In order to further demonstrate the superiority of the technical solution, the comparative experimental verification part of the technical solution will be described.
[0166] Specifically, to verify the effectiveness and superiority of the "power consumption behavior clustering analysis method based on multi-source deep embedding and dynamic probability clustering" proposed in this technical solution in the industrial park scenario, high-frequency power consumption data, operation and maintenance logs, and meteorological monitoring data from January 2022 to December 2023 of a real industrial park in a certain province were used. 40 industrial parks with EV fast charging stations and distributed photovoltaic systems were selected as test objects, and the power data sampling period was 1 minute. The supporting data was aligned according to the 1-hour sliding window.
[0167] Method A (this scheme): Multi-source deep encoder + Dirichlet process Gaussian mixture dynamic clustering (DP-GMM), and soft attribution KL fine-tuning is adopted;
[0168] Method B (overall vector K-Means): After traditional alignment of time series overall vectorization, K-Means clustering is adopted;
[0169] Method C (multi-scale wavelet K-Means): Wavelet transform features + K-Means clustering;
[0170] Method D (autoencoder + spectral clustering): Deep autoencoder embedding + spectral clustering;
[0171] Method E (DBSCAN density clustering): Density-based unsupervised clustering, parameters are optimized by grid search.
[0172] All methods use the same data slicing and standardization process, and the number of clusters is set to automatic (DP-GMM, DBSCAN) or best experience (other methods).
[0173] To comprehensively evaluate the clustering effect, the following indicators are selected in this paper:
[0174] NMI (Normalized Mutual Information): Measures the consistency of clustering labels and expert manual labels;
[0175] Silhouette Coefficient: Measures the internal compactness and inter-cluster separation of samples;
[0176] Cluster Purity: The proportion of main class samples in the main cluster;
[0177] Runtime: The running time of the clustering algorithm for equal-sized data, in seconds;
[0178] Behavior capture rate: The recognition coverage rate of key power consumption behavior patterns such as "fast charging transient" and "reverse injection".
[0179] Table 1. Comparison of clustering performance
[0180]
[0181] As shown in Table 1, the method provided in the embodiment (i.e. method A) is significantly better than the comparative method in all mainstream clustering evaluation indicators. Especially in NMI, cluster purity and key behavior capture rate, it has a significant improvement compared with traditional methods such as K-Means and density clustering, and can more accurately identify complex power consumption modes such as mutation and superposition in the park. This is due to the fusion of multi-source context features, the high expression ability of the deep encoder and the dynamic clustering cluster number adaptive mechanism. In addition, although the running time of method A is slightly longer than that of fast methods such as K-Means, it is better than traditional spectral clustering and density clustering, and has better scalability and business interpretability.
[0182] Figure 5 The NMI performance comparison curves of different clustering methods under the change of sample size are shown. As shown in the coordinate system in Figure 5 The horizontal axis of the coordinate system is the sample size (pieces) of the power consumption behavior clustering task, and the vertical axis is the NMI index, which measures the consistency of the clustering results and the artificial label. The multi-source deep embedding + dynamic probability clustering (i.e. method A) proposed in this paper is compared with K-Means overall (method B), wavelet K-Means (method C), autoencoder + spectral clustering (method D) and DBSCAN density clustering (method E). As shown in Figure 5 It can be seen directly that the method A proposed in this paper has the highest NMI performance in the whole sample size range, and still maintains excellent clustering consistency and resolution ability as the data size increases, which is significantly better than other methods. The traditional method has a certain gap in small samples, but when the sample size increases and the scene complexity improves, the NMI improvement is limited or even platform, which shows the lack of generalization ability, and verifies the clustering advantage of the technical scheme in this paper in the complex industrial power consumption data scene.
[0183] In addition, further analysis of the distribution of each clustering label on typical power consumption behaviors (such as EV fast charging, PV reverse injection, load seasonal drift, etc.). Method A can accurately divide key behavior events into different clustering clusters, reducing the probability of "behavior confusion" or "clustering label drift", and can support the implementation of named matching of main behavior patterns after label mapping.
[0184] It should be noted that, for the foregoing method embodiments, for the sake of simple description, they are all described as a series of actions, but those skilled in the art should know that the present application is not limited to the order of the actions described, because according to the present application, certain steps can be performed in other order or simultaneously. Secondly, those skilled in the art should know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily necessary for the present application. In the above embodiments, the description of each embodiment is focused on, and the parts not described in detail in a certain embodiment can be referred to the related description of other embodiments.
[0185] Figure 6 A structural block diagram of an example of a power consumption behavior clustering analysis system based on big data according to an embodiment of the present application is shown.
[0186] As shown in Figure 6 The power consumption behavior clustering analysis system 600 based on big data includes a data acquisition unit 610, a feature encoding unit 620, a clustering analysis unit 630 and a behavior tagging unit 640.
[0187] The data acquisition unit 610 is configured to acquire active power time series data, operation and maintenance log data and meteorological monitoring data of each industrial park, perform standardization processing on the active power time series data to generate normalized sequences, perform sliding window slicing on the normalized sequences based on a plurality of preset window lengths with a preset step size to form a subsequence set, and align the operation and maintenance log data and meteorological monitoring data to the corresponding subsequence according to the time window.
[0188] The feature encoding unit 620 is configured to input the subsequence set and the aligned operation and maintenance log data and meteorological monitoring data into a pre-trained deep encoder to obtain a set of embedded vectors that fuse multi-source features.
[0189] The clustering analysis unit 630 is configured to input the set of embedded vectors into a pre-trained Dirichlet process-based Gaussian mixture dynamic clustering model to automatically determine the number of clustering clusters corresponding to the set of embedded vectors and the clustering centers of each clustering cluster, and assign each embedded vector to the corresponding clustering cluster according to the clustering centers of the clustering clusters to generate clustering labels for the set of embedded vectors.
[0190] The behavior tagging unit 640 is configured to determine the typical power consumption behavior category to which each industrial park belongs according to the clustering labels, and generate the corresponding typical power consumption behavior label.
[0191] In some embodiments, the embodiments of the present application provide a non-volatile computer readable storage medium, wherein one or more programs including execution instructions are stored in the storage medium, and the execution instructions can be read and executed by an electronic device (including but not limited to a computer, a server, or a network device, etc.) to perform the steps of any of the above power consumption behavior clustering analysis methods based on big data.
[0192] In some embodiments, the embodiments of the present application also provide a computer program product, which includes a computer program stored on a non-volatile computer readable storage medium, and the computer program includes program instructions, which, when executed by a computer, cause the computer to perform the steps of any of the above power consumption behavior clustering analysis methods based on big data.
[0193] In some embodiments, the embodiments of the present application also provide an electronic device, which includes at least one processor and a memory connected to the at least one processor in communication, wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the steps of the power consumption behavior clustering analysis method based on big data.
[0194] The above products can perform the methods provided by the embodiments of the present application, and have the corresponding function modules and beneficial effects of performing the methods. Technical details not described in detail in the embodiments can be referred to the methods provided by the embodiments of the present application.
[0195] The electronic device of the embodiments of the present application exists in various forms, including but not limited to:
[0196] (1) Mobile communication device: This type of device is characterized by having mobile communication function, and providing voice and data communication as the main target. This type of terminal includes: smart phone, multimedia phone, functional phone, and low-end phone, etc.
[0197] (2) Ultra-mobile personal computer device: This type of device belongs to the category of personal computers, has computing and processing functions, and generally also has the characteristics of mobile Internet. This type of terminal includes: PDA, MID and UMPC device, etc.
[0198] (3) Portable entertainment device: This type of device can display and play multimedia content. This type of device includes: audio and video player, handheld game console, electronic book, and smart toy and portable car navigation device.
[0199] (4) Other onboard electronic devices with data interaction function, such as vehicle-mounted devices installed on vehicles.
[0200] The device embodiments described above are merely illustrative, wherein the units described as separate components can or can not be physically separate, and the components displayed as units can or can not be physical units, i.e., can be located in one place, or can be distributed to multiple network units. Part or all of the modules can be selected according to actual needs to achieve the purpose of the embodiment scheme.
[0201] Through the description of the above embodiments, those skilled in the art can clearly understand that the embodiments can be implemented by means of software plus a general hardware platform, and of course can also be implemented by hardware. Based on such understanding, the above technical solutions can be embodied in the form of a software product, which can be stored in a computer readable storage medium, such as a ROM / RAM, a magnetic disk, an optical disk, etc., and includes a plurality of instructions to make a computer device (which can be a personal computer, a server, or a network device, etc.) execute the methods described in each embodiment or some parts of the embodiments.
[0202] Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present application, and not to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: it can still modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacement for part of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A cluster analysis method for electricity consumption behavior based on big data, characterized in that: The method comprises: Active power time series data, operation and maintenance log data, and meteorological monitoring data are collected from each industrial park. The active power time series data is normalized to generate a normalized sequence. The normalized sequence is sliced using sliding windows with a preset step size based on multiple preset window lengths to form a set of subsequences. The operation and maintenance log data and meteorological monitoring data are aligned to corresponding subsequences according to the time window. Inputting the subsequence set and the aligned operation and maintenance log data and meteorological monitoring data into a pre-trained deep encoder to obtain an embedding vector set that integrates multi-source features; Inputting the embedding vector set into a pre-trained Gaussian mixture dynamic clustering model based on the Dirichlet process, calling the cluster number and cluster center parameters obtained by model training, and assigning each embedding vector to a corresponding cluster cluster through a cluster attribution inference method to generate a cluster label for the embedding vector set; Determine the typical electricity usage behavior category of each industrial park based on the cluster labels, and generate corresponding typical electricity usage behavior labels; The training of the Gaussian mixture dynamic clustering model based on the Dirichlet process includes: A pre-trained deep encoder is used to generate a set of historical embedding vectors corresponding to a set of historical subsequences, and a K-Means++ algorithm is used to analyze and initialize cluster centers based on the set of historical embedding vectors. Employ students t The distribution calculates the initial soft attribution of each historical embedding vector to the cluster center: , Where, For the History embedding vector For the first Cluster centers The initial soft attribution of Indicates the The historical embedding vectors generated by the deep encoder, the total number of historical embedding vectors contained in the historical embedding vector set is ; For the The location vectors of cluster centers, is the number of cluster centers; For students t The degrees of freedom hyperparameter of the distribution is used to adjust the fat-tail characteristics of the distribution; is the Euclidean distance operator, Represents the index of any cluster center; The corresponding target soft attribution degree is calculated according to the initial soft attribution degree. is the initial soft attribution The square of is normalized to obtain; The cluster center position is optimized and updated by minimizing the KL divergence loss function between the initial soft attribution degree and the target soft attribution degree: , Where, Indicates the The historical embedding vectors are The target soft belonging degree of cluster centers, Indicates the The updated positions of the cluster centers; The Dirichlet process is used to recursively assign a cluster number to each embedding vector, and the number of non-empty clusters is used as the number of clusters in the clustering model. The Dirichlet process is represented by the following Chinese restaurant process: , Where, Indicates the The cluster labels of the embedding vectors, Indicates the The embedding vector is assigned to the The probability of a cluster, conditional on the previous The cluster assignment of the embedding vectors is known; Indicates the front The embedding vectors have been assigned to The number of samples in each cluster; represents the concentration hyperparameter of the Dirichlet process, which is used to adjust the probability of new clusters appearing; Determine the preset distance threshold based on the distribution distance between the embedding vector set of the historical batch and the cluster center θ , specifically including: Calculate the Wasserstein distance between the historical embedding vector set of each historical batch and the cluster center, and update the preset distance threshold based on the 95% quantile of the distance distribution of all historical batches θ .
2. The method according to claim 1, characterized in that After assigning each embedding vector to a corresponding cluster according to the cluster center of each cluster to generate a cluster label for the set of embedding vectors, the method further includes: Calculating a distribution distance between the embedding vector set and a historical cluster center; the historical cluster center is a cluster center automatically determined and saved by the Gaussian mixture dynamic clustering model based on the Dirichlet process for a previous batch of embedding vector sets; If the distribution distance does not exceed the preset distance threshold, only updating the historical cluster center position; and If the distribution distance exceeds a preset distance threshold, it is determined that concept drift occurs in the Gaussian mixture dynamic clustering model based on the Dirichlet process, and fine-tuning training is performed on the Gaussian mixture dynamic clustering model based on the Dirichlet process based on the embedding vector set.
3. The method according to claim 2, characterized in that The distribution distance adopts Wasserstein distance.
4. The method according to claim 3, characterized in that The training of the deep encoder includes: Sampling a candidate subsequence set from the historical subsequence set, and determining a representative shape subsequence from the candidate subsequence set based on an entropy gain method; constructing positive and negative sample pairs from the historical subsequence set based on the representative shape subsequence, wherein the subsequence pairs corresponding to the same shape subsequence are used as positive sample pairs, and the subsequence pairs not containing the same shape subsequence are used as negative sample pairs; Based on the positive and negative sample pairs, the depth encoder is trained using a contrast loss function with a temperature adjustment factor to determine network parameters of the pre-trained depth encoder; The entropy gain method is expressed by the following formula: , Where, Candidate subsequence The entropy gain value, is the set of historical subsequences, is the information entropy function, Candidate subsequence an optimal partitioning threshold of the Euclidean distance with other subsequences in the historical subsequence set; Representation and candidate subsequence The Euclidean distance is not greater than the optimal partition threshold The set of historical subsequences of Representation and candidate subsequence The Euclidean distance is greater than the optimal partition threshold The set of historical subsequences of Indicates the number of elements in the collection.
5. The method according to claim 4, characterized in that The initializing cluster centers by analyzing the historical embedding vector set through the K-Means++ algorithm includes: Randomly select an embedding vector from the historical embedding vector set as the first cluster center; For each embedding vector in the historical embedding vector set that has not been selected as a cluster center, the probability of the embedding vector being selected as the next cluster center is determined according to the proportion of the square of the minimum distance between the embedding vector and the selected cluster center in all the embedding vectors that have not been selected, until the selection is obtained. M cluster centers, M is the preset number of cluster centers.
6. The method according to claim 1, characterized in that The pre-trained deep encoder includes: Multiple parallel one-dimensional convolutional layers, each with a different convolution kernel width, are used to extract multi-scale temporal features of the input; After the output results of the multiple one-dimensional convolutional layers are spliced, at least one residual block including a dilated convolution and a channel attention mechanism is input to fuse and enhance the feature expressions of the power data, operation and maintenance log data, and meteorological monitoring data; The output of the residual block is processed by global average pooling and a fully connected layer to obtain an embedding vector that fuses multi-source features.
7. The method according to claim 1, characterized in that The cluster attribution inference method softly assigns the attribution of the embedding vector by combining the logarithmic probability expectation of the cluster mixing weight and the logarithmic probability expectation of the Gaussian likelihood of the embedding vector relative to each cluster center, thereby generating the cluster label of the embedding vector set: For each embedding vector, calculate its The responsibility of each cluster: , Where, Indicates the The embedding vector of the fusion multi-source features has an embedding dimension of ; Indicates the The embedding vector for The responsibility of a cluster or cluster center satisfies ; Indicates the The mixing weights of the clusters are derived from the broken stick process construction of the truncated Dirichlet process, satisfying ; For the The mean vector of each cluster represents the location of the cluster center; For the The covariance matrix of a cluster, describing the distribution shape of the cluster; Indicates proportional to the sign; represents the Gaussian probability density function; is the expectation of the weight of the folded stick process, which represents the random variable The logarithmic expectation under the variational distribution is used to evaluate the credibility of cluster weights: , Where, Indicates the first The two posterior parameters of the Beta distribution control The shape of the distribution and the probability of generating new clusters; represents the Digamma function, Indicates the number of nodes from cluster 1 to cluster 2. The cumulative cluster index of the cluster, and Indicates the Two posterior parameters of the Beta distribution; is the expectation of the log-likelihood of the Gaussian distribution: , Where, Indicates the mean and covariance The multivariate Gaussian probability density function described; represents the vector transpose operation, For the The precision matrix of clusters is defined as ; represents the number of embedding dimensions of the embedding vector, Indicates the The expected value of the logarithmic determinant of the covariance matrix of the clusters; Each embedding vector Assign to The largest cluster : , Where, Indicates that among all clusters, the degree of belonging is selected Largest cluster index ; Until each embedding vector in the embedding vector set is assigned a unique cluster label.
8. The method according to claim 1, characterized in that Determining the typical electricity usage behavior category of each industrial park based on the cluster labels and generating corresponding typical electricity usage behavior labels includes: For all subsequences in the same industrial park, the frequency of occurrence of each cluster in the industrial park is counted according to the cluster label, and the preset number of clusters with the highest occurrence frequency are regarded as the main clusters of the industrial park; According to the preset mapping relationship between clusters and electricity consumption behavior categories, the user behavior category corresponding to the main cluster is set as a typical electricity consumption behavior label of the corresponding industrial park.
9. A power consumption behavior clustering analysis system based on big data, characterized in that: The system is used to implement the method according to any one of claims 1 to 8; the system includes: a data acquisition unit, configured to collect active power time series data, operation and maintenance log data, and meteorological monitoring data from each industrial park, perform normalization processing on the active power time series data to generate a normalized sequence, perform sliding window slicing on the normalized sequence based on multiple preset window lengths and with a preset step size to form a set of subsequences, and align the operation and maintenance log data and meteorological monitoring data to corresponding subsequences according to time windows; A feature encoding unit, configured to input the subsequence set and the aligned operation and maintenance log data and meteorological monitoring data into a pre-trained deep encoder to obtain an embedding vector set that fuses multi-source features; a cluster analysis unit, configured to input the embedding vector set into a pre-trained Gaussian mixture dynamic clustering model based on a Dirichlet process to automatically determine the number of clusters corresponding to the embedding vector set and the cluster centers of each cluster, and assign each embedding vector to a corresponding cluster according to the cluster centers of each cluster to generate a cluster label for the embedding vector set; The behavior labeling unit is used to determine the typical electricity consumption behavior category of each industrial park according to the cluster label and generate a corresponding typical electricity consumption behavior label.
Citation Information
Patent Citations
Clustering analysis method and device for power consumption behaviors of power customers
CN113450142A
Intelligent water conservancy integrated big data analysis method based on clustering algorithm
CN120124999A