Power demand prediction method and device, medium and equipment
By optimizing historical power data and building an index system, combining the two-layer structure model and the long-term memory model, accurate prediction of short-term power demand is achieved, the problem of insufficient prediction accuracy in the existing technology is solved, and the scheduling efficiency and stability of the power system are improved.
Patent Information
- Application Number
- CN202411674251.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-21
- Publication Date
- 2025-03-11
- Estimated Expiration
- 2044-11-21
AI Technical Summary
The existing technology cannot accurately predict short-term power demand, especially when facing special circumstances such as holidays and extreme weather, the fluctuations in power demand are more intense and the prediction accuracy is also higher.
By obtaining historical power data, optimizing data using the mutual information method and cosine similarity principle, an index system for power demand prediction is built. Combining historical power data and preset two-layer structural model, data is refined through a two-layer screening mechanism. Finally, the optimized data and index system are input into the trained long-term and short-term memory model, and the power demand results for each period to be predicted are output.
Accurate prediction of short-term power demand is achieved, scheduling efficiency and operating stability of the power system are improved, and the problem of inability to accurately predict short-term power demand in the prior art is solved.
Smart Images

Figure CN119599371A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of power demand forecasting, and in particular to a power demand forecasting method, device, medium and equipment. Background Art
[0002] With the rapid development of the power market and the increasing demand for electricity, accurate prediction of power demand is crucial for the stable operation of the power system and the optimal allocation of resources. In the existing technology, power demand forecasting methods mainly focus on long-term or medium-term power consumption trends, while there is relatively little research on short-term power demand forecasting. Short-term power demand forecasting is of great significance for the real-time dispatching and operation management of the power grid, especially in special situations such as holidays and extreme weather, when the fluctuation of power demand is more severe and the requirements for prediction accuracy are also higher.
[0003] Existing power demand forecasting methods usually consider relatively simple factors, such as relying only on historical power consumption data, or simply combining meteorological factors. These methods often ignore factors that have a significant impact on power demand, such as real-time electricity prices and holiday types. In addition, existing methods are relatively simple when processing forecast model samples and lack in-depth analysis and screening of input data, such as similar day analysis. These problems make it impossible for existing technologies to accurately predict short-term power demand. Summary of the invention
[0004] The present invention provides a method, device, medium and equipment for predicting power demand, so as to solve the problem that short-term power demand cannot be accurately predicted in the prior art.
[0005] In a first aspect, the present application provides a method for predicting power demand, comprising:
[0006] Obtain historical power data and forecast days;
[0007] According to the mutual information method and the cosine similarity principle, the historical power data is optimized to obtain an index system for power demand forecasting;
[0008] Inputting historical power data into a preset first structural model so that the first structural model outputs an initial sample set of the day to be predicted for short-term power demand according to a preset relative error method;
[0009] Inputting the initial sample set into a preset second structural model, so that the second structural model outputs power data for the day to be predicted that meets the short-term power demand according to preset numerical similarity and shape similarity;
[0010] According to the indicator system of the forecast day and the power demand forecast, a first indicator system is selected;
[0011] The power data and the first indicator system are input into a trained long short-term memory model, so that the long short-term memory model outputs power demand results for each time period of the day to be predicted.
[0012] This application first obtains historical power data, optimizes these data using the mutual information method and the cosine similarity principle, and thus obtains a power demand forecasting index system. This step ensures that the selected index is highly correlated with the power demand, providing a solid foundation for subsequent forecasts. Then, combining the historical power data and the preset two-layer structure model (including the first model and the second model), the power data that meets the preset requirements is calculated. This process further refines the data through the two-layer screening mechanism and improves the accuracy of the forecast. Finally, these power data and index systems that meet the preset requirements are input into the trained long-short-term memory model. The long-short-term memory model can learn the long-term dependencies of these data and output the power demand results for each period of the day to be predicted. Therefore, this application realizes the accurate prediction of short-term power demand, improves the dispatching efficiency and operation stability of the power system, and solves the problem that the prior art cannot accurately predict short-term power demand.
[0013] As a preferred embodiment of the first aspect, the acquiring of historical power data is specifically:
[0014] Get real-time electricity prices, meteorological factors, historical electricity demand and holiday types.
[0015] In this preferred embodiment, the application can fully capture the key factors affecting electricity demand by acquiring multi-dimensional historical electricity data such as real-time electricity prices, meteorological factors, historical electricity demand, and holiday types. This comprehensive data collection provides a rich information basis for subsequent data analysis and model training. Then, by optimizing these data using the mutual information method and the cosine similarity principle, the most predictive indicators can be screened out, and an indicator system for electricity demand forecasting can be constructed. This step ensures that the model can focus on the most influential factors, thereby improving the accuracy of the prediction.
[0016] As a preferred embodiment of the first aspect, the historical power data is input into a preset first structural model so that the first structural model outputs an initial sample set of the short-term power demand to be predicted day according to a preset relative error method, specifically:
[0017] Acquiring first historical power data;
[0018] According to the first historical power data, a power demand forecast correlation index matrix is constructed;
[0019] A first structural model is constructed according to a preset relative error method, the power demand forecast correlation index matrix and a preset sample correlation index matrix;
[0020] The historical power data is input into the first structural model so that the first structural model outputs an initial sample set of days to be predicted for short-term power demand.
[0021] In this preferred embodiment, the present application first obtains the first historical power data by inputting the historical power data into the preset first structural model, and these data contain key information affecting the power demand. Then, the power demand forecast correlation index matrix is constructed using these data. This step enables the model to identify and quantify the impact of various factors on power demand. Then, according to the preset relative error method, the power demand forecast correlation index matrix and the sample correlation index matrix, the first structural model is constructed. The design of this model is to accurately evaluate and select historical samples similar to the day to be predicted through the relative error method. Finally, the historical power data is input into the first structural model, and the model outputs the initial sample set of the day to be predicted for the short-term power demand. These sample sets are carefully screened and can represent the power demand characteristics of the day to be predicted. The present application improves the accuracy and relevance of power demand forecasting, provides high-quality input data for subsequent forecasting models, and thus enhances the reliability and practicality of the entire forecasting system.
[0022] As a preferred embodiment of the first aspect, the initial sample set is input into a preset second structural model so that the second structural model outputs power data for the day to be predicted that meets the short-term power demand according to preset numerical similarity and shape similarity, specifically:
[0023] Acquiring first historical power data and an initial sample set;
[0024] Calculate a numerical difference matrix according to the preset numerical similarity and the first historical power data;
[0025] Calculate a slope difference matrix according to a preset shape similarity and the first historical power data;
[0026] According to the preset proportional coefficient fusion method, numerical difference matrix and slope difference matrix, a second structural model is constructed;
[0027] The initial sample set is input into a preset second structural model so that the second structural model outputs power data for the day to be predicted that satisfies short-term power demand.
[0028] In this preferred embodiment, the present application first calculates the numerical difference matrix based on the first historical power data by inputting the initial sample set into the preset second structural model. This step quantifies the numerical deviation between the day to be predicted and the historical data, and provides the model with a direct indicator for measuring the change in power demand. Next, the slope difference matrix is calculated. This step takes into account the trend and shape of the change in power demand and supplements the information that the numerical difference matrix cannot cover. Then, the preset proportional coefficient fusion method is used to combine the numerical difference matrix and the slope difference matrix to construct the second structural model. This model combines the similarity of values and shapes, and can more comprehensively evaluate the similarity between the sample and the day to be predicted. Finally, the initial sample set is input into the second structural model, and the model outputs power data that matches the day to be predicted for short-term power demand. The present application improves the accuracy of power demand forecasting, ensures that the forecast results can more accurately reflect the changing trend of actual power demand, and thus provides more reliable data support for the scheduling and planning of the power system.
[0029] As a preferred embodiment of the first aspect, the power data meeting the preset requirements and the first indicator system are input into the trained long short-term memory model so that the long short-term memory model outputs the power demand results for each time period of the day to be predicted, specifically:
[0030] The power data that meets the preset requirements and the first indicator system are input into the trained long short-term memory model, and the weights of the parameters of the long short-term memory model are optimized according to the preset improved particle swarm optimization algorithm, so that the long short-term memory model outputs the power demand results for each time period of the day to be predicted.
[0031] In this preferred embodiment, the present application first uses the ability of the LSTM model to capture long-term dependencies in time series data by inputting the power data and the first indicator system that meet the preset requirements into the trained long short-term memory (LSTM) model, which is particularly important for predicting data with obvious time characteristics such as power demand. Then, the parameter weights of the LSTM network are optimized by the preset improved particle swarm optimization algorithm. This step further improves the prediction performance of the model, so that the model can more accurately learn and simulate the changing laws of power demand. Finally, this method that combines time series analysis and parameter optimization enables the LSTM model to output the power demand results for each period of the day to be predicted, thereby improving the accuracy and reliability of the prediction. The present application not only enhances the model's ability to process time series data, but also further improves the prediction accuracy through algorithm optimization, providing an efficient and accurate solution for power demand prediction.
[0032] As a preferred embodiment of the first aspect, the weights of the parameters of the long short-term memory model are optimized according to a preset improved particle swarm optimization algorithm, specifically:
[0033] The improved particle swarm optimization algorithm optimizes the weights of the parameters of the long short-term memory model based on the principle of using a scaling factor, and the scaling factor is:
[0034]
[0035] Where λ represents the expansion factor, C is a preset constant, C=c1+c2, and C>4;
[0036] The updating formula of the speed and position of the scaling factor is:
[0037] In the formula, λ represents the scaling factor, c1 and c2 represent the learning factors, represents the flying speed of the tth generation particle, and rand represents a random number between (0,1).
[0038] In this preferred embodiment, the present application optimizes the parameter weights of the long short-term memory (LSTM) network by adopting a preset improved particle swarm optimization algorithm. First, the concept of a scaling factor is introduced. The scaling factor is based on the nonlinear relationship between a preset constant and a learning factor, and provides a dynamic optimization mechanism for adjusting the parameters of the LSTM network. The introduction of the scaling factor enables the particle swarm algorithm to adapt to the search space more flexibly, improving the convergence speed and optimization ability of the algorithm. Specifically, the speed and position update formula of the scaling factor takes into account the current speed and random factors of the particles, which allows the algorithm to effectively search for the optimal solution while maintaining diversity. Therefore, this improved particle swarm optimization algorithm can more accurately adjust the parameters of the LSTM network, thereby improving the model's fit and prediction accuracy for power demand time series data. In summary, the beneficial effect of the present application is that through this optimization strategy, the performance of the LSTM model in the power demand forecasting task is enhanced, and more accurate capture and prediction of power demand changes are achieved, providing strong technical support for efficient management and decision-making of the power system.
[0039] In a second aspect, the present application provides a power demand forecasting device. The power demand forecasting device includes an acquisition module, an optimization module, a first input-output module, a selection module, and a second input-output module;
[0040] The acquisition module is used to obtain historical power data;
[0041] The optimization module is used to optimize the historical power data according to the mutual information method and the cosine similarity principle to obtain an index system for power demand forecasting;
[0042] The first input-output module is used to input the historical power data into a preset first structural model, so that the first structural model outputs an initial sample set of the short-term power demand to be predicted day according to a preset relative error method;
[0043] Inputting the initial sample set into a preset second structural model, so that the second structural model outputs power data for the day to be predicted that meets the short-term power demand according to preset numerical similarity and shape similarity;
[0044] The selection module is used to select a first indicator system according to the indicator system of the forecast day and the power demand forecast;
[0045] The second input-output module is used to input the power data and indicator system that meet the preset requirements into the trained long short-term memory model, so that the long short-term memory model outputs the power demand results for each time period of the day to be predicted.
[0046] This device uses five modules to divide the work and coordinate the work to better predict short-term electricity demand. This application first obtains historical electricity data, optimizes these data using the mutual information method and the cosine similarity principle, and thus obtains an electricity demand prediction index system. This step ensures that the selected index is highly correlated with the electricity demand, providing a solid foundation for subsequent predictions. Then, combining the historical electricity data and the preset two-layer structure model (including the first model and the second model), the electricity data that meets the preset requirements is calculated. This process further refines the data through the two-layer screening mechanism and improves the accuracy of the prediction. Finally, these electricity data and index systems that meet the preset requirements are input into the trained long-short-term memory model. The long-short-term memory model can learn the long-term dependencies of these data and output the electricity demand results for each period of the day to be predicted. Therefore, this application realizes the accurate prediction of short-term electricity demand, improves the dispatching efficiency and operation stability of the power system, and solves the problem that the prior art cannot accurately predict short-term electricity demand.
[0047] As a preferred embodiment of the second aspect, the power data meeting the preset requirements and the first indicator system are input into the trained long short-term memory model so that the long short-term memory model outputs the power demand results for each time period of the day to be predicted, specifically:
[0048] The power data that meets the preset requirements and the first indicator system are input into the trained long short-term memory model, and the weights of the parameters of the long short-term memory model are optimized according to the preset improved particle swarm optimization algorithm, so that the long short-term memory model outputs the power demand results for each time period of the day to be predicted.
[0049] In this preferred embodiment, the present application first uses the ability of the LSTM model to capture long-term dependencies in time series data by inputting the power data and the first indicator system that meet the preset requirements into the trained long short-term memory (LSTM) model, which is particularly important for predicting data with obvious time characteristics such as power demand. Then, the parameter weights of the LSTM network are optimized by the preset improved particle swarm optimization algorithm. This step further improves the prediction performance of the model, so that the model can more accurately learn and simulate the changing laws of power demand. Finally, this method that combines time series analysis and parameter optimization enables the LSTM model to output the power demand results for each period of the day to be predicted, thereby improving the accuracy and reliability of the prediction. The present application not only enhances the model's ability to process time series data, but also further improves the prediction accuracy through algorithm optimization, providing an efficient and accurate solution for power demand prediction.
[0050] In a third aspect, the present application provides a computer-readable storage medium, the computer-readable storage medium including a stored computer program, wherein when the computer program is executed, the device where the computer-readable storage medium is located is controlled to execute a power demand forecasting method as described. Its beneficial effect is the same as that of the power demand forecasting method provided in the first aspect of the present application.
[0051] In a fourth aspect, the present application provides a terminal device, comprising a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein when the processor executes the computer program, it implements any one of the electricity demand forecasting methods described in the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] Figure 1 : A flow chart of an embodiment of the power demand forecasting method provided in the present application;
[0053] Figure 2 : A structural diagram of an embodiment of the initial correlation index for power demand prediction provided by the present application;
[0054] Figure 3 : A structural diagram of an embodiment of the power demand prediction device provided in this application. DETAILED DESCRIPTION
[0055] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0056] Embodiment 1
[0057] Please refer to Figure 1 , which is a method for predicting power demand provided by an embodiment of the present invention.
[0058] In this embodiment, the process of the power demand prediction method in this application is described in detail through steps S01-S06.
[0059] S01: Obtain historical power data and the day to be predicted.
[0060] As a preferred embodiment of the first embodiment, the acquisition of historical power data and the day to be predicted is specifically as follows:
[0061] Get real-time electricity prices, meteorological factors, historical electricity demand and holiday types.
[0062] In this preferred embodiment, the application can fully capture the key factors affecting electricity demand by acquiring multi-dimensional historical electricity data such as real-time electricity prices, meteorological factors, historical electricity demand, and holiday types. This comprehensive data collection provides a rich information basis for subsequent data analysis and model training. Then, by optimizing these data using the mutual information method and the cosine similarity principle, the most predictive indicators can be screened out, and an indicator system for electricity demand forecasting can be constructed. This step ensures that the model can focus on the most influential factors, thereby improving the accuracy of the prediction.
[0063] S02: According to the mutual information method and the cosine similarity principle, the historical power data is optimized to obtain an indicator system for power demand forecasting.
[0064] As a preferred embodiment of the first embodiment, the historical power data is optimized according to the mutual information method and the cosine similarity principle to obtain an index system for power demand forecasting, specifically:
[0065] Construct a correlation index system for short-term electricity demand forecasting, comprehensively consider factors such as real-time electricity prices, meteorological factors, historical electricity demand and holiday types, use the mutual information method to explore the intrinsic correlation of different correlation indicators in the short-term electricity demand forecasting correlation index system, quantify the weights of different correlation indicators according to the cosine similarity coefficient method, and reasonably optimize the correlation index system.
[0066] 1) 17 short-term electricity demand forecast related indicators were selected from four aspects: real-time electricity price, meteorological factors, historical electricity demand and holiday types, and a short-term electricity demand forecast related indicator system was constructed. The maximum and minimum value methods were used for dimensionless processing.
[0067] There are many related indicators for short-term power demand forecasting. It is necessary to include other key related indicators into the related indicators while considering the real-time electricity price to improve the accuracy of power demand forecasting. 17 related indicators for short-term power demand forecasting are initially selected from four aspects: real-time electricity price, meteorological factors, historical power demand and holiday types, such as Figure 2 shown.
[0068] Since there are many related indicators and their dimensions are different, in order to avoid the reduction of power demand forecast accuracy due to dimension differences, the minimum and maximum value methods are used to non-dimensionalize the original data. At the same time, considering the problems of anomalies and missing values in the data collection process, the average interpolation method is used to process the data, and the dimensionless calculation formula is:
[0069]
[0070] In the formula, x i is the dimensionless value; is the original value, is the minimum value of the j-th correlation indicator matrix; is the maximum value of the j-th association indicator matrix.
[0071] 2) The mutual information method is used to calculate the mutual information values of different related indicators in the short-term power demand forecast related indicator system as the correlation coefficient, the intrinsic correlation of different related indicators is explored, and the weights of different related indicators are quantified according to the cosine similarity coefficient method.
[0072] As an information measure in information theory, mutual information can reflect the amount of information contained in two random variables and express the correlation between the two variables. Using the set of power demand correlation indicators, the mutual information values of different correlation indicator sequences for short-term power demand sequences are calculated:
[0073]
[0074] In the formula, I(h i ,h v ) is the mutual information value of the short-term power demand correlation index and the short-term power demand; n is the number of correlation indicators; h im is the value of the i-th correlation index at the m-th moment; h vm is the value of short-term electricity demand at the mth moment; p(h im ) and p(h vm ) is h im and h vm The marginal distribution of p(h im ,h vm ) is the probability density function. i and h v It is expressed as:
[0075]
[0076] In order to reflect the mapping degree of different correlation indicators to the power demand forecast results, the cosine similarity coefficient is used to weight the correlation coefficient of the correlation indicators and optimize the proportion of the correlation indicators. The specific formula for calculating the cosine similarity coefficient is:
[0077]
[0078] In the formula, ρ i Represents the cosine similarity coefficient value of the i-th association indicator.
[0079] The weighted calculation formula of the correlation index is:
[0080]
[0081] In the formula, ω i represents the weight of the i-th associated index; ρ i Represents the cosine similarity coefficient value of the i-th association indicator.
[0082] S03: Inputting historical power data into a preset first structural model, so that the first structural model outputs an initial sample set of the day to be predicted for short-term power demand according to a preset relative error method.
[0083] As a preferred embodiment of the first embodiment, the historical power data is input into a preset first structural model so that the first structural model outputs an initial sample set of the short-term power demand to be predicted day according to a preset relative error method, specifically:
[0084] Acquiring first historical power data;
[0085] According to the first historical power data, a power demand forecast correlation index matrix is constructed;
[0086] A first structural model is constructed according to a preset relative error method, the power demand forecast correlation index matrix and a preset sample correlation index matrix;
[0087] The historical power data is input into the first structural model so that the first structural model outputs an initial sample set of days to be predicted for short-term power demand.
[0088] More specifically, a matrix of related indicators for short-term electricity demand forecasting is constructed, thresholds are set, samples are screened using the relative error method, a sample set similar to the day of short-term electricity demand forecasting is roughly selected, a rough set of similar days is established, and the preliminary screening of the forecasting model input is completed to obtain the initial sample set.
[0089] The steps for selecting the rough set of similar days for the short-term power demand forecasting day are as follows:
[0090] a) Power demand forecast correlation index matrix:
[0091] If the correlation index matrix of the forecasted day is X a Indicates that each correlation indicator matrix of the sample is represented by X i Represented as: then the correlation index matrix is:
[0092]
[0093] In the formula, p is the number of correlation indicators finally selected by mutual information, q is the dimension of all correlation indicators, X aj is the value at the jth moment of the day to be predicted, X ij is the value of the i-th associated indicator at the j-th moment, i = 1, 2, ..., p, j = 1, 2, ..., q.
[0094] b) Rough set matrix for power demand forecast:
[0095] Construct the correlation index matrix of the predicted day and the sample correlation index matrix, and obtain the rough set matrix by calculating the relative error. The calculation formula is:
[0096]
[0097] Where δ(i,j) is the relative error between the j-th moment value of the forecast day and the j-th moment value of the i-th associated indicator.
[0098] The selection criteria of the rough set of similar days for each indicator are:
[0099]
[0100] When all moments j of the ith indicator satisfy the above formula, it means that the ith indicator meets the selection condition of similar day rough set. The selection criteria are:
[0101]
[0102] When all indicators i satisfy the above formula, it means that this sample meets the similar day rough set condition.
[0103] In this preferred embodiment, the present application first obtains the first historical power data by inputting the historical power data into the preset first structural model, and these data contain key information affecting the power demand. Then, the power demand forecast correlation index matrix is constructed using these data. This step enables the model to identify and quantify the impact of various factors on power demand. Then, according to the preset relative error method, the power demand forecast correlation index matrix and the sample correlation index matrix, the first structural model is constructed. The design of this model is to accurately evaluate and select historical samples similar to the day to be predicted through the relative error method. Finally, the historical power data is input into the first structural model, and the model outputs the initial sample set of the day to be predicted for the short-term power demand. These sample sets are carefully screened and can represent the power demand characteristics of the day to be predicted. The present application improves the accuracy and relevance of power demand forecasting, provides high-quality input data for subsequent forecasting models, and thus enhances the reliability and practicality of the entire forecasting system.
[0104] S04: Inputting the initial sample set into a preset second structural model, so that the second structural model outputs power data for the day to be predicted that meets the short-term power demand according to preset numerical similarity and shape similarity.
[0105] As a preferred embodiment of the first embodiment, the initial sample set is input into a preset second structural model so that the second structural model outputs power data for the day to be predicted that meets the short-term power demand according to preset numerical similarity and shape similarity, specifically:
[0106] Acquiring first historical power data and an initial sample set;
[0107] Calculate a numerical difference matrix according to the preset numerical similarity and the first historical power data;
[0108] Calculate a slope difference matrix according to a preset shape similarity and the first historical power data;
[0109] According to the preset proportional coefficient fusion method, numerical difference matrix and slope difference matrix, a second structural model is constructed;
[0110] The initial sample set is input into a preset second structural model so that the second structural model outputs power data for the day to be predicted that satisfies short-term power demand.
[0111] More specifically, based on the results of the rough set selection of similar days, from the two perspectives of value and shape, the improved grey correlation analysis method is used to calculate the numerical similarity and current situation similarity, quantify the similarity between the predicted day and the historical sample data, and perform a secondary selection of the rough set of similar days.
[0112] a) Numerical similarity:
[0113] Based on the absolute numerical difference between the correlation index matrix of the predicted day and the rough set matrix of similar days, the improved grey correlation analysis method is used to construct the numerical similarity and calculate the numerical difference matrix, which is specifically:
[0114] Δx1(i,j)=|X ij -X aj |;
[0115] Where Δx1(i,j) is the numerical difference between the value at the jth moment on the forecast day and the value at the jth moment of the i-th associated indicator.
[0116] Substitute the numerical difference matrix into the following formula to form the numerical similarity:
[0117]
[0118] Where γ1(i,j) is the numerical similarity represented by the numerical difference matrix.
[0119] b) Shape similarity:
[0120] Calculate the slope difference of each corresponding line segment sequence between the sequences, and use the shape slope difference and improved grey correlation analysis method to construct shape similarity. Calculate the slope value of the correlation index matrix of the predicted day and the rough set matrix of similar days, and the calculation formula is:
[0121] k(i,j)=|k ij -k i,j+1 |;
[0122] k(a,j)=|k aj -k a,j+1 |;
[0123] In the formula, k aj is the slope value at the jth moment on the forecast day; k ij is the slope value of the i-th associated indicator at the j-th moment.
[0124] The slope difference matrix is obtained by calculating the correlation index matrix of the predicted day and the rough set matrix of similar days. The calculation formula is:
[0125] Δx2(i,j)=|k(i,j)-k(a,j);
[0126] Where Δx2(i,j) is the slope difference between the j-th moment value on the forecast day and the j-th moment value of the i-th associated indicator.
[0127] Substitute the slope difference matrix into the following formula to form the shape similarity:
[0128]
[0129] Where γ2(i,j) is the shape similarity represented by the slope difference matrix.
[0130] The proportional coefficient is used to fuse the numerical similarity calculation results and the shape similarity calculation results to obtain the total similarity. The threshold is set to select sample data with a close degree of similarity to the short-term power demand forecast day, and the first k days are selected in ascending order as part of the input of the long short-term memory prediction model.
[0131] More specifically, the numerical similarity and shape similarity are calculated by the similar day rough set matrix and the correlation index matrix of the day to be predicted. Based on this, the total similarity between the correlation index matrix of the day to be predicted and the similar day rough set matrix can be calculated. The calculation formula is as follows:
[0132]
[0133] In the formula, γ i is the total similarity of the i-th correlation index between the predicted day and the sample; ω i is the weight of the i-th correlation index between the predicted day and the sample; α and β are correlation coefficients, α+β=1, and the values of α and β depend on the importance of numerical similarity and shape similarity.
[0134] According to the above process, the total similarity between the predicted day and the rough set of similar days is obtained, and the rough set of similar days is selected again. The samples with a total similarity threshold greater than 0.9 in the rough set of similar days are selected to form the similar day set, and the first k days are selected as similar days in ascending order.
[0135] In this preferred embodiment, the present application first calculates the numerical difference matrix based on the first historical power data by inputting the initial sample set into the preset second structural model. This step quantifies the numerical deviation between the day to be predicted and the historical data, and provides the model with a direct indicator for measuring the change in power demand. Next, the slope difference matrix is calculated. This step takes into account the trend and shape of the change in power demand and supplements the information that the numerical difference matrix cannot cover. Then, the preset proportional coefficient fusion method is used to combine the numerical difference matrix and the slope difference matrix to construct the second structural model. This model combines the similarity of values and shapes, and can more comprehensively evaluate the similarity between the sample and the day to be predicted. Finally, the initial sample set is input into the second structural model, and the model outputs power data that matches the day to be predicted for short-term power demand. The present application improves the accuracy of power demand forecasting, ensures that the forecast results can more accurately reflect the changing trend of actual power demand, and thus provides more reliable data support for the scheduling and planning of the power system.
[0136] S05: According to the indicator system of the day to be predicted and the power demand forecast, a first indicator system is selected.
[0137] S06: Input the power data and the first indicator system into the trained long short-term memory model, so that the long short-term memory model outputs the power demand results for each time period of the day to be predicted.
[0138] As a preferred embodiment of the first embodiment, the power data meeting the preset requirements and the first indicator system are input into the trained long short-term memory model so that the long short-term memory model outputs the power demand results for each period of the day to be predicted, specifically:
[0139] The power data that meets the preset requirements and the first indicator system are input into the trained long short-term memory model, and the weights of the parameters of the long short-term memory model are optimized according to the preset improved particle swarm optimization algorithm, so that the long short-term memory model outputs the power demand results for each time period of the day to be predicted.
[0140] More specifically, a long short-term memory neural network is used to construct a short-term power demand forecasting model. In order to avoid the poor robustness and reduced prediction accuracy caused by the high degree of randomization of the key parameters of the forecasting model, an improved particle swarm optimization algorithm is used to optimize the key parameters of the forecasting model. The improved particle swarm optimization algorithm is specifically:
[0141] The improved particle swarm optimization algorithm can realize the dynamic weight, mainly by using the scaling factor λ instead of the weight ω. The scaling factor utilizes the inherent connection between the weight and the learning factor and is expressed in a nonlinear way of the learning factor. The scaling factor has a full effect on the particle swarm flight speed update formula to improve the particle swarm algorithm's convergence speed optimization ability. The specific calculation of the scaling factor is shown below.
[0142]
[0143] In the formula, λ represents the expansion factor; C is a constant, C=c1+c2, and C>4.
[0144] The speed and position update formulas of the improved particle swarm optimization algorithm are as follows:
[0145]
[0146] Where: λ represents the scaling factor; c1 and c2 represent the learning factors; Represents the flying speed of the tth generation particle; rand() represents a random number between (0,1).
[0147] In this preferred embodiment, the present application first uses the ability of the LSTM model to capture long-term dependencies in time series data by inputting the power data and the first indicator system that meet the preset requirements into the trained long short-term memory (LSTM) model, which is particularly important for predicting data with obvious time characteristics such as power demand. Then, the parameter weights of the LSTM network are optimized by the preset improved particle swarm optimization algorithm. This step further improves the prediction performance of the model, so that the model can more accurately learn and simulate the changing laws of power demand. Finally, this method that combines time series analysis and parameter optimization enables the LSTM model to output the power demand results for each period of the day to be predicted, thereby improving the accuracy and reliability of the prediction. The present application not only enhances the model's ability to process time series data, but also further improves the prediction accuracy through algorithm optimization, providing an efficient and accurate solution for power demand prediction.
[0148] This application first obtains historical power data, optimizes these data using the mutual information method and the cosine similarity principle, and thus obtains a power demand forecasting index system. This step ensures that the selected index is highly correlated with the power demand, providing a solid foundation for subsequent forecasts. Then, combining the historical power data and the preset two-layer structure model (including the first model and the second model), the power data that meets the preset requirements is calculated. This process further refines the data through the two-layer screening mechanism and improves the accuracy of the forecast. Finally, these power data and index systems that meet the preset requirements are input into the trained long-short-term memory model. The long-short-term memory model can learn the long-term dependencies of these data and output the power demand results for each period of the day to be predicted. Therefore, this application realizes the accurate prediction of short-term power demand, improves the dispatching efficiency and operation stability of the power system, and solves the problem that the prior art cannot accurately predict short-term power demand.
[0149] Embodiment 2
[0150] Please refer to Figure 3 , which is a power demand forecasting device provided in an embodiment of the present application.
[0151] In this embodiment, the power demand forecasting device includes an acquisition module 10 , an optimization module 20 , a first input-output module 30 , a selection module 40 and a second input-output module 50 .
[0152] The acquisition module 10 is used to acquire historical power data and the day to be predicted.
[0153] As a preferred embodiment of the second embodiment, the acquisition of historical power data and the day to be predicted is specifically as follows:
[0154] Get real-time electricity prices, meteorological factors, historical electricity demand and holiday types.
[0155] In this preferred embodiment, the application can fully capture the key factors affecting electricity demand by acquiring multi-dimensional historical electricity data such as real-time electricity prices, meteorological factors, historical electricity demand, and holiday types. This comprehensive data collection provides a rich information basis for subsequent data analysis and model training. Then, by optimizing these data using the mutual information method and the cosine similarity principle, the most predictive indicators can be screened out, and an indicator system for electricity demand forecasting can be constructed. This step ensures that the model can focus on the most influential factors, thereby improving the accuracy of the prediction.
[0156] The optimization module 20 is used to optimize the historical power data according to the mutual information method and the cosine similarity principle to obtain an index system for power demand prediction.
[0157] As a preferred embodiment of the second embodiment, the historical power data is optimized according to the mutual information method and the cosine similarity principle to obtain an index system for power demand forecasting, specifically:
[0158] Construct a correlation index system for short-term electricity demand forecasting, comprehensively consider factors such as real-time electricity prices, meteorological factors, historical electricity demand and holiday types, use the mutual information method to explore the intrinsic correlation of different correlation indicators in the short-term electricity demand forecasting correlation index system, quantify the weights of different correlation indicators according to the cosine similarity coefficient method, and reasonably optimize the correlation index system.
[0159] 1) 17 short-term electricity demand forecast related indicators were selected from four aspects: real-time electricity price, meteorological factors, historical electricity demand and holiday types, and a short-term electricity demand forecast related indicator system was constructed. The maximum and minimum value methods were used for dimensionless processing.
[0160] There are many related indicators for short-term power demand forecasting. It is necessary to include other key related indicators into the related indicators while considering the real-time electricity price to improve the accuracy of power demand forecasting. 17 related indicators for short-term power demand forecasting are initially selected from four aspects: real-time electricity price, meteorological factors, historical power demand and holiday types, such as Figure 2 shown.
[0161] Since there are many related indicators and their dimensions are different, in order to avoid the reduction of power demand forecast accuracy due to dimension differences, the minimum and maximum value methods are used to non-dimensionalize the original data. At the same time, considering the problems of anomalies and missing values in the data collection process, the average interpolation method is used to process the data, and the dimensionless calculation formula is:
[0162]
[0163] In the formula, x i is the dimensionless value; is the original value, is the minimum value of the j-th correlation indicator matrix; is the maximum value of the j-th association indicator matrix.
[0164] 2) The mutual information method is used to calculate the mutual information values of different related indicators in the short-term power demand forecast related indicator system as the correlation coefficient, the intrinsic correlation of different related indicators is explored, and the weights of different related indicators are quantified according to the cosine similarity coefficient method.
[0165] As an information measure in information theory, mutual information can reflect the amount of information contained in two random variables and express the correlation between the two variables. Using the set of power demand correlation indicators, the mutual information values of different correlation indicator sequences for short-term power demand sequences are calculated:
[0166]
[0167] In the formula, I(h i ,h v ) is the mutual information value of the short-term power demand correlation index and the short-term power demand; n is the number of correlation indicators; h im is the value of the i-th correlation index at the m-th moment; h vm is the value of short-term electricity demand at the mth moment; p(h im ) and p(h vm ) is h im and h vm The marginal distribution of p(h im ,h vm ) is the probability density function. i and h v It is expressed as:
[0168]
[0169] In order to reflect the mapping degree of different correlation indicators to the power demand forecast results, the cosine similarity coefficient is used to weight the correlation coefficient of the correlation indicators and optimize the proportion of the correlation indicators. The specific formula for calculating the cosine similarity coefficient is:
[0170]
[0171] In the formula, ρ i Represents the cosine similarity coefficient value of the i-th association indicator.
[0172] The weighted calculation formula of the correlation index is:
[0173]
[0174] In the formula, ω i represents the weight of the i-th associated index; ρ i Represents the cosine similarity coefficient value of the i-th association indicator.
[0175] The first input-output module 30 is used to input the historical power data into a preset first structural model, so that the first structural model outputs an initial sample set of the day to be predicted for the short-term power demand according to a preset relative error method.
[0176] As a preferred embodiment of the second embodiment, the historical power data is input into a preset first structural model so that the first structural model outputs an initial sample set of the short-term power demand to be predicted day according to a preset relative error method, specifically:
[0177] Acquiring first historical power data;
[0178] According to the first historical power data, a power demand forecast correlation index matrix is constructed;
[0179] A first structural model is constructed according to a preset relative error method, the power demand forecast correlation index matrix and a preset sample correlation index matrix;
[0180] The historical power data is input into the first structural model so that the first structural model outputs an initial sample set of days to be predicted for short-term power demand.
[0181] More specifically, a matrix of related indicators for short-term electricity demand forecasting is constructed, thresholds are set, samples are screened using the relative error method, a sample set similar to the day of short-term electricity demand forecasting is roughly selected, a rough set of similar days is established, and the preliminary screening of the forecasting model input is completed to obtain the initial sample set.
[0182] The steps for selecting the rough set of similar days for the short-term power demand forecasting day are as follows:
[0183] a) Power demand forecast correlation index matrix:
[0184] If the correlation index matrix of the forecasted day is X a Indicates that each correlation indicator matrix of the sample is represented by X i Represented as: then the correlation index matrix is:
[0185]
[0186] In the formula, p is the number of correlation indicators finally selected by mutual information, q is the dimension of all correlation indicators, X aj is the value at the jth moment of the day to be predicted, X ij is the value of the i-th associated indicator at the j-th moment, i = 1, 2, ..., p, j = 1, 2, ..., q.
[0187] b) Rough set matrix for power demand forecast:
[0188] Construct the correlation index matrix of the predicted day and the sample correlation index matrix, and obtain the rough set matrix by calculating the relative error. The calculation formula is:
[0189]
[0190] Where δ(i,j) is the relative error between the j-th moment value of the forecast day and the j-th moment value of the i-th associated indicator.
[0191] The selection criteria of the rough set of similar days for each indicator are:
[0192]
[0193] When all moments j of the ith indicator satisfy the above formula, it means that the ith indicator meets the selection condition of similar day rough set. The selection criteria are:
[0194]
[0195] When all indicators i satisfy the above formula, it means that this sample meets the similar day rough set condition.
[0196] In this preferred embodiment, the present application first obtains the first historical power data by inputting the historical power data into the preset first structural model, and these data contain key information affecting the power demand. Then, the power demand forecast correlation index matrix is constructed using these data. This step enables the model to identify and quantify the impact of various factors on power demand. Then, according to the preset relative error method, the power demand forecast correlation index matrix and the sample correlation index matrix, the first structural model is constructed. The design of this model is to accurately evaluate and select historical samples similar to the day to be predicted through the relative error method. Finally, the historical power data is input into the first structural model, and the model outputs the initial sample set of the day to be predicted for the short-term power demand. These sample sets are carefully screened and can represent the power demand characteristics of the day to be predicted. The present application improves the accuracy and relevance of power demand forecasting, provides high-quality input data for subsequent forecasting models, and thus enhances the reliability and practicality of the entire forecasting system.
[0197] The first input-output module 30 is further used to input the initial sample set into a preset second structural model, so that the second structural model outputs power data for the day to be predicted that meets the short-term power demand according to preset numerical similarity and shape similarity.
[0198] As a preferred embodiment of the second embodiment, the initial sample set is input into a preset second structural model so that the second structural model outputs power data for the day to be predicted that meets the short-term power demand according to preset numerical similarity and shape similarity, specifically:
[0199] Acquiring first historical power data and an initial sample set;
[0200] Calculate a numerical difference matrix according to the preset numerical similarity and the first historical power data;
[0201] Calculate a slope difference matrix according to a preset shape similarity and the first historical power data;
[0202] According to the preset proportional coefficient fusion method, numerical difference matrix and slope difference matrix, a second structural model is constructed;
[0203] The initial sample set is input into a preset second structural model so that the second structural model outputs power data for the day to be predicted that satisfies short-term power demand.
[0204] More specifically, based on the results of the rough set selection of similar days, from the two perspectives of value and shape, the improved grey correlation analysis method is used to calculate the numerical similarity and current situation similarity, quantify the similarity between the predicted day and the historical sample data, and perform a secondary selection of the rough set of similar days.
[0205] a) Numerical similarity:
[0206] Based on the absolute numerical difference between the correlation index matrix of the predicted day and the rough set matrix of similar days, the improved grey correlation analysis method is used to construct the numerical similarity and calculate the numerical difference matrix, which is specifically:
[0207] Δx1(i,j)=|X ij -X aj |;
[0208] Where Δx1(i,j) is the numerical difference between the value at the jth moment on the forecast day and the value at the jth moment of the i-th associated indicator.
[0209] Substitute the numerical difference matrix into the following formula to form the numerical similarity:
[0210]
[0211] Where γ1(i,j) is the numerical similarity represented by the numerical difference matrix.
[0212] b) Shape similarity:
[0213] Calculate the slope difference of each corresponding line segment sequence between the sequences, and use the shape slope difference and improved grey correlation analysis method to construct shape similarity. Calculate the slope value of the correlation index matrix of the predicted day and the rough set matrix of similar days, and the calculation formula is:
[0214] k(i,j)=|k ij -k i,j+1 |;
[0215] k(a,j)=|k aj -k a,j+1 |;
[0216] In the formula, k aj is the slope value at the jth moment on the forecast day; k ij is the slope value of the i-th associated indicator at the j-th moment.
[0217] The slope difference matrix is obtained by calculating the correlation index matrix of the predicted day and the rough set matrix of similar days. The calculation formula is:
[0218] Δx2(i,j)=|k(i,j)-k(a,j);
[0219] Where Δx2(i,j) is the slope difference between the j-th moment value on the forecast day and the j-th moment value of the i-th associated indicator.
[0220] Substitute the slope difference matrix into the following formula to form the shape similarity:
[0221]
[0222] Where γ2(i,j) is the shape similarity represented by the slope difference matrix.
[0223] The proportional coefficient is used to fuse the numerical similarity calculation results and the shape similarity calculation results to obtain the total similarity. The threshold is set to select sample data with a close degree of similarity to the short-term power demand forecast day, and the first k days are selected in ascending order as part of the input of the long short-term memory prediction model.
[0224] More specifically, the numerical similarity and shape similarity are calculated by the similar day rough set matrix and the correlation index matrix of the day to be predicted. Based on this, the total similarity between the correlation index matrix of the day to be predicted and the similar day rough set matrix can be calculated. The calculation formula is as follows:
[0225]
[0226] In the formula, γ i is the total similarity of the i-th correlation index between the predicted day and the sample; ω iis the weight of the i-th correlation index between the predicted day and the sample; α and β are correlation coefficients, α+β=1, and the values of α and β depend on the importance of numerical similarity and shape similarity.
[0227] According to the above process, the total similarity between the predicted day and the rough set of similar days is obtained, and the rough set of similar days is selected again. The samples with a total similarity threshold greater than 0.9 in the rough set of similar days are selected to form the similar day set, and the first k days are selected as similar days in ascending order.
[0228] In this preferred embodiment, the present application first calculates the numerical difference matrix based on the first historical power data by inputting the initial sample set into the preset second structural model. This step quantifies the numerical deviation between the day to be predicted and the historical data, and provides the model with a direct indicator for measuring the change in power demand. Next, the slope difference matrix is calculated. This step takes into account the trend and shape of the change in power demand and supplements the information that the numerical difference matrix cannot cover. Then, the preset proportional coefficient fusion method is used to combine the numerical difference matrix and the slope difference matrix to construct the second structural model. This model combines the similarity of values and shapes, and can more comprehensively evaluate the similarity between the sample and the day to be predicted. Finally, the initial sample set is input into the second structural model, and the model outputs power data that matches the day to be predicted for short-term power demand. The present application improves the accuracy of power demand forecasting, ensures that the forecast results can more accurately reflect the changing trend of actual power demand, and thus provides more reliable data support for the scheduling and planning of the power system.
[0229] The selection module 40 is used to select a first indicator system according to the indicator system of the day to be predicted and the power demand prediction.
[0230] The second input-output module 50 is used to input the power data and the first indicator system into the trained long short-term memory model, so that the long short-term memory model outputs the power demand results for each time period of the day to be predicted.
[0231] As a preferred embodiment of the second embodiment, the power data meeting the preset requirements and the first indicator system are input into the trained long short-term memory model so that the long short-term memory model outputs the power demand results for each period of the day to be predicted, specifically:
[0232] The power data that meets the preset requirements and the first indicator system are input into the trained long short-term memory model, and the weights of the parameters of the long short-term memory model are optimized according to the preset improved particle swarm optimization algorithm, so that the long short-term memory model outputs the power demand results for each time period of the day to be predicted.
[0233] More specifically, a long short-term memory neural network is used to construct a short-term power demand forecasting model. In order to avoid the poor robustness and reduced prediction accuracy caused by the high degree of randomization of the key parameters of the forecasting model, an improved particle swarm optimization algorithm is used to optimize the key parameters of the forecasting model. The improved particle swarm optimization algorithm is specifically:
[0234] The improved particle swarm optimization algorithm can realize the dynamic weight, mainly by using the scaling factor λ instead of the weight ω. The scaling factor utilizes the inherent connection between the weight and the learning factor and is expressed in a nonlinear way of the learning factor. The scaling factor has a full effect on the particle swarm flight speed update formula to improve the particle swarm algorithm's convergence speed optimization ability. The specific calculation of the scaling factor is shown below.
[0235]
[0236] In the formula, λ represents the expansion factor; C is a constant, C=c1+c2, and C>4.
[0237] The speed and position update formulas of the improved particle swarm optimization algorithm are as follows:
[0238]
[0239] Where: λ represents the scaling factor; c1 and c2 represent the learning factors; Represents the flying speed of the tth generation particle; rand() represents a random number between (0,1).
[0240] In this preferred embodiment, the present application first uses the ability of the LSTM model to capture long-term dependencies in time series data by inputting the power data and the first indicator system that meet the preset requirements into the trained long short-term memory (LSTM) model, which is particularly important for predicting data with obvious time characteristics such as power demand. Then, the parameter weights of the LSTM network are optimized by the preset improved particle swarm optimization algorithm. This step further improves the prediction performance of the model, so that the model can more accurately learn and simulate the changing laws of power demand. Finally, this method that combines time series analysis and parameter optimization enables the LSTM model to output the power demand results for each period of the day to be predicted, thereby improving the accuracy and reliability of the prediction. The present application not only enhances the model's ability to process time series data, but also further improves the prediction accuracy through algorithm optimization, providing an efficient and accurate solution for power demand prediction.
[0241] This application first obtains historical power data, optimizes these data using the mutual information method and the cosine similarity principle, and thus obtains a power demand forecasting index system. This step ensures that the selected index is highly correlated with the power demand, providing a solid foundation for subsequent forecasts. Then, combining the historical power data and the preset two-layer structure model (including the first model and the second model), the power data that meets the preset requirements is calculated. This process further refines the data through the two-layer screening mechanism and improves the accuracy of the forecast. Finally, these power data and index systems that meet the preset requirements are input into the trained long-short-term memory model. The long-short-term memory model can learn the long-term dependencies of these data and output the power demand results for each period of the day to be predicted. Therefore, this application realizes the accurate prediction of short-term power demand, improves the dispatching efficiency and operation stability of the power system, and solves the problem that the prior art cannot accurately predict short-term power demand.
[0242] Embodiment three:
[0243] The embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium includes a stored computer program, wherein when the computer program is executed, the device where the computer-readable storage medium is located is controlled to execute the power demand prediction method;
[0244] Wherein, the power demand forecasting method, if implemented in the form of a software functional unit and used as an independent product, can be stored in a computer-readable storage medium. Based on such an understanding, the present invention implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Wherein, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form, etc. The computer-readable medium can include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium, etc.
[0245] Embodiment 4
[0246] The present application provides a terminal device, including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, and when the processor executes the computer program, it implements any one of the power demand forecasting methods described in Example 1.
[0247] The specific embodiments described above further illustrate the purpose, technical solutions and beneficial effects of the present invention. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. It is particularly pointed out that for those skilled in the art, any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention should be included in the scope of protection of the present invention.
Claims
1. A method for predicting power demand, characterized in that: include: Obtain historical power data and forecast days; According to the mutual information method and the cosine similarity principle, the historical power data is optimized to obtain an index system for power demand forecasting; Inputting historical power data into a preset first structural model so that the first structural model outputs an initial sample set of the day to be predicted for short-term power demand according to a preset relative error method; Inputting the initial sample set into a preset second structural model, so that the second structural model outputs power data for the day to be predicted that meets the short-term power demand according to preset numerical similarity and shape similarity; According to the indicator system of the forecast day and the power demand forecast, a first indicator system is selected; The power data and the first indicator system are input into a trained long short-term memory model, so that the long short-term memory model outputs power demand results for each time period of the day to be predicted.
2. The method for predicting power demand according to claim 1, characterized in that: The acquisition of historical power data is specifically as follows: Get real-time electricity prices, meteorological factors, historical electricity demand and holiday types.
3. The method for predicting power demand according to claim 1, characterized in that: The inputting of historical power data into a preset first structural model so that the first structural model outputs an initial sample set of the day to be predicted for short-term power demand according to a preset relative error method is specifically as follows: Acquiring first historical power data; According to the first historical power data, a power demand forecast correlation index matrix is constructed; A first structural model is constructed according to a preset relative error method, the power demand forecast correlation index matrix and a preset sample correlation index matrix; The historical power data is input into the first structural model so that the first structural model outputs an initial sample set of days to be predicted for short-term power demand.
4. The method for predicting power demand according to claim 1, characterized in that: The initial sample set is input into a preset second structural model so that the second structural model outputs the power data of the day to be predicted that meets the short-term power demand according to the preset numerical similarity and shape similarity, specifically: Acquiring first historical power data and an initial sample set; Calculate a numerical difference matrix according to the preset numerical similarity and the first historical power data; Calculate a slope difference matrix according to a preset shape similarity and the first historical power data; According to the preset proportional coefficient fusion method, numerical difference matrix and slope difference matrix, a second structural model is constructed; The initial sample set is input into a preset second structural model so that the second structural model outputs power data for the day to be predicted that satisfies short-term power demand.
5. The method for predicting power demand according to claim 1, characterized in that: The power data meeting the preset requirements and the first indicator system are input into the trained long short-term memory model, so that the long short-term memory model outputs the power demand results for each period of the day to be predicted, specifically: The power data that meets the preset requirements and the first indicator system are input into the trained long short-term memory model, and the weights of the parameters of the long short-term memory model are optimized according to the preset improved particle swarm optimization algorithm, so that the long short-term memory model outputs the power demand results for each time period of the day to be predicted.
6. The method for predicting power demand according to claim 5, characterized in that: The weights of the parameters of the long short-term memory model are optimized according to the preset improved particle swarm optimization algorithm, specifically: The improved particle swarm optimization algorithm optimizes the weights of the parameters of the long short-term memory model based on the principle of using a scaling factor, and the scaling factor is: Where λ represents the expansion factor, C is a preset constant, C=c1+c2, and C>4; The updating formula of the speed and position of the scaling factor is: In the formula, λ represents the scaling factor, c1 and c2 represent the learning factors, represents the flying speed of the tth generation particle, and rand represents a random number between (0,1).
7. A power demand forecasting device, characterized in that: It includes an acquisition module, an optimization module, a first input-output module, a selection module, and a second input-output module; The acquisition module is used to obtain historical power data; The optimization module is used to optimize the historical power data according to the mutual information method and the cosine similarity principle to obtain an index system for power demand forecasting; The first input-output module is used to input the historical power data into a preset first structural model, so that the first structural model outputs an initial sample set of the short-term power demand to be predicted day according to a preset relative error method; Inputting the initial sample set into a preset second structural model, so that the second structural model outputs power data for the day to be predicted that meets the short-term power demand according to preset numerical similarity and shape similarity; The selection module is used to select a first indicator system according to the indicator system of the forecast day and the power demand forecast; The second input-output module is used to input the power data and indicator system that meet the preset requirements into the trained long short-term memory model, so that the long short-term memory model outputs the power demand results for each time period of the day to be predicted.
8. The power demand forecasting device according to claim 7, characterized in that: The power data and index system that meet the preset requirements are input into the trained long short-term memory model, so that the long short-term memory model outputs the power demand results for each period of the day to be predicted, specifically: The power data and indicator system that meet the preset requirements are input into the trained long short-term memory model, and the weights of the parameters of the long short-term memory model are optimized according to the preset improved particle swarm optimization algorithm, so that the long short-term memory model outputs the power demand results for each time period of the day to be predicted.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored computer program, wherein when the computer program is executed, the device where the computer-readable storage medium is located is controlled to execute the power demand forecasting method according to any one of claims 1 to 6.
10. A terminal device, characterized in that: The method comprises a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein when the processor executes the computer program, the method for predicting power demand according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Battery life prediction method based on particle swarm optimization long-short-term memory network
CN112001113A
Transmitting end transient overvoltage suppression method based on overshoot parameter LSTM neural network
CN118399422A
Slope adaptive prediction method and system, terminal and medium
CN118484643A
Power demand prediction method and device, computer equipment and storage medium
CN118898312A
Cited By
Bandwidth traffic peak value analysis method and system based on time sequence data, and storage medium
CN121585559A