A power system voltage amplitude and phase angle collaborative prediction method and system based on a hybrid neural network
The voltage amplitude and phase angle co-prediction method using a hybrid neural network model solves the problems of low efficiency and fragmentation in existing power system voltage prediction technologies, achieving high-precision voltage state prediction, adapting to dynamic and topological changes in the power system, and meeting the real-time requirements of online rolling prediction.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- NANJING INST OF TECH
- Filing Date
- 2026-04-15
- Publication Date
- 2026-07-14
AI Technical Summary
Existing power system voltage prediction methods rely on accurate physical models, resulting in low prediction efficiency, fragmented amplitude and phase angle predictions, and an inability to meet the real-time requirements of online rolling prediction. Furthermore, they fail to effectively capture the dynamic processes and topology changes of the power system.
A hybrid neural network model, including convolutional neural networks, bidirectional gated recurrent units, and time attention layers, is adopted. A collaborative prediction method for voltage amplitude and phase angle is constructed through a sliding window mechanism and multi-step rolling prediction. Historical power data of grid nodes is used for end-to-end mapping, and a weighted composite loss function is introduced to balance the prediction error.
It achieves high-precision voltage amplitude and phase angle co-prediction, improves prediction efficiency and flexibility, meets the real-time requirements of rolling prediction, adapts to topology changes and measurement gaps, and provides reliable voltage stability assessment and control input.
Smart Images

Figure CN122393986A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of power system automation technology, specifically to a method and system for the collaborative prediction of power system voltage amplitude and phase angle based on a hybrid neural network. Background Technology
[0002] With the integration of a high proportion of renewable energy and a large number of power electronic devices into the grid, the randomness and volatility of power system operation have intensified, posing significant challenges to real-time situational awareness, safety early warning, and optimized control of the power grid. Voltage, as a core indicator for measuring power quality and system stability, requires rapid and accurate prediction for preventing voltage instability, optimizing reactive power and voltage control, and supporting the safe and economical operation of new power systems. Traditional voltage prediction methods mainly rely on power flow calculations based on physical models, such as the Newton-Raphson method. While these methods offer high accuracy, their performance heavily depends on precise grid topology parameters, component models, and real-time measurement data. In practical operation, their robustness is poor when faced with topology changes, inaccurate parameters, or missing measurements. Furthermore, for large-scale power grids, iterative power flow calculations are time-consuming, making it difficult to meet the real-time requirements of online rolling prediction.
[0003] Patent CN112290539A discloses a method and system for predicting transient voltage stability margin in power systems, which meets the requirements of speed and accuracy in assessing transient voltage stability margin in power systems and can adapt to scenarios where the power grid operation mode changes. However, the prediction does not consider the impact of changes in the power distribution across the entire grid, and the prediction results lack physical consistency and have weak generalization ability. In addition, existing methods often predict voltage amplitude and phase angle separately, severing the physical coupling between the two and making it difficult to ensure the consistency of the prediction results.
[0004] Patent CN116680989A discloses a method and system for predicting transient voltage stability of microgrid groups, which achieves efficient and accurate prediction of transient voltage stability of complex multi-bus microgrid groups. However, it does not consider that the time dimension is separated in the prediction process, ignores the dynamic inertia and time-series dependence of the power system state evolution, and cannot achieve effective multi-step forward rolling prediction, nor can it capture the dynamic process of the system over time. Summary of the Invention
[0005] The purpose of this invention is to provide a method and system for the coordinated prediction of voltage amplitude and phase angle in power systems based on hybrid neural networks, so as to solve the problems of relying on accurate physical models, low prediction efficiency, and separation of amplitude and phase angle prediction in the prior art.
[0006] To achieve the above objectives, the technical solution provided by this invention is: a method for co-predicting voltage amplitude and phase angle of a power system based on a hybrid neural network, comprising the following steps: S1: Obtain the historical dataset of the power system. The historical dataset contains the active power and reactive power of the grid nodes under multiple continuous time sections, as well as the actual voltage amplitude and actual voltage phase angle of each grid node corresponding to the time. S2: Perform data preprocessing on the historical dataset, construct a multi-dimensional feature vector for each power grid node in each time segment, and differentiate the true voltage amplitude and true voltage phase angle to obtain standardized target voltage amplitude parameters and target voltage phase angle parameters respectively. S3: The multidimensional feature vectors of the power grid nodes are serialized in time using a sliding window method to obtain the multidimensional feature vector sequence corresponding to each power grid node, which constitutes the training sample set; a hybrid neural network model is constructed, the input of which is the multidimensional feature vector sequence, and the output is the standardized target voltage amplitude parameter and target voltage phase angle parameter at the next time step; the hybrid neural network model is optimized and trained based on the training sample set, and the optimization training objective is to minimize the weighted composite loss function oriented towards voltage amplitude and voltage phase angle; S4: Evaluate the hybrid neural network model during training. Stop training when the evaluation metric on the validation set no longer decreases for several consecutive training rounds. Select the model with the best evaluation result as the final hybrid neural network model. S5: Deploy the final selected hybrid neural network model in the online prediction environment. Based on the sliding window and multi-step rolling prediction mechanism, receive real-time power data of the grid nodes and generate multi-dimensional feature vectors, and output the joint prediction results of voltage amplitude and voltage phase angle.
[0007] To optimize the above technical solution, the specific measures also include: Further, in step S2, the construction of a multi-dimensional feature vector for each power grid node at each time segment specifically involves:
[0008]
[0009]
[0010] in: This represents the active power of a power grid node; This represents the reactive power of a power grid node; This represents the periodic time characteristics of power grid nodes generated based on timestamps. Indicates the daily cycle; A normalized identifier for grid node numbers. Indicates the number of samples; express.
[0011] In step S2, the differential processing of the true voltage amplitude and the true voltage phase angle to obtain standardized target voltage amplitude parameters and target voltage phase angle parameters is specifically performed as follows: the true voltage amplitude is standardized, and the true voltage phase angle is sequentially unwrapped, smoothed by moving average, and standardized by Z-score to obtain standardized target voltage amplitude parameters and target voltage phase angle parameters, expressed as:
[0012] in, M The number of valid data points; V base Standard reference voltage; No. t The first time section n The actual voltage amplitude of each power grid node; No. t The first time section n Standardized target voltage amplitude parameters for each power grid node For all valid time sections t valid nodes n The voltage amplitudes are summed.
[0013]
[0014]
[0015]
[0016] in, For the first The first time section The actual voltage phase angle of each grid node; For the first The first time section The voltage phase angle of each grid node after smoothing; unwrap() is the unwrapping function used to eliminate abrupt changes in phase angle around ±180°; The moving average window width; and These are the mean and standard deviation of the unwound and smoothed phase angle sequence, respectively. For the first The first time section Standardized target voltage phase angle parameters for each power grid node.
[0017] Further, in step S3, the hybrid neural network model includes a convolutional neural network layer, a bidirectional gated recurrent unit layer, a temporal attention layer, and a fully connected output layer connected in sequence; the convolutional neural network layer performs a one-dimensional convolution operation along the time axis, and its calculation formula is:
[0018] in, l This indicates a layer index; * indicates a one-dimensional convolution operation. For the first t At the next time step, the CNN network... l The output features of the layer; ReLU is a linear rectified activation function used to introduce non-linear features and improve the model's fitting ability; Let be the convolutional kernel weights of the l-th layer of the CNN network, and be trainable parameters. For the first t At the next time step, the CNN network... l The output features of layer 1, i.e., the first layer l Layer input; For CNN network l The bias parameters of the layer are trainable parameters.
[0019] In step S3, the weighted composite loss function balances the voltage amplitude prediction error and the voltage phase angle prediction error, and the calculation formula is as follows:
[0020] in, This is a weighted composite loss function; For all trainable parameters of the hybrid neural network; N batch Batch size; This is the voltage phase angle loss weighting coefficient. For the first i The standardized target voltage amplitude parameters predicted for each sample. For the first i The true standardized target voltage amplitude parameters of each sample. For the first i The standardized target voltage phase angle parameters predicted for each sample. For the first i The sample contains the true standardized target voltage phase angle parameters.
[0021] In step S4, the evaluation of the hybrid neural network model during training is specifically carried out as follows: The training sample set was divided into training, validation, and test sets in a 7:2:1 ratio. The hybrid neural network model was trained using the Adam optimizer and a weighted composite loss function (λ=5). During training, the mean absolute error (MAPE), root mean square error (RMSE), and coefficient of determination (CQD) were calculated using the validation set after each training epoch. As an evaluation indicator, the calculation formula is as follows: Mean absolute error MAPE The calculation formula is:
[0022] Root mean square error RMSE The calculation formula is:
[0023] Coefficient of determination The calculation formula is:
[0024] in, This represents the true value of the voltage amplitude or phase angle. This is a predicted value for voltage amplitude or phase angle; The number of voltage amplitudes or phase angles; It is the average value of voltage amplitude or phase angle.
[0025] When the evaluation metric on the validation set no longer decreases for several consecutive training epochs, training is stopped, and the model parameters with the minimum loss on the validation set are saved as the final selected hybrid neural network model.
[0026] In step S5, the online prediction environment includes sliding window initialization and maintenance, as well as multi-step rolling prediction execution. The specific process of sliding window initialization and maintenance is as follows: For each grid node, a sliding window is maintained to continuously receive the latest active and reactive power data of the grid node. Each time a new time segment of data is received, it is constructed as a feature vector and added to the end of the window, and the oldest data at the beginning of the window is removed to achieve window sliding.
[0027] Furthermore, the multi-step rolling prediction execution is specifically as follows: For the k-th future step that needs to be predicted, the feature sequence within the current sliding window is organized into an input tensor and fed into the pre-trained hybrid neural network model to obtain the predicted values of all power grid nodes. For multi-step prediction, the prediction result of the current step is used as known data to update the sliding window and iteratively predict the subsequent step size.
[0028] As another important technical solution, the present invention also provides a power system voltage amplitude and phase angle co-prediction system based on a hybrid neural network, comprising: The data acquisition module is used to acquire historical datasets of the power system. The historical datasets include the active power and reactive power of the grid nodes under multiple continuous time sections, as well as the actual voltage amplitude and actual voltage phase angle of each grid node corresponding to the time. The data processing module is used to preprocess the historical dataset, construct a multi-dimensional feature vector for each power grid node in each time segment, and perform differential processing on the true voltage amplitude and the true voltage phase angle to obtain the standardized target voltage amplitude parameters and target voltage phase angle parameters, respectively. The model building and training module is used to perform time-series serialization of the multidimensional feature vectors of power grid nodes using a sliding window approach, obtaining the multidimensional feature vector sequence corresponding to each power grid node, which constitutes the training sample set; it constructs a hybrid neural network model, whose input is the multidimensional feature vector sequence and output is the standardized target voltage amplitude parameter and target voltage phase angle parameter at the next time step; it optimizes and trains the hybrid neural network model based on the training sample set, with the optimization training objective being to minimize the weighted composite loss function oriented towards voltage amplitude and voltage phase angle; The validation and evaluation module is used to evaluate the hybrid neural network model during training. Training stops when the evaluation metric on the validation set no longer decreases for several consecutive training rounds, and the model with the best evaluation result is selected as the final hybrid neural network model. The model prediction module is used to deploy the final selected hybrid neural network model in the online prediction environment. Based on the sliding window and multi-step rolling prediction mechanism, it receives real-time power data of the grid nodes and generates multi-dimensional feature vectors, and outputs the joint prediction results of voltage amplitude and voltage phase angle.
[0029] The present invention also proposes an electronic device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, it implements a power system voltage amplitude and phase angle co-prediction method based on a hybrid neural network as described above.
[0030] The present invention also proposes a computer-readable storage medium storing a computer program that enables a computer to execute a power system voltage amplitude and phase angle co-prediction method based on a hybrid neural network as described above.
[0031] Compared with the prior art, the beneficial effects of the present invention are: This invention achieves high-precision collaborative prediction of voltage amplitude and phase angle in power systems by constructing a hybrid spatiotemporal neural network model that deeply integrates convolutional neural networks, bidirectional gated recurrent units, and a time attention mechanism. This fundamentally changes the traditional approach that relies on precise physical modeling and iterative solutions. This method only requires historical active and reactive power time-series data to establish an end-to-end mapping from power input to voltage state output, significantly improving prediction efficiency and online deployment flexibility, and meeting the real-time requirements of rolling prediction scenarios.
[0032] This invention achieves synchronous and coordinated prediction of voltage amplitude and phase angle by designing a unified hybrid neural network output structure. It also introduces a weighted composite loss function to dynamically balance the prediction errors of the two, effectively solving the problem of poor physical coordination caused by modeling amplitude and phase angle separately in traditional methods. This ensures that the prediction results conform to the inherent power and voltage coupling law of the power system, providing a reliable input basis for subsequent voltage stability assessment and reactive power optimization control.
[0033] This invention also designs a sliding window mechanism and a multi-step rolling prediction strategy. It maintains a fixed-length feature window for each power grid node, updates power data in real time and generates an input sequence. Through iterative feedback, it uses the prediction result of the current step as known information to recursively predict the subsequent step length, thereby realizing a forward-looking prediction of the voltage state in the future multiple time steps. It fully considers the time-series dependence of power system operation and the lag effect of power changes on voltage.
[0034] This invention introduces a node number normalized identifier as a learnable spatial location code, which implicitly distinguishes the electrical characteristics and spatial differences of different nodes without relying on a clear power grid topology. Combined with periodic time characteristics, it enhances the adaptability and generalization robustness to complex operating conditions such as topology changes and measurement gaps.
[0035] This invention not only improves the accuracy and efficiency of voltage state prediction, but also provides reliable data support for the safe and stable operation of the power grid and intelligent decision-making. It demonstrates significant engineering application value and broad prospects for promotion in the field of power system situation awareness and operation control. Attached Figure Description
[0036] Figure 1 This is a flowchart of the present invention.
[0037] Figure 2 These are prediction curves for different models in embodiments of the present invention.
[0038] Figure 3 This is a comparison chart of voltage prediction results under different window widths in an embodiment of the present invention.
[0039] Figure 4This is a prediction curve of the CNN-BiGRU-Attention model of the present invention.
[0040] Figure 5 This is a training loss map in an embodiment of the present invention.
[0041] Figure 6 This is a diagram of the hybrid neural network structure in an embodiment of the present invention.
[0042] Figure 7 This is a schematic diagram of the BiGRU structure in an embodiment of the present invention.
[0043] Figure 8 This is a flowchart of the attention mechanism in an embodiment of the present invention.
[0044] Figure 9 This is a flowchart of the core model prediction process of this invention.
[0045] Figure 10 This is a comparison chart of the predicted and actual voltage amplitude and phase angle values of the present invention.
[0046] Figure 11 This is a correlation analysis diagram for single-voltage node prediction in this invention.
[0047] Figure 12 This is a schematic diagram of the sliding window principle of the present invention. Detailed Implementation
[0048] The present invention will be further described in detail below through specific embodiments, but it should not be construed as limiting the scope of the subject matter of the present invention to the following embodiments. All technologies implemented based on the above content of the present invention fall within the scope of the present invention.
[0049] In some embodiments, the present invention provides a method for co-predicting voltage amplitude and phase angle of a power system based on a hybrid neural network, comprising the following steps: S1: Obtain the historical dataset of the power system. The historical dataset contains the active power and reactive power of the grid nodes under multiple continuous time sections, as well as the actual voltage amplitude and actual voltage phase angle of each grid node corresponding to the time. S2: Perform data preprocessing on the historical dataset, construct a multi-dimensional feature vector for each power grid node in each time segment, and differentiate the true voltage amplitude and true voltage phase angle to obtain standardized target voltage amplitude parameters and target voltage phase angle parameters respectively. During the operation of a power system, the node voltage state is mainly affected by the injected power and its time variation. A multi-dimensional feature vector is constructed for each node at each time segment, and its calculation formula is as follows:
[0050]
[0051]
[0052] in: This represents the active power of a power grid node; This represents the reactive power of a power grid node; This represents the periodic time characteristics generated by power grid nodes based on timestamps (hours, minutes). Indicates the daily cycle; A normalized identifier for each power grid node serves as a learnable spatial location code, enabling the model to implicitly distinguish the electrical characteristics and spatial differences between nodes without relying on a defined power grid topology. Specifically, this code assigns an optimizable embedding vector to each node, automatically capturing the relative relationships and electrical characteristic differences between nodes during the training process. N The number of nodes determines the scale of the location encoding; n This represents the number of samples, used to describe the total number of temporal samples participating in training. By combining node-level encoding with temporal features of the sample dimension, the model can learn the spatial distribution patterns and electrical behavior characteristics of each node even in the absence of explicit topological information.
[0053] In some implementations, the active and reactive power of the grid nodes are normalized using the global maximum absolute value of the training set to eliminate dimensional differences and improve numerical stability.
[0054] The true voltage amplitude is standardized to ensure its data falls within a reasonable range, facilitating unified network modeling. The true voltage phase angle is then unwrapped, smoothed using moving average, and standardized using Z-score to obtain standardized target voltage amplitude and phase angle parameters. This eliminates abrupt discontinuities in the phase angle around ±180° and reduces the interference of high-frequency noise on the prediction results. The expression is:
[0055] in, M The number of valid data points; V base Standard reference voltage; No. t The first time section n The actual voltage amplitude of each power grid node; No. t The first time section n Standardized target voltage amplitude parameters for each power grid node For all valid time sections t valid nodesn Sum the voltage values;
[0056]
[0057]
[0058] in, For the first The first time section The actual voltage phase angle of each grid node; For the first The first time section The voltage phase angle of each grid node after smoothing; unwrap() is the unwrapping function used to eliminate abrupt changes in phase angle around ±180°; The moving average window width; and These are the mean and standard deviation of the unwound and smoothed phase angle sequence, respectively. For the first The first time section Standardized target voltage phase angle parameters for each power grid node.
[0059] S3: The multidimensional feature vectors of the power grid nodes are serialized in time using a sliding window method to obtain the multidimensional feature vector sequence corresponding to each power grid node, which constitutes the training sample set; a hybrid neural network model is constructed, the input of which is the multidimensional feature vector sequence, and the output is the standardized target voltage amplitude parameter and target voltage phase angle parameter at the next time step; the hybrid neural network model is optimized and trained based on the training sample set, and the optimization training objective is to minimize the weighted composite loss function oriented towards voltage amplitude and voltage phase angle; In some implementations, a sliding window approach is used, where for any prediction time, the previous prediction time is extracted. L Using a sequence of multidimensional feature vectors from historical moments as model input, the model can fully utilize historical operating state information to capture the hysteretic and cumulative effects of power changes on voltage state.
[0060] The hybrid neural network model consists of a one-dimensional convolutional neural network layer unit, a bidirectional gated recurrent unit, a temporal attention layer unit, and a fully connected output layer unit connected in sequence. Through a unified network structure, the coordinated output of voltage amplitude and phase angle is achieved, ensuring the physical consistency and numerical coordination of the prediction results.
[0061] In some implementations, the CNN layer within a one-dimensional convolutional neural network layer performs one-dimensional convolution operations along the time axis to automatically learn the short-term local patterns and abrupt changes of the local time series of each power grid node in the input sequence. The calculation formula is as follows:
[0062] in, l This indicates a layer index; * indicates a one-dimensional convolution operation. For the first t At the next time step, the CNN network... l The output features of the layer; ReLU is a linear rectified activation function used to introduce non-linear features and improve the model's fitting ability; Let be the convolutional kernel weights of the l-th layer of the CNN network, and be trainable parameters. For the first t At the next time step, the CNN network... l The output features of layer 1, i.e., the first layer l Layer input; For CNN network l The bias parameters of the layer are trainable parameters.
[0063] The bidirectional gated recurrent unit receives the deep feature sequence extracted by the CNN network, and the BiGRU layer processes the sequence simultaneously from both forward and backward directions, effectively capturing the long-term dependencies and dynamic inertia in the state evolution of the power system. The temporal attention layer unit takes into account all the outputs of the BiGRU layer. L The hidden states at each time step are weighted and aggregated, so that the model can automatically focus on the historical information that is most critical to the current prediction. In some implementations, the fully connected output layer unit maps the context vector output by the attention layer to the final two-dimensional predicted value, i.e., the standardized target voltage magnitude parameter. and standardized target voltage phase angle parameters ; In step S3, the weighted composite loss function balances the voltage amplitude prediction error and the voltage phase angle prediction error, and the calculation formula is as follows:
[0064] in, This is a weighted composite loss function; For all trainable parameters of the hybrid neural network; N batch Batch size; This is the voltage phase angle loss weighting coefficient, with a typical value. This is used to enhance the prediction accuracy requirements for the sensitive parameter of voltage phase angle; For the first i The standardized target voltage amplitude parameters predicted for each sample. For the first i The true standardized target voltage amplitude parameters of each sample. For the first i The standardized target voltage phase angle parameters predicted for each sample. For the first i The sample contains the true, standardized target voltage phase angle parameters. This weighted composite loss function balances the amplitude and phase angle prediction accuracy through the weight λ, thus ensuring the training effect of synergistic optimization of both.
[0065] S4: Evaluate the hybrid neural network model during training. Stop training when the evaluation metric on the validation set no longer decreases for several consecutive training rounds. Select the model with the best evaluation result as the final hybrid neural network model. In some implementations, mean absolute percentage error, root mean square error, and coefficient of determination are used to evaluate the prediction results; Mean absolute error MAPE The calculation formula is:
[0066] Root mean square error RMSE The calculation formula is:
[0067] Coefficient of determination The calculation formula is:
[0068] in, This represents the true value of the voltage amplitude or phase angle. This is a predicted value for voltage amplitude or phase angle; The number of voltage amplitudes or phase angles; It is the average value of voltage amplitude or phase angle.
[0069] In some implementations, the training, validation, and test sets are divided in a 7:2:1 ratio. The hybrid neural network model is trained using the Adam optimizer and a weighted composite loss function (λ=5). During training, after each training epoch, the mean absolute error (MAPE), root mean square error (RMSE), and coefficient of determination are calculated using the validation set. () as an evaluation indicator.
[0070] Training stops when the evaluation metric on the validation set no longer decreases after several consecutive training epochs, and the model parameters with the minimum loss on the validation set are saved as the final selected hybrid neural network model. These model parameters include the convolutional kernel size, the hidden layer dimension of the bidirectional gated recurrent unit, the learning rate, the sliding window length, and the batch size. According to MAPE, RMSE and R 2The specific values are used to judge the quality of each of the three tests, and finally, the overall performance of the hybrid neural network model is determined by combining the results of the three tests. Prediction accuracy test: Validated on a 33-node test set, the voltage amplitude RMSE was obtained as 0.0037, the voltage phase angle RMSE as 1.1347, and R... 2 Values greater than 0.98 are all within the good range; Spatiotemporal modeling effectiveness test: Multiple benchmark models were selected as comparison objects under the same training dataset, the same prediction stride, and the same test scenario. These included a pure LSTM model using only recurrent neural network structures, a pure CNN model using only convolutional structures, and a CNN–BiGRU combined model without an attention mechanism. Figure 2 As can be seen, compared with pure LSTM, pure CNN and CNN-BiGRU, this model is significantly better than the comparison models in all core accuracy metrics; like Figure 9 As shown, online efficiency testing verified the high efficiency of data processing and flow through multi-node data partitioning and standardization. Comparing the CNN-BiGRU-Attention and BiGRU models, the model demonstrated low latency and high accuracy in the collaborative prediction of voltage amplitude and phase angle under sequence-to-point regression and temporal attention mechanisms. Complete coverage of the test set and standardization process ensured the stability and continuity of online operation. All three tests were passed, and the core quantitative indicators were at an excellent level, indicating that the model is suitable for the collaborative prediction of voltage amplitude and phase angle in power systems.
[0071] S5: Deploy the final selected hybrid neural network model in the online prediction environment. Based on the sliding window and multi-step rolling prediction mechanism, receive real-time power data of the grid nodes and generate multi-dimensional feature vectors, and output the joint prediction results of voltage amplitude and voltage phase angle.
[0072] The online prediction environment includes sliding window initialization and maintenance, as well as multi-step rolling prediction execution. The specific process of sliding window initialization and maintenance is as follows: In some implementations, a fixed-length sliding window is maintained for each grid node, continuously receiving the latest active and reactive power data of the grid node, with each new time segment received... t The data is used to construct a feature vector. Xt (Including electrical quantities such as active power and reactive power) Add to the end of the window and remove the oldest data from the beginning of the window to achieve window sliding.
[0073] The formula for calculating the sliding window update is as follows: Let the current time be T current The sliding window contains the most recent LFeature vectors of historical moments:
[0074] in, W new The set of the latest feature sequences after the sliding window update. is the node feature vector of the time section, and is the historical feature within the window.
[0075] In some implementations, multi-step rolling forecasting specifically involves: for the future number that needs to be predicted... k step( k =1,2,..., H , H To predict the total step size, the feature sequence within the current sliding window is organized into an input tensor, which is then fed into a pre-trained hybrid neural network model to output the predicted values for all power grid nodes in parallel. The multi-step prediction process specifically involves: [The text abruptly ends here, likely due to an incomplete sentence or missing information.] k The prediction result of the first step is used as known data to update the sliding window, and the subsequent step size is predicted iteratively (i.e., the first step). k +1 step to the next H step).
[0076] The autocorrelation coefficient of the historical load dataset is calculated to reflect the correlation between states at different lag times.
[0077] Here, the states between each lag order refer to the intervals in the time series. h The correlation between two observations at each time step is calculated using the following formula:
[0078] in, h For order, u The mean of a time series composed of historical load data. x i and x i+h Corresponding to the first in the original time series i The observation value and the first i+h Two observations, both from the same sequence, are determined by lag order. h Establish pairing relationships to calculate the distance between them. h The correlation between two observations at a given time step x h The autocorrelation coefficient is used to indicate the historical data for that time interval, suggesting that the historical data has strong predictive value for the current load. This result represents the sliding window length of the hybrid neural network model. LThe selection provides a reference basis, namely, to prioritize the lag order with strong autocorrelation as the window length, thereby improving the model's ability to capture time series features.
[0079] In another embodiment of the present invention, a power system voltage amplitude and phase angle co-prediction system based on a hybrid neural network is proposed, comprising: The data acquisition module is used to acquire historical datasets of the power system. The historical datasets include the active power and reactive power of the grid nodes under multiple continuous time sections, as well as the actual voltage amplitude and actual voltage phase angle of each grid node corresponding to the time. The data processing module is used to preprocess the historical dataset, construct a multi-dimensional feature vector for each power grid node in each time segment, and perform differential processing on the true voltage amplitude and the true voltage phase angle to obtain the standardized target voltage amplitude parameters and target voltage phase angle parameters, respectively. The model building and training module is used to perform time-series serialization of the multidimensional feature vectors of power grid nodes using a sliding window approach, obtaining the multidimensional feature vector sequence corresponding to each power grid node, which constitutes the training sample set; it constructs a hybrid neural network model, whose input is the multidimensional feature vector sequence and output is the standardized target voltage amplitude parameter and target voltage phase angle parameter at the next time step; it optimizes and trains the hybrid neural network model based on the training sample set, with the optimization training objective being to minimize the weighted composite loss function oriented towards voltage amplitude and voltage phase angle; The validation and evaluation module is used to evaluate the hybrid neural network model during training. Training stops when the evaluation metric on the validation set no longer decreases for several consecutive training rounds, and the model with the best evaluation result is selected as the final hybrid neural network model. The model prediction module is used to deploy the final selected hybrid neural network model in the online prediction environment. Based on the sliding window and multi-step rolling prediction mechanism, it receives real-time power data of the grid nodes and generates multi-dimensional feature vectors, and outputs the joint prediction results of voltage amplitude and voltage phase angle.
[0080] In another embodiment of the present invention, an electronic device is proposed, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements a power system voltage amplitude and phase angle co-prediction method based on a hybrid neural network as described above.
[0081] In another embodiment of the present invention, a computer-readable storage medium is provided storing a computer program that causes a computer to execute a power system voltage amplitude and phase angle co-prediction method based on a hybrid neural network as described above.
[0082] In the embodiments disclosed in this application, a computer storage medium may be a tangible medium that may contain or store programs for use by or in conjunction with an instruction execution system, apparatus, or device. The computer storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of computer storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0083] In some implementations, such as Figure 1 As shown, the overall process of this method is as follows: Import the data, then configure the parameters, including setting the path and window parameters, and determining the size and step size of the sliding window.
[0084] After parameter configuration, the next stage is feature engineering and sequential sample construction. First, the required data is extracted from the complete dataset, and the training set is initialized, with a time window set to 24 hours. Based on this, sequential samples are constructed to prepare input-output pairs for model training.
[0085] After completing sample construction, proceed to the model training branch. Start the model, select the running mode, and enter the model training process. The model training part includes: loading preprocessed data, constructing sequence samples, packaging the dataset, initializing the model, and then entering the training loop to train the model. After training is complete, save the model and charts.
[0086] After model training is complete, the system enters the online rolling prediction branch. First, the saved model is loaded. Then, temporal features and prediction sequences are constructed. Predictions are made through forward propagation of the model, and after inverse normalization, the prediction results are output and saved. The system calculates an error index based on the prediction results.
[0087] After completing a prediction, the system determines whether to trigger retraining. If retraining is required, the system continues to update the model by calling the training model; otherwise, the prediction results are accumulated and written to the rolling prediction data, and the system slides to the next window. The system extracts data from the current 144 nodes from the complete data, and then calls the prediction model to perform the next round of prediction, forming a rolling prediction loop.
[0088] After the entire rolling prediction process is completed, the system plots an error trend graph to visually evaluate the model's prediction performance, and the process ends.
[0089] Through the above process, this invention achieves a complete closed loop from data preprocessing, sample construction, model training to online rolling prediction, ensuring that the model can adaptively update and maintain prediction accuracy.
[0090] like Figure 3 As shown, during periods of rapid load changes or large fluctuations in renewable energy output, the model of this invention accurately tracks the dynamic changes in voltage state. Furthermore, through visualization analysis of the attention weight distribution, it was found that at critical moments with large voltage changes, the model automatically assigns higher attention weights to the corresponding historical power mutation moments, indicating that the attention mechanism effectively identifies the historical information that has the greatest influence on the current prediction.
[0091] In some implementations, such as Figure 4 As shown, the predictions for the 24-hour voltage amplitude and phase angle curves are highly consistent with the true values when verified on a standard 33-node distribution system test set. like Figure 5 As shown, both training loss and validation loss show a continuous decreasing trend with the increase of training epochs. The model achieves a good fit on the training set and also demonstrates good generalization ability on the validation set. The training process converges stably without oscillation or divergence, fully demonstrating the effectiveness and robustness of the adopted training strategy.
[0092] like Figure 6 As shown, the CNN–BiGRU–Attention hybrid network structure employed is specifically designed for the characteristics of power system operation data. Power system power and voltage data exhibit both significant temporal continuity and sudden changes and nonlinear coupling relationships. A single type of neural network structure is insufficient to handle these characteristics. Specifically, the one-dimensional convolutional neural network scans the time series through local convolutional kernels, effectively extracting short-term fluctuation patterns in the power data, such as sudden load increases and rapid changes in the output of distributed power sources. Figure 7 As shown, based on convolutional features, this invention employs a bidirectional GRU network structure to model the feature sequence simultaneously from both the forward and backward temporal directions, such as... Figure 8 As shown, a temporal attention mechanism is introduced to adaptively weight the hidden states at each time step. Specifically, the input features are first transformed by linear projection to calculate the attention score; then the attention score is normalized to generate normalized weights; finally, the features at each time step are multiplied by the corresponding weights and aggregated into a context vector through weighted summation, thereby achieving dynamic focusing on important temporal information.
[0093] In some implementations, such as Figure 9As shown, a feature construction and sample organization method integrating the physical characteristics and time periodicity of the power grid is presented. In terms of feature construction, a multi-bus per-unit modeling approach is adopted to unify the dimensions of different voltage levels, and phase angle smoothing is combined to eliminate the impact of phase angle jumps on model training. In terms of sample organization, multiple sets of sample pairs are constructed for model training by dividing Predict1 as the prediction target sequence and Train1~TrainN as historical input sequences, thereby achieving effective matching of features and labels in time series prediction tasks.
[0094] like Figure 10 As shown, the method of this invention involves only one feedforward neural network inference process in the prediction phase, avoiding the computational burden caused by repeatedly constructing the Jacobian matrix and solving nonlinear equations in traditional methods. Therefore, even in online rolling prediction scenarios with short prediction intervals, such as 5 minutes or 15 minutes per round, the method of this invention operates stably and fully meets the application requirements of real-time situational awareness and early warning analysis of power systems. In some implementations, such as Figure 11 As shown, the mean absolute percentage error (MAPE) of voltage amplitude prediction is generally below 1%, and the coefficient of determination R² exceeds 0.99. Phase angle prediction also accurately captures its changing trend and magnitude, demonstrating the model's excellent accuracy. like Figure 12 As shown, a sliding window method was used for model training and evaluation in the robustness test. The parent window defines the overall time range, and child windows slide sequentially within the parent window to generate multiple training samples, thereby improving the model's generalization ability to temporal features. By artificially introducing a certain proportion of random noise into the original training and test data, and simulating situations where the power data at some time points is not completely accurate, the changes in the model's predictive performance were analyzed. Test results show that under the above perturbation conditions, the model's training loss remained stable and converged without abnormal oscillations; at the same time, the prediction error only fluctuated slightly, and the overall accuracy remained at a high level, without significant instability or abnormal deviations in the prediction results.
[0095] The above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention in any way. Any simple modifications, equivalent substitutions, and improvements made by those skilled in the art to the above embodiments without departing from the scope of the technical solution of the present invention, based on the technical essence of the present invention, shall still fall within the protection scope of the technical solution of the present invention.
Claims
1. A method for co-predicting voltage amplitude and phase angle in a power system based on a hybrid neural network, characterized in that, Includes the following steps: S1: Obtain the historical dataset of the power system. The historical dataset contains the active power and reactive power of the grid nodes under multiple continuous time sections, as well as the actual voltage amplitude and actual voltage phase angle of each grid node corresponding to the time. S2: Perform data preprocessing on the historical dataset, construct a multi-dimensional feature vector for each power grid node in each time segment, and differentiate the true voltage amplitude and true voltage phase angle to obtain standardized target voltage amplitude parameters and target voltage phase angle parameters respectively. S3: The multidimensional feature vectors of the power grid nodes are serialized in time using a sliding window method to obtain the multidimensional feature vector sequence corresponding to each power grid node, which constitutes the training sample set; a hybrid neural network model is constructed, the input of which is the multidimensional feature vector sequence, and the output is the standardized target voltage amplitude parameter and target voltage phase angle parameter at the next time step; the hybrid neural network model is optimized and trained based on the training sample set, and the optimization training objective is to minimize the weighted composite loss function oriented towards voltage amplitude and voltage phase angle; S4: Evaluate the hybrid neural network model during training. Stop training when the evaluation metric on the validation set no longer decreases for several consecutive training rounds. Select the model with the best evaluation result as the final hybrid neural network model. S5: Deploy the final selected hybrid neural network model in the online prediction environment. Based on the sliding window and multi-step rolling prediction mechanism, receive real-time power data of the grid nodes and generate multi-dimensional feature vectors, and output the joint prediction results of voltage amplitude and voltage phase angle.
2. The method for co-predicting voltage amplitude and phase angle of a power system based on a hybrid neural network according to claim 1, characterized in that: In step S2, the construction of a multi-dimensional feature vector for each power grid node at each time segment specifically involves: in: This represents the active power of a power grid node; This represents the reactive power of a power grid node; This represents the periodic time characteristics of power grid nodes generated based on timestamps; A normalized identifier for the numbering of power grid nodes.
3. The method for co-predicting voltage amplitude and phase angle of a power system based on a hybrid neural network according to claim 1, characterized in that: In step S2, the differential processing of the true voltage amplitude and the true voltage phase angle to obtain standardized target voltage amplitude parameters and target voltage phase angle parameters is specifically performed as follows: the true voltage amplitude is standardized, and the true voltage phase angle is sequentially unwrapped, smoothed by moving average, and standardized by Z-score to obtain standardized target voltage amplitude parameters and target voltage phase angle parameters, expressed as: in, V base Standard reference voltage; No. t The first time section n The actual voltage amplitude of each power grid node; No. t The first time section n Standardized target voltage amplitude parameters for each power grid node; For the first The first time section Standardized target voltage phase angle parameters for each power grid node; For the first The first time section The voltage phase angle of each power grid node after smoothing; and These are the mean and standard deviation of the phase angle sequence after unwinding and smoothing, respectively.
4. The method for co-predicting voltage amplitude and phase angle of a power system based on a hybrid neural network according to claim 1, characterized in that: In step S3, the weighted composite loss function balances the voltage amplitude prediction error and the voltage phase angle prediction error, and the calculation formula is as follows: in, This is a weighted composite loss function; For all trainable parameters of the hybrid neural network; N batch Batch size; This is the voltage phase angle loss weighting coefficient. For the first i The standardized target voltage amplitude parameters predicted for each sample. For the first i The true standardized target voltage amplitude parameters of each sample. For the first i The standardized target voltage phase angle parameters predicted for each sample. For the first i The sample contains the true standardized target voltage phase angle parameters.
5. The method for co-predicting voltage amplitude and phase angle of a power system based on a hybrid neural network according to claim 1, characterized in that: In step S4, the evaluation of the hybrid neural network model during training is specifically carried out as follows: The training sample set is divided into a training set, a validation set, and a test set according to a preset ratio. The hybrid neural network model is trained using the Adam optimizer and a weighted composite loss function. During the training process, the evaluation index is calculated using the validation set after each training round. The evaluation index includes the mean absolute percentage error and the root mean square error. When the evaluation metric on the validation set no longer decreases for several consecutive training epochs, training is stopped, and the model parameters with the minimum loss on the validation set are saved as the final selected hybrid neural network model.
6. The method for co-predicting voltage amplitude and phase angle of a power system based on a hybrid neural network according to claim 1, characterized in that: In step S5, the online prediction environment includes sliding window initialization and maintenance, as well as multi-step rolling prediction execution. The specific process of sliding window initialization and maintenance is as follows: For each grid node, a sliding window is maintained to continuously receive the latest active and reactive power data of the grid node. Each time a new time segment of data is received, it is constructed as a feature vector and added to the end of the window, and the oldest data at the beginning of the window is removed to achieve window sliding.
7. The method for co-predicting voltage amplitude and phase angle of a power system based on a hybrid neural network according to claim 6, characterized in that: The multi-step rolling prediction execution is specifically as follows: For the k-th future step that needs to be predicted, the feature sequence within the current sliding window is organized into an input tensor and fed into the pre-trained hybrid neural network model to obtain the predicted values of all power grid nodes. For multi-step prediction, the prediction result of the current step is used as known data to update the sliding window and iteratively predict the subsequent step size.
8. A power system voltage amplitude and phase angle co-prediction system based on a hybrid neural network, characterized in that, include: The data acquisition module is used to acquire historical datasets of the power system. The historical datasets include the active power and reactive power of the grid nodes under multiple continuous time sections, as well as the actual voltage amplitude and actual voltage phase angle of each grid node corresponding to the time. The data processing module is used to preprocess the historical dataset, construct a multi-dimensional feature vector for each power grid node in each time segment, and perform differential processing on the true voltage amplitude and the true voltage phase angle to obtain the standardized target voltage amplitude parameters and target voltage phase angle parameters, respectively. The model building and training module is used to perform time-series serialization of the multidimensional feature vectors of power grid nodes using a sliding window approach, obtaining the multidimensional feature vector sequence corresponding to each power grid node, which constitutes the training sample set; it constructs a hybrid neural network model, whose input is the multidimensional feature vector sequence and output is the standardized target voltage amplitude parameter and target voltage phase angle parameter at the next time step; it optimizes and trains the hybrid neural network model based on the training sample set, with the optimization training objective being to minimize the weighted composite loss function oriented towards voltage amplitude and voltage phase angle; The validation and evaluation module is used to evaluate the hybrid neural network model during training. Training stops when the evaluation metric on the validation set no longer decreases for several consecutive training rounds, and the model with the best evaluation result is selected as the final hybrid neural network model. The model prediction module is used to deploy the final selected hybrid neural network model in the online prediction environment. Based on the sliding window and multi-step rolling prediction mechanism, it receives real-time power data of the grid nodes and generates multi-dimensional feature vectors, and outputs the joint prediction results of voltage amplitude and voltage phase angle.
9. An electronic device, characterized in that, include: The device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, it implements a method for co-predicting voltage amplitude and phase angle of a power system based on a hybrid neural network as described in any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: The computer program causes the computer to execute a power system voltage amplitude and phase angle co-prediction method based on a hybrid neural network as described in any one of claims 1 to 7.