A non-invasive load decomposition method and device for energy scenarios
By combining the adaptive random decision forest large model (ARDF-EN) with Transformer and RDF and introducing a dynamic feedback mechanism, the limitations and robustness problems of traditional models in processing high-dimensional time series data are solved, and high-precision load decomposition and dynamic adaptation are achieved, which is suitable for complex heterogeneous energy scenarios.
Patent Information
- Application Number
- CN202510827908.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-20
- Publication Date
- 2025-09-19
- Estimated Expiration
- 2045-06-20
AI Technical Summary
When existing technologies process high-dimensional time series data, traditional random decision forest models have difficulty capturing the global dependencies of time series data, pure Transformer models lack robustness to local noise, and fixed parameter models cannot adapt to dynamic changes in equipment correlation, resulting in a high misjudgment rate of load superposition.
The adaptive random decision forest large model (ARDF-EN) is adopted. By integrating Transformer feature extraction and RDF ensemble learning, a dynamic feedback mechanism is introduced to adaptively adjust parameters. Combined with graph neural networks, a device association graph is constructed, a dynamic adjacency matrix is generated, and the attention weight distribution is optimized.
It significantly improves the load decomposition accuracy in large-scale heterogeneous energy scenarios, reduces computational complexity, improves the dynamic adaptability and anti-interference ability of the model, and can effectively distinguish between real load fluctuations and noise interference.
Smart Images

Figure CN120337161B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of smart grid and energy management technology, and in particular to a non-invasive load decomposition method and device for energy scenarios. Background Art
[0002] In the construction of the Energy Internet and new power systems, non-intrusive load monitoring (NILM) technology achieves device-level energy consumption decomposition by analyzing total load data, playing a key role in demand response, anomaly detection, and energy efficiency optimization. Traditional methods such as random decision forests (RDF) use ensemble learning to achieve load feature classification, but they have insufficient feature expression capabilities when processing high-dimensional time series data. In recent years, Transformer-based attention mechanism models have shown advantages in sequence modeling, but traditional Transformer models are not sensitive enough to local feature fluctuations, and the fixed model parameters lead to weak scenario adaptability. For example, the use of fixed attention weights cannot adapt to dynamic changes in device correlation (such as the coordinated start and stop of charging pile groups), resulting in a high rate of load superposition misjudgment.
[0003] The existing technology has the following defects: Single model limitations: Pure RDF models are difficult to capture the global dependencies of time series data, and pure Transformer models lack robustness to local noise; Insufficient dynamic adaptability: Fixed parameter models cannot adapt to complex working conditions such as sudden changes in charging pile power and fluctuations in photovoltaic output; Feature fusion defects: The correlation features between time series position coding and equipment operation mode are not effectively combined.
[0004] This paper proposes the ARDF-EN algorithm, which significantly improves the load decomposition accuracy in large-scale heterogeneous energy scenarios by integrating the advantages of Transformer feature extraction and RDF ensemble learning and introducing a dynamic feedback mechanism. Summary of the Invention
[0005] To address the above problems, the present invention proposes an Adaptive Random Decision Forest Encoder Network (ARDF-EN) algorithm, which can be applied to non-invasive load decomposition systems in high-proportion energy scenarios. The algorithm can decompose individual operating devices from the input aggregated load data and introduce a dynamic feedback mechanism to achieve adaptive parameter adjustment, significantly improving the load decomposition accuracy in large-scale heterogeneous energy scenarios.
[0006] To achieve the above objectives, the following technical solutions are adopted:
[0007] According to a first aspect of the present invention, a non-intrusive load decomposition method for energy scenarios is provided, comprising:
[0008] Step S1: Obtain aggregated load time series data and perform normalization processing;
[0009] Step S2: The standardized aggregate load time series data is input into the feature extraction module, and is sequentially processed through high-dimensional vector embedding, position encoding, multi-head self-attention mechanism processing, and nonlinear transformation to obtain a high-dimensional feature vector after nonlinear transformation;
[0010] Step S3: Input the high-dimensional feature vector after the nonlinear transformation into the load decomposition prediction module, perform maximum pooling dimensionality reduction processing in sequence to obtain the reduced-dimensional features, and use the reduced-dimensional features to train a random decision forest model. Then, use the trained random decision forest model to perform prediction and output the operating load prediction value of each device.
[0011] Step S4: Calculate the error between the predicted value and the actual value of the operating load of the individual device, and adjust the hyperparameters of the feature extraction module and the number and depth of trees of the random decision forest model based on the error adaptive feedback.
[0012] Furthermore, the step S1: obtaining aggregated load time series data and performing normalization processing includes:
[0013] Step S101: The input layer collects aggregated load data in the form of time series , To aggregate load data, It's in time The load value, M is the length of the time series;
[0014] Step S102: The normalization layer normalizes the aggregated load data to obtain the normalized time series data. ;
[0015]
[0016] Where, and are the mean and standard deviation of the aggregated load data, respectively.
[0017] Furthermore, the step S2 includes:
[0018] Step S201: The embedding layer embeds the standardized aggregated load time series data Convert to high-dimensional vector embedding representation , is the field of real numbers, is the embedding dimension;
[0019]
[0020] Step S202: The position encoding layer adds position encoding to the high-dimensional vector embedding representation E , and get the embedded representation after adding position encoding:
[0021]
[0022] Among them, the position encoding uses the sine-cosine function. is the time step In position Sinusoidal position encoding, is the time step In position The cosine position encoding, is the index of the time step, The dimension index encoding the position;
[0023] Step S203: The multi-head self-attention layer performs a multi-head self-attention mechanism on the embedded representation after adding the position encoding, calculates the self-attention, and obtains the feature representation after the multi-head self-attention mechanism processing ;
[0024] Step S204: The feedforward neural network layer uses the ReLU activation function to perform nonlinear transformation on the feature representation A processed by the multi-head self-attention mechanism to obtain a high-dimensional feature vector after nonlinear transformation ;
[0025]
[0026] Where, is the feature vector after nonlinear transformation, ReLU is the activation function applied to the output of the first layer, is the output of the self-attention layer, is the weight matrix of the first layer, is the bias vector of the first layer, is the weight matrix of the second layer, is the bias vector of the second layer.
[0027] Furthermore, step S3 includes:
[0028] Step S301: The maximum pooling layer of the load decomposition prediction module performs maximum pooling dimensionality reduction processing on the high-dimensional feature vector after the nonlinear transformation, including normalization and dimensionality reduction processing, to obtain a feature vector after dimensionality reduction;
[0029] Step S302: using the feature vector after dimensionality reduction to train a random decision forest model to obtain a trained random decision forest model;
[0030] Step S303: Utilize the trained random decision forest model to integrate the prediction results of multiple decision trees to output the operating load prediction value of a single device.
[0031] Furthermore, in step S302, each decision tree is trained using the feature vector after dimensionality reduction, and each decision tree makes predictions independently;
[0032]
[0033] Where, is the number of decision trees, is the prediction function of the j-th decision tree, is the feature vector after dimensionality reduction;
[0034] In step S303, the prediction results of each decision tree, i.e., the load prediction value, are integrated by majority voting or weighted averaging:
[0035]
[0036] Where, The operating load forecast value of a single device is output for forecasting. is the number of decision trees, is the prediction function of the j-th decision tree, The processed feature vector.
[0037] Furthermore, the step S4 includes:
[0038] Calculate the root mean square error between the predicted and actual operating load values of individual equipment;
[0039] At least one of the number of Transformer layers, the number of attention heads, and the learning rate of the feature extraction module is adjusted according to the root mean square error adaptive feedback; and the number of trees and the maximum depth of the random decision forest model are simultaneously optimized.
[0040] Furthermore, when the feedback mechanism detects that the error exceeds the threshold:
[0041] Launch a graph neural network (GNN) to analyze device spatial correlation and build a device association graph to generate a node relationship matrix. ;
[0042] According to the node relationship matrix Reconstruct the weight distribution of the multi-head self-attention layer:
[0043]
[0044] Among them, Q is the query matrix, K is the key matrix, and V is the value matrix. is the dimension of the key vector, and ⊙ represents the Hadamard product.
[0045] Furthermore, the startup graph neural network (GNN) analyzes the device association and constructs a device association graph to generate a node relationship matrix ,include:
[0046] Collect the real load time series of all equipment historical operation ;
[0047] Run real load time series based on all equipment history as described , calculate the Pearson correlation coefficient between device i' and device j' ;
[0048] Construct an initial undirected graph structure G=(V,E), where each device i' is a graph node , edge weight ;
[0049] Optimizing edge weights via graph neural networks: , ,in, is the original edge weight between devices; Learning structure for differentiable edge weights; is the device node feature vector;
[0050] Original edge weights between devices Nonlinearly normalize the off-diagonal elements of : ( ), , thus Map to the interval [0,1];
[0051] Where α is a trainable scaling factor, is the trainable edge weight parameter;
[0052] And, only when the load fluctuation of equipment i' or equipment j' exceeds the preset variance When , recalculate the Pearson correlation coefficient ; Graph neural networks only satisfy Optimize the edges of is the thinning threshold.
[0053] Furthermore, in the random decision forest model, the maximum depth of a single decision tree does not exceed 10, the minimum number of leaf node samples is 2, and the integration strategy adopts a weighted average method to fuse the prediction results of each tree.
[0054] According to a second aspect of the present invention, there is also provided a non-invasive load decomposition device for energy scenarios, which is used to implement the non-invasive load decomposition method for energy scenarios as described in the first aspect, comprising: a data input module, a feature extraction module, a load decomposition prediction module, and a dynamic feedback module connected in sequence;
[0055] The data input module includes an input layer and a normalization layer for collecting and normalizing aggregated load time series data;
[0056] The feature extraction module includes an embedding layer, a position encoding layer, and multiple Transformer blocks, which are used to process the standardized aggregated load time series data to generate a high-dimensional feature vector after nonlinear transformation; wherein the Transformer block includes a multi-head self-attention layer and a feedforward neural network layer;
[0057] The load decomposition prediction module includes a maximum pooling layer and a random decision forest model, which is used to perform maximum pooling dimensionality reduction processing on the high-dimensional feature vector after nonlinear transformation, and use the reduced dimensionality features to train and predict the random decision forest model, and output the operating load prediction value of each device;
[0058] The dynamic feedback module includes an error calculation unit and a parameter adjustment unit. The error calculation unit predicts the error between the predicted value and the true value; the parameter adjustment unit dynamically optimizes the parameters of the feature extraction module and the load decomposition prediction module based on the error to achieve model adaptive feedback adjustment;
[0059] The feedforward neural network layer includes two fully connected layers and a ReLU activation function; the random decision forest includes multiple decision trees, which are trained by random subsets of features and random subsets of data.
[0060] Compared with the prior art, the present invention achieves the following beneficial effects:
[0061] 1. This paper combines the global feature extraction capability of Transformer with the local pattern recognition advantage of Random Decision Forest (RDF). Transformer captures the long-range dependencies of time series data, while RDF enhances robustness to local noise through ensemble learning, breaking through the limitations of a single model.
[0062] 2. This invention introduces a dynamic feedback mechanism to adaptively adjust the number of Transformer layers, the number of attention heads, and the depth of the RDF tree based on real-time errors. For example, when a sudden load change is detected, the model can dynamically increase the number of attention heads to enhance feature extraction while optimizing the RDF tree structure to prevent overfitting. This reduces computational complexity while maintaining accuracy. For example, the number of Transformer layers and the depth of the RDF tree are dynamically adjusted based on the complexity of the scene, avoiding redundant computations.
[0063] 3. This invention uses a graph neural network (GNN) to construct a device association graph and generate a dynamic adjacency matrix to modify the distribution of attention weights. This mechanism effectively addresses the problem of load superposition caused by coordinated device startup and shutdown. For example, when a group of charging stations are started and stopped simultaneously, traditional models can easily misinterpret the superimposed load as the behavior of a single device.
[0064] 4. This invention combines time-series position coding with the associated characteristics of device operating modes, enabling the model to distinguish between real load fluctuations and noise interference. For example, the characteristics of photovoltaic output fluctuations and charging load are effectively decoupled through position coding and GNN association analysis.
[0065] In summary, the present invention has achieved breakthroughs in key indicators such as load decomposition accuracy, dynamic adaptability, anti-interference ability, and computing efficiency through technical innovations such as algorithm fusion, dynamic feedback, and device association modeling. It provides a solution with both high precision and strong robustness for the field of smart grid and energy management. The present invention has significant technical advantages and application value in complex heterogeneous energy scenarios.
[0066] It should be understood that the contents described in the summary of the invention are not intended to limit the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become readily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0067] The above and other features, advantages and aspects of the embodiments of the present invention will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. The accompanying drawings are provided for a better understanding of the present invention and do not constitute a limitation of the present invention. In the accompanying drawings, the same or similar reference numerals represent the same or similar elements, among which:
[0068] Figure 1 This is a flow chart of a non-invasive load decomposition method for energy scenarios according to an embodiment of the present invention;
[0069] Figure 2 1 is a schematic diagram of data flow and network architecture of a non-intrusive load decomposition method and device for energy scenarios according to an embodiment of the present invention;
[0070] Figure 31 is a schematic diagram of a module of a non-invasive load decomposition device for energy scenarios according to an embodiment of the present invention;
[0071] Figure 4 2 is a schematic diagram of the structure of the Transformer encoding block according to an embodiment of the present invention;
[0072] Figure 5 3 is a flow chart of step S5 in an embodiment of the present invention. DETAILED DESCRIPTION
[0073] To make the objectives, technical solutions, and advantages of the embodiments of the present invention more clear, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.
[0074] In this document, the term "and / or" simply describes a relationship between related objects, indicating that three possible relationships exist. For example, "A and / or B" can represent: A exists alone, A and B exist simultaneously, or B exists alone. Furthermore, the character " / " in this document generally indicates that the related objects are in an "or" relationship.
[0075] The purpose of this application is to provide an adaptive random decision forest encoder network (ARDF-EN) algorithm for non-invasive load decomposition and prediction tasks in high-proportion energy scenarios. It can solve the problem of wind and solar fluctuations masking the charging load characteristics in non-invasive load decomposition systems in high-proportion energy scenarios, such as scenarios where the new energy penetration rate is greater than 20% and the equipment composition includes photovoltaic inverter groups, wind power converters and charging pile clusters. For example, in large-scale electric vehicle charging facilities, the number of charging piles is greater than or equal to 100 and the power mutation rate is greater than 30% / min, and the equipment composition includes DC fast charging piles, AC slow charging piles and V2G piles, etc., to solve the problem of load superposition caused by the coordinated start and stop of the pile group. Through the independently developed adaptive random decision forest large model algorithm, the load conditions of individual devices or energy consumption components are decomposed from the input aggregated load data, and the parameter adaptive adjustment is achieved by adding a feedback mechanism.
[0076] Load decomposition forecasting refers to accurately predicting the load conditions of individual equipment or energy-consuming components from the overall energy load data, which is of great significance for energy management and optimization.
[0077] Example 1:
[0078] Figure 1 A schematic flow chart of a non-invasive load decomposition method for energy scenarios according to an embodiment of the present invention is shown; Figure 2 This is a data flow and network architecture diagram of a non-invasive load decomposition method and device for energy scenarios according to an embodiment of the present invention. Figure 1 and Figure 2 As shown, a non-intrusive load decomposition method 100 for energy scenarios is applied to Figure 3 The non-intrusive load decomposition device 200 for energy scenarios shown includes the following steps:
[0079] Step S1: Obtain aggregated load time series data and perform normalization processing;
[0080] Step S2: The standardized aggregate load time series data is input into the feature extraction module, and is sequentially processed through high-dimensional vector embedding, position encoding, multi-head self-attention mechanism processing, and nonlinear transformation to obtain a high-dimensional feature vector after nonlinear transformation;
[0081] Step S3: Input the high-dimensional feature vector after the nonlinear transformation into the load decomposition prediction module, perform maximum pooling dimensionality reduction processing in sequence to obtain the reduced-dimensional features, and use the reduced-dimensional features to train a random decision forest model. Then, use the trained random decision forest model to perform prediction and output the operating load prediction value of each device.
[0082] Step S4: Calculate the error between the predicted value and the actual value of the operating load of the individual device, and adjust the hyperparameters of the feature extraction module and the number and depth of trees of the random decision forest model based on the error adaptive feedback.
[0083] Figure 3 is a module diagram of a non-invasive load decomposition device for energy scenarios according to an embodiment of the present invention. Figure 3 As shown, a non-invasive load decomposition device 200 for energy scenarios according to an embodiment of the present invention is used to implement the above-mentioned non-invasive load decomposition method 100 for energy scenarios, including: a data input module 210, a feature extraction module 220, a load decomposition prediction module 230 and a dynamic feedback module 240 connected in sequence.
[0084] The data input module 210 includes an input layer and a normalization layer for collecting and normalizing aggregated load time series data;
[0085] The feature extraction module 220 includes an embedding layer (fully connected layer), a position encoding layer, and multiple Transformer blocks, which are used to process the standardized aggregated load time series data to generate a high-dimensional feature vector after nonlinear transformation; wherein the Transformer block includes a multi-head self-attention layer and a feedforward neural network layer;
[0086] Each Transformer block consists of a multi-head self-attention layer and a feed-forward network (FFN). The FFN performs feature transformation within the Transformer block, and its output directly serves as the input (or final output) of the next Transformer block. The feed-forward network layer includes two fully connected layers and a ReLU activation function.
[0087] The load decomposition prediction module 230 includes a maximum pooling layer and a random decision forest model, which is used to perform maximum pooling dimensionality reduction processing on the high-dimensional feature vector after nonlinear transformation, and use the reduced dimensionality features to train and predict the random decision forest model, and output the operating load prediction value of each individual device;
[0088] Among them, the random decision forest includes multiple decision trees, which are trained by random subsets of features and random subsets of data.
[0089] The dynamic feedback module 240 includes an error calculation unit and a parameter adjustment unit. The error calculation unit calculates the error between the predicted value and the true value. The parameter adjustment unit dynamically optimizes the parameters of the feature extraction module 220 and the load decomposition prediction module 230 based on the error, such as adjusting at least one of the number of Transformer layers, the number of attention heads, and the learning rate, and simultaneously optimizes the number of trees and the maximum depth of the random decision forest model to achieve model adaptive feedback adjustment.
[0090] Furthermore, step S1: obtaining aggregated load time series data and performing normalization processing, specifically includes:
[0091] Step S101: The input layer collects aggregated load data in the form of time series , To aggregate load data, It's in time Specifically, the input layer receives aggregated load data from multiple devices (e.g., charging piles and battery swap stations in charging facilities; photovoltaic storage devices and wind turbines in energy storage systems) in the form of time series, containing load data points (e.g., power values and energy consumption) at multiple time steps. For example, M = 1440 represents 24 hours of data with a 1-minute interval.
[0092] Step S102: The normalization layer normalizes the aggregated load data to obtain the normalized time series data. ;
[0093]
[0094] Where, and are the mean and standard deviation of the aggregated load data, respectively.
[0095] The time series data normalized in step S102 is used for subsequent feature extraction.
[0096] Furthermore, the step S2 specifically includes:
[0097] Step S201: The embedding layer embeds the standardized aggregated load time series data Convert to high-dimensional vector embedding representation , is the field of real numbers, is the embedding dimension, for example, 256;
[0098]
[0099] Through step S201, the input time series data is converted into a high-dimensional vector representation, making it suitable for subsequent neural network processing.
[0100] Step S202: The position encoding layer adds position encoding to the high-dimensional vector embedding representation E , and get the embedded representation after adding position encoding:
[0101]
[0102] Among them, the position encoding uses the sine-cosine function. is the time step In position Sinusoidal position encoding, is the time step In position The cosine position encoding, is the index of the time step, The dimension index encoding the position.
[0103] In step S202, position code P is added to the high-dimensional vector embedding representation E to retain the order information of the time series, ensuring that the model can capture the position information between time steps and avoiding the loss of time step order information that affects the prediction effect.
[0104] Step S203: The multi-head self-attention layer performs a multi-head self-attention mechanism on the embedded representation after adding the position encoding, calculates the self-attention, and obtains the feature representation after the multi-head self-attention mechanism processing :
[0105]
[0106] Where Q is the inter-check matrix, E is the high-dimensional vector embedding representation, W is the linear transformation matrix, K is the key matrix, and V is the value matrix. is the feature representation A after processing by the multi-head self-attention mechanism, is the dot product of the query matrix and the key matrix, is the dimension of the key matrix, and softmax is the normalization function that converts the dot product result into a weight distribution.
[0107] This step S203 is used to capture the global dependencies in the time series data, and extract the important features and relationships in the input sequence by calculating the attention weights between each time step and all other time steps.
[0108] Step S204: The feedforward neural network layer uses the ReLU activation function to perform nonlinear transformation on the feature representation A processed by the multi-head self-attention mechanism to obtain a high-dimensional feature vector after nonlinear transformation ;
[0109]
[0110] Where, is the feature vector after nonlinear transformation, ReLU is the activation function applied to the output of the first layer, is the output of the self-attention layer, is the weight matrix of the first layer, is the bias vector of the first layer, is the weight matrix of the second layer, is the bias vector of the second layer. In the internal structure of FFN, Linear(256→512) + ReLU + Linear(512→256).
[0111] Furthermore, in some embodiments, the feature extraction module includes N (e.g., 4) serially connected Transformer encoding blocks, such as Figure 4 As shown, each encoding block includes: a layer normalization unit, a multi-head self-attention calculation unit, a first residual connection unit, a second layer normalization unit, a feedforward neural network unit (including two fully connected layers and ReLU activation), and a second residual connection unit. Figure 4 The y in is the output of the first residual connection unit. The parameters of the feedforward neural network unit satisfy:
[0112]
[0113] in, , , the feedforward layer hidden layer dimension , c is the FFN input, that is, the multi-head attention layer output A.
[0114] In step S204, the output of the self-attention layer is nonlinearly transformed through the feedforward neural network layer to enhance the expression ability of the model and further extract high-order features.
[0115] Furthermore, step S3 specifically includes:
[0116] Step S301: The maximum pooling layer of the load decomposition prediction module performs maximum pooling dimensionality reduction processing on the high-dimensional feature vector after the nonlinear transformation, including normalization and dimensionality reduction processing, to obtain a feature vector after dimensionality reduction; specifically, the process includes:
[0117] Step S3011: normalize the features after nonlinear transformation, i.e., the output high-dimensional feature vector, to obtain normalized features:
[0118]
[0119] Where, is the normalized feature, is the high-dimensional feature vector after nonlinear transformation, is the mean of the eigenvectors, is the standard deviation of the eigenvector.
[0120] Step S3012: Perform dimensionality reduction processing on the normalized features to obtain the reduced-dimensional features:
[0121]
[0122] Where, is the feature after dimensionality reduction; It is a dimensionality reduction algorithm used to reduce the dimension of feature vectors.
[0123] The max pooling layer performs dimensionality reduction on the high-dimensional feature vector output from the Transformer model. The processed feature vector, through the above-mentioned feature dimensionality reduction and other processing steps, facilitates the subsequent training of the random decision forest model.
[0124] Step S302: using the feature vector after dimensionality reduction to train a random decision forest model to obtain a trained random decision forest model;
[0125] The random decision forest model consists of N decision trees, trained using random subsets of features and data. The specific steps are as follows: Decision tree training: N decision trees are trained using the feature vectors, with each tree making independent predictions. Ensemble prediction: The predictions from each decision tree are combined using an ensemble strategy such as majority voting or weighted averaging. Output: The operating load forecast for each device.
[0126] In this random decision forest model, the maximum depth of a single decision tree does not exceed 10, and the minimum number of leaf node samples is 2.
[0127] Each decision tree is trained using the reduced feature vector, and each decision tree makes predictions independently;
[0128]
[0129] Where, is the number of decision trees, is the prediction function of the j-th decision tree, is the feature vector after dimensionality reduction;
[0130] In step S303, the trained random decision forest model is used to integrate the prediction results of multiple decision trees to output the operating load prediction value of each device;
[0131] In step S303, the prediction results of each decision tree, i.e., the load prediction value, are integrated by majority voting or weighted average:
[0132]
[0133] Where, The operating load forecast value of a single device is output for forecasting. is the number of decision trees, is the prediction function of the j-th decision tree, The processed feature vector.
[0134] Furthermore, step S4 specifically includes:
[0135] Calculate the error between the predicted value and the actual value of the operating load of a single device, such as the root mean square error:
[0136]
[0137] Where, is the mean square error, is the predicted load value of the t-th sample, is the true load value of the tth sample.
[0138] According to the root mean square error Adaptive feedback adjusts at least one of the number of Transformer layers, the number of attention heads, and the learning rate of the feature extraction module; and simultaneously optimizes the number of trees and the maximum depth of the random decision forest model.
[0139] For example, when the root mean square error Error exceeds the threshold When , the gradient descent method is used to update the number of Transformer layers L and the number of attention heads H. The update formula is:
[0140] L = L - α * ∂Error / ∂L
[0141] H = H - β * ∂Error / ∂H
[0142] Where α and β are learning rates, which are dynamically adjusted according to historical errors (α∈[0.01,0.1], β∈[0.005,0.05]).
[0143] This step S4 can significantly improve the prediction accuracy by updating the model parameters.
[0144] Preferably, in some embodiments of the present invention, the method further comprises:
[0145] S5: Based on the dynamic topology reconstruction mechanism, when the feedback mechanism detects that the error exceeds the threshold When , the attention weight distribution is modified by the Hadamard product. Among them, the threshold The 95% percentile of historical errors is dynamically set and updated every 24 hours. The specific steps are as follows:
[0146] S501: Start the graph neural network (GNN) to analyze the spatial correlation of devices and build a device correlation graph to generate a node relationship matrix (i.e., a dynamic adjacency matrix). ; Z is the total number of devices to be decomposed (for example, charging piles numbered 1 to Z), The value range is [0,1], indicating the strength of the association (topological structure) between device i' and device j'. It is a priori knowledge in the device dimension, such as describing the coordinated start and stop rules between charging piles.
[0147] Preferably, when the error is detected > 0.25, GNN is triggered to generate the node relationship matrix .
[0148] S502: Based on the node relationship matrix Reconstruct the weight distribution of the multi-head self-attention layer:
[0149]
[0150] Among them, Q is the query matrix, K is the key matrix, and V is the value matrix. is the dimension of the key vector, and ⊙ represents the Hadamard product.
[0151] The dynamic topology mechanism of step S5 can solve technical problems such as the dynamic changes in device association caused by the start and stop of charging pile groups, which are difficult for fixed models to adapt to, or the load superposition caused by the simultaneous start and stop of pile groups, which cannot be distinguished by traditional attention. By separating the superimposed loads, the model's recognition rate for sudden load events can be effectively improved, and the prediction value error can be reduced.
[0152] Further, step S501: start the graph neural network (GNN) to analyze the device association and build a device association graph to generate a node relationship matrix , specifically including:
[0153] S5011: Collect the real load time series Y of all equipment historical operation , i.e. device metadata (type / location / power rating), .
[0154] S5012: Run real load time series based on all equipment history , calculate the Pearson correlation coefficient between device i' and device j' ;
[0155] Compute the covariance:
[0156] Pearson correlation coefficient:
[0157] S5013: Construct an initial undirected graph structure G = (V, E), where each device i' is a graph node , edge weight ;
[0158] S5014: Optimizing Edge Weights via Graph Neural Networks: , ,in, is the original edge weight between devices; Learning structure for differentiable edge weights; is the device node feature vector ( is the hidden layer dimension), which integrates the dynamic power characteristics of the device ( ) with static attributes (type / position), pre-trained It can quickly adapt to new scenarios (such as adding new charging stations) and is portable.
[0159] In addition, the graph neural network (GNN) model structure uses a two-layer GCN (Graph Convolutional Network), with an output dimension of 128 and a ReLU activation function for each layer;
[0160] Design node features For example, if devices i' and j' are charging piles, then is the average power of the device, is the power standard deviation; device type embedding (e.g., fast charging pile / slow charging pile); geographic location embedding (e.g., charging station area A);
[0161] Message passing formula: ,in, Indicates that node i' is l +1 layer’s feature vector; Indicates that j' is l The feature vector of the layer; Represents the neighbor set of node i'. If node i' has three neighbors, i.e., associated devices, then ; ReLU is a nonlinear activation function, ReLU(⋅)=max(0,⋅); For the l The trainable weight matrix of the layer; is a linear feature transformation; represents the aggregation of neighbor features; Represents the normalization coefficient to avoid information bias caused by the difference in the number of neighbors. If device j' has 10 neighbors and device i' has 2 neighbors, the weight decays. ; Through the learnable matrix Extracting combined patterns of neighbor features, such as capturing the light-load coupling characteristics of photovoltaic storage devices or learning the periodic start-stop pattern of charging pile groups, when the device association changes (such as adding a charging pile), only the neighbor set needs to be updated , without having to retrain the entire model.
[0162] S5015: Original edge weights between devices Nonlinearly normalize the off-diagonal elements of : ( ), , thus Map to the interval [0,1];
[0163] Where α is a trainable scaling factor, for example, α∈[2,5], is the trainable edge weight parameter;
[0164] And, only when the load fluctuation of equipment i' or equipment j' exceeds the preset variance When , recalculate the Pearson correlation coefficient ; Graph neural networks only satisfy Optimize the edges of is the sparseness threshold, such as neighbor aggregation: only aggregate the association devices (e.g. β = 0.3).
[0165] Preferably, the above recalculated Pearson correlation coefficient When , the covariance update formula is:
[0166]
[0167] Among them, γ∈[0,1] is the forgetting factor.
[0168] According to the above-mentioned embodiments of the present invention, a non-intrusive load decomposition method and apparatus for energy scenarios is provided. By designing an adaptive random decision forest encoder network (ARDF-EN) algorithm, it can decompose individual operating devices from input aggregated load data. A dynamic feedback mechanism is introduced to achieve adaptive parameter adjustment, significantly improving load decomposition accuracy in large-scale heterogeneous energy scenarios. Furthermore, the feature extraction module (Transformer) and the load decomposition module (Random Forest) are jointly trained and optimized through an end-to-end gradient backpropagation mechanism (rather than staged training). The Transformer feature layer is specifically optimized to match the random forest decision boundary, and error feedback is used to adjust Transformer hyperparameters (such as the number of attention heads) and forest structure (tree depth) in real time, improving decomposition accuracy and recognition rate of sudden load scenarios. This invention provides a load decomposition solution for the smart grid field that combines high accuracy, strong interference immunity, low latency, and reliability.
[0169] Example 2:
[0170] The present invention discloses a non-invasive load decomposition device for energy scenarios, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor. The memory and the processor form an electronic terminal. When the processor executes the computer program, the steps of a non-invasive load decomposition method for energy scenarios in an embodiment are implemented.
[0171] Example 3:
[0172] The present invention discloses a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, the steps of a non-invasive load decomposition method for energy scenarios in embodiment 1 are implemented.
[0173] Comparative experiments were conducted on a system equipped with an NVIDIA Tesla V100 GPU using Python 3.8, TensorFlow 2.5, and Scikit-learn 0.24. The Transformer model was configured with 4 layers, 8 attention heads, and a 256-dimensional embedding. The learning rate was 0.001, the batch size was 32, and training was performed for 50 epochs. The random decision forest model consisted of 100 decision trees with a maximum depth of 10 and a minimum sample split of 2. The root mean square error (RMSE) was used as the primary evaluation metric to assess the performance of the two models in load decomposition forecasting. The results are shown in Table 1.
[0174] Table 1: Experimental results
[0175]
[0176] According to the comparative experimental results, the present invention captures timing dependencies through the feature extraction module (Transformer), enhances robustness through random decision forest, and dynamically optimizes the feedback mechanism. Compared with a single model, it effectively reduces the root mean square error (RMSE) and improves decomposition accuracy. The advantages are particularly significant in high-interference scenarios. Dynamic topology reconstruction suppresses the superposition of associated equipment loads and has strong anti-interference capabilities.
[0177] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of each step described above can refer to the corresponding process in the aforementioned system embodiment and will not be repeated here.
[0178] It should be noted that the various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. Reference can be made to the common and similar parts between the various embodiments. For the devices disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the description is relatively simple, and the relevant parts can be referred to the description of the methods.
[0179] It should also be noted that, in the embodiments of the present application, relational terms such as first and second, etc. are merely used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply the existence of any such actual relationship or order between these entities or operations. Moreover, the terms "comprise", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the statement "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device comprising the elements.
[0180] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined in the embodiments of the present application may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown in the embodiments of the present application, but rather will conform to the widest scope consistent with the principles and novel features disclosed in the embodiments of the present application.
Claims
1. A non-intrusive load decomposition method for energy scenarios, characterized in that: include: Step S1: Obtain aggregated load time series data and perform normalization processing; Step S2: The standardized aggregate load time series data is input into the feature extraction module, and is sequentially processed through high-dimensional vector embedding, position encoding, multi-head self-attention mechanism processing, and nonlinear transformation to obtain a high-dimensional feature vector after nonlinear transformation; Step S3: Input the high-dimensional feature vector after the nonlinear transformation into the load decomposition prediction module, perform maximum pooling dimensionality reduction processing in sequence to obtain the reduced-dimensional features, and use the reduced-dimensional features to train a random decision forest model. Then, use the trained random decision forest model to perform prediction and output the operating load prediction value of each device. Step S4: Calculate the error between the predicted value and the actual value of the operating load of the individual device, and adjust the hyperparameters of the feature extraction module and the number and depth of trees of the random decision forest model according to the error adaptive feedback; The step S4 comprises: Calculate the root mean square error between the predicted and actual operating load values of individual equipment; Adjusting at least one of the number of Transformer layers, the number of attention heads, and the learning rate of the feature extraction module based on the root mean square error adaptive feedback; and simultaneously optimizing the number of trees and the maximum depth of the random decision forest model; When the feedback mechanism detects that the error exceeds the threshold: Launch a graph neural network (GNN) to analyze device spatial correlation and build a device association graph to generate a node relationship matrix. ; According to the node relationship matrix Reconstruct the weight distribution of the multi-head self-attention layer: Among them, Q is the query matrix, K is the key matrix, and V is the value matrix. is the dimension of the key vector, and ⊙ represents the Hadamard product.
2. The non-invasive load decomposition method for energy scenarios according to claim 1, characterized in that: The step S1: obtaining aggregated load time series data and performing normalization processing includes: Step S101: The input layer collects aggregated load data in the form of time series , To aggregate load data, It's in time The load value, M is the length of the time series; Step S102: The normalization layer normalizes the aggregated load data to obtain the normalized time series data. ; Where, and are the mean and standard deviation of the aggregated load data, respectively.
3. The non-invasive load decomposition method for energy scenarios according to claim 2, characterized in that: in, The step S2 comprises: Step S201: The embedding layer embeds the standardized aggregated load time series data Convert to high-dimensional vector embedding representation , is the field of real numbers, is the embedding dimension; Step S202: The position encoding layer adds position encoding to the high-dimensional vector embedding representation E , and get the embedded representation E+P after adding position encoding: Among them, the position encoding uses the sine-cosine function. is the time step In position Sinusoidal position encoding, is the time step In position The cosine position encoding, is the index of the time step, The dimension index encoding the position; Step S203: The multi-head self-attention layer performs a multi-head self-attention mechanism on the embedded representation after adding the position encoding, calculates the self-attention, and obtains the feature representation after the multi-head self-attention mechanism processing ; Step S204: The feedforward neural network layer uses the ReLU activation function to perform nonlinear transformation on the feature representation A processed by the multi-head self-attention mechanism to obtain a high-dimensional feature vector after nonlinear transformation ; Where, is the feature vector after nonlinear transformation, ReLU is the activation function applied to the output of the first layer, is the output of the self-attention layer, is the weight matrix of the first layer, is the bias vector of the first layer, is the weight matrix of the second layer, is the bias vector of the second layer.
4. The non-invasive load decomposition method for energy scenarios according to claim 3, characterized in that: The step S3 comprises: Step S301: The maximum pooling layer of the load decomposition prediction module performs maximum pooling dimensionality reduction processing on the high-dimensional feature vector after the nonlinear transformation, including normalization and dimensionality reduction processing, to obtain a feature vector after dimensionality reduction; Step S302: using the feature vector after dimensionality reduction to train a random decision forest model to obtain a trained random decision forest model; Step S303: Using the trained random decision forest model, the prediction results of multiple decision trees are integrated to output the operating load prediction value of each device.
5. The non-invasive load decomposition method for energy scenarios according to claim 4, characterized in that: In step S302, each decision tree is trained using the feature vector after dimensionality reduction, and each decision tree makes predictions independently; Where, is the number of decision trees, is the prediction function of the j-th decision tree, is the feature vector after dimensionality reduction; In step S303, the prediction results of each decision tree, i.e., the load prediction value, are integrated by majority voting or weighted averaging: Where, The operating load forecast value of a single device is output for forecasting. is the number of decision trees, is the prediction function of the j-th decision tree, The processed feature vector.
6. The non-invasive load decomposition method for energy scenarios according to claim 1, characterized in that: The startup graph neural network (GNN) analyzes device association and builds a device association graph to generate a node relationship matrix ,include: Collect the real load time series of all equipment historical operation ; Run real load time series based on all equipment history as described , calculate the Pearson correlation coefficient between device i' and device j' ; Construct an initial undirected graph structure G=(V,E), where each device i' is a graph node , edge weight ; Optimizing edge weights via graph neural networks: , ,in, is the original edge weight between devices; Learning structure for differentiable edge weights; is the device node feature vector; Original edge weights between devices Nonlinearly normalize the off-diagonal elements of : ( ), , thus Map to the interval [0,1]; Where α is a trainable scaling factor, is the trainable edge weight parameter; And, only when the load fluctuation of equipment i' or equipment j' exceeds the preset variance When , recalculate the Pearson correlation coefficient ; Graph neural networks only satisfy Optimize the edges of is the thinning threshold.
7. The non-invasive load decomposition method for energy scenarios according to claim 1, characterized in that: In the random decision forest model, the maximum depth of a single decision tree does not exceed 10, the minimum number of leaf node samples is 2, and the integration strategy adopts a weighted average method to fuse the prediction results of each tree.
8. A non-invasive load decomposition device for energy scenarios, used to implement the non-invasive load decomposition method for energy scenarios according to any one of claims 1 to 7, characterized in that: include: A data input module, a feature extraction module, a load decomposition prediction module and a dynamic feedback module connected in sequence; The data input module includes an input layer and a normalization layer for collecting and normalizing aggregated load time series data; The feature extraction module includes an embedding layer, a position encoding layer, and multiple Transformer blocks, which are used to process the standardized aggregated load time series data to generate a high-dimensional feature vector after nonlinear transformation; wherein the Transformer block includes a multi-head self-attention layer and a feedforward neural network layer; The load decomposition prediction module includes a maximum pooling layer and a random decision forest model, which is used to perform maximum pooling dimensionality reduction processing on the high-dimensional feature vector after nonlinear transformation, and use the reduced dimensionality features to train and predict the random decision forest model, and output the operating load prediction value of each device; The dynamic feedback module includes an error calculation unit and a parameter adjustment unit. The error calculation unit predicts the error between the predicted value and the true value; the parameter adjustment unit dynamically optimizes the parameters of the feature extraction module and the load decomposition prediction module based on the error to achieve model adaptive feedback adjustment; The feedforward neural network layer includes two fully connected layers and a ReLU activation function; the random decision forest includes multiple decision trees, which are trained by random subsets of features and random subsets of data.
Citation Information
Patent Citations
Graph neutral networks with attention
CN112119412A
Transform and RF fused power load prediction method
CN119448265A