Power load prediction method and system
By pre -processing and optimization of the original data of the power system, combine the strange spectrum analysis method and the fuzzy entropy aggregation method, the data is decomposed into high -frequency and low -frequency components, and the Tempo and TSMIXER models are used to solve the existing power load prediction model Insufficient accuracy and IAO algorithm are prone to falling into the optimal problem, achieving higher prediction accuracy.
Patent Information
- Application Number
- CN202411368085.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-29
- Publication Date
- 2025-01-28
AI Technical Summary
The existing power load prediction model cannot fully utilize the original data of the power system, the model parameter setting is not accurate enough, the prediction accuracy needs to be improved, and the information acquisition optimization algorithm is prone to fall into local optimization in the later stage of iteration.
By obtaining the original data of the power system for pre -processing, the optimization information acquisition optimization algorithm (IAO) uses random opposition learning strategies and spiral search strategies, combined with the strange spectrum analysis method (SSA) and the fuzzy entropy convergence method to decompose data into high frequency and low -frequency low -frequency and low frequency The weight is transformed into a two -dimensional image data and entered into the Tempo and TSMIXER models for training. The Bayes optimizes algorithm optimization of the TSMIXER model.
It significantly improves the accuracy of electricity load prediction, avoids the IAO algorithm fall into the optimal problem, enhances the data decomposition effect, and improves the accuracy of the model's prediction.
Smart Images

Figure CN119382075A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a load forecasting method and system, and in particular to a power load forecasting method and system, and belongs to the technical field of power load forecasting. Background Art
[0002] With the rapid development of the global economy and the acceleration of the industrialization process, electricity, as one of the indispensable energy sources in modern society, has an important impact on economic development and people's lives. As a typical nonlinear, time-varying, multi-input and output system, the accurate prediction of the load of the power system is crucial to the stable operation of the power grid, the rational allocation of energy and the economic benefits of the power market. Accurate power load forecasting can greatly improve the utilization rate of electric energy and reduce carbon emissions; it can greatly improve the economic benefits of the power industry. On the contrary, when the load forecasting error is large, it will not only cause a lot of operating costs and profit losses, but also affect the reliability of the power system operation and the balance of supply and demand in the power market.
[0003] At present, the methods of power load forecasting can be roughly divided into traditional forecasting methods and machine learning methods. Traditional forecasting methods are mainly based on statistical principles, and common methods include: time series method, regression analysis method, and gray model method. Although traditional forecasting methods are widely used to a certain extent, their forecasting ability is limited when processing data with strong randomness, and they cannot meet the higher load forecasting requirements. The forecasting methods based on machine learning are mainly represented by neural networks, decision tree theory, and support vector machine methods. Among them, neural networks have become one of the commonly used methods to solve load forecasting problems due to their strong nonlinear mapping ability and self-learning ability.
[0004] The current power load forecasting model cannot make full use of the original data of the power system, the model parameters are not set accurately, and the forecasting accuracy needs to be improved. The existing technology also optimizes the singular spectrum analysis (SSA) method through the information acquisition optimization algorithm (IAO) algorithm, but it does not take into account the disadvantage that the information acquisition optimization algorithm is prone to fall into the local optimum in the later iteration. Summary of the invention
[0005] Purpose of the invention: The purpose of the present invention is to provide a method and system for power load forecasting that can improve forecasting accuracy.
[0006] Technical solution: A method for predicting power load according to the present invention comprises:
[0007] Step 1: Obtain the raw data of the power system and pre-process the acquired raw data;
[0008] Step 2: Optimize the information acquisition optimization algorithm IAO, use the random adversarial learning strategy to replace the random initialization of the population position in the original IAO algorithm, and introduce the spiral search strategy to obtain the improved IAO algorithm;
[0009] Step 3: Decompose the data into multiple IMF components using optimized singular spectrum analysis (SSA); the SSA is optimized using an improved IAO algorithm.
[0010] Step 4: Use the fuzzy entropy FE aggregation method to separate the decomposed IMF components into high-frequency components and low-frequency components according to the entropy value;
[0011] Step 5: Use Gram angle difference field GADF to convert the high frequency component into a two-dimensional image;
[0012] Step 6: Input the two-dimensional image data and low-frequency components into the TEMPO model and TSMixer model for training respectively, and use the Bayesian optimization algorithm to optimize the hyperparameters of the TSMixer model to obtain the power load prediction model;
[0013] Step 7: Train the power load prediction model, use the trained power load prediction model to predict the power load, and obtain the power load prediction result.
[0014] Furthermore, the step 2 comprises:
[0015] Step 2.1: Set the objective function of the IAO algorithm to the decomposition effect of the signal decomposition and initialize relevant parameters, including: population size, number of iterations, dimension size and window length;
[0016] Step 2.2: Use the random adversarial learning strategy to replace the random initialization of the population position in the original IAO algorithm. The formula is expressed as:
[0017]
[0018] in, is the individual position of the current population, is the reverse solution generated by random adversarial learning, k′ is a random number between [0, 1], l is the lower limit, and up is the upper limit;
[0019] Step 2.3: Calculate the fitness value according to the objective function, and obtain the optimal solution based on the calculated fitness;
[0020] Step 2.4: The IAO algorithm is optimized in two stages, including the exploration stage and the development stage. The specific process is as follows:
[0021] Step 2.5: Continuously update the current solution through the IAO optimization process, and simultaneously update the global optimal solution;
[0022] Step 2.6: Determine whether the algorithm termination condition is reached through the given maximum number of iterations. If not, go to step 2.3 and output the optimal result within the specified number of iterations.
[0023] Further, the step 2.4 comprises:
[0024] Step 2.4.1: Filtering and evaluating information is considered as the exploration phase of the IAO algorithm, expressed as:
[0025]
[0026] in, is the individual position of the current population, is the reverse solution generated by random adversarial learning, rand is a random number generated in [0,1], represents the random individual position of the population, Δ is the error caused by subjective factors when filtering and evaluating information, which is expressed by the mathematical formula:
[0027]
[0028] Among them, Ψ is a subjective influencing factor that affects the final acquisition and application of information. The mathematical expression of Ψ is:
[0029] Ψ=2×mod(3.468×ν×(1-β)×(acos(γ×10 4 ))),1)
[0030] Among them, ν, β, γ and a are random numbers generated between [0,1], and mod() represents the modulus operation;
[0031] Γ is defined as the reliability factor, which describes the ability of the algorithm to self-adjust according to the quality of information at different iteration stages to optimize its behavior, and is expressed by the mathematical formula:
[0032]
[0033] Among them, Max_iter is the maximum number of iterations, iter is the current number of iterations, Φ is the information quality factor, and Φ is expressed by the formula:
[0034]
[0035] Among them, Ω is a random number generated between [0,1], and the quality factor Φ further affects the eigenvalue of individual i by affecting the reliability factor Γ during the iteration process.
[0036] Step 2.4.2: Introduce the spiral search strategy to perturb the search phase. The formula is:
[0037]
[0038]
[0039] in, is the best population position generated, D′ is the distance between the current individual position and the global optimal individual, b is a constant, e is a natural constant used to construct the shape of the logarithmic spiral, and l is a random number in [-1,1];
[0040] Construct a spiral search factor:
[0041]
[0042] The new search phase calculation formula is:
[0043]
[0044] Step 2.4.3: The development phase of the IAO algorithm is represented by the information analysis and organization process as follows:
[0045]
[0046] in, is the best population position generated, D represents the total number of best population positions generated, represents the average value of the best population position generated in the previous iteration, α, ζ, κ and ω are random numbers generated between [0,1], and Λ represents the control factor for analyzing and organizing information, which is defined as:
[0047]
[0048] Furthermore, the step 3 comprises:
[0049] Step 3.1: Input preprocessed data;
[0050] Step 3.2: Construct the trajectory matrix and select a suitable window length M. The construction form is as follows:
[0051] X s =[X1,X2,X3,…X N ]
[0052] X MK =[X1,X2,X3,ΛX K ]
[0053]
[0054] Where M is in the interval (1, N / 2), N is the length of the one-dimensional time series, K = N-M+1, X i is the original sequence, X MK is the trajectory matrix;
[0055] Step 3.3: According to the trajectory matrix X MK Construct the covariance matrix S MM , then for S MM Perform SVD decomposition to obtain S MM The eigenvalue E MM and the eigenvector U MM , E MM is a diagonal matrix:
[0056]
[0057] Where T represents transpose;
[0058] Find the trajectory matrix X MK The corresponding matrix V s value, where d is X MK Rank:
[0059]
[0060] Among them, E(·) is the unit matrix, U s is the feature vector;
[0061] The corresponding d elementary matrices are calculated, and the trajectory matrix can be composed of d elementary matrices X s Linear representation:
[0062]
[0063] Step 3.4: Group reconstruction, superimpose the subsequences with the same signal to obtain a special sequence of signals representing trends, cycles, half cycles and noise, and realize the decomposition of the original sequence. The formula is as follows:
[0064]
[0065] Furthermore, the step 4 comprises:
[0066] Step 4.1: Suppose there is a time series X = {x1, x2, …, x N′};
[0067] Step 4.2: Construct the time series X into an m-dimensional vector X m (1),K,X m (N′-m+1), where
[0068] X m(u) = {x(u), x(u+1), ..., x(u+m-1)}, 1≤u≤N′-m+1, the vector represents m consecutive values of x starting from the uth point, and N′ is the length of the one-dimensional time series;
[0069] Step 4.3: Define vector X m (u) and X m (v) The distance d[X m (u),X m (v)] is the absolute value of the maximum difference between the corresponding elements of the two, that is:
[0070] d[X m (u),X m (v)]=max k=0,…,m-1 (|x(u+k)-x(v+k)|)
[0071] Step 4.4: For a given X m (u), statistics X m (u) and X m The number of v (1≤v≤N′-m,v≠u) whose distance between (v) is less than or equal to r, and is recorded as B u For 1≤u≤N′-m, define:
[0072]
[0073] Definition B (m )(r) is:
[0074]
[0075] Step 4.5: Increase the dimension to m+1 and calculate X m+1 (u) and X m+1 The number of distances (v)(1≤v≤N′-m,v≠u) less than or equal to r, denoted as A u , Defined as:
[0076]
[0077] Definition A m (r) is:
[0078]
[0079] Step 4.6: B (m) (r) is the probability that two sequences match m points under similarity tolerance r, A m (r) is the probability of two sequences matching m+1 points, and the sample entropy is defined as:
[0080]
[0081] When N' is a finite value, it can be estimated using the following formula:
[0082]
[0083] Furthermore, the step 5 comprises:
[0084] Step 5.1: Convert high frequency time series components Normalize and scale it to the range [-1,1]. The formula for this process is:
[0085]
[0086] Among them, X t is the scaled high-frequency time series component, min(·) and max(·) are the minimum and maximum values of the component, respectively;
[0087] Step 5.2: Convert the time series into polar coordinates, regard the normalized time series X as the angle cosine, and the time step as the radius. This process is expressed by the mathematical formula:
[0088]
[0089] Among them, t z represents the time step, Z is the constant factor of the regularized polar coordinate generation space, θ z is the phase angle, r′ is the polar coordinate radius; A is the standardized scaled
[0090] Step 5.3: Considering the different time correlations in different time intervals, two different Gram angle fields are generated, namely, the Gram angle sum field and the Gram angle difference field. The present invention mainly uses the Gram angle difference field. This process is expressed by the mathematical formula:
[0091]
[0092] Furthermore, the step 6 comprises:
[0093] Step 6.1: Input the 2D image data into the TEMPO model;
[0094] Step 6.2: Given the observed values of the previous G timestamps, the task of multivariate time series prediction is to predict the value of the next H timestamps. The formula is:
[0095]
[0096] in, is the estimated vector of the Hth step of the timestamp t of the channel corresponding to the pth feature; historical value The model F, the parameter φ and the prompt V p to infer;
[0097] Step 6.3: Given an input X∈R n′×L , where R is a real number set, n′ is the feature channel size, and L is the length of the time series, it can be expressed as:
[0098]
[0099] Where p is the channel index of the multivariate time series input, and trend captures the underlying long-term patterns in the data, where m′=2k′+1 and k′ is the average step size; the seasonal component X S ∈R n′×L Includes repeated short-term cycles, estimated after removing the trend component; the residual component X R ∈R n′×L represents the remaining part of the data after extracting trend and seasonality;
[0100] Step 6.4: Convert the trend-specific cues into word embedding space and then perform a linear transformation to obtain a learnable trend cue vector V t ; The combination of this prompt and the time series representation is embedded as:
[0101] x T =[V t ;P T ]
[0102] Among them, x T represents the set of embeddings along the time axis; the embedding process reflects the seasonal and residual components, producing X S and X R ;
[0103] Step 6.5: Use the decoder-based GPT as the backbone to build the basis of the time series representation, concatenate the prompts and different components together, and put them into a GPT block, where the input of the time series embedding is expressed as:
[0104]
[0105] in, Corresponds to the connection operation;
[0106] Step 6.6: Use the fully connected layer to get the final output and obtain the power load result predicted by the two-dimensional image;
[0107] Step 6.7: Input the low-frequency component in step 4 into the TSMixer model;
[0108] Step 6.8: Given the input matrix Temporal projection TP is a linear layer that operates on the columns of X and is shared across all columns to project the time series from the input length to the prediction length. The operation is defined as:
[0109]
[0110] Among them, X *,p is the column of X, and are the weights and biases of the linear layer, respectively. Represents the mapping relationship between input dimension and output dimension;
[0111] Step 6.9: Put the three parameters of trend, seasonality and residual into the Bayesian algorithm for optimization and then proceed to the subsequent steps;
[0112] Step 6.10: The time mixture TM is applied to all columns of X and performs time feature transformation. The operation is defined as:
[0113]
[0114] Where σ(·) is the activation function, Drop(·) is dropout, and Norm(·) is layer normalization or batch normalization;
[0115] Step 6.11: The feature mixture FM is a two-layer residual MLP that acts on the input matrix The rows of , and are shared among all rows, and applied to each row of the input matrix X q,* , the operation is defined as:
[0116] U′ q,* =Drop(σ(W2X q,* +b2))
[0117] FM C→C (X) q,* =Norm(X q,* +Drop(W3U′ q,* +b3))
[0118]
[0119] Among them, W2,W3∈R C×C and b2,b3∈R C
[0120] When features need to be projected to H of different sizes (H = C), TSMixer performs a linear transformation on the residual term:
[0121] FM C→H (X) q,* =Norm(WH X q,* +b H +Drop(W3U′ q,* +b3))
[0122]
[0123] Among them, W3,W H ∈R H×C and b2,b3∈R C
[0124] Step 6.12: Conditional Feature Blending Conditional Feature Blending (CFM) is a variation of the FM block that takes into account the associated static features. Convert static features to hidden features. The operation is defined as:
[0125]
[0126] in Expand the input along the time dimension and repeat the input L times. It is the concatenation of X and V′ along the characteristic dimension;
[0127] Step 6.13: The mixer layer Mix is a combination of the temporal mixing layer and the feature mixing layer, and the conditional mixing layer CMix is a combination of the temporal mixing layer and the conditional feature mixing layer. The Mix and CMix blocks apply temporal and feature transformations respectively:
[0128]
[0129] Step 6.14: Use the fully connected layer to get the final output and obtain the power load result predicted by the low-frequency component;
[0130] Step 6.15: Sum the prediction results of each component to obtain the final power load prediction result.
[0131] Furthermore, in step 6, the hyperparameters of the TSMixer model are optimized using the Bayesian optimization algorithm, including:
[0132] Initialize multiple models randomly and train them with a checkpoint set every few steps;
[0133] Adjust the parameters of your own model. If the fitting effect of your own model is better than random search, continue training. Otherwise, adjust the model parameters for mining and add random exploration to retrain.
[0134] After training for a preset time, the optimal model hyperparameters are obtained.
[0135] Furthermore, the method also includes step 8: displaying the power load forecast result obtained in step 7 through an interface.
[0136] Based on the same inventive concept, the present invention also provides a power load forecasting system, comprising:
[0137] A preprocessing module is used to obtain raw data of the power system and preprocess the obtained raw data;
[0138] The optimization module is used to optimize the information acquisition optimization algorithm IAO pair, using the random adversarial learning strategy to replace the random initialization of the population position in the original IAO algorithm, and introducing the spiral search strategy to obtain an improved IAO algorithm;
[0139] The decomposition module is used to decompose the data into multiple IMF components by using an optimized singular spectrum analysis method SSA; the SSA is optimized by an improved IAO algorithm,
[0140] A separation module is used to separate the decomposed IMF components into high-frequency components and low-frequency components according to the entropy values by using the fuzzy entropy FE aggregation method;
[0141] A conversion module, used for converting the high frequency component into a two-dimensional image by using a Gram angle difference field GADF;
[0142] The model building module is used to input the two-dimensional image data and the low-frequency component into the TEMPO model and the TSMixer model for training respectively, and optimize the hyperparameters of the TSMixer model using the Bayesian optimization algorithm to obtain the power load prediction model;
[0143] The prediction module is used to train the power load prediction model, use the trained power load prediction model to predict the power load, and obtain the power load prediction result;
[0144] The display module is used to display the power load forecast results through the interface.
[0145] Beneficial effects: Compared with the prior art, the present invention enhances the data decomposition effect by optimizing the singular spectrum analysis method SSA with the improved information acquisition optimization algorithm IAO. By introducing the information acquisition optimization algorithm IAO to tune the parameters in the singular spectrum analysis method, the inherent patterns in the data can be separated more accurately, thereby significantly improving the accuracy of power load prediction. The present invention uses the improved IAO algorithm for parameter optimization, and proposes an improved strategy to avoid the problem of the IAO algorithm falling into the local optimum. The random initialization of the population position in the original IAO algorithm is replaced by the random adversarial learning strategy. In the optimization process, the spiral search strategy is introduced to enhance the disturbance of the update of the optimal solution position, increase the diversity of the population, and help to jump out of the local optimum. The present invention respectively establishes TEMPO and TSMixer models to predict the two-dimensional image data and low-frequency subsequence of power load, and uses Bayesian optimization to optimize the TSMixer model. Finally, the predicted components are summed to obtain the final power load prediction result. The TEMPO model introduces an interpretable prompt-based generative transformer TEMPO for time series representation learning, and shows stable prediction performance on multimodal datasets. The TSMixer model is a new architecture designed by stacking multi-layer perceptrons, which can effectively extract information through mixed operations along time and feature dimensions. The establishment of TEMPO and TSMixer models significantly improves the accuracy of power load prediction. BRIEF DESCRIPTION OF THE DRAWINGS
[0146] Figure 1 is a flow chart of a method according to an embodiment of the present invention;
[0147] Figure 2 The flowchart of the improved IAO algorithm of the embodiment of the present invention is shown in FIG.
[0148] Figure 3 The figure is an algorithm flow chart of the Bayesian optimization algorithm PBT according to an embodiment of the present invention. DETAILED DESCRIPTION
[0149] In order to enable those skilled in the art to better understand the present application, the present invention will be further described in detail below in conjunction with the following drawings. The process, conditions and implementation methods of the present invention, except for the contents specifically mentioned below, are all common knowledge in the art and are not particularly limited by the present invention.
[0150] As attached Figure 1 As shown, the power load forecasting method of this embodiment includes:
[0151] (1) Obtaining raw data of the power system and preprocessing the acquired raw data;
[0152] (2) The information acquisition optimization algorithm IAO is optimized, and the random adversarial learning strategy is used to replace the random initialization of the population position in the original IAO algorithm, and the spiral search strategy is introduced to obtain the improved IAO algorithm;
[0153] (3) Decomposing the data into multiple IMF components by using optimized singular spectrum analysis (SSA); the SSA is optimized by an improved IAO algorithm.
[0154] (4) The fuzzy entropy FE aggregation method is used to separate the decomposed IMF components into high-frequency components and low-frequency components according to the entropy values;
[0155] (5) Using Gram angle difference field (GADF) to convert high frequency components into a two-dimensional image;
[0156] (6) The two-dimensional image data and low-frequency components are respectively input into the TEMPO model and the TSMixer model for training, and the hyperparameters of the TSMixer model are optimized using the Bayesian optimization algorithm to obtain the power load prediction model;
[0157] (7) The power load prediction model is trained, and the power load is predicted using the trained power load prediction model to obtain a power load prediction result.
[0158] Specifically, in step (2), the information acquisition optimization algorithm (IAO) includes adopting a random adversarial learning strategy to replace the random initialization of the population position in the original IAO algorithm, introducing a spiral search strategy to enhance the disturbance of the optimal solution position update, increase the diversity of the population, and help to jump out of the local optimum, and use the improved information acquisition optimization algorithm to optimize the singular spectrum analysis method window length M hyperparameter to obtain the optimal model hyperparameter, which specifically includes the following steps:
[0159] (21) Setting the objective function of the IAO algorithm as the decomposition effect of the signal decomposition and initializing relevant parameters, including: population size, number of iterations, dimension size, and window length M;
[0160] (22) Figure 2 As shown in the figure, the random adversarial learning strategy is used to replace the random initialization of the population position in the original IAO algorithm. This process is expressed by the mathematical formula:
[0161]
[0162] in, is the individual position of the current population, is the reverse solution generated by random adversarial learning, k′ is a random number between [0, 1], l is the lower limit, and up is the upper limit;
[0163] (23) Calculating the fitness value according to the objective function, and obtaining the optimal solution according to the calculated fitness;
[0164] (24) The IAO algorithm is divided into two stages in the optimization process: the first stage is the exploration stage and the second stage is the development stage. The specific process is as follows:
[0165] (241) In the contemporary context of information overload, the filtering and evaluation process of information has become an important mechanism for individuals to quickly identify relevant and useful information. It not only effectively eliminates inaccurate and misleading information, but also significantly improves the overall quality of information acquisition. This process is the exploration stage of the IAO algorithm, which is expressed by the mathematical formula:
[0166]
[0167] in, is the individual position of the current population, is the reverse solution generated by random adversarial learning, rand is a random number generated in [0,1], and Δ is the error caused by subjective factors when filtering and evaluating information, which is expressed by the mathematical formula:
[0168]
[0169] Among them, Ψ is a subjective influencing factor that affects the final acquisition and application of information. The mathematical expression of Ψ is:
[0170] Ψ=2×mod(3.468×ν×(1-β)×(acos(γ×10 4 ))),1)
[0171] Among them, ν, β, γ are random numbers generated between [0,1];
[0172] Γ is defined as the reliability factor, which describes the ability of the algorithm to self-adjust according to the quality of information at different iteration stages to optimize its behavior, and is expressed by the mathematical formula:
[0173]
[0174] Among them, Max_iter is the maximum number of iterations, Φ is the information quality factor, and the information quality factor Φ ensures that information quality is an important factor affecting Γ, avoiding the algorithm over-optimizing the iteration dynamics and ignoring the basic requirements of information quality. Φ is expressed by the mathematical formula:
[0175]
[0176] Among them, Ω is a random number generated between [0,1], and the quality factor Φ further affects the eigenvalue of individual i by affecting the reliability factor Γ during the iteration process.
[0177] (242) A spiral search strategy is introduced to perturb the search phase, which increases the diversity of the population and helps to escape from the local optimum. This process is expressed by the mathematical formula:
[0178]
[0179]
[0180] Where D′ is the distance between the current individual position and the global optimal individual, b is a constant used to construct the shape of the logarithmic spiral, and l is a random number in [-1,1];
[0181] Construct the spiral search factor, which is expressed by the mathematical formula:
[0182]
[0183] The new search phase calculation formula is:
[0184]
[0185] (243) The purpose of information analysis and organization is to identify the existing useful information from the filtered information and convert the convertible information identified in the previous stage into useful information, thereby increasing the probability of obtaining the optimal information body. This process is the development stage of the IAO algorithm, which is expressed by the mathematical formula:
[0186]
[0187] in, is the best population position generated, D represents the total number of best population positions generated, represents the average value of the best population position generated in the previous iteration, α, ζ, κ and ω are random numbers generated between [0,1], and Λ represents the control factor for analyzing and organizing information, defined as:
[0188]
[0189] (25) The current solution is continuously updated through the IAO optimization process, and the global optimal solution is updated synchronously;
[0190] (26) Determine whether the algorithm termination condition is reached by the given maximum number of iterations. If not, go to step (23) and output the optimal result within the specified number of iterations.
[0191] In step (3), the optimized singular spectrum analysis (SSA) is used to decompose the data into multiple IMF components. The SSA optimizes the parameters by an improved information acquisition optimization algorithm (IAO), which can more accurately separate the inherent patterns in the data, thereby significantly improving the accuracy of power load forecasting.
[0192] (31) Input preprocessed data;
[0193] (32) Construct the trajectory matrix and select a suitable window length M. The construction form is as follows:
[0194] X s =[X1,X2,X3,…X N ]
[0195] X MK =[X1,X2,X3,ΛX K ]
[0196]
[0197] Where M is in the interval (1, N / 2), N is the length of the one-dimensional time series, K = N-M+1, X i is the original sequence, X MK is the trajectory matrix;
[0198] (33) First, according to the trajectory matrix X MK Construct the covariance matrix S MM , then for S MM Perform SVD decomposition to obtain S MM The eigenvalue E MM and the eigenvector U MM , E MM is a diagonal matrix:
[0199]
[0200] Find the trajectory matrix X MK The corresponding V i value, where d is X MK Rank:
[0201]
[0202] Among them, E(·) is the unit matrix, U s is the feature vector;
[0203] The corresponding d elementary matrices are calculated, and the trajectory matrix can be composed of d elementary matrices X s Linear representation:
[0204]
[0205] (34) Group reconstruction: Subsequences with the same signal are superimposed to obtain special sequences representing trends, cycles, half cycles, noise and other signals, thereby realizing the decomposition of the original sequence. The reconstruction principle formula is as follows:
[0206]
[0207] In step (4), the fuzzy entropy (FE) aggregation method is used to reduce the computational complexity, and the multiple modal components in step (3) are separated into high-frequency and low-frequency components according to the entropy values;
[0208] (41) Suppose there is a time series X = {x1, x2, …, x N′};
[0209] (42) Construct the time series X into an m-dimensional vector X m (1),K,X m (N′-m+1), where
[0210] X m (u) = {x(u), x(u+1), ..., x(u+m-1)}, 1≤u≤N′-m+1, these vectors represent the m consecutive values of x starting from the uth point;
[0211] (43) Define vector X m (u) and X m (v) The distance d[X m (u),X m (v)] is the absolute value of the maximum difference between the corresponding elements of the two, that is:
[0212] d[X m (u),X m (v)]=max k=0,…,m-1 (|x(u+k)-x(v+k)|)
[0213] (44) For a given X m (u), statistics X m (u) and X m The number of v (1≤v≤N′-m,v≠u) whose distance between (v) is less than or equal to r, and is recorded as B u For 1≤u≤N′-m, define:
[0214]
[0215] Definition B (m) (r) is:
[0216]
[0217] Step (45): Increase the dimension to m+1 and calculate X m+1 (u) and X m+1 The number of distances (v)(1≤v≤N′-m,v≠u) less than or equal to r, denoted as A u , Defined as:
[0218]
[0219] Definition A m (r) is:
[0220]
[0221] (46)B (m) (r) is the probability that two sequences match m points under similarity tolerance r, and A m (r) is the probability of two sequences matching m+1 points, and the sample entropy is defined as:
[0222]
[0223] When N' is a finite value, it can be estimated using the following formula:
[0224]
[0225] In step (5), the high frequency component in step (4) is converted into a two-dimensional image using a Gram angle difference field (GADF);
[0226] (51) The high-frequency time series components Normalization, scaling it to the range [-1,1], this process is expressed by the mathematical formula:
[0227]
[0228] Among them, X t is the scaled high-frequency time series component, min(·) and max(·) are the minimum and maximum values of the component, respectively;
[0229] (52) The time series is converted into polar coordinates, the normalized time series X is regarded as the angular cosine, and the time step is regarded as the radius. This process is expressed by the mathematical formula:
[0230]
[0231] Among them, t z represents the time step, Z is the constant factor of the regularized polar coordinate generation space, θ z is the phase angle, r′ is the polar coordinate radius; A is the standardized scaled
[0232] (53) Considering the different time correlations in different time intervals, two different Gram angle fields are generated, namely, the Gram angle sum field and the Gram angle difference field. The present invention mainly uses the Gram angle difference field. This process is expressed by the mathematical formula:
[0233]
[0234] In step (6), the two-dimensional image data in step 5 and the low-frequency component in step 4 are respectively input into the TEMPO and TSMixer models for training, and the hyperparameters of the TSMixer model are optimized using the Bayesian optimization algorithm to obtain a power load prediction model;
[0235] (61) inputting the two-dimensional image data in step (5) into the TEMPO model;
[0236] (62) Given the observed values of the previous K timestamps, the task of multivariate time series prediction is to predict the value of the next H timestamps. The formula is:
[0237]
[0238] in, is the estimated vector of the Hth step of the timestamp t of the channel corresponding to the pth feature; historical value The model F, the parameter φ and the prompt V p to infer;
[0239] (63) Given an input X∈R n′×L , where n′ is the feature channel size and L is the length of the time series, it can be expressed as:
[0240]
[0241] Where p is the channel index of the multivariate time series input, and trend captures the underlying long-term patterns in the data, where m′=2k′+1 and k′ is the average step size; the seasonal component X S ∈R n′×L Includes repeated short-term cycles, estimated after removing the trend component; the residual component X R ∈R n′×L represents the remaining part of the data after extracting trend and seasonality;
[0242] (64) First, the trend-specific cues are converted into word embedding space and then linearly transformed to obtain a learnable trend cue vector V t ; The combination of this prompt and the time series representation is embedded as:
[0243] x T =[V t ;PT ]
[0244] Among them, x T represents the set of embeddings along the time axis; this concatenation process reflects the seasonal and residual components, producing X S and X R ;
[0245] (65) Use the decoder-based GPT as the backbone to build the foundation of time series representation, concatenate the prompts and different components together, and put them into a GPT block; specifically, the input of the time series embedding in this architecture is formulated as:
[0246]
[0247] in, Corresponding to the connection operation, x * Indicates different parameters;
[0248] (66) Use the fully connected layer to obtain the final output and obtain the power load result predicted by the two-dimensional image;
[0249] (67) Input the low-frequency component in step 4 into the TSMixer model;
[0250] (68) Given the input matrix Time projection (TP) is a column of X (denoted by X *,i ) and shared among all columns to project the time series from the input length to the prediction length, the operation is defined as:
[0251]
[0252] in, and are the weights and biases of the linear layer, respectively. Represents the mapping relationship between input dimension and output dimension;
[0253] (69) The three major parameters of trend, seasonality and residual are put into the Bayesian algorithm for optimization and then the subsequent steps are carried out;
[0254] (610) Time Mixing (TM) acts on all columns of X and performs time feature transformation. The operation is defined as:
[0255]
[0256] Where σ(·) is the activation function, Drop(·) is dropout, and Norm(·) is layer normalization or batch normalization;
[0257] (611) Feature Mixture (FM) is a two-layer residual MLP that operates on the input matrix The rows of , and are shared among all rows, and applied to each row of the input matrix X q,* , the operation is defined as:
[0258] U′ q,* =Drop(σ(W2X q,* +b2))
[0259] FM C→C (X) q,* =Norm(X q,* +Drop(W3U′ q,* +b3))
[0260]
[0261] Among them, W2,W3∈R C×C and b2,b3∈R C
[0262] When features need to be projected to H of different sizes (H = C), TSMixer performs a linear transformation on the residual term:
[0263] FM C→H (X) q,* =Norm(W H X q,* +b H +Drop(W3U′ q,* +b3))
[0264]
[0265] Among them, W3,W H ∈R H×C and b2,b3∈R C
[0266] (612) Conditional Feature Mixing Conditional Feature Mixing (CFM) is a variant of the FM block, except that the input sequence In addition, the static characteristics of the association are also considered Convert static features to hidden features. The operation is defined as:
[0267]
[0268] in Expand the input along the time dimension and repeat the input Second-rate, It is the concatenation of X and V′ along the characteristic dimension;
[0269] (613) The mixer layer (Mix) is a combination of a temporal mixing layer and a feature mixing layer, while the conditional mixing layer (CMix) is a combination of a temporal mixing layer and a conditional feature mixing layer. The Mix and CMix blocks apply temporal and feature transformations respectively:
[0270] Mix C→H (X) = FR C→H (TR L→L (X)
[0271] CMix C→H (X,S′)=CFR C→H (TR L→L (X),S′)
[0272] (614) using a fully connected layer to obtain a final output, and obtaining a power load result predicted by a low-frequency component;
[0273] (615) summing the prediction results of each component to obtain a final power load prediction result;
[0274] By using the Bayesian optimization algorithm to optimize the TSMixer model:
[0275] (616) Figure 3 As shown, multiple models are randomly initialized and trained with a checkpoint set every few steps;
[0276] (617) Adjust the parameters of the own model according to the advantages and disadvantages of other models. If the fit of the own model is good, continue training. Otherwise, use better model parameters for mining and add random exploration to retrain;
[0277] (618) After a period of training, the optimal model hyperparameters are obtained.
[0278] In step (7), the power load prediction model trained and optimized in step (6) is used to predict the power load to obtain the final power load prediction result.
[0279] The method also includes step (8), in which the power load forecasting result obtained in step (7) is displayed on a front-end interface to facilitate processing by supervisory personnel.
[0280] Based on the same inventive concept, this embodiment also provides a power load forecasting system, including:
[0281] A preprocessing module is used to obtain raw data of the power system and preprocess the obtained raw data;
[0282] The optimization module is used to optimize the information acquisition optimization algorithm IAO pair, using the random adversarial learning strategy to replace the random initialization of the population position in the original IAO algorithm, and introducing the spiral search strategy to obtain an improved IAO algorithm;
[0283] The decomposition module is used to decompose the data into multiple IMF components by using an optimized singular spectrum analysis method SSA; the SSA is optimized by an improved IAO algorithm,
[0284] A separation module is used to separate the decomposed IMF components into high-frequency components and low-frequency components according to the entropy values by using the fuzzy entropy FE aggregation method;
[0285] A conversion module, used for converting the high frequency component into a two-dimensional image by using a Gram angle difference field GADF;
[0286] The model building module is used to input the two-dimensional image data and the low-frequency component into the TEMPO model and the TSMixer model for training respectively, and optimize the hyperparameters of the TSMixer model using the Bayesian optimization algorithm to obtain the power load prediction model;
[0287] The prediction module is used to train the power load prediction model, use the trained power load prediction model to predict the power load, and obtain the power load prediction result;
[0288] The display module is used to display the power load forecast results through the interface.
[0289] The above-mentioned specific implementation cases are used to illustrate the present invention and are only preferred embodiments of the present invention, rather than limiting the present invention. Any modifications, equivalent substitutions, improvements, etc. made to the present invention within the spirit of the present invention and the protection scope of the claims shall fall within the protection scope of the present invention.
Claims
1. A method for predicting power load, characterized in that: include: Step 1: Obtain the raw data of the power system and pre-process the acquired raw data; Step 2: Optimize the information acquisition optimization algorithm IAO, use the random adversarial learning strategy to replace the random initialization of the population position in the original IAO algorithm, and introduce the spiral search strategy to obtain the improved IAO algorithm; Step 3: Decompose the data into multiple IMF components using optimized singular spectrum analysis (SSA); the SSA is optimized using an improved IAO algorithm. Step 4: Use the fuzzy entropy FE aggregation method to separate the decomposed IMF components into high-frequency components and low-frequency components according to the entropy value; Step 5: Use Gram angle difference field GADF to convert the high frequency component into a two-dimensional image; Step 6: Input the two-dimensional image data and low-frequency components into the TEMPO model and TSMixer model for training respectively, and use the Bayesian optimization algorithm to optimize the hyperparameters of the TSMixer model to obtain the power load prediction model; Step 7: Train the power load prediction model, use the trained power load prediction model to predict the power load, and obtain the power load prediction result.
2. The power load forecasting method according to claim 1, characterized in that: The step 2 comprises: Step 2.1: Set the objective function of the IAO algorithm to the decomposition effect of the signal decomposition and initialize relevant parameters, including: population size, number of iterations, dimension size and window length; Step 2.2: Use the random adversarial learning strategy to replace the random initialization of the population position in the original IAO algorithm. The formula is expressed as: in, is the individual position of the current population, is the reverse solution generated by random adversarial learning, k′ is a random number between [0, 1], l is the lower limit, and up is the upper limit; Step 2.3: Calculate the fitness value according to the objective function, and obtain the optimal solution based on the calculated fitness; Step 2.4: The IAO algorithm is optimized in two stages, including the exploration stage and the development stage. The specific process is as follows: Step 2.5: Continuously update the current solution through the IAO optimization process, and simultaneously update the global optimal solution; Step 2.6: Determine whether the algorithm termination condition is reached through the given maximum number of iterations. If not, go to step 2.3 and output the optimal result within the specified number of iterations.
3. The power load forecasting method according to claim 2, characterized in that: The step 2.4 comprises: Step 2.4.1: Filtering and evaluating information is considered as the exploration phase of the IAO algorithm, expressed as: in, is the individual position of the current population, is the reverse solution generated by random adversarial learning, rand is a random number generated in [0,1], represents the random individual position of the population, Δ is the error caused by subjective factors when filtering and evaluating information, which is expressed by the mathematical formula: Among them, Ψ is a subjective influencing factor that affects the final acquisition and application of information. The mathematical expression of Ψ is: Ψ=2×mod(3.468×ν×(1-β)×(acos(γ×10 4 ))),1) Among them, ν, β, γ and a are random numbers generated between [0,1], and mod() represents the modulus operation; Γ is defined as the reliability factor, which describes the ability of the algorithm to self-adjust according to the quality of information at different iteration stages to optimize its behavior, and is expressed by the mathematical formula: Among them, Max_iter is the maximum number of iterations, iter is the current number of iterations, Φ is the information quality factor, and Φ is expressed by the formula: Among them, Ω is a random number generated between [0,1], and the quality factor Φ further affects the eigenvalue of individual i by affecting the reliability factor Γ during the iteration process. Step 2.4.2: Introduce the spiral search strategy to perturb the search phase. The formula is: in, is the best population position generated, D′ is the distance between the current individual position and the global optimal individual, b is a constant, e is a natural constant used to construct the shape of the logarithmic spiral, and l is a random number in [-1,1]; Construct a spiral search factor: The new search phase calculation formula is: Step 2.4.3: The development phase of the IAO algorithm is represented by the information analysis and organization process as follows: in, is the best population position generated, D represents the total number of best population positions generated, represents the average value of the best population position generated in the previous iteration, α, ζ, κ and ω are random numbers generated between [0,1], and Λ represents the control factor for analyzing and organizing information, which is defined as:
4. The power load forecasting method according to claim 1, characterized in that: The step 3 comprises: Step 3.1: Input preprocessed data; Step 3.2: Construct the trajectory matrix and select a suitable window length M. The construction form is as follows: X s =[X1,X2,X3,…X N ] X MK =[X1,X2,X3,ΛX K ] Where M is in the interval (1, N / 2), N is the length of the one-dimensional time series, K = N-M+1, X i is the original sequence, X MK is the trajectory matrix; Step 3.3: According to the trajectory matrix X MK Construct the covariance matrix S MM , then for S MM Perform SVD decomposition to obtain S MM The eigenvalue E MM and the eigenvector U MM , E MM is a diagonal matrix: Where T represents transpose; Find the trajectory matrix X MK The corresponding matrix V s value, where d is X MK Rank: Among them, E(·) is the unit matrix, U s is the feature vector; The corresponding d elementary matrices are calculated, and the trajectory matrix can be composed of d elementary matrices X s Linear representation: Step 3.4: Group reconstruction, superimpose the subsequences with the same signal to obtain a special sequence of signals representing trends, cycles, half cycles and noise, and realize the decomposition of the original sequence. The formula is as follows:
5. The power load forecasting method according to claim 1, characterized in that: The step 4 comprises: Step 4.1: Suppose there is a time series X = {x1, x2, …, x N′ }; Step 4.2: Construct the time series X into an m-dimensional vector X m (1),K,X m (N′-m+1), where X m (u) = {x(u), x(u+1), ..., x(u+m-1)}, 1≤u≤N′-m+1, the vector represents m consecutive values of x starting from the uth point, and N′ is the length of the one-dimensional time series; Step 4.3: Define vector X m (u) and X m (v) The distance d[X m (u),X m (v)] is the absolute value of the maximum difference between the corresponding elements of the two, that is: d[X m (u),X m (v)]=max k=0,…,m-1 (|x(u+k)-x(v+k)|) Step 4.4: For a given X m (u), statistics X m (u) and X m The number of v (1≤v≤N′-m,v≠u) whose distance between (v) is less than or equal to r, and is recorded as B u For 1≤u≤N′-m, define: Definition B (m) (r) is: Step 4.5: Increase the dimension to m+1 and calculate X m+1 (u) and X m+1 The number of distances (v)(1≤v≤N′-m,v≠u) less than or equal to r, denoted as A u , Defined as: Definition A m (r) is: Step 4.6: B (m) (r) is the probability that two sequences match m points under similarity tolerance r, A m (r) is the probability of two sequences matching m+1 points, and the sample entropy is defined as: When N' is a finite value, it can be estimated using the following formula:
6. The power load forecasting method according to claim 1, characterized in that: The step 5 comprises: Step 5.1: Convert high frequency time series components Normalize and scale it to the range [-1,1]. The formula for this process is: Among them, X t is the scaled high-frequency time series component, min(·) and max(·) are the minimum and maximum values of the component, respectively; Step 5.2: Convert the time series into polar coordinates, regard the normalized time series X as the angle cosine, and the time step as the radius. This process is expressed by the mathematical formula: Among them, t z represents the time step, Z is the constant factor of the regularized polar coordinate generation space, θ z is the phase angle, r′ is the polar coordinate radius; A is the standardized scaled Step 5.3: Considering the different time correlations in different time intervals, two different Gram angle fields are generated, namely, the Gram angle sum field and the Gram angle difference field. The present invention mainly uses the Gram angle difference field. This process is expressed by the mathematical formula:
7. The power load forecasting method according to claim 1, characterized in that: The step 6 comprises: Step 6.1: Input the 2D image data into the TEMPO model; Step 6.2: Given the observed values of the previous G timestamps, the task of multivariate time series prediction is to predict the value of the next H timestamps. The formula is: in, is the estimated vector of the Hth step of the timestamp t of the channel corresponding to the pth feature; historical value The model F, the parameter φ and the prompt V p to infer; Step 6.3: Given an input X∈R n′×L , where R is a real number set, n′ is the feature channel size, and L is the length of the time series, it can be expressed as: Where p is the channel index of the multivariate time series input, and trend captures the underlying long-term patterns in the data, where m′=2k′+1 and k′ is the average step size; the seasonal component X S ∈R n′×L Includes repeated short-term cycles, estimated after removing the trend component; the residual component X R ∈R n′×L represents the remaining part of the data after extracting trend and seasonality; Step 6.4: Convert the trend-specific cues into word embedding space and then perform a linear transformation to obtain a learnable trend cue vector V t ; The combination of this prompt and the time series representation is embedded as: x T =[V t ;P T ] Among them, x T represents the set of embeddings along the time axis; the embedding process reflects the seasonal and residual components, producing X S and X R ; Step 6.5: Use the decoder-based GPT as the backbone to build the basis of the time series representation, concatenate the prompts and different components together, and put them into a GPT block, where the input of the time series embedding is expressed as: in, Corresponds to the connection operation; Step 6.6: Use the fully connected layer to get the final output and obtain the power load result predicted by the two-dimensional image; Step 6.7: Input the low-frequency component in step 4 into the TSMixer model; Step 6.8: Given the input matrix Temporal projection TP is a linear layer that operates on the columns of X and is shared across all columns to project the time series from the input length to the prediction length. The operation is defined as: Among them, X *,p is the column of X, and are the weights and biases of the linear layer, respectively. Represents the mapping relationship between input dimension and output dimension; Step 6.9: Put the three parameters of trend, seasonality and residual into the Bayesian algorithm for optimization and then proceed to the subsequent steps; Step 6.10: The time mixture TM is applied to all columns of X and performs time feature transformation. The operation is defined as: Where σ(·) is the activation function, Drop(·) is dropout, and Norm(·) is layer normalization or batch normalization; Step 6.11: The feature mixture FM is a two-layer residual MLP that acts on the input matrix The rows of , and are shared among all rows, and applied to each row of the input matrix X q,* , the operation is defined as: U q ′ ,* =Drop(σ(W2X q,* +b2)) FM C→C (X) q,* =Norm(X q,* +Drop(W3U q ′ ,* +b3)) Among them, W2,W3∈R C×C and b2,b3∈R C When features need to be projected to H of different sizes (H = C), TSMixer performs a linear transformation on the residual term: FM C→H (X) q,* =Norm(W H X q,* +b H +Drop(W3U q ′ ,* +b3)) Among them, W3,W H ∈R H×C and b2,b3∈R C Step 6.12: Conditional Feature Blending Conditional Feature Blending (CFM) is a variation of the FM block that takes into account the associated static features. Convert static features to hidden features. The operation is defined as: in Expand the input along the time dimension and repeat the input Second-rate, It is the concatenation of X and V′ along the characteristic dimension; Step 6.13: The mixer layer Mix is a combination of the temporal mixing layer and the feature mixing layer, and the conditional mixing layer CMix is a combination of the temporal mixing layer and the conditional feature mixing layer. The Mix and CMix blocks apply temporal and feature transformations respectively: Step 6.14: Use the fully connected layer to get the final output and obtain the power load result predicted by the low-frequency component; Step 6.15: Sum the prediction results of each component to obtain the final power load prediction result.
8. The power load forecasting method according to claim 1, characterized in that: Step 6 uses the Bayesian optimization algorithm to optimize the hyperparameters of the TSMixer model, including: Initialize multiple models randomly and train them with a checkpoint set every few steps; Adjust the parameters of your own model. If the fitting effect of your own model is better than random search, continue training. Otherwise, adjust the model parameters for mining and add random exploration to retrain. After training for a preset time, the optimal model hyperparameters are obtained.
9. The power load forecasting method according to claim 1, characterized in that: It also includes step 8: displaying the power load forecast result obtained in step 7 through an interface.
10. A power load forecasting system, characterized in that: include: A preprocessing module is used to obtain raw data of the power system and preprocess the obtained raw data; The optimization module is used to optimize the information acquisition optimization algorithm IAO pair, using the random adversarial learning strategy to replace the random initialization of the population position in the original IAO algorithm, and introducing the spiral search strategy to obtain an improved IAO algorithm; The decomposition module is used to decompose the data into multiple IMF components by using an optimized singular spectrum analysis method SSA; the SSA is optimized by an improved IAO algorithm, A separation module is used to separate the decomposed IMF components into high-frequency components and low-frequency components according to the entropy values by using the fuzzy entropy FE aggregation method; A conversion module, used for converting the high frequency component into a two-dimensional image by using a Gram angle difference field GADF; The model building module is used to input the two-dimensional image data and the low-frequency component into the TEMPO model and the TSMixer model for training respectively, and optimize the hyperparameters of the TSMixer model using the Bayesian optimization algorithm to obtain the power load prediction model; The prediction module is used to train the power load prediction model, use the trained power load prediction model to predict the power load, and obtain the power load prediction result; The display module is used to display the power load forecast results through the interface.