Photovoltaic energy storage system adaptive power allocation method based on reinforcement learning
By using a reinforcement learning-based method, the decision sensitivity of nodes is dynamically clustered and virtual node states are constructed to generate optimal energy storage charging and discharging power allocation instructions. This solves the problem of inaccurate power allocation in traditional photovoltaic energy storage systems and improves the stability and economy of the system.
Patent Information
- Application Number
- CN202611254727.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-18
- Publication Date
- 2026-11-24
AI Technical Summary
Traditional photovoltaic energy storage system scheduling methods cannot quantify the differentiated decision-making influence of each node on system scheduling in real time, resulting in the inability to achieve fine-grained adaptive optimal power allocation and problems such as energy storage exceeding limits, accelerated lifespan loss, and large power fluctuations.
By employing a reinforcement learning-based approach, the system dynamically clusters node decision-making sensitivities by collecting real-time data from the photovoltaic-storage-load system, constructs virtual node states, generates optimal energy storage charging and discharging power allocation commands using a main Actor network and an auxiliary Actor network, and evaluates and updates network parameters through a Critic network to achieve hierarchical collaborative control.
It achieves precise power allocation for photovoltaic energy storage systems, enhances the system's overall optimization capabilities, solves the operational imbalance problem under traditional scheduling modes, and ensures the system's stability and economy.
Smart Images

Figure CN123163031A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of photovoltaic energy storage technology, specifically an adaptive power allocation method for photovoltaic energy storage systems based on reinforcement learning. Background Technology
[0002] With the large-scale grid connection of distributed photovoltaic and energy storage clusters, the operating conditions of photovoltaic-storage-load systems fluctuate significantly and the nodes exhibit strong heterogeneity. Traditional photovoltaic-storage power allocation schemes have obvious technical shortcomings.
[0003] Existing scheduling methods mostly rely on fixed parameters, static thresholds, and uniform distribution strategies, which cannot quantify the influence of each node on the system scheduling in real time. The scheduling weights are fixed, making it difficult to adapt to complex dynamic working conditions and resulting in insufficient global optimization capabilities.
[0004] Meanwhile, traditional scheduling lacks a hierarchical and coordinated control mechanism, which cannot take into account both the overall system operation benefits and the safety constraints of individual nodes. This can easily lead to a contradiction between overall economic optimization and local node operation imbalance, resulting in problems such as energy storage exceeding limits, accelerated lifespan loss, and large power fluctuations. Consequently, it is impossible to achieve refined power allocation for photovoltaic energy storage systems. Summary of the Invention
[0005] (a) Technical problems to be solved To address the aforementioned technical problems, the present invention aims to provide an adaptive power allocation method for photovoltaic energy storage systems based on reinforcement learning, thereby solving the technical problem that photovoltaic energy storage systems struggle to achieve precise adaptive optimal power allocation and greatly improving the accuracy of power allocation.
[0006] (II) Technical Solution To achieve the above objectives, the present invention provides the following technical solution: an adaptive power allocation method for a photovoltaic energy storage system based on reinforcement learning, the method comprising: Real-time acquisition of operational data from each node of the photovoltaic-storage-load system and the power grid; dynamic clustering of decision sensitivity of each node based on the current scheduling strategy; weighted synthesis of virtual node states corresponding to each category according to decision influence within the category; and construction of system state. The system state is input into the main Actor network and auxiliary Actor network of reinforcement learning, which generate the reference power of each node cluster and the single node deviation correction amount, and after superposition, the optimal energy storage charging and discharging power allocation command is output. Execute the power allocation command to complete the power transfer between photovoltaic, energy storage, load and grid; Collect the running data for the next moment, evaluate the merits of this allocation action through the Critic network, and update the weight parameters of the main Actor network, auxiliary Actor network, and Critic network through backpropagation. Repeat the above steps to iteratively optimize the scheduling strategy online.
[0007] Preferably, the specific logic for generating the system state is as follows: Collect the physical state vectors of all nodes at time t, input them into the Actor network for forward propagation to obtain the action distribution; Freeze the network parameters, calculate the Jacobian matrix of state features with respect to the log probability of actions for each node, extract the norm of each action dimension, and obtain the instantaneous sensitivity vector of each node. The driving metrics are calculated node by node, and the window length of each node is updated by dynamically adjusting the algorithm. Historical sensitivity sequences are extracted based on window length and fused to obtain an effective sensitivity vector; Using the effective sensitivity vectors of all nodes as feature inputs, online K-Means dynamic clustering is performed to obtain multiple node clusters; For each node cluster, normalization is performed based on the modulus of the effective sensitivity of each node in the cluster to obtain the intra-class weight. The running data of all nodes in the cluster are weighted and merged according to the corresponding weight to generate the virtual representative node state of the corresponding node cluster. The system state is composed of the virtual representative node states. Save the sensitivity data, cluster labels, and status data at the current moment for adaptive adjustment of the historical window at the next moment.
[0008] Preferably, the driving metric is calculated node by node, and the window length of each node is updated dynamically by adjusting the algorithm, including: Four adjustment driving indicators were calculated for each node: sensitivity temporal fluctuation, physical state change rate, global policy convergence, and node clustering membership stability. The four driving indicators are weighted and fused to obtain the comprehensive adjustment factor for the corresponding node. The positive or negative sign of the comprehensive adjustment factor represents the direction of increase or decrease of the window length, and the absolute value of the comprehensive adjustment factor represents the adjustment range of the window length. The window adjustment step size at the current moment is calculated by combining the preset maximum adjustment amount per step with the comprehensive adjustment factor. The initial window length at the current moment is obtained by superimposing the historical window length of the previous moment with the current window adjustment step size. Then, the initial window length is constrained by the preset upper and lower limits of the window length, and the final historical window length at the current moment is output. When the absolute value of the comprehensive adjustment factor is less than the preset hysteresis threshold, the window length adjustment is not performed, and the historical window length of the previous moment of the node is directly used.
[0009] Preferably, the specific process for generating the optimal energy storage charging and discharging power allocation command is as follows: The virtual node system state is input into the main Actor network, and the reference charge and discharge power of the energy storage cluster corresponding to each node cluster is output through forward propagation. The original lightweight state characteristics of all nodes are input into the lightweight auxiliary Actor network, and the deviation correction amount of each physical energy storage node relative to the reference power of its cluster is output through forward propagation. The original lightweight state characteristics of all nodes include at least one of node SOC deviation rate, real-time power fluctuation amount, and health coefficient. Based on the amplitude threshold setting strategy, the upper and lower limits of the amplitude are preset for each deviation correction amount, and the value range of the deviation correction amount is constrained. For each physical energy storage node, the reference charge / discharge power of the energy storage cluster corresponding to its node cluster is superimposed with the deviation correction amount of that node to generate the charge / discharge power allocation command for each energy storage node.
[0010] Preferably, the amplitude threshold setting strategy is as follows: Extract the effective sensitivity modulus of the virtual nodes corresponding to each node cluster, and combine it with a preset reference threshold to generate the cluster-level baseline limiting ratio for each node cluster; For each energy storage node within a node cluster, the initial relative weight corresponding to the effective sensitivity modulus of a single node is calculated based on the effective sensitivity modulus of the virtual nodes in that cluster. Obtain the clustering membership confidence of each node, and use the membership confidence to correct the initial relative weights to obtain the amplitude limiting coefficient of each node; Based on the cluster-level benchmark limiting ratio and node limiting coefficient of the corresponding node cluster, and combined with the energy storage cluster benchmark charging and discharging power of the cluster, upper and lower limits of the deviation correction amplitude of the charging direction and the discharging direction are generated for each node. If the current time is the initial time, the upper and lower limits of the amplitude at the previous time will be taken as the system's preset rated amplitude limit. If the current time is not the initial time, the upper and lower limits of the deviation correction magnitude of the previous time are combined with the sliding smoothing process of the upper and lower limits of the current time. The smoothing coefficient is positively correlated with the temporal stability of the node sensitivity.
[0011] Preferably, the update process for the weight parameters of the main Actor network, auxiliary Actor network, and Critic network is as follows: Construct benefit-oriented and safety-oriented Critic networks with completely independent parameters; Collect the running data at the next moment, and decompose it into mutually independent benefit reward components and safety reward components; send the corresponding inputs into the benefit-type Critic network and the safety-type Critic network respectively; The two Critic networks independently calculate the temporal difference error based on the corresponding reward components, iteratively update their own network parameters, and calculate the policy gradient of the corresponding Actor action. By combining the overall power grid risk level, the intensity of source load fluctuations within the cluster, and the effective sensitivity of nodes, dynamic hedging weight coefficients are generated. The main Actor network uses the benefit policy gradient as the primary factor and the safety policy gradient as the secondary factor, while the auxiliary Actor network uses the safety policy gradient as the primary factor and the benefit policy gradient as the secondary factor. The final gradient is synthesized by weighting the gradients according to the hedging weight coefficients and the parameters are updated accordingly. The evaluation result deviation rate of the two Critic networks is calculated in real time. When the deviation rate continuously exceeds the preset threshold, the parameter updates of the main and auxiliary Actor networks are frozen. The updates are resumed after the evaluation deviation of the two Critic networks is converged first. The maximum number of freezing iteration steps is set. If the evaluation deviation of the two Critic networks still does not converge to within the threshold after exceeding the number of steps, the parameters of the main and auxiliary Actor networks are forcibly unfrozen and updated based on the policy gradient output by the benefit-oriented Critic network.
[0012] The present invention also provides an adaptive power allocation system for photovoltaic energy storage systems based on reinforcement learning, wherein the system uses the above-described adaptive power allocation method for photovoltaic energy storage systems based on reinforcement learning.
[0013] The present invention also provides a computer-readable storage medium storing a computer program that is executed by a processor to implement the above-described adaptive power allocation method for a photovoltaic energy storage system based on reinforcement learning.
[0014] (III) Beneficial Effects Compared with the prior art, the beneficial effects of the present invention are: This invention breaks through the limitations of traditional fixed node grouping and static state modeling in photovoltaic-storage systems, and innovatively proposes a dynamic clustering modeling method based on node decision sensitivity. By calculating the Jacobian matrix of the log probability of each node's actions, an instantaneous sensitivity vector is extracted. Combining four core driving indicators—sensitivity temporal fluctuation, physical state change, strategy convergence, and cluster stability—the method adaptively adjusts the historical sensitivity window length for each node, accurately selecting effective sensitivity features. Simultaneously, an online K-Means dynamic clustering algorithm is introduced to complete node cluster division. Virtual node states are generated by weighted fusion of the sensitivity moduli of nodes within each cluster, constructing a dynamic system state model adapted to the real-time operating characteristics of the system, achieving precise quantification of the operating state and decision influence of each node in the photovoltaic-storage load.
[0015] This invention innovatively designs a dual-network hierarchical power allocation architecture consisting of a main Actor and an auxiliary Actor, breaking away from the traditional coarse-grained scheduling mode of unified power allocation in a single network. The main Actor network outputs the benchmark charging and discharging power of each node cluster based on the clustered virtual node states, achieving macroscopic power coordination at the system level. The lightweight auxiliary Actor network relies on the original lightweight characteristics of nodes such as SOC deviation rate, power fluctuation, and health to output the deviation correction amount for each node. Simultaneously, a dynamic amplitude threshold strategy based on node sensitivity modulus and cluster membership confidence is constructed to adaptively constrain the upper and lower limits of the deviation correction amount. Furthermore, the dynamic update logic of the threshold is optimized through a time-series smoothing algorithm, realizing a hierarchical power allocation mode of "cluster-level benchmark coordination + precise node correction".
[0016] This invention constructs a parameter-independent dual-Critic network, focusing on both efficiency and safety. It decomposes and independently optimizes the efficiency and safety reward components of system operation, overcoming the limitation of traditional single-Critic networks that cannot simultaneously address scheduling economics and grid operation safety. By dynamically generating hedging weights based on grid risk level, source-load fluctuation intensity, and node effectiveness sensitivity, the gradient update logic of the main and auxiliary Actor networks is designed differently. The main Actor focuses on efficiency optimization, while the auxiliary Actor focuses on safety constraints, achieving collaborative iteration of dual objectives. Simultaneously, a dual-Critic evaluation deviation monitoring and parameter freezing convergence mechanism is added to address network iteration imbalance and convergence instability, ensuring the stability of the reinforcement learning model's online iteration. Attached Figure Description
[0017] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this invention. For those skilled in the art, other drawings can be obtained based on these drawings.
[0018] Figure 1 This is a schematic diagram of an adaptive power allocation method for photovoltaic energy storage systems based on reinforcement learning. Detailed Implementation
[0019] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be described in detail below. Obviously, the described embodiments are merely some embodiments of this invention, and not all embodiments. Based on the embodiments of this invention, all other implementation methods obtained by those skilled in the art without creative effort are within the scope of protection of this invention.
[0020] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0021] Example 1 like Figure 1 As shown, this embodiment discloses an adaptive power allocation method for a photovoltaic energy storage system based on reinforcement learning. The method includes: The system collects real-time operational data from each node of the photovoltaic-storage-load system and the power grid. Based on the current scheduling strategy, it dynamically clusters the decision sensitivity of each node and synthesizes the corresponding virtual node states according to the decision influence within each cluster, thus constructing the system state. Detailed data includes the active power output of each photovoltaic node, the state of charge (SOC) and real-time charging / discharging power of each energy storage node, and the active power of each load node. Power grid operational data includes the real-time electricity price at the grid connection point and the grid power constraint threshold. The decision sensitivity described in this paper quantifies the degree of influence of node state changes on the output action of the current scheduling strategy; higher sensitivity indicates a greater weight of the impact of node state fluctuations on scheduling decisions.
[0022] In this implementation, the specific logic for generating the system state is as follows: Collect the physical state vectors of all nodes at time t, input them into the Actor network for forward propagation to obtain the action distribution; let the physical state vector of the i-th node at time t be denoted as . , For nodal photovoltaic active power, In the state of energy storage charge, For the active power of the node load, This represents the current time-of-use electricity price on the power grid.
[0023] The action distribution output by the Actor network is the logarithmic probability distribution of the charging and discharging actions of all energy storage nodes, denoted as... ;in For action vectors, These are the parameters of the Actor network; Freeze the network parameters, calculate the Jacobian matrix of state features with respect to the log probability of actions for each node, extract the norm of each action dimension, and obtain the instantaneous sensitivity vector of each node. Specifically, freeze the Actor network parameters. Keeping the state unchanged, for the i-th node, calculate its state vector. Jacobian matrix for the logarithmic probability of actions ; For multi-action dimension scenarios, the F-norm corresponding to each action dimension is calculated separately, and the instantaneous sensitivity vector of the node is obtained by concatenating the vectors according to the dimensions. The vector dimension is consistent with the scheduling action dimension.
[0024] The driving metrics are calculated node by node, and the window length of each node is updated by dynamically adjusting the algorithm. Specifically, the driving metrics are calculated node by node, and the window length of each node is updated dynamically by adjusting the algorithm, including: Four adjustment driving indicators were calculated for each node: sensitivity temporal fluctuation, physical state change rate, global policy convergence, and node clustering membership stability. The formulas for calculating the four adjustment drivers are as follows: Sensitivity temporal fluctuation: Take the instantaneous sensitivity modulus sequence of the M most recent moments of the node and calculate the coefficient of variation. The calculation formula is: ;in, For standard deviation calculation, For mean calculation, To fix the reference window length.
[0025] Rate of change of physical state: take the nearest node Calculate the coefficient of variation of the core state variables at each time point (SOC for energy storage, active power for photovoltaics / load). .
[0026] Global policy convergence: Calculate the F-norm of the Actor network parameter updates over K consecutive time steps, relative to the normalized value of the updates during the initial training phase. The value range is [0,1]. The closer to 0, the more convergent the strategy.
[0027] Node clustering stability: The percentage of times when the clustering labels of a node in the most recent M time steps are consistent with the label at the current time step, denoted as . The value ranges from [0,1], and the higher the percentage, the more stable the cluster affiliation.
[0028] The four driving indicators are weighted and fused to obtain the comprehensive adjustment factor for the corresponding node. The positive or negative sign of the comprehensive adjustment factor represents the direction of increase or decrease of the window length, and the absolute value of the comprehensive adjustment factor represents the adjustment range of the window length. The window adjustment step size is calculated based on the preset maximum single-step adjustment amount and a comprehensive adjustment factor to obtain the current window adjustment step size; window adjustment step size The calculation formula is: ; To preset the maximum adjustment amount per step, we set it to 2 in this embodiment; This is for rounding up to the nearest integer.
[0029] The initial window length at the current moment is obtained by superimposing the historical window length of the previous moment with the current window adjustment step size. Then, the initial window length is constrained by the preset upper and lower limits of the window length, and the final historical window length at the current moment is output. The formula for updating the window length is: ; This is a truncation function. This is the lower limit of the window length; in this embodiment, it is set to 1. The maximum window length is set to 12 in this embodiment; initially, the window length of all nodes is uniformly set to the baseline value. .
[0030] When the absolute value of the comprehensive adjustment factor is less than the preset hysteresis threshold, the window length adjustment is not performed, and the historical window length of the node at the previous moment is directly used. In this embodiment, the hysteresis threshold is set to 0.1 by default to avoid frequent increases and decreases in the window length near the critical value and to improve the stability of the algorithm.
[0031] Historical sensitivity sequences are extracted based on window length and fused to obtain an effective sensitivity vector; The specific steps for generating an effective sensitivity vector are as follows: Extract the first node before the i-th node The sensitivity vectors from each historical moment, together with the instantaneous sensitivity vector at the current moment, constitute the sensitivity sequence within the window. ; Generate time decay weights: the closer the time within the window is to the current time, the higher the weight. The weights at each time point are: ; This is the time decay coefficient.
[0032] Then, time decay weight normalization is performed, and weighted fusion is performed to obtain the effective sensitivity vector.
[0033] Using the effective sensitivity vectors of all nodes as feature inputs, online K-Means dynamic clustering is performed to obtain multiple node clusters; In this embodiment, Euclidean distance is used as the similarity metric for clustering, which is the distance from the i-th node to the k-th cluster centroid. After the node cluster assignment is completed in each scheduling cycle, the cluster centroid is updated by weighting the effective sensitivity modulus of the nodes within the cluster. The number of clusters is dynamically adjusted according to the operating conditions during the clustering process.
[0034] For each node cluster, normalization is performed based on the modulus of the effective sensitivity of each node in the cluster to obtain the intra-class weight. The running data of all nodes in the cluster are weighted and merged according to the corresponding weight to generate the virtual representative node state of the corresponding node cluster. The system state is composed of the virtual representative node states. The intra-class weights are calculated using Softmax normalization; the intra-class weight of the i-th node within the k-th cluster is... ; Let be a very small normal number. When the effective sensitivity modulus of all nodes in the cluster approaches 0, the offset constant causes a small difference in the exponential terms of each node, avoiding completely equal weights and preserving the node differentiation characteristics; when there are obviously high-sensitivity nodes, the offset constant can be ignored in the weight allocation result, without destroying the original core logic of nonlinear weighting based on sensitivity.
[0035] The state vector of the virtual representative node is obtained by weighted fusion of the physical state vectors of all nodes in the cluster: ; By concatenating the virtual node state vectors of all clusters in order, the final system state vector is obtained. , where K is the total number of current node clusters.
[0036] The system saves the current sensitivity data, cluster labels, and state data for adaptive adjustment of the historical window in the next time step. The saved data includes the instantaneous sensitivity vector, effective sensitivity vector, node cluster affiliation label, physical state vector, and centroid location data for each cluster. Data storage uses a sliding window mechanism, retaining only the most recent data. Historical data at a specific moment.
[0037] The system state is input into the main Actor network and auxiliary Actor network of reinforcement learning, which generate the reference power of each node cluster and the single node deviation correction amount, and after superposition, the optimal energy storage charging and discharging power allocation command is output. In this embodiment, the specific process for generating the optimal energy storage charging and discharging power allocation command is as follows: The virtual node system state is input into the main Actor network, and the reference charge and discharge power of the energy storage cluster corresponding to each node cluster is output through forward propagation. In detail, the reference charge / discharge power of the k-th cluster output by the main Actor network is denoted as... Positive values represent discharging, and negative values represent charging; the power unit is kW. The main Actor network is responsible for the global economic optimization objective. The network has three fully connected layers, and the activation function is ReLU.
[0038] The original lightweight state characteristics of all nodes are input into a lightweight auxiliary Actor network, and the deviation correction of each physical energy storage node relative to the reference power of its cluster is output after forward propagation. The original lightweight state characteristics of all nodes include at least one of node SOC deviation rate, real-time power fluctuation, and health coefficient. Specifically, the node SOC deviation rate refers to the relative deviation between the node's current SOC and the average SOC of its cluster, and the calculation formula is as follows: ; is the average SOC value of the k-th cluster. The auxiliary Actor network is a lightweight, fully connected 2-layer network with 1 / 3 the number of parameters of the main Actor network, used for fast response to differences in the individual state of nodes.
[0039] Based on the amplitude threshold setting strategy, upper and lower limits of amplitude are preset for each deviation correction amount, thus constraining the range of values for the deviation correction amount. Specifically, the amplitude threshold setting strategy is as follows: Extract the effective sensitivity modulus of the virtual nodes corresponding to each node cluster, and combine it with a preset reference threshold to generate the cluster-level baseline limiting ratio for each node cluster; Detailed cluster-level baseline limiting ratio The calculation formula is: ;in The global baseline limiting ratio is set to 0.2 by default in this embodiment; The effective sensitivity modulus of the k-th cluster virtual node; The average sensitivity modulus of all nodes is used as the preset reference sensitivity threshold.
[0040] For each energy storage node within a node cluster, the initial relative weight corresponding to the effective sensitivity modulus of a single node is calculated based on the effective sensitivity modulus of the virtual nodes in that cluster. The detailed formula for calculating the initial relative weights is as follows: ; Let be the effective sensitivity modulus of the i-th node.
[0041] Obtain the clustering membership confidence of each node, and use the membership confidence to correct the initial relative weights to obtain the amplitude limiting coefficient of each node; Detailed clustering membership confidence The percentage of time a node has spent belonging to the current cluster within the last M time intervals, with a value ranging from [0,1]; limiting coefficient. The calculation formula is: The lower the membership confidence level, the smaller the amplitude limiting coefficient, and the narrower the allowable deviation range of the corresponding node, which is used to suppress instruction oscillations at the boundary nodes.
[0042] Based on the cluster-level benchmark limiting ratio and node limiting coefficient of the corresponding node cluster, and combined with the energy storage cluster benchmark charging and discharging power of the cluster, upper and lower limits of the deviation correction amplitude of the charging direction and the discharging direction are generated for each node. Upper limit of deviation correction for the i-th node and lower limit The calculation formula is: The charging direction corresponds to a negative deviation, and the discharging direction corresponds to a positive deviation, ensuring that the deviation correction is only finely adjusted within the proportional range of the reference power.
[0043] If the current time is the initial time, the upper and lower limits of the amplitude at the previous time will be taken as the system's preset rated amplitude limit. If the current time is not the initial time, the upper and lower limits of the deviation correction magnitude of the previous time are combined with the sliding smoothing process of the upper and lower limits of the current time. The smoothing coefficient is positively correlated with the temporal stability of the node sensitivity.
[0044] The logic for smoothing the sliding motion is as follows: ; in This is the upper limit value calculated at the current moment. This is the lower limit value calculated at the current moment. This is a smoothing coefficient, with a value range of [0,1]. Higher node sensitivity indicates better temporal stability (smaller coefficient of variation). The larger the value, the stronger the smoothing effect.
[0045] For each physical energy storage node, the reference charge / discharge power of the energy storage cluster corresponding to its node cluster is superimposed with the deviation correction amount of that node to generate the charge / discharge power allocation command for each energy storage node.
[0046] In detail, the formula for calculating the final charge and discharge power command of the i-th energy storage node is as follows: ; This is used to correct the deviation in the output of the Actor network.
[0047] Execute the power allocation command to complete the power transfer between photovoltaic, energy storage, load and grid; Collect the running data for the next moment, evaluate the merits of this allocation action through the Critic network, and update the weight parameters of the main Actor network, auxiliary Actor network, and Critic network through backpropagation. In detail, the benefit reward consists of three components: peak-valley arbitrage revenue, demand-based electricity fee reduction, and grid power purchase cost. The calculation formula is as follows: ;in This represents the total discharge power. Total charging power Power purchased for the power grid.
[0048] The safety bonus consists of three components: SOC over-limit penalty, grid connection point power fluctuation penalty, and energy storage lifetime loss cost. The calculation formula is as follows: ; For SOC exceeding the limit, For the power fluctuation rate at the grid connection point, Depth of charge / discharge cycles , , This is the penalty weighting coefficient.
[0049] The update process for the weight parameters of the main Actor network, auxiliary Actor network, and Critic network is as follows: Two completely independent Critic networks, a benefit-oriented Critic network and a safety-oriented Critic network, are constructed. Specifically, the two types of Critic networks do not share any network layers or parameters. The input dimension of the benefit-oriented Critic network is matched with the main Actor network to evaluate the long-term economic benefits of cluster-level baseline power. The input dimension of the safety-oriented Critic network is matched with the auxiliary Actor network to evaluate the operational safety of node-level bias correction.
[0050] Collect the running data at the next moment, and decompose it into mutually independent benefit reward components and safety reward components; send the corresponding inputs into the benefit-type Critic network and the safety-type Critic network respectively; The two Critic networks independently calculate the temporal difference error based on the corresponding reward components, iteratively update their own network parameters, and calculate the policy gradient of the corresponding Actor action. The detailed formula for calculating timing difference error (TD error) is as follows: ; Discount factor; The state-action value output by the Critic network.
[0051] The benefit-oriented Critic and the safety-oriented Critic are respectively substituted with the corresponding reward components and input states, and the TD error is calculated independently and their own network parameters are updated through gradient descent. Then, based on the policy gradient theorem, the benefit policy gradient and the safety policy gradient of the corresponding actions are calculated respectively.
[0052] By combining the overall power grid risk level, the intensity of source-load fluctuations within a cluster, and the effective sensitivity of nodes, a dynamic hedging weight coefficient is generated. The dynamic hedging weight coefficient adopts a three-level linkage calculation method: at the global level, a global risk base coefficient is calculated based on the power fluctuation rate at the grid connection point, with higher risks resulting in a larger proportion of safety weight; at the cluster level, a cluster-level correction coefficient is calculated based on the power fluctuation rate of source-loads within the cluster, further increasing the safety weight of clusters with high fluctuations; at the node level, a node correction coefficient is calculated based on the effective sensitivity modulus of the node, with the safety weight of highly sensitive nodes being increased simultaneously.
[0053] The main Actor network uses the benefit policy gradient as the primary factor and the safety policy gradient as the secondary factor, while the auxiliary Actor network uses the safety policy gradient as the primary factor and the benefit policy gradient as the secondary factor. The final gradient is synthesized by weighting the gradients according to the hedging weight coefficients and the parameters are updated accordingly. The evaluation result deviation rate of the two Critic networks is calculated in real time. When the deviation rate continuously exceeds the preset threshold, the parameter updates of the main and auxiliary Actor networks are frozen. The updates are resumed after the evaluation deviation of the two Critic networks is converged first. The maximum number of freezing iteration steps is set. If the evaluation deviation of the two Critic networks still does not converge to within the threshold after exceeding the number of steps, the parameters of the main and auxiliary Actor networks are forcibly unfrozen and updated based on the policy gradient output by the benefit-oriented Critic network.
[0054] Repeat the above steps to iteratively optimize the scheduling strategy online.
[0055] This embodiment also discloses an adaptive power allocation system for photovoltaic energy storage systems based on reinforcement learning, wherein the system uses the aforementioned adaptive power allocation method for photovoltaic energy storage systems based on reinforcement learning.
[0056] This embodiment also discloses a computer-readable storage medium storing a computer program, which is executed by a processor to implement the above-described adaptive power allocation method for photovoltaic energy storage systems based on reinforcement learning.
[0057] Optionally, in this embodiment, those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be implemented by a program instructing the hardware related to the terminal device. The program can be stored in a computer-readable storage medium, which may include: flash drive, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.
[0058] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0059] If the integrated units in the above embodiments are implemented as software functional units and sold or used as independent products, they can be stored in the aforementioned computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause one or more electronic devices to execute all or part of the steps of the methods described in the various embodiments of this application.
[0060] In the above embodiments of this application, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0061] In the several embodiments provided in this application, it should be understood that the disclosed application can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection of units or modules may be electrical or other forms.
[0062] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0063] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0064] The above description is only a preferred embodiment of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of this application, and these improvements and modifications should also be considered within the scope of protection of this application.
Claims
1. An adaptive power allocation method for photovoltaic energy storage systems based on reinforcement learning, characterized in that, The method includes: Real-time acquisition of operational data from each node of the photovoltaic-storage-load system and the power grid; dynamic clustering of decision sensitivity of each node based on the current scheduling strategy; weighted synthesis of virtual node states corresponding to each category according to decision influence within the category; and construction of system state. The system state is input into the main Actor network and auxiliary Actor network of reinforcement learning, which generate the reference power of each node cluster and the single node deviation correction amount, and after superposition, the optimal energy storage charging and discharging power allocation command is output. Execute the power allocation command to complete the power transfer between photovoltaic, energy storage, load and grid; Collect the running data for the next moment, evaluate the merits of this allocation action through the Critic network, and update the weight parameters of the main Actor network, auxiliary Actor network, and Critic network through backpropagation. Repeat the above steps to iteratively optimize the scheduling strategy online.
2. The adaptive power allocation method for photovoltaic energy storage systems based on reinforcement learning according to claim 1, characterized in that, The specific logic for generating system states is as follows: Collect the physical state vectors of all nodes at time t, input them into the Actor network for forward propagation to obtain the action distribution; Freeze the network parameters, calculate the Jacobian matrix of state features with respect to the log probability of actions for each node, extract the norm of each action dimension, and obtain the instantaneous sensitivity vector of each node. The driving metrics are calculated node by node, and the window length of each node is updated by dynamically adjusting the algorithm. Historical sensitivity sequences are extracted based on window length and fused to obtain an effective sensitivity vector; Using the effective sensitivity vectors of all nodes as feature inputs, online K-Means dynamic clustering is performed to obtain multiple node clusters; For each node cluster, normalization is performed based on the modulus of the effective sensitivity of each node in the cluster to obtain the intra-class weight. The running data of all nodes in the cluster are weighted and merged according to the corresponding weight to generate the virtual representative node state of the corresponding node cluster. The system state is composed of the virtual representative node states. Save the sensitivity data, cluster labels, and status data at the current moment for adaptive adjustment of the historical window at the next moment.
3. The adaptive power allocation method for photovoltaic energy storage systems based on reinforcement learning according to claim 2, characterized in that, Calculate the driving metrics node by node, and update the window length of each node through a dynamically adjusted algorithm, including: Four adjustment driving indicators were calculated for each node: sensitivity temporal fluctuation, physical state change rate, global policy convergence, and node clustering membership stability. The four driving indicators are weighted and fused to obtain the comprehensive adjustment factor for the corresponding node. The positive or negative sign of the comprehensive adjustment factor represents the direction of increase or decrease of the window length, and the absolute value of the comprehensive adjustment factor represents the adjustment range of the window length. The window adjustment step size at the current moment is calculated by combining the preset maximum adjustment amount per step with the comprehensive adjustment factor. The initial window length at the current moment is obtained by superimposing the historical window length of the previous moment with the current window adjustment step size. Then, the initial window length is constrained by the preset upper and lower limits of the window length, and the final historical window length at the current moment is output. When the absolute value of the comprehensive adjustment factor is less than the preset hysteresis threshold, the window length adjustment is not performed, and the historical window length of the previous moment of the node is directly used.
4. The adaptive power allocation method for photovoltaic energy storage systems based on reinforcement learning according to claim 3, characterized in that, The specific process for generating the optimal energy storage charging and discharging power allocation command is as follows: The virtual node system state is input into the main Actor network, and the reference charge and discharge power of the energy storage cluster corresponding to each node cluster is output through forward propagation. The original lightweight state characteristics of all nodes are input into a lightweight auxiliary Actor network, and the deviation correction of each physical energy storage node relative to the reference power of its cluster is output through forward propagation; the original lightweight state characteristics of all nodes include at least one of node SOC deviation rate, real-time power fluctuation, and health coefficient. Based on the amplitude threshold setting strategy, upper and lower limits of amplitude are preset for each deviation correction amount, thus constraining the range of values for the deviation correction amount. For each physical energy storage node, the reference charge / discharge power of the energy storage cluster corresponding to its node cluster is superimposed with the deviation correction amount of that node to generate the charge / discharge power allocation command for each energy storage node.
5. The adaptive power allocation method for photovoltaic energy storage systems based on reinforcement learning according to claim 4, characterized in that, The amplitude threshold setting strategy is as follows: Extract the effective sensitivity modulus of the virtual nodes corresponding to each node cluster, and combine it with a preset reference threshold to generate the cluster-level baseline limiting ratio for each node cluster; For each energy storage node within a node cluster, the initial relative weight corresponding to the effective sensitivity modulus of a single node is calculated based on the effective sensitivity modulus of the virtual nodes in that cluster. Obtain the clustering membership confidence of each node, and use the membership confidence to correct the initial relative weights to obtain the amplitude limiting coefficient of each node; Based on the cluster-level benchmark limiting ratio and node limiting coefficient of the corresponding node cluster, and combined with the energy storage cluster benchmark charging and discharging power of the cluster, upper and lower limits of the deviation correction amplitude of the charging direction and the discharging direction are generated for each node. If the current time is the initial time, the upper and lower limits of the amplitude at the previous time will be taken as the system's preset rated amplitude limit. If the current time is not the initial time, the upper and lower limits of the deviation correction magnitude of the previous time are combined with the sliding smoothing process of the upper and lower limits of the current time. The smoothing coefficient is positively correlated with the temporal stability of the node sensitivity.
6. The adaptive power allocation method for photovoltaic energy storage systems based on reinforcement learning according to claim 5, characterized in that, The update process for the weight parameters of the main Actor network, auxiliary Actor network, and Critic network is as follows: Construct benefit-oriented and safety-oriented Critic networks with completely independent parameters; Collect the running data at the next moment, and decompose it into mutually independent benefit reward components and safety reward components; send the corresponding inputs into the benefit-type Critic network and the safety-type Critic network respectively; The two Critic networks independently calculate the temporal difference error based on the corresponding reward components, iteratively update their own network parameters, and calculate the policy gradient of the corresponding Actor action. By combining the overall power grid risk level, the intensity of source load fluctuations within the cluster, and the effective sensitivity of nodes, dynamic hedging weight coefficients are generated. The main Actor network uses the benefit policy gradient as the primary factor and the safety policy gradient as the secondary factor, while the auxiliary Actor network uses the safety policy gradient as the primary factor and the benefit policy gradient as the secondary factor. The final gradient is synthesized by weighting the gradients according to the hedging weight coefficients and the parameters are updated accordingly. The evaluation result deviation rate of the two Critic networks is calculated in real time. When the deviation rate continuously exceeds the preset threshold, the parameter updates of the main and auxiliary Actor networks are frozen. The updates are resumed after the evaluation deviation of the two Critic networks is converged first. The maximum number of freezing iteration steps is set. If the evaluation deviation of the two Critic networks still does not converge to within the threshold after exceeding the number of steps, the parameters of the main and auxiliary Actor networks are forcibly unfrozen and updated based on the policy gradient output by the benefit-oriented Critic network.
7. An adaptive power allocation system for photovoltaic energy storage systems based on reinforcement learning, characterized in that, The system uses the reinforcement learning-based adaptive power allocation method for photovoltaic energy storage systems as described in any one of claims 1 to 6.
8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that is executed by a processor to implement the reinforcement learning-based adaptive power allocation method for photovoltaic energy storage systems as described in any one of claims 1 to 6.
