A household flexible resource joint monitoring method considering meteorological factor influence
By constructing a joint monitoring model for household flexibility resources, combining a Transformer encoder and a temporal convolutional neural network, the problem of difficulty in monitoring complex household flexibility resources in existing technologies is solved, achieving accurate monitoring and model universality in complex electricity usage scenarios.
Patent Information
- Application Number
- CN202411509884.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-28
- Publication Date
- 2025-11-07
- Estimated Expiration
- 2044-10-28
AI Technical Summary
Existing technologies struggle to accurately and efficiently monitor the complex flexibility resources in a home, particularly neglecting the impact of non-electrical factors on adjustable appliances and downstream photovoltaic output, and failing to effectively handle complex bus power in scenarios where multiple flexibility resources operate simultaneously.
By using correlation analysis and multi-task learning, a joint monitoring model for household flexibility resources is constructed. Combining a Transformer encoder and a temporal convolutional neural network, the model comprehensively considers the correlation between environmental factors and flexibility resources, selects key meteorological factors as inputs, reduces computational complexity, and improves monitoring accuracy.
It enables accurate monitoring of various flexible resources in complex power consumption scenarios, enhances the model's versatility and robustness, reduces computational complexity, and improves monitoring accuracy and robustness.
Smart Images

Figure CN119519117B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of flexible resource monitoring, and particularly to a household flexible resource joint monitoring method considering the influence of meteorological factors. BACKGROUND
[0002] In recent years, with the large-scale use of renewable energy, the volatility and intermittency of its power generation have brought major challenges to real-time power distribution network operation. To meet these challenges, it is increasingly important to enhance the flexibility of the load side. In this context, demand response is crucial to encourage users to adjust flexible resources to maintain the balance between supply and demand of the power grid. However, due to the concealment of flexible resources, the power grid cannot directly perceive their operating state, making it difficult to assess the adjustment potential of users. Therefore, accurately monitoring flexible resources in the home is an important prerequisite for developing accurate response plans.
[0003] Although existing research provides some preliminary solutions for flexible resource monitoring, it is still very difficult to accurately and efficiently monitor complex household flexible resources. First, most current monitoring research on household adjustable appliances and behind-the-meter photovoltaics adopts a single-task learning paradigm, training a model for each monitoring target independently. This not only leads to a significant increase in computational complexity when monitoring multiple flexible resources, but also fails to consider the correlation between these flexible resources, making it difficult to effectively handle complex bus power in scenarios where multiple flexible resources operate together. Second, most research ignores the complex impact of non-electrical factors on the output of household adjustable appliances and behind-the-meter photovoltaics. Even when considered, the selection of non-electrical factors often relies on subjective judgment, making it difficult to accurately reflect and exploit the operating characteristics of flexible resources. Finally, existing non-intrusive load monitoring methods based on multi-task learning still fail to consider the randomness and volatility of photovoltaics and their dual impact on the complex use behavior of household appliances, resulting in a decline in monitoring performance of flexible resources. To date, no research has developed a multi-task learning framework that can jointly monitor adjustable appliances and distributed generation equipment in households. SUMMARY
[0004] The present application aims to overcome the shortcomings and deficiencies of the prior art and proposes a household flexible resource joint monitoring method considering the influence of meteorological factors. This method comprehensively considers the correlation between environmental factors and flexible resources, as well as the correlation between these resources through correlation analysis and multi-task learning. It aims to handle the complex use patterns of household adjustable appliances and the high volatility of rooftop photovoltaics, enhance the model's versatility in different households, reduce the computational complexity of monitoring multiple targets, and ultimately achieve accurate monitoring of multiple flexible resources in complex power consumption scenarios.
[0005] In order to achieve the above object, the technical scheme provided by the present application is as follows: a household flexible resource joint monitoring method considering meteorological factor influence, comprising the following steps:
[0006] 1) Collecting bus power data in a real household power consumption scene, individual power data of each flexible resource, and candidate meteorological factor data corresponding to the time period and performing preprocessing to obtain clean data;
[0007] 2) According to the clean data obtained by preprocessing in step 1), calculating the correlation coefficient between the operation of the household flexible resource and the candidate meteorological factor, and according to the calculation result, screening out key meteorological factor data which has a great influence on the operation of the flexible resource, and merging the bus power data in step 1) into a multi-dimensional feature vector as a subsequent model input;
[0008] 3) Based on the multi-task learning idea, introducing a Transformer encoder and a time series convolutional neural network to construct a household flexible resource joint monitoring model, taking the multi-dimensional feature vector constructed in step 2) as input and the individual power data preprocessed in step 1) as label to perform model training, and obtaining a trained model;
[0009] 4) In actual application, the bus power data collected in real time and the key meteorological factor data corresponding to the time period screened out in step 2) are merged into a multi-dimensional feature vector and input into the trained model, and multiple accurate individual power data of the flexible resource are obtained.
[0010] Further, in step 1), the flexible resource refers to household adjustable appliances and distributed power generation equipment which can be adjusted according to the actual demand of the power grid, the household adjustable appliances include temperature control loads and translatable loads, the temperature control loads include heat pumps and air conditioners, and the translatable loads include washing machines and dishwashers; the distributed power generation equipment includes roof photovoltaic and micro wind turbines; the bus power data refers to the power data at the entrance of the household user's electric meter; the individual power data of each flexible resource refers to the power data when each flexible resource operates alone; both the above two kinds of power data are collected by an intelligent measurement terminal, the sampling period is T sample , the sampling time is T, the intelligent measurement terminal includes a smart meter; the candidate meteorological data refers to the meteorological data corresponding to the time obtained from the meteorological station at the location of the household;
[0011] The preprocessing includes outlier detection and normalization processing; the calculation formula of the outlier detection criterion abn is as follows:
[0012] abn=I(|z λ+1 -z λ |>thed),λ=1,2,...,w
[0013] In the formula, I(·) is an indicator function, which returns 1 if the condition in the parentheses is met, and 0 otherwise; w is the number of sampling points; z λ+1 and z λ respectively represent the (λ+1)th and the λth power sampling points in a single piece of fragment data; thed represents a threshold value of the absolute difference between adjacent power sampling points; abn is an abnormal value detection criterion, if abn is equal to 1, it is determined that there is an abnormal value, the piece of fragment data is deleted, and the piece of fragment data is supplemented by interpolation, if abn is equal to 0, it is indicated that there is no abnormal value, and the piece of fragment data is retained;
[0014] The normalization processing refers to standardization by using a Z-score method, which obtains standardized sample data by calculating the sample and its mean and variance, and the specific formula is as follows:
[0015]
[0016] In the formula, X and X norm respectively represent sample data before and after standardization; μ represents the sample mean; and σ represents the sample variance.
[0017] Further, in step 2), the correlation coefficient is used to quantitatively represent the correlation degree between the operation of the family flexible resource and the meteorological factor, and the correlation coefficient that can be selected includes a maximum information coefficient (MIC) and a Spearman correlation coefficient (Spearman);
[0018] The MIC is a non-parametric method for measuring the linear and nonlinear relationship between two variables, the core idea of which is to find a variable segmentation method that can maximize the information to reveal the maximum correlation between two variables, and it has high sensitivity for mining the potential correlation between variables, and is suitable for discovering various types of relationships between variables, including linear and nonlinear relationships, and its value range is 0 to 1, where 0 represents no relationship, 1 represents complete correlation, and greater than 0.5 represents a strong correlation between two variables, and the calculation formula is as follows:
[0019]
[0020] In the formula, B represents the 0.6th power of the data amount; a and b respectively represent the division of a two-dimensional space composed of variables m and n into a rows and b columns; p(m, n) represents the joint probability function of variables m and n; and p(m) and p(n) represent the boundary probability density functions of variables m and n;
[0021] Spearman is used to measure the rank correlation between two variables, which is based on the ordering and ranking of variable observations, suitable for evaluating the monotonic relationship between two variables, especially when there is an order relationship between variables but the specific functional form is unknown or complex, and its value ranges from-1 to 1, where 1 indicates that the two variables are completely monotonically positively correlated, 0 indicates that there is no monotonic relationship between the two variables, and-1 indicates that the two variables are completely monotonically positively correlated, and an absolute value greater than 0.5 indicates that there is a strong correlation between the two variables, and its calculation formula is as follows:
[0022]
[0023] In the formula, d represents the difference between the rank of the two variables after ordering; N represents the number of samples;
[0024] The specific process of the correlation coefficient calculation is as follows:
[0025] First, combine the clean data after step 1) preprocessing, and count the number of times each appliance in the family is turned on every hour every day during the sampling period, then use kernel density estimation to fit the usage probability curve of each appliance every hour in a day;
[0026] Second, use MIC and Spearman to calculate the correlation coefficient between each candidate meteorological factor and the usage probability curve of all flexible resources, and record the calculation results, in this way, not only can the nonlinear relationship of the appliance operation mode be captured, but also the potential influence of meteorological factors on flexible resources can be effectively measured, thereby providing reliable basis for subsequent model input;
[0027] Then, based on the calculated correlation coefficient, each candidate meteorological factor is screened: the number of correlation coefficients between each candidate meteorological factor and all flexible resources whose absolute value exceeds a predetermined threshold is counted, which reflects the degree of association between the candidate meteorological factor and multiple flexible resources, and the greater the number, the higher the degree of association between the candidate meteorological factor and multiple flexible resources;
[0028] Next, sort the candidate meteorological factors according to the degree of association with flexible resources from high to low, filter out meteorological factors with low correlation with flexible resources, and retain those meteorological factors with high degree of association in multiple target resources as key meteorological factors;
[0029] Finally, merge the data of the screened key meteorological factors with the bus power data obtained in step 1) to form a multi-dimensional input vector, providing high-quality input data for subsequent model training, so that the model can better capture the dynamic characteristics and external influences of flexible resources, thereby improving the accuracy and robustness of monitoring.
[0030] Further, in step 3), the multi-task learning idea refers to learning multiple related tasks simultaneously using a single model, which has the advantages of utilizing the correlation between tasks, improving the overall performance of the model, and reducing the complexity of the model; the family flexibility resource joint monitoring model is composed of a shared feature extraction module, a gating network and a tower network, and its working principle is as follows: first, the shared feature extraction module extracts relevant feature information across monitoring tasks; then, the gating network reasonably distributes the extracted relevant feature information to the parallel tower network to generate monitoring results of different flexibility resources; the shared feature extraction module is composed of multiple expert networks, which learn the correlation information across monitoring tasks from different angles; first, the input vector of the model is composed of bus power data and meteorological factor data; then, the expert network is composed of a one-dimensional convolutional neural network and multiple Transformer encoders, wherein the one-dimensional convolutional neural network adopts a 1*1 convolution kernel for point-by-point convolution to better represent the time series input, and then the Transformer encoder is composed of a multi-head attention mechanism, a residual connection and a feedforward neural network to explore the potential correlation between multiple tasks and global shared information; the multi-head attention mechanism enables the model to simultaneously capture multiple complex correlation relationships, as shown in the following formula:
[0031]
[0032] MH(Q,K,V)=Concat(head1,head2,...,head u ,...,head h )W O
[0033] In the formula, Q, K, and V represent query, key, and value respectively; Attention(Q,K,V) represents the calculation formula of dot product attention score; Softmax represents the activation function; d represents the scaling factor; head u represents the u-th dot product attention score; , respectively, represent the weight matrix corresponding to Q, K, and V; Concat represents the concatenation operation; W O represents the output weight matrix; MH(Q,K,V) represents the output result of multi-head attention;
[0034] Each Transformer encoder layer contains a feedforward neural network for non-linear transformation and mapping of features at each position in the sequence; the feedforward neural network is composed of two fully connected layers, with an activation function in between for non-linear transformation, which can better capture local features at each position in the sequence and enhance the representation ability of the model, and its calculation process is shown in the following formula.
[0035] y linear= Linear2(ReLU(Linear1(MH(Q, K, V))))
[0036] where y linear and MH(Q, K, V) represent the output and input of the feedforward neural network, respectively; Linear1(·) and Linear2(·) represent two fully connected layers, respectively; and ReLU(·) represents an activation function.
[0037] In the Transformer encoder, the multi-head attention mechanism and the feedforward neural network are followed by a residual connection and a layer normalization operation; the residual connection is used to pass the input directly to the output of the multi-head attention mechanism and the feedforward neural network, thereby alleviating the gradient vanishing problem when training a deep model; the layer normalization is used to normalize the output of the multi-head attention mechanism and the feedforward neural network, which helps to speed up the training process of the model; in order to realize the adaptive weighting of the output features of all expert networks for each flexibility resource monitoring task, a gating network is introduced in the model, which is composed of a fully connected layer and a softmax activation function, and it can learn the weighting coefficients of the output of each expert network according to the features of the input data; the output of the gating network is represented by the following formula.
[0038]
[0039] where x is the input of the model; is the weighting coefficient matrix of the i-th expert network for the k-th sub-task; softmax represents an activation function; W ki is the transformation matrix of the i-th expert network in the gating network for the k-th sub-task; n expert is the number of expert networks in the model; k is the number of the appliance power decomposition task; f i (x) is the output of the i-th expert network; G k (x) is the weighted sum of the outputs of the n expert expert networks for the k-th task, which is the input of the corresponding task tower network;
[0040] The tower network provides a dedicated branch for each resource monitoring task, which can capture the distribution features related to the specific task from the shared features; the tower network is composed of a temporal convolutional neural network (TCN), a one-dimensional convolutional neural network and a fully connected layer.
[0041] Firstly, TCN extracts the long-term and medium-term dependency from the shared features, and through the causal convolution and dilated convolution, TCN can expand the receptive field, so that the model can pay attention to a wider range of historical information, thereby more effectively extracting the time pattern in the power data, and this design enables the model to better cope with the diversified characteristics of different flexible resources and monitor according to the specific needs of each resource, and the calculation formula is as shown in the following formula.
[0042]
[0043] In the formula, H κ (t) is the time sequence of the kth layer, h(·) is an activation function, * is a convolution operation, omega κ,i is the weight of the i-th convolution kernel of the kth layer, k is the width of the convolution kernel, and the input of the kth layer is obtained by convolving the output of the k-1th layer at k time points; D is the dilated factor, which represents the number of steps across time steps; H κ-1 (t-d x i) is the value of the time sequence of the k-1th layer at different time steps;
[0044] Then, the local connectivity of the one-dimensional convolutional neural network is used to capture the fine-grained time change, and the ability of the model to focus on specific patterns in a short time window is enhanced; finally, quantile regression is applied in the full connection layer to obtain the final monitoring result, wherein the quantile regression can comprehensively describe the conditional distribution of different quantiles, and can effectively capture the diversified distribution caused by the subtle changes of the use mode of household appliances and the fluctuations of photovoltaic output in complex power data;
[0045] In addition, by outputting multiple quantile values, the model can reveal the potential uncertainty in the change of flexible resources, and provide data support for formulating fine demand response strategies; the output of the tower network is defined as follows:
[0046]
[0047] In the formula, h k (·) is the kth tower network; is the jth quantization value tau j of the kth tower network.
[0048] Compared with the prior art, the present application has the following advantages and beneficial effects:
[0049] 1. The present application proposes a new model input feature analysis and screening method. A variety of correlation evaluation indexes are combined to comprehensively evaluate the correlation degree between candidate environmental factors and various flexible resources, and environmental factors highly correlated with various flexible resources are screened out, so as to ensure the effectiveness and universality of the selected factors in various power consumption scenarios.
[0050] 2.The application constructs a household flexibility resource joint monitoring model based on multi-task learning. First, the shared feature extraction module based on the Transformer encoder deeply mines the cross-task general time features in the input electrical and environmental data. Then, the specific task features are personalized processed by using the gating network and tower network, and the long-term and short-term changes of the corresponding flexibility resources are captured, which improves the monitoring accuracy of the flexibility resources.
[0051] 3.The application proposes a new household flexibility resource monitoring method. Through correlation analysis and multi-task learning, the correlation between environmental factors and flexibility resources, as well as the correlation between these resources, is comprehensively considered. It aims to handle the complex usage patterns of adjustable electrical appliances and the high volatility of rooftop photovoltaics, enhance the universality of the model in different households, and reduce the computational complexity of the model in practical application.
[0052] In summary, the application provides a new solution to the problem of accurate monitoring of household flexibility resources in complex electricity consumption scenarios, has practical application value, and is worth promoting. BRIEF DESCRIPTION OF DRAWINGS
[0053] Figure 1 The flowchart of the method of the application.
[0054] Figure 2 The structure diagram of the household flexibility resource joint monitoring model.
[0055] Figure 3 The structure diagram of the expert network.
[0056] Figure 4 The structure diagram of the tower network. DETAILED DESCRIPTION
[0057] The application will be further described in detail below in conjunction with the embodiments and drawings, but the implementation of the application is not limited thereto.
[0058] Example 1
[0059] As shown in the Figure 1 , the embodiment discloses a household flexibility resource joint monitoring method considering the influence of meteorological factors, including the following steps:
[0060] Step 1: Collecting bus power data in real household electricity scene, individual power data of each flexible resource and candidate meteorological factor data in corresponding period, and preprocessing them to obtain clean data. Flexible resource refers to household adjustable electrical appliances and distributed power generation equipment that users can adjust their operation behavior according to the actual demand of power grid. Household adjustable electrical appliances include but are not limited to temperature controlled loads such as heat pump, air conditioner and so on, and translatable loads such as washing machine, dishwasher and so on. Distributed power generation equipment includes but is not limited to roof photovoltaic, micro wind turbine and so on. Bus power data refers to power data at the entrance of household user meter; individual power data of each flexible resource refers to power data when each flexible resource operates individually. Both of the above two kinds of power data are collected by intelligent metering terminal such as smart meter, sampling period is T sample , and sampling duration is T. Candidate meteorological data refers to meteorological data corresponding to the time obtained from the meteorological station at the location of the family. In this embodiment, T sample is 1 minute.
[0061] The preprocessing includes outlier detection and normalization processing; the calculation of outlier detection criterion abn is as follows:
[0062] abn = I(|z λ+1 -z λ |>thed), λ = 1, 2, …, w
[0063] In the formula, I(·) is an indicator function, which returns 1 if the condition in the parentheses is met, otherwise returns 0; w is the number of sampling points; z λ+1 and z λ respectively represent the λ+1th and λth power sampling points in a single segment data; theed represents the threshold value of the absolute difference between adjacent power sampling points; abn is the outlier detection criterion, if abn is equal to 1, it is determined that there is an outlier, the segment data is deleted, and the segment data is supplemented by interpolation method, if abn is equal to 0, it means that there is no outlier, the segment data is retained;
[0064] Normalization processing refers to standardization by Z-score method, which obtains standardized sample data by calculating the sample and its mean and variance, the specific formula is as follows:
[0065]
[0066] Where X and X norm are sample data before and after standardization respectively; μ represents the sample mean; σ represents the sample variance.
[0067] Step 2: According to the pre-processed data in Step 1, calculate the correlation coefficient between the operation of the household flexible resource and the candidate meteorological factors. According to the calculation result, the key meteorological factors that have a greater impact on the operation of the flexible resource are selected and combined with the bus power data in Step 1 to form a multi-dimensional feature vector as the input of the model. The correlation coefficient is used to quantitatively represent the degree of association between the operation of the household flexible resource and the meteorological factors. The correlation coefficient that can be selected includes but is not limited to Maximum Information Coefficient (MIC) and Spearman correlation coefficient (Spearman), etc.
[0068] MIC is a non-parametric method for measuring the linear and non-linear relationship between two variables. The core idea is to find the variable partitioning method that can maximize the information to reveal the maximum correlation between the two variables. It has high sensitivity in mining the potential association between variables and is suitable for discovering various types of relationships between variables, including linear and non-linear relationships. Its value ranges from 0 to 1, where 0 represents no relationship and 1 represents complete correlation. A value greater than 0.5 indicates a strong correlation between the two variables. The calculation formula is as follows:
[0069]
[0070] where B represents the 0.6 power of the data volume; a and b represent the division of the two-dimensional space composed of variables m and n into a rows and b columns; p(m,n) represents the joint probability function of variables m and n; p(m) and p(n) represent the boundary probability density function of variables m and n.
[0071] Spearman is used to measure the rank correlation between two variables. Its calculation is based on the ordering and ranking of variable observations and is suitable for evaluating the monotonic relationship between two variables, especially when there is an order relationship between variables but the specific function form is unknown or complex. Its value ranges from -1 to 1, where 1 represents complete monotonic positive correlation between two variables, 0 represents no monotonic relationship between two variables, and -1 represents complete monotonic positive correlation between two variables. An absolute value greater than 0.5 indicates a strong correlation between the two variables. The calculation formula is as follows:
[0072]
[0073] where d i represents the difference between the rank of two variables after ordering; N represents the number of samples. The specific process of correlation coefficient calculation is as follows. First, based on the pre-processed data in Step 1, count the number of times each appliance in the household is turned on every hour every day during the sampling period. Then, use kernel density estimation to obtain the probability curve of each appliance usage every hour in a day.
[0074] Secondly, the correlation coefficients between each candidate meteorological factor and all flexible resource usage probability curves are calculated using MIC and Spearman, and the calculation results are recorded. In this way, not only the nonlinear relationship of the appliance running mode can be captured, but also the potential impact of meteorological factors on flexible resources can be effectively measured, thereby providing a reliable basis for subsequent model input.
[0075] Then, based on the calculated correlation coefficients, each candidate meteorological factor is further screened. Specifically, the number of correlation coefficients between each candidate meteorological factor and all flexible resources whose absolute values exceed a predetermined threshold is counted. The number reflects the degree of association between the candidate meteorological factor and multiple flexible resources, and the larger the number, the higher the degree of association between the candidate meteorological factor and multiple flexible resources. In this embodiment, the predetermined threshold is taken as 0.5.
[0076] Next, these candidate meteorological factors are sorted in descending order of their correlation with flexible resources. This step can effectively filter out meteorological factors with low correlation with flexible resources and retain those with high correlation in multiple target resources as key meteorological factors.
[0077] Finally, the data of the screened key meteorological factors are merged with the bus power data obtained in step 1 to form a multi-dimensional input vector, providing high-quality input data for subsequent model training. In this way, the model can better capture the dynamic characteristics and external influences of flexible resources, thereby improving the accuracy and robustness of monitoring.
[0078] Step 3: Based on the idea of multi-task learning, a Transformer encoder and a time series convolutional neural network are innovatively introduced to construct a household flexible resource joint monitoring model. The multi-dimensional feature vector constructed in step 2 is used as input and the single body power data preprocessed in step 1 is used as label for model training. The household flexible resource joint monitoring model consists of a shared feature extraction module, a gating network and a tower network, as shown in the specific structure of Figure 2 The working principle is as follows. First, the model extracts relevant feature information across monitoring tasks through the shared feature extraction module. Then, the gating network reasonably allocates these information to parallel tower networks to generate monitoring results for different flexible resources.
[0079] (1) Shared feature extraction module
[0080] The shared feature extraction module consists of multiple expert networks that learn relevant information across monitoring tasks from different perspectives. First, the input vector of the model consists of bus power data and meteorological factor data. Then, the expert network consists of a one-dimensional convolutional neural network and multiple Transformer encoders, as shown in the specific structure ofFigure 3 The one-dimensional convolutional neural network adopts 1x1 convolution kernel for point-by-point convolution to better represent the time series input. Subsequently, the Transformer encoder is composed of multi-head attention mechanism, residual connection and feedforward neural network, exploring the potential correlation between multiple tasks and global shared information.
[0081] 1) Multi-head attention mechanism
[0082] The multi-head attention mechanism enables the model to capture multiple complex correlations simultaneously, as shown in the following formula.
[0083]
[0084] MH(Q, K, V) = Concat(head1, head2,..., head u ,...,head h )W O
[0085] In the formula, Q, K, V represent query, key, value respectively; Attention(Q, K, V) represents the calculation formula of dot-product attention score; Softmax represents the activation function; d represents the scaling factor; head u represents the u-th dot-product attention score; Concat represents the concatenation operation; W O represents the output weight matrix; MH(Q, K, V) represents the output result of multi-head attention.
[0086] 2) Feedforward neural network
[0087] Each Transformer encoder layer contains a feedforward neural network for nonlinear transformation and mapping of features at each position in the sequence. The feedforward neural network is usually composed of two fully connected layers, with an activation function in between for nonlinear transformation. Such a design enables the model to better capture local features at each position in the sequence and enhances the representation ability of the model. The calculation process of this part is shown in the following formula.
[0088] y linear = Linear2(ReLU(Linear1(MH(Q, K, V))))
[0089] In the formula, y linear and MH(Q, K, V) represent the output and input of the feedforward neural network respectively; Linear1(·) and Linear2(·) represent the two fully connected layers respectively; ReLU(·) represents the activation function.
[0090] 3) Residual connection and layer normalization
[0091] In the Transformer encoder, a residual connection and layer normalization operation are contained after the multi-head attention mechanism and the feed-forward neural network. The residual connection is used to pass the input directly to the output of the multi-head attention mechanism and the feed-forward neural network, thereby alleviating the gradient vanishing problem when training deep models. The layer normalization is used to normalize the output of the multi-head attention mechanism and the feed-forward neural network, which helps to speed up the training process of the model.
[0092] (2) Gating network
[0093] In order to realize the adaptive weighting of all expert network output features for each flexibility resource monitoring task, a gating network is introduced in the model. The gating network consists of a fully connected layer and a softmax activation function. Its main function is to learn the weighting coefficients of the output of each expert network according to the features of the input data.
[0094] The output of the gating network can be represented by the following formula.
[0095]
[0096] In the formula, x is the input of the model; W is the weighting coefficient matrix of the i-th expert network for the k-th sub-task; softmax represents the activation function; W ki is the transformation matrix of the i-th expert network for the k-th sub-task in the gating network; n expert is the number of expert networks in the model; k is the number of appliance power decomposition tasks; f i (x) is the output of the i-th expert network; G k (x) is the weighted sum of the outputs of the n expert expert networks for task k, which is the input of the corresponding task tower network;
[0097] (3) Tower network
[0098] The tower network provides a dedicated branch for each resource monitoring task, which can capture the distribution characteristics related to the specific task from the shared features. The tower network consists of a temporal convolutional neural network (TCN), a one-dimensional convolutional neural network, and a fully connected layer, as shown in Figure 4 .
[0099] Firstly, TCN extracts the long-term and medium-term dependencies from the shared features. Through the causal convolution and dilated convolution, TCN can expand the receptive field, enabling the model to focus on a wider range of historical information, thus more effectively extracting the temporal patterns in the power data. This design enables the model to better cope with the diverse characteristics of different flexible resources and monitor according to the specific needs of each resource. The calculation formula is as follows.
[0100]
[0101] where H κ (t) is the time series of the k-th layer, h(·) is the activation function, * is the convolution operation, ω κ,i is the weight of the i-th convolution kernel of the k-th layer, k is the width of the convolution kernel, and represents that the input of the k-th layer is obtained by convolving the output of the k-1-th layer at k time steps; D is the dilation factor, representing the number of steps across time steps; H κ-1 (t-d×i) is the value of the time series of the k-1-th layer at different time steps.
[0102] Then, the local connectivity of the one-dimensional convolutional neural network is used to capture fine-grained temporal changes and enhance the model's ability to focus on specific patterns within a short time window. Finally, quantile regression is applied in the fully connected layer to obtain the final monitoring results. Unlike traditional regression methods, quantile regression can comprehensively describe the conditional distribution of different quantiles, effectively capturing the diverse distribution caused by subtle changes in appliance usage patterns and photovoltaic output fluctuations in complex power data.
[0103] In addition, by outputting multiple quantile values, the model can reveal the potential uncertainty in the changes of flexible resources, providing data support for developing fine-grained demand response strategies. The output of the tower network is defined as follows:
[0104]
[0105] where h k (·) is the k-th tower network; is the predicted value corresponding to the j-th quantization value τ j in the k-th tower network.
[0106] Step 4: In actual application, the real-time collected bus power data and the corresponding period of key meteorological factor data screened out in step 2 are merged into a multi-dimensional feature vector input to the trained model, and multiple accurate flexible resource individual power data are obtained.
[0107] Embodiment 2
[0108] Referring to Tables 1, 2, 3, 4 and 5, for the second embodiment of the present application, on the basis of Embodiment 1, in order to verify its beneficial effects, the experimental effect is explained.
[0109] Preferably, in order to further illustrate the effectiveness of the application, this embodiment integrates the two public data sets of AMPds2 and UK-dale, photovoltaic simulation data and meteorological data, constructs an experimental data set and tests it. For simplicity of description, the households in the AMPds2 data set are marked as A1, and households 1, 2 and 5 in the UK-dale data set are marked as U1, U2 and U5, respectively. The heat pump, washing machine, clothes dryer and dishwasher in household A1, and the washing and drying integrated machine and dishwasher in households U1, U2 and U5 are selected as experimental appliances. In order to unify the washing and drying integrated machine in the UK-dale data, the power data of the washing machine and clothes dryer in the AMPds2 data set are added and combined, and are simply referred to as washing machine.
[0110] The photovoltaic power data in this embodiment is derived from a photovoltaic geographic information system. The photovoltaic system installation site is set in the central area of the corresponding household in the simulation, and the simulation parameters are shown in Table 1. The meteorological data is derived from a historical weather database, and the data of household A1 is from the Environment and Climate Change Canada (ECCC), and the data of households U1, U2 and U3 is from VisualCrossing. Meteorological factors include temperature, dew point temperature, humidity, solar radiation, solar elevation angle, etc.
[0111] Table 1 Photovoltaic simulation parameters
[0112]
[0113]
[0114] Then, the original data is processed, and the abnormal data such as negative power data and temperature exceeding the threshold value are regarded as missing data, and the forward filling method is used to ensure the continuity of the time series. In order to unify the time scale, the power data, meteorological data and photovoltaic power data in the UK-dale data set are resampled to 1 minute resolution and aligned on the time axis. The photovoltaic power in the data set of this embodiment is negative, and the absolute value is equal to the photovoltaic power value. The bus data of each household in this embodiment is obtained by adding the bus power and photovoltaic power of the corresponding household in the public data set.
[0115] Table 2 Correlation indicators of meteorological factors and appliance usage habits of household A1
[0116]
[0117] Further, in terms of screening key meteorological factors, in this embodiment, firstly, the use probability distribution of each electrical appliance in family A1 and family U1 is obtained by using kernel density estimation, and then the MIC and Spearman correlation coefficient between the electrical appliances of the two families and the meteorological factors such as temperature, dew point temperature, humidity, solar radiation, solar elevation angle, etc. are calculated. The calculation results are shown in Table 2 and Table 3.
[0118] Table 3 Correlation index of meteorological factors and electrical appliance use habits of family U1
[0119]
[0120] The number of absolute values of each correlation index in Table 2 and Table 3 greater than 0.5 is counted, and the result is shown in Table 4.
[0121] Table 4 Statistics of meteorological characteristics and adjustable resource correlation indexes
[0122]
[0123] From the above, it can be found that the correlation degree between temperature, solar radiation, solar elevation angle and photovoltaic power generation and electrical appliance use is relatively large. In addition, the MIC and Spearman correlation coefficient between solar radiation and solar elevation angle are 0.9999 and 0.9660 respectively, and the correlation degree of the two is very high, and the change trend is basically the same. Therefore, considering the correlation degree between exogenous meteorological characteristics and each adjustable resource, and in order to reduce the influence of redundant feature information on the performance of the model, temperature and solar radiation are selected as input features of the model together with bus power data.
[0124] Further, in terms of testing the accuracy performance, for family A1, the data of the whole year of 2013 is selected for training (the proportion of training set and validation set is 9:1), and the data from January 1, 2014 to March 31, 2014 is selected for testing. For families U1, U2 and U3, the data from November 2012 to November 2014, February 2013 to October 2013 and June 2014 to November 2014 respectively are selected, among which the first 80% of the data from each family is used for training (the proportion of training set and validation set is 9:1), and the last 20% of the data is used for testing. In this embodiment, the models SGN-Conv, MTL-S2P, MAT-Conv with excellent monitoring performance in existing research and the proposed model Ours are compared.
[0125] Further, in terms of test indicators, the mean absolute error (MAE), signal aggregate error (SAE), and F1 score (denoted as F1) are selected as evaluation indicators. The calculation formulas are as follows.
[0126]
[0127] wherein N represents the number of samples; y c and y v represent the true value; and represent the predicted value; M represents the batch number of data set division; period represents the size of time steps in each batch; Precision is the accuracy, Recall is the recall rate, TP is the true positive, FP is the false positive, and FN is the false negative.
[0128] Further, Table 5 shows the monitoring performance of the proposed model on the household flexible resources. The experimental results show that the proposed model achieves the best performance in all household monitoring tasks. In particular, in the heat pump monitoring task of household A1, the proposed model reduces the MAE and SAE by 34.39% and 24.69%, respectively, compared with the second-best MAT-Conv model, significantly improving the monitoring accuracy. In addition, in the photovoltaic monitoring tasks of households U1, U2, and U5, the model also achieves significant advantages compared with the SGN-Conv model, with the MAE, SAE, and F1-score improved by 48.53%, 59.20%, and 6.43%, respectively, verifying the effectiveness and stability of the proposed model.
[0129] Table 5 Monitoring accuracy performance test results
[0130]
[0131] The above embodiments are the preferred embodiments of the present application, but the embodiments of the present application are not limited by the above embodiments, and any changes, modifications, substitutions, combinations, simplifications made without departing from the spirit and principles of the present application should be equivalent replacement methods, and are all included in the protection scope of the present application.
Claims
1. A method for joint monitoring of home flexibility resources considering meteorological factors, characterized in that, The method comprises the following steps: 1) Collecting bus power data in a real household power scene, individual power data of each flexible resource, and candidate meteorological factor data of the corresponding period, and preprocessing to obtain clean data; 2) According to the clean data preprocessed in step 1), the correlation coefficient between the operation of the household flexible resource and the candidate meteorological factor is calculated, and according to the calculation result, the key meteorological factor data which has a great influence on the operation of the flexible resource is screened out, and is combined with the bus power data in step 1) into a multi-dimensional feature vector as the input of the subsequent model; 3) Based on the multi-task learning idea, a Transformer encoder and a time series convolutional neural network are introduced to construct a household flexible resource joint monitoring model, the multi-dimensional feature vector constructed in step 2) is taken as the input, and the individual power data preprocessed in step 1) is taken as the label, and the model is trained to obtain the trained model; The multi-task learning idea refers to learning multiple related tasks simultaneously using a single model, which has the advantages of utilizing the correlation between tasks, improving the overall performance of the model, and reducing the complexity of the model; the household flexible resource joint monitoring model is composed of a shared feature extraction module, a gating network and a tower network, and its working principle is as follows: first, the shared feature extraction module extracts relevant feature information across monitoring tasks; then, the gating network reasonably distributes the extracted relevant feature information to the parallel tower network to generate monitoring results of different flexible resources; The shared feature extraction module is composed of multiple expert networks, which learn the correlation information across monitoring tasks from different angles; first, the input vector of the model is composed of bus power data and meteorological factor data; then, the expert network is composed of a one-dimensional convolutional neural network and multiple Transformer encoders, wherein the one-dimensional convolutional neural network adopts a 1*1 convolution kernel for point-by-point convolution to better represent the time series input, and then the Transformer encoder is composed of a multi-head attention mechanism, a residual connection and a feedforward neural network to explore the potential correlation and global shared information between multiple tasks; 4) In actual application, the real-time collected bus power data and the key meteorological factor data screened out in step 2) of the corresponding period are combined into a multi-dimensional feature vector and input into the trained model to obtain multiple accurate individual power data of the flexible resource. 2.The method of claim 1, wherein, In step 1), the flexible resource refers to household adjustable electrical appliances and distributed power generation equipment that users can adjust their operation behavior according to the actual demand of the power grid, the household adjustable electrical appliances include temperature control load and translatable load, the temperature control load includes heat pump and air conditioner, the translatable load includes washing machine and dishwasher; the distributed power generation equipment includes roof photovoltaic and micro wind turbine; the bus power data refers to the power data at the entrance of the household user electric meter; the individual power data of each flexible resource refers to the power data when each flexible resource operates alone; both of the above two kinds of power data are collected by the smart metering terminal, the sampling period is T sample , the sampling duration is T, the smart metering terminal includes a smart meter; the candidate weather data refers to the weather data of the corresponding time obtained from the weather station at the location of the household. The preprocessing includes outlier detection and normalization processing; the calculation formula of the outlier detection criterion abn is as follows: abn = I (z λ+1 -z λ |>thed), λ = 1, 2,..., w In the formula, I(·) is an indicator function, which returns 1 if the condition in the parentheses is met, and otherwise returns 0; w is the number of sampling points; z λ+1 and z λ respectively represent the (λ+1)th and the λth power sampling points in a single piece of fragment data. Theed represents the threshold value of the absolute difference value of adjacent power sampling points; abn is the outlier detection criterion, if abn is equal to 1, it is determined that there is an outlier, the segment data is deleted, and the segment data is supplemented by the interpolation method, if abn is equal to 0, it is indicated that there is no outlier, and the segment data is retained; The normalization processing refers to the Z-score method for standardization, which calculates the standardized sample data by calculating the sample and its mean and variance, and the specific formula is as follows: In the formula, X and X norm respectively represent the sample data before and after standardization; μ represents the sample mean; and σ represents the sample variance. 3.The method of claim 2, wherein, In step 2), the correlation coefficient is used to quantitatively characterize the degree of association between the operation of the household flexible resources and the meteorological factors, and the selected correlation coefficients include the maximum information coefficient MIC and the Spearman correlation coefficient; MIC is a non-parametric method for measuring the linear and nonlinear relationship between two variables, the core idea is to find the variable partitioning that can maximize the information to reveal the maximum correlation between two variables, it has high sensitivity for mining the potential association between variables, and is suitable for discovering various types of relationships between variables, including linear and nonlinear relationships, its value ranges from 0 to 1, where 0 represents no relationship, 1 represents complete correlation, and greater than 0.5 indicates a strong correlation between two variables, and its calculation formula is as follows: In the formula, B represents the 0.6 power of the data volume; a and b represent the division of a two-dimensional space composed of variables m and n into a rows and b columns; p(m,n) represents the joint probability function of variables m and n; p(m) and p(n) represent the boundary probability density functions of variables m and n; Spearman is used to measure the rank correlation between two variables, and its calculation is based on the ordering and ranking of variable observations, and it is suitable for evaluating the monotonic relationship between two variables, especially when there is an order relationship between variables but the specific function form is unknown or complex, its value ranges from -1 to 1, where 1 indicates that the two variables are completely monotonically positively correlated, 0 indicates that there is no monotonic relationship between the two variables, and -1 indicates that the two variables are completely monotonically positively correlated, and an absolute value greater than 0.5 indicates a strong correlation between the two variables, and its calculation formula is as follows: In the formula, d' represents the difference between the rank of two variables after ordering; N represents the number of samples; The specific process of the correlation coefficient calculation is as follows: First, based on the clean data after preprocessing in step 1), the number of times each appliance in the household is turned on every hour every day during the sampling period is counted, and then the usage probability curve of each appliance every hour in a day is fitted using kernel density estimation; Second, MIC and Spearman are used to calculate the correlation coefficient between each candidate meteorological factor and the usage probability curve of all flexible resources, and the calculation results are recorded, in this way, not only the nonlinear relationship between the operation mode of the appliance can be captured, but also the potential impact of meteorological factors on flexible resources can be effectively measured, thereby providing a reliable basis for subsequent model input; Then, based on the calculated correlation coefficients, each candidate meteorological factor is screened: the number of correlation coefficients between each candidate meteorological factor and all flexible resources whose absolute value exceeds a predetermined threshold is counted, which reflects the degree of association between the candidate meteorological factor and multiple flexible resources, and the greater the number, the higher the degree of association between the candidate meteorological factor and multiple flexible resources; Next, the candidate meteorological factors are sorted in descending order of correlation with flexible resources, and meteorological factors with low correlation with flexible resources are filtered out, and those with high correlation in multiple target resources are retained as key meteorological factors; Finally, the selected key meteorological factor data is merged with the total bus power data obtained in step 1) to form a multi-dimensional input vector, providing high-quality input data for subsequent model training. This allows the model to better capture the dynamic characteristics of flexible resources and external influences, thereby improving the accuracy and robustness of monitoring.
4. The method of claim 3, wherein the method further comprises: In step 3), the multi-head attention mechanism enables the model to capture multiple complex correlations simultaneously, as shown in the following formula: MH(Q,K,V) = Concat(head1, head2,..., head u ,...,head h )W O In the formula, Q, K, and V represent queries, keys, and values, respectively; Attention(Q, K, V) represents the calculation formula of the dot product attention score; and Softmax represents the activation function. d represents the scaling factor. head u denotes the u-th dot-product attention score; denotes the weight matrices for Q, K, V respectively; Concat denotes the concatenation operation; W O denotes the output weight matrix; MH(Q, K, V) denotes the output of multi-head attention. Each Transformer encoder layer contains a feedforward neural network that performs nonlinear transformation and mapping of features at each position in the sequence; the feedforward neural network consists of two fully connected layers with an activation function in between for nonlinear transformation. This design allows the model to better capture local features at each position in the sequence and enhances the model's representation ability, as shown in the following formula: y linear = Linear2(ReLU(Linear1(MH(Q, K, V)))) where y linear and MH(Q, K, V) represent the output and input of the feedforward neural network, respectively; Linear1(·) and Linear2(·) represent two fully connected layers, respectively; and ReLU(·) represents an activation function. In the Transformer encoder, the multi-head attention mechanism and the feedforward neural network are followed by a residual connection and layer normalization operation; the residual connection is used to pass the input directly to the output of the multi-head attention mechanism and the feedforward neural network, thereby alleviating the gradient vanishing problem when training deep models; layer normalization is used to normalize the output of the multi-head attention mechanism and the feedforward neural network, which helps to speed up the training process of the model; to achieve adaptive weighting of all expert network output features for each flexible resource monitoring task, a gating network is introduced into the model, which consists of a fully connected layer and a softmax activation function. It can learn the weighting coefficients of the output of each expert network based on the characteristics of the input data; the output of the gating network is represented by the following formula: where x is the input of the model; is the weight coefficient matrix of the ith expert network for the kth sub-task; softmax represents the activation function, W ki is the transformation matrix of the ith expert network for the kth sub-task in the gating network; n expert is the number of expert networks in the model; k is the number of the appliance power decomposition task; f i (x) is the output of the ith expert network; G k (x) is the output of the n expert expert networks for the kth task, that is, the input of the corresponding task tower network. The tower network provides a dedicated branch for each resource monitoring task, allowing it to capture personalized distribution features related to specific tasks from shared features; the tower network consists of a temporal convolutional neural network (TCN), a one-dimensional convolutional neural network, and a fully connected layer. First, the TCN extracts medium- and long-term dependencies from shared features by using causal convolution and dilated convolution, which can expand the receptive field and enable the model to focus on a wider range of historical information, thereby more effectively extracting temporal patterns in power data. This design allows the model to better handle the diverse characteristics of different flexible resources and monitor them according to their specific needs, as shown in the following formula: where H κ′ (t) is the time series of the k'th layer, h(·) is the activation function, * is the convolution operation, ω κ′,i is the weight of the i'th convolution kernel of the k'th layer, is the width of the convolution kernel, and indicates that the input of the k'th layer is obtained by convolving the output of the k-1'th layer at different time steps; D is the dilation factor, indicating the number of steps across time steps; H κ′-1 (t-D x i) is the value of the k-1'th layer time series at different time steps; Then, the one-dimensional convolutional neural network is used to capture fine-grained temporal changes, enhancing the model's ability to focus on specific patterns within a short time window; finally, quantile regression is applied in the fully connected layer to obtain the final monitoring results, where quantile regression can comprehensively describe the conditional distribution of different quantiles and effectively capture the diverse distribution caused by subtle changes in appliance usage patterns and photovoltaic output fluctuations in complex power data. In addition, by outputting multiple quantile values, the model can reveal potential uncertainty in the flexibility resource changes, providing data support for developing refined demand response strategies; the output of the tower network is defined as follows: where h k (·) is the kth tower network; is the jth quantized value τ j corresponding predicted value.
Citation Information
Patent Citations
Abnormality detection and root cause analysis method and system for industrial time series data
CN116611013A
Wind-light-load power short-term prediction method based on multi-task progressive learning
CN117421971A