Output power control method of distributed photovoltaic cluster based on knowledge distillation

Through the use of knowledge distillation technology in the output power control of distributed photovoltaic clusters, trains the network of student networks and perform data labeling, solve the problem of difficulty in model scale, accuracy and response speed, and achieve efficient and refined control strategy deployment. Adapt to the needs of large -scale access to the grid.

CN118760983BActive Publication Date: 2025-01-28STATE GRID ZHEJIANG ELECTRIC POWER CO LTD JINHUA POWER SUPPLY CO +4
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411243852.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-05
Publication Date
2025-01-28
Estimated Expiration
2044-09-05

AI Technical Summary

Technical Problem

In the distributed photovoltaic cluster output power control, the model scale, accuracy and response speed are difficult to take into account, and the deployment is difficult, resulting in overvoltage problems when large-scale connection to the power grid.

Method used

The method based on knowledge distillation is used to train the student network to migrate the knowledge of the teacher network into the student network, reduce the model scale, and at the same time avoid excessive fitness through data labeling to improve the accuracy and efficiency of the control strategy.

Benefits of technology

While maintaining high accuracy and rapid response, the model size has been reduced, the difficulty of deployment has been reduced, the problem of large -scale deployment of the output power control of distributed photovoltaic clusters has improved, and the adaptability of large -scale access to the grid is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118760983B_ABST
    Figure CN118760983B_ABST
Patent Text Reader

Abstract

The present invention discloses a distributed photovoltaic cluster output power control method based on knowledge distillation. The student network is trained by using knowledge distillation, and the lightweight student network is deployed in a regional distributed photovoltaic output power control system. In addition, the most suitable student network is selected for processing by labeling the data, so that the overfitting problem of knowledge distillation does not have a negative impact in the present invention, thereby improving the accuracy of the strategy, resolving and utilizing the defect that knowledge distillation is prone to overfitting, and finally achieving the reduction of the model scale and the reduction of the deployment difficulty while maintaining the accuracy and response speed, so as to meet the large-scale deployment requirements of the output power control of the distributed photovoltaic cluster.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing, and in particular to a distributed photovoltaic cluster output power control method based on knowledge distillation. Background Art

[0002] When high-penetration distributed photovoltaics are integrated into the distribution network on a large scale, if the output power of distributed photovoltaic equipment is not controlled, it is easy to cause line overload and voltage over-limit problems in areas with weak grid structures. Existing studies mostly use large-scale linear programming (LP) methods, first transforming the nonlinear multi-constraints affecting the output of distributed photovoltaics into linear convex optimization constraints, and then using LP to find the optimal value of the objective function in the distributed photovoltaic output strategy. Alternatively, some studies use reinforcement learning methods to treat each distributed photovoltaic output power control system as an independent intelligent agent, guided by the reward function split from the objective function, and driven by the action strategy obtained by training to meet the constraints, and use the centralized training-decentralized execution mode to construct a distributed photovoltaic cluster output power control strategy.

[0003] If LP is used to control the output power of distributed photovoltaic clusters, the modeling accuracy depends on the high-precision distribution network topology and line parameters; and when LP is used to solve the model, the solution speed is slow; in addition, when the model is updated later and the control requirements change, the distributed photovoltaic output power control strategy of each region needs to be remodeled and solved. Therefore, this method has a significant contradiction between model accuracy and solution speed.

[0004] If reinforcement learning is used for distributed photovoltaic cluster output power control, the reinforcement learning control models of different regions in the distributed photovoltaic cluster are generally trained and deployed separately, or the online central processor is used for centralized training and distributed equipment is used for decentralized execution. The former requires a lot of computing resources, and the neural network of each distributed control module needs to be re-adjusted and trained when the model is updated later; while the latter simplifies the training process and facilitates subsequent model updates, due to centralized training, the resulting action strategy sometimes cannot well express the actual demand for regional distributed photovoltaic output power, and the frequent interaction between the central processor and the distributed control equipment increases the communication cost and the risk of privacy leakage. Therefore, this method has significant contradictions in terms of model training, deployment difficulty, and security.

[0005] However, due to its particularity, the output power control of distributed photovoltaic clusters is not suitable for running complex models, but still requires high-precision control strategies. Therefore, if we want to improve the overvoltage problem caused by large-scale access of distributed photovoltaic clusters to the power grid, we need to first solve the large-scale deployment problem in terms of model scale, accuracy, execution efficiency, deployment difficulty, etc., so as to improve the control capabilities of various areas within the distributed photovoltaic cluster. Summary of the invention

[0006] In view of the problem that the model scale, accuracy, response speed and deployment difficulty of the distributed photovoltaic cluster output power control system in the prior art are difficult to balance, the present invention provides a distributed photovoltaic cluster output power control method based on knowledge distillation, which uses knowledge distillation to train a student network and deploys the lightweight student network to the regional distributed photovoltaic output power control system. In addition, by labeling the data, the most suitable student network is selected for processing, so that the overfitting problem of knowledge distillation does not have a negative impact in the present invention, thereby improving the accuracy of the strategy, resolving and utilizing the defect that knowledge distillation is prone to overfitting, and ultimately achieving the reduction of model scale and reduced deployment difficulty while maintaining accuracy and response speed, so as to meet the large-scale deployment needs of distributed photovoltaic cluster output power control.

[0007] The following is the technical solution of the present invention.

[0008] The output power control method of distributed photovoltaic cluster based on knowledge distillation includes the following steps:

[0009] S1: Select the distributed photovoltaic cluster regional division indicators;

[0010] S2: Based on the distributed photovoltaic cluster regional division index, divide the distributed photovoltaic cluster into several regions, obtain the historical data of each region and set labels;

[0011] S3: Establish a distributed photovoltaic voltage control model for each region;

[0012] S4: Build a teacher network to control regional output power based on the distributed photovoltaic voltage control model, and use historical data for training and optimization;

[0013] S5: Build a student network for each region, and use the historical data of the corresponding region to perform knowledge distillation on the teacher network and the student network until the student network meets the preset conditions, and then deploy the student network to the corresponding region;

[0014] S6: When the output power of any area is controlled, the real-time data of the area is judged, the student network deployed in the area corresponding to the most matching label is selected for processing, the control strategy is output, and the output power of the distributed photovoltaic cluster is controlled based on the control strategy.

[0015] In the present invention, the distributed photovoltaic cluster area is divided, on the one hand, to make the deployment of the control strategy more refined and more targeted, and on the other hand, considering that any model has overfitting, the division according to the characteristics of the region can avoid the problem caused by overfitting as much as possible. The knowledge distillation used in the present invention as a model compression method can transfer the knowledge in a large model (usually referred to as a "teacher network") to a smaller model (called a "student network"), so that the student network has a smaller volume and faster running speed while maintaining a high accuracy rate. The student network inherits the high-precision characteristics of the teacher network, and at the same time has a smaller model scale, faster response speed, and lower deployment difficulty. However, due to the particularity of knowledge distillation, since the training is dominated by the teacher network, the student network is very easy to overfit, resulting in weak generalization ability. In order to further avoid the problems caused by overfitting, the present invention labels the data to determine the similarity between the new real-time data and the historical data during training, so that the real-time data to be processed is more matched with the student network, reducing the generalization ability requirements for the student network, and making full use of the characteristics of higher accuracy in processing similar data brought by overfitting.

[0016] Preferably, the S1: selecting the distributed photovoltaic cluster regional division index includes:

[0017] At least active power balance, reactive power balance and electrical distance are selected as the distributed photovoltaic cluster division criteria;

[0018] The active power balance is calculated based on the number of regions that need to be divided into clusters, the number of distributed photovoltaics within the cluster, the total length of time for collecting data, the active power that can be output by distributed photovoltaics, and the output power limit of distributed photovoltaics;

[0019] The reactive power balance is calculated based on the reactive power that can be output by the distributed photovoltaic power electronic controller and the maximum reactive power limit that can be output by the reactive compensation device in the distributed photovoltaic power electronic controller;

[0020] The electrical distance is calculated based on the total number of transmission lines in the entire distribution network, the edge weights between connected nodes, and the congestion degree between nodes, where the edge weight is 0 when the nodes are not connected and 1 when they are directly connected.

[0021] Preferably, in S2, the distributed photovoltaic cluster is divided based on the distributed photovoltaic cluster area division index to obtain several areas, including:

[0022] A genetic algorithm is used to perform distributed photovoltaic cluster regional division. The distributed photovoltaic cluster regional division index is weighted to form a distributed photovoltaic cluster regional division comprehensive balance index. The comprehensive balance index is used as the fitness function in the genetic algorithm to perform optimization and solve the regional division result.

[0023] Preferably, in S2, obtaining historical data of each region and setting a label includes:

[0024] A1: Select a time range, obtain historical data for each region, sort the values ​​of each data type in the historical data within the time range at each moment in the same region and type, calculate the mean of the entire sequence, and select the median as the standard value of the corresponding data type in the region;

[0025] A2: Repeat step A1 until the mean and standard value of each data type in all regions are obtained and stored in the form of vector (D1, D2, D3, D4) to obtain a label vector, where D1 represents the region, D2 represents the type, D3 represents the mean, and D4 represents the standard value. Each region will obtain the same number of label vectors as the number of data types.

[0026] A3: Each region is integrated based on its own label vector to obtain the label of each region.

[0027] In the present invention, the mean is calculated and the median is used as the standard value, which can simplify the characteristics of the data and represent the environmental characteristics of the corresponding area to a certain extent. At the same time, the vector form is used to facilitate the subsequent calculation of similarity.

[0028] Preferably, the step S3: establishing a distributed photovoltaic voltage control model for each region includes:

[0029] A control objective function is established based on the node voltage of each node, the number of distribution network nodes, and the rated voltage of the distribution network;

[0030] The constraints of the model are established, including regional power flow constraints, regional distributed photovoltaic active power constraints, and regional distributed photovoltaic reactive power constraints.

[0031] Preferably, the power flow constraints of the region include:

[0032] Satisfy: The sum of the active power consumed by the load at the node, the active transmission line loss of the distribution network, and the real-time input or output power of the energy storage equipped by the distributed photovoltaic is equal to the sum of the active power injected by the main grid into the distribution network in the area and the active output of the distributed photovoltaic at the node;

[0033] And meet:

[0034] The sum of the reactive power consumed by the load at the node and the reactive transmission line loss of the distribution network is equal to the sum of the reactive power injected by the main grid into the distribution network in the area, the reactive output of the distributed photovoltaic at the node, and the reactive power output of the reactive compensation equipment at the node.

[0035] Preferably, the regional distributed photovoltaic active power constraint includes:

[0036] The following conditions are met: the range of the reduction of the active power of photovoltaic nodes in the region is less than or equal to the sum of the active power output limit of photovoltaic nodes and the real-time input or output power of the energy storage equipped with distributed photovoltaic.

[0037] Preferably, S4: constructing a teacher network for controlling regional output power based on a distributed photovoltaic voltage control model, and using historical data for training and optimization, includes:

[0038] Based on the distributed photovoltaic voltage control model, the teacher network state space, action space and reward function are constructed. The state space includes the active power, reactive power and voltage value of each node in the region, and the action space includes the active output of the distributed photovoltaic nodes in the region and the reactive compensation of the reactive compensation nodes in the region.

[0039] Use historical data to train and optimize the teacher network.

[0040] Preferably, S5: constructing a student network for each region, and performing knowledge distillation on the teacher network and the student network using historical data of the corresponding region until the student network meets the preset conditions, and then deploying the student network to the respective corresponding regions, includes:

[0041] Construct a student network for each region, and input the historical data of the corresponding region into both the teacher network and the student network for knowledge distillation;

[0042] Calculate the probability output of the teacher network and the probability output of the student network;

[0043] Calculate the hard loss and soft loss in knowledge distillation based on the probability output of the teacher network and the probability output of the student network;

[0044] Calculate the distillation loss function based on hard loss and soft loss, back-propagate the result of the distillation loss function to the student network, and repeat the training until the value of the distillation loss function reaches the preset condition;

[0045] After knowledge distillation is completed, the student network has been quantized and deployed as an output power controller on the distributed photovoltaic system in the corresponding area.

[0046] Preferably, S6: when output power control is performed on any area, the real-time data of the area is judged, the student network deployed in the area corresponding to the most matching tag is selected for processing, a control strategy is output, and the output power control of the distributed photovoltaic cluster is performed based on the control strategy, including:

[0047] When output power control is performed on any area, real-time data of the area in the target time period is obtained;

[0048] Calculate and organize the real-time data to obtain the mean and standard value of each data type in the real-time data, and construct an information vector in the same form as the label vector;

[0049] The cosine similarity is calculated using the information vector and the different label vectors of each region’s label, and the student network corresponding to the region with the highest calculation result is used as the target student network;

[0050] The real-time data is input into the target student network for processing, and the control strategy is output to the area corresponding to the real-time data to control the output power of the distributed photovoltaic cluster.

[0051] In the present invention, in most cases, the real-time data in the same area must be the most matched with the label in the same area, so the student network in the same area can be well processed and output control strategies, but in some cases, due to environmental mutations and other reasons, the real-time data may be closer to the labels of other areas. At this time, if the student network in the same area is still used, the problem of overfitting may be prominent. Generally speaking, in order to cope with this possible situation, it is necessary to avoid overfitting as much as possible in the process of knowledge distillation, which requires frequent adjustment of network parameters and a large amount of verification. However, there are a large number of distributed photovoltaic clusters, and each student network needs to undergo such adjustment and verification, which is obviously costly. The present invention chooses to control from the source of the data, so that the data and the student network fit each other, and there is no need to frequently adjust the network parameters and perform a large amount of verification.

[0052] In other words, the present invention does not specifically optimize the overfitting of the model itself, but uses the aforementioned division, labeling, selection of the target student network and other measures to avoid testing the generalization ability of the model as much as possible. Therefore, there is no need to pay special attention to the overfitting problem, and the technical difficulties of knowledge distillation in the output power control of distributed photovoltaic clusters are solved.

[0053] The present invention also provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and when the processor calls the computer program in the memory, the steps of the above-mentioned distributed photovoltaic cluster output power control method based on knowledge distillation are implemented.

[0054] The present invention also provides a storage medium, in which computer executable instructions are stored. When the computer executable instructions are loaded and executed by a processor, the steps of the above-mentioned distributed photovoltaic cluster output power control method based on knowledge distillation are implemented.

[0055] The substantial effects of the present invention include:

[0056] By scientifically and rationally dividing the distributed photovoltaic cluster area, the deployment of the control strategy is more refined and targeted. This division method fully considers the characteristics of the region, helps to avoid the problems caused by model overfitting, and improves the accuracy and effectiveness of the control strategy.

[0057] By using knowledge distillation technology, the knowledge in the large teacher network is transferred to the smaller student network. In this way, the student network has a smaller size and faster running speed while maintaining a high accuracy rate, which reduces the difficulty of deployment and improves the response speed.

[0058] The overfitting problem is further alleviated by data labeling. By calculating the mean and using the median as the standard value, the characteristics of the data are simplified, which facilitates the subsequent calculation of similarity and optimizes the calculation process. At the same time, this processing method also helps to better utilize and allocate computing resources and improve the operating efficiency of the overall system. Then, by judging the real-time data and selecting the student network deployed in the area corresponding to the most matching label for processing, the generalization ability requirements of the student network are reduced, and the higher accuracy of similar data processing brought by overfitting is fully utilized. BRIEF DESCRIPTION OF THE DRAWINGS

[0059] Figure 1 It is an overall flow chart of an embodiment of the present invention. DETAILED DESCRIPTION

[0060] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution will be clearly and completely described below in combination with the embodiments. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0061] It should be understood that in various embodiments of the present invention, the size of the sequence number of each process does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.

[0062] It should be understood that in the present invention, "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or apparatus comprising 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 these processes, methods, products or apparatuses.

[0063] It should be understood that in the present invention, "plurality" refers to two or more than two. "And / or" is merely a description of the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "Contains A, B and C", "Contains A, B, C" means that A, B, and C are all included, "Contains A, B or C" means that one of A, B, and C is included, and "Contains A, B and / or C" means that any one, any two, or any three of A, B, and C are included.

[0064] The technical solution of the present invention is described in detail with specific embodiments below. The embodiments may be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments.

[0065] Example

[0066] Distributed photovoltaic cluster output power control method based on knowledge distillation, such as Figure 1 As shown, the following steps are included:

[0067] S1: Select the distributed photovoltaic cluster regional division indicators.

[0068] In this embodiment, the active power balance degree is selected , reactive power balance and electrical distance Three indicators are used as the classification criteria for distributed photovoltaic clusters.

[0069] Establishing active power balance Indicator, mathematical expression is as follows:

[0070] (1);

[0071] is the number of regions that need to be clustered. is the number of distributed photovoltaics within the cluster, is the total time length of data collection, For distributed photovoltaic exist The active power that can be output at any time, Distributed photovoltaic output power limit.

[0072] Establish reactive power balance Indicator, mathematical expression is as follows:

[0073] (2);

[0074] For distributed photovoltaic Power electronic controllers The reactive power that can be output at any time, Distributed photovoltaic The maximum reactive power limit that the reactive power compensation device in the power electronic controller can output, is the logarithmic sign.

[0075] Establishing electrical distance Indicator, mathematical expression is as follows:

[0076] (3);

[0077] is the total number of transmission lines in the entire distribution network, To connect nodes and The edge right, edge right At the node and When not connected, it is 0; when directly connected, it is 1. Representation Node and The blocking degree between is a matrix containing only 0 and 1.

[0078] S2: Based on the distributed photovoltaic cluster regional division index, divide the distributed photovoltaic cluster into several regions, obtain the historical data of each region and set labels.

[0079] In this embodiment, a genetic algorithm (GA) is used to divide the distributed photovoltaic cluster into regions. , , The three are weighted to form the comprehensive balance index of distributed photovoltaic cluster regional division. ,by To optimize the fitness function in the genetic algorithm, the solution result is the region division result. The specific solution process is as follows:

[0080] (4);

[0081] Weight Index , , The selection should be based on the actual needs of the distribution network area and the requirements of the power grid dispatching center, and meet the requirements of , , is the phase angle weight constraint, which is used to limit the phase angle of the output power and satisfies .

[0082] Additionally, get historical data for each region and set labels, including:

[0083] A1: Select a time range, obtain historical data for each region, sort the values ​​of each data type in the historical data within the time range at each moment in the same region and type, calculate the mean of the entire sequence, and select the median as the standard value of the corresponding data type in the region;

[0084] A2: Repeat step A1 until the mean and standard value of each data type in all regions are obtained and stored in the form of vector (D1, D2, D3, D4) to obtain a label vector, where D1 represents the region, D2 represents the type, D3 represents the mean, and D4 represents the standard value. Each region will obtain the same number of label vectors as the number of data types.

[0085] A3: Each region is integrated based on its own label vector to obtain the label of each region.

[0086] For example, if some historical data includes temperature and light intensity, then calculate the average temperature of each sampling moment within the time range, and then sort the average temperatures of each sampling moment to obtain the median as the standard value. The same applies to light intensity.

[0087] Therefore, for example, for region A, we can get the label vectors: (A, temperature, mean X1, standard value Y1) and (A, light intensity, mean X2, standard value Y2). Then the label of region A is: {(A, temperature, mean X1, standard value Y1), (A, light intensity, mean X2, standard value Y2)}.

[0088] Similarly, region B will also have its own label.

[0089] In this embodiment, the mean is calculated and the median is used as the standard value, which can simplify the characteristics of the data and represent the environmental characteristics of the corresponding area to a certain extent. At the same time, the vector form is used to facilitate the subsequent calculation of similarity.

[0090] S3: Establish a distributed photovoltaic voltage control model for each area.

[0091] The control model achieves distributed photovoltaic voltage stability by controlling the distributed photovoltaic active and reactive output in the area. The implementation on the equipment side is to use the power electronic port to control the output photovoltaic active power and the capacitor bank reactive compensation to adjust the output reactive power. Specifically include:

[0092] Establish control objectives , the mathematical expression is as follows:

[0093] (5);

[0094] For the The node voltage of each node, is the number of distribution network nodes, is the rated voltage of the distribution network.

[0095] The constraints for establishing the model are shown in formulas (6) - (8):

[0096] (6);

[0097] (7);

[0098] (8);

[0099] Formula (6) is the regional power flow constraint. is the number of distribution network nodes in the area, and for time The active power and reactive power consumed by the load on the node, and for Active and reactive power transmission line losses of the distribution network at the moment, The real-time input or output power of the energy storage for distributed photovoltaics. and for The active and reactive power injected by the main grid into the distribution network in this area at any given moment. and for time The active and reactive output of distributed photovoltaics at the node, if If there is no distributed photovoltaic at the node, these two items are 0. for time The reactive power compensation equipment on the node outputs reactive power. If the node has no reactive power compensation equipment, these two items are 0.

[0100] Formula (7) is the active power constraint of regional distributed photovoltaics. For the region The range of node photovoltaic active power reduction is as follows: for Node photovoltaic active power output limit.

[0101] Formula (8) is the reactive power constraint of regional distributed photovoltaics. For the region The range of node photovoltaic reactive power reduction is: For Region Maximum power of node distributed photovoltaic power electronic grid-connected inverter. for The reactive power output upper limit of the reactive power compensator at the node. The lower limit of the output is the opposite of the upper limit.

[0102] S4: Construct a teacher network for controlling regional output power based on the distributed photovoltaic voltage control model, and use historical data for training and tuning.

[0103] According to the control target in S3 The teacher network for controlling the output power is constructed with constraints (6)-(8). The teacher network adopts the deep Q-network (DQN) reinforcement learning algorithm, with the DNN (Deep NeuralNetworks, DNN) network as the neural network kernel.

[0104] The specific process includes: constructing the teacher network state space , the mathematical expression is as follows:

[0105] (9);

[0106] , , is the active power, reactive power and voltage value of each node in the area, k Indicates the number of training updates.

[0107] Constructing the teacher network action space , the mathematical expression is as follows:

[0108] (10);

[0109] is the active output of distributed photovoltaic nodes within the region, is the reactive compensation amount of the reactive compensation node within the area.

[0110] Constructing the Teacher Network Reward Function , the mathematical expression is as follows:

[0111] (11);

[0112] The matrix represents the voltage crossing value matrix that may occur at each node in the area. When the voltage does not cross the line, the value of the node in the matrix is ​​0. , superscript represents the transpose of a matrix, is the total amount of compensation for teacher network reactive power compensation, is the photovoltaic active output value of the teacher network, , , is the weight coefficient.

[0113] Train the teacher network based on the above steps and historical data.

[0114] S5: Build a student network for each region, and use the historical data of the corresponding region to perform knowledge distillation on the teacher network and the student network until the student network meets the preset conditions, and then deploy the student network to the corresponding regions.

[0115] Specifically include:

[0116] Construct a student network for each region, and input the historical data of the corresponding region into both the teacher network and the student network for knowledge distillation;

[0117] Calculate the probability output of the teacher network and the probability output of the student network. The mathematical expression is as follows:

[0118] (12);

[0119] (13);

[0120] and They represent the first The probability output of the teacher network of the class action value and the probability output of the student network are expressed as The function normalizes the output result. and Represent all the outputs of the teacher and student DNN networks, and It means a specific Class output, Represents the number of output layers and temperature coefficients of the two DNN networks It is used to amplify the loss value corresponding to the probability value of the non-student network in the teacher network.

[0121] The hard loss (HardLoss) and soft loss (SoftLoss) in knowledge distillation are calculated based on the probability output of the teacher network and the probability output of the student network. The mathematical expression is as follows:

[0122] (14);

[0123] (15);

[0124] , are the HardLoss function and SoftLoss function in the knowledge distillation loss function. Since this knowledge distillation model is unsupervised training, the true probability Instead of hard labels, the real-time output probabilities of the teacher network are used ,Right now .

[0125] The distillation loss (LOSS) function is calculated based on hard loss and soft loss. The mathematical expression is as follows:

[0126] (16);

[0127] Distillation Loss Function Depend on and Weighted, The distillation loss function result is back-propagated to the student DNN network, and the training is repeated until the distillation loss function Close to 0, the knowledge distillation process is completed, the student network has been quantized, and can be lightweight deployed on the distributed photovoltaic system in the area as an output power controller.

[0128] Based on the regional division of distributed photovoltaic clusters, reinforcement learning training is performed using high-precision data set samples. Under the guidance of the set reward function, the optimal strategy is learned through interaction with the environment to train the teacher network. It is worth noting that since knowledge distillation from the teacher network to the student network is required in S5, the teacher network needs to be constructed with a more complex and multi-layered DNN neural network hidden layer than the general algorithm, and requires larger-scale and higher-precision training data. Based on the trained teacher network, the neural network in the teacher network is quantified, and the network parameters are compressed using knowledge distillation. The lightweight network version is deployed to the remaining regional distributed photovoltaic output power control systems (as student networks). The knowledge distillation framework will continuously update the state space of the teacher network and the student network according to the environment, but will no longer update the reward of the student network. The loss function used in this knowledge distillation framework It includes HardLoss and SoftLoss. They use the Softmax function to characterize the probability output of different output strategies of the teacher network and the student network. During the training process, the student network is continuously approached to the teacher network by reducing the loss function.

[0129] The advantage of this approach is that only the teacher network area has a demand for high-precision data sets, which reduces the data demand and model training volume and improves the accuracy of the student model. It can also reduce the response delay of the student network model, compress the network parameters of the student network, and achieve lightweight and fast training and deployment. When the output power control target of the distributed photovoltaic cluster changes in the later stage, it is only necessary to retrain the teacher network and the student network can be quickly updated.

[0130] S6: When the output power of any area is controlled, the real-time data of the area is judged, the student network deployed in the area corresponding to the most matching label is selected for processing, the control strategy is output, and the output power of the distributed photovoltaic cluster is controlled based on the control strategy.

[0131] Specifically include:

[0132] When output power control is performed on any area, real-time data of the area in the target time period is obtained;

[0133] Calculate and organize the real-time data to obtain the mean and standard value of each data type in the real-time data, and construct an information vector in the same form as the label vector;

[0134] The cosine similarity is calculated using the information vector and the different label vectors of each region’s label, and the student network corresponding to the region with the highest calculation result is used as the target student network;

[0135] The real-time data is input into the target student network for processing, and the control strategy is output to the area corresponding to the real-time data to control the output power of the distributed photovoltaic cluster.

[0136] For example, there are three regions: Region A, Region B, and Region C. Each region has a distributed photovoltaic cluster, and each region corresponds to a trained student network, which are called student network A, student network B, and student network C. These student networks have learned how to output appropriate output power control strategies based on real-time data by learning the historical data of their respective regions.

[0137] Now, a piece of real-time data comes from region A, but due to some sudden environmental factors (such as artificial rainfall, sudden temperature drop, etc.), this piece of real-time data is more similar to the historical data of region B, and this similarity is reflected in the calculation results of cosine similarity of label vectors. Since the real-time data matches the label of region B the most, student network B is selected as the target student network.

[0138] It should be noted that in this embodiment, in most cases, the real-time data in the same area must be the most matched with the label in the same area, so the student network in the same area can process and output control strategies very well, but in some cases, due to environmental mutations and other reasons, the real-time data may be closer to the labels of other areas. At this time, if the student network in the same area is still used, the problem of overfitting may be prominent. Generally speaking, in order to deal with this possible situation, it is necessary to avoid overfitting as much as possible in the knowledge distillation process, which requires frequent adjustment of network parameters and a large amount of verification. However, there are a large number of distributed photovoltaic clusters, and each student network needs to undergo such adjustment and verification, which is obviously costly. However, this embodiment chooses to control from the source of the data, so that the data and the student network fit each other, and there is no need to frequently adjust the network parameters and perform a large amount of verification.

[0139] In other words, this embodiment does not specifically optimize the overfitting of the model itself, but uses the aforementioned division, labeling, selection of the target student network and other measures to avoid testing the generalization ability of the model as much as possible. Therefore, there is no need to pay special attention to the overfitting problem, and the technical difficulties of knowledge distillation in the output power control of distributed photovoltaic clusters are solved.

[0140] In addition, this embodiment also provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and when the processor calls the computer program in the memory, the steps of the above-mentioned distributed photovoltaic cluster output power control method based on knowledge distillation are implemented.

[0141] And, a storage medium storing computer executable instructions, which, when loaded and executed by a processor, implement the steps of the above-mentioned distributed photovoltaic cluster output power control method based on knowledge distillation.

[0142] In summary, the substantial effects of this embodiment include:

[0143] By scientifically and rationally dividing the distributed photovoltaic cluster area, the deployment of the control strategy is more refined and targeted. This division method fully considers the characteristics of the region, helps to avoid the problems caused by model overfitting, and improves the accuracy and effectiveness of the control strategy.

[0144] By using knowledge distillation technology, the knowledge in the large teacher network is transferred to the smaller student network. In this way, the student network has a smaller size and faster running speed while maintaining a high accuracy rate, which reduces the difficulty of deployment and improves the response speed.

[0145] The overfitting problem is further alleviated by data labeling. By calculating the mean and using the median as the standard value, the characteristics of the data are simplified, which facilitates the subsequent calculation of similarity and optimizes the calculation process. At the same time, this processing method also helps to better utilize and allocate computing resources and improve the operating efficiency of the overall system. Then, by judging the real-time data and selecting the student network deployed in the area corresponding to the most matching label for processing, the generalization ability requirements of the student network are reduced, and the higher accuracy of similar data processing brought by overfitting is fully utilized.

[0146] Through the description of the above implementation methods, technical personnel in the relevant field can understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the specific device can be divided into different functional modules to complete all or part of the functions described above.

[0147] In the embodiments provided in the present application, it should be understood that the disclosed structures and methods can be implemented in other ways. For example, the embodiments of the structure described above are only schematic. For example, the division of modules or units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another structure, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, structures or units, which can be electrical, mechanical or other forms.

[0148] The units described as separate components may or may not be physically separated, and the components shown as units may be one physical unit or multiple physical units, that is, they may be located in one place or distributed in multiple different places. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0149] In addition, each functional unit in the embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0150] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially 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, which is stored in a storage medium, including several instructions to enable a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to perform all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program code.

[0151] The above contents are only specific implementation methods of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A distributed photovoltaic cluster output power control method based on knowledge distillation, characterized in that: The following steps are involved: S1: Select the distributed photovoltaic cluster regional division indicators; S2: Based on the distributed photovoltaic cluster regional division index, divide the distributed photovoltaic cluster into several regions, obtain the historical data of each region and set labels; S3: Establish a distributed photovoltaic voltage control model for each region; S4: Build a teacher network to control regional output power based on the distributed photovoltaic voltage control model, and use historical data for training and optimization; S5: Build a student network for each region, and use the historical data of the corresponding region to perform knowledge distillation on the teacher network and the student network until the student network meets the preset conditions, and then deploy the student network to the corresponding region; S6: When the output power of any area is controlled, the real-time data of the area is judged, the student network deployed in the area corresponding to the most matching label is selected for processing, the control strategy is output, and the output power of the distributed photovoltaic cluster is controlled based on the control strategy; In S2, historical data of each region is obtained and labels are set, including: A1: Select a time range, obtain historical data for each region, sort the values ​​of each data type in the historical data within the time range at each moment in the same region and type, calculate the mean of the entire sequence, and select the median as the standard value of the corresponding data type in the region; A2: Repeat step A1 until the mean and standard value of each data type in all regions are obtained and stored in the form of vector (D1, D2, D3, D4) to obtain a label vector, where D1 represents the region, D2 represents the type, D3 represents the mean, and D4 represents the standard value. Each region will obtain the same number of label vectors as the number of data types. A3: Each region is integrated based on its own label vector to obtain the label of each region; S6: When the output power of any area is controlled, the real-time data of the area is judged, the student network deployed in the area corresponding to the most matching tag is selected for processing, the control strategy is output, and the output power of the distributed photovoltaic cluster is controlled based on the control strategy, including: When output power control is performed on any area, real-time data of the area in the target time period is obtained; Calculate and organize the real-time data to obtain the mean and standard value of each data type in the real-time data, and construct an information vector in the same form as the label vector; The cosine similarity is calculated using the information vector and the different label vectors of each region’s label, and the student network corresponding to the region with the highest calculation result is used as the target student network; The real-time data is input into the target student network for processing, and the control strategy is output to the area corresponding to the real-time data to control the output power of the distributed photovoltaic cluster.

2. The distributed photovoltaic cluster output power control method based on knowledge distillation according to claim 1 is characterized in that: S1: Selecting distributed photovoltaic cluster regional division indicators, including: At least active power balance, reactive power balance and electrical distance are selected as the distributed photovoltaic cluster division criteria; The active power balance is calculated based on the number of regions that need to be divided into clusters, the number of distributed photovoltaics within the cluster, the total length of time for collecting data, the active power that can be output by distributed photovoltaics, and the output power limit of distributed photovoltaics; The reactive power balance is calculated based on the reactive power that can be output by the distributed photovoltaic power electronic controller and the maximum reactive power limit that can be output by the reactive compensation device in the distributed photovoltaic power electronic controller; The electrical distance is calculated based on the total number of transmission lines in the entire distribution network, the edge weights between connected nodes, and the congestion degree between nodes, where the edge weight is 0 when the nodes are not connected and 1 when they are directly connected.

3. The distributed photovoltaic cluster output power control method based on knowledge distillation according to claim 1 or 2, characterized in that: In S2, based on the distributed photovoltaic cluster area division index, the distributed photovoltaic cluster is divided into several areas, including: A genetic algorithm is used to perform distributed photovoltaic cluster regional division. The distributed photovoltaic cluster regional division index is weighted to form a distributed photovoltaic cluster regional division comprehensive balance index. The comprehensive balance index is used as the fitness function in the genetic algorithm to perform optimization and solve the regional division result.

4. The distributed photovoltaic cluster output power control method based on knowledge distillation according to claim 1 is characterized in that: S3: Establishing a distributed photovoltaic voltage control model for each region, including: A control objective function is established based on the node voltage of each node, the number of distribution network nodes, and the rated voltage of the distribution network; The constraints of the model are established, including regional power flow constraints, regional distributed photovoltaic active power constraints, and regional distributed photovoltaic reactive power constraints.

5. The distributed photovoltaic cluster output power control method based on knowledge distillation according to claim 4 is characterized in that: The power flow constraints for the area include: Satisfy: The sum of the active power consumed by the load at the node, the active transmission line loss of the distribution network, and the real-time input or output power of the energy storage equipped by the distributed photovoltaic is equal to the sum of the active power injected by the main grid into the distribution network in the area and the active output of the distributed photovoltaic at the node; And meet: The sum of the reactive power consumed by the load at the node and the reactive transmission line loss of the distribution network is equal to the sum of the reactive power injected by the main grid into the distribution network in the area, the reactive output of the distributed photovoltaic at the node, and the reactive power output of the reactive compensation equipment at the node.

6. The distributed photovoltaic cluster output power control method based on knowledge distillation according to claim 5 is characterized in that: The regional distributed photovoltaic active power constraints include: The following conditions are met: the range of the reduction of the active power of photovoltaic nodes in the region is less than or equal to the sum of the active power output limit of photovoltaic nodes and the real-time input or output power of the energy storage equipped with distributed photovoltaic.

7. The distributed photovoltaic cluster output power control method based on knowledge distillation according to claim 1 is characterized in that: S4: constructing a teacher network for controlling regional output power based on a distributed photovoltaic voltage control model, and using historical data for training and optimization, including: Based on the distributed photovoltaic voltage control model, the teacher network state space, action space and reward function are constructed. The state space includes the active power, reactive power and voltage value of each node in the region, and the action space includes the active output of the distributed photovoltaic nodes in the region and the reactive compensation of the reactive compensation nodes in the region. Use historical data to train and optimize the teacher network.

8. The distributed photovoltaic cluster output power control method based on knowledge distillation according to claim 1 is characterized in that: S5: constructing a student network for each region, and using the historical data of the corresponding region to perform knowledge distillation on the teacher network and the student network until the student network meets the preset conditions, and then deploying the student network to the corresponding regions, including: Construct a student network for each region, and input the historical data of the corresponding region into both the teacher network and the student network for knowledge distillation; Calculate the probability output of the teacher network and the probability output of the student network; Calculate the hard loss and soft loss in knowledge distillation based on the probability output of the teacher network and the probability output of the student network; Calculate the distillation loss function based on hard loss and soft loss, back-propagate the result of the distillation loss function to the student network, and repeat the training until the value of the distillation loss function reaches the preset condition; After knowledge distillation is completed, the student network has been quantized and deployed as an output power controller on the distributed photovoltaic system in the corresponding area.

9. An electronic device, characterized in that: It comprises a memory and a processor, wherein the memory stores a computer program, and when the processor calls the computer program in the memory, the steps of the distributed photovoltaic cluster output power control method based on knowledge distillation as described in any one of claims 1 to 8 are implemented.

10. A storage medium, characterized in that: The storage medium stores computer executable instructions, and when the computer executable instructions are loaded and executed by the processor, the steps of the distributed photovoltaic cluster output power control method based on knowledge distillation as described in any one of claims 1 to 8 are implemented.

Citation Information

Patent Citations

  • System and method for knowledge distillation between neural networks

    CA3076424A1

  • New energy photovoltaic short-term power prediction method and system

    CN117791576A