Power grid investment prediction method and system
By using the GRU-Attention model of the time attention mechanism in the grid investment prediction and combining the PSO particle swarm optimization algorithm, the problem of insufficient accuracy of the grid investment prediction model under the influence of complex factors is solved, and higher prediction accuracy and stability.
Patent Information
- Application Number
- CN202411091938.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-09
- Publication Date
- 2024-12-27
AI Technical Summary
The existing grid investment prediction model cannot accurately predict the complex nonlinear and non-stationary characteristics of grid investment under the influence of multiple factors, and the traditional model ignores the cyclical characteristics of historical investment data, resulting in inaccurate prediction results and insufficient generalization capabilities. .
A GRU-Attention prediction model based on the time attention mechanism is adopted, and the model parameters are optimized in combination with the PSO particle swarm optimization algorithm to generate a PSO-GRU prediction model to improve the accuracy and stability of the prediction.
Through the PSO-GRU model, the problem of difficult to determine neural network parameters is overcome, the accidentality of manual parameter adjustment is avoided, and the accuracy and stability of grid investment prediction is significantly improved, which is better than the root mean square error and average absolute error of other models. Performance.
Smart Images

Figure CN119205347A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of power systems, and in particular to a power grid investment forecasting method and system. Background Art
[0002] With the development of grid automation and intelligence, the grid is developing rapidly in the direction of kilovolt ultra-high voltage, AC / DC hybrid transmission, and large-scale grid connection of new energy equipment. The business structure of the grid has changed, the electricity demand of the whole society continues to increase, and the requirements for grid construction and investment are also increasing. If power companies can analyze and predict grid investment in a timely and accurate manner in advance, they can coordinate and plan the investment management of grid construction, and at the same time arrange project plans in advance, reduce costs, promote the stable development of enterprises, improve investment planning and plan the construction process.
[0003] The exploration of prediction methods has always been the focus of scholars, and many prediction methods have been proposed. Traditional prediction models based on parameter estimation include regression analysis, time series prediction, and gray models. These models have established a mature theoretical foundation in the continuous development of decades in the last century and have been widely studied and applied at home and abroad. In recent years, with the continuous development of artificial neural networks, machine learning, intelligent computing and other technologies, these methods have been widely used in the field of prediction. Therefore, intelligent algorithms based on the above single or combined prediction models have become the mainstream and development trend in the field of prediction.
[0004] Some scholars have proposed the use of hierarchical analysis and grey models to predict grid investment, but these prediction models are too simple and subjective, so the accuracy of the prediction results needs to be improved. Other scholars have proposed a grid investment demand forecast based on cointegration theory and error correction model, which finds the logarithmic linear relationship between grid investment and various factors affecting grid investment. However, grid investment is affected by multiple factors such as economy, society, politics, and environment, which can be further divided into short-term, medium-term, and long-term influencing factors. Therefore, under the joint action of short-term, medium-term, and long-term influencing factors, grid investment exhibits complex nonlinear and non-stationary characteristics, making this method unable to accurately predict grid investment. In addition, traditional grid investment forecasting models often ignore the periodic characteristics of historical investment data, resulting in one-sided investment allocation results and insufficient model generalization ability. Summary of the invention
[0005] The purpose of the present invention is to solve at least one technical problem in the background technology and to provide a power grid investment forecasting method and system.
[0006] To achieve the above object, the present invention provides a power grid investment forecasting method, comprising the following steps:
[0007] Acquire historical power grid investment data, preprocess the historical power grid investment data, and generate a training set and a test set;
[0008] Based on the historical grid investment data and the temporal attention mechanism, an initial GRU-Attention prediction model is constructed;
[0009] Optimizing the parameters of the initial GRU-Attention prediction model based on the training set and the optimized PSO particle swarm optimization algorithm to obtain a trained PSO-GRU prediction model;
[0010] Based on the trained PSO-GRU prediction model, power investment prediction is performed on the target power grid.
[0011] According to one solution of the present invention, preprocessing the historical power grid investment data includes: normalizing the historical power grid investment data.
[0012] According to one solution of the present invention, the optimized PSO particle swarm optimization algorithm includes: adding an inertia weight w to the PSO particle swarm optimization algorithm;
[0013] The update iteration formula of the optimized PSO particle swarm optimization algorithm includes:
[0014]
[0015] in, represents the velocity of particle i in dimension j in the n+1th iteration;
[0016] represents the velocity of particle i in dimension j in the nth iteration;
[0017] c1 represents the acceleration factor, which is used to adjust the convergence speed of the algorithm;
[0018] r i,n j With R i,n j Represents a random number that satisfies a uniform distribution between 0 and 1, that is, r i,n j ,R i,n j ~U(0,1);
[0019] represents the position of the best adaptive value in the jth dimension found for particle i in the nth iteration, that is, the personal best position;
[0020] represents the position of particle i in dimension j in the nth iteration;
[0021] represents the global best position in dimension j at the nth iteration.
[0022] According to one solution of the present invention, the inertia weight w satisfies the following formula:
[0023]
[0024] Among them, w max and w min are the maximum and minimum values of the inertia weight w respectively; t is the current iteration number; t max is the maximum number of iterations.
[0025] According to one solution of the present invention, the method further includes: verifying the trained PSO-GRU prediction model based on the test set.
[0026] According to one solution of the present invention, the evaluation index for optimizing the parameters of the initial GRU-Attention prediction model based on the training set and the optimized PSO particle swarm optimization algorithm includes: root mean square error RMSE.
[0027] To achieve the above object, the present invention also provides a power grid investment forecasting system, comprising:
[0028] A preprocessing module, used to obtain historical power grid investment data, preprocess the historical power grid investment data, and generate a training set and a test set;
[0029] A model building module, used to build an initial GRU-Attention prediction model based on the historical power grid investment data and the time attention mechanism; optimize the parameters of the initial GRU-Attention prediction model based on the training set and the optimized PSO particle swarm optimization algorithm to obtain a trained PSO-GRU prediction model;
[0030] The prediction module is used to predict the power investment of the target power grid based on the trained PSO-GRU prediction model.
[0031] The present invention uses the PSO particle swarm optimization algorithm to optimize the parameters of the GRU-Attention prediction model to obtain a trained PSO-GRU prediction model, thereby effectively solving the problem of difficulty in determining neural network parameters and avoiding the contingency of manual parameter adjustment and the deficiency of over-reliance on expert experience. Based on the trained PSO-GRU prediction model, the present invention predicts the power investment of the target power grid and obtains the power grid investment prediction value, thereby improving the accuracy and stability of the prediction. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] Figure 1A flow chart of a method for predicting power grid investment according to an embodiment of the present invention;
[0033] Figure 2 A structural diagram of a power grid investment forecasting system according to an embodiment of the present invention;
[0034] Figure 3 A schematic diagram of the network structure of a GRU;
[0035] Figure 4 A flow chart of a method for optimizing parameters of an initial GRU-Attention prediction model based on an optimized PSO particle swarm optimization algorithm according to an embodiment of the present invention;
[0036] Figure 5 A flow chart of a method for predicting power grid investment according to an embodiment of the present invention;
[0037] Figure 6 Provide historical grid investment data for a power company;
[0038] Figure 7 The historical power grid investment data after preprocessing;
[0039] Figure 8 A weight distribution diagram of a power grid investment forecasting method according to an embodiment of the present invention;
[0040] Fig. 9 A power grid investment prediction curve diagram according to an embodiment of the present invention;
[0041] Fig.10 A power grid investment prediction curve diagram according to an embodiment of the present invention;
[0042] Fig.11 A power grid investment prediction curve diagram according to an embodiment of the present invention. DETAILED DESCRIPTION
[0043] The content of the present invention will now be discussed with reference to exemplary embodiments. It should be understood that the embodiments discussed are only to enable those skilled in the art to better understand and thus implement the content of the present invention, rather than implying any limitation on the scope of the present invention.
[0044] As used herein, the term "including" and variations thereof are to be interpreted as open-ended terms meaning "including but not limited to." The term "based on" is to be interpreted as "based, at least in part, on." The terms "one embodiment" and "an embodiment" are to be interpreted as "at least one embodiment."
[0045] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.
[0046] Figure 1 FIG. 1 is a flow chart of a method for predicting power grid investment according to an embodiment of the present invention. Figure 1 As shown, in this embodiment, a power grid investment forecasting method includes the following steps:
[0047] Step S102: Acquire historical power grid investment data, pre-process the historical power grid investment data, and generate a training set and a test set;
[0048] Step S104: constructing an initial GRU-Attention prediction model based on historical power grid investment data and the temporal attention mechanism;
[0049] The Gated Recurrent Unit (GRU) is based on the Long Short-Term Memory (LSTM) network. The forget gate and input gate in the LSTM are improved to update gates, so that there are only reset gates and update gates in the structure, thereby simplifying the network structure, reducing training parameters, and reducing learning and training time. Figure 3 It is a schematic diagram of the network structure of a GRU, such as Figure 3 As shown, the calculation formula is as follows:
[0050] r t =σ(W r h t-1 +U r x t +b r ),
[0051] z t =σ(W z h t-1 +U z x t +b z ),
[0052]
[0053]
[0054] Among them, x t represents the input features at the current time t, h t represents the hidden state at the current time t, z t and r t represent the update gate and reset gate respectively, W r , U r , W z , U z , W h and U h is the weight matrix; b r 、b zand b h is the corresponding bias vector; tanh is the hyperbolic tangent function; σ is the sigmoid function; and Represents vector product;.
[0055] When people's brains process a large amount of complex information, they usually focus on the main information and reduce the attention to the secondary information in order to obtain more valuable information and reduce other irrelevant information. This is the attention mechanism of the brain. By imitating the way the human brain handles this information overload, the attention mechanism has been proposed in the field of deep learning. When the time series is too long, the traditional GRU network may lose important information. Unlike the traditional GRU network, the attention mechanism assigns an adaptive weight coefficient to the output of the hidden layer state at the last moment and makes the coefficient satisfy the distribution of the probability distribution function. This weight score is called the attention score, which is linearly weighted with the hidden layer state output at each moment to obtain the final feature vector. Its calculation formula is as follows:
[0056] a t =σ(W a h t +b a ),
[0057]
[0058] Among them, W a is the weight matrix; b a is the bias vector; σ is the sigmoid function; ⊙ is the Hadamard product, that is, the product of the corresponding elements in the matrix; a t is the attention score. t is the output of the attention layer at time t.
[0059] This paper proposes a gated recurrent unit (GRU) model with integrated temporal attention mechanism, extracts the periodic features of the input power grid investment data sequence, and constructs an initial GRU-Attention prediction model.
[0060] Step S106: Optimizing the parameters of the initial GRU-Attention prediction model based on the training set and the optimized PSO particle swarm optimization algorithm to obtain a trained PSO-GRU prediction model;
[0061] PSO particle swarm optimization algorithm is a typical swarm intelligence optimization algorithm. Like most swarm intelligence optimization algorithms, this algorithm usually randomly initializes a set of solutions (particles), and then iteratively updates these solutions to adjust the entire population as a whole to a better fitness value. Finally, it is expected that the optimal solution to the problem can be found in a finite number of iterations. If a PSO particle swarm optimization algorithm containing M particles is used to solve a problem with a search space dimension of N, then in the nth iteration of PSO, the current position and current velocity of particle i (1≤i≤M) can be expressed as X and i,n =(X i1,n ,X i2,n ,···,X iN,n ) and V i,n =(V i1,n ,V i2,n ,···,V iN,n ). PSO uses the following equations to update the velocity and position of each particle in each dimensional component at each iteration:
[0062]
[0063]
[0064] in, represents the velocity of particle i in dimension j in the n+1th iteration;
[0065] represents the velocity of particle i in dimension j in the nth iteration; for most problems, when using PSO to solve, it is necessary to limit the jth dimension of the particle velocity to a certain range [-V maxj ,V maxj ,];
[0066] c1 and c2 represent acceleration factors, which are used to adjust the convergence speed of the algorithm. In this embodiment, both c1 and c2 are set to 2.
[0067] r i,n j ,R i,n j Represents a random number that satisfies a uniform distribution between 0 and 1, that is, r i,n j ,R i,n j ~U(0,1);
[0068] represents the position of the best adaptive value found for particle i in the jth dimension at the nth iteration, that is, the personal best (pbest) position, P i,n =(P i,n1 ,P i,n2 ,…,Pi,nN );
[0069] represents the position of particle i in dimension j in the nth iteration;
[0070] represents the global optimal position at the nth iteration in dimension j;
[0071] G n =(G n1 ,G n2 ,…,G nN ) is the position with the best adaptation value among all pbest positions at the nth iteration, also known as the global best (gbest) position;
[0072] Vector P i,n =(P i,n1 ,P i,n2 ,…,P i,nN ) is the position of the best adaptive value found for particle i from initialization to the nth iteration, also known as the personal best (pbest) position. After each iteration, the pbest position of each particle needs to be updated according to the following rules:
[0073]
[0074] where f(·) is the objective function to find the fitness value of the corresponding position.
[0075] The training process of the PSO-GRU prediction model can be summarized into the following steps:
[0076] (1) Initialize parameters such as population size, number of iterations, variable dimension, inertia weight, and learning factor.
[0077] (2) Initialize the position and velocity of the particle.
[0078] (3) Update the individual and global optimal positions of the population.
[0079] (4) Use adaptive methods to update parameters.
[0080] (5) Update the particle's position and velocity.
[0081] (6) If the number of iterations reaches the set value, the search stops.
[0082] (7) Save the best parameter set.
[0083] Step S108: Based on the trained PSO-GRU prediction model, power investment prediction is performed on the target power grid.
[0084] The present invention adopts the PSO particle swarm optimization algorithm to optimize the parameters of the GRU-Attention prediction model to obtain the trained PSO-GRU prediction model, which overcomes the problem that the parameters of the neural network are difficult to determine, and avoids the defects of certain randomness and over-reliance on expert experience in manual parameter adjustment; based on the trained PSO-GRU prediction model, the present invention predicts the power investment of the target power grid, obtains the power grid investment prediction value, and improves the prediction accuracy and stability.
[0085] Figure 6 Provide historical grid investment data for a power company. Figure 7 is the historical power grid investment data after preprocessing. Figure 6 and Figure 7 As shown, according to one embodiment of the present invention, preprocessing the historical power grid investment data includes: normalizing the historical power grid investment data;
[0086] Specifically, the historical power grid investment data is normalized by the minimum-maximum algorithm, and the normalization formula is as follows:
[0087]
[0088] Among them, y* is the normalized data, y max is the maximum value of the power investment data, y min It is the minimum value of electricity investment data.
[0089] Since the historical power grid investment data has been normalized, the data obtained by the power investment forecast of the target power grid based on the trained PSO-GRU forecasting model needs to be further processed to restore the forecast results to their original data range; this is done through the following formula:
[0090] y=y * (y max -y min )+y min .
[0091] Among them, y is the power investment forecast data of the original data interval.
[0092] Figure 6 The monthly power investment data from August 2009 to July 2011 are shown. In the specific network model training, it is found that the learning effect of directly using the original data is poor. The reason may be that the power grid investment data will fall from a high level to 0 from the end of the first half to the beginning of the year. Taking the end of 2009 to the beginning of 2010 as an example, the investment amount at the end of 2009 was close to 400 billion yuan, and the power grid investment amount will start from 0 at the beginning of 2010, which will show a huge data drop on the chart.
[0093] Unstable data is not conducive to the iteration of the gradient descent algorithm, because the mutated data points are discontinuous and non-differentiable, and gradient descent cannot be used for training at such data locations. The gradient descent algorithm is more suitable for smooth data, so the data is preprocessed to make the data more conducive to the training of the algorithm.
[0094]
[0095] Where ×h is the mid-year data. If t is in the first half of the year, the first half of the year data is selected. If t is in the second half of the year, the data is regarded as the end-of-year data minus twice the current grid investment data. After such processing, the data at the end of the year and the beginning of the year will not be too large. In actual model training, it is found that after such data processing, the data is more suitable for the gradient descent optimization algorithm, and the fit is improved compared with before processing. In this embodiment, the processed grid investment line graph is as follows Figure 7 shown.
[0096] Since the GRU model is highly sensitive to data scale, the present invention can reduce the impact of data on the results of grid investment forecasting by normalizing historical grid investment data. At the same time, processing the original data in a normalized manner can also prevent data leakage.
[0097] Figure 4 The flowchart of a method for optimizing the parameters of the initial GRU-Attention prediction model based on the optimized PSO particle swarm optimization algorithm according to an embodiment of the present invention is as follows. Figure 1 and Figure 4 As shown, according to an embodiment of the present invention, the optimized PSO particle swarm optimization algorithm includes: adding an inertia weight w to the PSO particle swarm optimization algorithm; the update iteration formula of the optimized PSO particle swarm optimization algorithm includes:
[0098]
[0099] in, represents the velocity of particle i in dimension j in the n+1th iteration;
[0100] represents the velocity of particle i in dimension j in the nth iteration;
[0101] c1 represents the acceleration factor, which is used to adjust the convergence speed of the algorithm;
[0102] r i,n j ,R i,n j Represents a random number that satisfies a uniform distribution between 0 and 1, that is, r i,n j ,Ri,n j ~U(0,1);
[0103] represents the position of the best adaptive value in the jth dimension found for particle i in the nth iteration, that is, the personal best position;
[0104] represents the velocity of particle i in dimension j in the nth iteration;
[0105] represents the global best position at the nth iteration in dimension j.
[0106] Because the search behavior is too biased towards the global optimal solution, the PSO particle swarm optimization algorithm converges too slowly when solving certain problems. The present invention improves the convergence speed of the PSO particle swarm optimization algorithm when solving problems by adding inertia weights to the PSO particle swarm optimization algorithm.
[0107] According to one embodiment of the present invention, the inertia weight w satisfies the following formula:
[0108]
[0109] Among them, w max and w min are the maximum and minimum values of w respectively; t is the current iteration number; t max is the maximum number of iterations.
[0110] As t increases, w gradually decreases, that is, the weight is larger in the early stage and smaller in the later stage.
[0111] By optimizing the inertia weight w, the present invention can make the model update faster when the global optimal solution is not found in the early stage of optimization search, thereby improving the global optimization search capability; in the later stage close to the global optimal solution, the model update speed slows down and the local optimization search capability is enhanced. The improved PSO particle swarm optimization algorithm is used to optimize the parameters of GRU in a given parameter space to improve the accuracy of the power grid investment forecasting model.
[0112] According to one embodiment of the present invention, a power grid investment forecasting method further includes:
[0113] Step S107: Verify the trained PSO-GRU prediction model based on the test set.
[0114] Table 1 is a comparison of normalized RMSE metrics for different models:
[0115] Table 1
[0116]
[0117] Among them, Model 1: In the traditional GRU model, the network is not optimized and the initialization parameters are used for training.
[0118] Model 2: The classic PSO particle swarm optimization algorithm is used to optimize the GRU model.
[0119] Model 3: Grey prediction model.
[0120] Model 4: Autoregressive model.
[0121] Model 5: Use the classic PSO algorithm to optimize the LSTM network model.
[0122] Model 6: The artificial grey wolf algorithm is used to optimize the GRU model parameters.
[0123] Model 7: Random prediction model.
[0124] According to the results in Table 1, the root mean square error of the PSO-GRU model after training proposed by the present invention is 0.1223, which is better than other algorithms. This data proves the effectiveness of the PSO-GRU model proposed by the present invention.
[0125] In order to further confirm the effectiveness of the model, we introduced the mean absolute error MAE to further compare the normalized data of different models. The comparison results are shown in Table 2:
[0126] Table 2
[0127]
[0128] By analyzing the data in Table 1 and Table 2, we found that: the deep learning algorithm is more suitable for power grid investment forecasting, but the performance of the GRU algorithm is significantly better than that of the LSTM algorithm; compared with the traditional GRU model, the application of the optimization algorithm can significantly improve the prediction accuracy; compared with the artificial gray wolf algorithm, the parameter optimization performance of the particle swarm optimization algorithm is better; the RMSE and MAE of the GRU algorithm are lower than those of the gray prediction model and the autoregressive model; after being optimized by the traditional PSO particle swarm optimization algorithm, the performance of the GRU model is significantly improved, and the RMSE of the three years is reduced by 0.0044, 0.0052 and 0.0042 respectively, and the average absolute error of the three years is reduced by 0.0012, 0.00534 and 0.00427 respectively; although the decrease in the RMSE and MAE values is very small, the reduction in the original investment amount range is converted into a larger value. The improvement scheme proposed in the present invention further improves the particle swarm optimization algorithm and further improves the accuracy of power grid investment forecasting. The PSO-GRU model proposed in the present invention has higher prediction accuracy and is more suitable for power grid investment forecasting business.
[0129] The PSO-GRU model proposed in the present invention has lower RMSE and MAE, with an average normalized RMSE of 0.1223, and is more suitable for power investment forecasting.
[0130] After completing the training of the PSO-GRU prediction model, the present invention verifies the model through a test set to detect the performance of the PSO-GRU prediction model.
[0131] The present invention uses a test set to predict the trained model, further determines the prediction effect of the model, and reduces the risk of directly using the power grid investment prediction model for prediction.
[0132] According to one embodiment of the present invention, the evaluation index for optimizing the parameters of the initial GRU-Attention prediction model based on the training set and the optimized PSO particle swarm optimization algorithm includes: root mean square error RMSE.
[0133] The smaller the value of the root mean square error (RMSE), the smaller the deviation between the predicted result and the true value, and the more accurate the result. The present invention optimizes the parameters of the initial GRU-Attention prediction model by referencing the root mean square error (RMSE), so that the confirmation of the optimal parameters is more accurate.
[0134] Figure 5 FIG. 1 is a flow chart of a method for predicting power grid investment according to an embodiment of the present invention. Figure 5 As shown, the technical framework used in this embodiment includes three main parts: data processing, prediction model construction and parameter optimization, and its functions are as follows:
[0135] (1) Collect power investment data, smooth the data, and enhance the regularity of the data. Normalize and scale the data to the interval [0, 1], and then perform sliding window processing on the input data.
[0136] (2) Divide the data into training set and test set, and initialize the network parameters. Then initialize the parameters of the PSO particle swarm optimization algorithm, and iteratively search the parameter set of the GRU algorithm with RMSE as the evaluation index. Repeat 10 times and save the best parameter set. The initialized network parameters are shown in Table 3, and the saved best parameter set is shown in Table 4:
[0137] Table 3
[0138] parameter Influence Parameter Value period Iterations 100 Batch size The number of samples per training iteration 8 quit The probability of random neuron inactivation 0.1 Learning Rate Control weight updates 0.01 Neurons Number of neurons in GRU 8 level GRU network layers 3
[0139] Table 4
[0140] parameter Parameter Value period 46 Batch size 8 quit 0.1 Learning Rate 0.018 Neurons [6,8,13] level 3
[0141] (3) Save the optimal model parameters and group the optimized GRU models, predict the power grid investment on the test set, output the prediction results, and restore the prediction results to the original data range.
[0142] In the modeling stage, the data is windowed and the grid investment demand forecast is performed once a month according to business needs, that is, each forecast predicts the grid investment for the next month in a single-step forecasting manner. The time window size used in the present invention is 4 months, that is, the power investment for the next month is predicted using the power investment for the past 4 months. The modeling adopts the mode of predicting future investment by historical investment, which is a typical time series prediction problem.
[0143] Since the amount of data is not large, the complexity of establishing the entire network structure of the present invention is relatively low. The network has three GRU layers, each with the same number of neurons. In the initial stage, the number of neurons of GRU is set to 8, which is dynamically adjusted during the parameter optimization process, and the initialization of other training parameters is consistent with Table 3.
[0144] The present invention uses an optimized PSO algorithm to optimize the GRU model parameters, and the optimization parameters include the learning rate and the number of neurons. The number of neurons in each layer is 4 to 16, and the learning rate is 0.001 to 0.01. Due to the long modeling time, repeated use of the same parameters for modeling will cause a waste of algorithm power consumption. The particle position memory is set as follows: when a particle is repeatedly positioned at a certain position, the historical value is directly used. The particle swarm optimization parameters are set as follows: the number of particles = 50, the maximum number of iterations = 500, and the inertia weight is 0.5279.
[0145] The final set of parameters is shown in Table 4. In this case, an early stopping strategy is used during training, and if the loss decreases slowly over several consecutive iterations, the training stops early. Under the optimal parameters obtained by the PSO particle swarm optimization algorithm, the loss no longer decreases at the 46th stage of model training, and the model stops training early. The final learning rate parameter is 0.018, and the final number of neurons in the three-layer GRU is 13, 8, and 6, respectively.
[0146] Figure 8 : is a weight distribution diagram of a power grid investment forecasting method according to an embodiment of an implementation mode of the present invention. The time attention weight distribution used in this embodiment is as follows: Figure 8 As shown in Figure 2, as the input step size increases, the attention weight shows a monotonically increasing trend. Since the time series is autocorrelated, the time point with a larger input step size is closer to the predicted time point, and the time point provides more information for the predicted time point, so the attention weight is larger.
[0147] Figure 9-11 This is a power grid investment prediction curve diagram of an embodiment of the present invention. The model of the present invention is used to predict power investment. The prediction curve is as follows: Figure 9-11 The forecast results show that the trends in these three years are consistent, the forecast error in January is very large, and the forecast results in other months are better.
[0148] The present invention uses the PSO particle swarm optimization algorithm to optimize the parameters of the GRU-Attention prediction model to obtain a trained PSO-GRU prediction model, thereby effectively solving the problem of difficulty in determining neural network parameters and avoiding the contingency of manual parameter adjustment and the deficiency of over-reliance on expert experience. Based on the trained PSO-GRU prediction model, the present invention predicts the power investment of the target power grid and obtains the power grid investment prediction value, thereby improving the accuracy and stability of the prediction.
[0149] Figure 2 FIG. 1 is a structural diagram of a power grid investment forecasting system according to an embodiment of the present invention. Figure 2 As shown, in this embodiment, a power grid investment forecasting system includes:
[0150] A preprocessing module is used to obtain historical power grid investment data, preprocess the historical power grid investment data, and generate training sets and test sets;
[0151] Model building module, used to build the initial GRU-Attention prediction model based on historical grid investment data and temporal attention mechanism;
[0152] Optimizing the parameters of the initial GRU-Attention prediction model based on the training set and the optimized PSO particle swarm optimization algorithm to obtain a trained PSO-GRU prediction model;
[0153] The prediction module is used to predict the power investment of the target power grid based on the trained PSO-GRU prediction model.
[0154] The present invention adopts the PSO particle swarm optimization algorithm to optimize the parameters of the GRU-Attention prediction model to obtain the trained PSO-GRU prediction model, which overcomes the problem that the parameters of the neural network are difficult to determine, and avoids the defects of certain randomness and over-reliance on expert experience in manual parameter adjustment; based on the trained PSO-GRU prediction model, the present invention predicts the power investment of the target power grid, obtains the power grid investment prediction value, and improves the prediction accuracy and stability.
[0155] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the system described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.
[0156] The above description is only a preferred embodiment of the present application and an explanation of the technical principles used. Those skilled in the art should understand that the scope of the invention involved in the present application is not limited to the technical solution formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the inventive concept. For example, the above features are replaced with (but not limited to) technical features with similar functions disclosed in the present application.
[0157] It should be understood that the size of the serial numbers of each step in the content of the invention and the embodiments of the present invention does not absolutely mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
Claims
1. A method for predicting power grid investment, characterized in that: The following steps are involved: Acquire historical power grid investment data, preprocess the historical power grid investment data, and generate a training set and a test set; Based on the historical grid investment data and the temporal attention mechanism, an initial GRU-Attention prediction model is constructed; Optimizing the parameters of the initial GRU-Attention prediction model based on the training set and the optimized PSO particle swarm optimization algorithm to obtain a trained PSO-GRU prediction model; Based on the trained PSO-GRU prediction model, power investment prediction is performed on the target power grid.
2. The power grid investment forecasting method according to claim 1, characterized in that: Preprocessing the historical power grid investment data includes: normalizing the historical power grid investment data.
3. The power grid investment forecasting method according to claim 1, characterized in that: The optimized PSO particle swarm optimization algorithm includes: adding an inertia weight w to the PSO particle swarm optimization algorithm; The update iteration formula of the optimized PSO particle swarm optimization algorithm includes: in, represents the velocity of particle i in dimension j in the n+1th iteration; represents the velocity of particle i in dimension j in the nth iteration; c1 represents the acceleration factor, which is used to adjust the convergence speed of the algorithm; r i,n j With R i,n j Represents a random number that satisfies a uniform distribution between 0 and 1, that is, r i,n j ,R i,n j ~U(0,1); represents the position of the best adaptive value in the jth dimension found for particle i in the nth iteration, that is, the personal best position; represents the position of particle i in dimension j in the nth iteration; represents the global best position in dimension j at the nth iteration.
4. The power grid investment forecasting method according to claim 3, characterized in that: The inertia weight w satisfies the following formula: Among them, w max and w min are the maximum and minimum values of the inertia weight w respectively; t is the current iteration number; t max is the maximum number of iterations.
5. The power grid investment forecasting method according to claim 1, characterized in that: The method also includes: verifying the trained PSO-GRU prediction model based on the test set.
6. The power grid investment forecasting method according to claim 1, characterized in that: The evaluation index for optimizing the parameters of the initial GRU-Attention prediction model based on the training set and the optimized PSO particle swarm optimization algorithm includes: root mean square error RMSE.
7. A power grid investment forecasting system, characterized in that: include: A preprocessing module, used to obtain historical power grid investment data, preprocess the historical power grid investment data, and generate a training set and a test set; A model building module, used to build an initial GRU-Attention prediction model based on the historical power grid investment data and the time attention mechanism; optimize the parameters of the initial GRU-Attention prediction model based on the training set and the optimized PSO particle swarm optimization algorithm to obtain a trained PSO-GRU prediction model; The prediction module is used to predict the power investment of the target power grid based on the trained PSO-GRU prediction model.
