Power consumption portrait construction method and system based on dynamic bayesian network
By reducing latent variables of electricity consumption preferences using dynamic Bayesian networks and autoencoder models, and updating the electricity consumption profile template using the structural EM algorithm, the problems of inability to intuitively depict electricity consumption patterns and high computational overhead in existing technologies are solved, thus achieving efficient and interpretable electricity consumption profile construction.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- YUNNAN UNIV
- Filing Date
- 2026-01-04
- Publication Date
- 2026-06-05
Smart Images

Figure CN122153270A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of probabilistic graphical model technology, and in particular to a method and system for constructing electricity consumption profiles based on dynamic Bayesian networks. Background Technology
[0002] Driven by the construction of new power systems and other factors, the refined management and intelligent decision-making of electricity consumption behavior face higher standards. Electricity consumption profiling technology refers to learning the dynamic relationship between user attributes and their electricity consumption patterns from time-series electricity consumption data containing multiple time slices. This quantitatively characterizes the electricity consumption patterns implied by these relationships, and has significant research and practical value for promoting tasks such as intelligent power distribution management, power load forecasting, and root cause analysis of carbon emission exceedances.
[0003] Currently, common methods involve using clustering and neural networks to discover users' electricity consumption patterns. Chinese patent publication number CN202510124769.2 discloses an AI-powered intelligent electricity consumption prediction method based on electricity consumption behavior profiling. This method categorizes users based on electricity consumption data and uses an LSTM model to predict electricity consumption.
[0004] However, on the one hand, the hidden state of LSTM is an abstract high-dimensional vector, which is difficult to interpret intuitively as to what specific interests the vector represents. It often requires manual intervention for debugging and has the defect of poor interpretability. On the other hand, although the existing probabilistic graphical methods have strong interpretability, as the number of latent variables of electricity preference increases, the model needs to perform marginal calculations on all possible combinations of latent variables during inference, and the computational space grows exponentially, resulting in a sharp increase in inference and learning costs. Furthermore, in the process of building and updating the electricity consumption profile, the model also has the problem of repeatedly learning relatively fixed electricity consumption habits, which causes the computational cost to gradually increase.
[0005] In view of this, this application proposes a new method for constructing electricity consumption profiles, aiming to overcome the above-mentioned shortcomings. Summary of the Invention
[0006] The main purpose of this application is to provide a method for constructing electricity consumption profiles based on dynamic Bayesian networks, aiming to solve the problem of how to optimize the construction of electricity consumption profiles.
[0007] To achieve the above objectives, this application provides a method for constructing electricity consumption profiles based on dynamic Bayesian networks, the method comprising: S10, determine the single-time-slice electricity consumption dataset and the adjacent time-slice electricity consumption dataset from the collected time-series electricity consumption dataset; S20, Construct an initial single-time-slice electricity consumption profile, wherein the electricity consumption attribute preferences in the initial single-time-slice electricity consumption profile are described using latent variables; S30, using a vector quantization variational autoencoder model and a Gaussian parameter network, the latent variables in the initial single-time-slice electricity consumption profile are reduced to obtain an optimized single-time-slice electricity consumption profile; S40, learn the intra-time-slice relationship in the optimized single-time-slice electricity consumption profile based on the single-time-slice electricity consumption dataset, and learn the inter-time-slice relationship in the optimized single-time-slice electricity consumption profile based on the adjacent time-slice electricity consumption dataset, to obtain an initial electricity consumption profile template based on dynamic Bayesian network; S50, calculate the parameter variation degree of the adjacent time slice electricity consumption dataset based on the initial electricity consumption profile template, determine the local structure that needs to be updated in the initial electricity consumption profile template according to the magnitude of the parameter variation degree, and update the intra-time slice relationship and inter-time slice relationship of the local structure based on the structure EM algorithm to obtain the target electricity consumption profile.
[0008] Optionally, S10 includes: S11, retrieve the first [user's] [number] from multiple users. Electricity consumption data for each time period , The variables in are ; in, , User attribute variables that do not change over time. For the first Electricity consumption attribute variables for each time slice, For the first The electricity consumption variable for each time slice, and ; S12, will Electricity consumption data for each time slot As independent and identically distributed samples, a single-time-slice electricity consumption dataset is obtained. ; S13. The electricity consumption data of adjacent time slices are concatenated and used as independent and identically distributed samples to obtain the electricity consumption dataset of adjacent time slices. .
[0009] Optionally, S20 includes: S21, Initialize electricity consumption profile ; in, It is a single-time-slice power consumption profile. It is a set of relationships between time segments; S22 uses the implicit variable L of electricity preference and the variable V of electricity attribute to point to the variable Y of applied electricity consumption, denoted as and The structure of the directed acyclic graph is obtained. ; in, For variables in the time-slice electricity consumption data, For a set of latent variables, It is a set of relations; S23, Randomly initialize the parameters of the conditional probability table corresponding to the directed acyclic graph structure G. : In the formula, express The set of parent nodes, for The size of the combinations of values that a middle node can take. express Values and The value is the first The parameters of the conditional probability table corresponding to the combination; S24, based on the directed acyclic graph structure G and the parameters of the conditional probability table. The initial single-time-slice power consumption profile was obtained. .
[0010] Optionally, S30 includes: S31, using a vector quantization variational autoencoder model, reduces the r latent variables in a single-time-slice electricity consumption profile to... One hidden variable; S32, based on the Gaussian parameter network model, the conditional probability table parameters corresponding to the latent variables are transformed into the vector quantization variational autoencoder model, so that the conditional probability table parameters before reduction are used as constraints for the latent variable reduction process.
[0011] Optionally, the vector quantization variational autoencoder model includes an encoder network. Vector table and decoder network h, where, For discrete feature vectors, S31 includes: S311, Randomly sample the single-time-slice electricity consumption dataset using the single-time-slice electricity consumption profile. Mid-time slice power consumption data The corresponding latent variable values of electricity consumption preferences are used to obtain the complete electricity consumption dataset. ; In the formula, L is the set of latent variables. Represents the possible values of the set of latent variables; S312, Input encoder network ,get Low-dimensional feature representation after dimensionality reduction : S313, calculate respectively In Each feature vector, and the vector table middle The Euclidean distance between vectors, Each of the features is represented by a vector. Select the nearest vector to obtain Corresponding low-dimensional discrete features : In the formula, , , , The Euclidean distance function is: In the formula, and respectively, feature vectors and The One element; S314, low-dimensional discrete features Input to the decoder network In this process, we obtain the reduced set of latent variables. Value : In the formula, the loss function is used. Reduce the set of latent variables Error: In the formula, For the gradient termination operator, during backpropagation, The vectors in the vectors are treated as constants; ( )and ( ) represents the weighting coefficient.
[0012] Optionally, S32 includes: S321, Minimize the Euclidean distance between the CPT parameters before and after reduction. Let the latent variable conditional distribution after joint probability decomposition be... and Following a uniform distribution, the reduction results of the conditional probability table parameters under the constraint of consistent electricity consumption distribution are obtained. : In the formula, and Let represent the combined magnitudes of the latent variable values before and after reduction, and Z represent the latent variable of electricity preference after reduction. Indicates the specific value of the hidden variable. The first variable representing the electricity consumption attribute variable Each possible value Potential represents the electrical property variable; S322, subnetworks of the Gaussian parametric network model and These are used to discretely encode the latent variables. Transform into The mean of the corresponding multiple independent Gaussian distributions and variance , recorded as and ; In the formula, express yes The Seek values; S323, using the log-likelihood function as the reduction result under Gaussian distribution conditions. objective function : in, S324, the objective function As a loss function Regularization terms are used to construct an objective function for latent variable reduction. : S325, Minimize the objective function using gradient descent. We obtain the reduced latent variables of electricity preference under the constraint of consistent distribution of electricity consumption patterns. and the reduced electricity consumption attribute variables A new directed acyclic graph structure for single-time-slice power consumption is obtained. ,in, ; S326, according to Randomly initialize the parameters of the conditional probability table The optimized single-time-slice power consumption profile after reduction is obtained. .
[0013] Optionally, the steps in S40 include: S41, optimizing the power consumption profile for a single time slice. The new single-time-slice power consumption profile is a directed acyclic graph structure. Starting from this point, randomly add elements that exist in the relation set. The relationship between them yields a set of candidate structures. Bayesian information criterion is used as an arbitrary candidate structure. rating : In the formula, for The number of nodes, for The number of independent probability parameters in the corresponding conditional probability table. The weighting coefficient for the penalty term. This is a penalty term for the complexity of the probability parameter, used to limit the number of new relations. This is a weighted electricity consumption dataset; in, ; In the formula, For single-time-slice power consumption datasets In each data sample, z is a reduced latent variable. The value of , It is the conditional probability corresponding to each complete sample; S42, the maximum score among all candidate structures is taken as the optimal structure for the single-time-slice power consumption profile. If the optimal structure The score is greater than the current structure The rating value will then be The parameters of the corresponding conditional probability table serve as the current single-time-slice electricity consumption profile for the next round of learning. Otherwise, end the learning process and create a power consumption profile for the current single time slice. As a learning outcome.
[0014] Optionally, in step S40, the step of learning the inter-time-slice relationships in the optimized single-time-slice electricity consumption profile based on the adjacent time-slice electricity consumption dataset includes: S43 will optimize the power consumption profile for a single time slice. Copy and use and Different time slices were distinguished to obtain Optimization of power consumption profile for a single time slice and Optimization of power consumption profile for a single time slice ; S44, using the learning steps in S41 and S42, according to... and Electricity consumption datasets in adjacent time slices Iteratively generate the set of all possible relationships that satisfy the time slices. Determine the optimal inter-time slice relationship based on the time slice relationships. Obtain the electricity consumption profile template .
[0015] Optionally, S50 includes: S51. Calculate the adjacent time-slice electricity consumption dataset based on the initial electricity consumption profile template. Degree of parametric variation of parameters in a conditional probability table : In the formula, express The Middle The variables take values of And the parent node's value is the first The parameters of the conditional probability table corresponding to the various combinations. Indicates The obtained conditional probability table parameters, express The number of parameters; S52, Set the parameter variability threshold , will satisfy variables Insertion sequence In the middle, then sequentially from Extracting variables from Add it to the set of sub-images of the electricity consumption profile template to be updated. In the middle, traverse again All neighbor variables If satisfied and Then judge It is a latent variable of electricity preference and yes The parent node; if it satisfies and That is, to judge For electricity preference latent variables and yes The parent node; the neighbor variables in these two cases Insertion queue At the same time, with Adding connected relationships ; Repeat the dequeue operation until... If empty, obtain the set of sub-images of the electricity consumption profile template that need to be updated. ; S53, based on the intra-time slice relationship learning method and inter-time slice relationship learning method in S40, processes the electricity consumption profile template subgraph set. Each electricity consumption profile template sub-image in the [text] The update is performed to obtain the updated local electricity consumption profile. ; S54, As the first A time-segment profile of electricity consumption, As the first Electricity consumption profile for each time slot and the first The dynamic relationship between electricity consumption profiles over time slices, and spliced to the already constructed first The time slice to the first Electricity consumption profile for a specific time period In the middle, we obtained the first The time slice to the first Electricity consumption profile for a specific time period ; S55, after updating the electricity consumption profile templates for all time slices, stitches together the data to obtain the first to the last data slices. Electricity consumption profile for a specific time period This yields the final target electricity consumption profile.
[0016] In addition, to achieve the above objectives, this application also provides a computer system, the computer system comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the computer program is executed by the processor, it implements the steps of the electricity consumption profile construction method based on dynamic Bayesian networks as described in any of the preceding claims.
[0017] This application has at least the following beneficial effects: 1. To address the issue that existing electricity consumption profiling methods cannot intuitively depict the influencing factors of electricity consumption patterns, multiple latent variables are introduced to describe users' preferences for various electricity consumption attributes. A DBN-based electricity consumption profile is constructed to provide an intuitive and reasonable explanation of the influencing factors of electricity consumption patterns, thereby improving the interpretability of electricity consumption profile modeling and meeting the actual requirements of power reliability management. 2. To address the issue that the computational space grows exponentially due to the need to marginalize all possible combinations of latent variables during model inference, leading to a sharp increase in inference and learning costs, the VQVAE and GPN models are introduced to reduce the latent variables of electricity consumption preferences. This significantly reduces the cost of building the electricity consumption profile while ensuring that the reduction does not change the original distribution of electricity consumption patterns and that the constructed electricity consumption profile accurately depicts the dynamic relationships between variables. 3. To address the computational overhead caused by repeatedly learning relatively fixed electricity consumption habits during the construction and subsequent updating of electricity consumption profiles, an electricity consumption profile template is constructed to uniformly learn the relatively fixed relationships within and between all time slices. Then, the relevant local structures in the template are updated by combining the electricity consumption data of adjacent time slices to capture the dynamic relationships that exist within and between time slices, thereby achieving efficient construction of electricity consumption profiles. Attached Figure Description
[0018] Figure 1 This is a flowchart illustrating the method for constructing electricity consumption profiles based on dynamic Bayesian networks, as described in an embodiment of this application. Figure 2 This is a schematic diagram of the initialization of the single-time-slice power consumption profile according to an embodiment of this application; Figure 3 This is a schematic diagram illustrating the reduction of latent variables related to electricity preference in the embodiments of this application; Figure 4 This is a schematic diagram illustrating the intra-slice relationship learning of electricity consumption profiles in an embodiment of this application; Figure 5 This is a schematic diagram illustrating the learning of the inter-segment relationship of electricity consumption profiles in an embodiment of this application; Figure 6 This is a schematic diagram illustrating the updating of the electricity consumption profile template involved in the embodiments of this application.
[0019] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0020] To better understand the above technical solutions, exemplary embodiments of this disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of this disclosure are shown in the drawings, it should be understood that this disclosure can be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of this disclosure to those skilled in the art.
[0021] First Embodiment Reference Figure 1 This embodiment provides a method for constructing electricity consumption profiles based on dynamic Bayesian networks. The method includes the following steps: S10, determine the single-time-slice electricity consumption dataset and the adjacent time-slice electricity consumption dataset from the collected time-series electricity consumption dataset; In this embodiment, considering that the same relationships usually exist in the structure of electricity consumption profiles in different time slices, in order to avoid repeatedly learning these relationships within and between time slices, this embodiment constructs single-time-slice electricity consumption data and adjacent time-slice electricity consumption data from time-series electricity consumption data, providing the data required for calculation for the construction and updating of electricity consumption profile templates.
[0022] S20, Construct an initial single-time-slice electricity consumption profile, wherein the electricity consumption attribute preferences in the initial single-time-slice electricity consumption profile are described using latent variables; Furthermore, a set of latent variables is introduced to describe the degree of user preference for electricity consumption attributes, so as to intuitively characterize the influencing factors of electricity consumption patterns; based on domain expert knowledge, initial relationships are set between electricity consumption attributes, latent variables of electricity consumption preferences, and electricity consumption to construct an initialized single-time-slice electricity consumption profile.
[0023] S30, using a vector quantization variational autoencoder model and a Gaussian parameter network, the latent variables in the initial single-time-slice electricity consumption profile are reduced to obtain an optimized single-time-slice electricity consumption profile; Furthermore, in this embodiment, a Vector Quantized Variational Autoencoder (VQVAE) model and a Gaussian Parameter Network (GPN) are used to reduce the latent variables of the single-time-slice electricity consumption profile. This improves the efficiency of electricity consumption profile construction while ensuring that the distribution of electricity consumption patterns is consistent before and after the reduction.
[0024] S40, learn the intra-time-slice relationship in the optimized single-time-slice electricity consumption profile based on the single-time-slice electricity consumption dataset, and learn the inter-time-slice relationship in the optimized single-time-slice electricity consumption profile based on the adjacent time-slice electricity consumption dataset, to obtain an initial electricity consumption profile template based on dynamic Bayesian network; Furthermore, the single-time-slice electricity consumption profile in step S20 is updated based on the reduction results obtained in S30; starting from the single-time-slice electricity consumption data and adjacent time-slice electricity consumption data in step S10, the Structural EM (Structural Expectation-Maximization, Structural EM) algorithm is used to perform latent variable interpolation, structure learning and parameter learning, and obtain an electricity consumption profile template based on Dynamic Bayesian Network (DBN).
[0025] To quantitatively characterize the time-invariant relationships among user attributes, electricity consumption attributes, electricity preference latent variables, and electricity consumption, this invention uses the dataset from step S10. and Image of electricity consumption in a single time slice after reduction Conduct relationship learning to build electricity consumption profile templates ,in, and Depend on Learn and gain Used to describe the relatively fixed electricity consumption habits of users across all time periods.
[0026] S50, calculate the parameter variation degree of the adjacent time slice electricity consumption dataset based on the initial electricity consumption profile template, determine the local structure that needs to be updated in the initial electricity consumption profile template according to the magnitude of the parameter variation degree, and update the intra-time slice relationship and inter-time slice relationship of the local structure based on the structure EM algorithm to obtain the target electricity consumption profile.
[0027] Finally, the parameter variation degree of the electricity consumption profile template in step S40 with respect to the electricity consumption data of adjacent time slices in step S10 is calculated to measure the degree of fit of the electricity consumption profile template to the time-series electricity consumption data; the local structure that needs to be updated is determined based on the parameter variation degree, and the SEM algorithm is used to efficiently update the relationship between time slices and time slices in the local structure to obtain the final electricity consumption profile.
[0028] In the technical solution provided in this embodiment, on the one hand, to address the problem that existing electricity consumption profile construction methods cannot intuitively depict the influencing factors of electricity consumption patterns, multiple latent variables are introduced to describe the user's preference for each electricity consumption attribute, and a DBN-based electricity consumption profile is constructed to provide an intuitive and reasonable explanation of the influencing factors of electricity consumption patterns, thereby improving the interpretability of electricity consumption profile modeling and meeting the actual requirements of power reliability management. Secondly, to address the issue that the construction time of electricity consumption profiles increases exponentially with the number of latent variables related to electricity consumption preferences, the VQVAE and GPN models are introduced to reduce the latent variables of electricity consumption preferences. This significantly reduces the construction cost of electricity consumption profiles while ensuring that the reduction does not change the original distribution of electricity consumption patterns and that the constructed electricity consumption profile accurately depicts the dynamic relationships between variables. Thirdly, to address the computational overhead caused by repeatedly learning relatively fixed electricity consumption habits during the construction and subsequent updates of electricity consumption profiles, an electricity consumption profile template is constructed to uniformly learn the relatively fixed relationships within and between all time slices. Then, the relevant local structures in the template are updated by combining the electricity consumption data of adjacent time slices to capture the dynamic relationships existing within and between time slices, thereby achieving efficient construction of electricity consumption profiles.
[0029] Second Embodiment Based on the first embodiment, in this embodiment, step S10 includes: S11, retrieve the first [user's] [number] from multiple users. Electricity consumption data for each time period , The variables in are ; in, , User attribute variables that do not change over time. For the first Electricity consumption attribute variables for each time slice, For the first The electricity consumption variable for each time slice, and ; S12, will Electricity consumption data for each time slot As independent and identically distributed samples, a single-time-slice electricity consumption dataset is obtained. ; S13. The electricity consumption data of adjacent time slices are concatenated and used as independent and identically distributed samples to obtain the electricity consumption dataset of adjacent time slices. .
[0030] In this embodiment, the power monitoring equipment acquires the first data from multiple users. Electricity consumption data for each time slice is represented as follows: , The variable is .in, , User attribute variables such as type and region that do not change over time. For the first Electricity consumption attribute variables such as electricity price and day / night conditions for each time slice. For the first The electricity consumption variable for each time slice, and For ease of description, time will not be specified. The user attributes, electricity consumption attribute set, and electricity consumption are respectively , , .Will , , Discretization is performed to make The range is the set of discrete values. ,in, express The momentum.
[0031] The steps for constructing single-time-slice power consumption data and adjacent-time-slice power consumption data are as follows: First, ... The electricity consumption data of each time slice is used as independent and identically distributed samples to obtain a single time slice electricity consumption dataset. This is used to learn relationships in single-time-slice electricity consumption profiles. Then, the electricity consumption data from adjacent time slices are concatenated and treated as independent and identically distributed samples to obtain an adjacent-time-slice electricity consumption dataset. This is used to learn the relationships between time slices in the electricity consumption profile template. Simultaneously, the electricity consumption data from each adjacent time slice... Used to update the electricity consumption profile template.
[0032] Third Embodiment Based on any of the above embodiments, in this embodiment, S20 includes: S21, Initialize electricity consumption profile ; in, It is a single-time-slice power consumption profile. It is a set of relationships between time segments; S22 uses the implicit variable L of electricity preference and the variable V of electricity attribute to point to the variable Y of applied electricity consumption, denoted as and The structure of the directed acyclic graph is obtained. ; in, For variables in the time-slice electricity consumption data, For a set of latent variables, It is a set of relations; S23, Randomly initialize the parameters of the conditional probability table corresponding to the directed acyclic graph structure G. : In the formula, express The set of parent nodes, for The size of the combinations of values that a middle node can take. express Values and The value is the first The parameters of the conditional probability table corresponding to the combination; S24, based on the directed acyclic graph structure G and the parameters of the conditional probability table. The initial single-time-slice power consumption profile was obtained. .
[0033] In this embodiment, to provide a reasonable and intuitive explanation of the factors influencing electricity consumption patterns—for example, the concentrated electricity consumption behavior of manufacturing users under specific electricity consumption attributes such as low electricity prices and weekdays—reflects electricity users' preferences for electricity consumption attributes, a set of latent variables is introduced. To describe the user's middle The degree of preference for individual electricity usage attributes Indicates no time is specified. The set of latent variables, where latent variables Value range and electricity usage attributes The value ranges correspond one-to-one.
[0034] The electricity consumption profile constructed in this embodiment is represented as follows: ,in, It is a single-time-slice power consumption profile. It is a set of relationships between time slices. Since electricity consumption behavior has both characteristics that change over time and includes relatively fixed electricity consumption habits, to avoid repetitive learning of electricity consumption habits when constructing an electricity consumption profile, this invention first... and To initialize a single time-slice power consumption profile This is used to quantitatively characterize the time-invariant relationships among user attributes, electricity consumption attributes, latent variables of electricity consumption preferences, and electricity consumption. It is a Directed Acyclic Graph (DAG) structure. , , It is a set of relations.
[0035] , represents the set of CPT parameters that constitute the power consumption profile of a single time slice. express The CPT parameter set, express The set of parent nodes, for The size of the combinations of values that a middle node can take. express Values and The value is the first The Conditional Probability Table (CPT) parameters corresponding to the various combinations.
[0036] To ensure the accuracy of the electricity consumption profile in fitting time-series electricity consumption data, it is necessary to pre-define the relationship between latent and explicit variables of electricity consumption preferences to guarantee the convergence of the electricity consumption profile construction process. Simultaneously, to accurately characterize the relationships between electricity consumption attributes, it is also necessary to define explicit relationships within the electricity consumption profile based on domain expert knowledge. Therefore, the following steps are used to initialize the relationships between latent variables of electricity consumption preferences, electricity consumption attributes, and electricity consumption in a single-time-slice electricity consumption profile: (1) Electricity consumption preferences influence the values of electricity consumption attributes. For example, users in the environmental protection industry tend to use wind or solar power. Therefore, the initialized single-time-slice electricity consumption profile contains edges from the latent variable of electricity consumption preferences to the applied electricity attribute variable, denoted as .
[0037] (2) Whether electricity consumption preferences and electricity consumption attributes are consistent will affect electricity consumption. For example, manufacturing industry users prefer low electricity prices and specific electricity consumption attributes such as weekdays. When electricity consumption preferences and electricity consumption attributes are consistent, concentrated electricity consumption behavior will occur. Therefore, the initialized single-time-slice electricity consumption profile has edges pointing from the latent variables of electricity consumption preferences and electricity consumption attributes to the electricity consumption variables, denoted as... and .
[0038] After initializing the power consumption profile for a single time slice, the structure is obtained. Random initialization Corresponding CPT parameters The initial single-time-slice power consumption profile was obtained. .
[0039] Fourth embodiment Based on any of the above embodiments, in this embodiment, S30 includes: S31, using a vector quantization variational autoencoder model, reduces the r latent variables in a single-time-slice electricity consumption profile to... One hidden variable; To avoid the exponential increase in the construction time of DBN-based electricity consumption profiles with the increase of the number of latent variables of electricity consumption preferences, this invention introduces the VQVAE model to integrate the electricity consumption profiles in a single time slice. The number of latent variables is reduced to approximately [number]. One hidden variable, which is about to Encoded as a reduced set of latent variables of electricity preference This reduces the combined size of latent variables related to electricity preference. The VQVAE model includes an encoder network. Vector table and decoder network h, where, It is a discrete eigenvector. The reduction steps for the latent variable of electricity preference are as follows: (1) Generation of complete electricity consumption data. Given a single time-slice electricity consumption dataset. and single-time slice power portrait ,according to Random sampling The corresponding latent variable values of electricity consumption preferences are used to obtain the complete electricity consumption dataset. .
[0040] (2) Latent variable embedding of electricity consumption preferences. For complete electricity consumption data samples ,Will Input encoder network ,get Low-dimensional feature representation after dimensionality reduction : (1) Next, calculate separately In eigenvectors and middle The Euclidean distance between vectors, Each of the features is represented by a vector. Select the nearest vector to obtain Corresponding low-dimensional discrete features : (2) in, , , , The Euclidean distance function is: (3) in, and respectively, feature vectors and The Each element.
[0041] (3) Reconstruction of electricity preference latent variables. To ensure the correctness of the dimensionality reduction of the electricity preference latent variables, that is, the dimensionality reduction encoding can be restored to the original electricity preference latent variables, the latent variables are reconstructed. Input decoder network The reconstructed set of latent variables of electricity preference is obtained. The value of : (4) By reducing the reconstruction error of the latent variables of electricity preference, a loss function for reducing the latent variables of electricity preference based on VQVAE is constructed: (5) in, For the gradient termination operator, during backpropagation, The vectors in the vectors are treated as constants; ( )and ( ) represents the weighting coefficient.
[0042] Summarizing the above steps, S31 specifically includes: S311, Randomly sample the single-time-slice electricity consumption dataset using the single-time-slice electricity consumption profile. Mid-time slice power consumption data The corresponding latent variable values of electricity consumption preferences are used to obtain the complete electricity consumption dataset. ; In the formula, L is the set of latent variables. Represents the possible values of the set of latent variables; S312, Input encoder network ,get Low-dimensional feature representation after dimensionality reduction : S313, calculate respectively In Each feature vector, and the vector table middle The Euclidean distance between vectors, Each of the features is represented by a vector. Select the nearest vector to obtain Corresponding low-dimensional discrete features : In the formula, , , , The Euclidean distance function is: In the formula, and respectively, feature vectors and The One element; S314, low-dimensional discrete features Input to the decoder network In this process, we obtain the reduced set of latent variables. Value : In the formula, the loss function is used. Reduce the set of latent variables Error: In the formula, For the gradient termination operator, during backpropagation, The vectors in the vectors are treated as constants; ( )and ( ) represents the weighting coefficient.
[0043] S32, based on the Gaussian parameter network model, the conditional probability table parameters corresponding to the latent variables are transformed into the vector quantization variational autoencoder model, so that the conditional probability table parameters before reduction are used as constraints for the latent variable reduction process.
[0044] Since dimensionality reduction can lead to information loss, the electricity consumption pattern distribution learned after reducing the latent variables of electricity preference may differ significantly from the actual electricity consumption pattern distribution before reduction. To avoid the inaccurate characterization of the relationship between electricity consumption attributes due to differences in the distribution of electricity consumption patterns, this invention introduces the GPN model to transform the CPT parameters of the latent variables of electricity preference before reduction into the space of the VQVAE model. These CPT parameters are then used as constraints in the reduction process of the latent variables of electricity preference, ensuring consistency in the distribution of electricity consumption patterns before and after reduction.
[0045] Considering that the CPT parameters before and after reduction cannot be completely equal, this invention uses Euclidean distance to evaluate the distance between distributions. By minimizing the Euclidean distance between the CPT parameters before and after reduction, the consistency of electricity consumption patterns is ensured, i.e., minimizing... Joint distribution and The model is decomposed according to the chain rule into the product of the conditional distributions of each node under the condition of its parent node. To simplify the model, we assume the conditional distributions of the latent variables... and Since they are all uniformly distributed over their domain, the reduction result of CPT parameters under the constraint of consistent electricity consumption distribution can be obtained: (6) in, and Let represent the combined size of the latent variable values before and after the reduction, respectively. The first item representing electricity consumption Each possible value It represents the potential of the electricity consumption.
[0046] The GPN model can transform the CPT parameters of formula (6) into the space of the VQVAE model, that is, use the GPN model to... Parameterization is performed on the subnetworks of the GPN model. and These are used to discretely encode the latent variables of electricity consumption preferences. Transform into The mean of the corresponding multiple independent Gaussian distributions and variance , recorded as and .in, express yes The The possible values.
[0047] To quantify the fit between the Gaussian distribution and the CPT parameters of the GPN model, this invention defines the log-likelihood function of the GPN model to quantify the probability of the CPT parameters occurring under the current Gaussian distribution condition, and uses it as the parameterization parameter of the GPN model. Objective function: (7) in, This is a complete sample of electricity consumption data. Characteristic functions on: (8) Using formula (7) as the regularization term of the VQVAE objective function in formula (5), we construct an objective function for reducing the latent variables of electricity consumption preferences, so that the distribution of electricity consumption patterns before and after reduction remains consistent, ensuring that the electricity consumption profile can accurately depict the relationship between electricity consumption attributes: (9) Among them, probability parameters It is calculated using formula (6).
[0048] By minimizing the objective function in formula (9) using the gradient descent method, the parameters of the VQVAE model and the GPN model are updated, resulting in the reduced set of latent variables of electricity consumption preference under the constraint of consistent electricity consumption distribution. .
[0049] because It is defined in Personal electrical properties Electricity consumption preferences and There is a one-to-one relationship, Approximately reduced to At the same time, it is also necessary to collect the electricity consumption data for each time slice. Electricity consumption datasets in adjacent time slices of Reduced to electricity consumption attribute variables Use them separately. and replace and A new single-time slice power consumption profile DAG structure was obtained. .according to Randomly initialize CPT parameters to obtain the reduced single-time-slice power consumption profile. ,in, , .
[0050] The following steps are required to organize the information: S321, Minimize the Euclidean distance between the CPT parameters before and after reduction. Let the latent variable conditional distribution after joint probability decomposition be... and Following a uniform distribution, the reduction results of the conditional probability table parameters under the constraint of consistent electricity consumption distribution are obtained. : In the formula, and Let represent the combined magnitudes of the latent variable values before and after reduction, and Z represent the latent variable of electricity preference after reduction. Indicates the specific value of the hidden variable. The first variable representing the electricity consumption attribute variable Each possible value Potential represents the electrical property variable; S322, subnetworks of the Gaussian parametric network model and These are used to discretely encode the latent variables. Transform into The mean of the corresponding multiple independent Gaussian distributions and variance , recorded as and ; In the formula, express yes The Seek values; S323, using the log-likelihood function as the reduction result under Gaussian distribution conditions. objective function : in, S324, the objective function As a loss function Regularization terms are used to construct an objective function for latent variable reduction. : S325, Minimize the objective function using gradient descent. We obtained the latent variables of electricity consumption preferences under the constraint of consistent distribution of electricity consumption patterns. and the reduced electricity consumption attribute variables A new directed acyclic graph structure for single-time-slice power consumption is obtained. ,in, ; S326, according to Randomly initialize the parameters of the conditional probability table The optimized single-time-slice power consumption profile after reduction is obtained. .
[0051] Fifth embodiment Based on any of the above embodiments, in this embodiment, the learning of relationships within a time slice aims to analyze electricity consumption data from a single time slice. Let's begin by learning how to profile electricity consumption in a single time frame. Besides the initialization relationship, other relationships are learned by maximizing the fit between the DAG structure and time-series electricity consumption data. For example, user attributes may influence electricity consumption preferences, so the electricity consumption profile template may contain latent relationships between user attribute variables and electricity consumption preference variables. This invention denotes the set of all possible relationships within a time slice as... By calculation The generated candidate structures and datasets The degree of fit is . Add a new relationship. The specific steps are as follows: (1) Generation of weighted electricity consumption data. Given a single-time-slice electricity consumption dataset. and single-time slice power portrait ,for Each data sample filling of Select values to generate a complete electricity consumption dataset. Then, the conditional probability corresponding to each complete electricity consumption data sample is calculated: (10) Finally, As a complete sample of electricity consumption data The weights are used to obtain the weighted electricity consumption dataset. .
[0052] (2) Generation of candidate structures for single-time-slice electricity consumption profiles. From the single-time-slice electricity consumption profile... The current DAG structure Starting from this point, randomly add elements that exist in the relation set. The relationship between them yields a set of candidate structures. .
[0053] (3) Scoring of candidate structures for single-time-slice electricity consumption profiles. Learning candidate structures. The corresponding CPT parameters need to be quantified in relation to the weighted electricity consumption dataset. The degree of fit. Therefore, this invention defines CPT parameters. log-likelihood function , to quantify in candidate structure The probability of weighted electricity consumption data appearing under the following conditions: (11) Learning by maximizing formula (11) Then, the following Bayesian Information Criterion (BIC) is used to calculate any candidate structure. BIC score: (12) in, for The number of nodes, for The number of independent probability parameters corresponding to CPT. The weighting coefficient for the penalty term. This is a penalty term for the complexity of the probability parameter, used to limit the number of new relations.
[0054] (4) Selection of the optimal structure for single-time-slice power consumption profiling. The candidate structure with the highest BIC score is selected as the optimal structure for single-time-slice power consumption profiling. If the optimal structure The BIC score is higher than the current structure The BIC score will then Its CPT parameters serve as the current single-time-slice power consumption profile for the next round of learning. Otherwise, end the learning process and create a power consumption profile for the current single time slice. As a learning outcome. Used to describe the relatively fixed electricity consumption habits of users across all time slices.
[0055] The results were: S41, optimizing the power consumption profile for a single time slice. The new single-time-slice power consumption profile is a directed acyclic graph structure. Starting from this point, randomly add elements that exist in the relation set. The relationship between them yields a set of candidate structures. Bayesian information criterion is used as an arbitrary candidate structure. rating : In the formula, for The number of nodes, for The number of independent probability parameters in the corresponding conditional probability table. The weighting coefficient for the penalty term. This is a penalty term for the complexity of the probability parameter, used to limit the number of new relations. This is a weighted electricity consumption dataset; in, ; In the formula, For single-time-slice power consumption datasets Each data sample It is the conditional probability corresponding to each complete sample.
[0056] S42, the maximum score among all candidate structures is taken as the optimal structure for the single-time-slice power consumption profile. If the optimal structure The score is greater than the current structure The rating value will then be The parameters of the corresponding conditional probability table serve as the current single-time-slice electricity consumption profile for the next round of learning. Otherwise, end the learning process and create a power consumption profile for the current single time slice. As a learning outcome.
[0057] On the other hand, regarding the learning of relationships between time slices, in order to reflect the latent variables of electricity consumption attributes, electricity consumption preferences, and the relationship between electricity consumption and its invariance over time between adjacent time slices, this invention is based on... Electricity consumption datasets in adjacent time slices Learning time and inter-film relationship The specific steps are as follows: (1) Replication of single-time-slice electricity consumption profiles. To distinguish variables in adjacent time slices, single-time-slice electricity consumption profiles are replicated. Copy and use and Different time slices were distinguished to obtain and .
[0058] (2) Construction of electricity profile templates. Learning the relationship between time slices involves learning from the dataset. Let's set off and learn. and The possible relationships between them. For example, The electricity usage attributes and electricity consumption may affect The electricity consumption attributes and electricity consumption are considered, therefore, the time-slice relationship template may contain multiple relationships where electricity consumption attribute variables and electricity consumption variables point to each other. This invention denotes the set of all possible relationships between time slices as... By utilizing intra-time-slice relation learning methods, a set of all possible relations satisfying inter-time-slice conditions is iteratively generated. The inter-slice temporal relationships are determined based on the scoring, and the optimal inter-slice temporal relationships are identified. This leads to the creation of an electricity consumption profile template. .
[0059] The results were: S43 will optimize the power consumption profile for a single time slice. Copy and use and Different time slices were distinguished to obtain Optimization of power consumption profile for a single time slice and Optimization of power consumption profile for a single time slice ; S44, using the learning steps in S41 and S42, according to... and Electricity consumption datasets in adjacent time slices Iteratively generate the set of all possible relationships that satisfy the time slices. Determine the optimal inter-time slice relationship based on the time slice relationships. Obtain the electricity consumption profile template .
[0060] Sixth Embodiment Based on any of the above embodiments, in this embodiment, in order to accurately depict the user's electricity consumption behavior over time, the present invention uses electricity consumption data from adjacent time slices. Electricity consumption portrait template Update and stitch together the updated time-slice relationship template. Electricity consumption portrait template To construct the final electricity consumption profile .
[0061] To quantify the fit of the electricity consumption profile template to time-series electricity consumption data, the electricity consumption profile template is obtained through S40. Electricity consumption data The CPT parameter is used to calculate the degree of parameter variation: (13) in, express The Middle The variables take values of And the parent node's value is the first The CPT parameters corresponding to the various combinations, Indicates The obtained CPT parameters, express The number of parameters. The greater the variation of a variable's parameters in the electricity consumption profile template, the worse the fit of that variable to the electricity consumption data of the corresponding time slice, and the more necessary it is to update its local structure.
[0062] In order to obtain a given electricity consumption data pair Determine the electricity consumption portrait template under the circumstances For local structures that need updating, this invention first calculates... The various variables related to electricity consumption data The degree of parameter variability. Then, set the parameter variability threshold. , will satisfy variables insert middle, Used to store the variables to be judged. Then, sequentially from... Extracting variables from Add it to the set of sub-images of the electricity consumption profile template to be updated. , then traverse All neighbor variables If satisfied and ,Right now It is a latent variable of electricity preference and yes The parent node, or satisfying and ,Right now It is a latent variable of electricity preference and yes The parent node will then pass the neighbor variable. Insertion queue At the same time, with Adding connected relationships Repeatedly perform the dequeue operation until... It is empty at this time. This refers to the set of sub-images in the electricity consumption profile template that need to be updated.
[0063] The results were: S51. Calculate the adjacent time-slice electricity consumption dataset based on the initial electricity consumption profile template. Degree of parametric variation of parameters in a conditional probability table : In the formula, express The Middle The variables take values of And the parent node's value is the first The parameters of the conditional probability table corresponding to the various combinations. Indicates The obtained conditional probability table parameters, express The number of parameters; S52, Set the parameter variability threshold , will satisfy variables Insertion sequence In the middle, then sequentially from Extracting variables from Add it to the set of sub-images of the electricity consumption profile template to be updated. In the middle, traverse again All neighbor variables If satisfied and Then judge It is a latent variable of electricity preference and yes The parent node; if it satisfies and That is, to judge For electricity preference latent variables and yes The parent node; the neighbor variables in these two cases Insertion queue At the same time, with Adding connected relationships ; Repeat the dequeue operation until... If empty, obtain the set of sub-images of the electricity consumption profile template that need to be updated. ; Furthermore, in order to reflect the relationship between user attributes, electricity consumption attributes, electricity consumption preference latent variables, and electricity consumption over time, a set of electricity consumption profile template subgraphs is obtained. After that, firstly Each electricity consumption profile template sub-image in the [text] Using intra-time-slice relation learning and inter-time-slice relation learning methods, a candidate structure set for the electricity consumption profile template subgraph is generated, and the data is then used to... Iteratively learns the dynamic relationships within and between time slices to update the electricity consumption profile template. To obtain the local structure of the electric field image .
[0064] Then, As the first A time-segment profile of electricity consumption, As the first The time slice of electricity usage portrait and the first The dynamic relationship between electricity consumption profiles over time slices, by... and spliced to the already constructed first The time slice to the first Electricity consumption profile for a specific time period In the middle, we obtained the first The time slice to the first Electricity consumption profile for a specific time period .
[0065] Finally, after updating the electricity consumption profile templates for all time slices, the images from the 1st to the 2nd time slices were stitched together to obtain the first set of images. Electricity consumption profile for a specific time period This will serve as the final electricity consumption profile.
[0066] The results were: S53, based on the intra-time slice relationship learning method and inter-time slice relationship learning method in S40, processes the electricity consumption profile template subgraph set. Each electricity consumption profile template sub-image in the [text] The update is performed to obtain the updated local electricity consumption profile. ; S54, As the first A time-segment profile of electricity consumption, As the first Electricity consumption profile for each time slot and the first The dynamic relationship between electricity consumption profiles over time slices, and spliced to the already constructed first The time slice to the first Electricity consumption profile for a specific time period In the middle, we obtained the first The time slice to the first Electricity consumption profile for a specific time period ; S55, after updating the electricity consumption profile templates for all time slices, stitches together the data to obtain the first to the last data slices. Electricity consumption profile for a specific time period This yields the final target electricity consumption profile.
[0067] Verification of Examples Based on any of the above embodiments, this embodiment verifies the effectiveness of the electricity consumption profile construction method based on dynamic Bayesian networks involved in the above embodiments, as follows: Electricity consumption profiles were constructed from time-series electricity consumption data containing 100 users and 1396 time slices. User attribute data included user type. ,area Income level Industry type Building area Table 1 shows the user attribute data for 100 users across 5 user attributes. Each user's electricity consumption data for each time slot includes electricity consumption. Electricity price Day and night conditions Holiday schedule ,season Temperature Is there a power rationing? There are a total of 6 electricity consumption attributes. The time-series electricity consumption data of user 1 is shown in Table 2.
[0068] Table 1. User attribute data snippets for 100 users
[0069] Table 2. User 1's electricity usage attributes and electricity consumption data fragments
[0070] 1. Determine the single-time-slice electricity consumption dataset and the adjacent-time-slice electricity consumption dataset from the collected time-series electricity consumption dataset; Construct a single-time-slice electricity consumption dataset , Including 100 users in the User attribute data, electricity consumption attribute data, and electricity consumption data for each time slice.
[0071] Constructing electricity consumption datasets for adjacent time slices Electricity consumption data in adjacent time slots Including 100 users in the The time slice and the first User attribute data, electricity consumption attribute data, and electricity consumption data for each time slice.
[0072] 2. Construct an initial single-time-slice electricity consumption profile; 2.1 Setting Latent Variables for Electricity Preferences Introducing 6 latent variables of electricity consumption preference To describe users' attitudes towards electricity prices Day and night conditions Holiday schedule ,season Temperature Is there a power rationing? The degree of preference for these six electricity consumption attributes. Latent variables of electricity consumption preference. Value range and electricity consumption attribute variables The ranges correspond one-to-one. For example, the electricity price variable. The range of values is Latent variables of electricity preference The range of values is .
[0073] 2.2 Initialization of Power Consumption Profile Relationships in a Single Time Slice User attribute variables Latent variables of electricity consumption preferences Electricity consumption attribute variables and electricity consumption variables As variables in the electricity consumption profile, explicit relationships are established in the electricity consumption profile based on domain expert knowledge, namely, edges pointing from latent variables of electricity consumption preferences to variables of applied electricity attributes. Latent variables of electricity preference pointing to edge variables of electricity consumption An edge pointing from the electricity consumption attribute variable to the electricity consumption variable. Add these relationships to the relationship set. DAG structure for obtaining a single time slice power consumption profile Random initialization Corresponding CPT parameters The initial single-time-slice power consumption profile is obtained. Single-time slice power consumption profile The DAG structure and electrical property variables and CPT parameters such as Figure 2 As shown.
[0074] 3. By employing a vector quantization variational autoencoder model and a Gaussian parameter network, the latent variables in the initial single-time-slice electricity consumption profile are reduced to obtain an optimized single-time-slice electricity consumption profile; 3.1 Reduction of Latent Variables of Electricity Preference Based on VQVAE Based on the initialized single-time-slice power consumption profile Random sampling The complete electricity consumption dataset is obtained by taking the values of the latent variables of electricity consumption preferences for each sample. .For example, Shopping mall, eastern region, high, shopping mall, 2010 High electricity price, daytime, weekday, spring, 27℃, no power rationing, 93 kWh, preference for high electricity price, preference for daytime, preference for weekday, preference for spring, preference for 27℃, preference for no power rationing ,in, (Prefers high electricity prices, daytime, weekdays, spring, 27°C, and unlimited power).
[0075] Then, initialize a VQVAE model, and... Discrete input encoder network Obtain low-dimensional feature representation and the corresponding low-dimensional discrete features .For example, The corresponding discrete encoding is ,Will enter The low-dimensional feature representations are shown in Table 3. According to the vector table shown in Table 4 ,calculate eigenvectors , and With vector table The Euclidean distances between the vectors are shown in Table 5. , and Select the vector that is closest to each other , and To obtain low-dimensional discrete features , , .
[0076] Table 3. Low-dimensional feature representation
[0077] Table 4. Vectors in the Vector Table
[0078] Table 5. and Euclidean distance between vectors
[0079] Finally, Input decoder network The values of the reconstructed latent variables of electricity preference are obtained. The discrete encoding is used, and the loss function value of the electricity preference latent variable is calculated using formula (5). For example, the discrete encoding is used. , , enter get Discrete encoding This indicates that the latent variable representing the reconstructed electricity preference takes the value (preference). Electricity price, preference for daytime, preference for weekdays, preference for spring, preference for 28℃, preference for unlimited power supply). Calculate the relevant information according to formula (5). loss function value ,in, and .
[0080] 3.2 Reduction of Latent Variables of Electricity Preference with Introduced Constraints By minimizing the Euclidean distance between the electricity consumption patterns before and after the reduction of the latent variable of electricity preference, the reduction result of the CPT parameter in formula (6) that satisfies the consistency constraint of the electricity consumption pattern distribution is obtained. For example, the initial single-time-slice electricity consumption profile. Electricity consumption variables Some CPT parameters are: The reduction result of the CPT parameter obtained according to formula (6) is as follows: Among them, the combined size of the original latent variable values for electricity preference is The combined size of the latent variable values for electricity preference after reduction is The value of the electricity consumption variable is .
[0081] Then, a GPN model is initialized, which incorporates the low-dimensional discrete features of the latent variables of electricity consumption preferences. As input to the GPN model, the parameterization is calculated according to formula (7). The objective function value is used as a constraint for reducing the latent variable of electricity preference, and the objective function value with the constraint is calculated according to formula (9). For example, the objective function value with the constraint is calculated as follows: , , Subnetworks of the input GPN model and ,get The mean of the corresponding multiple independent Gaussian distributions and Calculate the parameterization of the GPN model according to formula (7). Objective function value: .in, express Reduced to The third combination of values (i.e.) ).
[0082] Finally, by minimizing the objective function in formula (9) using the gradient descent method, the parameters of the VQVAE model and the GPN model are updated, and the reduced set of latent variables of electricity consumption preference under the constraint of consistent electricity consumption distribution is obtained. and the VQVAE model, and then based on Single-time-slice power consumption data Electricity consumption datasets in adjacent time slices Electricity consumption attribute variables Reduced to the reduced electricity consumption attribute variable Use them separately. and replace Figure 2 Mid-time slice power consumption profile of and A new single-time slice power consumption profile DAG structure was obtained. .according to Randomly initialize CPT parameters to obtain the reduced single-time-slice power consumption profile. ,like Figure 3 As shown.
[0083] 4. Based on the single-time-slice electricity consumption dataset, learn the intra-time-slice relationships in the optimized single-time-slice electricity consumption profile, and based on the adjacent time-slice electricity consumption dataset, learn the inter-time-slice relationships in the optimized single-time-slice electricity consumption profile, to obtain an initial electricity consumption profile template based on a dynamic Bayesian network; 4.1 Learning the Relationships Within a Timeframe for Fill each sample of The value is selected based on the current single-time-slice electricity consumption profile. Calculate the conditional probability for each complete electricity consumption data sample to obtain the weighted electricity consumption dataset. .For example, express With a combination of values Weighted electricity consumption data sample The weight is Among them, in such Figure 4 The single-time-slice power consumption image shown The above probabilistic inference yields ,Right now: Then, from the single-time-slice power consumption profile The current DAG structure Starting from the given set of relations, randomly add them. The relationship between them yields a set of candidate structures. For example, in Add to each , and Obtain candidate structures , and .
[0084] By maximizing the log-likelihood function , and The CPT parameters of the three candidate structures were obtained respectively. , and The BIC scores of the three candidate structures are calculated according to formula (12). For example, candidate structures The BIC score is ,in, Similarly, we can obtain , .
[0085] Finally, the candidate structure with the highest BIC score was selected. As the current optimal structure Due to the current DAG structure The BIC score is ,and Then Its CPT parameters serve as the current single-time-slice power consumption profile for the next round of learning. ,in, When the learning process is completed after 5 iterations, the result is as follows: Figure 4 The current single-time-slice power consumption profile shown is as follows. ,in, .
[0086] 4.2 Learning about the relationship between time segments Image of electricity in a single time slice Copy and use and Different time slices are distinguished to obtain and From the dataset Starting from this point, referring to the previous method for learning intra-time-slice relationships within a single time slice, iteratively generate methods that satisfy... Time-sharing relationship And thus obtain such Figure 5 The electricity consumption portrait template shown .
[0087] 5. Update the target electricity consumption profile. 5.1 Selection of Sub-images in Electricity Image Template Will exist CPT update parameters for adjacent time slice subsets of data Calculate the parameter change rate of each variable node according to formula (13), and select the sub-graph set to be updated in the electricity consumption profile template. .
[0088] For example, the CPT parameters of each variable node before the update were: The updated parameters are Parameters of the electro-image template Therefore, according to formula (13), we can obtain and .
[0089] Set the threshold for parameter variability. It is 0.1, and has ,Will Add to queue .by The process of selecting the subgraph starting from the given point is shown in Table 6, resulting in the following: Figure 6 The subgraph structure represented by the red nodes and edges. .
[0090] Table 6. Candidate Queues Set of subgraph structures Adjustment process
[0091] 5.2: Sub-image update of the electricity portrait template Following the intra-time-slice relationship learning method in 4.1 and the inter-time-slice relationship learning method in 4.2, the electricity consumption data is analyzed... Iteratively update the set of subgraph structures obtained in 5.1 The local structure set of the electricity consumption image is obtained. For example, based on electricity consumption data right Figure 6 Subgraph structure in Update by adding relationships , , The updated partial structure of the electricity consumption profile was obtained. ,like Figure 6 As shown.
[0092] Subsequently, respectively In As a portrait of electricity consumption from the 2nd to the 1396th time slice, The relationship between adjacent electricity consumption profiles is represented by these profiles. That is, by... and spliced together In the middle, we obtained ,Bundle and spliced together In the middle, we obtained By doing this, we can obtain the final electricity consumption profile. ,like Figure 6 As shown.
[0093] As one implementation scheme, the hardware operating environment architecture of the computer system involved in this application embodiment is described. The computer system may include: a processor 1001, such as a CPU, a memory 1005, a user interface 1003, a network interface 1004, and a communication bus 1002. The communication bus 1002 is used to implement communication between these components. The user interface 1003 may include a display screen and an input unit such as a keyboard; optionally, the user interface 1003 may also include a standard wired interface or a wireless interface. The network interface 1004 may optionally include a standard wired interface or a wireless interface (such as a Wi-Fi interface). The memory 1005 may be high-speed RAM or stable non-volatile memory, such as a disk storage device. Optionally, the memory 1005 may also be a storage device independent of the aforementioned processor 1001.
Claims
1. A method for constructing electricity consumption profiles based on dynamic Bayesian networks, characterized in that, The method includes the following steps: S10, determine the single-time-slice electricity consumption dataset and the adjacent time-slice electricity consumption dataset from the collected time-series electricity consumption dataset; S20, Construct an initial single-time-slice electricity consumption profile, wherein the electricity consumption attribute preferences in the initial single-time-slice electricity consumption profile are described using latent variables; S30, using a vector quantization variational autoencoder model and a Gaussian parameter network, the latent variables in the initial single-time-slice electricity consumption profile are reduced to obtain an optimized single-time-slice electricity consumption profile; S40, learn the intra-time-slice relationship in the optimized single-time-slice electricity consumption profile based on the single-time-slice electricity consumption dataset, and learn the inter-time-slice relationship in the optimized single-time-slice electricity consumption profile based on the adjacent time-slice electricity consumption dataset, to obtain an initial electricity consumption profile template based on dynamic Bayesian network; S50, calculate the parameter variation degree of the adjacent time slice electricity consumption dataset based on the initial electricity consumption profile template, determine the local structure that needs to be updated in the initial electricity consumption profile template according to the magnitude of the parameter variation degree, and update the intra-time slice relationship and inter-time slice relationship of the local structure based on the structure EM algorithm to obtain the target electricity consumption profile.
2. The method as described in claim 1, characterized in that, S10 includes: S11, retrieve the first [user's] [number] from multiple users. Electricity consumption data for each time period , The variables in are ; in, , User attribute variables that do not change over time. For the first Electricity consumption attribute variables for each time slice, For the first The electricity consumption variable for each time slice, and ; S12, will Electricity consumption data for each time slot As independent and identically distributed samples, a single-time-slice electricity consumption dataset is obtained. ; S13. The electricity consumption data of adjacent time slices are concatenated and used as independent and identically distributed samples to obtain the electricity consumption dataset of adjacent time slices. .
3. The method as described in claim 1, characterized in that, S20 includes: S21, Initialize electricity consumption profile ; in, It is a single-time-slice power consumption profile. It is a set of relationships between time segments; S22 uses the implicit variable L of electricity preference and the variable V of electricity attribute to point to the variable Y of applied electricity consumption, denoted as and The structure of the directed acyclic graph is obtained. ; in, For variables in the time-slice electricity consumption data, For a set of latent variables, It is a set of relations; S23, Randomly initialize the parameters of the conditional probability table corresponding to the directed acyclic graph structure G. : ; In the formula, express The set of parent nodes, for The size of the combinations of values that a middle node can take. express Values and The value is the first The parameters of the conditional probability table corresponding to the combination; S24, based on the directed acyclic graph structure G and the parameters of the conditional probability table. The initial single-time-slice power consumption profile was obtained. .
4. The method as described in claim 1, characterized in that, S30 includes: S31, using a vector quantization variational autoencoder model, reduces the r latent variables in a single-time-slice electricity consumption profile to... One hidden variable; S32, based on the Gaussian parameter network model, the conditional probability table parameters corresponding to the latent variables are transformed into the vector quantization variational autoencoder model, so that the conditional probability table parameters before reduction are used as constraints for the latent variable reduction process.
5. The method as described in claim 4, characterized in that, The vector quantization variational autoencoder model includes an encoder network. Vector table and decoder network h, where, For discrete feature vectors, S31 includes: S311, Randomly sample the single-time-slice electricity consumption dataset using the single-time-slice electricity consumption profile. Mid-time slice power consumption data The corresponding latent variable values of electricity consumption preferences are used to obtain the complete electricity consumption dataset. ; In the formula, L is the set of latent variables. Represents the possible values of the set of latent variables; S312, Input encoder network ,get Low-dimensional feature representation after dimensionality reduction : ; S313, calculate respectively In Each feature vector, and the vector table middle The Euclidean distance between vectors, Each of the features is represented by a vector. Select the nearest vector to obtain Corresponding low-dimensional discrete features : ; In the formula, , , , The Euclidean distance function is: ; In the formula, and respectively, feature vectors and The One element; S314, low-dimensional discrete features Input to the decoder network In this process, we obtain the reduced set of latent variables. Value : ; In the formula, the loss function is used. Reduce the set of latent variables Error: ; In the formula, For the gradient termination operator, during backpropagation, The vectors in the vectors are treated as constants; ( )and ( ) represents the weighting coefficient.
6. The method as described in claim 4, characterized in that, S32 includes: S321, Minimize the Euclidean distance between the CPT parameters before and after reduction. Let the latent variable conditional distribution after joint probability decomposition be... and Following a uniform distribution, the reduction results of the conditional probability table parameters under the constraint of consistent electricity consumption distribution are obtained. : ; In the formula, Z represents the reduced latent variable of electricity preference. Indicates the specific value of the hidden variable. and Let represent the combined size of the latent variable values before and after the reduction, respectively. The first variable representing the electricity consumption attribute variable Each possible value Potential represents the electrical property variable; S322, subnetworks of the Gaussian parametric network model and These are used to discretely encode the latent variables. Transform into The mean of the corresponding multiple independent Gaussian distributions and variance , recorded as and ; In the formula, express yes The Seek values; S323, using the log-likelihood function as the reduction result under Gaussian distribution conditions. objective function : ; in, ; S324, the objective function As a loss function Regularization terms are used to construct an objective function for latent variable reduction. : ; S325, Minimize the objective function using gradient descent. We obtain the reduced latent variables of electricity preference under the constraint of uniformity in electricity consumption distribution. and the reduced electricity consumption attribute variables A new directed acyclic graph structure for single-time-slice power consumption is obtained. ,in, ; S326, according to Randomly initialize the parameters of the conditional probability table The optimized single-time-slice power consumption profile after reduction is obtained. .
7. The method as described in claim 1, characterized in that, The steps in S40 include: S41, optimizing the power consumption profile for a single time slice. The new single-time-slice power consumption profile is a directed acyclic graph structure. Starting from this point, randomly add elements that exist in the relation set. The relationship between them yields a set of candidate structures. Bayesian information criterion is used as an arbitrary candidate structure. rating : ; In the formula, for The number of nodes, for The number of independent probability parameters in the corresponding conditional probability table. The weighting coefficient for the penalty term. This is a penalty term for the complexity of the probability parameter, used to limit the number of new relations. This is a weighted electricity consumption dataset; in, ; In the formula, For single-time-slice power consumption datasets Each data sample It is the conditional probability corresponding to each complete sample; S42, the maximum score among all candidate structures is taken as the optimal structure for the single-time-slice power consumption profile. If the optimal structure The score is greater than the current structure The rating value will then be The parameters of the corresponding conditional probability table serve as the current single-time-slice electricity consumption profile for the next round of learning. Otherwise, end the learning process and create a power consumption profile for the current single time slice. As a learning outcome.
8. The method as described in claim 7, characterized in that, In step S40, the step of learning the inter-time-slice relationship in the optimized single-time-slice electricity consumption profile based on the adjacent time-slice electricity consumption dataset includes: S43 will optimize the power consumption profile for a single time slice. Copy and use and Different time slices were distinguished to obtain Optimization of power consumption profile for a single time slice and Optimization of power consumption profile for a single time slice ; S44, using the learning steps in S41 and S42, according to... and Electricity consumption datasets in adjacent time slices Iteratively generate the set of all possible relationships that satisfy the time slices. Determine the optimal inter-time slice relationship based on the time slice relationships. Obtain the electricity consumption profile template .
9. The method as described in claim 1, characterized in that, The S50 includes: S51. Calculate the adjacent time-slice electricity consumption dataset based on the initial electricity consumption profile template. Degree of parametric variation of parameters in a conditional probability table : ; In the formula, express The Middle The variables take values of And the parent node's value is the first The parameters of the conditional probability table corresponding to the various combinations. Indicates The obtained conditional probability table parameters, express The number of parameters; S52, Set the parameter variability threshold , will satisfy variables Insertion sequence In the middle, then sequentially from Extracting variables from Add it to the set of sub-images of the electricity consumption profile template to be updated. In the middle, traverse again All neighbor variables If satisfied and Then judge It is a latent variable of electricity preference and yes The parent node; if it satisfies and That is, to judge For electricity preference latent variables and yes The parent node; the neighbor variables in these two cases Insertion queue At the same time, with Adding connected relationships ; Repeat the dequeue operation until... If empty, obtain the set of sub-images of the electricity consumption profile template that need to be updated. ; S53, based on the intra-time slice relationship learning method and inter-time slice relationship learning method in S40, processes the electricity consumption profile template subgraph set. Each electricity consumption profile template sub-image in the [text] The update is performed to obtain the updated local electricity consumption profile. ; S54, As the first A time-segment profile of electricity consumption, As the first Electricity consumption profile for each time slot and the first The dynamic relationship between electricity consumption profiles over time slices, and spliced to the already constructed first The time slice to the first Electricity consumption profile for a specific time period In the middle, we obtained the first The time slice to the first Electricity consumption profile for a specific time period ; S55, after updating the electricity consumption profile templates for all time slices, stitches together the data to obtain the first to the last data slices. Electricity consumption profile for a specific time period This yields the final target electricity consumption profile.
10. A computer system, characterized in that, The computer system includes: a memory, a processor, and a computer program stored in the memory and executable on the processor. When the computer program is executed by the processor, it implements the steps of the method for constructing an electricity consumption profile based on a dynamic Bayesian network as described in any one of claims 1 to 9.