A method for decomposing electrical power and a storage medium
By constructing a two-layer sliding window neural network model and a self-attention mechanism, and combining frequency domain features and power consumption scenario information, the problems of low electrical appliance decomposition accuracy and poor scenario adaptability in NILM technology are solved, achieving high-precision electrical appliance power decomposition and stable prediction.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SHANGHAI ENEINTEL TECH CO LTD
- Filing Date
- 2026-04-24
- Publication Date
- 2026-06-30
AI Technical Summary
Existing NILM technology struggles to capture long-term time-series dependencies in electrical appliance operation, loses detailed features of appliance power start-up and shutdown and fluctuations over short periods, and the power characteristics are disconnected from the power consumption scenario, resulting in low appliance decomposition accuracy and insufficient generalization ability.
A neural network model with a two-layer sliding window is constructed. Combining frequency domain features and power consumption scenario information, the power of electrical appliances is accurately decomposed through a self-attention mechanism and dynamic fusion weights.
It significantly improves the accuracy and stability of electrical appliance power decomposition, enhances the model's adaptability to different regions, seasons, and time periods, reduces the RMSE of electrical appliance power prediction by 10%-20%, and achieves an accuracy of over 80% in identifying heterogeneous datasets.
Smart Images

Figure CN122087437B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of smart grid technology, specifically to an electrical power decomposition method and storage medium. Background Technology
[0002] With the increasing popularity of smart homes and the accelerated construction of smart grids, the demand for refined and low-cost home energy management is becoming increasingly urgent. Non-Intrusive Load Monitoring (NILM) technology can identify the operating status of appliances and decompose their power consumption using only the power data collected from the main household meter. This avoids the high cost and complex construction problems of traditional invasive solutions that require installing independent sensors for each appliance, making it a core technology direction for home energy management.
[0003] The current energy decomposition methods in NILM technology have the following key problems:
[0004] Existing models often use short time windows as input, making it difficult to capture the long-term temporal dependencies of appliance operation. On the other hand, a single long window is prone to losing detailed features of appliance power start-up, shutdown, and fluctuations within a short period. Meanwhile, in traditional hierarchical coding, features from each sub-window are fused equally and single-dimensional weights are used for judgment, which makes key power features easily diluted by stable features, resulting in low effectiveness of long-term feature fusion.
[0005] Existing models decompose electricity consumption by predicting the power ratio of each appliance. However, due to the influence of the "ratio" attribute, the prediction results are prone to severe fluctuations. At the same time, they only use simple physical constraints such as non-negative power and total power matching, without flexible thresholds and hard correction mechanisms. This makes it impossible to avoid abnormal prediction problems that do not conform to actual operating laws, such as appliances exceeding their rated power limits or power fluctuations. As a result, the decomposition accuracy of high-power appliances is low.
[0006] Existing models only extract basic time-domain and frequency-domain features of current or power, without deep integration with electricity consumption scenarios and without a scenario-aware pre-process, resulting in a disconnect between power characteristics and actual electricity consumption scenarios. This leads to weak adaptability to electricity consumption patterns in different regions, seasons, and time periods in China, and poor heterogeneous data transferability.
[0007] Existing datasets are mostly collected from overseas (such as REDD and UK-DALE), which differ significantly from the categories, power characteristics, and usage patterns of household appliances in China. Models trained using such data and single features lack generalization ability in domestic scenarios and are difficult to meet the needs of practical applications.
[0008] In summary, there is an urgent need for a method for decomposing the power of home appliances that can simultaneously capture long-term dependencies and preserve short-term details, achieve accurate fusion of key features, improve physical constraint logic, and enhance scene adaptability. Summary of the Invention
[0009] This application provides an electrical power decomposition method and storage medium to solve the problems of insufficient input window time span, large power prediction fluctuation, high decomposition error of high-power electrical appliances, and weak generalization ability caused by the disconnect between features and power consumption scenarios in existing power decomposition models.
[0010] This application provides a method for decomposing electrical power, which specifically includes steps for acquiring raw data, data preprocessing, model building, model training, and acquiring decomposition results.
[0011] The raw data acquisition step is used to collect the raw current signal and total active power data of the user's main electricity meter, as well as the actual power data of the target appliance, and to obtain the electricity consumption scenario information corresponding to the collection time. The data preprocessing step is used to obtain the frequency domain feature vector of the raw current signal and the scenario feature vector of the electricity consumption scenario information, and to normalize the total active power data and the actual power data. The model construction step is used to construct a neural network model including a double-layer sliding window, wherein the double-layer sliding window includes a second preset duration input window, and the input window includes two or more first preset durations. The sub-windows are continuous and do not overlap. The model training step involves inputting the original current signal, normalized total active power data, normalized real power data, frequency domain feature vector, and scene feature vector as training data into the neural network model to train the neural network model. The decomposition result acquisition step involves inputting the original current signal and total active power data of the user's main electricity meter at any time, as well as the corresponding electricity consumption scenario information at that time, into the trained neural network model to output the power decomposition result of the target appliance.
[0012] Furthermore, the data preprocessing steps include a frequency domain feature vector acquisition step, a one-hot encoding step, and a normalization step.
[0013] The frequency domain feature vector acquisition step involves performing a Fast Fourier Transform on the original current signal using a sliding window of the first preset duration to extract the frequency domain feature vectors of odd harmonics in the obtained frequency domain harmonic sequence; the one-hot encoding step involves performing one-hot encoding on the electricity consumption scenario information to obtain scenario feature vectors; the normalization step is based on a preset global maximum power value to normalize the total active power data and the actual power data, compressing the power values of both the total active power data and the actual power data to the [0, 1] interval, using the formula:
[0014]
[0015] in, This represents the power value of the normalized total active power data or the power value of the normalized true power data. This represents the power value of the total active power data or the power value of the actual power data. This represents the preset global maximum power value.
[0016] Furthermore, the model training steps include a data partitioning step, a time-domain waveform acquisition step, a frequency-domain feature distribution acquisition step, a time-series feature vector acquisition step, and a fusion feature acquisition step.
[0017] The data partitioning step divides the training data into at least one data unit of a second preset duration through the input window, and further divides the data unit into two or more sub-data units of a first preset duration through the sub-window; the time-domain waveform acquisition step extracts the time-domain waveform features of the original current signal in the sub-data unit through the high-frequency branch included in the neural network model, the high-frequency branch consisting of 3 layers of 1D convolution, BN layer and ReLU layer; the frequency-domain feature distribution acquisition step extracts the frequency-domain feature distribution of the frequency-domain feature vector in the sub-data unit through the low-frequency branch included in the neural network model, the low-frequency branch consisting of 2 layers of 1D convolution, BN layer and ReLU layer; the time-series feature vector acquisition step concatenates the time-domain waveform features and the frequency-domain feature distribution, and captures the time-series dependency relationship between the concatenated time-domain waveform features and the frequency-domain feature distribution through the BiGRU layer included in the neural network model to obtain the time-series feature vector; the fusion feature acquisition step concatenates the time-series feature vector with the scene feature vector of the sub-data unit to obtain the fusion feature of the sub-window.
[0018] Furthermore, the model training steps also include independent encoding steps, comprehensive scoring acquisition steps, and global fusion feature acquisition steps.
[0019] The independent encoding step utilizes a self-attention mechanism, employing the Transformer segment encoder within the neural network model to independently encode the fusion features of each sub-window, resulting in sub-window encoded features. The comprehensive score acquisition step obtains the comprehensive importance score of the sub-window based on the normalized total active power data. The global fusion feature acquisition step, based on the obtained comprehensive importance score, uses temperature parameters... The Softmax function is used to perform a weighted summation of the sub-window encoded features using the calculated dynamic fusion weights to obtain the global fusion features.
[0020] Furthermore, the comprehensive score acquisition step includes a volatility calculation step, a maximum rate of change calculation step, an edge energy ratio calculation step, and a score calculation step.
[0021] The volatility calculation step is used to calculate the variance of the normalized total active power data as the volatility of the total active power data, and the formula is as follows:
[0022]
[0023] in, This represents the volatility of the i-th sub-window. The greater the volatility, the higher the probability of electrical appliances starting or stopping or state switching occurring within the sub-window. Indicates variance; This represents the normalized total active power value within the sub-window at sampling time t.
[0024] The maximum rate of change calculation step is used to calculate the maximum first-order absolute value of the total active power data within the sub-window as the maximum rate of change of the total active power data. The formula is as follows:
[0025]
[0026] in, This represents the maximum rate of change of the i-th sub-window. The larger the maximum rate of change, the more critical the sub-window is. Represents the maximum value function; This represents the normalized total active power value within the sub-window at sampling time t-1.
[0027] The edge energy ratio calculation step is used to calculate the ratio of the average power of the starting and ending edges of the sub-window to the average power of the entire sub-window, and the formula is as follows:
[0028]
[0029] in, This represents the edge energy ratio of the i-th sub-window. This represents the normalized total active power value at the start and end edges of the sub-window. This represents the normalized total active power value within the entire sub-window. This represents an aggregate function.
[0030] The scoring calculation step involves normalizing the obtained volatility, maximum rate of change, and edge energy ratio, and then obtaining the comprehensive importance score of the sub-window through weighted summation. The formula is as follows:
[0031]
[0032] in, This represents the overall importance score of the i-th sub-window. This indicates the preset volatility weight. This represents the preset maximum rate of change weight. This represents the preset edge energy ratio weight. This represents the normalized volatility of the i-th sub-window. This represents the maximum normalized rate of change of the i-th sub-window. This represents the normalized edge energy ratio of the i-th sub-window.
[0033] Furthermore, the global fusion feature acquisition step includes a dynamic fusion weight calculation step and a weighted summation step.
[0034] The dynamic fusion weight calculation step is based on the obtained comprehensive importance score, using a temperature parameter. The Softmax function calculates the dynamic fusion weights and assigns them to the child windows. The calculation formula is as follows:
[0035]
[0036] in, This represents the dynamic fusion weight of the i-th sub-window. This represents the overall importance score of the i-th sub-window. This represents the overall importance score of the j-th sub-window. Indicates temperature parameter, Let N represent an exponential function, and let N represent the number of sub-windows in the input window.
[0037] The weighted summation step, based on the obtained dynamic fusion weights, performs a weighted summation of the sub-window encoded features to obtain the global fusion feature, the formula of which is:
[0038]
[0039] in, Indicates global fusion features, This represents the encoding feature of the i-th sub-window.
[0040] Furthermore, the model training steps also include a power prediction calculation step, an inverse normalization step, an electrical physics constraint step, and a model optimization step.
[0041] The power prediction calculation step is based on the obtained global fusion features. A power output head maps the global fusion features to the normalized power prediction value of the target appliance through linear transformation and the Sigmoid activation function. The formula is as follows:
[0042]
[0043] in, This represents the normalized power prediction value of the k-th type of target electrical appliance. This represents the weight matrix of the power output head. Indicates global fusion features, This represents the bias vector of the power output head.
[0044] The inverse normalization step involves inverse normalizing the normalized power prediction value to obtain the restored true power value, and the formula is as follows:
[0045]
[0046] in, This represents the true power value restored for the k-th type of target electrical appliance. This represents the preset global maximum power value.
[0047] The power physical constraint step involves applying a four-layer progressive power physical constraint to the true power restoration value, thereby correcting the true power restoration value and obtaining a loss correction value.
[0048] The model optimization step involves calculating the differential loss weight based on the fluctuation of the total active power data within the sub-window, calculating the RMSE loss of the sub-window based on the obtained loss correction value, updating the model parameters using the training loss calculated by the differential loss weight and the RMSE loss, and obtaining the trained neural network model.
[0049] Furthermore, the electrical physical constraint steps include a first constraint step, a second constraint step, a third constraint step, and a fourth constraint step.
[0050] The first constraint step involves pruning all negative values from the true power restoration value to obtain a first predicted value, the formula of which is:
[0051]
[0052] in, This represents the first predicted value for the k-th type of target electrical appliance. This represents the true power value restored for the k-th type of target electrical appliance. Represents the maximum value function;
[0053] The second constraint step calculates the predicted total power value of the target appliance based on the obtained first predicted value. When the predicted total power value is greater than the actual power data, the first predicted value is compressed proportionally. Within the range, a second predicted value is obtained; when the predicted total power value is less than the power value of the actual power data, based on the operating state confidence of the target appliance, the first predicted value of the target appliance operating with high confidence is compensated and calibrated to obtain the second predicted value; the formula for calculating the predicted total power value is as follows:
[0054]
[0055] in, This represents the predicted total power value, where M represents the number of target appliance categories. The power value represents the actual power data. This indicates the preset deviation tolerance threshold.
[0056] The third constraint step involves progressively tailoring the second predicted value of each target electrical appliance based on its physical characteristics, ensuring that the second predicted value falls within a preset power range. The formula is:
[0057]
[0058] in, This represents the third predicted value for the target appliance of category k. This represents the second predicted value for the k-th type of target appliance. This represents the minimum value function.
[0059] The fourth constraint step is used to preset a maximum power change rate. The difference between the current power restoration value and the third predicted value at the previous moment is determined by the maximum power change rate. The formula for the size relationship between them is:
[0060]
[0061] in, This represents the fourth predicted value for the k-th type of target electrical appliance, i.e., the loss correction value. This represents the true power value of the k-th type of target electrical appliance at the current moment. This represents the third predicted value of the k-th type of target electrical appliance at the previous time step.
[0062] Furthermore, the model optimization steps include a differential loss weight calculation step, an RMSE loss calculation step, a weighted loss calculation step, and a training loss calculation step.
[0063] The differential loss weight calculation step is based on the fluctuation of the total active power data within the sub-window to calculate the differential loss weight, and the formula is as follows:
[0064]
[0065] in, This represents the differential loss weight for the i-th sub-window. This represents the fluctuation of the total active power data within the i-th sub-window. This represents the fluctuation of the total active power data within the j-th sub-window. Let N represent an exponential function, and let N represent the number of sub-windows in the input window.
[0066] The RMSE loss calculation step is based on the obtained loss correction value, calculating the point-by-point root mean square error of all time points within the sub-window as the RMSE loss, and the formula is as follows:
[0067]
[0068] in, Let T represent the RMSE loss of the i-th sub-window, and let T represent the number of time points within a sub-window. This represents the loss correction value of the k-th type of target electrical appliance at time point t in sub-window i. This represents the actual power value of the target appliance of type k at time point t in sub-window i.
[0069] The weighted loss calculation step involves multiplying the RMSE loss by the differential loss weight of the sub-window to obtain the weighted loss of the sub-window, and the formula is as follows:
[0070]
[0071] in, This represents the weighted loss of the i-th sub-window.
[0072] The training loss calculation step involves calculating the weighted loss of N sub-windows and taking the average of the results as the training loss. The formula is as follows:
[0073]
[0074] in, This indicates training loss.
[0075] This application also provides a storage medium storing computer-readable instructions that, when read by at least one processor, cause at least one processor to execute the electrical power decomposition method.
[0076] This application provides an electrical appliance power decomposition method and storage medium. By constructing a two-layer sliding window input system consisting of fine-grained sub-windows and long-term input windows, and combining it with a multi-dimensional dynamic attention weighted fusion mechanism based on bus signals, it achieves precise coupling between short-term detailed features and long-term dependencies, effectively solving the problem of key features being easily diluted in traditional hierarchical coding. This allows the model to adaptively focus on key windows containing changes in the appliance's state. Through four-layer progressive power physics constraints and weighted hierarchical loss co-optimization, it fundamentally avoids abnormal prediction problems such as negative power, rated power exceeding limits, and power mutations. This significantly improves the stability and accuracy of power prediction, reducing the RMSE of high-power appliance power prediction by 10%-20% compared to existing models. By cross-coding the original current signal, frequency domain feature vector, and electricity consumption scenario information such as region, season, time period, and household load level, the model deeply correlates power characteristics with electricity consumption scenarios, effectively improving the model's adaptability and generalization ability to different regions, seasons, time periods, and load levels of household electricity consumption scenarios in China. The overall identification accuracy on heterogeneous datasets exceeds 80%, and the accuracy for Class A devices exceeds 85%, providing accurate data support for household energy management and electricity demand response. Attached Figure Description
[0077] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0078] Figure 1 This is a flowchart of the electrical power decomposition method described in the embodiments of this application;
[0079] Figure 2 This is a flowchart of the data preprocessing steps described in the embodiments of this application;
[0080] Figure 3 This is the process of the model training steps described in the embodiments of this application. Figure 1 ;
[0081] Figure 4 This is the process of the model training steps described in the embodiments of this application. Figure 2 ;
[0082] Figure 5 This is a flowchart of the comprehensive score acquisition steps described in the embodiments of this application;
[0083] Figure 6 This is a flowchart of the global fusion feature acquisition steps described in the embodiments of this application;
[0084] Figure 7This is the process of the model training steps described in the embodiments of this application. Figure 3 ;
[0085] Figure 8 This is a flowchart of the power physical constraint steps described in the embodiments of this application;
[0086] Figure 9 This is a flowchart of the model optimization steps described in the embodiments of this application;
[0087] Figure 10 This is a schematic diagram of the storage medium described in the embodiments of this application;
[0088] Figure 11 This is a diagram showing the power decomposition result of the target electrical appliance output by the electrical power decomposition method described in the embodiments of this application. Detailed Implementation
[0089] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application. This application provides an electrical power decomposition method, specifically including a raw data acquisition step, a data preprocessing step, a model building step, a model training step, and a decomposition result acquisition step.
[0090] like Figure 1 As shown, this application provides an electrical power decomposition method, which specifically includes step S1) raw data acquisition step, step S2) data preprocessing step, step S3) model construction step, step S4) model training step and step S5) decomposition result acquisition step.
[0091] Step S1) Raw data acquisition step: Collect the raw current signal and total active power data of the user's main electricity meter and the actual power data of the target appliance, and obtain the electricity consumption scenario information corresponding to the time of collection.
[0092] In this application, the raw current signal and total active power data of the household's main electricity meter are continuously collected at a high sampling rate of 6400Hz; the electricity usage scenario information corresponding to the collection time is recorded simultaneously, including region, season, time period, household load level, etc., for subsequent scenario feature encoding. At the same time, the actual power data of each appliance (14 categories of target appliances decomposed into fixed frequency air conditioners, variable frequency air conditioners, water heaters, electric kettles, rice cookers, electric ovens, electric heaters, induction cookers, microwave ovens, hair dryers, refrigerators, drum washing machines, turbine washing machines, and electric bicycles) are collected as labels for model training.
[0093] Step S2) Data preprocessing step: Obtain the frequency domain feature vector of the original current signal and the scene feature vector of the power consumption scenario information, and normalize the total active power data and the actual power data.
[0094] like Figure 2 As shown, step S2) data preprocessing includes step S21) frequency domain feature vector acquisition, step S22) one-hot coding, and step S23) normalization.
[0095] Step S21) Frequency domain feature vector acquisition step: Perform fast Fourier transform on the original current signal with the first preset time sliding window to extract the frequency domain feature vectors of odd harmonics (1st, 3rd, 5th, 7th, 9th, 11th, 13th) in the obtained frequency domain harmonic sequence. The frequency domain feature vectors include amplitude, phase, harmonic proportion and harmonic distortion rate.
[0096] Step S22) One-hot encoding step: Perform one-hot encoding on the electricity consumption scenario information to obtain the scenario feature vector.
[0097] In this application, one-hot encoding is performed on seven regions—Northeast, North China, Northwest, Central China, East China, South China, and Southwest—to generate a 7-dimensional binary vector. One-hot encoding is also performed on four seasons—spring, summer, autumn, and winter—to generate a 4-dimensional binary vector. One-hot encoding is performed on three time periods—morning peak (06:00-09:00), evening peak (17:00-20:00), and off-peak (other times)—to generate a 3-dimensional binary vector. Based on monthly household electricity consumption, the load level is divided into three levels: low, medium, and high, and numerically mapped to 0, 1, and 2 respectively, forming a 1-dimensional numerical vector. All encoded scene features are concatenated to form a complete scene feature vector (dimensions: 7+4+3+1=15).
[0098] Step S23) Normalization step: Based on a preset global maximum power value, normalize the total active power data and the actual power data, compressing the power values of both the total active power data and the actual power data into the [0, 1] interval. The formula is as follows:
[0099]
[0100] in, This represents the power value of the normalized total active power data or the power value of the normalized true power data. This represents the power value of the total active power data or the power value of the actual power data. This represents the preset global maximum power value.
[0101] In this application, the formula for step S23) normalization represents the normalization process and is a general formula. When normalizing the total active power data, This represents the power value of the normalized total active power data. This represents the power value of the total active power data; when normalizing the actual power data... This represents the power value of the normalized true power data. The power value represents the actual power data.
[0102] The technical effect of the data preprocessing step is that by performing a fast Fourier transform on the original current signal and extracting the frequency domain feature vector of odd harmonics, it can effectively capture the differentiated features of different electrical appliances in harmonic components, providing rich frequency domain discrimination information for subsequent models. By constructing scene feature vectors through one-hot encoding of electricity consumption scenario information, multi-dimensional environmental factors such as region, season, time period, and household load level are transformed into structured inputs that the model can perceive, enabling the pre-association of power characteristics with electricity consumption scenarios, significantly improving the model's adaptability to different regions, seasons, and time periods of electricity consumption patterns. At the same time, based on the preset global maximum power value, the total active power data and the actual power data are normalized, and all power values are uniformly compressed to the [0,1] interval, eliminating the numerical differences between electrical appliances of different power levels, ensuring the stability and convergence efficiency of the model training process, and providing a dimensionally unified and feature-rich input data foundation for subsequent double-layer sliding window construction and hierarchical encoding.
[0103] Step S3) Model building step: Construct a neural network model including a double-layer sliding window. The double-layer sliding window includes an input window of a second preset duration. The input window includes two or more sub-windows of a first preset duration. The second preset duration is longer than the first preset duration. The sub-windows are continuous and do not overlap.
[0104] In this application, the second preset duration input window is a long time series window. For example, a 5-minute long time series input window is divided into 5 consecutive, non-overlapping 1-minute fine-grained sub-windows. This structure ensures that the model can observe the details of short-term power fluctuations and capture long-term time series dependencies within 5 minutes.
[0105] The technical effect lies in the fact that by constructing a neural network model containing a double-layer sliding window, using a second preset duration as a long-term input window, and splitting the input window into two or more continuous and non-overlapping fine-grained sub-windows of a first preset duration, it preserves the fine information of the start-up and shutdown of electrical appliances and instantaneous fluctuations in a short period of time for subsequent feature extraction, and provides a unified input framework for capturing the periodic operation and continuous working rules of electrical appliances in a long-term time series. It realizes the structured organization of multi-scale time series information and lays the architectural foundation for the model to take into account both short-term details and long-term dependencies.
[0106] Step S4) Model training step: Input the original current signal, normalized total active power data, normalized real power data, frequency domain feature vector, and scene feature vector as training data into the neural network model to train the neural network model.
[0107] like Figure 3 As shown, step S4) model training includes step S401) data partitioning, step S402) time-domain waveform acquisition, step S403) frequency-domain feature distribution acquisition, step S404) time-series feature vector acquisition, and step S405) fusion feature acquisition.
[0108] Step S401) Data partitioning step: The training data is divided into at least one data unit of a second preset duration through the input window, and the data unit is further divided into two or more sub-data units of a first preset duration through the sub-window.
[0109] The technical effect is that the training data is divided into at least one data unit of a second preset duration through the input window, and each data unit is further divided into two or more sub-data units of a first preset duration using the sub-window. This achieves precise alignment between the training data and the double-layer sliding window input structure, enabling the model to simultaneously obtain local temporal information within fine-grained sub-windows and global dependencies within long temporal windows during training. This provides a clear and scale-uniform data organization foundation for subsequent independent sub-window encoding, dynamic attention weighted fusion, and hierarchical loss calculation, ensuring a high degree of matching between the model input and the network architecture.
[0110] Step S402) Time-domain waveform acquisition step: Extract the time-domain waveform features of the original current signal in the sub-data unit through the high-frequency branch included in the neural network model. The high-frequency branch consists of 3 layers of 1D convolution, BN layer and ReLU layer.
[0111] Step S403) Temporal feature vector acquisition step: extract the frequency domain feature distribution of the frequency domain feature vector in the sub-data unit through the low-frequency branch included in the neural network model. The low-frequency branch consists of 2 layers of 1D convolution, BN layer and ReLU layer.
[0112] Step S404) The feature fusion acquisition step involves concatenating the time-domain waveform features with the frequency-domain feature distribution, capturing the temporal dependency between the concatenated time-domain waveform features and the frequency-domain feature distribution through the BiGRU layer included in the neural network model, and obtaining the temporal feature vector.
[0113] Specifically, the time-domain waveform features and the frequency-domain feature distribution are concatenated by an independent concatenate layer (which does not rely on modules with trainable parameters such as convolutional neural networks or recurrent neural networks) to form a local power feature vector. The local power feature vector is then input into the BiGRU layer to capture the temporal dependency between the concatenated time-domain waveform features and the frequency-domain feature distribution to obtain a temporal feature vector.
[0114] Step S405) The fusion feature acquisition step involves concatenating the temporal feature vector with the scene feature vector of the sub-data unit to obtain the fusion feature of the sub-window.
[0115] Specifically, the temporal feature vector of the independent Concatenate layer is concatenated with the scene feature vector of the sub-data unit to form the fused feature of the sub-window.
[0116] For steps S401 to S405, the technical effect is as follows: Through three layers of 1D convolution, batch normalization, and ReLU activation layers in the high-frequency branch, deep time-domain waveform features are extracted from the original current signal, fully preserving the start-stop transients and waveform details under high-frequency sampling; through two layers of 1D convolution, batch normalization, and ReLU activation layers in the low-frequency branch, frequency-domain distribution features are extracted from the frequency-domain feature vector, accurately capturing the differences in harmonic components among different electrical appliances; after concatenating the time-domain waveform features with the frequency-domain feature distribution, a bidirectional gated recurrent unit is used to capture their local temporal dependencies, generating a temporal feature vector rich in dynamic change patterns within the sub-window; finally, the temporal feature vector is concatenated with the scene feature vector to obtain the fusion features of the sub-window, enabling scene information to participate in all subsequent coding steps. This achieves deep fusion of power features and the power consumption environment, providing a feature-complete and semantically rich input foundation for the model to accurately perceive the operating status of electrical appliances and adapt to different regional and seasonal power consumption patterns.
[0117] like Figure 4 As shown, step S4) model training step also includes step S406) independent encoding step, step S407) comprehensive score acquisition step and step S408) global fusion feature acquisition step.
[0118] Step S406) Independent encoding step: Using the self-attention mechanism, the fusion features of each sub-window are independently encoded through the Transformer segment encoder included in the neural network model to obtain the sub-window encoded features.
[0119] Step S407) Comprehensive score acquisition step: Based on the normalized total active power data, obtain the comprehensive importance score of the sub-window.
[0120] like Figure 5 As shown, step S407) the comprehensive score acquisition step includes step S413) the volatility calculation step, step S414) the maximum change rate calculation step, step S415) the edge energy ratio calculation step and step S416) the score calculation step.
[0121] Step S413) Fluctuation Calculation Step: Calculate the variance of the normalized total active power data as the fluctuation of the total active power data. The formula is as follows:
[0122]
[0123] in, This represents the volatility of the i-th sub-window. The greater the volatility, the higher the probability of electrical appliances starting or stopping or state switching occurring within the sub-window. Indicates variance; This represents the normalized total active power value within the sub-window at sampling time t.
[0124] Step S414) Maximum rate of change calculation step: Calculate the maximum first-order absolute value of the total active power data within the sub-window as the maximum rate of change of the total active power data. The formula is as follows:
[0125]
[0126] in, This represents the maximum rate of change of the i-th sub-window. The larger the maximum rate of change, the more critical the sub-window is. Represents the maximum value function; This represents the normalized total active power value within the sub-window at sampling time t-1.
[0127] Step S415) Edge Energy Ratio Calculation Step: Calculate the ratio of the average power of the starting and ending edges of the sub-window to the average power of the entire sub-window. The formula is as follows:
[0128]
[0129] in, This represents the edge energy ratio of the i-th sub-window. This represents the normalized total active power value at the start and end edges of the sub-window. This represents the normalized total active power value within the entire sub-window. This represents an aggregate function.
[0130] Step S416) Scoring calculation step: Normalize the obtained volatility, maximum rate of change, and edge energy ratio, and obtain the comprehensive importance score of the sub-window by weighted summation. The formula is as follows:
[0131]
[0132] in, This represents the overall importance score of the i-th sub-window. This indicates the preset volatility weight. This represents the preset maximum rate of change weight. This represents the preset edge energy ratio weight. This represents the normalized volatility of the i-th sub-window. This represents the maximum normalized rate of change of the i-th sub-window. This represents the normalized edge energy ratio of the i-th sub-window.
[0133] For steps S413 to S416, the technical effect is as follows: by calculating the variance of the normalized total active power data as the volatility, the severity of power changes within the sub-window is accurately quantified, effectively identifying key periods for appliance start-up, shutdown, or state switching; by calculating the maximum absolute value of the first-order difference of the total active power data within the sub-window as the maximum rate of change, the power jump characteristics at the moment of appliance state switching are keenly captured; by calculating the ratio of the average power at the start and end edges of the sub-window to the average power of the entire window as the edge energy ratio, the occurrence of appliance state changes near the window boundary is accurately determined; and after normalizing the volatility, maximum rate of change, and edge energy ratio, a comprehensive importance score for each sub-window is obtained by weighted summation using learnable weights. This mechanism is entirely based on bus observable signals and does not rely on prior information from the distributor. It comprehensively quantifies and evaluates the criticality of the sub-window from three dimensions: volatility amplitude, rate of change, and boundary events, providing an objective and learnable basis for the subsequent dynamic attention weight allocation. This allows the model to adaptively focus on sub-windows containing key events, effectively improving the targeting and effectiveness of feature fusion.
[0134] Step S408) Global fusion feature acquisition step: Based on the obtained comprehensive importance score, through temperature parameter... The Softmax function is used to perform a weighted summation of the sub-window encoded features using the calculated dynamic fusion weights to obtain the global fusion features.
[0135] For steps S406 to S408, the technical effect lies in the independent encoding of the fusion features of each sub-window through the Transformer segment encoder. The self-attention mechanism fully mines the deep feature patterns within each fine-grained sub-window, completely preserving detailed information about key events such as appliance start-up and shutdown, and power fluctuations within a short period. Based on the normalized total active power data, the comprehensive importance score of each sub-window is calculated, achieving an objective quantification of the criticality of the sub-window. Furthermore, a dynamic fusion weight is generated using a Softmax function with a temperature parameter, and the encoded features of each sub-window are adaptively weighted and summed to obtain the global fusion features. This mechanism enables the model to automatically focus on key windows containing changes in appliance state, while preserving long-term continuous information through low-weight windows. It effectively solves the problem of equal fusion of sub-windows and dilution of key features by stable features in traditional hierarchical encoding, achieving precise coupling between short-term details and long-term correlations.
[0136] like Figure 6 As shown, step S408) global fusion feature acquisition step includes step S417) dynamic fusion weight calculation step and step S418) weighted summation step.
[0137] Step S417) Dynamic fusion weight calculation step, based on the obtained comprehensive importance score, using temperature parameter... The Softmax function calculates the dynamic fusion weights and assigns them to the child windows. The calculation formula is as follows:
[0138]
[0139] in, This represents the dynamic fusion weight of the i-th sub-window. This represents the overall importance score of the i-th sub-window. This represents the overall importance score of the j-th sub-window. Indicates temperature parameter, Let N represent an exponential function, and let N represent the number of sub-windows in the input window.
[0140] Step S418) Weighted summation step: Based on the obtained dynamic fusion weights, the sub-window encoded features are weighted and summed to obtain the global fusion features, the formula of which is:
[0141]
[0142] in, Indicates global fusion features, This represents the encoding feature of the i-th sub-window.
[0143] For steps S417-S418, the technical effect lies in the fact that, based on the comprehensive importance score of each sub-window, a dynamic fusion weight is calculated using a Softmax function with a temperature parameter. The temperature parameter can flexibly control the concentration of weight allocation, enabling the model to adaptively adjust the focus intensity according to the criticality of the sub-window. Then, the calculated dynamic fusion weights are used to weighted sum the encoded features of each sub-window to generate a global fusion feature. This mechanism is entirely based on bus observable signals and does not rely on prior information from the distributor. Through dynamic weights, it automatically amplifies the encoded features of key sub-windows and appropriately suppresses the encoded features of stable sub-windows. This allows the global fusion feature to retain long-term continuous information while accurately focusing on key periods containing changes in the state of the electrical appliances. This effectively solves the problem of equal fusion of sub-windows and dilution of key features by stable features in traditional hierarchical coding, providing a feature-focused and information-complete fusion representation for subsequent power prediction.
[0144] like Figure 7 As shown, step S4) model training step also includes step S409) power prediction value calculation step, step S410) inverse normalization step, step S411) power physics constraint step and step S412) model optimization step.
[0145] Step S409) Power prediction calculation step: Based on the obtained global fusion features, a power output head maps the global fusion features to the normalized power prediction value of the target appliance through linear transformation and the Sigmoid activation function. The formula is as follows:
[0146]
[0147] in, This represents the normalized power prediction value of the k-th type of target electrical appliance. This represents the weight matrix of the power output head. Indicates global fusion features, This represents the bias vector of the power output head.
[0148] Step S410) Inverse normalization step: The normalized power prediction value is inverse normalized to obtain the restored true power value, and the formula is as follows:
[0149]
[0150] in, This represents the true power value restored for the k-th type of target electrical appliance. This represents the preset global maximum power value.
[0151] Step S411) Electrical physical constraint step: Apply four-level progressive electrical physical constraints to the true power restoration value to correct the true power restoration value and obtain the loss correction value.
[0152] like Figure 8 As shown, step S411) the electrical physical constraint step includes step S419) the first constraint step, step S420) the second constraint step, step S421) the third constraint step and step S422) the fourth constraint step.
[0153] Step S419) First constraint step: Trim all negative values in the power restoration true value to obtain the first predicted value, the formula of which is:
[0154]
[0155] in, This represents the first predicted value for the k-th type of target electrical appliance. This represents the true power value restored for the k-th type of target electrical appliance. Represents the maximum value function;
[0156] Step S420) Second constraint step: Based on the obtained first predicted value, calculate the predicted total power value of the target appliance. When the predicted total power value is greater than the power value of the actual power data, compress the first predicted value proportionally. Within the range, a second predicted value is obtained; when the predicted total power value is less than the power value of the actual power data, based on the operating state confidence of the target appliance, the first predicted value of the target appliance operating with high confidence is compensated and calibrated to obtain the second predicted value; the formula for calculating the predicted total power value is as follows:
[0157]
[0158] in, This represents the predicted total power value, where M represents the number of target appliance categories. The power value represents the actual power data. This indicates the preset deviation tolerance threshold.
[0159] Step S421) Third constraint step: Based on the physical characteristics of each type of target electrical appliance, progressively trim the second predicted value of the target electrical appliance so that the second predicted value is within a preset power range. The formula is:
[0160]
[0161] in, This represents the third predicted value for the target appliance of category k. This represents the second predicted value for the k-th type of target appliance. This represents the minimum value function.
[0162] Step S422) Fourth constraint step: Preset a maximum power change rate. The difference between the current power restoration value and the third predicted value at the previous moment is determined by the maximum power change rate. The formula for the size relationship between them is:
[0163]
[0164] in, This represents the fourth predicted value for the k-th type of target electrical appliance, i.e., the loss correction value. This represents the true power value of the k-th type of target electrical appliance at the current moment. This represents the third predicted value of the k-th type of target electrical appliance at the previous time step.
[0165] For steps S419 to S422, the first constraint step prunes all negative values in the power restoration true value to obtain the first predicted value, eliminating physically impossible negative power anomalies from the source; the second constraint step calculates the predicted total power value based on the first predicted value. When the predicted total power deviates from the true total power by more than a preset tolerance threshold, proportional compression or compensation calibration is used for bidirectional correction to obtain the second predicted value, ensuring that the predicted total power and the true total power maintain a reasonable match on a macroscopic level; the third constraint step progressively prunes the second predicted value according to the physical characteristics of each type of target electrical appliance to obtain the third predicted value, strictly limiting the power prediction value of individual electrical appliances within their rated operating range to avoid over-limit anomalies; the fourth constraint step dynamically limits the difference between the third predicted value and the correction value at the previous moment based on the preset maximum power change rate to obtain the fourth predicted value, effectively suppressing power mutations and ensuring the physical smoothness of the time-series prediction. The fourth predicted value is the final loss correction value used for loss calculation. The four layers of constraints are progressively advanced and refined step by step, jointly constructing a complete hard correction system from macroscopic total power matching to microscopic individual constraints, and from static interval constraints to time-series dynamic constraints. This ensures that the model output strictly conforms to the laws of electrical physics and significantly improves the stability and decomposition accuracy of power prediction.
[0166] Step S412) Model optimization step: Calculate the differential loss weight based on the fluctuation of the total active power data in the sub-window, calculate the RMSE loss of the sub-window based on the obtained loss correction value, update the model parameters through the training loss calculated by the differential loss weight and the RMSE loss, and obtain the trained neural network model.
[0167] For steps S409 to S412, the technical effect is that by mapping the global fusion features to the normalized power prediction value of the target electrical appliance through linear transformation and Sigmoid activation function via the power output head, a precise mapping from fusion features to the power of each electrical appliance is achieved. The inverse normalization step restores the predicted value to the true power dimension, providing a numerical basis with clear physical meaning for physical constraints. Through four layers of progressive hard physical constraints, non-negativity constraints, total power threshold bidirectional constraints, rated power range constraints, and dynamic constraints on the power restoration value are applied sequentially, directly correcting the predicted value to strictly conform to the laws of electrical physics, fundamentally avoiding abnormal prediction problems such as negative power, rated power exceeding limits, and power mutations. Furthermore, differentiated loss weights are calculated based on the fluctuation of the total active power data within the sub-window, and the RMSE loss of the sub-window is calculated based on the loss correction value. The model parameters are then updated after weighting with differentiated weights, allowing the model to focus on key periods of drastic power fluctuations during training, significantly improving the stability of power prediction and the decomposition accuracy of high-power electrical appliances, achieving synergistic optimization of physical laws and data-driven approaches.
[0168] like Figure 9 As shown, step S412) model optimization step includes step S423) differential loss weight calculation step, step S424) RMSE loss calculation step, step S425) weighted loss calculation step and step S426) training loss calculation step.
[0169] Step S423) Differentiated loss weight calculation step: Calculate the differentiated loss weight based on the fluctuation of the total active power data within the sub-window. The formula is as follows:
[0170]
[0171] in, This represents the differential loss weight for the i-th sub-window. This represents the fluctuation of the total active power data within the i-th sub-window. This represents the fluctuation of the total active power data within the j-th sub-window. Let N represent an exponential function, and let N represent the number of sub-windows in the input window.
[0172] Step S424) RMSE loss calculation step: Based on the obtained loss correction value, calculate the point-by-point root mean square error of all time points within the sub-window as the RMSE loss, and the formula is as follows:
[0173]
[0174] in, Let T represent the RMSE loss of the i-th sub-window, and let T represent the number of time points within a sub-window. This represents the loss correction value of the k-th type of target electrical appliance at time point t in sub-window i. This represents the actual power value of the target appliance of type k at time point t in sub-window i.
[0175] Step S425) Weighted loss calculation step: Multiply the RMSE loss by the differential loss weight of the sub-window to obtain the weighted loss of the sub-window. The formula is as follows:
[0176]
[0177] in, This represents the weighted loss of the i-th sub-window.
[0178] Step S426) Training loss calculation step: For N sub-windows, calculate the weighted loss of the N sub-windows and take the average as the training loss. The formula is as follows:
[0179]
[0180] in, This indicates training loss.
[0181] For steps S423 and S426, the technical effects are as follows: Through the differential loss weight calculation step, differential loss weights are generated based on the fluctuation of the total active power data within the sub-window using exponential function normalization, enabling the model to automatically focus on key sub-windows with drastic power fluctuations and containing critical events during training; through the RMSE loss calculation step, the root mean square error is calculated point-by-point for each sub-window based on the loss correction value after four layers of hard physical constraints, ensuring that the loss calculation is based on strict adherence to the laws of electrical physics; through the weighted loss calculation step, the differential loss weights are multiplied by the RMSE loss to obtain the weighted loss of each sub-window, achieving precise constraints on errors during critical periods; through the training loss calculation step, the average of the weighted losses of all sub-windows is taken as the total training loss, balancing the contribution of each sub-window to model optimization and avoiding a single window dominating gradient updates; finally, through the decomposition result acquisition step, the observable bus signal at any time is input into the trained neural network model, directly outputting the power decomposition result of the target electrical appliance. This optimization mechanism significantly improves the stability of the model's power prediction and the decomposition accuracy of high-power electrical appliances, providing a reliable training guarantee for the accurate decomposition of the model in practical applications.
[0182] Step S5) Decomposition result acquisition step: Input the original current signal and total active power data of the user's main electricity meter at any time, as well as the corresponding electricity consumption scenario information at that time, into the trained neural network model, and output the power decomposition result of the target appliance.
[0183] Specifically, the system takes the raw current signal and total active power data from the user's main electricity meter collected at any given time, along with the corresponding electricity consumption scenario information, as input. This data is directly fed into the trained neural network model, outputting the power decomposition results of the target appliances without relying on any distributor sensors or prior information. This fully demonstrates the core advantages of non-intrusive load monitoring technology, enabling precise decomposition of the power consumption of various appliances solely through bus-observable signals, significantly reducing system deployment costs and construction complexity. Furthermore, because the model has fully learned the deep correlation between power characteristics and electricity consumption scenarios during the training phase through mechanisms such as double-layer sliding windows, dynamic attention-weighted fusion, and four layers of hard physical constraints, it exhibits excellent decomposition accuracy and stability in practical applications for household electricity consumption scenarios of different regions, seasons, time periods, and load levels. The decomposition results can be directly used for scenarios such as home energy management, smart electricity billing, electricity behavior analysis, and grid demand response, providing reliable data support for refined energy management and smart grid construction.
[0184] like Figure 10 As shown, this application also provides a storage medium 100 storing computer-readable instructions, which, when read by at least one processor 200, cause at least one processor 200 to execute the electrical power decomposition method.
[0185] like Figure 11 The figure shows the power decomposition result of the target electrical appliance output by the electrical appliance power decomposition method of this application.
[0186] This application provides an electrical appliance power decomposition method and storage medium. By constructing a two-layer sliding window input system consisting of fine-grained sub-windows and long-term input windows, and combining it with a multi-dimensional dynamic attention weighted fusion mechanism based on bus signals, it achieves precise coupling between short-term detailed features and long-term dependencies, effectively solving the problem of key features being easily diluted in traditional hierarchical coding. This allows the model to adaptively focus on key windows containing changes in the appliance's state. Through four-layer progressive power physics constraints and weighted hierarchical loss co-optimization, it fundamentally avoids abnormal prediction problems such as negative power, rated power exceeding limits, and power mutations. This significantly improves the stability and accuracy of power prediction, reducing the RMSE of high-power appliance power prediction by 10%-20% compared to existing models. By cross-coding the original current signal, frequency domain feature vector, and electricity consumption scenario information such as region, season, time period, and household load level, the model deeply correlates power characteristics with electricity consumption scenarios, effectively improving the model's adaptability and generalization ability to different regions, seasons, time periods, and load levels of household electricity consumption scenarios in China. The overall identification accuracy on heterogeneous datasets exceeds 80%, and the accuracy for Class A devices exceeds 85%, providing accurate data support for household energy management and electricity demand response.
[0187] The present application provides a detailed description of an electrical power decomposition method and storage medium. Specific examples have been used to illustrate the principles and implementation methods of the present application. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of the present application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of the present application. Therefore, the content of this specification should not be construed as a limitation of the present application.
Claims
1. A method for decomposing electrical power, characterized in that, Specifically, the steps include the following: The raw data acquisition steps involve collecting the raw current signal and total active power data from the user's main electricity meter, as well as the actual power data of the target appliance, and obtaining the electricity consumption scenario information corresponding to the time of collection. The data preprocessing step involves obtaining the frequency domain feature vector of the original current signal and the scene feature vector of the power consumption scenario information, and normalizing the total active power data and the actual power data. The model building steps include building a neural network model with a double-layer sliding window. The double-layer sliding window includes an input window of a second preset duration. The input window includes two or more sub-windows of a first preset duration. The second preset duration is longer than the first preset duration. The sub-windows are continuous and do not overlap. The model training step involves inputting the original current signal, the normalized total active power data, the normalized real power data, the frequency domain feature vector, and the scene feature vector as training data into the neural network model to train the neural network model. as well as The decomposition result acquisition step involves inputting the raw current signal and total active power data of the user's main electricity meter at any given time, along with the corresponding electricity consumption scenario information, into the trained neural network model, and outputting the power decomposition result of the target appliance.
2. The electrical power decomposition method as described in claim 1, characterized in that, The data preprocessing steps include the following steps: The frequency domain feature vector acquisition step involves performing a fast Fourier transform on the original current signal using a sliding window of a first preset duration to extract the frequency domain feature vectors of the odd harmonics in the obtained frequency domain harmonic sequence. One-hot encoding step: Perform one-hot encoding on the electricity consumption scenario information to obtain scenario feature vector; as well as The normalization step, based on a preset global maximum power value, normalizes both the total active power data and the actual power data, compressing both the power values of the total active power data to the [0, 1] interval. The formula is as follows: in, This represents the power value of the normalized total active power data or the power value of the normalized true power data. This represents the power value of the total active power data or the power value of the actual power data. This represents the preset global maximum power value.
3. The electrical power decomposition method as described in claim 1, characterized in that, The model training steps include the following steps: The data partitioning step involves dividing the training data into at least one data unit of a second preset duration through the input window, and further splitting the data unit into two or more sub-data units of a first preset duration through the sub-window. The time-domain waveform acquisition step involves a neural network model that includes a high-frequency branch. The high-frequency branch consists of three 1D convolutional layers, a BN layer, and a ReLU layer. The time-domain waveform features of the original current signal in the sub-data unit are extracted through the high-frequency branch. The frequency domain feature distribution acquisition step involves the neural network model including a low-frequency branch, which consists of two 1D convolutional layers, a BN layer, and a ReLU layer. The frequency domain feature distribution of the frequency domain feature vector in the sub-data unit is extracted through the low-frequency branch. The time-series feature vector acquisition step involves a neural network model including a BiGRU layer, which concatenates the time-domain waveform features with the frequency-domain feature distribution, and captures the temporal dependency between the concatenated time-domain waveform features and the frequency-domain feature distribution through the BiGRU layer to obtain the time-series feature vector. as well as The feature fusion acquisition step involves concatenating the temporal feature vector with the scene feature vector of the sub-data unit to obtain the fusion features of the sub-window.
4. The electrical power decomposition method as described in claim 3, characterized in that, The model training process also includes the following steps: The independent encoding step utilizes a self-attention mechanism to independently encode the fusion features of each sub-window through the Transformer segment encoder included in the neural network model, thereby obtaining the sub-window encoded features. The comprehensive score acquisition step involves obtaining the comprehensive importance score of the sub-window based on the normalized total active power data. as well as The global fusion feature acquisition step, based on the obtained comprehensive importance score, uses a temperature parameter... The Softmax function is used to perform a weighted summation of the sub-window encoded features using the calculated dynamic fusion weights to obtain the global fusion features.
5. The electrical power decomposition method as described in claim 4, characterized in that, The steps for obtaining the comprehensive score include the following: The volatility calculation steps involve calculating the variance of the normalized total active power data as the volatility of the total active power data, using the following formula: in, This represents the volatility of the i-th sub-window. The greater the volatility, the higher the probability of electrical appliances starting or stopping or state switching occurring within the sub-window. Indicates variance; This represents the normalized total active power value within the sub-window at sampling time t; The maximum rate of change is calculated by taking the absolute value of the maximum first-order difference of the total active power data within the sub-window as the maximum rate of change of the total active power data. The formula is as follows: in, This represents the maximum rate of change of the i-th sub-window. The larger the maximum rate of change, the more critical the sub-window is. Represents the maximum value function; This represents the normalized total active power value within the sub-window at sampling time t-1; The edge energy ratio calculation steps involve calculating the ratio of the average power at the start and end edges of the sub-window to the average power of the entire sub-window. The formula is as follows: in, This represents the edge energy ratio of the i-th sub-window. This represents the normalized total active power value at the start and end edges of the sub-window. This represents the normalized total active power value within the entire sub-window. Represents aggregate functions; and The scoring calculation steps involve normalizing the obtained volatility, maximum rate of change, and edge energy ratio, and then obtaining the comprehensive importance score of the sub-window through weighted summation. The formula is as follows: in, This represents the overall importance score of the i-th sub-window. This indicates the preset volatility weight. This represents the preset maximum rate of change weight. This represents the preset edge energy ratio weight. This represents the normalized volatility of the i-th sub-window. This represents the maximum normalized rate of change of the i-th sub-window. This represents the normalized edge energy ratio of the i-th sub-window.
6. The electrical power decomposition method as described in claim 5, characterized in that, The global fusion feature acquisition step includes the following steps: The dynamic fusion weight calculation step, based on the obtained comprehensive importance score, uses a temperature parameter... The Softmax function calculates the dynamic fusion weights and assigns them to the child windows. The calculation formula is as follows: in, This represents the dynamic fusion weight of the i-th sub-window. This represents the overall importance score of the i-th sub-window. This represents the overall importance score of the j-th sub-window. Indicates temperature parameter, Let N represent the number of sub-windows in the input window, and N represent the number of sub-windows in the input window; and The weighted summation step, based on the obtained dynamic fusion weights, performs a weighted summation of the sub-window encoded features to obtain the global fusion features, the formula of which is: in, Indicates global fusion features, This represents the encoding feature of the i-th sub-window.
7. The electrical power decomposition method as described in claim 6, characterized in that, The model training process also includes the following steps: The power prediction calculation steps involve, based on the obtained global fusion features, mapping the global fusion features to the normalized power prediction value of the target appliance through a linear transformation and a sigmoid activation function. The formula is as follows: in, This represents the normalized power prediction value of the k-th type of target electrical appliance. This represents the weight matrix of the power output head. Indicates global fusion features, This represents the bias vector of the power output head; The inverse normalization step involves inverse normalizing the normalized power prediction value to obtain the restored true power value, using the following formula: in, This represents the true power value restored for the k-th type of target electrical appliance. This represents the preset global maximum power value; The power physical constraint step involves applying a four-layer progressive power physical constraint to the power restoration true value, thereby correcting the power restoration true value and obtaining the loss correction value. The model optimization steps are as follows: calculate the differential loss weight based on the fluctuation of the total active power data within the sub-window; calculate the RMSE loss of the sub-window based on the obtained loss correction value; update the model parameters through the training loss calculated by the differential loss weight and the RMSE loss to obtain the trained neural network model.
8. The electrical power decomposition method as described in claim 7, characterized in that, The electrical physical constraint steps include the following steps: The first constraint step involves pruning all negative values from the restored true power value to obtain the first predicted value, whose formula is as follows: in, This represents the first predicted value for the k-th type of target electrical appliance. This represents the true power value restored for the k-th type of target electrical appliance. Represents the maximum value function; The second constraint step involves calculating the predicted total power value of the target appliance based on the obtained first predicted value. When the predicted total power value is greater than the actual power data, the first predicted value is compressed proportionally. Within the range, a second predicted value is obtained; when the predicted total power value is less than the power value of the actual power data, based on the operating state confidence of the target appliance, the first predicted value of the target appliance operating with high confidence is compensated and calibrated to obtain the second predicted value; the formula for calculating the predicted total power value is as follows: in, This represents the predicted total power value, where M represents the number of target appliance categories. The power value represents the actual power data. This indicates the preset deviation tolerance threshold; The third constraint step involves progressively tailoring the second predicted value of each target electrical appliance based on its physical characteristics, ensuring that the second predicted value falls within a preset power range. Inside, its formula is in, This represents the third predicted value for the target appliance of category k. This represents the second predicted value for the k-th type of target appliance. Describe the minimum value function; and The fourth constraint step is to preset a maximum power change rate. The difference between the current power restoration value and the third predicted value at the previous moment is determined by the maximum power change rate. The formula for the size relationship between them is: in, This represents the fourth predicted value for the k-th type of target electrical appliance, i.e., the loss correction value. This represents the true power value of the k-th type of target electrical appliance at the current moment. This represents the third predicted value of the k-th type of target electrical appliance at the previous time step.
9. The method for decomposing electrical power as described in claim 7, characterized in that, The model optimization steps include the following steps: The differential loss weight calculation steps involve calculating the differential loss weight based on the fluctuation of the total active power data within the sub-window. The formula is as follows: in, This represents the differential loss weight for the i-th sub-window. This represents the fluctuation of the total active power data within the i-th sub-window. This represents the fluctuation of the total active power data within the j-th sub-window. This represents an exponential function, where N represents the number of sub-windows in the input window; The RMSE loss calculation steps involve calculating the point-by-point root mean square error (RMSE) for all time points within the sub-window based on the obtained loss correction value. The formula is as follows: in, Let T represent the RMSE loss of the i-th sub-window, and let T represent the number of time points within a sub-window. This represents the loss correction value of the k-th type of target electrical appliance at time point t in sub-window i. This represents the actual power value of the target appliance of type k at time point t in sub-window i; The weighted loss calculation steps involve multiplying the RMSE loss by the differential loss weights of the sub-windows to obtain the weighted loss of the sub-windows. The formula is as follows: in, Represents the weighted loss of the i-th sub-window; and The training loss calculation steps are as follows: For N sub-windows, calculate the weighted loss of the N sub-windows and take the average as the training loss. The formula is: in, This indicates training loss.
10. A storage medium storing computer-readable instructions, characterized in that, When the computer-readable instructions are read by at least one processor, the at least one processor performs the electrical power decomposition method as described in any one of claims 1 to 9.