Photovoltaic grid-connected node voltage prediction method and device and computer equipment
The method enhances PV node voltage prediction accuracy by using a spatial-temporal graph attention network to analyze node interdependence, addressing voltage fluctuations and improving grid stability.
Patent Information
- Application Number
- CN202510277435.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-10
- Publication Date
- 2025-07-15
AI Technical Summary
The existing voltage prediction technology has low accuracy in the voltage prediction of photovoltaic grid-connected nodes, and it has failed to effectively consider the correlation between node voltages.
Using a combined model of graph attention network and gated cycle unit, by obtaining real-time voltage data of multiple photovoltaic grid-connected nodes, performing spatial and timing analysis based on the adjacency relationship, using the attention mechanism to extract node characteristics, and voltage prediction is performed through the full connection layer.
It improves the accuracy of voltage prediction of photovoltaic grid-connected nodes, provides data support from the power system scheduling department, and enhances the operating reliability of the power system and the awareness of voltage fluctuations.
Smart Images

Figure CN120320399A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of power systems, and particularly to a method, device, computer device, computer-readable storage medium, and computer program product for predicting the voltage of a photovoltaic grid-connected node. Background Art
[0002] With the intensification of the global energy crisis, the unsustainability of traditional fossil energy and the environmental problems caused by it have become increasingly prominent, and energy transformation has become the focus of global attention. Against this background, renewable energy, especially photovoltaic power generation, has gradually become an important direction for energy structure adjustment due to its clean, renewable, and widely distributed characteristics. In recent years, photovoltaic power generation technology has developed rapidly and the cost has decreased significantly, promoting its large-scale grid-connected application and becoming an important part of the power system.
[0003] However, the output power of photovoltaic power generation highly depends on meteorological conditions, resulting in significant intermittency and volatility in its power generation output. As the penetration rate of photovoltaic power generation in the power system continues to increase, the problems of voltage fluctuation and over-limit of photovoltaic grid-connected nodes caused by this have become increasingly severe, and even endanger the stable operation of the power system. If the operation and over-limit conditions of the voltage of photovoltaic grid-connected nodes can be grasped in advance, and the voltage fluctuation can be sensed and monitored, it has very important guiding significance for the power system dispatching department in terms of distribution optimization management and future planning.
[0004] The existing voltage prediction technologies mainly start from the perspective of time series prediction, and construct a mapping relationship from input features to future voltage using a deep learning model, but ignore the correlation between node voltages in the power system, resulting in low accuracy of the predicted voltage. Summary of the Invention
[0005] Based on this, it is necessary to provide a method, device, computer device, computer-readable storage medium, and computer program product for predicting the voltage of a photovoltaic grid-connected node that can improve the accuracy of voltage prediction in view of the above technical problems.
[0006] In a first aspect, the present application provides a method for predicting the voltage of a photovoltaic grid-connected node, including: obtaining the real-time voltages respectively collected for a plurality of photovoltaic grid-connected nodes in a target area at at least two acquisition times, and the voltage prediction duration for the target area; each prediction time within the voltage prediction duration refers to a future acquisition time after the acquisition time; determining the number of prediction times expected to be included within the voltage prediction duration based on the interval duration between the acquisition times; for each acquisition time, performing spatial analysis on the real-time voltages obtained at the acquisition time based on the adjacency relationship between the photovoltaic grid-connected nodes to obtain the spatial characteristics of each photovoltaic grid-connected node at the acquisition time; performing temporal analysis on the spatial characteristics corresponding to each acquisition time in the chronological order of the acquisition times to obtain the target temporal characteristics; performing voltage prediction processing on the target temporal characteristics based on the number of prediction times to obtain the predicted voltages respectively corresponding to each photovoltaic grid-connected node at each prediction time.
[0007] In one embodiment, performing spatial analysis on the real-time voltages obtained at the acquisition time based on the adjacency relationship between the photovoltaic grid-connected nodes to obtain the spatial characteristics of each photovoltaic grid-connected node at the acquisition time includes: determining, based on the adjacency relationship between the photovoltaic grid-connected nodes, each neighbor node corresponding to each photovoltaic grid-connected node from among the photovoltaic grid-connected nodes; for each neighbor node corresponding to each photovoltaic grid-connected node, using an attention function to obtain, for the real-time voltages of the photovoltaic grid-connected node and the neighbor node and a shared parameter matrix for linear transformation, a first attention coefficient of the neighbor node relative to the photovoltaic grid-connected node; performing normalization processing on the first attention coefficient to obtain a first attention weight of the neighbor node relative to the photovoltaic grid-connected node; obtaining a second attention weight corresponding to the photovoltaic grid-connected node based on a second attention coefficient of the photovoltaic grid-connected node relative to the photovoltaic grid-connected node; using an activation function to obtain the spatial characteristics of the photovoltaic grid-connected node at the acquisition time for the first attention weight, the second attention weight, the shared parameter matrix, and the real-time voltages of the photovoltaic grid-connected node and the neighbor node.
[0008] In one embodiment, the method further includes: using the graph attention network in the trained spatio-temporal graph attention network, based on the adjacency relationship between each photovoltaic grid-connected node, performing spatial analysis on each real-time voltage obtained at the acquisition moment to obtain the spatial features of each photovoltaic grid-connected node at the acquisition moment; wherein, each acquisition moment corresponds to a graph attention network, and the trained spatio-temporal graph attention network further includes a gated recurrent unit connected to each graph attention network, and the gated recurrent unit includes an update gate, a hidden unit, and a reset gate; according to the time sequence between each acquisition moment, performing temporal analysis on the spatial features corresponding to each acquisition moment respectively to obtain the target time features, including: for the acquisition moment and the previous acquisition moment of the acquisition moment, using an activation function to process the weight matrix and bias vector of the reset gate, the spatial features corresponding to the acquisition moment, and the time features corresponding to the previous acquisition moment to obtain the first result output by the reset gate; using the arctangent function to process the weight matrix and bias vector of the hidden unit, the first result, the spatial features corresponding to the acquisition moment, and the time features corresponding to the previous acquisition moment to obtain an intermediate result; using an activation function to process the weight matrix and bias vector of the update gate, the spatial features corresponding to the acquisition moment, and the time features corresponding to the previous acquisition moment to obtain the second result output by the update gate; obtaining a first parameter that is anti-correlated with the second result, and based on the second result, the first parameter, the time features corresponding to the previous acquisition moment, and the intermediate result, obtaining the time features corresponding to the acquisition moment; in the case where the acquisition moment is the last acquisition moment, determining the time features corresponding to the acquisition moment as the target time features.
[0009] In one embodiment, the trained spatio-temporal graph attention network further includes a fully connected layer connected to the gated recurrent unit corresponding to the last acquisition moment; based on the number of prediction moments, performing voltage prediction processing on the target time features to obtain the predicted voltages corresponding to each photovoltaic grid-connected node at each prediction moment respectively, including: adjusting the parameters of the fully connected layer based on the number of prediction moments so that the output dimension of the fully connected layer matches the number of prediction moments; processing the target time features based on the weight matrix and bias vector of the adjusted fully connected layer to obtain the predicted voltages corresponding to each photovoltaic grid-connected node at each prediction moment respectively.
[0010] In one embodiment, the adjacency relationship between each photovoltaic grid-connected node is characterized by an adjacency matrix. The method for obtaining the adjacency matrix includes: for each photovoltaic grid-connected node and each remaining node in the target area except the photovoltaic grid-connected node, based on the respective historical voltages of the photovoltaic grid-connected node and the remaining node, obtaining the Pearson correlation coefficient between the photovoltaic grid-connected node and the remaining node; the remaining node is a photovoltaic grid-connected node; when the Pearson correlation coefficient is greater than or equal to a preset coefficient, determining that the remaining node is a neighbor node of the photovoltaic grid-connected node, and setting the element at the corresponding position of the photovoltaic grid-connected node and the remaining node in the adjacency matrix to a first preset value; when the Pearson correlation coefficient is less than the preset coefficient, determining that the remaining node is a non-neighbor node of the photovoltaic grid-connected node, and setting the element at the corresponding position of the photovoltaic grid-connected node and the remaining node in the adjacency matrix to a second preset value.
[0011] In one embodiment, the method further includes: for each predicted voltage corresponding to a prediction moment adjacent to the current time, for each predicted voltage, determining the difference between the predicted voltage and the voltage limit value of the corresponding photovoltaic grid-connected node; wherein, the voltage limit value is determined according to the node voltage level of the photovoltaic grid-connected node; if among multiple differences, there is a difference that exceeds the voltage deviation range of the photovoltaic grid-connected node, an alarm message is output.
[0012] In a second aspect, the present application provides a device for predicting the voltage of a photovoltaic grid-connected node. The device includes: an acquisition module, configured to acquire the real-time voltages respectively collected for a plurality of photovoltaic grid-connected nodes in a target area at at least two acquisition moments, and the voltage prediction duration for the target area; a determination module, configured to determine the number of prediction moments expected to be included within the voltage prediction duration based on the interval duration between the acquisition moments; each prediction moment within the voltage prediction duration refers to a future acquisition moment after the acquisition moment; a first analysis module, configured to perform spatial analysis on the real-time voltages obtained at each acquisition moment based on the adjacency relationship between each photovoltaic grid-connected node, to obtain the spatial characteristics of each photovoltaic grid-connected node at each acquisition moment; a second analysis module, configured to perform temporal analysis on the respective spatial characteristics corresponding to each acquisition moment in the time sequence of the acquisition moments, to obtain the target time characteristics; a prediction module, configured to perform voltage prediction on the target time characteristics based on the required number of prediction moments, to obtain the predicted voltages respectively corresponding to each photovoltaic grid-connected node at each prediction moment.
[0013] In a third aspect, the present application also provides a computer device, including a memory and a processor. The memory stores a computer program, and when the processor executes the computer program, the following steps are implemented: obtaining the real-time voltages respectively collected for a plurality of photovoltaic grid-connected nodes within a target area at at least two acquisition times, and the voltage prediction duration for the target area; each prediction time within the voltage prediction duration refers to a future acquisition time after the acquisition time; determining the number of prediction times expected to be included within the voltage prediction duration based on the interval duration between the acquisition times; for each acquisition time, performing spatial analysis on the real-time voltages obtained at the acquisition time based on the adjacency relationship between the photovoltaic grid-connected nodes, to obtain the spatial characteristics of each photovoltaic grid-connected node at the acquisition time; performing temporal analysis on the spatial characteristics respectively corresponding to each acquisition time in the time sequence of the acquisition times, to obtain the target time characteristics; performing voltage prediction processing on the target time characteristics based on the number of prediction times, to obtain the predicted voltages respectively corresponding to each photovoltaic grid-connected node at each prediction time.
[0014] In a fourth aspect, the present application also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the following steps are implemented: obtaining the real-time voltages respectively collected for a plurality of photovoltaic grid-connected nodes within a target area at at least two acquisition times, and the voltage prediction duration for the target area; each prediction time within the voltage prediction duration refers to a future acquisition time after the acquisition time; determining the number of prediction times expected to be included within the voltage prediction duration based on the interval duration between the acquisition times; for each acquisition time, performing spatial analysis on the real-time voltages obtained at the acquisition time based on the adjacency relationship between the photovoltaic grid-connected nodes, to obtain the spatial characteristics of each photovoltaic grid-connected node at the acquisition time; performing temporal analysis on the spatial characteristics respectively corresponding to each acquisition time in the time sequence of the acquisition times, to obtain the target time characteristics; performing voltage prediction processing on the target time characteristics based on the number of prediction times, to obtain the predicted voltages respectively corresponding to each photovoltaic grid-connected node at each prediction time.
[0015] Fifth aspect, the present application further provides a computer program product, including a computer program, which when executed by a processor implements the following steps: obtaining the real-time voltages respectively collected for a plurality of photovoltaic grid-connected nodes within a target area at at least two acquisition times, and the voltage prediction duration for the target area; each prediction time within the voltage prediction duration refers to a future acquisition time after the acquisition time; determining the number of prediction times expected to be included within the voltage prediction duration based on the interval duration between the acquisition times; for each acquisition time, performing spatial analysis on the real-time voltages obtained at the acquisition time based on the adjacency relationship between the photovoltaic grid-connected nodes, to obtain the spatial characteristics of each photovoltaic grid-connected node at the acquisition time; performing temporal analysis on the spatial characteristics respectively corresponding to each acquisition time in the chronological order of the acquisition times, to obtain the target temporal characteristics; and performing voltage prediction processing on the target temporal characteristics based on the number of prediction times, to obtain the predicted voltages respectively corresponding to each photovoltaic grid-connected node at each prediction time.
[0016] For the above photovoltaic grid-connected node voltage prediction method, device, computer device, computer-readable storage medium, and computer program product, by obtaining the real-time voltages respectively collected for a plurality of photovoltaic grid-connected nodes within a target area at at least two acquisition times, and the voltage prediction duration for the target area, determining the number of prediction times expected to be included within the voltage prediction duration based on the interval duration between the acquisition times, performing spatial analysis on the real-time voltages obtained at the acquisition time based on the adjacency relationship between the photovoltaic grid-connected nodes for each acquisition time, to obtain the spatial characteristics of each photovoltaic grid-connected node at the acquisition time, and performing temporal analysis on the spatial characteristics respectively corresponding to each acquisition time in the chronological order of the acquisition times, to obtain the target temporal characteristics, and then performing voltage prediction on the target temporal characteristics based on the required number of prediction times, the predicted voltages respectively corresponding to each photovoltaic grid-connected node at each prediction time can be obtained. Thus, by predicting the voltages of each photovoltaic grid-connected node while considering the adjacency relationship between the photovoltaic grid-connected nodes, the voltage prediction accuracy can be improved; moreover, by predicting the voltages of each photovoltaic grid-connected node in advance in the present application, data support is provided for the power system dispatching department in aspects of distribution optimization management and future planning, and the operation reliability of the power system can be improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the following will briefly introduce the drawings required for use in the description of the embodiments of the present application or related technologies. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, other related drawings can be obtained based on these drawings without creative efforts.
[0018] Figure 1It is an application environment diagram of a photovoltaic grid-connected node voltage prediction method in an embodiment;
[0019] Figure 2 It is a schematic flowchart of a photovoltaic grid-connected node voltage prediction method in an embodiment;
[0020] Figure 3 It is a schematic flowchart of a method for obtaining an adjacency matrix in an embodiment;
[0021] Figure 4 It is a schematic flowchart of spatially analyzing each real-time voltage obtained at the acquisition moment based on the adjacency relationship between photovoltaic grid-connected nodes in an embodiment to obtain the spatial characteristics of each photovoltaic grid-connected node at the acquisition moment;
[0022] Figure 5 It is a schematic structural diagram of a graph attention network in an embodiment;
[0023] Figure 6 It is a schematic flowchart of performing temporal analysis on each spatial characteristic corresponding to each acquisition moment in chronological order between acquisition moments in an embodiment to obtain target time characteristics;
[0024] Figure 7 It is a schematic diagram of the gating mechanism of a gated recurrent unit in an embodiment;
[0025] Figure 8 It is a schematic flowchart of performing voltage prediction processing on target time characteristics based on the number of prediction moments in an embodiment to obtain the predicted voltages corresponding to each photovoltaic grid-connected node at each prediction moment;
[0026] Figure 9 It is a schematic flowchart of a photovoltaic grid-connected node voltage prediction method in another embodiment;
[0027] Figure 10 It is a schematic structural diagram of a trained spatio-temporal graph attention network in an embodiment;
[0028] Figure 11 It is a structural block diagram of a photovoltaic grid-connected node voltage prediction device in an embodiment;
[0029] Figure 12 It is an internal structural diagram of a computer device in an embodiment. Specific embodiments
[0030] In order to make the objectives, technical solutions, and advantages of the present application clearer, the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0031] The node voltages in a power system are usually affected by the grid power supply and grid load. On the one hand, new energy generation such as photovoltaic and wind power is affected by meteorological conditions, and the new energy output in adjacent regions is correlated. The node voltage fluctuations caused by the fluctuations in new energy output also have a certain correlation. On the other hand, the nodes in the power system are connected by lines, and the electrical connection relationship makes the voltages between adjacent nodes naturally correlated. Based on this, a graph attention network can be used to aggregate the correlation between the voltages of photovoltaic grid-connected nodes in the region, and a gated recurrent unit can be used to extract the temporal features. Finally, a fully connected layer is used to map the spatio-temporal features extracted into future node voltage values, realizing the prediction of the voltages of photovoltaic grid-connected nodes, and providing a reference for the distribution optimization management and future planning of the power system dispatching department.
[0032] In addition, with the increase in the photovoltaic penetration rate, the number of photovoltaic grid-connected nodes in the power grid will increase significantly. If voltage prediction for all nodes is to be achieved, existing methods often need to train a model for each node separately, greatly increasing the time and computing power costs. Therefore, by training a spatio-temporal graph attention network, the trained spatio-temporal graph attention network can include multiple graph attention networks, as well as gated recurrent units connected to each graph attention network, and a fully connected layer connected to the last gated recurrent unit, enabling the voltage of all photovoltaic grid-connected nodes in the region to be predicted at one time, saving time and computing power costs.
[0033] In view of this, the present application provides a method for predicting the voltage of photovoltaic grid-connected nodes, which can be applied to the application environment as Figure 1 shown. Among them, the terminal 102 communicates with the server 104 through the network. The data storage system can store the data that the server 104 needs to process. The data storage system can be integrated on the server 104, or placed in the cloud or other network servers.
[0034] Specifically, the server 104 obtains the real-time voltages respectively collected for multiple photovoltaic grid-connected nodes in the target area at at least two acquisition times from the terminal 102, and the voltage prediction duration for the target area. Based on the interval duration between the acquisition times, the server 104 determines the number of prediction times expected to be included within the voltage prediction duration. Each prediction time within the voltage prediction duration refers to a future acquisition time after the acquisition time. Thus, the server 104 can perform spatial analysis on the real-time voltages obtained at the acquisition times for each acquisition time based on the adjacency relationship between the photovoltaic grid-connected nodes, obtain the spatial features of each photovoltaic grid-connected node at the acquisition time, and perform temporal analysis on the spatial features corresponding to each acquisition time in the order of time between the acquisition times, obtain the target time features, and then perform voltage prediction on the target time features based on the required number of prediction times, so as to obtain the predicted voltages corresponding to each photovoltaic grid-connected node at each prediction time.
[0035] Among them, the terminal 102 can be, but is not limited to, various personal computers, laptop computers, smart phones, tablet computers, Internet of Things devices, and portable wearable devices. The Internet of Things devices can be smart speakers, smart TVs, smart air conditioners, smart in-vehicle devices, projection devices, etc. The portable wearable devices can be smart watches, smart bracelets, head-mounted devices, etc. The head-mounted devices can be virtual reality (VR) devices, augmented reality (AR) devices, smart glasses, etc. The server 104 can be an independent physical server, a server cluster or a distributed system composed of multiple physical servers, or a cloud server providing cloud computing services.
[0036] In one embodiment, as Figure 2 shown, a method for predicting the voltage of a photovoltaic grid-connected node is provided. Taking this method applied to Figure 1 the server 104 in
[0037] S202, obtaining the real-time voltages respectively collected for a plurality of photovoltaic grid-connected nodes in the target area at at least two acquisition times, and the voltage prediction duration for the target area.
[0038] Among them, the at least two acquisition times may include the current acquisition time and the historical acquisition times before the current acquisition time. The target area refers to the area where the voltage of the photovoltaic grid-connected nodes is predicted, and the area range of the target area is not limited.
[0039] The real-time voltage may refer to three-phase voltage. The voltage prediction duration refers to the duration that is expected to be predicted for the voltage of the photovoltaic grid-connected nodes in the target area. Each prediction time within the voltage prediction duration refers to a future acquisition time after the acquisition time. For example, taking the voltage prediction duration as 4 hours as an example, the predicted voltages corresponding to each photovoltaic grid-connected node at each future acquisition time within the next 4 hours can be predicted.
[0040] S204, based on the interval duration between each acquisition time, determining the number of prediction times expected to be included within the voltage prediction duration.
[0041] Among them, the interval duration represents the acquisition period for the real-time voltage of the photovoltaic grid-connected nodes. For example, taking the interval duration as 15 minutes as an example, the real-time voltage of the photovoltaic grid-connected nodes can be collected every 15 minutes.
[0042] In one of the embodiments, the ratio of the voltage prediction duration to the interval duration can be determined as the number of prediction times. For example, the interval duration is 15 minutes, the voltage prediction duration is 4 hours, there are 4 prediction times in each hour, so the number of prediction times within 4 hours is 16.
[0043] S206. For each acquisition moment, based on the adjacency relationship between each photovoltaic grid-connected node, perform spatial analysis on the respective real-time voltages obtained at the acquisition moment to obtain the spatial characteristics of each photovoltaic grid-connected node at the acquisition moment.
[0044] Among them, the adjacency relationship between each photovoltaic grid-connected node is used to reflect the positional relationship between each photovoltaic grid-connected node. For example, based on the adjacency relationship between each photovoltaic grid-connected node, each neighbor node corresponding to each photovoltaic grid-connected node can be obtained from each photovoltaic grid-connected node.
[0045] In one embodiment, for each acquisition moment, based on the adjacency relationship between each photovoltaic grid-connected node, determine the neighbor nodes of each photovoltaic grid-connected node from each photovoltaic grid-connected node; for each photovoltaic grid-connected node, input the real-time voltages corresponding to the neighbor nodes and the real-time voltage of the photovoltaic grid-connected node into the trained spatial analysis model, and the spatial characteristics of the photovoltaic grid-connected node at the acquisition moment can be obtained.
[0046] S208. According to the time sequence between each acquisition moment, perform time series analysis on the respective spatial characteristics corresponding to each acquisition moment to obtain the target time characteristics.
[0047] Among them, for each acquisition moment, the respective spatial characteristics corresponding to the acquisition moment include the spatial characteristics corresponding to each photovoltaic grid-connected node corresponding to the acquisition moment.
[0048] In one embodiment, for each photovoltaic grid-connected node, according to the time sequence between each acquisition moment, combine the spatial characteristics of the photovoltaic grid-connected node at each acquisition moment to obtain the combined spatial characteristics corresponding to the photovoltaic grid-connected node; input the combined spatial characteristics corresponding to each photovoltaic grid-connected node into the trained time series analysis model to obtain the target time characteristics.
[0049] S210. Based on the number of prediction moments, perform voltage prediction processing on the target time characteristics to obtain the predicted voltages corresponding to each photovoltaic grid-connected node at each prediction moment respectively.
[0050] In one embodiment, adjust the trained voltage prediction model based on the number of prediction moments to obtain a target network with an output dimension matching the number of prediction moments; input the target time characteristics into the target network, and the predicted voltages corresponding to each photovoltaic grid-connected node at each prediction moment respectively can be obtained.
[0051] Based on Figure 2The content shown below determines the number of prediction moments expected to be included within the voltage prediction duration based on the interval duration between each acquisition moment by obtaining the real-time voltages respectively acquired for multiple photovoltaic grid-connected nodes within the target area at at least two acquisition moments and the voltage prediction duration for the target area. For each acquisition moment, spatial analysis is performed on the real-time voltages obtained at the acquisition moment based on the adjacency relationship between each photovoltaic grid-connected node to obtain the spatial characteristics of each photovoltaic grid-connected node at the acquisition moment, and temporal analysis is performed on the spatial characteristics corresponding to each acquisition moment in the chronological order between each acquisition moment to obtain the target temporal characteristics. Furthermore, voltage prediction is performed on the target temporal characteristics based on the required number of prediction moments, and the predicted voltages corresponding to each photovoltaic grid-connected node at each prediction moment can be obtained. Thus, by predicting the voltages of each photovoltaic grid-connected node while considering the adjacency relationship between each photovoltaic grid-connected node, the accuracy of voltage prediction can be improved. Moreover, by predicting the voltages of each photovoltaic grid-connected node in advance in this application, data support is provided for the power system dispatching department in terms of distribution optimization management and future planning, which can improve the operational reliability of the power system.
[0052] In one embodiment, for each predicted voltage corresponding to a prediction moment adjacent to the current time, for each predicted voltage, the difference between the predicted voltage and the voltage limit value of the corresponding photovoltaic grid-connected node is determined. If among the multiple differences, there is a difference that exceeds the voltage deviation range of the photovoltaic grid-connected node, an alarm message is output. The voltage limit value is determined according to the node voltage level of the photovoltaic grid-connected node. Thus, voltage over-limit judgment can be performed through the predicted voltage before the prediction moment arrives to perceive the trend of voltage fluctuations in advance, which provides data support for the power system dispatching department in terms of distribution optimization management and future planning and can improve the operational reliability of the power system.
[0053] Among them, the node voltage levels of the photovoltaic grid-connected nodes can include the first level, the second level, and the third level. Each level is configured with a corresponding voltage limit value, and each level of photovoltaic grid-connected node corresponds to a voltage deviation range. For example, the nodes of the first level represent 10 kV nodes, the nodes of the second level include 110 kV nodes, the nodes of the third level represent 220 kV nodes. The voltage deviation range of the 10 kV nodes can be 0% - 7%, the voltage deviation range of the 110 kV nodes can be -3% - 7%, and the voltage deviation range of the 220 kV nodes can be 0% - 10%.
[0054] In one embodiment, the adjacency relationship between each photovoltaic grid-connected node can be characterized by an adjacency matrix, and the obtaining method of the adjacency matrix can be as Figure 3 shown, including the following steps:
[0055] S302. For each PV grid - connection node and each remaining node in the target area except the PV grid - connection nodes, based on the respective historical voltages of the PV grid - connection nodes and the remaining nodes, obtain the Pearson correlation coefficient between the PV grid - connection nodes and the remaining nodes.
[0056] Among them, the remaining nodes are PV grid - connection nodes. The historical voltage can refer to three - phase voltage. The respective historical voltages of the PV grid - connection nodes can be all the historical voltages of the PV grid - connection nodes, or can refer to some of the historical voltages among all the historical voltages of the PV grid - connection nodes. For example, the respective historical voltages of the PV grid - connection nodes refer to the historical voltages within a preset time period from the current acquisition moment. The preset time period can be 72 hours, one week, three weeks, or other values.
[0057] Specifically, the Pearson correlation coefficient between the PV grid - connection nodes and the remaining nodes can be obtained based on the first formula, and the first formula satisfies:
[0058]
[0059] where X i represents the respective historical voltages of the i - th PV grid - connection node, represents the voltage mean of the respective historical voltages of the PV grid - connection nodes; Y s represents the respective historical voltages of the s - th remaining node corresponding to the PV grid - connection node, represents the voltage mean of the respective historical voltages of the remaining nodes.
[0060] S304. When the Pearson correlation coefficient is greater than or equal to the preset coefficient, determine that the remaining node is a neighbor node of the PV grid - connection node, and set the element at the corresponding position of the PV grid - connection node and the remaining node in the adjacency matrix to the first preset value.
[0061] S306. When the Pearson correlation coefficient is less than the preset coefficient, determine that the remaining node is a non - neighbor node of the PV grid - connection node, and set the element at the corresponding position of the PV grid - connection node and the remaining node in the adjacency matrix to the second preset value.
[0062] Among them, when the Pearson correlation coefficient is greater than or equal to the preset coefficient, it indicates that the node voltage correlation between the PV grid - connection node and the remaining node is relatively strong, and it can be determined that the remaining node is a neighbor node of the PV grid - connection node. Conversely, the remaining node is a non - neighbor node of the PV grid - connection node.
[0063] Among them, the preset coefficient can be set to 0.8, or there can be other settings. The first preset value can be 1, the second preset value can be 0, and the first preset value and the second preset value can also be represented by other numerical values.
[0064] For example, taking the preset coefficient as 0.8, the first preset value as 1, and the second preset value as 0, the Pearson correlation coefficient between the photovoltaic grid-connected node and the remaining nodes can be expressed as:
[0065]
[0066] where a mn is the element in the m-th row and n-th column of the adjacency matrix, X m is the historical voltages of the m-th photovoltaic grid-connected node, and X n is the historical voltages of the n-th remaining node corresponding to the photovoltaic grid-connected node. Then, for each photovoltaic grid-connected node and the corresponding remaining nodes, the corresponding Pearson correlation coefficient can be obtained according to the above first formula, and then the adjacency matrix can be obtained.
[0067] Based on Figure 3 the content shown above, for each photovoltaic grid-connected node and each remaining node other than the photovoltaic grid-connected node in the target area, by determining the Pearson correlation coefficient between the photovoltaic grid-connected node and the remaining nodes, the adjacency relationship between the photovoltaic grid-connected nodes can be determined. Thus, considering the voltage correlation between adjacent nodes, the accuracy of voltage prediction can be improved.
[0068] In one embodiment, based on the adjacency relationship between the photovoltaic grid-connected nodes, the implementation of performing spatial analysis on the real-time voltages obtained at the acquisition moment to obtain the spatial characteristics of each photovoltaic grid-connected node at the acquisition moment (i.e., S206) can be as Figure 4 shown below, including the following steps:
[0069] S402, based on the adjacency relationship between the photovoltaic grid-connected nodes, determine the respective neighbor nodes corresponding to each photovoltaic grid-connected node from the photovoltaic grid-connected nodes.
[0070] Among them, the adjacency relationship between the photovoltaic grid-connected nodes can be characterized by an adjacency matrix. For each photovoltaic grid-connected node and each remaining node other than the photovoltaic grid-connected node in the target area, the adjacency matrix includes elements representing the correlation between each photovoltaic grid-connected node and the corresponding remaining nodes. For example, when the element is the first preset value, it is determined that the remaining node is the neighbor node of the photovoltaic grid-connected node; when the element is the second preset value, it is determined that the remaining node is the non-neighbor node of the photovoltaic grid-connected node.
[0071] S404, for the respective neighbor nodes corresponding to each photovoltaic grid-connected node, use the attention function to obtain the first attention coefficient of the neighbor node relative to the photovoltaic grid-connected node based on the real-time voltages of the photovoltaic grid-connected node and the neighbor node and the shared parameter matrix for linear transformation.
[0072] In one embodiment, the first attention coefficient of a neighbor node relative to a photovoltaic grid-connected node can be expressed by a second formula, and the second formula satisfies:
[0073]
[0074] where e ij is the first attention coefficient, [·||·] is the feature concatenation operation, and a(·) is the attention function, which is used to map the concatenated high-dimensional features to a real number; is the real-time voltage of the i-th photovoltaic grid-connected node, is the real-time voltage of the j-th neighbor node, j ∈ N i , N i is the set of neighbor nodes of the i-th photovoltaic grid-connected node, and W is the shared parameter matrix for linear transformation.
[0075] S406. Normalize the first attention coefficient to obtain the first attention weight of the neighbor node relative to the photovoltaic grid-connected node.
[0076] In one embodiment, the first attention weight of the neighbor node relative to the photovoltaic grid-connected node can be obtained based on a third formula, and the third formula satisfies:
[0077]
[0078] where α ij is the first attention weight, e ij is the first attention coefficient, softmax(·) is the normalization function, and i k is the k-th neighbor node of the i-th photovoltaic grid-connected node, then can be understood as the first attention coefficient between the i-th photovoltaic grid-connected node and its corresponding k-th neighbor node.
[0079] where LeakyReLU(x) is the non-linear transformation function, where x is the independent variable of the function, and γ is the positive slope of the negative region of the function.
[0080] S408. Obtain the second attention weight corresponding to the photovoltaic grid-connected node based on the second attention coefficient of the photovoltaic grid-connected node relative to the photovoltaic grid-connected node.
[0081] Among them, the acquisition method of the second attention coefficient can refer to the content adaptation description of S404, and the implementation method of obtaining the second attention weight based on the second attention coefficient can refer to the content adaptation description of S406, which will not be elaborated here.
[0082] S410. Use an activation function to obtain the spatial features of the PV grid-connected node at the acquisition moment based on the first attention weight, the second attention weight, the shared parameter matrix, and the respective real-time voltages of the PV grid-connected node and its neighbor nodes.
[0083] In one embodiment, when the activation function is the sigmoid activation function, the spatial features of the PV grid-connected node at the acquisition moment can be obtained based on the fourth formula, and the fourth formula satisfies:
[0084]
[0085] Where, is the spatial feature of the PV grid-connected node at the acquisition moment, σ(·) is the sigmoid activation function, W represents the shared parameter matrix for linear transformation, is the real-time voltage of the i-th PV grid-connected node, is the real-time voltage of the j-th neighbor node.
[0086] Based on Figure 4 As shown in the content, by determining the spatial features of the PV grid-connected node at the acquisition moment based on the respective real-time voltages of the PV grid-connected node and its neighbor nodes, thus, considering the correlation of voltages between adjacent nodes, the accuracy of voltage prediction can be improved.
[0087] In one embodiment, the graph attention network in the trained spatio-temporal graph attention network can be used to perform spatial analysis on the respective real-time voltages obtained at the acquisition moment based on the adjacency relationship between the PV grid-connected nodes, and obtain the spatial features of the PV grid-connected nodes at the acquisition moment. Specifically, the second formula, the third formula, and the fourth formula can be configured in the graph attention network, so that based on the adjacency relationship between the PV grid-connected nodes, the spatial analysis of the respective real-time voltages obtained at the acquisition moment through the graph attention network can obtain the spatial features of the PV grid-connected nodes at the acquisition moment.
[0088] Graph Neural Networks (GNNs) are a type of deep learning model specifically designed to process graph-structured data. Different from traditional neural networks, GNNs can directly model graph data (such as social networks, molecular structures, knowledge graphs, etc.) and capture the relationship information between nodes. The core idea of GNNs is to aggregate the information of neighbor nodes to the target node through the Message Passing mechanism, so as to learn the feature representation of the node. Graph neural networks mainly include graph convolutional network (GCN), graph attention network (GAT), etc. The graph attention network is an important variant of the graph neural network, and its core innovation lies in the introduction of the Attention Mechanism, which is used to dynamically adjust the importance weights of neighbor nodes to the target node. Compared with the graph convolutional network GCN, the attention weights of GAT can intuitively reflect the importance of neighbor nodes to the target node, providing a certain interpretability for model decision-making.
[0089] As Figure 5 shown, a structure of a graph attention network is provided. Among them, when the real-time voltage is three-phase voltage, the corresponding attention coefficients can be obtained based on the structure as Figure 5 shown, that is, the calculation processes of the second formula and the third formula match the structure of the graph attention network as Figure 5 shown.
[0090] In one embodiment, training data can be constructed according to the historical voltage sequences of multiple photovoltaic grid-connected nodes in the target area, and the spatio-temporal graph attention network can be trained to obtain a trained spatio-temporal graph attention network. The historical voltage sequence of the photovoltaic grid-connected node can refer to the sequence composed of all historical voltages, or it can refer to the sequence composed of partial voltages among all historical voltages.
[0091] Among them, the historical voltage can refer to three-phase voltage. During training, different from other deep learning models, the graph neural network used can take the three-phase historical voltage data of multiple time steps and multiple nodes as the model input. The input at each time step (i.e., each acquisition moment) contains three dimensions: node, time, and feature. Among them, the node corresponds to multiple photovoltaic grid-connected nodes in the target area; the time is the optimal input time step length determined after hyperparameter tuning, that is, the number of prediction moments; the feature corresponds to the three-phase voltage of each node; taking the three-phase voltage data of multiple nodes at a certain future time scale as the expected output, and by iteratively optimizing the model parameters to minimize the mean square error between the predicted voltage and the actual voltage, a trained spatio-temporal graph attention network can be obtained.
[0092] Among them, each acquisition moment corresponds to a graph attention network, that is, the number of graph attention networks is the same as the number of acquisition moments. By setting multiple graph attention networks, the spatial features corresponding to each acquisition moment can be obtained synchronously, which can save processing time and computing power costs. It should be noted that each graph attention network shares the same set of parameters.
[0093] Among them, the trained spatio-temporal graph attention network also includes a gated recurrent unit connected to each graph attention network. The gated recurrent unit includes an update gate, a hidden unit, and a reset gate. The Gated Recurrent Unit (GRU) is a variant of the Recurrent Neural Networks (RNNs), similar to the Long Short-Term Memory (LSTM). It solves the problems of RNNs in long-term memory retention and gradient propagation through a gating mechanism. Compared with LSTM, GRU has a simpler internal structure and can be regarded as a lightweight version of LSTM.
[0094] GRU includes an update gate, a reset gate, and a hidden unit. Among them, the reset gate determines how to combine new input information with previous memories, while the update gate defines the amount of previous memories to be passed to the current time step. The uniqueness of these two gating mechanisms lies in their ability to retain information in long sequences without being cleared over time.
[0095] In one embodiment, according to the time sequence between each acquisition moment, a temporal analysis is performed on the spatial features corresponding to each acquisition moment, and the implementation method of obtaining the target time feature (i.e., S208) can be as Figure 6 shown, including the following steps:
[0096] S602, for an acquisition moment and the previous acquisition moment of the acquisition moment, use an activation function to process the weight matrix and bias vector of the reset gate, the spatial features corresponding to the acquisition moment, and the time feature corresponding to the previous acquisition moment, and obtain the first result output by the reset gate.
[0097] In one embodiment, the first result output by the reset gate can be obtained based on the fifth formula, and the fifth formula satisfies:
[0098] r t =σ(W r ·[h t-1 ,x t +b r )
[0099] Among them, r t is the first result output by the reset gate, W rFor resetting the weight matrix of the gate, b r For resetting the bias vector of the gate, h t-1 For the time feature corresponding to the previous acquisition moment, x t For the respective spatial features corresponding to the acquisition moment, and σ is the activation function.
[0100] S604. Use the arctangent function to process the weight matrix and bias vector of the hidden unit, the first result, the respective spatial features corresponding to the acquisition moment, and the time feature corresponding to the previous acquisition moment to obtain an intermediate result.
[0101] In one embodiment, the intermediate result can be obtained based on the sixth formula, and the sixth formula satisfies:
[0102]
[0103] Wherein, Is the intermediate result, tanh(·) is the arctangent function, Is the weight matrix of the hidden unit, Is the bias vector of the hidden unit, r t Is the first result, h t-1 Is the time feature corresponding to the previous acquisition moment, x t Is the respective spatial features corresponding to the acquisition moment, and ⊙ represents element-wise multiplication.
[0104] S606. Use the activation function to process the weight matrix and bias vector of the update gate, the respective spatial features corresponding to the acquisition moment, and the time feature corresponding to the previous acquisition moment to obtain the second result output by the update gate.
[0105] In one embodiment, the second result output by the reset gate can be obtained based on the seventh formula, and the seventh formula satisfies:
[0106] z t =σ(W z ·[h t-1 ,x t +b z )
[0107] Wherein, z t Is the second result output by the update gate, σ is the activation function, W z Is the weight matrix of the update gate, b z Is the bias vector of the update gate, h t-1 Is the time feature corresponding to the previous acquisition moment, x t Is the respective spatial features corresponding to the acquisition moment.
[0108] S608. Obtain a first parameter that is inversely correlated with the second result, and based on the second result, the first parameter, the time feature corresponding to the previous acquisition moment, and the intermediate result, obtain the time feature corresponding to the acquisition moment.
[0109] In one embodiment, the time feature corresponding to the acquisition moment can be obtained based on the eighth formula, and the eighth formula satisfies:
[0110]
[0111] where h t is the time feature corresponding to the acquisition moment, z t is the second result, (1 - z t ) is the first parameter that is inversely correlated with the second result, h t-1 is the time feature corresponding to the previous acquisition moment, is the intermediate result.
[0112] It should be understood that the time feature corresponding to the previous acquisition moment can be obtained by adapting the content of S602 - S608, that is, based on the time feature corresponding to the previous acquisition moment of the current acquisition moment, the time feature corresponding to the current acquisition moment can be obtained.
[0113] S610. When the acquisition moment is the last acquisition moment, determine the time feature corresponding to the acquisition moment as the target time feature.
[0114] Among them, when the acquisition moment is the last acquisition moment, h t in the eighth formula is the target time feature.
[0115] Based on Figure 6 the content shown, the time feature corresponding to the current acquisition moment can be determined by the time features output by the gated recurrent unit corresponding to adjacent acquisition moments. Considering the time features between adjacent acquisition moments, the accuracy of the obtained target time feature can be improved, and further the voltage prediction accuracy can be improved.
[0116] Combined with Figure 6 the content shown, as Figure 7 shown, a schematic diagram of the gated mechanism of the gated recurrent unit is provided. Among them, the gated recurrent unit includes a reset gate, an update gate, and a hidden unit. Based on Figure 7 the structure shown, the target time feature can be obtained, that is, Figure 7 the calculation process of the structure shown matches the calculation processes of the fifth formula to the eighth formula. Among them, Figure 7 one of the h t represents the calculation result calculated by the current gated recurrent unit, and the other h tIndicates that the current calculation result will be used as the input of the gated recurrent unit corresponding to the next acquisition moment.
[0117] In one embodiment, the number of layers of the graph attention network and the hidden feature dimension of the gated recurrent unit can be adjusted according to the total number of nodes of each photovoltaic grid-connected node and / or the voltage change trend of each historical voltage of each photovoltaic grid-connected node. That is to say, the output of the current graph attention network is the input of the next connected graph attention network, and the output of the last connected graph attention network is the input of the gated recurrent unit. For example, the number of layers of the graph attention network can be set between 2 and 4 layers. Too many layers will result in too large a receptive field of the nodes and reduce the performance of extracting node correlations. The hidden feature dimension of the gated recurrent unit can be tuned as a hyperparameter of the neural network until the model achieves optimal performance.
[0118] In one embodiment, the trained spatio-temporal graph attention network further includes a fully connected layer connected to the gated recurrent unit corresponding to the last acquisition moment. The fully connected layer can realize the mapping from the output of the gated recurrent unit to the predicted voltage. Specifically, the implementation method of performing voltage prediction processing on the target time feature based on the number of prediction moments to obtain the predicted voltage corresponding to each photovoltaic grid-connected node at each prediction moment (i.e., S210) can be as Figure 8 shown, including the following steps:
[0119] S802, Adjust the parameters of the fully connected layer based on the number of prediction moments so that the output dimension of the adjusted fully connected layer matches the number of prediction moments.
[0120] For example, taking the voltage prediction duration of 4 hours as an example, the number of prediction moments is 16. Mapping the output dimension of the last gated recurrent unit (i.e., the hidden feature dimension of the gated recurrent unit, assumed to be 64) to 16, the parameters of the fully connected layer are (64, 16), that is, the number of input nodes is 64 and the number of output nodes is 16.
[0121] S804, Process the target time feature based on the weight matrix and bias vector of the adjusted fully connected layer to obtain the predicted voltage corresponding to each photovoltaic grid-connected node at each prediction moment.
[0122] In one embodiment, the predicted voltage corresponding to each photovoltaic grid-connected node at each prediction moment can be obtained based on the ninth formula, and the ninth formula satisfies:
[0123] y p =W q *h t +b q
[0124] where, h t is the target time feature, Wq is the weight matrix of the fully connected layer, b q is the bias vector of the fully connected layer.
[0125] Based on Figure 8 the content shown, adjusting the fully connected layer based on the number of prediction moments, and processing the target time features based on the weight matrix and bias vector of the fully connected layer can improve the prediction accuracy.
[0126] Combining the above content, in one embodiment, as Figure 9 shown, it includes the following steps:
[0127] S902, obtaining the real-time voltages respectively collected for multiple photovoltaic grid-connected nodes in the target area at at least two acquisition moments, and the voltage prediction duration for the target area; each prediction moment within the voltage prediction duration refers to a future acquisition moment after the acquisition moment.
[0128] Among them, the at least two acquisition moments may include the current acquisition moment and the historical acquisition moments before the current acquisition moment.
[0129] S904, determining the number of prediction moments expected to be included within the voltage prediction duration based on the interval duration between the acquisition moments.
[0130] S906, training the spatio-temporal graph attention network based on the historical voltages of each photovoltaic grid-connected node in the target area to obtain a trained spatio-temporal graph attention network; the trained spatio-temporal graph attention network includes a graph attention network corresponding to each acquisition moment, a gated recurrent unit connected to the graph attention network, and a fully connected layer connected to the gated recurrent unit corresponding to the last acquisition moment.
[0131] For each graph attention network, the graph attention network is configured with the second formula to the fourth formula, where S910 can be executed based on the second formula, S912 can be executed based on the third formula, and S916 can be executed based on the fourth formula.
[0132] For each gated recurrent unit, the gated recurrent unit is configured with the fifth formula to the eighth formula, where S918 can be executed based on the fifth formula, S920 can be executed based on the sixth formula, S922 can be executed based on the seventh formula, and S924 can be executed based on the eighth formula.
[0133] S908, for each acquisition moment, determining the respective neighbor nodes corresponding to each photovoltaic grid-connected node from the photovoltaic grid-connected nodes based on the adjacency relationship between the photovoltaic grid-connected nodes.
[0134] S910. For each neighbor node corresponding to each photovoltaic grid-connected node, using an attention function, the real-time voltages of the photovoltaic grid-connected node and the neighbor node respectively, and the shared parameter matrix for linear transformation, obtain the first attention coefficient of the neighbor node relative to the photovoltaic grid-connected node.
[0135] S912. Normalize the first attention coefficient to obtain the first attention weight of the neighbor node relative to the photovoltaic grid-connected node.
[0136] S914. Based on the second attention coefficient of the photovoltaic grid-connected node relative to the photovoltaic grid-connected node, obtain the second attention weight corresponding to the photovoltaic grid-connected node.
[0137] S916. Use an activation function to process the first attention weight, the second attention weight, the shared parameter matrix, and the real-time voltages of the photovoltaic grid-connected node and the neighbor node respectively, to obtain the spatial feature of the photovoltaic grid-connected node at the acquisition moment.
[0138] S918. For the acquisition moment and the previous acquisition moment of the acquisition moment, use an activation function to process the weight matrix and bias vector of the reset gate, the spatial features corresponding to the acquisition moment, and the time features corresponding to the previous acquisition moment, to obtain the first result output by the reset gate.
[0139] S920. Use the arctangent function to process the weight matrix and bias vector of the hidden unit, the first result, the spatial features corresponding to the acquisition moment, and the time features corresponding to the previous acquisition moment, to obtain an intermediate result.
[0140] S922. Use an activation function to process the weight matrix and bias vector of the update gate, the spatial features corresponding to the acquisition moment, and the time features corresponding to the previous acquisition moment, to obtain the second result output by the update gate.
[0141] S924. Obtain a first parameter that is anti-correlated with the second result, and based on the second result, the first parameter, the time features corresponding to the previous acquisition moment, and the intermediate result, obtain the time features corresponding to the acquisition moment.
[0142] S926. In the case where the acquisition moment is the last acquisition moment, determine the time features corresponding to the acquisition moment as the target time features.
[0143] S928. Adjust the parameters of the fully connected layer based on the number of prediction moments, so that the output dimension of the adjusted fully connected layer matches the number of prediction moments.
[0144] S930. Process the target time features based on the weight matrix and bias vector of the adjusted fully connected layer to obtain the predicted voltages corresponding to each photovoltaic grid-connected node at each prediction moment.
[0145] Among them, the fully connected layer is configured with a ninth formula, and S930 can be executed based on the ninth formula.
[0146] Among them, for the specific content of S902 - S930, reference can be made to the foregoing content for adaptation description, which will not be elaborated here.
[0147] It should be understood that when training the spatio - temporal graph attention network, the spatio - temporal graph attention network can be trained based on the first formula to the ninth formula. By iteratively optimizing the model parameters, the mean square error between the predicted voltage and the actual voltage is minimized, thereby obtaining a trained spatio - temporal graph attention network.
[0148] Based on Figure 9 the content shown, a schematic structural diagram of the trained spatio - temporal graph attention network as shown in Figure 10 can be obtained. Among them, the trained spatio - temporal graph attention network includes a graph attention network GAT corresponding to each acquisition moment, a gated recurrent unit GRU connected to the graph attention network GAT, and a fully connected layer connected to the gated recurrent unit corresponding to the last acquisition moment. Thus, based on Figure 10 the structure shown, using Figure 9 the method shown, the predicted voltages corresponding to each photovoltaic grid - connection node in the target area at each prediction moment can be obtained.
[0149] Among them, each acquisition moment is respectively represented as X1, X2 to X T , and each time step corresponds to an acquisition moment, that is, the number of acquisition moments is T; the network output is the predicted voltages of p time steps, that is, the predicted voltages of the photovoltaic grid - connection nodes at p future prediction moments with the number of prediction moments being p are predicted respectively.
[0150] Combined with the above content, considering that the node voltage in the power system is affected by the grid power supply and grid load, on the one hand, new energy power generation such as photovoltaic and wind power is affected by meteorological conditions, and the output of distributed power sources in adjacent regions is correlated, and the node voltage fluctuations caused by the fluctuations of new energy output are also correlated; on the other hand, the nodes in the power system are connected by lines, and the electrical connection relationship makes the voltages between adjacent nodes naturally correlated. Therefore, in order to fit this correlation to achieve high - precision voltage prediction, the method provided in this application introduces a graph attention network to realize feature interaction between nodes, and represents the correlation relationship between nodes with an adjacency matrix.
[0151] In addition, traditional prediction methods generally rely on Euclidean data. The input data of the model consists of two-dimensional data composed of time and features, and the output is the predicted voltage of a single node. However, as the penetration rate of photovoltaic power generation in the power system continues to increase, the number of photovoltaic grid-connected nodes also increases. If traditional prediction methods are used to monitor all photovoltaic grid-connected nodes in the region, it will be necessary to train models for each node separately and then make predictions individually, increasing the training time and hardware requirements. Therefore, the method provided in this application is based on graph neural networks, which can process non-Euclidean structured data such as graph data, that is, directly input the data of multiple nodes and achieve the voltage prediction of all nodes in the region at one time, saving hardware costs.
[0152] Moreover, the graph attention network has a certain degree of interpretability. By extracting attention weights, the importance between nodes can be obtained, which is convenient for analyzing the prediction results. In addition, the graph attention network is particularly suitable for dealing with situations where node features are uneven or the graph structure is irregular, and can adapt to the complex situations in the power system, with a wide range of applications.
[0153] In summary, for the method provided in this application, first, considering the correlation of node voltages in the region, the correlation aggregation between nodes is achieved by introducing a graph attention network, improving the accuracy of voltage prediction. Second, the voltage prediction of all nodes in the region can be achieved at one time, saving computing power and time costs, and being able to adapt to the situation of high-proportion access of photovoltaic power generation to the power grid. At the same time, the graph attention network has a certain degree of interpretability. By extracting attention weights, the importance between nodes can be obtained, which is convenient for analyzing the prediction results. Moreover, the graph attention network is particularly suitable for dealing with situations where node features are uneven or the graph structure is irregular, and can adapt to the complex situations in the power system, with a wide range of applications.
[0154] It should be understood that although the steps in the flowcharts involved in the above-described embodiments are shown in sequence according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise clearly stated in this article, the execution of these steps has no strict order limit, and these steps can be executed in other orders. Moreover, at least some of the steps in the flowcharts involved in the above-described embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be executed alternately or in turn with at least a part of other steps or steps or stages in other steps.
[0155] Based on the same inventive concept, an embodiment of the present application further provides a photovoltaic grid-connected node voltage prediction device for implementing the photovoltaic grid-connected node voltage prediction method involved above. The solution provided by this device to solve the problem is similar to the solution described in the above method. Therefore, the specific limitations in one or more embodiments of the photovoltaic grid-connected node voltage prediction device provided below can refer to the limitations on the photovoltaic grid-connected node voltage prediction method in the above text, and will not be repeated here.
[0156] In an exemplary embodiment, as Figure 11 shown, a photovoltaic grid-connected node voltage prediction device is provided, including: an acquisition module 1102, a determination module 1104, a first analysis module 1106, a second analysis module 1108, and a prediction module 1110, where:
[0157] The acquisition module 1102 is configured to acquire the real-time voltages respectively collected for a plurality of photovoltaic grid-connected nodes in the target area at at least two acquisition times, and the voltage prediction duration for the target area; the determination module 1104 is configured to determine the number of prediction times expected to be included within the voltage prediction duration based on the interval duration between the acquisition times; each prediction time within the voltage prediction duration refers to a future acquisition time after the acquisition time; the first analysis module 1106 is configured to perform spatial analysis on the real-time voltages obtained at each acquisition time based on the adjacency relationship between the photovoltaic grid-connected nodes, to obtain the spatial characteristics of each photovoltaic grid-connected node at the acquisition time; the second analysis module 1108 is configured to perform temporal analysis on the spatial characteristics corresponding to each acquisition time in the time sequence of the acquisition times, to obtain the target time characteristics; the prediction module 1110 is configured to perform voltage prediction on the target time characteristics based on the required number of prediction times, to obtain the predicted voltages respectively corresponding to each photovoltaic grid-connected node at each prediction time.
[0158] In one of the embodiments, the first analysis module 1106 is further configured to: determine, based on the adjacency relationship between the photovoltaic grid-connected nodes, each neighbor node corresponding to each photovoltaic grid-connected node from among the photovoltaic grid-connected nodes; for each neighbor node corresponding to each photovoltaic grid-connected node, use an attention function to perform linear transformation on the real-time voltages of the photovoltaic grid-connected node and the neighbor nodes and a shared parameter matrix, to obtain the first attention coefficient of the neighbor node relative to the photovoltaic grid-connected node; perform normalization processing on the first attention coefficient to obtain the first attention weight of the neighbor node relative to the photovoltaic grid-connected node; obtain the second attention weight corresponding to the photovoltaic grid-connected node based on the second attention coefficient of the photovoltaic grid-connected node relative to the photovoltaic grid-connected node; use an activation function to perform operations on the first attention weight, the second attention weight, the shared parameter matrix, and the real-time voltages of the photovoltaic grid-connected node and the neighbor nodes, to obtain the spatial characteristics of the photovoltaic grid-connected node at the acquisition time.
[0159] In one embodiment, the first analysis module 1106 is further configured to: use the graph attention network in the trained spatio-temporal graph attention network to perform spatial analysis on the respective real-time voltages obtained at the acquisition moment based on the adjacency relationship between the photovoltaic grid-connected nodes, so as to obtain the spatial features of each photovoltaic grid-connected node at the acquisition moment; wherein, each acquisition moment corresponds to a graph attention network, and the trained spatio-temporal graph attention network further includes a gated recurrent unit connected to each graph attention network, and the gated recurrent unit includes an update gate, a hidden unit, and a reset gate; for the acquisition moment and the previous acquisition moment of the acquisition moment, use an activation function to process the weight matrix and bias vector of the reset gate, the respective spatial features corresponding to the acquisition moment, and the time features corresponding to the previous acquisition moment to obtain a first result output by the reset gate; use the arctangent function to process the weight matrix and bias vector of the hidden unit, the first result, the respective spatial features corresponding to the acquisition moment, and the time features corresponding to the previous acquisition moment to obtain an intermediate result; use an activation function to process the weight matrix and bias vector of the update gate, the respective spatial features corresponding to the acquisition moment, and the time features corresponding to the previous acquisition moment to obtain a second result output by the update gate; obtain a first parameter that is anti-correlated with the second result, and based on the second result, the first parameter, the time features corresponding to the previous acquisition moment, and the intermediate result, obtain the time features corresponding to the acquisition moment; in the case where the acquisition moment is the last acquisition moment, determine the time features corresponding to the acquisition moment as the target time features.
[0160] In one embodiment, the trained spatio-temporal graph attention network further includes a fully connected layer connected to the gated recurrent unit corresponding to the last acquisition moment; the prediction module 1110 is further configured to: adjust the parameters of the fully connected layer based on the number of prediction moments, so that the output dimension of the fully connected layer matches the number of prediction moments; process the target time features based on the weight matrix and bias vector of the adjusted fully connected layer to obtain the predicted voltages corresponding to each photovoltaic grid-connected node at each prediction moment.
[0161] In one embodiment, the acquisition module 1101 is further configured to: for each photovoltaic grid-connected node and each remaining node other than the photovoltaic grid-connected node in the target area, obtain the Pearson correlation coefficient between the photovoltaic grid-connected node and the remaining node based on the respective historical voltages of the photovoltaic grid-connected node and the remaining node; the remaining node is a photovoltaic grid-connected node; when the Pearson correlation coefficient is greater than or equal to a preset coefficient, determine that the remaining node is a neighbor node of the photovoltaic grid-connected node, and set the element at the corresponding position of the photovoltaic grid-connected node and the remaining node in the adjacency matrix to a first preset value; when the Pearson correlation coefficient is less than the preset coefficient, determine that the remaining node is a non-neighbor node of the photovoltaic grid-connected node, and set the element at the corresponding position of the photovoltaic grid-connected node and the remaining node in the adjacency matrix to a second preset value.
[0162] In one embodiment, the device further includes an alarm module, which is configured to: for each predicted voltage corresponding to a predicted moment adjacent to the current time, determine, for each predicted voltage, the difference between the predicted voltage and the voltage limit value of the corresponding photovoltaic grid-connected node; wherein, the voltage limit value is determined according to the node voltage level of the photovoltaic grid-connected node; if, among multiple differences, there is a difference that exceeds the voltage deviation range of the photovoltaic grid-connected node, an alarm message is output.
[0163] Each module in the above photovoltaic grid-connected node voltage prediction device can be implemented in whole or in part by software, hardware, and their combination. The above modules can be embedded in the processor of the computer device in hardware form or be independent of it, or be stored in the memory of the computer device in software form, so as to facilitate the processor to call and execute the operations corresponding to the above respective modules.
[0164] In an exemplary embodiment, a computer device is provided. The computer device can be a server, and its internal structure diagram can be as Figure 12 shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, abbreviated as I / O), and a communication interface. Among them, the processor, the memory, and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data such as the real-time voltages of each photovoltaic grid-connected node at each acquisition moment, and the historical voltages of each photovoltaic grid-connected node. The input / output interface of the computer device is used for the processor to exchange information with external devices. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a method for predicting the voltage of a photovoltaic grid-connected node is implemented.
[0165] Those skilled in the art can understand that Figure 12 the structure shown in
[0166] In one embodiment, a computer device is further provided, which includes a memory and a processor. A computer program is stored in the memory, and when the processor executes the computer program, the steps in the foregoing method embodiments are implemented.
[0167] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the foregoing method embodiments are implemented.
[0168] In one embodiment, a computer program product is provided, which includes a computer program. When the computer program is executed by a processor, the steps in the foregoing method embodiments are implemented.
[0169] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use, and processing of relevant data need to comply with relevant regulations.
[0170] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above methods. Among them, any reference to a memory, database, or other medium used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc. The databases involved in the embodiments provided in this application can include at least one of relational databases and non-relational databases. Non-relational databases can include distributed databases based on blockchain, etc., without limitation. The processors involved in the embodiments provided in this application can be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, data processing logics based on quantum computing, artificial intelligence (AI) processors, etc., without limitation.
[0171] The technical features of the above embodiments can be combined arbitrarily. For the sake of brevity of description, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, it should be considered to be within the scope recorded in this application.
[0172] The above-described embodiments merely represent several implementation manners of the present application. The description thereof is relatively specific and detailed, but it should not be construed as a limitation on the patent scope of the present application. It should be noted that for those of ordinary skill in the art, without departing from the concept of the present application, several modifications and improvements can still be made, and these all fall within the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the appended claims.
Claims
1. A photovoltaic grid-connected node voltage prediction method, characterized in that, The method includes: Obtaining the real-time voltages respectively collected for a plurality of photovoltaic grid-connected nodes within a target area at at least two acquisition times, and the voltage prediction duration for the target area; each prediction time within the voltage prediction duration refers to a future acquisition time after the acquisition time; Based on the interval durations between the acquisition times, determining the number of prediction times expected to be included within the voltage prediction duration; For each of the acquisition times, based on the adjacency relationship between the photovoltaic grid-connected nodes, performing spatial analysis on the real-time voltages obtained at the acquisition time to obtain the spatial characteristics of each photovoltaic grid-connected node at the acquisition time; In accordance with the time sequence between the acquisition times, performing temporal analysis on the spatial characteristics respectively corresponding to the acquisition times to obtain target time characteristics; Based on the number of prediction times, performing voltage prediction processing on the target time characteristics to obtain the predicted voltages respectively corresponding to each photovoltaic grid-connected node at each prediction time.
2. The method according to claim 1, characterized in that The performing spatial analysis on the real-time voltages obtained at the acquisition time based on the adjacency relationship between the photovoltaic grid-connected nodes to obtain the spatial characteristics of each photovoltaic grid-connected node at the acquisition time includes: Based on the adjacency relationship between the photovoltaic grid-connected nodes, determining, from the photovoltaic grid-connected nodes, each neighbor node corresponding to each photovoltaic grid-connected node; For each neighbor node corresponding to each photovoltaic grid-connected node, using an attention function to obtain, for the real-time voltages of the photovoltaic grid-connected node and the neighbor node respectively and a shared parameter matrix for linear transformation, a first attention coefficient of the neighbor node relative to the photovoltaic grid-connected node; Performing normalization processing on the first attention coefficient to obtain a first attention weight of the neighbor node relative to the photovoltaic grid-connected node; Based on a second attention coefficient of the photovoltaic grid-connected node relative to the photovoltaic grid-connected node, obtaining a second attention weight corresponding to the photovoltaic grid-connected node; Using an activation function to obtain, for the first attention weight, the second attention weight, the shared parameter matrix, and the real-time voltages of the photovoltaic grid-connected node and the neighbor node respectively, the spatial characteristics of the photovoltaic grid-connected node at the acquisition time.
3. The method according to claim 1, wherein The method further includes: Using the graph attention network in the trained spatio-temporal graph attention network to perform spatial analysis on the real-time voltages obtained at the acquisition time based on the adjacency relationship between the photovoltaic grid-connected nodes to obtain the spatial characteristics of each photovoltaic grid-connected node at the acquisition time; Wherein, each acquisition time corresponds to the graph attention network, and the trained spatio-temporal graph attention network further includes a gated recurrent unit connected to each graph attention network, and the gated recurrent unit includes an update gate, a hidden unit, and a reset gate; The performing temporal analysis on the spatial characteristics respectively corresponding to the acquisition times in accordance with the time sequence between the acquisition times to obtain target time characteristics includes: For the collection time and the previous collection time of the collection time, use an activation function to process the weight matrix and bias vector of the reset gate, each spatial feature corresponding to the collection time, and the time feature corresponding to the previous collection time to obtain a first result output by the reset gate; Use the arctangent function to process the weight matrix and bias vector of the hidden unit, the first result, each of the spatial features corresponding to the collection time, and the time feature corresponding to the previous collection time to obtain an intermediate result; Use an activation function to process the weight matrix and bias vector of the update gate, each spatial feature corresponding to the collection time, and the time feature corresponding to the previous collection time to obtain a second result output by the update gate; Obtain a first parameter that is inversely correlated with the second result, and based on the second result, the first parameter, the time feature corresponding to the previous collection time, and the intermediate result, obtain the time feature corresponding to the collection time; In the case where the collection time is the last collection time, determine the time feature corresponding to the collection time as the target time feature.
4. The method according to claim 3, characterized in that, The trained spatio-temporal graph attention network further includes a fully connected layer connected to the gated recurrent unit corresponding to the last collection time; The voltage prediction process for the target time feature based on the number of prediction times to obtain the predicted voltages corresponding to each of the photovoltaic grid-connected nodes at each prediction time includes: Adjust the parameters of the fully connected layer based on the number of prediction times so that the output dimension of the fully connected layer matches the number of prediction times; Process the target time feature based on the weight matrix and bias vector of the adjusted fully connected layer to obtain the predicted voltages corresponding to each of the photovoltaic grid-connected nodes at each prediction time.
5. The method according to claim 1, characterized in that The adjacency relationship between each of the photovoltaic grid-connected nodes is represented by an adjacency matrix, and the obtaining method of the adjacency matrix includes: For each photovoltaic grid-connected node and each remaining node in the target area except the photovoltaic grid-connected node, based on the respective historical voltages of the photovoltaic grid-connected node and the remaining node, obtain the Pearson correlation coefficient between the photovoltaic grid-connected node and the remaining node; the remaining node is a photovoltaic grid-connected node; When the Pearson correlation coefficient is greater than or equal to a preset coefficient, determine that the remaining node is a neighbor node of the photovoltaic grid-connected node, and set the element at the corresponding position of the photovoltaic grid-connected node and the remaining node in the adjacency matrix to a first preset value; When the Pearson correlation coefficient is less than the preset coefficient, determine that the remaining node is a non-neighbor node of the photovoltaic grid-connected node, and set the element at the corresponding position of the photovoltaic grid-connected node and the remaining node in the adjacency matrix to a second preset value.
6. The method according to claim 1, wherein The method further includes: For each of the predicted voltages corresponding to the predicted moments adjacent to the current time, for each of the predicted voltages, determine the difference between the predicted voltage and the voltage limit of the corresponding photovoltaic grid-connected node; wherein, the voltage limit is determined according to the node voltage level of the photovoltaic grid-connected node. If, among the multiple differences, there is a difference that exceeds the voltage deviation range of the photovoltaic grid-connected node, an alarm message is output.
7. A photovoltaic grid-connected node voltage prediction device, characterized in that, The device includes: An acquisition module, configured to acquire the real-time voltages respectively acquired for multiple photovoltaic grid-connected nodes in a target area at at least two acquisition moments, and the voltage prediction duration for the target area. A determination module, configured to determine the number of predicted moments expected to be included within the voltage prediction duration based on the interval duration between the acquisition moments; each predicted moment within the voltage prediction duration refers to a future acquisition moment after the acquisition moment. A first analysis module, configured to perform spatial analysis on the real-time voltages obtained at each acquisition moment based on the adjacency relationship between the photovoltaic grid-connected nodes for each of the acquisition moments, and obtain the spatial characteristics of each photovoltaic grid-connected node at the acquisition moment. A second analysis module, configured to perform temporal analysis on the spatial characteristics corresponding to each of the acquisition moments in the chronological order of the acquisition moments, and obtain the target time characteristics. A prediction module, configured to perform voltage prediction on the target time characteristics based on the required number of predicted moments, and obtain the predicted voltages respectively corresponding to each photovoltaic grid-connected node at each predicted moment.
8. A computer device, comprising a memory and a processor, the memory storing a computer program, characterized in that, When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, the steps of the method according to any one of claims 1 to 6 are implemented.
Citation Information
Cited By
Power distribution network load prediction method and device in photovoltaic grid connection and medium
CN121440563A
System and method for controlling power distribution systems using graph-based reinforcement learning
US12627150B2
System and method for controlling power distribution systems using graph-based reinforcement learning
US20230074995A1
