Virtual power plant response capability assessment method and device
By constructing a sparse expert model and an attention distillation optimization algorithm, active resource sub-networks are dynamically selected to solve the problems of resource heterogeneity and benefit fragmentation in the response capability evaluation of virtual power plants, and achieve integrated evaluation of accurate prediction and economic efficiency.
Patent Information
- Application Number
- CN202511247518.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-03
- Publication Date
- 2025-10-03
AI Technical Summary
Existing virtual power plant response capability assessment methods have shortcomings in handling resource heterogeneity, ignoring the operational constraints and dynamic characteristics of different types of resources, and separating benefit and capability assessment, resulting in insufficient prediction accuracy and disconnection between economic benefits.
A sparse expert model based on the gating mechanism is constructed. The active resource sub-network is dynamically selected through the sparse gating network. The attention distillation optimization algorithm is introduced to establish the correlation weights between resource sub-networks, optimize the model parameters, and calculate the peak-valley arbitrage benefits in combination with time-of-use electricity prices.
It improves the prediction accuracy and interpretability in multi-resource heterogeneous environments, enhances the generalization and robustness of the model, quantifies technical capabilities and economic benefits, and avoids the separation of capability assessment and economic analysis.
Smart Images

Figure CN120746064A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of power system dispatching and operation optimization, and more specifically, to a method and device for evaluating the response capability of a virtual power plant. Background Art
[0002] With the increasing proportion of renewable energy in the power system and the diversification of user-side adjustable resources, virtual power plants (VPPs), a key form of aggregation of distributed power sources, energy storage systems, and adjustable loads to participate in the power market and provide ancillary services, have become a crucial means of enhancing the flexible regulation capabilities of the power system. In actual operation, VPPs must accurately assess available capacity at different time periods, while ensuring operational safety and resource constraints. They must also formulate appropriate peak-shaving and valley-filling strategies based on time-of-use electricity prices to achieve both technical and economic benefits.
[0003] However, existing response capability assessment methods have obvious shortcomings. On the one hand, in dealing with resource heterogeneity, most of them use a single model to uniformly model different types of resources such as energy storage, adjustable loads, and distributed power sources, ignoring the differences in operating constraints, dynamic characteristics, and regulation mechanisms among various types of resources, resulting in insufficient prediction accuracy and poor interpretability. On the other hand, in terms of the relationship between benefits and capability assessment, most methods separate the calculation of peak-valley arbitrage benefits from capability assessment, and fail to introduce electricity price signals and economic constraints in the assessment stage, making the assessment results disconnected from actual economic benefits, making it difficult to provide an integrated reference for scheduling decisions that takes into account both technical capabilities and economic benefits. Summary of the Invention
[0004] In order to overcome the above-mentioned defects of the prior art, an embodiment of the present invention provides a virtual power plant responsiveness evaluation method. By constructing a sparse expert model based on a gating mechanism and introducing attention distillation optimization, it solves the problems of insufficient processing of resource heterogeneity and the disconnection between evaluation results and actual economic benefits.
[0005] To achieve the above object, the present invention provides the following technical solutions: According to a first aspect of the present disclosure, a method for evaluating the responsiveness of a virtual power plant is provided, comprising the following steps: dynamically selecting an active resource subnetwork based on a first model to generate a first responsiveness curve, wherein the first model includes a sparse expert model based on a gating mechanism; performing initial optimization and joint optimization on the first model, wherein the initial optimization updates preset network parameters of the active resource subnetwork through an attention distillation optimization algorithm, and the joint optimization optimizes the first model parameters through the prediction error between the first responsiveness curve and historical data; generating a second responsiveness curve based on the optimized first model and virtual power plant prediction data; calculating peak-valley arbitrage returns based on the data parameters of the second responsiveness curve, and outputting a result of evaluating the responsiveness of the virtual power plant.
[0006] In a preferred embodiment, the first model includes a sparse gating network, several resource sub-networks, an aggregation layer and an attention distillation module. The attention distillation module is arranged between each resource sub-network and updates the preset network parameters of the active resource sub-network through the attention distillation optimization algorithm.
[0007] In a preferred embodiment, the dynamic selection of active resource sub-networks based on the first model is specifically as follows: the gating score of each resource sub-network is calculated based on the sparse gating network at the anchor point time, and the gating score is normalized to obtain the activation probability of each resource sub-network; and the resource sub-network whose activation probability meets the preset activation threshold is selected as the active resource sub-network.
[0008] In a preferred embodiment, the generation of the first responsiveness curve is specifically as follows: constructing a first input feature vector based on a historical time window and converting it into a time series input tensor; extracting a resource-specific input tensor corresponding to each adjustable resource type from the time series input tensor, and inputting it into the corresponding active resource sub-network; the active resource sub-network performs forward calculation and resource constraint processing on the resource-specific input tensor, and outputs a responsiveness prediction vector for multiple time segments; at the aggregation layer, the responsiveness prediction vectors of all time segments are weighted and summed according to the activation probability of each active resource sub-network to generate the first responsiveness curve.
[0009] In a preferred embodiment, the initial optimization comprises the following specific steps: combining the multi-time segmented response capability prediction vectors output by each active resource sub-network to generate an expert output set; constructing a distillation loss function based on the attention correlation weights and the differences in prediction results; and performing gradient backpropagation updates on the preset network parameters of the active resource sub-network using the distillation loss as the optimization target, wherein the preset network parameters include the active resource sub-network weights, the sparse gating network weights, and the attention mapping weights.
[0010] In a preferred embodiment, the attention correlation weight and the prediction result difference are specifically obtained in the following manner: extracting the intermediate layer features of each active resource sub-network, and calculating the correlation weight between any two active resource sub-networks through a multi-head attention mechanism; extracting the response capability prediction vector corresponding to the active resource sub-network from the expert output set; calculating the difference vector between the response capability prediction vectors of any two active resource sub-networks, and taking the square of the dichotomy norm of the difference vector as the prediction result difference.
[0011] In a preferred embodiment, the joint optimization comprises the following specific steps: obtaining a first responsiveness curve and a historical responsiveness curve; calculating the task loss of the first responsiveness curve and the historical responsiveness curve; constructing a joint loss function based on the distillation loss and the task loss; and performing gradient backpropagation updates on the first model parameters of the active resource subnetwork with the joint loss function as the optimization target; the first model parameters include weights of each resource subnetwork, weights of the sparse gating network, and weights of the attention mapping.
[0012] In a preferred embodiment, the second response capability curve is generated based on the optimized first model and the virtual power plant prediction data, specifically: the virtual power plant prediction data is obtained and preprocessed to construct a second input feature vector; the second input feature vector is input into the optimized first model to generate a second response capability curve.
[0013] In a preferred embodiment, the peak-valley arbitrage profit is calculated based on the data parameters of the second response capability curve, and the virtual power plant response capability evaluation result is output, specifically: identifying the peak-shaving period and valley-filling period of the time-of-use electricity price sequence in the virtual power plant forecast data; combining the second response capability curve with the preset peak-valley arbitrage formula to calculate the arbitrage profit value in the peak-shaving period and valley-filling period respectively; accumulating the profit value of each period to obtain the peak-valley arbitrage profit; constructing an evaluation result vector based on the second response capability curve and the peak-valley arbitrage profit, and outputting the virtual power plant response capability evaluation result.
[0014] According to another aspect of the present disclosure, an electronic device is provided, comprising a processor, and a memory and a network interface connected to the processor; the network interface is connected to a non-volatile memory in a server; the processor retrieves a computer program from the non-volatile memory through the network interface during operation, and runs the computer program through the memory to execute the above-mentioned virtual power plant responsiveness assessment method.
[0015] The technical effects and advantages of the virtual power plant response capability evaluation method and device of the present invention are as follows: This embodiment, by constructing a sparse expert model based on a gating mechanism, helps overcome the reliance of traditional virtual power plant response capability assessment methods on a single, unified model. It establishes dedicated subnetworks for different resource types, such as energy storage, adjustable loads, and distributed power sources. Combined with dynamic gating to select active resource subnetworks, this approach accurately characterizes the operational constraints and dynamic adjustment characteristics of various resources under multiple operating scenarios, improving prediction accuracy and interpretability in heterogeneous multi-resource environments. By introducing an attention distillation optimization algorithm, a knowledge transfer mechanism based on relevance weights is established between active resource subnetworks, enabling targeted optimization of weak expert subnetworks. This significantly enhances the model's generalization and robustness, reducing prediction bias caused by varying operating states and electricity price curves. By integrating time-of-use electricity prices into the evaluation phase to calculate peak-valley arbitrage benefits and integrating economic indicators with segmented capability curves, it simultaneously quantifies technical capabilities and economic benefits, avoiding the decision-making distortion caused by the separation of capability assessment and economic analysis in traditional methods. This effectively addresses the issues of insufficient resource heterogeneity handling, lack of segmented capability characterization, and the separation of benefit assessment and capability assessment in existing technologies. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 A schematic flow chart of a method for evaluating the response capability of a virtual power plant provided in an embodiment of the present invention.
[0017] Figure 2 A schematic diagram of the first model structure of the virtual power plant responsiveness evaluation method provided in an embodiment of the present invention.
[0018] Figure 3 A comparison chart of response capability curves of the virtual power plant response capability evaluation method provided in an embodiment of the present invention.
[0019] Figure 4 A schematic diagram of the electronic device structure of the virtual power plant responsiveness evaluation method provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0020] The following will provide a clear and complete description of the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.
[0021] Example 1, Figure 1 A virtual power plant response capability assessment method is proposed, which includes the following steps: S1, dynamically selecting an active resource sub-network based on a first model to generate a first responsiveness curve, wherein the first model includes a sparse expert model based on a gating mechanism; S2, performing initial optimization and joint optimization on the first model, wherein the initial optimization updates preset network parameters of the active resource sub-network using an attention distillation optimization algorithm, and the joint optimization optimizes the first model parameters using a prediction error between the first responsiveness curve and historical data; S3, generating a second response capability curve based on the optimized first model and the virtual power plant prediction data; S4: Calculate the peak-valley arbitrage profit based on the data parameters of the second response capability curve and output the virtual power plant response capability evaluation result.
[0022] This embodiment, by constructing a sparse expert model based on a gating mechanism, helps overcome the reliance of traditional virtual power plant response capability assessment methods on a single, unified model. It establishes dedicated subnetworks for different resource types, such as energy storage, adjustable loads, and distributed power sources. Combined with dynamic gating to select active resource subnetworks, this approach accurately characterizes the operational constraints and dynamic adjustment characteristics of various resources under multiple operating scenarios, improving prediction accuracy and interpretability in heterogeneous multi-resource environments. By introducing an attention distillation optimization algorithm, a knowledge transfer mechanism based on relevance weights is established between active resource subnetworks, enabling targeted optimization of weak expert subnetworks. This significantly enhances the model's generalization and robustness, reducing prediction bias caused by varying operating states and electricity price curves. By integrating time-of-use electricity prices into the evaluation phase to calculate peak-valley arbitrage benefits and integrating economic indicators with segmented capability curves, it simultaneously quantifies technical capabilities and economic benefits, avoiding the decision-making distortion caused by the separation of capability assessment and economic analysis in traditional methods. This effectively addresses the issues of insufficient resource heterogeneity handling, lack of segmented capability characterization, and the separation of benefit assessment and capability assessment in existing technologies.
[0023] S1. Dynamically select an active resource sub-network based on a first model to generate a first response capability curve. The first model includes a sparse expert model based on a gating mechanism.
[0024] In this embodiment, the first model includes a sparse gating network, several resource sub-networks, an aggregation layer and an attention distillation module. The attention distillation module is set between each resource sub-network and updates the preset network parameters of the active resource sub-network through the attention distillation optimization algorithm.
[0025] In this embodiment, the dynamic selection of the active resource sub-network based on the first model is specifically as follows: The gating score of each resource sub-network is calculated based on the sparse gating network at the anchor point, and the gating score is normalized to obtain the activation probability of each resource sub-network; The resource subnetwork whose activation probability meets the preset activation threshold is selected as the active resource subnetwork.
[0026] It should be noted that the first model is different from the traditional fixed-structure multi-expert model. By setting up a sparse gating network to dynamically select active resource sub-networks in each computing cycle instead of fully activating them, it significantly reduces the amount of computation and reduces inference latency, making it suitable for the quasi-real-time scheduling needs of virtual power plants. Furthermore, the sparse gating network dynamically adjusts the expert selection according to the input features, so that the first model can select the optimal expert combination under different electricity price curves, resource availability and load characteristics, thereby improving its adaptability in multiple scenarios.
[0027] It should be noted that the resource sub-networks are independently constructed for different adjustable resources, avoiding the performance degradation caused by "average modeling" of different resource characteristics in a single network. Taking energy storage systems, distributed photovoltaics, and adjustable loads as examples, three resource sub-networks are constructed respectively: For the energy storage system, an energy storage system resource subnetwork is constructed based on a two-layer bidirectional long short-term memory network; for the adjustable load, an adjustable load resource subnetwork is constructed based on a one-dimensional convolutional neural network and a gated recurrent unit; for distributed photovoltaics, a distributed photovoltaic resource subnetwork is constructed based on a convolutional neural network and a long short-term memory network.
[0028] It should be noted that the calculation of the gating score of each resource sub-network is specifically as follows: First, the first feature input vector is parsed. From the first feature input vector, the corresponding feature columns are assigned to the input channels of each resource subnetwork according to the adjustable resource type. For example, the energy storage system resource subnetwork receives the energy storage state of charge and time-of-use electricity price, the adjustable load resource subnetwork receives the adjustable load forecast value and time-of-use electricity price, and the distributed photovoltaic resource subnetwork receives the distributed photovoltaic power forecast value. The time feature is assigned to each resource subnetwork, and the derived feature is assigned to the corresponding resource subnetwork. At the anchor point, the first feature input vector is fed into the sparse gating network; The sparse gating network encodes the time features in the first feature input vector and maps the discrete time features into a continuous time encoding vector; Extracting corresponding resource feature subsets from the first feature input vector according to the adjustable resource type to form resource feature vectors for each adjustable resource type. Taking energy storage systems, distributed photovoltaic systems, and adjustable loads as examples, a storage resource feature vector, a photovoltaic resource feature vector, and an adjustable load resource feature vector are formed. The time code vector is concatenated or multi-channel fused with the feature vectors of each resource to form the fused input tensor of the sparse gating network:
[0029] in, is the fused input tensor, is the energy storage resource characteristic vector, is the photovoltaic resource characteristic vector, is the characteristic vector of the adjustable load resource, is the time encoding vector; The sparse gating network performs forward computation on the fused input tensors:
[0030]
[0031] in, is the gated hidden layer output, is a nonlinear activation function, such as ReLU, GELU or SiLU, is the first layer weight matrix, is the fused input tensor, is the first layer bias vector, For adjustable resources The transposed vector of the corresponding resource sub-network's gating weight vector, For adjustable resources The corresponding gate bias scalar of the resource sub-network, For adjustable resources the corresponding raw gating score; Normalize all the original gating scores to get the activation probability of each resource sub-network:
[0032] in, For adjustable resources The activation probability of the corresponding resource sub-network, is an exponential function, For adjustable resources The corresponding raw gating score, is the Softmax temperature coefficient, and , is the index set of the resource sub-network collection, for example:
[0033] A resource sub-network whose activation probability meets a preset activation threshold is selected as an active resource sub-network, where meeting the activation threshold means that the activation probability is greater than or equal to the preset activation threshold.
[0034] In this embodiment, the generating of the first responsiveness curve is specifically as follows: Construct the first input feature vector based on the historical time window and convert it into a time series input tensor; Extract resource-specific input tensors corresponding to each adjustable resource type from the time series input tensor and input them into the corresponding active resource sub-network; The active resource sub-network performs forward computation and resource constraint processing on resource-specific input tensors, and outputs a multi-time segmented response capability prediction vector; At the aggregation layer, the response capacity prediction vectors of all time segments are weighted and summed according to the activation probability of each active resource sub-network to generate the first response capacity curve.
[0035] It should be noted that the specific construction method of the first input feature vector is: Time-align the historical data of the virtual power plant according to a unified sampling interval (such as 5 minutes or 15 minutes), and interpolate missing data to ensure the continuity of the time axis; Use preset threshold checks and statistical monitoring methods to eliminate abnormal values in the virtual power plant's historical data (such as data points where SOC is greater than 100% or less than 0%, sudden changes in time-of-use electricity prices, data points where the predicted PV power exceeds the rated power of the PV system, and data points where the predicted adjustable load is less than 0 or exceeds the system's maximum adjustable capacity). Replace the abnormal values with the average value of the adjacent values or the interpolated value. Normalizing the energy storage state of charge, time-of-use electricity price, distributed photovoltaic power forecast value, and adjustable load forecast value, and saving the normalization parameters so that the same scale is used when obtaining the second input feature vector; Generate time features based on the timestamp of each data record, and calculate derived features based on the original time series (such as the average, variance, maximum, minimum, and rate of change of energy storage state of charge, time-of-use electricity price, distributed photovoltaic power forecast value, and adjustable load forecast value over the past several time steps); The preprocessed data are concatenated into a multidimensional feature vector for a single time step according to the preset field order:
[0036] in, For the moment The multidimensional feature vector of For the moment The energy storage state of charge, For the moment Time-of-use electricity prices, For the moment The predicted value of distributed photovoltaic power, For the moment Adjustable load forecast value, For the moment Historical response invitation information, For the moment The time characteristics of For the moment The derived characteristics of Preprocessing operators, that is, performing time alignment, missing value filling, outlier replacement, normalization or standardization on the data; In the time dimension, the multidimensional feature vectors in the historical window are arranged in chronological order to form the first input feature vector:
[0037] in, Anchor moment The first input feature vector of is the history window length.
[0038] It should be noted that the historical data of the virtual power plant includes the energy storage charge state, time-of-use electricity price, distributed photovoltaic power forecast value, adjustable load forecast value and historical response invitation parameters; the virtual power plant prediction data includes the energy storage charge state, time-of-use electricity price, distributed photovoltaic power forecast value, adjustable load forecast value and response invitation parameters.
[0039] Furthermore, the historical data of the virtual power plant is based on the anchor point time. As the reference point, the historical sequence data obtained by looking back is ,in is the length of the historical window; the virtual power plant prediction data is based on the anchor point time As the starting point, the predicted sequence data obtained by extending backward is ,in is the prediction window length.
[0040] Furthermore, the energy storage charge state, time-of-use electricity price, distributed photovoltaic power forecast value, adjustable load forecast value and historical response invitation parameters are the minimum implementable data set of this embodiment. It should be noted that the historical window is , the prediction window is .
[0041] It should be noted that the conversion into a time series input tensor is specifically as follows: the first input feature vector of each moment in the historical window is stacked in chronological order to form a two-dimensional array (time × feature), which is the time series input tensor.
[0042] It should be noted that the resource-specific input tensor corresponding to each adjustable resource type is extracted from the timing input tensor and input into the corresponding active resource sub-network, specifically: First, establish a "feature-resource mapping table" using energy storage systems, distributed photovoltaics, and adjustable loads as an example, as shown in Table 1: Table 1 Feature-resource mapping table
[0043] Select fields from the time series input tensor according to the "Feature-Resource Mapping Table" to form resource-specific input tensors, such as energy storage input vectors, distributed photovoltaic input vectors, and adjustable load input vectors.
[0044] It should be noted that the active resource subnetwork performs forward computation on resource-specific input tensors, specifically: First, perform time encoding to encode the resource-specific input tensor into a time position that is consistent with the training. The processed resource-specific input tensor is fed into the time series modeling unit of the active resource sub-network. The time series modeling unit can be a causal one-dimensional convolutional network, a recurrent neural network, or a lightweight attention network. It is used to extract the time series correlation and trend information of multiple time step features within the anchor window and output a time step feature sequence. Extract anchor context features from the time-step feature sequence using a fixed aggregation method. This aggregation method includes directly taking the features of the last time step in the window, or weighting the time-step feature sequence in the entire historical window by attention weights, or using exponential decay weighting to enhance the importance of recent information. The anchor point context features are input into the multi-time segment prediction module of the active resource sub-network. The multi-time segment prediction module can be a multi-layer perceptron or an equivalent structure, and outputs the initial response capability prediction vector of the multiple time segments within the time window.
[0045] Furthermore, taking the time series modeling unit using a lightweight Transformer encoder as an example, the processing process is as follows: The multi-head self-attention layer generates query, key, value matrices through trainable weights. For each time step , calculate all the history windows that are no later than Time step The similarity score of , and add a causal mask to mask future moments:
[0046] in, is the time step For time steps The similarity score of is the time step The query vector, is the time step The key vector of are the dimensions of the query vector and key vector, It is a causal mask; Normalize to get the attention weight:
[0047] in, is the time step For time steps The attention weight, For Take the index, is the causal mask constraint, which means that only the current and past time steps can be referenced, and future information cannot be used; all attention weights are combined to obtain the attention weight matrix; The value vector is weighted and summed using the attention weight to obtain the context representation of each time step, and the context representations of all time steps in the history window are combined to obtain the time step feature sequence.
[0048] Furthermore, taking the feature of the last time step of the window as the anchor context feature, the multi-time segment prediction module adopts the multi-layer perceptron structure as an example. The processing process is as follows:
[0049] in, is the initial response capability prediction vector for multiple time segments, is the anchor context feature, For the The weight matrix of the layer, is the number of layers of the multi-layer perceptron, is a nonlinear activation function, For the The bias vector of the layer.
[0050] It should be noted that the resource constraint processing is specifically as follows: Execute capacity constraint processing: Based on the available capacity upper limit corresponding to the adjustable resource, limit the initial response capacity forecast value of each time segment to not exceed the capacity upper limit. If it exceeds the capacity upper limit, the capacity upper limit value is used; Power change rate constraint processing is performed: Based on the maximum adjustment rate allowed by the adjustable resource, the change range of the initial response capacity prediction value of adjacent time segments is limited to ensure that the change of the response capacity conforms to the physical adjustment characteristics and avoid sudden changes; Perform operating power range constraint processing: further truncate the initial response capability prediction value of each time segment according to the operating power range allowed by the adjustable resources.
[0051] Furthermore, after performing resource constraint processing on the initial response capability prediction vector of multiple time segments, a response capability prediction vector of multiple time segments is obtained.
[0052] It should be noted that, at the aggregation layer, the response capability prediction vectors of all time segments are weighted and summed according to the activation probability of each active resource sub-network to generate the first response capability curve, which is specifically: Normalize the activation probabilities corresponding to all active resource sub-networks to obtain normalized activation weights; The response capacity prediction vectors output by all active resource sub-networks are organized into a resource-segment matrix in rows, and the normalized activation weights are organized into column vectors. The weighted calculation of every two response capacity prediction vectors is performed through matrix multiplication to obtain the first response capacity curve.
[0053] S2. Perform initial optimization and joint optimization on the first model. The initial optimization updates the preset network parameters of the active resource sub-network through an attention distillation optimization algorithm. The joint optimization optimizes the first model parameters through the prediction error between the first responsiveness curve and historical data.
[0054] In this embodiment, the initial optimization specifically includes the following steps: Combine the multi-time segment response capability prediction vectors output by each active resource sub-network to generate an expert output set; Construct a distillation loss function based on the attention relevance weights and the difference in prediction results; Taking the distillation loss as the optimization target, gradient backpropagation is performed on the preset network parameters of the active resource sub-network, which include the active resource sub-network weights, the sparse gating network weights, and the attention mapping weights.
[0055] It should be noted that the initial optimization, that is, updating the preset network parameters of the active resource sub-network through the attention distillation optimization algorithm, introduces a multi-head attention mechanism to calculate the correlation weights between the active resource sub-networks, thereby weighting the prediction differences to form a more targeted distillation loss, ensuring that the distillation is context-aware; for the first model, the active resource sub-network may be different at each anchor point. The attention distillation optimization algorithm dynamically constructs a distillation relationship based on the current active resource sub-network at each anchor point, ensuring that distillation is only performed between the resource sub-networks that are currently actually involved in decision-making, reducing the interference of irrelevant knowledge.
[0056] It should be noted that the distillation loss function is specifically:
[0057] in, is the distillation loss, is the number of active resource subnetworks, 、 is the resource sub-network index, For the Active resource subnetworks and The correlation weights between active resource sub-networks, The responsiveness prediction vector and the responsiveness prediction vector The difference in prediction results.
[0058] It should be noted that the gradient backpropagation and update can adopt an adaptive optimization algorithm such as stochastic gradient descent or Adam; the gradient backpropagation and update continue until the distillation loss converges or the maximum number of iterations is reached.
[0059] It should be noted that the preset network parameters of the active resource sub-network include the active resource sub-network weight, the sparse gating network weight, and the attention mapping weight: The active resource subnetwork weight is located inside each resource subnetwork in the first model. For example, for the energy storage system resource subnetwork constructed based on a two-layer bidirectional long short-term memory network, the active resource subnetwork weight is the total input weights, hidden state weights and bias parameters of the two-layer Bi-LSTM; for the adjustable load resource subnetwork constructed based on a one-dimensional convolutional neural network and a gated recurrent unit, the active resource subnetwork weight is the convolution kernel parameters of the 1D convolution layer and all the gating weights and biases of the GRU unit; for the distributed photovoltaic resource subnetwork constructed based on a convolutional neural network and a long short-term memory network, the active resource subnetwork weight is the weights and biases of each convolution layer of the CNN, as well as all the gating weights and biases of the LSTM unit; The sparse gating network weights are the weight matrix and bias vector located in the fully connected layer; The attention mapping weights are the query weight matrix, key weight matrix, and value weight matrix used to generate relevance weights in the attention distillation optimization algorithm.
[0060] In this embodiment, the specific acquisition method based on the attention relevance weight and the difference in prediction results is as follows: Extract the intermediate layer features of each active resource sub-network and calculate the correlation weight between any two active resource sub-networks through the multi-head attention mechanism; Extract the response capability prediction vector corresponding to the active resource sub-network from the expert output set; The difference vector between the response capacity prediction vectors of any two active resource sub-networks is calculated, and the square of the dichotomy norm of the difference vector is used as the prediction result difference.
[0061] It should be noted that the calculation process of the correlation weight is: Perform linear mapping on the response capability prediction vector of each active resource sub-network in the expert output set to obtain the query vector, key vector and value vector; calculate the first Active resource subnetworks and The similarity scores between the active resource sub-networks are normalized by softmax to obtain the correlation weights. .
[0062] It should be noted that the difference in the prediction results is calculated as follows:
[0063] in, The responsiveness prediction vector and the responsiveness prediction vector The difference in prediction results.
[0064] In this embodiment, the joint optimization comprises the following specific steps: Obtain the first response capability curve and the historical response capability curve; Calculate the mission loss of the first response capability curve and the historical response capability curve; Construct a joint loss function based on distillation loss and task loss; Taking the joint loss function as the optimization objective, gradient backpropagation is performed on the first model parameters of the active resource sub-network; the first model parameters include the weights of each resource sub-network, the sparse gating network weights, and the attention mapping weights.
[0065] It should be noted that the historical response capability curve is usually derived from the actual dispatching execution records in the historical operation cycle of the virtual power plant. The output sequence with the same time dimension and segmentation rules as the historical data of the virtual power plant is extracted from the actual dispatching execution records, and resampled and aligned according to the same historical window and time segmentation method to obtain a historical response capability curve consistent with the first response capability curve.
[0066] It should be noted that the calculation process of the task loss is as follows: First, the rated scale difference is eliminated and the first response capability curve and the historical response capability curve are normalized to the same scale; Calculate the task loss according to the mean square error formula:
[0067] in, For mission loss, is the number of sample batches, is the number of predicted time segments within each sample, For the The sample in The predictive response capability of each time segment, For the The sample in The historical response capability of each time segment, For the The scale normalization coefficient of each sample; the sample batch is a first curve-historical curve pair corresponding to multiple anchor points participating in the comparison, the predicted response capability is extracted from the first response capability curve, and the historical response capability is extracted from the historical response capability curve.
[0068] It should be noted that the joint loss function is specifically:
[0069] in, For joint losses, is the task loss weighting coefficient, is the distillation loss weighting coefficient.
[0070] Furthermore, the joint training optimization with the joint loss function as the optimization target simultaneously optimizes the prediction accuracy and the collaboration ability of the resource sub-networks, accelerates the model convergence speed, reduces the performance degradation during long-term training, and effectively prevents the capacity of some resource sub-networks from decreasing when inactive, thereby improving the reliability and economy of the response capability assessment during the long-term operation of the virtual power plant.
[0071] Furthermore, the difference between the joint training optimization and the initial optimization is that: The initial optimization takes knowledge transfer between expert sub-networks as the sole optimization goal and narrows the differences in prediction accuracy and pattern learning between different resource sub-networks by constructing a distillation loss function. Joint training optimization introduces task loss and distillation loss to construct a joint loss function, which optimizes the first model in both prediction accuracy and generalization ability, speeds up convergence, and reduces performance degradation under long-term training.
[0072] Furthermore, the initial optimization is performed before the joint loss optimization because: Initially, weak experts are optimized to quickly learn the prediction distribution of strong experts, balance expert capabilities, and reduce gradient conflicts and oscillations during direct joint training. Strong experts are resource sub-networks with higher prediction accuracy, smaller errors, and higher activation probabilities in historical training. Weak experts are resource sub-networks with lower prediction accuracy and relatively lower activation probabilities. Provide indirect gradient signals to low-activity resource sub-networks during the distillation phase to prevent capacity solidification due to long-term inactivity. Performing initial optimization first can narrow the gap between active resource sub-networks, enhance the quality of distillation signals, make the gradient direction more consistent during joint training optimization, and improve optimization efficiency and prediction accuracy.
[0073] It should be noted that the weights of each resource sub-network are updated by introducing load balancing or coverage regularization on the gating side. For example, the activation frequency of each resource sub-network within a near window is counted and compared with the target frequency to construct a balanced loss. Furthermore, by periodically adjusting the gating temperature or threshold, or adopting a rotational or random activation strategy, all resource sub-networks can be activated and trained over the long term.
[0074] S3: Generate a second response capability curve based on the optimized first model and the virtual power plant prediction data.
[0075] In this embodiment, the second response capability curve is generated based on the optimized first model and the virtual power plant prediction data, specifically: Obtain virtual power plant prediction data and preprocess it to construct a second input feature vector; The second input feature vector is input into the optimized first model to generate a second responsiveness curve.
[0076] It should be noted that the construction process and feature structure of the second input feature vector are basically the same as those of the first input feature vector.
[0077] It should be noted that the second input feature vector is input into the optimized first model to generate the second response capability curve, specifically: The second input feature vector is input into the optimized first model. The sparse gating network parses the second input feature vector, calculates the gating score of each resource sub-network, and normalizes the gating score to obtain the activation probability of each resource sub-network. The resource sub-network whose activation probability meets the preset activation threshold is selected as the active resource sub-network.
[0078] Based on the second input feature vector of the prediction window, a time series input tensor is constructed. Resource-specific input tensors corresponding to each adjustable resource type are extracted from the time series input tensor and input into the corresponding active resource sub-network. The active resource sub-network performs forward calculations and applies resource constraint processing to obtain response capability prediction vectors for multiple time segments. At the aggregation layer, based on the activation probabilities corresponding to the active resource sub-networks, a weighted calculation is performed on the responsiveness prediction vectors of all time segments to generate a second responsiveness curve.
[0079] S4: Calculate the peak-valley arbitrage profit based on the data parameters of the second response capability curve and output the virtual power plant response capability evaluation result.
[0080] In this embodiment, the peak-valley arbitrage benefits are calculated based on the data parameters of the second response capability curve, and the virtual power plant response capability evaluation result is output, specifically: Identify the peak-shaving and valley-filling periods of the time-of-use electricity price series in the virtual power plant forecast data; Combining the second response capability curve with the preset peak-valley arbitrage formula, the arbitrage profit value is calculated during the peak-shaving period and the valley-filling period respectively; Accumulate the profit values of each period to obtain the peak-valley arbitrage profit; Based on the second response capability curve and the peak-valley arbitrage profit, an evaluation result vector is constructed and the virtual power plant response capability evaluation result is output.
[0081] It should be noted that the identification of the peak-shaving period and valley-filling period of the time-of-use electricity price sequence in the virtual power plant forecast data is specifically as follows: Extract time-of-use electricity price series from virtual power plant forecast data; According to the grid dispatching rules or virtual power plant operation strategies, the peak shaving threshold and valley filling threshold are preset. The time period when the time-of-use electricity price is higher than the peak shaving threshold is regarded as the peak shaving period, and the time period when the time-of-use electricity price is lower than the valley filling threshold is regarded as the valley filling period.
[0082] It should be noted that the preset peak-valley arbitrage formula is specifically as follows: Peak shaving period:
[0083] in, To cut the peak period revenue, is the time step index, During the peak shaving period, For the Time-of-use electricity price for each time step, For the The positive power part of the time step, is the duration of a single time step; Valley filling period:
[0084] in, For the valley-filling period income, is the time step index, It is the valley filling period. For the Time-of-use electricity price for each time step, For the The negative power part of the time step, is the duration of a single time step.
[0085] It should be noted that the second response capability curve is combined with the preset peak-valley arbitrage formula to calculate the arbitrage profit value in the peak shaving period and the valley filling period, respectively, as follows: Extracting the discharge power and charging power components of each time segment based on the response capability prediction vectors of the multiple time segments in the second response capability curve, where the discharge power is positive power and the charging power is negative power; Based on the peak-valley arbitrage formula, the arbitrage profit value of each peak-cutting period and valley-filling period is calculated.
[0086] It should be noted that the evaluation result vector is specifically:
[0087]
[0088] in, is the evaluation result vector, is the response capacity prediction vector of multiple time segments in the second response capacity curve, is the accumulated peak-to-valley arbitrage profit, To cut the peak period revenue, It is the profit during the valley period.
[0089] Furthermore, after constructing the evaluation result vector, the system can and At the same time, threshold judgment or rule matching is performed as input for the next step of scheduling or execution; and the vector structured output is convenient for archiving and comparison, and in the future, it can be used according to different input scenarios. The value is used to retrospectively evaluate the deviation between the prediction accuracy and profit realization of the first model. If the output is not unified as a vector, the output formats of different modules will be inconsistent, which will make it difficult to access subsequent training, evaluation, optimization and other processes.
[0090] It should be noted that the virtual power plant response capability evaluation result is an evaluation result vector structured in JSON or data table format.
[0091] Example 2, This embodiment provides an electronic device, such as Figure 4 As shown, including: at least one processor; and a memory communicatively coupled to the at least one processor; The memory stores instructions that can be executed by at least one processor, so that the at least one processor can execute: dynamically selecting an active resource subnetwork based on a first model to generate a first responsiveness curve, wherein the first model includes a sparse expert model based on a gating mechanism; performing initial optimization and joint optimization on the first model, wherein the initial optimization updates preset network parameters of the active resource subnetwork using an attention distillation optimization algorithm, and the joint optimization optimizes the first model parameters using a prediction error between the first responsiveness curve and historical data; generating a second response capability curve based on the optimized first model and the virtual power plant prediction data; According to the data parameters of the second response capability curve, the peak-valley arbitrage profit is calculated and the response capability evaluation result of the virtual power plant is output.
[0092] The above formulas are all dimensionless and numerical calculations. The formulas are obtained by collecting a large amount of data and performing software simulation to obtain the most recent real situation. The preset parameters in the formulas are set by technicians in this field according to actual conditions.
[0093] The above embodiments may be implemented in whole or in part through software, hardware, firmware, or any other combination thereof. When implemented using software, the above embodiments may be implemented in whole or in part in the form of a computer program product.
[0094] Those skilled in the art will appreciate that the modules and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0095] In addition, each functional module in each embodiment of the present application may be integrated into one processing module, or each module may exist physically separately, or two or more modules may be integrated into one module.
[0096] The above description is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims.
[0097] Finally: The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A virtual power plant response capability evaluation method, characterized in that: The following steps are involved: dynamically selecting an active resource subnetwork based on a first model to generate a first responsiveness curve, wherein the first model includes a sparse expert model based on a gating mechanism; performing initial optimization and joint optimization on the first model, wherein the initial optimization updates preset network parameters of the active resource subnetwork using an attention distillation optimization algorithm, and the joint optimization optimizes the first model parameters using a prediction error between the first responsiveness curve and historical data; generating a second response capability curve based on the optimized first model and the virtual power plant prediction data; According to the data parameters of the second response capability curve, the peak-valley arbitrage profit is calculated and the response capability evaluation result of the virtual power plant is output.
2. The virtual power plant response capability evaluation method according to claim 1, characterized in that: The first model includes a sparse gating network, several resource sub-networks, an aggregation layer and an attention distillation module. The attention distillation module is set between each resource sub-network and updates the preset network parameters of the active resource sub-network through the attention distillation optimization algorithm.
3. The virtual power plant response capability evaluation method according to claim 2, characterized in that: The dynamic selection of the active resource sub-network based on the first model is specifically as follows: The gating score of each resource sub-network is calculated based on the sparse gating network at the anchor point, and the gating score is normalized to obtain the activation probability of each resource sub-network; The resource subnetwork whose activation probability meets the preset activation threshold is selected as the active resource subnetwork.
4. The method for evaluating the response capability of a virtual power plant according to claim 3, wherein: The generating of the first response capability curve is specifically as follows: Construct the first input feature vector based on the historical time window and convert it into a time series input tensor; Extract resource-specific input tensors corresponding to each adjustable resource type from the time series input tensor and input them into the corresponding active resource sub-network; The active resource sub-network performs forward computation and resource constraint processing on resource-specific input tensors, and outputs a multi-time segmented response capability prediction vector; At the aggregation layer, the response capacity prediction vectors of all time segments are weighted and summed according to the activation probability of each active resource sub-network to generate the first response capacity curve.
5. The method for evaluating the response capability of a virtual power plant according to claim 4, wherein: The initial optimization specifically includes the following steps: Combine the multi-time segment response capability prediction vectors output by each active resource sub-network to generate an expert output set; Construct a distillation loss function based on the attention relevance weights and the difference in prediction results; Taking the distillation loss as the optimization target, gradient backpropagation is performed on the preset network parameters of the active resource sub-network, which include the active resource sub-network weights, the sparse gating network weights, and the attention mapping weights.
6. The method for evaluating the response capability of a virtual power plant according to claim 5, characterized in that: The specific method of obtaining the attention correlation weight and the prediction result difference is: Extract the intermediate layer features of each active resource sub-network and calculate the correlation weight between any two active resource sub-networks through the multi-head attention mechanism; Extract the response capability prediction vector corresponding to the active resource sub-network from the expert output set; The difference vector between the response capacity prediction vectors of any two active resource sub-networks is calculated, and the square of the dichotomy norm of the difference vector is used as the prediction result difference.
7. The method for evaluating the response capability of a virtual power plant according to claim 6, wherein: The joint optimization specifically comprises the following steps: Obtain the first response capability curve and the historical response capability curve; Calculate the mission loss of the first response capability curve and the historical response capability curve; Construct a joint loss function based on distillation loss and task loss; Taking the joint loss function as the optimization objective, gradient backpropagation is performed on the first model parameters of the active resource sub-network; the first model parameters include the weights of each resource sub-network, the sparse gating network weights, and the attention mapping weights.
8. The method for evaluating the response capability of a virtual power plant according to claim 7, wherein: The second response capability curve is generated based on the optimized first model and the virtual power plant prediction data, specifically: Obtain virtual power plant prediction data and preprocess it to construct a second input feature vector; The second input feature vector is input into the optimized first model to generate a second responsiveness curve.
9. The method for evaluating the response capability of a virtual power plant according to claim 8, characterized in that: The peak-valley arbitrage benefits are calculated based on the data parameters of the second response capability curve, and the virtual power plant response capability evaluation result is output, specifically: Identify the peak-shaving and valley-filling periods of the time-of-use electricity price series in the virtual power plant forecast data; Combining the second response capability curve with the preset peak-valley arbitrage formula, the arbitrage profit value is calculated during the peak-shaving period and the valley-filling period respectively; Accumulate the profit values of each period to obtain the peak-valley arbitrage profit; Based on the second response capability curve and the peak-valley arbitrage profit, an evaluation result vector is constructed and the virtual power plant response capability evaluation result is output.
10. An electronic device, characterized in that: The method comprises a processor, a memory and a network interface connected to the processor; the network interface is connected to a non-volatile memory in a server; the processor retrieves a computer program from the non-volatile memory through the network interface during operation, and runs the computer program through the memory to execute the method according to any one of claims 1 to 9.
Citation Information
Patent Citations
Virtual power plant collaborative optimization scheduling method and system based on deep reinforcement learning
CN119494521A
Multi-modal large model dynamic compression and reasoning optimization method based on MoE architecture
CN120409694A
Virtual power plant resource optimization scheduling system based on multi-head self-calibration tensor factorization
CN120542867A
Mixture of experts neural networks
US20190251423A1
Cited By
Reactive compensation control optimization method and device for continuously adjustable new energy compensation filter
CN121076841A
Virtual power plant dynamic aggregation method and system based on Transform and AdaptMLP
CN121457746A