Training method of power load prediction model, high-temperature weather power load prediction method and related products
By combining time series modeling of air conditioning power and meteorological data with the GRU model, the accuracy problem of traditional power load forecasting under high temperature weather was solved, and accurate power load forecasting under high temperature weather was achieved, improving the stability and operating efficiency of the power system.
Patent Information
- Application Number
- CN202511084421.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-04
- Publication Date
- 2025-11-21
AI Technical Summary
Traditional power load forecasting methods struggle to capture deep-seated patterns in data during periods of high temperatures, resulting in limited accuracy and an inability to adequately address power fluctuations caused by extreme weather events.
By collecting air conditioning power data and meteorological data, time series modeling is performed using the sliding window method. The power load prediction model is trained by combining the GRU deep learning model. The Huber loss function and Adam optimizer are used to design an early shutdown mechanism to improve the prediction accuracy of the model.
It enables accurate power load forecasting under high-temperature weather conditions, improves the dispatch efficiency and energy utilization efficiency of the power system, reduces operating costs, and supports the development of smart grids.
Smart Images

Figure CN120995003A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the fields of artificial intelligence and deep learning technology, and in particular to a training method for an electricity load forecasting model, a method for forecasting electricity load during high-temperature weather, and related products. Background Technology
[0002] With the intensification of global climate change, extreme weather events have brought unprecedented challenges to the stability and security of power systems. In particular, during periods of high temperatures, the surge in electricity demand from air conditioning and cooling equipment causes drastic fluctuations in power load, further complicating power system dispatching. To effectively address this challenge, accurately predicting power load during periods of high temperatures has become a crucial means of improving power system operating efficiency, ensuring energy supply security, and optimizing energy allocation.
[0003] In the past, electricity load forecasting mainly relied on traditional statistical methods, such as regression analysis and ARIMA (Autoregressive Integral Moving Average). These methods, through numerical analysis-based modeling, can effectively fit linear trends when processing historical load data. However, with the increasing complexity of electricity load data, especially in the face of nonlinear and dynamically changing factors such as high temperatures, traditional statistical methods often struggle to capture deeper patterns in the data, limiting forecast accuracy. At the same time, existing models are relatively inadequate in considering extreme weather events and fail to adequately address electricity demand fluctuations during periods of high temperatures. Summary of the Invention
[0004] The purpose of this application is to provide a training method for an electricity load forecasting model, a method for forecasting electricity load in high-temperature weather, and related products. By collecting and analyzing environmental data such as air conditioning power consumption and temperature and humidity, and combining it with a GRU deep learning model to perform time series data modeling, the electricity load under high-temperature weather conditions can be accurately predicted.
[0005] To achieve the above objectives, this application provides the following solution:
[0006] Firstly, this application provides a training method for an electricity load forecasting model, comprising:
[0007] Acquire historical data; the historical data includes: air conditioning power data and meteorological data;
[0008] Using the sliding window method, time series modeling is performed based on the air conditioning power data and the meteorological data to obtain an input sequence and a target sequence; the input sequence consists of feature data for several time steps; the target sequence is the power load value at the next moment of each time step; the feature data includes: air conditioning power data and meteorological data for each time step;
[0009] Using the input sequence as input, the target sequence as label, and the predicted power load value at the next moment of each time step as output, a gated recurrent unit model is trained to obtain a power load prediction model.
[0010] Optionally, the gated recurrent unit model specifically includes: an input layer, a GRU layer, a fully connected layer, and an activation function;
[0011] The input layer is used to acquire the input sequence;
[0012] The GRU layer includes: an update gate mechanism, a reset gate mechanism, and a candidate hidden state mechanism;
[0013] The update gate mechanism is used to control the proportion of historical information retained at the current moment;
[0014] The reset gate mechanism is used to control the impact of the previous hidden state on the current input;
[0015] The GRU layer outputs the hidden state of the last time step;
[0016] The fully connected layer is used to perform a linear transformation on the output of the GRU layer, and then process it through the activation function to obtain the output of the gated recurrent unit model.
[0017] Optionally, the loss function used when training the gated recurrent unit model is the Huber loss function, with the following formula:
[0018]
[0019] Where δ is the threshold, and y and These are the actual value and the predicted value, respectively.
[0020] Optionally, the acquisition of historical data specifically includes:
[0021] Use smart meters to obtain electricity consumption data;
[0022] Temperature and humidity data are acquired using temperature and humidity sensors.
[0023] The electricity consumption data and the temperature and humidity data are standardized in time format to obtain time-uniformed electricity consumption data and time-uniformed temperature and humidity data.
[0024] The time-unified power consumption data and the time-unified temperature and humidity data are resampled according to a preset time frequency to obtain resampled power consumption data and resampled temperature and humidity data.
[0025] The resampled power consumption data and the resampled temperature and humidity data were standardized using StandardScaler to obtain air conditioning power data and meteorological data.
[0026] Optionally, using the input sequence as input, the target sequence as label, and the predicted power load value at the next moment of each time step as output, a gated recurrent unit model is trained to obtain a power load prediction model, specifically including:
[0027] The input sequence and the target sequence are normalized respectively to obtain a normalized input sequence and a normalized target sequence;
[0028] Using the normalized input sequence as input, the normalized target sequence as label, and the predicted power load value at the next moment of each time step as output, a gated recurrent unit model is trained to obtain a power load prediction model.
[0029] Optionally, when training the gated recurrent unit model:
[0030] In each round of training, the validation loss is calculated based on the loss function; when the validation loss decreases, the model parameters are updated; otherwise, the early stopping mechanism is triggered to end the training.
[0031] Secondly, this application provides a method for predicting electricity load during high-temperature weather, including:
[0032] Obtain the sequence to be predicted; the sequence to be predicted includes: current air conditioning power data and meteorological data;
[0033] The sequence to be predicted is input into the power load prediction model to obtain the predicted power load value at the next time step; the power load prediction model is trained by the training method of the power load prediction model according to any one of claims 1-6.
[0034] Thirdly, this application provides a computer device, including: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the training method for the power load forecasting model or the high-temperature weather power load forecasting method described in any one of the above descriptions.
[0035] Fourthly, this application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the training method for the power load forecasting model described above or the power load forecasting method for high-temperature weather as described above.
[0036] Fifthly, this application provides a computer program product, including a computer program that, when executed by a processor, implements the training method for the power load forecasting model described above or the power load forecasting method for high-temperature weather.
[0037] According to the specific embodiments provided in this application, the following technical effects are disclosed:
[0038] This application provides a training method for an electricity load forecasting model, a method for forecasting electricity load in high-temperature weather, and related products. The training method for the electricity load forecasting model includes: acquiring historical data; the historical data includes air conditioning power data and meteorological data; using the sliding window method, performing time series modeling based on the air conditioning power data and the meteorological data to obtain an input sequence and a target sequence; the input sequence consists of feature data for several time steps; the target sequence is the electricity load value at the next moment of each time step; the feature data includes air conditioning power data and meteorological data at each time step; using the input sequence as input, the target sequence as a label, and the predicted electricity load value at the next moment of each time step as output, a gated recurrent unit model is trained to obtain the electricity load forecasting model. This application comprehensively considers the influencing factors of electricity load under high-temperature weather by collecting and analyzing environmental data such as air conditioning power consumption, temperature, and humidity, and then combines it with a GRU deep learning model for time series data modeling, utilizing the powerful memory capability of the GRU model in time series data to accurately predict electricity load under high-temperature weather conditions. Attached Figure Description
[0039] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0040] Figure 1 This is a diagram illustrating the training method for a power load forecasting model and the application environment of a power load forecasting method for high-temperature weather, as described in one embodiment of this application.
[0041] Figure 2 This is a flowchart illustrating a training method for an electricity load prediction model provided in one embodiment of this application.
[0042] Figure 3 This is a prediction error distribution diagram provided for an embodiment of this application.
[0043] Figure 4 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. Detailed Implementation
[0044] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0045] This application combines power load data and meteorological data under high-temperature weather conditions with a GRU model to perform efficient and accurate power load forecasting. The aim is to improve the accuracy of power load forecasting under high-temperature weather conditions, provide support for power system dispatching and optimization, and help power companies cope with the risks brought by extreme weather.
[0046] This application applies the GRU method to power load forecasting during high-temperature weather. By leveraging its powerful time-series data modeling capabilities and combining it with intelligent data processing and analysis methods, it provides a more accurate forecasting tool for the power system, thereby promoting the development of smart grids, improving energy efficiency, reducing the operating costs of the power system, and driving the sustainable development of the energy industry.
[0047] To make the above-mentioned objectives, features and advantages of this application more apparent and understandable, the application will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0048] The power load forecasting model training method and the high-temperature weather power load forecasting method provided in this application can be applied to, for example... Figure 1 In the application environment shown, terminal 102 communicates with server 104 via a network. A data storage system can store the data that server 104 needs to process. The data storage system can be set up independently, integrated into server 104, or placed in the cloud or on another server.
[0049] The terminal 102 can be, but is not limited to, various desktop computers, laptops, smartphones, tablets, IoT devices, and portable wearable devices. IoT devices can include smart speakers, smart TVs, smart air conditioners, and smart in-vehicle devices. Portable wearable devices can include smartwatches, smart bracelets, and head-mounted devices. The server 104 can be implemented using a standalone server or a server cluster composed of multiple servers, or it can be a cloud server.
[0050] In one exemplary embodiment, such as Figure 2 As shown, a training method for a power load forecasting model is provided. This method is executed by a computer device, specifically by a terminal or server alone, or by both a terminal and a server. In this embodiment, the method is applied to... Figure 1Taking server 104 as an example, the explanation includes the following steps S1 to S3. Wherein:
[0051] S1. Obtain historical data; the historical data includes: air conditioning power data and meteorological data.
[0052] Data collection and preprocessing are crucial steps in high-temperature weather power load forecasting models, directly impacting model training effectiveness and prediction accuracy. This embodiment ensures the quality of input data and the stability of the model through multiple steps, including precise data cleaning, missing value imputation, feature selection, and transformation.
[0053] In this embodiment, the data sources include multiple sensors and monitoring devices, primarily comprising air conditioning power data and meteorological data. Air conditioning power data is collected via smart meters, and the raw data includes phase A voltage (V), phase A current (A), phase A active power (W), phase A apparent power (W), phase A maximum power (W), phase A reactive power (W), phase A single-waveform active power array, phase B single-waveform active power array, and phase C single-waveform active power array. Meteorological data is collected via temperature and humidity sensors, including temperature and humidity. By integrating the air conditioning power data and meteorological data, a time-series prediction model is trained to predict power load during hot summer weather.
[0054] Air Conditioner Power Data: Air conditioner power data is recorded every minute by the data acquisition device. The data includes detailed information about the device's operating status, such as voltage and current. The data is stored in CSV file format and includes a timestamp field to identify the acquisition time of each record.
[0055] Meteorological data: Temperature and humidity data are provided by meteorological stations or environmental monitoring equipment, and the data storage format and timestamps are the same as those for electricity data. By integrating temperature and humidity data with electricity data, the impact of meteorological factors on electricity load can be analyzed more comprehensively.
[0056] Data storage format: All data is stored in CSV file format and includes timestamps (reporting time / date) as indexes to ensure that data can be processed in chronological order.
[0057] Data preprocessing is a crucial step in ensuring the accuracy and stability of model training. Since raw data often contains missing values, outliers, redundant data, and inconsistent formats, detailed data cleaning and transformation are necessary. The following are the steps involved in data preprocessing:
[0058] Data Import and Merging: First, the Excel file is converted to a CSV file using excel_to_csv for easier subsequent processing. Specific steps include reading air conditioning power data and meteorological data, formatting them, and then performing a left join and merging of the power and meteorological data based on timestamps to ensure that each power data record corresponds to temperature information.
[0059] Missing Value Handling: In actual engineering data acquisition, due to factors such as sensor failure, data transmission interruption, or storage anomalies, the acquired monitoring data often contains missing values. To ensure the integrity and reliability of data analysis, this embodiment proposes a systematic imputation scheme for the missing data problem: First, based on the principle of temporal proximity, valid observations within 5 minutes before and after the missing time are retrieved from the raw data acquired by sensors and detection equipment for imputation; when data from adjacent time periods is unavailable, time series analysis methods are used to establish a predictive model based on the temporal characteristics of historical data for reasonable imputation.
[0060] Outlier Handling: Outliers are values that deviate significantly from the majority of the data, possibly due to equipment malfunction or measurement errors. When processing power load data, a strategy is employed to convert negative values to positive values (using an absolute value function) and retain two decimal places to ensure the reasonableness of the values. This step effectively avoids calculation errors caused by negative values and ensures that the data conforms to actual physical conditions.
[0061] Time format unification and frequency adjustment: Since the timestamp format in the original data may be inconsistent, errors or mismatches may occur during data merging. The parse_time function is used to unify the time format and resample the data according to a specified time frequency (e.g., every minute). By grouping the data by minute, the temporal sequence of the data is ensured, enabling the model to capture more granular changes.
[0062] Feature normalization: StandardScaler is used to standardize the data, eliminating the differences in the units of different features and ensuring that each feature is trained on the same scale. This helps improve the stability and convergence speed of model training. The standardization formula is as follows:
[0063]
[0064] Where X is the original value of the feature data, μ is the mean of the feature data, and σ is the standard deviation of the feature data. The standardized data has a mean of 0 and a standard deviation of 1. This processing unifies the weights of each feature data, avoiding unnecessary impact on model training caused by some features having excessively large or small numerical ranges.
[0065] Data cleaning and storage: The results of data cleaning will be saved as a new CSV file to ensure that the original data is not contaminated, which facilitates subsequent analysis and model training. The cleaned data provides a reliable foundation for subsequent feature engineering and modeling.
[0066] S2. Using the sliding window method, time series modeling is performed based on the air conditioning power data and the meteorological data to obtain an input sequence and a target sequence; the input sequence consists of feature data for several time steps; the target sequence is the power load value at the next moment of each time step; the feature data includes: air conditioning power data and meteorological data for each time step.
[0067] Time series modeling is a crucial step in power load forecasting. Its core objective is to capture the dynamic patterns of power load changes over time by establishing a reasonable data sequence. This embodiment constructs a time series model that reflects time dependencies based on power load data (air conditioning power data) and meteorological data during high-temperature weather. The specific implementation process is as follows.
[0068] In time series modeling, the raw data first needs to be divided into appropriate input and target sequences so that the deep learning model can predict future power load values by observing data from several previous time points. This embodiment uses the sliding window method to generate time series data for the training and test sets.
[0069] Let the input data be X = {x1, x2, ..., x...} T The target data is Y = {y1, y2, ..., y}. T The window length is ω. The formula for constructing sequence data is as follows:
[0070] Input sequence: X i ={x i ,x i+1 ,…,x i+ω-1}, i∈{1,2,…,T-ω+1};
[0071] Target sequence: Y I =x i+ω , i∈{1,2,…,T-ω+1};
[0072] Each input sequence X i The target sequence Y contains feature data at ω time steps. I The target sequence is the power load value for the next time step. By constructing the time series in this way, the temporal dependencies of the data can be captured during model training. Each time step of the input sequence will contain air conditioning power data, meteorological data, and other relevant features, while the target sequence only corresponds to the predicted value of the power load. The target sequence contains the power load value at a certain time in the future or the load values at multiple consecutive time steps (multi-step prediction).
[0073] After constructing the time series, this embodiment further divides the data into training, validation, and test sets. First, all data is randomly partitioned into training and test sets, with a ratio of 80% and 20%, respectively. Then, a portion of the training set is allocated as a validation set for real-time performance evaluation of the model during training. After data partitioning, the training and test sets are represented as follows: Training set: (X... train ,Y train Test set: (X) test ,Y test ).
[0074] To eliminate dimensional differences between features and improve model convergence speed, the input data is normalized. The normalization formula is:
[0075]
[0076] Where X is the original value of the feature data, min(x) is the minimum value of the feature data, and max(x) is the maximum value of the feature data.
[0077] For features where data distribution needs to be standardized in certain situations, a standardization formula is used.
[0078] After constructing and normalizing the time series data, the data is loaded into the data loader to support batch processing. The data loader can effectively improve the training efficiency of the model and prevent overfitting by randomly shuffling the order of the samples. Here, PyTorch's DataLoader is used to implement this function.
[0079] S3. Using the input sequence as input, the target sequence as label, and the predicted power load value at the next moment of each time step as output, train the gated recurrent unit model to obtain the power load prediction model.
[0080] The Gated Recurrent Unit (GRU) is a classic time series processing model. By introducing a gating mechanism, it solves the gradient vanishing problem that traditional Recurrent Neural Networks (RNNs) often encounter in processing long-sequence data. Furthermore, compared to Long Short-Term Memory (LSTM) networks, the GRU structure is simpler and requires less computation, exhibiting comparable or even superior performance to LSTM in many scenarios. This embodiment uses the GRU model as the core component for high-temperature weather power load forecasting. Through targeted design and training optimization, a highly efficient time series forecasting model is constructed.
[0081] The design and training of GRU includes three main aspects: the basic principles of the model, the specific design scheme, and the training optimization process.
[0082] The core of the GRU model lies in its gating mechanism, which captures long-term dependencies in time-series data by controlling the retention and forgetting of hidden state information. Input x t and hidden state h t-1 The values are passed to the update gate, reset gate, and candidate hidden state module respectively, and finally a new hidden state h is generated through weighted calculation. t This structural design ensures that GRU can efficiently handle dependencies in long-running sequences.
[0083] Compared to LSTM, GRU combines the input gate and forget gate into a single gate, greatly simplifying the network structure while maintaining excellent memory capabilities. GRU uses an update gate and a reset gate to control the degree of hidden state updates and the retention of historical information, respectively. The calculation formula is as follows:
[0084] z t =σ(W z x t +U z h t-1 +b z );
[0085] r t =σ(W r x t +U r h t-1 +b r );
[0086] Where: z t This indicates the update gate, which controls the retention of historical information; r t This indicates resetting the gate, controlling the impact of the previous hidden state on the current time information; t represents the current time step; W z Indicates the use of gate z for updating t The weight matrix, W r Indicates the use of resetting gate r t The weight matrix is connected to the input x at the current time step. t And perform a linear transformation to combine it with information from the previous hidden state; U z Indicates the use of gate z for updating t The weight matrix, U r Indicates the use of resetting gate r t The weight matrix is connected to the hidden state h from the previous time step. t-1 And perform a linear transformation to combine it with the current input information; b z To update gate zt The bias vector, b r The bias vector for resetting the gate adds an offset to the linear transformation, increasing the flexibility of the model; σ represents the Sigmoid activation function, which is used to compress the output value to the range [0,1].
[0087] Candidate hidden state This is an intermediate state generated based on the current input and the previous hidden state, under the effect of the reset gate:
[0088]
[0089] Among them, W h and U h It is used for candidate hidden states The weight matrix, W h Connect the output x of the current time step t U h Connect to the hidden state h from the previous time step t-1 b h Candidate hidden state The bias vector; This indicates element-wise multiplication. tanh is the hyperbolic tangent activation function, which compresses values to the range [-1, 1].
[0090] Finally, the hidden state h t It is done by updating the door to the previous hidden state h. t-1 and candidate hidden state The weighted sum is obtained as follows:
[0091]
[0092] Update Gate Z t This determines how much historical information should be retained and how much new information should be introduced in the current hidden state.
[0093] Using the four formulas above, GRU can effectively handle dependencies spanning long periods in time series tasks, preventing premature forgetting of information.
[0094] In this embodiment, the design of the GRU model fully incorporates the characteristics of power load forecasting under high-temperature weather conditions, specifically including the design of the input layer, GRU layer, fully connected layer, and activation function.
[0095] First, the input layer receives the time-series modeled data. Each time step contains multiple features (such as voltage, temperature, and humidity), and the input shape is (batch size, time step, number of features). The GRU layer extracts the temporal dependencies through the aforementioned gating mechanism, and the hidden layer dimensions are adjusted experimentally to ensure the model has sufficient expressive power.
[0096] The input data is first modeled using time series analysis. A sliding window method is used to divide the original data into multiple subsequences, each containing ω consecutive time steps. In the input layer, the data has a shape of (B, ω, F), where B represents the batch size, ω is the window length (i.e., the number of time steps), and F is the number of features at each time step, including air conditioning power data and meteorological data. Each input sequence X... i Represented as {x i ,x i+1 ,…,x i+ω-1}, where each x t The feature vector corresponding to a time step has a dimension of F.
[0097] Subsequently, the GRU layer processes the input sequence step by step through mechanisms such as update gates, reset gates, and candidate hidden states to capture the dynamic dependencies in the time series. Specifically, the update gate z... t This determines the proportion of historical information retained at the current moment, and the reset gate r t The influence of the previous hidden state on the current input is controlled. Through these two gates, GRU can effectively handle long-term dependency problems. Finally, the GRU layer outputs the hidden state h of the last time step. ω The shape is (B,H), where H is the dimension of the hidden layer.
[0098] Finally, the output of the GRU layer undergoes a linear transformation through a fully connected layer, resulting in a single predicted power load value. The output of the fully connected layer then passes through the PReLU (Parametric ReLU) activation function to introduce nonlinearity and ensure the output value remains within a reasonable range, yielding the final predicted load value with a shape of (B,1). The formula for PReLU is:
[0099]
[0100] Where v represents the input value and a is the learnable parameter.
[0101] This design ensures the model's flexibility and efficiency, enabling it to adapt to diverse power load data.
[0102] To improve the model's prediction accuracy and generalization ability, this embodiment employs several optimization strategies during training, including the selection of the loss function, the design of the optimizer, learning rate scheduling, and an early stopping mechanism.
[0103] This embodiment uses the Huber loss function, which is more robust in handling outliers. The definition of Huber loss is:
[0104]
[0105] Where δ is the threshold, and y and These are the actual value and the predicted value, respectively.
[0106] The model training uses the Adam optimizer, which improves the efficiency of parameter updates by adaptively adjusting the learning rate. Combined with the ReduceLROnPlateau scheduler, the learning rate is automatically reduced when the validation set loss does not decrease, accelerating model convergence.
[0107] To prevent overfitting, an early stopping mechanism is introduced during training. Training stops and the optimal model parameters are saved when the validation set loss no longer decreases over several epochs. In each training epoch, the model iterates through all training data and updates its parameters, while simultaneously calculating the loss on the validation set to evaluate model performance. When the validation loss decreases, the optimal model parameters are updated; otherwise, the early stopping mechanism is triggered to terminate training.
[0108] Through the above design and training optimization, this embodiment uses the GRU model to efficiently capture the time dependence of power load under high temperature weather, providing accurate prediction results for power system scheduling and optimization.
[0109] In time series modeling, the input, output, and label definitions during model training and application phases must be closely integrated with the task objectives. The input during training consists of historical time series data generated by a sliding window. Each sample contains multi-dimensional features within a fixed-length time window, typically covering air conditioning power data, meteorological data, and temporal features. These features are aligned by time steps, forming a tensor of shape (N,T,D), where N is the total number of samples, T is the time window length, and D is the feature dimension. The label represents the corresponding true value of future power load: for single-step prediction, the label is the load value at the next moment (shape (N,1)); for multi-step prediction, it is the load sequence at K consecutive future moments (shape (N,K)). The model output is the predicted value for the label, and during training, a loss function continuously narrows the gap between the predicted and true values.
[0110] Key metrics for model evaluation include the Huber loss function and the accuracy of the prediction results. These metrics reflect the model's predictive ability from different dimensions, and low error and high accuracy are particularly important in scenarios involving power load forecasting during high-temperature weather. Performance comparisons on the validation and test sets can provide a preliminary assessment of the model's generalization ability.
[0111] To improve the model's prediction accuracy, this embodiment employs the following optimization strategies: A ReduceLROnPlateau method is introduced to dynamically adjust the learning rate. When the validation set loss no longer decreases during training, the learning rate is reduced to avoid the model getting trapped in local optima. Data augmentation is performed by normalizing and perturbing the training data to improve the model's adaptability to different data distributions. Regularization techniques are used, and Dropout is added to the GRU layer to effectively prevent overfitting. These optimization methods significantly improve the model's robustness and generalization performance, laying the foundation for future model applications.
[0112] This embodiment can effectively solve the accuracy problem of traditional forecasting methods under high temperature weather, improve forecast accuracy, optimize power system dispatch, reduce energy waste, improve the stability and operating efficiency of the power system, and provide support for the construction of smart grids.
[0113] Based on the same inventive concept, this application also provides a method for predicting power load during high-temperature weather, including the following steps:
[0114] Obtain the sequence to be predicted; the sequence to be predicted includes: current air conditioning power data and meteorological data.
[0115] The sequence to be predicted is input into the power load prediction model to obtain the predicted power load value at the next time step; the power load prediction model is trained by the power load prediction model training method described above.
[0116] Specifically, in practical applications, the model's input is the feature sequence of the previous T time steps (e.g., the latest 24-hour data), whose content is consistent with the training data, but contains only historical information and no future data. The input shape is (1,T,D) (single prediction) or (M,T,D) (batch prediction). The output is the model's prediction of future load: single-step prediction outputs the load value at the next time step (shape (1,1)(1,1)), and multi-step prediction outputs the sequence at the next K time steps (shape (1,K)). At this stage, no labels are involved, and the prediction results need to be subsequently validated using actual observations.
[0117] The core difference between training and application lies in the following: during training, both the input and labels are historically known data, and the goal is to learn the mapping relationship from historical features to future loads; while during application, the input is real-time or the latest historical data, and the output is an unknown future forecast. Furthermore, the rationality of feature design (such as the correlation between meteorological data and load) and the selection of time windows (such as 24-hour cycle alignment) directly affect model performance. If deviations occur in practical applications, optimizations need to be made in areas such as feature alignment, window length optimization, or model structure improvement to enhance prediction accuracy and generalization ability.
[0118] To further understand the model's prediction performance, this embodiment generates a prediction error distribution map, such as... Figure 3 As shown, the diagram visually illustrates the correspondence between predicted and actual values, aiding in the analysis of model prediction bias. In the figure, dark gray dots represent the correspondence between all predicted and actual values, their positions determined by the actual value (x-axis) and the predicted value (y-axis). Light gray dots represent correct predictions within an acceptable range; these points fall near the 45-degree dashed line, indicating relatively accurate predictions on these data points. The 45-degree dashed line is an important reference line for evaluating model prediction performance, representing the ideal scenario where the actual and predicted values are perfectly aligned. The solid line represents the fit between the actual and predicted values in real-world conditions. The diagram shows that most predicted points are distributed around the 45-degree dashed line, indicating relatively accurate predictions on mainstream data samples; however, some bias is unavoidable in predicting outliers.
[0119] After completing the model design and optimization, it needs to be applied to real-world business scenarios and deployed to the production environment. The core objective of the high-temperature weather power load forecasting model is to provide real-time decision support for power dispatching. Therefore, the main deployment process includes environment setup, interface development, user interaction design, and continuous optimization. Through a scientific and reasonable deployment strategy, the model's effectiveness can be fully utilized, providing stable and accurate forecasting services for power dispatching.
[0120] First, the model's deployment environment utilizes mainstream cloud computing platforms (such as Azure or AWS) and incorporates Docker containerization technology to ensure high consistency and flexibility. Containerization effectively avoids issues caused by inconsistencies between traditional development and production environments, while also facilitating rapid expansion. Within the container, the system employs Python as the core development tool and utilizes the Flask framework to develop a RESTful API interface, enabling the model's predictive capabilities to provide external services. Through API calls, users only need to input future weather data (such as temperature and humidity) to obtain real-time power load forecasts, ensuring the model's simplicity and efficiency in practical use.
[0121] In terms of user interaction design, a complete user interface module was developed to enhance the system's usability. The user interface mainly comprises three core parts: data input, model configuration, and results display. The data input interface is designed to be simple and intuitive, supporting users to import meteorological data through manual input or file upload, further lowering the operational threshold for users. In the model configuration interface, the system allows users to select model parameters according to specific needs, providing flexible customization capabilities. In the results display module, intuitive charts dynamically present the comparison between predicted results and actual data, facilitating users' quick understanding of the predicted data.
[0122] In addition to its core prediction capabilities, the system prioritizes performance and security during deployment. For performance optimization, a learning rate adjustment strategy based on the ReduceLROnPlateau algorithm allows the model to dynamically adjust its optimization direction, further improving prediction accuracy. At the system operation level, the scalability of the cloud platform allows for flexible increases in computing resources to meet the demands of high-load conditions. Furthermore, in its security design, HTTPS protocol is used to encrypt data transmission, ensuring the security of user privacy data over the network. To further enhance access management capabilities, the system implements Role-Based Access Control (RBAC), effectively restricting unauthorized user access to the system.
[0123] After deployment, the system establishes a complete load forecasting closed loop through data flow and interface linkage. Real-time meteorological data is transmitted to the forecasting model via the interface, and the model outputs results which are then sent back to the user interface for direct use in power dispatching. This closed-loop mechanism ensures fully automated processing capabilities from data acquisition to forecast result publication. During the continuous optimization phase, the system performs regular performance evaluations of the model based on historical data and automatically adjusts model parameters according to the evaluation results, ensuring high forecasting accuracy under different environments.
[0124] In the overall deployment architecture, the backend uses the Flask framework for API service development, while MySQL is used to manage structured data such as user information and model configurations. The frontend utilizes the Vue.js technology stack to build a dynamically responsive user interface, further enhancing the user experience. Furthermore, to handle potentially high concurrency, the system implements load balancing on a cloud platform, effectively distributing system load through a distributed service architecture.
[0125] Finally, based on the above design and deployment, the entire system has the capability to handle the entire process from data acquisition and model prediction to result display, while also taking into account performance, security, and user experience. As a core tool for forecasting power load during high-temperature weather, the practical application of this system will effectively support intelligent decision-making in power dispatching and provide important technical support for ensuring the reliability of power grid operation.
[0126] Overall, this application addresses the problem of power load forecasting under high-temperature weather by proposing an intelligent power load forecasting method based on a gated cyclic unit (GRU) deep learning model. This method collects and analyzes environmental data such as air conditioning power consumption, temperature, and humidity, and combines this with a GRU deep learning model to perform time-series data modeling, accurately predicting power load under high-temperature conditions. This method not only effectively solves the problem of low accuracy in traditional power load forecasting methods under high-temperature weather but also provides reliable decision support for power system scheduling and management. It can be summarized as follows:
[0127] Step (1) Data collection and preprocessing: Collect power load data and meteorological data under high temperature weather, perform data cleaning, missing value processing and outlier detection to ensure the accuracy and integrity of the data.
[0128] Step (2), Feature selection and transformation: The most critical features for power load forecasting are identified through feature selection methods, and then standardized and normalized to eliminate dimensional differences and improve the prediction accuracy of the model.
[0129] Step (3) GRU model design and training: The GRU model is used to predict the power load in time series. The training set data is used to learn the load change pattern. The PReLU activation function and Huber loss function are combined to improve the robustness and predictive ability of the model.
[0130] Step (4) Model evaluation and optimization: The model performance is evaluated through methods such as cross-validation, and hyperparameter tuning techniques are used to improve the model's accuracy and generalization ability.
[0131] Step (5), Model Application and Deployment: Integrate the trained GRU model into the power load management system to realize real-time power load prediction and intelligent scheduling under high temperature weather.
[0132] In one exemplary embodiment, a computer device is provided, which may be a server or a terminal, and its internal structure diagram may be as follows. Figure 4As shown, this computer device includes a processor, memory, input / output (I / O) interfaces, and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and databases. The internal memory provides the environment for the operating system and computer programs stored in the non-volatile storage media to run. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communicating with external terminals via a network connection. When the computer program is executed by the processor, it implements a training method for a power load forecasting model or a method for forecasting power load during high-temperature weather.
[0133] Those skilled in the art will understand that Figure 4 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0134] In one exemplary embodiment, a computer device is also provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above-described method embodiments.
[0135] In one exemplary embodiment, a computer-readable storage medium is provided storing a computer program that, when executed by a processor, implements the steps in the above-described method embodiments.
[0136] In one exemplary embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above-described method embodiments.
[0137] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data must comply with relevant regulations.
[0138] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM).
[0139] The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.
[0140] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0141] This document uses specific examples to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the methods and core ideas of this application. Furthermore, those skilled in the art will recognize that, based on the ideas of this application, there will be changes in the specific implementation methods and application scope. Therefore, the content of this specification should not be construed as a limitation of this application.
Claims
1. A method for training an electric power load prediction model, characterized by, The method comprises the following steps: obtaining historical data; the historical data comprises air conditioner power data and meteorological data; using a sliding window method, time series modeling is performed according to the air conditioner power data and the meteorological data to obtain an input sequence and a target sequence; the input sequence is feature data of several time steps; the target sequence is the power load value of the next moment of each time step; the feature data comprises air conditioner power data and meteorological data of each time step; training a gated recurrent unit model by taking the input sequence as input, the target sequence as label, and the predicted power load value of the next moment of each time step as output to obtain a power load prediction model. 2.The method of claim 1, wherein, The gated recurrent unit model comprises an input layer, a GRU layer, a full connection layer and an activation function. The input layer is used to obtain the input sequence. The GRU layer comprises an update gate mechanism, a reset gate mechanism and a candidate hidden state mechanism. The update gate mechanism is used to control the retention proportion of historical information at the current moment. The reset gate mechanism is used to control the influence of the previous hidden state on the current input. The GRU layer outputs the hidden state of the last time step. The full connection layer is used to perform linear transformation on the output of the GRU layer, and then the output is processed through the activation function to obtain the output of the gated recurrent unit model. 3.The method of claim 1, wherein, The loss function for training the gated recurrent unit model is a Huber loss function, and the formula is: wherein δ is a threshold value, y and are actual and predicted values, respectively. 4.The method of claim 1, wherein, The method for obtaining historical data comprises the following steps: obtaining air conditioner power consumption data by using a smart meter; obtaining temperature and humidity data by using a temperature and humidity sensor; performing time format unification on the air conditioner power consumption data and the temperature and humidity data to obtain time-unified power consumption data and time-unified temperature and humidity data; resampling the time-unified power consumption data and the time-unified temperature and humidity data according to a preset time frequency to obtain resampled power consumption data and resampled temperature and humidity data; performing standardization processing on the resampled power consumption data and the resampled temperature and humidity data by using a StandardScaler to obtain air conditioner power data and meteorological data. 5.The method of claim 1, wherein, The method for training the gated recurrent unit model by taking the input sequence as input, the target sequence as label, and the predicted power load value of the next moment of each time step as output to obtain a power load prediction model comprises the following steps: performing normalization processing on the input sequence and the target sequence respectively to obtain a normalized input sequence and a normalized target sequence; training the gated recurrent unit model by taking the normalized input sequence as input, the normalized target sequence as label, and the predicted power load value of the next moment of each time step as output to obtain a power load prediction model. 6.The method of claim 1, wherein, During the training of the gated recurrent unit model: in each round of training, the validation loss is calculated according to the loss function; when the validation loss decreases, the model parameters are updated, otherwise the early stopping mechanism is triggered to end the training.
7. A high-temperature weather power load prediction method characterized by, The method comprises the following steps: obtaining a to-be-predicted sequence; the to-be-predicted sequence comprises air conditioner power data and meteorological data of the current moment; inputting the to-be-predicted sequence into the power load prediction model to obtain a predicted power load value at a next time; the power load prediction model is trained by the training method of the power load prediction model according to any one of claims 1-6.
8. A computer device comprising: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the training method of the power load prediction model according to any one of claims 1-6 or the high-temperature weather power load prediction method according to claim 7.
9. A computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to implement the training method of the power load prediction model according to any one of claims 1-6 or the high-temperature weather power load prediction method according to claim 7.
10. A computer program product comprising a computer program, characterized in that, The computer program is executed by the processor to implement the training method of the power load prediction model according to any one of claims 1-6 or the high-temperature weather power load prediction method according to claim 7. The computer program is executed by the processor to implement the training method of the power load prediction model according to any one of claims 1-6 or the high-temperature weather power load prediction method according to claim 7.
Citation Information
Patent Citations
Electrical load prediction method based on multivariate meteorological characteristic indexes and combinatorial optimization model
CN119377878A
Electric power prediction method and device of electric power system, medium and equipment
CN119674954A
Power load prediction method and device, electronic equipment and computer readable storage medium
CN120127631A