Power system short-term load prediction method, device, equipment and medium
By applying the Transformer model in the short-term load prediction of power systems, combining historical load, weather parameters and electricity price data, the problems of low prediction accuracy and poor robustness in the existing technology are solved, and more efficient load prediction and demand response potential assessment are achieved. .
Patent Information
- Application Number
- CN202411424623.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-12
- Publication Date
- 2025-02-07
AI Technical Summary
The prior art is difficult to fully capture the relationship between nonlinear features and higher-order features in the short-term load prediction of power systems, with low prediction accuracy, poor robustness, and unable to effectively capture the long-term dependencies in long-term load sequence data.
A short-term load prediction method based on the Transformer model is adopted to build a training data set by obtaining historical load, weather parameters and electricity price data, and calculate the predicted value using the multi-head self-attention mechanism and forward propagation to optimize the model parameters to improve the prediction accuracy.
It improves the accuracy and effectiveness of short-term load prediction of power systems, can better capture the relationship between nonlinear features and higher-order features, enhances the robustness of the model, and effectively evaluates the demand response potential.
Smart Images

Figure CN119401392A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of power system automation, and in particular relates to a method, device, equipment and medium for short-term load forecasting of a power system. Background Art
[0002] With the gradual advancement of power market reform and the continuous development of smart grid technology, demand response (DR) will play an increasingly important role in future new power systems. Demand response can achieve energy supply and demand balance and efficient utilization by adjusting load-side energy consumption, which can reduce grid operation costs and enhance the stability of the energy system. The uncertainty of power load is one of the important research directions of demand response uncertainty. The incentive mechanism and price policy of demand response will affect users' general energy consumption habits, adding more complexity and uncertainty to the entire energy system. In addition, the widespread incorporation of large-scale intermittent new energy power generation systems and new loads in recent years have further increased the difficulty of load forecasting.
[0003] Traditional statistical-based load forecasting algorithms such as multivariate linear regression, exponential smoothing, and Kalman filtering have the characteristics of being difficult to fully capture the relationship between nonlinear features and high-order features, low prediction accuracy, and poor robustness, which will lead to the inability to effectively implement the formulated scheduling strategy. Machine learning forecasting methods such as support vector machines, extreme gradient boosting, and random forests have strong self-learning and nonlinear fitting capabilities, but they have problems such as local convergence, complex linear or even overall modeling, and ignoring time characteristics. Deep learning algorithms such as convolutional neural networks (CNNs) and recurrent neural networks (RNNs) cannot maintain long-term memory and cannot capture long-term dependencies in long-term load series data. Summary of the invention
[0004] The object of the present invention is to provide a method, device, equipment and medium for short-term load forecasting of an electric power system, so as to solve at least one of the problems existing in the prior art.
[0005] In order to achieve the above object, the present invention adopts the following technical solution: In a first aspect, the present invention provides a method for short-term load forecasting of a power system, comprising the following steps: Acquire time series data for load forecasting; wherein the time series data includes historical load, weather parameters associated with the historical load, and electricity prices within a demand response usage period; The time series data is input into a pre-trained Transformer short-term load forecasting model, and the Transformer short-term load forecasting model outputs a short-term load forecasting result; wherein the Transformer short-term load forecasting model is trained based on the power demand response fluctuation results corresponding to various electricity price differences under different probability conditions.
[0006] Furthermore, the Transformer short-term load forecasting model is trained based on the power demand response fluctuation results corresponding to various power price differences under different probability conditions, including: Determine various electricity price differences under different probability conditions, and the power load demand response results corresponding to each electricity price difference; determining meteorological data corresponding to the power load demand response results; The electricity price difference, the power load demand response result corresponding to the electricity price difference, and the meteorological data corresponding to the power load demand response result are constructed as a training data set; Determine the architecture of the Transformer model, set model parameters, and define the loss function; Initialize model parameters and set the optimizer; Input the training data set into the Transformer model, perform forward propagation to calculate the predicted value; calculate the loss value according to the loss function; use the optimizer to update the model parameters according to the loss value; Repeat the above steps until the preset number of training rounds is reached or the loss value converges, and a trained Transformer short-term load forecasting model is obtained.
[0007] Furthermore, various electricity price differences under different probability conditions and the power load demand response results corresponding to each electricity price difference are determined, including: Determine the price differences of various electricity prices under different probability conditions; Based on the electricity price difference, a Tanh function is used to describe a demand response central curve; response fluctuation values under different probability conditions are determined; based on the demand response central curve and the response fluctuation values, power load demand response results under different probability conditions are calculated.
[0008] Further, based on the electricity price difference, a Tanh function is used to describe a demand response central curve; a response fluctuation value under different probability conditions is determined; based on the demand response central curve and the response fluctuation value, a power load demand response result under different probability conditions is calculated, including: The demand response center curve is expressed as:
[0009] In the formula, λe is the response of the central curve; Δ p Difference in electricity prices; Δp δmax The price difference corresponding to the maximum fluctuation in the response area; c is the constant used to translate the curve; The response fluctuation value under different probability conditions is expressed as:
[0010] In the formula, δ is the absolute value of the demand response fluctuation momentum; β is the calculation result of the fluctuation value scaling; L is the probability condition; σ is the standard deviation of the response fluctuation value; The power load demand response results under different probability conditions are expressed as:
[0011] In the formula, λ eup is the specified probability condition L The upper limit of the response fluctuation under ; λ elow is the specified probability condition L The lower limit of the response fluctuation.
[0012] Furthermore, after the step of outputting the short-term load forecasting result by the Transformer short-term load forecasting model, the method further includes: The short-term load forecasting result is used to calculate the demand response regulation potential of the power system during the power demand response period.
[0013] Furthermore, the demand response regulation potential of the power system during the power demand response period is calculated using the short-term load forecasting result, including: Using the short-term load forecast result as the load power during the user response period; Determine the base load power; The demand response regulation potential of the power system is obtained by subtracting the load power during the user response period from the benchmark load power.
[0014] Further, the base load power is determined, including: When the power demand response occurs on a working day, the benchmark load power is equal to the average historical load power at the corresponding time of the 5 working days before the power demand response day; When electricity demand response occurs on a non-working day, the benchmark load power is equal to the average historical load power of the last three non-working days before the electricity demand response day.
[0015] In a second aspect of the present invention, a short-term load forecasting device for a power system is provided, comprising: A data acquisition module, used to acquire time series data for load forecasting; wherein the time series data includes historical loads, weather parameters associated with historical loads, and electricity prices within a demand response usage period; The data prediction module is used to input the time series data into a pre-trained Transformer short-term load prediction model, and the Transformer short-term load prediction model outputs a short-term load prediction result; wherein the Transformer short-term load prediction model is trained based on the power demand response fluctuation results corresponding to various electricity price differences under different probability conditions.
[0016] According to a third aspect of the present invention, there is provided an electronic device, comprising a processor and a memory, wherein the processor is configured to execute a computer program stored in the memory to implement the above-mentioned method for short-term load forecasting of a power system.
[0017] According to a fourth aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores at least one instruction, and when the at least one instruction is executed by a processor, the method for short-term load forecasting of a power system as described above is implemented.
[0018] Compared with the prior art, the present invention has the following advantages and beneficial effects: The accuracy and effectiveness of power system load forecasting play a vital and fundamental role in the safe and stable operation of the power grid and the smooth production. The present invention proposes a method for short-term load forecasting of a power system, which is implemented based on a Transformer model that considers the potential for demand response, so as to improve the accuracy of short-term load forecasting of the power system under a demand response scenario. The effectiveness of the proposed method was verified by comparative analysis with actual data. Compared with other existing methods, the Transformer model that considers demand response performs well in power load forecasting, and provides a certain theoretical basis for evaluating the potential for demand response. A short-term load forecasting device, electronic device, and computer-readable storage medium for a power system provided by the present invention also solve the problems raised in the background technology section. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] The drawings constituting a part of the present application are used to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings: Figure 1 A flowchart of a method for short-term load forecasting of a power system according to an embodiment of the present invention; Figure 2It is a principle diagram of demand response based on Tanh function in an embodiment of the present invention; Figure 3 is a probability density distribution diagram of demand response fluctuation values in different response intervals in an embodiment of the present invention; Figure 4 is a diagram showing the relationship between the uncertainty of demand response and the difference in electricity prices in an embodiment of the present invention; Figure 5 This is a diagram of demand response results under different probability conditions in an embodiment of the present invention; Figure 6 It is a flow chart of a Transformer model short-term load forecasting model considering demand response potential in an embodiment of the present invention; Figure 7 This is a structural block diagram of a short-term load forecasting device for a power system according to an embodiment of the present invention; Figure 8 The present invention is a structural block diagram of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0020] The present invention will be described in detail below with reference to the accompanying drawings and in combination with embodiments. It should be noted that the embodiments and features in the embodiments of the present application can be combined with each other without conflict.
[0021] The following detailed description is an exemplary description, which is intended to provide further detailed description of the present invention. Unless otherwise specified, all technical terms used in the present invention have the same meaning as those generally understood by those skilled in the art to which the present application belongs. The terms used in the present invention are only for describing specific embodiments, and are not intended to limit exemplary embodiments according to the present invention.
[0022] Example 1 Accurate and effective power system load forecasting is an important prerequisite for ensuring the safety, stable operation and normal production of the power grid. In order to improve the accuracy of short-term load forecasting of power systems under demand response scenarios, this paper proposes a power system short-term load forecasting method considering the demand response potential Transformer model.
[0023] like Figure 1 As shown, a method for short-term load forecasting of a power system comprises the following steps: S1. Acquire time series data for load forecasting; wherein the time series data includes historical load, weather parameters associated with the historical load, and electricity prices within a demand response usage period.
[0024] S2. Input the time series data into a pre-trained Transformer short-term load forecasting model, and the Transformer short-term load forecasting model outputs a short-term load forecasting result; wherein the Transformer short-term load forecasting model is trained based on the power demand response fluctuation results corresponding to various electricity price differences under different probability conditions.
[0025] Specifically, the Transformer short-term load forecasting model is trained based on the power demand response fluctuation results corresponding to various electricity price differences under different probability conditions, including: Determine various electricity price differences under different probability conditions, and the power load demand response results corresponding to various electricity price differences; determine the meteorological data corresponding to the power load demand response results; construct the electricity price difference, the power load demand response results corresponding to the electricity price difference, and the meteorological data corresponding to the power load demand response results as a training data set; Determine the architecture of the Transformer model, set model parameters, and define the loss function; Initialize model parameters and set the optimizer; Input the training data set into the Transformer model, perform forward propagation to calculate the predicted value; calculate the loss value according to the loss function; use the optimizer to update the model parameters according to the loss value; Repeat the above steps until the preset number of training rounds is reached or the loss value converges, and a trained Transformer short-term load forecasting model is obtained.
[0026] Specifically, various electricity price differences under different probability conditions and the power load demand response results corresponding to each electricity price difference are determined, including: Determine various electricity price differences under different probability conditions; based on the electricity price difference, use the Tanh function to describe the demand response central curve; determine the response fluctuation value under different probability conditions; based on the demand response central curve and the response fluctuation value, calculate the power load demand response results under different probability conditions.
[0027] It should be noted that in the process of demand response, users will choose the response amount according to their own needs and electricity prices. According to the principles of consumer psychology, the above response process can be described by the Tanh function. In actual operation, demand response may lead to uncertainty in the response results due to factors such as user energy consumption and consumption behavior. This uncertainty can be described as the fluctuation of demand response within a certain range. The principle of demand response based on the Tanh function is as follows: Figure 2As shown. The demand response curve is based on consumer psychology. It uses the Tanh function to divide the demand response into a dead zone, a response zone, and a saturation zone to describe the response of users under different electricity price incentive levels. The dead zone means that the electricity price incentive level is too low and no obvious response results will be produced; the electricity price difference in the response zone is within a reasonable range, and users will have a more obvious response result; the user demand response ability in the saturation zone has been fully utilized, and the response value no longer changes significantly.
[0028] More specifically, based on the electricity price difference, a Tanh function is used to describe a demand response central curve; response fluctuation values under different probability conditions are determined; based on the demand response central curve and the response fluctuation value, power load demand response results under different probability conditions are calculated, including: The uncertainty range in the demand response process can be described by setting the upper and lower limits of the response fluctuation. The demand response center curve is expressed as: (1) In the formula, λ e is the response of the central curve; Δ p Difference in electricity prices; Δp δmax is the price difference corresponding to the maximum fluctuation of the response area, that is, the response area Δ p The median point of c is the constant used to translate the curve; Although demand response has uncertainty, the uncertainty in different response intervals will change regularly with the change of electricity price difference, and the fluctuation results of demand response under different probability conditions can be quantified based on statistical data. If the fluctuation value corresponding to the specified electricity price difference in demand response under different probability conditions can be calculated, the solution of uncertain demand response results can be achieved. The uncertainty of demand response is caused by multiple independent small factors such as user psychology and environment. Random variables generally obey normal distribution, and the fluctuation value of demand response under given probability conditions can be solved by normal distribution function.
[0029] It should be noted that the probability conditions / probability referred to in this solution refer to the response probability. Response probability: the probability that users choose to respond based on the difference in electricity prices and the principles of consumer psychology. Under different probability conditions = under different circumstances = uncertainty = fluctuations in demand response. The purpose is to more accurately predict power load and demand response potential The response fluctuation value under different probability conditions is expressed as: (2) In the formula, δ is the absolute value of the demand response fluctuation momentum; β is the calculation result of the fluctuation value scaling;L is the probability condition; σ The mathematical meaning of uncertainty is the standard deviation of the response fluctuation value, which represents the uncertain response spread and reflects the uncertainty of fluctuation through the distribution of fluctuation value. σ As the value increases, the distribution of demand response fluctuation values will become more and more divergent, and the uncertainty will become higher and higher; on the contrary, the response fluctuation values will become more and more concentrated, and the uncertainty will become smaller and smaller.
[0030] The uncertainty of demand response will change with the change of electricity price difference, which can be expressed by the probability density distribution of demand response fluctuation value in each response interval, as shown in the attached figure. Figure 3 The uncertainty of the response results in the dead zone and saturation zone is low, and the fluctuation values are mostly concentrated near zero; the uncertainty in the response zone is high and the distribution is more divergent. To describe the above law, the characteristics of the change of demand response uncertainty with electricity price difference are shown in the attached figure. Figure 4 shown.
[0031] Based on the relationship between response uncertainty and electricity price differences, as well as the calculation formula for response volatility under different probability conditions, the power demand response results considering uncertainty can be obtained. The demand response results under different probability conditions are shown in the attached figure. Figure 5 shown.
[0032] The power load demand response results under different probability conditions are expressed as: (3) (4) In the formula, λ eup is the specified probability condition L The upper limit of the response fluctuation under ; λ elow is the specified probability condition L The lower limit of the response fluctuation.
[0033] Uncertain demand response results λ esum By Response Center λ e and the response volatility δ Processing, calculation of specified probability conditions L The difference in electricity prices Δp The corresponding response results. The uncertainty of demand response is quantified by setting upper and lower limits of response fluctuations. The upper and lower limits represent the maximum and minimum demand response amounts that users may generate under different probability conditions.
[0034] In the post-model solving process, the response results under different probability conditions will be processed by an equal-weighted attention mechanism to achieve the probabilistic understanding of uncertain response results in the model. Under the premise of giving priority to the response probability, combined with other input influencing factors, consider the possible medium and low probability situations, improve the comprehensiveness of the model's consideration of the problem, and improve the final prediction accuracy. Specifically, give priority to the response probability: first calculate and give priority to the high-probability response situation (because it has the greatest impact on the final load forecast) based on the difference in electricity prices and the principles of consumer psychology; combine with other input influencing factors: in addition to the response probability, the model will also consider other factors that affect the power load, such as user historical load, temperature, electricity price and other time series data. "Consider medium and low probability situations: The model will also analyze the medium and low probability response situations in combination with the purpose of improving the comprehensiveness of the model's problem handling. Improving the final prediction accuracy = considering the response probability (including high, medium, and low response probabilities) + considering other input influencing factors.
[0035] In this solution, Transformer neural network is used to extract features from user historical load, temperature, electricity price and other time series data. Through the multi-head self-attention mechanism, the structural relationship between time series data is paid attention to, and the importance of input variables at each historical moment to the current load is analyzed. Thus, high-precision prediction of user load and demand response potential is achieved. The prediction process of the model proposed in this invention is shown in the attached figure. Figure 6 As shown in the figure. The input data of the model are historical multivariate load data, meteorological data (temperature, humidity, wind speed) and electricity price data within a week, and the output is the future load within a certain time range. The Transformer model neural network combined with the multi-head self-attention mechanism can analyze historical input data from multiple different angles and realize the extraction and filtering of important input data.
[0036] The calculation principle is as follows: (5) (6) (7) In the formula, Q H and K H They are the query matrix and the key matrix, which are used to calculate the correlation between data. H , the correlation between energy consumption data at each time point is obtained, thereby increasing the attention value of strongly correlated data; V H represents the value matrix; W QH / W KH / W VH / W mattt Both represent trainable parameter matrices. d K yes K H The dimension is used in conjunction with the softmax function to normalize the attention value. The normalized attention value is multiplied by the value vector representing the historical data V H , the energy consumption correlation attention value is completed H att1 After analyzing the energy consumption correlation at different time points from a total of n perspectives, the summary matrix W matt Summarize the system energy consumption patterns in the above energy consumption correlations and infer the historical input data that the model needs to pay attention to during the prediction process H matt .
[0037] Based on the Transformer model's prediction of the user's load value on the day when the DR (power demand response) event occurs, the user's DR potential can be further calculated. The DR potential calculation methods commonly used by power users may vary depending on user responses.
[0038] Preferably, after the step of the Transformer short-term load forecasting model outputting the short-term load forecasting result, it also includes: using the short-term load forecasting result to calculate the demand response regulation potential of the power system during the power demand response period.
[0039] Specifically, using the short-term load forecasting result, calculating the demand response regulation potential of the power system during the power demand response period includes: The short-term load forecast result is used as the load power during the user response period; the benchmark load power is determined; the load power during the user response period and the benchmark load power are subtracted to obtain the demand response regulation potential of the power system.
[0040] (8) In the formula: ΔP DR is the DR power during the user response period; P B is the user's baseline load power; P A is the load power during the user response period.
[0041] Among them, for the benchmark load power P B Determination, including: When the electricity demand response occurs on a working day, the benchmark load power is equal to the average historical load power at the corresponding time of the five working days before the electricity demand response day; when the electricity demand response occurs on a non-working day, the benchmark load power is equal to the average historical load power of the last three non-working days before the electricity demand response day.
[0042] In order to further explain and illustrate this solution, the following is a specific example. Step 1: Select the data.
[0043] The present invention selects the load data of users in the same industry and voltage level as the prediction target data to eliminate the interference of factors such as industry, voltage level, holidays, etc. The temperature, wind speed, electricity price, specific time, etc. corresponding to each historical load data are selected as external influencing factors to form an input matrix. At the same time, in order to avoid uneven weight values due to large differences in the values of each influencing factor, it is necessary to normalize the data of each influencing factor before model training.
[0044] In order to verify the effectiveness of the Transformer model in predicting the load and DR potential of power users, this paper takes 18 industrial users in the general parts manufacturing industry in a certain city as an example and uses them as user clusters for DR potential prediction analysis. The daily load curve in June 2021 is selected as the original data for analysis. In the original data, the user collects a total of 96 load values every day, that is, the load data is collected every 15 minutes.
[0045] Step 2: Accuracy evaluation.
[0046] In order to verify the accuracy of load forecasting, the present invention selects the mean absolute error ( R MAPE ), square root error ( R MSE ) and the regression coefficient β As an evaluation criterion, it measures the difference between the predicted load data and the actual load data. If the predicted value is closer to the true value, then R MAPE and R MSE The value will be smaller. β The closer the value is to 1, the closer the predicted data is to the actual data. R MAPE , R MSE and β The calculation formula is: (9) (10) In the formula: yn is the true value; y′ n is the predicted value; y av is the average of the true values; n is the sequence number of the data, n = 1, 2, ..., N.
[0047] Step 3: Model parameter setting.
[0048] The present invention takes prediction accuracy as a prerequisite, adopts the grid search method, and determines the required hyperparameters through multiple experiments. The training hyperparameters of the model are set as 200 training iterations, 24 training batches, and a learning rate of 0.0001. To prevent overfitting, a dropout stage is set for training, and the dropout rate is 0.2. The main hyperparameters of the remaining network models are shown in Table 1.
[0049] Table 1 Network model parameters
[0050] The experimental hardware platform uses Intel Core i5-11400H CPU and NVIDIA GeForce RTX 3050 GPU, accelerated by CUDA11.8; the software platform uses Python 3.9 environment, and the deep learning model uses Python third-party libraries and TensorFlow framework.
[0051] Step 4: Analysis of the impact of comprehensive demand response on the model prediction performance.
[0052] In order to verify the positive effect of considering comprehensive demand response on multivariate load forecasting, the present invention compares and analyzes the prediction performance of the Transformer model when considering and not considering the comprehensive demand response signal. The statistical results of the prediction error are shown in Table 2. As can be seen from Table 2, when considering the comprehensive demand response signal, the prediction error of the model is lower than the prediction error when the comprehensive demand response signal is not considered. This shows that considering the comprehensive demand response factor can enhance the model's understanding of the operation mode of the integrated energy system and effectively improve the prediction accuracy and stability of the model.
[0053] Table 2 Comparison of prediction errors
[0054] The present invention uses five models, namely SVR (support vector regression), CNN (convolutional neural network), GNN (graph neural network), LSTM (long short-term memory network) and Transformer, in the calculation example, and predicts the power load from July 1, 2020 to July 7, 2020 in the calculation example. The time unit is 1 hour, and the input is multivariate load, meteorological data and comprehensive demand response signal within a week. The basic prediction process of the above comparative analysis model is consistent with the Transformer model. The models used for comparative analysis are all error-optimal models obtained through training, and they all consider the demand response process of the integrated energy system by inputting comprehensive demand response signals. The evaluation results of the prediction data of each model are shown in Table 3. The Transformer model not only has high prediction accuracy, but also has good prediction stability.
[0055] Table 3 Comparison of prediction results of different models Model <![CDATA[R MAPE / %]]> <![CDATA[R MSE / kW]]> Transformer 1.056 379.090 LSTM 1.478 551.234 GNN 1.499 575.033 CNN 2.428 979.902 SVR 2.788 1081.375 Step 5: DR potential prediction.
[0056] In order to verify the effectiveness of the Transformer model in predicting the DR potential of power users, this paper takes 18 users in the general component manufacturing industry as an example and uses them as user clusters to predict and analyze their DR potential.
[0057] The peak and valley time periods around July 15th changed. After July 15th, due to the adjustment of the peak and valley time periods, the electricity prices in the three time periods of 14:00-15:00, 17:00-19:00, and 21:00-22:00 changed. The temperature-induced changes in electricity prices mainly occur between 10:00 and 11:00 in the morning, and the trigger condition is that the maximum temperature exceeds 35°C. By retrieving the city's meteorological data for 2021, it can be found that the maximum temperature from June to August 2021 remained between 25°C and 36°C. During this period, there were 4 days with a maximum temperature exceeding 35°C, namely June 7, July 11, July 14, and August 31. Taking various factors into consideration, the present invention first selected the load data of 18 general parts manufacturing users for 31 working days from June 1 to July 14 to train the Transformer model, with a total of 31,896 load data training samples. The trained model is used to forecast the load on July 15 and calculate the DR regulation power during the electricity price change period. The actual regulation power is compared and analyzed. Based on the predicted load data and the benchmark load, the DR regulation power of industry users on July 15 can be obtained. Table 4 compares the average DR regulation power of users during the three electricity price adjustment periods on the same day.
[0058] Table 4 Comparison of average DR regulation power on July 15, 2021 Time period Actual power Model Power 14:00—15:00 1343 3789 17:00—19:00 -774 -4637 21:00—22:00 4357 772 According to Table 4, it can be seen that in the two time periods of 14:00-15:00 and 21:00-22:00 on July 15, due to the increase in electricity prices, the actual load of users decreased compared with the benchmark load, and the average DR regulation power was positive. However, from 17:00 to 19:00, due to the decrease in electricity prices, the actual load of users increased compared with the benchmark load, and the average DR regulation power was negative. The predicted DR regulation power is consistent with the actual regulation power. In addition, the present invention uses the load data of all working days from June 1 to August 30 as samples to continue training the Transformer model to predict the load situation on August 31. Since the maximum temperature on August 31 is 35 ℃, the electricity price in the morning period of 10:00-11:00 will increase by 0.1 yuan / kWh compared with the peak electricity price.
[0059] Table 5 Comparison of average DR regulation power on August 31, 2021 Time period Actual regulated power Model Adjustment Power 10:00—11:00 1335 1015 According to the analysis in Table 5, as the training data increases, the DR adjustment power is closer to the actual adjustment power value.
[0060] Example 2 like Figure 7 As shown, based on the same inventive concept as the above embodiment, the present invention also provides a short-term load forecasting device for a power system, comprising: A data acquisition module, used to acquire time series data for load forecasting; wherein the time series data includes historical loads, weather parameters associated with historical loads, and electricity prices within a demand response usage period; The data prediction module is used to input the time series data into a pre-trained Transformer short-term load prediction model, and the Transformer short-term load prediction model outputs a short-term load prediction result; wherein the Transformer short-term load prediction model is trained based on the power demand response fluctuation results corresponding to various electricity price differences under different probability conditions.
[0061] Example 3 like Figure 8 As shown, the present invention also provides an electronic device 100 for implementing a method for short-term load forecasting of a power system; The electronic device 100 includes a memory 101 , at least one processor 102 , a computer program 103 stored in the memory 101 and executable on the at least one processor 102 , and at least one communication bus 104 .
[0062] The memory 101 can be used to store a computer program 103 , and the processor 102 implements the steps of a method for short-term load forecasting of a power system in Example 1 by running or executing the computer program stored in the memory 101 and calling the data stored in the memory 101 .
[0063] The memory 101 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area may store data (such as audio data) created according to the use of the electronic device 100, etc. In addition, the memory 101 may include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), at least one disk storage device, a flash memory device, or other non-volatile solid-state storage devices.
[0064] At least one processor 102 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The processor 102 may be a microprocessor or any conventional processor, etc. The processor 102 is the control center of the electronic device 100, and uses various interfaces and lines to connect various parts of the entire electronic device 100.
[0065] The memory 101 in the electronic device 100 stores a plurality of instructions to implement a method for short-term load forecasting of a power system, and the processor 102 can execute the plurality of instructions to implement: Acquire time series data for load forecasting; wherein the time series data includes historical load, weather parameters associated with the historical load, and electricity prices during a demand response usage period.
[0066] The time series data is input into a pre-trained Transformer short-term load forecasting model, and the Transformer short-term load forecasting model outputs a short-term load forecasting result; wherein the Transformer short-term load forecasting model is trained based on the power demand response fluctuation results corresponding to various electricity price differences under different probability conditions.
[0067] Example 4 If the module / unit integrated in the electronic device 100 is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this 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 method embodiments when executed by the processor. Among them, 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. Computer-readable media may include: any entity or device capable of carrying computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory and read-only memory (ROM, Read-Only Memory).
[0068] It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0069] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0070] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0071] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0072] In the description of this specification, the description with reference to the terms "one embodiment", "example", "specific example", etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner.
[0073] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the above embodiments, ordinary technicians in the relevant field should understand that the specific implementation methods of the present invention can still be modified or replaced by equivalents. Any modification or equivalent replacement that does not depart from the spirit and scope of the present invention should be covered within the scope of protection of the claims of the present invention.
Claims
1. A method for short-term load forecasting of a power system, characterized in that: The steps include: Acquire time series data for load forecasting; wherein the time series data includes historical load, weather parameters associated with the historical load, and electricity prices within a demand response usage period; The time series data is input into a pre-trained Transformer short-term load forecasting model, and the Transformer short-term load forecasting model outputs a short-term load forecasting result; wherein the Transformer short-term load forecasting model is trained based on the power demand response fluctuation results corresponding to various electricity price differences under different probability conditions.
2. The method for short-term load forecasting of a power system according to claim 1, characterized in that: The Transformer short-term load forecasting model is trained based on the power demand response fluctuation results corresponding to various power price differences under different probability conditions, and includes: Determine various electricity price differences under different probability conditions, and the power load demand response results corresponding to each electricity price difference; determining meteorological data corresponding to the power load demand response results; The electricity price difference, the power load demand response result corresponding to the electricity price difference, and the meteorological data corresponding to the power load demand response result are constructed as a training data set; Determine the architecture of the Transformer model, set model parameters, and define the loss function; Initialize model parameters and set the optimizer; Input the training data set into the Transformer model, perform forward propagation to calculate the predicted value; calculate the loss value according to the loss function; use the optimizer to update the model parameters according to the loss value; Repeat the above steps until the preset number of training rounds is reached or the loss value converges, and a trained Transformer short-term load forecasting model is obtained.
3. The method for short-term load forecasting of a power system according to claim 2, characterized in that: Determine the various electricity price differences under different probability conditions, and the power load demand response results corresponding to each electricity price difference, including: Determine the price differences of various electricity prices under different probability conditions; Based on the electricity price difference, a Tanh function is used to describe a demand response central curve; response fluctuation values under different probability conditions are determined; based on the demand response central curve and the response fluctuation values, power load demand response results under different probability conditions are calculated.
4. The method for short-term load forecasting of a power system according to claim 3, characterized in that: Based on the electricity price difference, a Tanh function is used to describe a demand response central curve; Determine the response fluctuation value under different probability conditions; Based on the demand response center curve and the response fluctuation value, the power load demand response results under different probability conditions are calculated, including: The demand response center curve is expressed as: In the formula, λ e is the response of the central curve; Δ p Difference in electricity prices; Δp δmax The price difference corresponding to the maximum fluctuation in the response area; c is the constant used to translate the curve; The response fluctuation value under different probability conditions is expressed as: In the formula, δ is the absolute value of the demand response fluctuation momentum; β is the calculation result of the fluctuation value scaling; L is the probability condition; σ is the standard deviation of the response fluctuation value; The power load demand response results under different probability conditions are expressed as: In the formula, λ eup is the specified probability condition L The upper limit of the response fluctuation under ; λ elow is the specified probability condition L The lower limit of the response fluctuation.
5. The method for short-term load forecasting of a power system according to claim 1, characterized in that: After the step of outputting the short-term load forecasting result by the Transformer short-term load forecasting model, the method further includes: The short-term load forecasting result is used to calculate the demand response regulation potential of the power system during the power demand response period.
6. The method for short-term load forecasting of a power system according to claim 5, characterized in that: Using the short-term load forecasting results, the demand response regulation potential of the power system during the power demand response period is calculated, including: Using the short-term load forecast result as the load power during the user response period; Determine the base load power; The demand response regulation potential of the power system is obtained by subtracting the load power during the user response period from the benchmark load power.
7. The method for short-term load forecasting of a power system according to claim 6, characterized in that: Determine the base load power, including: When the power demand response occurs on a working day, the benchmark load power is equal to the average historical load power at the corresponding time of the 5 working days before the power demand response day; When electricity demand response occurs on a non-working day, the benchmark load power is equal to the average historical load power of the last three non-working days before the electricity demand response day.
8. A short-term load forecasting device for a power system, characterized in that: include: A data acquisition module, used to acquire time series data for load forecasting; wherein the time series data includes historical loads, weather parameters associated with historical loads, and electricity prices within a demand response usage period; The data prediction module is used to input the time series data into a pre-trained Transformer short-term load prediction model, and the Transformer short-term load prediction model outputs a short-term load prediction result; wherein the Transformer short-term load prediction model is trained based on the power demand response fluctuation results corresponding to various electricity price differences under different probability conditions.
9. An electronic device, characterized in that: It comprises a processor and a memory, wherein the processor is used to execute a computer program stored in the memory to implement the method for short-term load forecasting of a power system as claimed in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores at least one instruction, and when the at least one instruction is executed by a processor, the method for short-term load forecasting of a power system according to any one of claims 1 to 7 is implemented.