A big data resource allocation method and system for smart grid
By constructing a collaborative learning framework and generative adversarial network in the smart grid, and combining multi-agent reinforcement learning, dynamic incentive strategies are generated, which solves the problems of dynamic changes in user behavior and environmental influencing factors, and realizes efficient response of flexible loads on the user side and stable operation of the power grid.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- ZHEJIANG QIUSHENG TECH CO LTD
- Filing Date
- 2026-01-23
- Publication Date
- 2026-06-05
AI Technical Summary
Existing smart grid systems fail to fully consider the dynamic changes in individual user behavior and real-time environmental factors, resulting in low response rates and inefficient incentives for flexible loads on the user side, making it impossible to effectively mobilize flexible load resources to balance the power grid's supply and demand imbalance.
By building a collaborative learning framework between the central server and user terminals, high-quality data is synthesized using generative adversarial networks, and dynamic incentive strategies are generated by combining multi-agent reinforcement learning algorithms to achieve personalized response models and global policy optimization.
While ensuring user data privacy, precise incentives are provided for flexible loads on the user side to participate in regulation, thereby improving the operational efficiency and reliability of the smart grid and achieving peak shaving and valley filling.
Smart Images

Figure CN122159178A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of smart grids, and more specifically, to a method and system for allocating big data resources for smart grids. Background Technology
[0002] With the deepening of smart grid construction, the efficient integration of flexible load resources on the user side has become a key means to improve the grid's regulation capabilities. In smart community pilot projects, grid operators guide users to adjust flexible loads such as air conditioners and electric vehicle charging piles through demand response projects to cope with the problem of tight power supply during peak hours. In this scenario, there are significant differences in users' electricity consumption behavior. Some users respond positively to electricity price incentive policies, while others respond weakly due to electricity consumption habits or equipment limitations. External environmental factors such as dynamic electricity price signals and load demand fluctuations caused by weather changes, as well as internal factors such as insufficient data collection frequency of smart meters and incomplete data acquisition due to user privacy protection requirements, together constitute a complex application scenario. Existing systems usually rely on historical electricity consumption data and simple cluster analysis for load forecasting and implement a unified price incentive strategy within a fixed time period in an attempt to guide users to participate in grid regulation.
[0003] However, existing technologies have significant limitations. Currently widely used user response prediction methods based on clustering or regression analysis fail to fully consider the dynamic changes in individual user behavior and real-time environmental factors. These methods typically rely on historical data, classify users into limited categories, and assume that users of the same category behave consistently, ignoring real-time changes in user preferences due to factors such as seasons, weather, and lifestyle habits. Furthermore, due to user privacy protection requirements, the actual data available is often anonymized or aggregated, resulting in coarse data granularity and missing individual characteristics. In addition, existing incentive mechanisms are mostly statically designed and cannot be dynamically adjusted according to the real-time response status of users, leading to low incentive efficiency. These technical defects collectively result in a response rate of user-side flexible loads participating in resource allocation that is far lower than expected, especially during peak load periods, where sufficient flexible load resources cannot be effectively mobilized to balance the power grid supply and demand imbalance. Summary of the Invention
[0004] This invention addresses the technical problems existing in the prior art by providing a method and system for allocating big data resources in smart grids, thereby resolving the issues raised in the background section.
[0005] The technical solution of this invention to solve the above-mentioned technical problems is as follows: a big data resource allocation method for smart grids, specifically including the following steps: Step S1: The central server distributes the initialized global user behavior prediction model to multiple user terminals. Each user terminal uses its locally stored private dataset to train the received model locally. After training, the updated model parameters are encrypted and uploaded to the central server. The central server receives and aggregates the model parameters uploaded by all user terminals to update the global user behavior prediction model. Step S2: Using the updated global user behavior prediction model from step S1 as the initialization basis for the discriminator, construct a generative adversarial network (GAN) with the generator; using the GAN, generate synthetic electricity consumption data with the same conditional distribution as the real user electricity consumption data, with conditional variables as input. Step S3: For each user, call the generator trained in step S2 to generate a unique synthetic electricity consumption dataset based on the condition variables corresponding to that user; merge the synthetic electricity consumption dataset with the user's private dataset to form an enhanced dataset; and use the enhanced dataset as the initialization basis for the updated global user behavior prediction model parameters in step S1 to perform personalized fine-tuning training on the model to obtain a personalized response model for each user. Step S4: Integrate the personalized response models of all users obtained in step S3 into a virtual simulation environment, use a multi-agent reinforcement learning algorithm, with the goal of maximizing the global utility of the power grid, train in the virtual simulation environment, and finally output a set of dynamic incentive strategies. In a preferred embodiment, the specific process of each user terminal using its locally stored private dataset to train the received model locally in step S1 is as follows: Each user terminal uses the current parameters of the received global user behavior prediction model as the initial parameters of its local model. The objective function for local training consists of a prediction error loss function and a regularization term. The prediction error loss function calculates the difference between the predicted value and the true value of the model on the locally stored private dataset. The regularization term is used to constrain the Euclidean distance between the updated parameters of the local model and the received global model parameters. By minimizing this objective function, each user terminal obtains the updated parameters of the local model through stochastic gradient descent iteration.
[0006] In a preferred embodiment, the specific process by which the central server receives and aggregates the model parameters uploaded by all user terminals is as follows: The central server first decrypts and receives encrypted data uploaded by each user terminal. This data includes the update amount of the local model parameters, the number of samples in the private dataset stored locally by the terminal, and an update confidence score calculated based on the norm of the current model parameter update amount and the number of samples in the local private dataset. Subsequently, the central server uses an adaptive weighted average algorithm for aggregation. This algorithm assigns an aggregation weight to the model parameter update amount of each user terminal. This weight is the product of the update confidence score and the number of samples in the corresponding terminal's local dataset. Finally, the central server sums the model parameter update amounts of all user terminals according to their corresponding aggregation weights, and adds the weighted sum to the global model parameters before aggregation to obtain the updated next-generation global user behavior prediction model parameters.
[0007] In a preferred embodiment, the specific process of using the updated global user behavior prediction model from step S1 as the initialization basis for the discriminator in step S2 is as follows: The parameters of all network layers of the global user behavior prediction model finally trained in step S1 are directly used as the initial parameters of the backbone feature extraction network of the discriminator in the generative adversarial network. Based on this, a conditional projection layer is added to the end of the discriminator network to map the input conditional variable into a feature vector with the same dimension as the output of the discriminator backbone network. Finally, the joint discriminative output value of the discriminator on the input data and the conditional variable is obtained by adding the feature extraction result of the backbone feature extraction network on the input data and the mapping output result of the conditional projection layer on the conditional variable.
[0008] In a preferred embodiment, the specific training operation for generating synthetic electricity consumption data that has the same conditional distribution as real user electricity consumption data is as follows: During the training of a Generative Adversarial Network (GAN), the generator and discriminator engage in adversarial training based on a value function. In each training iteration, the gradient norm of the discriminator network weights relative to the expected value of the true data items in the objective function is calculated first, along with the gradient norm of the discriminator network weights relative to the expected value of the generated data items in the objective function. The ratio of these two values is then recorded as the dynamic equilibrium index. Subsequently, the learning rate of the discriminator network in this training iteration is dynamically adjusted based on the value of this dynamic equilibrium index. When the dynamic equilibrium index is greater than the preset target equilibrium value, the learning rate of the discriminator is reduced proportionally. When the dynamic equilibrium index is less than the preset target equilibrium value, the learning rate of the discriminator is maintained or increased proportionally. After the training process is completed, the trained generator model parameters are output; for any given condition variable, by inputting a random noise vector and the condition variable into the generator, the corresponding synthetic electricity consumption data can be generated, forming a conditional synthetic dataset.
[0009] In a preferred embodiment, the specific operation in step S3, based on the updated global user behavior prediction model in step S1, is as follows: All network parameters of the global user behavior prediction model finally trained in step S1 are directly used as the initial parameters of each user's personalized response model. This initialization method ensures that the model training process for each user does not start from scratch, but rather begins from a high starting point with a wide range of common knowledge about users' electricity consumption behavior.
[0010] In a preferred embodiment, the specific operation of using the augmented dataset for personalized fine-tuning training is as follows: For each user, the training objective function of the personalized model consists of a weighted sum of two parts: the first part is the prediction error loss value of the personalized model on its augmented dataset, and the second part is the KL divergence value between the output probability distribution of the personalized model and the global user behavior prediction model obtained in step S1 on the synthetic data part of its augmented dataset. By optimizing this combined objective function, a high-quality personalized response model that can reflect the user's personality and maintain global consistency is finally obtained.
[0011] In a preferred embodiment, the specific operation of integrating the personalized response models of all users obtained in step S3 into a virtual simulation environment is as follows: A digital twin virtual simulation environment is constructed, and the personalized response model of each user output in step S3 is used as an independent agent with a fixed strategy in this environment. The strategy of the agent is defined as follows: receive the excitation signal issued by the power grid center and its own state information, and output the predicted electricity consumption behavior response of the user. The response behaviors of all agents interact together to drive the dynamic evolution of the virtual simulation environment, which is used to simulate the operation of a real smart grid.
[0012] In a preferred embodiment, the specific operation of training a multi-agent reinforcement learning algorithm in a virtual simulation environment with the goal of maximizing the global utility of the power grid is as follows: The grid operator is designated as the central agent, whose observation information is a global state vector containing the total grid load and voltage information of each node. The central agent employs an attention-based policy network to adaptively generate dynamic incentive signal vectors for all users by calculating the correlation weights between different user state codes. The training process uses a course learning strategy, controlling the gradual increase in the complexity of the virtual environment through a course factor that monotonically increases over time. The optimization objective of the central agent is to maximize a discounted expected cumulative utility, which is the weighted algebraic sum of the sum of the user's local utility at each time step, the total cost of grid incentive issuance, and the grid peak load penalty term. Through continuous interaction and optimization, a globally optimal incentive strategy that can dynamically respond to grid conditions and coordinate the behavior of all users is finally obtained.
[0013] This application also provides a big data resource allocation system for smart grids, specifically including: a federated collaborative training module, a conditional data generation module, a personalized modeling module, and a strategy optimization decision-making module, wherein... Federated Collaborative Training Module: This module is used by the central server to distribute the initialized global user behavior prediction model to multiple user terminals. Each user terminal uses its locally stored private historical electricity consumption data to train the received model locally. After training, the updated model parameters are encrypted and uploaded to the central server. The central server receives and aggregates the model parameters uploaded by all user terminals to update the global user behavior prediction model. Conditional data generation module: It is used to use the global user behavior prediction model updated by the federated collaborative training module as the initialization basis of the discriminator, and to form a generative adversarial network with the generator. Using the generative adversarial network as input, the conditional variables are used to generate synthetic electricity consumption data with the same conditional distribution as the real user electricity consumption data. Personalized modeling module: For each user, the module merges their private historical electricity consumption data with the synthetic electricity consumption data generated by the conditional data generation module under the corresponding conditional variables to form an enhanced dataset. Based on the global user behavior prediction model updated by the federated collaborative training module, the module uses the enhanced dataset to perform personalized fine-tuning training to obtain a personalized response model for each user. The strategy optimization decision module integrates the personalized response models of all users obtained from the personalized modeling module into a virtual simulation environment. It uses a multi-agent reinforcement learning algorithm to train the system in the virtual simulation environment with the goal of maximizing the global utility of the power grid, and finally outputs a set of dynamic incentive strategies.
[0014] The beneficial effects of this invention are as follows: By constructing a collaborative learning framework between the central server and user terminals, while absolutely protecting user data privacy, federated learning is used to aggregate common knowledge of group electricity consumption behavior, and high-quality data is synthesized with the help of generative adversarial networks to compensate for the sparsity of individual data; then, a personalized response model is trained for each user that can reflect their unique electricity consumption pattern and contain global robust knowledge; finally, through multi-agent collaborative decision-making, a global strategy is generated that can dynamically respond to the grid status and accurately incentivize flexible loads on the user side to participate in regulation, thereby achieving the core goal of smart grid peak shaving and valley filling, and improving operational efficiency and reliability. Attached Figure Description
[0015] Figure 1 This is a flowchart of the method of the present invention; Figure 2 This is a block diagram of the system structure of the present invention. Detailed Implementation
[0016] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0017] In the description of this application, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the stated features. In the description of this application, "multiple" means two or more, unless otherwise explicitly specified.
[0018] In the description of this application, the term "for example" is used to mean "used as an example, illustration, or description." Any embodiment described as "for example" in this application is not necessarily to be construed as being more preferred or advantageous than other embodiments. The following description is provided to enable any person skilled in the art to make and use the invention. Details are set forth in the following description for purposes of explanation. It should be understood that those skilled in the art will recognize that the invention can be made without using these specific details. In other instances, well-known structures and processes will not be described in detail to avoid obscuring the description of the invention with unnecessary detail. Therefore, the invention is not intended to be limited to the embodiments shown, but is consistent with the broadest scope of the principles and features disclosed in this application.
[0019] Example 1 This embodiment provides, for exampleFigure 1 The above describes a method for allocating big data resources for smart grids, which specifically includes the following steps: Step S1: The central server distributes the initialized global user behavior prediction model to multiple user terminals (such as smart meters and charging pile controllers). Each user terminal uses its locally stored private dataset to train the received model locally, and after training, it encrypts and uploads the updated model parameters to the central server. The central server receives and aggregates the model parameters uploaded by all user terminals to update the global user behavior prediction model. Step S2: Using the updated global user behavior prediction model from step S1 as the initialization basis for the discriminator, construct a generative adversarial network (GAN) with the generator; using the GAN, generate synthetic electricity consumption data with the same conditional distribution as the real user electricity consumption data, with conditional variables as input. Step S3: For each user, call the generator trained in step S2 to generate a unique synthetic electricity consumption dataset based on the condition variables corresponding to that user. ; Compare the synthetic electricity dataset with the user's private dataset Merge them to form an augmented dataset. The expression is: ; in, Indicates user Augmented datasets, which are for users The final training dataset is constructed by merging its private real data and newly generated synthetic data. Indicates user Private datasets are historical, real-time electricity consumption data stored locally on user terminals, and are typically small in size (sparse). The union operation represents the combination of two datasets, which merges them into a larger set containing all the data samples. Represented as user Generate a customized synthetic electricity consumption dataset, tailored to the user. A set of artificial electricity consumption data samples generated under relevant specific conditions (such as its usual time period, climate of geographical location, etc.); and based on the updated global user behavior prediction model parameters in step S1, the model is trained with personalized fine-tuning using the augmented dataset to obtain a personalized response model for each user. Step S4: Integrate the personalized response models of all users obtained in Step S3 into a virtual simulation environment, use a multi-agent reinforcement learning algorithm, with the goal of maximizing the global utility of the power grid, train in the virtual simulation environment, and finally output a set of dynamic incentive strategies.
[0020] In this embodiment, it is particularly important to explain the process in step S1, where each user terminal... Private datasets using local storage The specific process of locally training the received model (which includes the user's electricity consumption history data) is as follows: Each user terminal uses the current parameters of the received global user behavior prediction model as the initial parameters of its local model. The objective function for local training consists of a prediction error loss function and a regularization term. The prediction error loss function calculates the difference between the predicted values and the true values on the locally stored private dataset. The regularization term constrains the Euclidean distance between the updated parameters of the local model and the received global model parameters to prevent excessive deviation of the local training from the global model and improve training stability. The objective function formula is: ; in, This indicates a minimization operation, which involves adjusting the local model parameters. The variable value makes the function The value reaches its minimum. Indicates the first A local loss function on each user terminal; the value of this function measures the current model parameters. The degree of "badness" is indicated by a higher value, which means the model's predictions are less accurate or less satisfactory. The training objective is to minimize this value. Indicates the first The current local model parameters of each user terminal can be understood as a set of numbers that define the specific behavior of the model. The purpose of training is to find an optimal set of parameters. , Indicates that it is stored in the first The local private dataset on each user terminal contains the user's electricity consumption history data. Indicates the first Local private datasets for each user terminal The number of samples, i.e., how many historical electricity usage records the user has. This represents a summation operation on a local private dataset. For each sample (x, y), calculate and sum them. This represents a feature vector from the training data. For example, in electricity consumption forecasting, it can include features such as time, weather, and historical electricity consumption. This represents the true value (label) in the training data. For example, in electricity consumption forecasting, it could be the actual electricity consumption over a specified time period. This represents the prediction error loss function, which is a function used to calculate the model's predicted values. Compared with the true value A common example of the difference is the mean squared error; the larger the value, the greater the difference. This represents a user behavior prediction model, which is a function whose input is a feature vector. The output is a predicted value (e.g., predicted electricity consumption), whose behavior is determined by the local model parameters. Decide, This represents the regularization coefficient (a hyperparameter), a real number greater than 0, which is manually set to control the regularization term. Weights or importance in the total loss function The larger the value, the stronger the penalty for local parameters deviating from global parameters. Indicates the first During each iteration, the global model parameters issued by the central server serve as the benchmark for collaborative training across all user terminals. L2 norm (Euclidean norm) is used to calculate the L2 norm of two vectors (here). and The Euclidean distance between the local and global parameters visually represents the magnitude of the difference between the local and global parameters. This represents the squaring operation, specifically calculating the square of the L2 norm. By minimizing this objective function, each user terminal obtains the updated parameters after local model updates through iterative stochastic gradient descent. ; The specific process by which the central server receives and aggregates the model parameters uploaded by all user terminals is as follows: The central server first decrypts and receives the encrypted data uploaded by each user terminal. The data includes the update volume of local model parameters. The number of samples in the private dataset stored locally on this terminal. And an update confidence score calculated based on the norm of the current model parameter update for this terminal and the number of samples in its locally stored private dataset. The updated confidence formula is: ; in, Indicates the first The update confidence score of each user terminal is an indicator that measures the quality of the model update for that terminal. The higher the value (closer to 1), the more robust and reliable the update is, and the higher its weight should be in subsequent global model aggregation. This represents an exponential function, specifically an exponential operation with the natural constant e as the base. It maps the result within the parentheses to an interval of (0, +∞), ensuring a positive confidence level. It is typically combined with a subsequent weighted average to suppress outliers. However, when the update volume is too large, the confidence level will decrease sharply. This represents a hyperparameter, preset by the system, used to adjust the sensitivity of the confidence level to the "ratio of update magnitude to data volume". The larger the value, the greater the penalty for large updates based on a small amount of data, and the faster the confidence level decreases. Indicates the first The terminal in the first The amount of local model parameter updates generated during each round of training (i.e., the difference between the parameters after training on the terminal and the received global parameters). This indicates the calculation of the L2 norm of the vector (the amount of local model parameter update), which is the square root of the sum of the squares of the vector's elements. The result represents the magnitude of this update. Indicates the first Local private datasets for each user terminal The number of samples, This represents the average update magnitude per unit of data, and it's the core calculation part of the formula. A large update magnitude driven by massive amounts of data is likely robust; however, if the same update magnitude is driven by very little data, it's likely due to the model overfitting on a small amount of data, producing unreliable "noisy" updates. This ratio is precisely to capture this risk; the higher the ratio, the greater the risk and the higher the confidence level. The lower the value, the better. Subsequently, the central server uses an adaptive weighted average algorithm for aggregation. This algorithm assigns an aggregation weight to the model parameter update amount of each user terminal. This weight is the product of the update confidence score and the number of samples in the corresponding terminal's local dataset. Finally, the central server sums the model parameter updates of all user terminals according to their corresponding aggregation weights, and adds the weighted sum to the global model parameters before aggregation, thus obtaining the updated next-generation global user behavior prediction model parameters. The formula for the next-generation global user behavior prediction model parameters is: ; in, Indicates the first The next-generation global model parameters after each iteration are calculated by the central server using this formula. This involves aggregating updates from all user terminals to obtain the new version of the model parameters, which will serve as the starting point for the next round of training and distribution to each terminal. Indicates the first Global model parameters after (or before) a round of iterations. These are model parameters stored on a central server, with subscripts... Represents Global, superscript ( ) represents the first The next iteration, or communication round, is the starting point for the aggregation operation. This indicates the total number of user terminals participating in this round of federated learning training, with the subscript indicating the total number of terminals. From 1 to The loop represents performing calculations for each terminal participating in the training. Indicates the first Update confidence of individual user terminals Indicates the first Local private datasets for each user terminal The number of samples, Indicates the first The user terminal in the first The calculation method for the model parameter update amount generated by the wheel is as follows: ,in It is based on the initially issued global model parameters of terminal i. and local private datasets The new parameters obtained after training This indicates in which direction and to what extent the terminal wants to push the global model to be updated. The summation symbol is used to sum the values in the following expression. The value is accumulated from the first terminal (i=1) to the Nth terminal.
[0021] In this embodiment, the specific process of using the updated global user behavior prediction model from step S1 as the initialization basis for the discriminator in step S2 is as follows: The parameters of all network layers of the global user behavior prediction model finally trained in step S1 are... It is directly used as a discriminator in generative adversarial networks. The initial parameters of the backbone feature extraction network are set. Based on this, a conditional projection layer is added to the end of the discriminator network to map the input conditional variables to a feature vector with the same dimension as the output of the backbone network. Finally, the joint discriminant output value of the discriminator on the input data and conditional variables is the sum of the feature extraction result of the backbone feature extraction network on the input data and the mapping output result of the conditional projection layer on the conditional variables. The final output expression of the discriminator is: ; in, This represents the final output value of the discriminator. It is a scalar representing the probability that the discriminator recognizes the event that "given condition c, the input data x is true data". This represents the data samples input to the discriminator (from the local private datasets of each user terminal). The data extracted (from the data source) can be real user electricity consumption data or synthetic data generated by the generator. 'c' represents a condition variable, a vector containing conditional information such as timestamps, electricity price ranges, and weather type codes. It guides the generator in producing data under specific conditions and instructs the discriminator in making conditional judgments. This represents the backbone feature extraction network of the discriminator; it is a function whose next-generation global model parameters... This comes directly from the global user behavior prediction model trained in step S1. Its function is to receive input data x and output a high-dimensional feature vector, which contains the essential feature information of data x. Indicates the first The next-generation global model parameters after each iteration are directly used as the initial parameters for the discriminator backbone network here. The conditional projection function, typically a simple neural network layer (such as a linear layer), maps the condition variable c to a high-dimensional feature space and outputs a value that is analogous to the conditional projection function. Feature vectors with exactly the same dimensions; To generate synthetic electricity consumption data with the same conditional distribution as real user electricity consumption data, the specific training operation is as follows: During the training of a generative adversarial network, the generator and discriminator undergo adversarial training based on a value function, expressed as: ; in, Let G represent the adversarial training objectives for the generator and discriminator. The generator (G) aims to minimize this value function, while the discriminator... The goal is to maximize it. This represents the expected value operator, used to calculate the average of the following terms. The subscript representing the expectation, i.e., from the actual data distribution. Sample real data x and its corresponding condition variable c. This represents the final output value of the discriminator. The sigmoid activation function is represented by 'sigmoid', and log represents the natural logarithm function. The subscript representing the expectation, i.e., from the prior distribution (such as the normal distribution). Random noise z is sampled from the conditional distribution () In the sampled condition variable c, G(z,c) represents the output of the generator network. This represents the discriminator's judgment on the generated data, that is, the probability that the discriminator judges "the generated data G(z,c) is real data under condition c". This represents the network weight parameters of the generator G, which need to be optimized during training. Discriminator The network weight parameters need to be optimized during training. In each training iteration, the gradient norm of the discriminator network weight parameters relative to the expected value of the true data items in the objective function is calculated first, along with the gradient norm of the discriminator network weight parameters relative to the expected value of the generated data items in the objective function. The ratio of these two values is then taken as the dynamic equilibrium index, and the calculation formula is as follows: ; in, The gradient norm ratio (i.e., a dynamic equilibrium metric) is the ratio of the gradient strength of the discriminator with respect to the real data to the gradient strength with respect to the generated data. It is used to measure the "strength" of the discriminator in the current training state. This represents the gradient operator, used to calculate the partial derivative of a subsequent function. Discriminator The network weight parameters, This represents the expected value, which is the probability average of the expression within the parentheses. `log` represents the natural logarithm function. This represents the Sigmoid activation function, which maps the discriminator's output to the (0,1) interval, representing the probability. This represents the output function of the discriminator network. The inputs are data x (or G(z,c)) and conditions c. The output is a scalar value, where x represents a real data sample from the real data distribution. The electricity consumption data obtained from sampling is given by G(z,c), where c represents the condition variable, and G(z,c) represents the output of the generator network, i.e., the synthesized data sample generated by the generator based on random noise z and condition c, where z represents the random noise vector, typically drawn from a standard normal distribution. Mid-sampling, used as a random input source for the generator. Let L2 norm be the norm, and let the magnitude of the vector within the brackets be calculated, which is used here to calculate the magnitude of the gradient vector. Then, the learning rate of the discriminator network in this training iteration is dynamically adjusted based on the value of this dynamic balance index. When the dynamic balance index is greater than the preset target balance value, the learning rate of the discriminator in this iteration is reduced proportionally; when the dynamic balance index is less than the preset target balance value, the learning rate of the discriminator in this iteration is maintained or increased proportionally. The dynamic learning rate adjustment formula is: ; in, The discriminator is in the first... The dynamic learning rate in each training iteration is a value calculated in real time based on the gradient ratio RA. This represents the initial learning rate of the discriminator, a pre-set hyperparameter. This function represents the minimum value, taking the smaller of the two values within the parentheses. This represents the target gradient ratio (i.e., the preset target equilibrium value), a preset hyperparameter (usually set to 1.0), representing the ideal gradient ratio when training to the optimal equilibrium. This represents the gradient norm ratio (i.e., the dynamic equilibrium index); the mechanism aims to maintain a dynamic balance between the growth of the discriminator and the generator's capabilities during training, ensuring that training converges stably until the generator can produce high-quality synthetic data. After the training process is complete, the trained generator is output. Model parameters For any given condition variable By inputting a random noise vector and a condition variable into the generator ( , This represents a sample of electricity consumption data synthesized by the generator. It is artificial data simulated by the generator and has the same conditional distribution as real user electricity consumption data. This represents the trained generator, which is a neural network model whose function is to receive random noise and condition variables and output synthetic data. z represents the random noise vector input to the generator. Indicates the first A condition variable is a vector containing specific conditional information (such as time, electricity price, weather, etc.) used to guide the generator to produce electricity consumption data that meets those specific conditions. It is an index of conditions. Indicates the generator after training. The optimal model parameters (these are fixed values obtained through the aforementioned adversarial training process, which determine the generator's performance and the quality of the output data) can then be used to generate the corresponding synthetic electricity consumption data, forming a conditional synthetic dataset. .
[0022] In this embodiment, the specific operation in step S3, based on the updated global user behavior prediction model in step S1, is as follows: All network parameters of the global user behavior prediction model finally trained in step S1. This is directly used as the initial parameter for each user's personalized response model; this initialization method ensures that the model training process for each user does not start from scratch, but rather begins from a high starting point with a broad range of common knowledge about users' electricity consumption behaviors. The expression is: ; in, Indicates user The initial parameters of the personalized response model, which are used when starting to respond to the user. The initial values set for the model parameters before fine-tuning the training. This represents the assignment operator, which assigns the value on the right to the value on the left. This represents the parameters of the next-generation global model after the final training in step S1; The specific steps for using augmented datasets for personalized fine-tuning training are as follows: For each user The training objective function of the personalized model consists of a weighted sum of two parts. The first part is the prediction error loss value of the personalized model on its augmented dataset. This part ensures that the model can learn and fit the unique real and synthetic data features of the user. The second part is the KL divergence value between the output probability distribution of the personalized model and the global user behavior prediction model obtained in step S1 on the synthetic data part of its augmented dataset. This part acts as a soft constraint to prevent the personalized model from deviating excessively from the robust knowledge contained in the global model during training, thereby effectively avoiding overfitting and improving the model's generalization ability. By optimizing this combined objective function, a high-quality personalized response model that reflects user personality while maintaining global consistency is finally obtained. The expression of the training objective function of the personalized model is: ; in, This indicates the optimal operation, which involves adjusting the user's settings. Personalized model parameters In order to minimize the value of the subsequent objective function, This represents the objective function, the entire expression that needs to be minimized. This represents the balancing hyperparameter, an adjustable parameter between 0 and 1, used to weigh the importance of the error loss term and the distillation loss term in the overall objective function. This represents the total number of samples in the augmented dataset. This indicates a summation operation, performing a summation on each data sample x and its corresponding label y in the augmented dataset. Let x represent the error loss function, used to calculate the personalized model's prediction for sample x. The difference between the true value y and the actual value y (such as mean squared error, cross entropy). This represents the weighting coefficient for the distillation loss term. Indicates user A dedicated synthetic dataset, namely the synthetic data portion of the augmented dataset. This indicates the number of samples in the synthetic dataset. This indicates iterative summation, performing a summation operation on each data sample x in the synthetic dataset. KL divergence is used to measure the difference between two probability distributions. This represents the output probability distribution of the personalized model for input x. Represents the global model (with parameters) The output probability distribution for input x.
[0023] In this embodiment, it is specifically necessary to explain that the personalized response models of all users obtained in step S3 are... The specific steps for integrating into a virtual simulation environment are as follows: Build a digital twin virtual simulation environment Each user's personalized response model output in step S3 is used as an independent, policy-fixed agent in the environment. The agent's policy is defined as: receiving the excitation signal issued by the power grid center and its own state information, and outputting the predicted electricity consumption behavior response for that user. The response behaviors of all agents interact together to drive the dynamic evolution of the virtual simulation environment, used to simulate the operation of a real smart grid. The expression is: ; in, Indicates user A fixed strategy, that is, in a virtual simulation environment, the user The agent follows a set of behavioral rules, which are directly determined by its personalized response model. The superscript 0 indicates that the strategy is initial and fixed. Indicates an action, referring to the user. The electricity consumption behavior responses output by the agent, such as specific operations like reducing power consumption or delaying charging. The condition symbol indicates the probability distribution or output to its left given a certain condition; here it is read as "given...". Indicates status, referring to the user It can store its own status information, such as its current power consumption, equipment operating status, and indoor temperature. Indicates user The personalized response model, which is the output of step S3, is a function (or model) that receives the user's state. and excitation signal As input, it outputs a predicted action (or a probability distribution of the action). , This indicates an excitation signal, meaning it is sent from the power grid center to the user. Incentive information, such as dynamic electricity prices, subsidy amounts, and reward signals; The specific operation of training a multi-agent reinforcement learning algorithm in a virtual simulation environment with the goal of maximizing the global utility of the power grid is as follows: The power grid operator is designated as the central intelligent agent, whose observation information includes the total load of the power grid. With the voltage of each node The information is a global state vector; the central agent employs an attention-based policy network. ( This represents the policy of the central agent, i.e., the global incentive policy. This represents the excitation signal vector sent to all users at time t, expressed as: , This represents the total number of excitation signal vectors sent to all users. The global state vector at time t is represented as follows: , Representational Policy Network The parameters to be optimized are obtained by calculating the correlation weights between different user state codes, and then adaptively generating a dynamic stimulus signal vector for all users. The formula for calculating the correlation weights is as follows: ; in, This represents attention weight, indicating the user's... Status for users The extent of the impact Indicates user The state encoding (the feature vector representation of its state). This represents a learnable weight matrix used for linear transform state encoding. This represents a learnable weight vector used to calculate the attention score. This represents a vector concatenation operation. This represents an activation function, where exp stands for exponential function, used to convert scores into positive numbers. This means for all users Summation is performed to normalize the weights; the training process employs a course learning strategy, using a course factor that monotonically increases over time to control the gradual increase in the complexity of the virtual environment; the objective of the central agent optimization is to maximize a discounted expected cumulative utility, which is the weighted algebraic sum of the sum of the user's local utility at each time step, the total cost of grid incentives, and the grid peak load penalty term, expressed as: ; in, This represents the objective function (expected cumulative utility) that the central agent needs to maximize. Represents the expectation operator, Indicates the discount factor. Weighing the importance of current and future returns This represents the total system utility at time t. It is a scalar value used to measure the overall performance of the entire system (such as a smart grid) at time step t. The higher the value, the better the system's operating condition. Its calculation method is as follows: , This represents the summation operator, from the first element to the second. Summing each element This typically represents the total number of users, agents, or components in the system. Indicates user Weighting coefficient, a real number greater than or equal to 0, is used to adjust the user's weight. Local rewards Its importance in total utility The larger the value, the more important the user's contribution. Indicates user The local reward obtained at time t is a function that calculates the state of the element at time t. And perform the action The immediate benefits gained afterward, for example, for users This could represent the electricity cost savings due to energy conservation. Indicates user The state at time t describes the user's status at a specific moment, such as a user's current power consumption, device status, etc. Indicates user The action performed at time t represents the decision or behavior made by the user at that specific moment, such as the user deciding to reduce electricity consumption. This represents the penalty coefficient for the cost item, a constant greater than 0, used to adjust the cost item. The degree of negative impact on total utility The larger the value, the lower the system's tolerance for cost. The coefficient representing the peak load penalty term is a positive constant used to adjust the penalty imposed by peak loads on the system. The severity The larger the value, the more the system tends to avoid peak loads. This represents the penalty function for the peak load of the power grid at time t, which is expressed as the total system load at time t. For input, output a penalty value. Its typical form is: when the load... When a certain safety threshold is exceeded, a positive penalty value is output (which may increase with the magnitude of the exceedance); otherwise, 0 is output. Its function is to discourage excessive peak loads in the system and encourage load smoothing. Through continuous interaction and optimization, a globally optimal incentive strategy that can dynamically respond to the grid status and coordinate the behavior of all users is finally obtained. After training, the globally optimal incentive strategy is deployed in a real smart grid. During operation, the central agent calculates and publishes incentive signals based on the real-time collected global status. Each user terminal calls its locally stored personalized response model to respond to the incentive signal and generate electricity consumption behavior. The whole process does not require additional real-time complex communication between user terminals or with the central agent.
[0024] Example 2 This embodiment provides, for example Figure 2 The system, shown, is a big data resource allocation system for smart grids. Specifically, it includes: a federated collaborative training module, a conditional data generation module, a personalized modeling module, and a strategy optimization decision-making module. Federated Collaborative Training Module: This module is used by the central server to distribute the initialized global user behavior prediction model to multiple user terminals. Each user terminal uses its locally stored private historical electricity consumption data to train the received model locally. After training, the updated model parameters are encrypted and uploaded to the central server. The central server receives and aggregates the model parameters uploaded by all user terminals to update the global user behavior prediction model. Conditional data generation module: It is used to use the global user behavior prediction model updated by the federated collaborative training module as the initialization basis of the discriminator, and to form a generative adversarial network with the generator. Using the generative adversarial network as input, the conditional variables are used to generate synthetic electricity consumption data with the same conditional distribution as the real user electricity consumption data. Personalized modeling module: For each user, the module merges their private historical electricity consumption data with the synthetic electricity consumption data generated by the conditional data generation module under the corresponding conditional variables to form an enhanced dataset. Based on the global user behavior prediction model updated by the federated collaborative training module, the module uses the enhanced dataset to perform personalized fine-tuning training to obtain a personalized response model for each user. The strategy optimization decision module integrates the personalized response models of all users obtained from the personalized modeling module into a virtual simulation environment. It uses a multi-agent reinforcement learning algorithm to train the system in the virtual simulation environment with the goal of maximizing the global utility of the power grid, and finally outputs a set of dynamic incentive strategies.
[0025] It should be noted that the descriptions of each embodiment in the above embodiments have different focuses. For parts that are not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.
[0026] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0027] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0028] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0029] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0030] Although preferred embodiments of the invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including both the preferred embodiments and all changes and modifications falling within the scope of the invention.
[0031] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Therefore, if these modifications and variations fall within the scope of the claims of this invention and their equivalents, this invention also intends to include these modifications and variations.
Claims
1. A method for allocating big data resources for smart grids, characterized in that, Specifically, the following steps are included: Step S1: The central server distributes the initialized global user behavior prediction model to multiple user terminals. Each user terminal uses its locally stored private dataset to train the received model locally. After training, the updated model parameters are encrypted and uploaded to the central server. The central server receives and aggregates the model parameters uploaded by all user terminals to update the global user behavior prediction model. Step S2: Using the updated global user behavior prediction model from step S1 as the initialization basis for the discriminator, and combining it with the generator to form a generative adversarial network; By using generative adversarial networks, and taking conditional variables as input, synthetic electricity consumption data with the same conditional distribution as real user electricity consumption data is generated. Step S3: For each user, call the generator trained in step S2 to generate a unique synthetic electricity consumption dataset based on the condition variables corresponding to that user; merge the synthetic electricity consumption dataset with the user's private dataset to form an augmented dataset. Using the updated global user behavior prediction model parameters from step S1 as the initialization basis, the augmented dataset is used to perform personalized fine-tuning training on the model to obtain a personalized response model for each user. Step S4: Integrate the personalized response models of all users obtained in Step S3 into a virtual simulation environment, use a multi-agent reinforcement learning algorithm, with the goal of maximizing the global utility of the power grid, train in the virtual simulation environment, and finally output a set of dynamic incentive strategies.
2. The big data resource allocation method for smart grids according to claim 1, characterized in that: In step S1, the specific process of each user terminal using its locally stored private dataset to train the received model locally is as follows: Each user terminal uses the current parameters of the received global user behavior prediction model as the initial parameters of its local model. The objective function for local training consists of a prediction error loss function and a regularization term. The prediction error loss function calculates the difference between the predicted value and the true value of the model on the locally stored private dataset. The regularization term is used to constrain the Euclidean distance between the updated parameters of the local model and the received global model parameters. By minimizing this objective function, each user terminal obtains the updated parameters of the local model through stochastic gradient descent iteration.
3. The big data resource allocation method for smart grids according to claim 2, characterized in that: The specific process by which the central server receives and aggregates the model parameters uploaded by all user terminals is as follows: The central server first decrypts and receives the encrypted data uploaded by each user terminal. The data includes the update amount of the local model parameters, the number of samples in the private dataset stored locally by the terminal, and an update confidence calculated based on the norm of the current model parameter update amount of the terminal and the number of samples in the private dataset stored locally. Subsequently, the central server uses an adaptive weighted average algorithm for aggregation. This algorithm assigns an aggregation weight to the model parameter update of each user terminal. The weight is the product of the update confidence and the number of samples in the local dataset of the corresponding terminal. Finally, the central server sums the model parameter updates of all user terminals according to their corresponding aggregation weights, and adds the weighted sum to the global model parameters before aggregation to obtain the updated next-generation global user behavior prediction model parameters.
4. The big data resource allocation method for smart grids according to claim 3, characterized in that: In step S2, the specific process of using the updated global user behavior prediction model from step S1 as the initialization basis for the discriminator is as follows: The parameters of all network layers of the global user behavior prediction model finally trained in step S1 are directly used as the initial parameters of the backbone feature extraction network of the discriminator in the generative adversarial network. Based on this, a conditional projection layer is added to the end of the discriminator network to map the input conditional variables into a feature vector with the same dimension as the output of the discriminator backbone network. Finally, the joint discriminant output value of the discriminator on the input data and the conditional variables is obtained by adding the feature extraction result of the backbone feature extraction network on the input data to the mapping output result of the conditional projection layer on the conditional variables.
5. A big data resource allocation method for smart grids according to claim 4, characterized in that: The specific training operation for generating synthetic electricity consumption data that has the same conditional distribution as real user electricity consumption data is as follows: During the training of a generative adversarial network, the generator and the discriminator are trained adversarially according to the value function. In each training iteration, the gradient norm of the discriminator network weight parameters with respect to the expected value of the real data items in the objective function and the gradient norm of the discriminator network weight parameters with respect to the expected value of the generated data items in the objective function are calculated first, and the ratio of the two is denoted as the dynamic balance index. Subsequently, the learning rate of the discriminator network in this training iteration is dynamically adjusted based on the value of the dynamic balance index. When the dynamic balance index is greater than the preset target balance value, the learning rate of the discriminator in this iteration is reduced proportionally. When the dynamic balance index is less than the preset target balance value, the learning rate of the discriminator in this iteration is maintained or increased proportionally. After the training process is completed, the trained generator model parameters are output; for any given condition variable, by inputting a random noise vector and the condition variable into the generator, the corresponding synthetic electricity consumption data can be generated, forming a conditional synthetic dataset.
6. The big data resource allocation method for smart grids according to claim 5, characterized in that: In step S3, the specific operation based on the updated global user behavior prediction model in step S1 is as follows: All network parameters of the global user behavior prediction model finally trained in step S1 are directly used as the initial parameters of each user's personalized response model. This initialization method ensures that the model training process for each user does not start from scratch, but rather starts from a high starting point with a wide range of common knowledge about users' electricity consumption behavior.
7. A method for allocating big data resources for smart grids according to claim 6, characterized in that: The specific steps for personalized fine-tuning training using augmented datasets are as follows: For each user, the training objective function of the personalized model consists of a weighted sum of two parts: the first part is the prediction error loss value of the personalized model on its augmented dataset, and the second part is the KL divergence value between the output probability distribution of the personalized model and the global user behavior prediction model obtained in step S1 on the synthetic data part of its augmented dataset. By optimizing this combined objective function, a high-quality personalized response model that can reflect the user's personality and maintain global consistency is finally obtained.
8. A method for allocating big data resources for smart grids according to claim 7, characterized in that: The specific operation of integrating the personalized response models of all users obtained in step S3 into a virtual simulation environment is as follows: A digital twin virtual simulation environment is constructed, and the personalized response model of each user output in step S3 is used as an independent agent with a fixed strategy in this environment. The strategy of the agent is defined as follows: receive the excitation signal issued by the power grid center and its own state information, and output the predicted electricity consumption behavior response of the user. The response behaviors of all agents interact together to drive the dynamic evolution of the virtual simulation environment, which is used to simulate the operation of a real smart grid.
9. A method for allocating big data resources for smart grids according to claim 8, characterized in that: The specific operation of training a multi-agent reinforcement learning algorithm in a virtual simulation environment with the goal of maximizing the global utility of the power grid is as follows: The grid operator is designated as the central agent, whose observation information is a global state vector containing the total grid load and voltage information of each node. The central agent employs an attention-based policy network to adaptively generate dynamic incentive signal vectors for all users by calculating the correlation weights between different user state codes. The training process uses a course learning strategy, controlling the gradual increase in the complexity of the virtual environment through a course factor that monotonically increases over time. The optimization objective of the central agent is to maximize a discounted expected cumulative utility, which is the weighted algebraic sum of the sum of the user's local utility at each time step, the total cost of grid incentive issuance, and the grid peak load penalty term. Through continuous interaction and optimization, a globally optimal incentive strategy that can dynamically respond to grid conditions and coordinate the behavior of all users is finally obtained.
10. A big data resource allocation system for smart grids is applied to the big data resource allocation method for smart grids as described in any one of claims 1-9, characterized in that: Specifically, it includes: The modules include a federated collaborative training module, a conditional data generation module, a personalized modeling module, and a policy optimization decision-making module. Federated Collaborative Training Module: This module is used by the central server to distribute the initialized global user behavior prediction model to multiple user terminals. Each user terminal uses its locally stored private historical electricity consumption data to train the received model locally. After training, the updated model parameters are encrypted and uploaded to the central server. The central server receives and aggregates the model parameters uploaded by all user terminals to update the global user behavior prediction model. Conditional data generation module: It is used to use the global user behavior prediction model updated by the federated collaborative training module as the initialization basis of the discriminator, and to form a generative adversarial network with the generator. Using the generative adversarial network as input, the conditional variables are used to generate synthetic electricity consumption data with the same conditional distribution as the real user electricity consumption data. Personalized modeling module: For each user, the module merges their private historical electricity consumption data with the synthetic electricity consumption data generated by the conditional data generation module under the corresponding conditional variables to form an enhanced dataset. Based on the global user behavior prediction model updated by the federated collaborative training module, the module uses the enhanced dataset to perform personalized fine-tuning training to obtain a personalized response model for each user. The strategy optimization decision module integrates the personalized response models of all users obtained from the personalized modeling module into a virtual simulation environment. It uses a multi-agent reinforcement learning algorithm to train the system in the virtual simulation environment with the goal of maximizing the global utility of the power grid, and finally outputs a set of dynamic incentive strategies.