Load prediction method and device for power system, equipment, storage medium and program product
Through deep learning methods, especially the load prediction model using the multi-head self-attention layer, the problem that traditional methods are difficult to deal with complex power system data is solved, and higher load prediction accuracy is achieved.
Patent Information
- Application Number
- CN202411625545.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-14
- Publication Date
- 2025-02-25
AI Technical Summary
Traditional load prediction methods are difficult to effectively process complex, nonlinear, high-dimensional and dynamically changing data in power systems, resulting in insufficient prediction accuracy.
Using deep learning methods, especially load prediction models including the multi-head self-attention layer, we use the self-attention mechanism and the multi-head attention mechanism to capture the interaction of time-dependent relationships and multiple complex features by acquiring and preprocessing multiple load-related data.
Improves the accuracy of power system load prediction, enables better understanding and processing of complex data, and captures the complex interactions between nonlinear characteristics and influencing factors.
Smart Images

Figure CN119518738A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of power system and energy management, and in particular to a method, device, computer equipment, computer-readable storage medium and computer program product for load forecasting of a power system. Background Art
[0002] In the field of power system and energy management, load forecasting is a core task and its importance is self-evident. The accuracy of load forecasting has a decisive impact on the operating efficiency of the power grid, the rational allocation of energy, and the normal operation of the power market. With the development of smart grids and the increasing popularity of renewable energy, the complexity of load forecasting has also increased. In this context, traditional load forecasting methods, such as statistical regression models and time series analysis, although they perform well when historical data is relatively stable and linear, have obvious limitations when dealing with the nonlinear, high-dimensional and dynamically changing characteristics of current power grid data.
[0003] Traditional load forecasting methods are usually based on simplified assumptions, such as linear relationships and fixed historical patterns. However, modern power systems are characterized by being highly dynamic and complex, and their power characteristics are affected by a variety of factors, such as changing consumer behavior, fluctuating weather conditions, unstable input of renewable energy, and changes in policies and markets. These factors make the power load significantly nonlinear and unpredictable, and traditional methods have difficulty capturing these complex dynamic relationships. In addition, load forecasting requires comprehensive consideration of multiple factors, and the dimensions of power system data are gradually increasing. The fusion of multi-dimensional data places high demands on the processing capabilities of the model, and traditional methods usually find it difficult to effectively integrate and analyze these multi-dimensional data.
[0004] With the advancement of technology, the data acquisition and processing capabilities of power systems have been greatly improved, generating a large amount of real-time or near-real-time data. These data provide new opportunities for load forecasting, but also bring new challenges to data processing and analysis, such as the storage, processing and real-time analysis capabilities of big data. Traditional load forecasting methods are often inefficient when processing large-scale, high-frequency data, making it difficult to achieve real-time or near-real-time load forecasting. Therefore, in order to more accurately predict power load, new methods and technologies need to be developed. Summary of the invention
[0005] Based on this, it is necessary to provide a load forecasting method, device, computer equipment, computer readable storage medium and computer program product for a power system in response to the above technical problems, which can improve the accuracy of load forecasting for the power system.
[0006] In a first aspect, the present application provides a load forecasting method for a power system, comprising:
[0007] Obtain multiple load-related data of the power system within a set time period;
[0008] Preprocess multiple load-related data separately to obtain multiple feature codes;
[0009] Load the trained load forecasting model and obtain the key time information corresponding to multiple load-related data; the load forecasting model includes at least a multi-head self-attention layer;
[0010] The feature code is input into the load forecasting model to obtain the power load forecast value output by the load forecasting model; wherein, during the operation of the load forecasting model, the multi-head self-attention layer adjusts the self-attention weight corresponding to each input feature based on the key time information; the input feature refers to the feature input to the multi-head self-attention layer.
[0011] In one embodiment, the method further comprises:
[0012] Collect training samples and load value labels of the power system in the historical time period;
[0013] Preprocess the training samples to obtain sample codes;
[0014] Input the sample code into the load forecasting model to obtain the training forecast value;
[0015] Calculate the loss function value corresponding to the training prediction value and the load value label;
[0016] When the loss function value is greater than the set threshold, the model parameters of the load forecasting model are adjusted, and the load forecasting model is continuously iterated and trained until the calculated loss function value is less than or equal to the set threshold, thereby obtaining a trained load forecasting model.
[0017] In one embodiment, the plurality of load-related data includes geographic location data, production process data, electricity consumption behavior data, external electrical data and environmental data; each load-related data is arranged in chronological order.
[0018] In one embodiment, multiple load-related data are preprocessed respectively to obtain multiple feature codes, including:
[0019] Use one-hot encoding or label encoding to represent different geographic areas in the geographic location data to obtain geographic location codes;
[0020] Classify each production process in the production process data according to the energy consumption characteristics, and encode each production process according to the classification result to obtain the production process code;
[0021] Encoding each electricity usage behavior according to the category of the electricity usage behavior data to obtain an electricity usage behavior code;
[0022] Normalizing or standardizing the values of external electrical data to obtain electrical parameter coding;
[0023] The numerical values of the environmental data are normalized or standardized to obtain the environmental parameter code.
[0024] In one embodiment, the load forecasting model includes an encoding layer, a multi-head self-attention layer, a gated recurrent network layer, a feature fusion layer, and a prediction output layer; wherein:
[0025] The encoding layer is used to compile multiple feature codes respectively and output the first feature;
[0026] A multi-head self-attention layer, used to adjust the self-attention weight corresponding to the first feature based on the key time information, and convert the first feature into a first intermediate feature based on the self-attention weight;
[0027] A gated recurrent network layer for selecting the second intermediate features that are most important for load forecasting from the first features;
[0028] A feature fusion layer is used to fuse the first intermediate feature and the second intermediate feature to obtain the target feature;
[0029] The prediction output layer is used to make predictions based on target features and output power load prediction values.
[0030] In one embodiment, after inputting the feature code into the load prediction model to obtain the power load prediction value output by the load prediction model, the method further includes:
[0031] According to the power load forecast value and the power load monitoring value, the output performance of the load forecast model is evaluated to obtain an evaluation result;
[0032] According to the evaluation results, the model parameters of the load forecasting model are adjusted.
[0033] In a second aspect, the present application also provides a load forecasting device for a power system, comprising:
[0034] An acquisition module is used to acquire multiple load-related data of the power system within a set time period;
[0035] A preprocessing module is used to preprocess multiple load-related data to obtain multiple feature codes;
[0036] A loading module is used to load the trained load forecasting model and obtain key time information corresponding to multiple load-related data; the load forecasting model includes at least a multi-head self-attention layer;
[0037] The prediction module is used to input the feature code into the load prediction model to obtain the power load prediction value output by the load prediction model; wherein, during the operation of the load prediction model, the multi-head self-attention layer adjusts the self-attention weight corresponding to each input feature based on the key time information; the input feature refers to the feature input to the multi-head self-attention layer.
[0038] In a third aspect, the present application further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the steps of the method described in the first aspect above are implemented.
[0039] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of the method described in the first aspect above are implemented.
[0040] In a fifth aspect, the present application further provides a computer program product, comprising a computer program, which, when executed by a processor, implements the steps of the method described in the first aspect above.
[0041] The load forecasting method, device, computer equipment, computer readable storage medium and computer program product of the above-mentioned power system obtain multiple load-related data of the power system within a set time period; pre-process the multiple load-related data respectively to obtain multiple feature codes; load the trained load forecasting model and obtain the key time information corresponding to the multiple load-related data; the load forecasting model includes at least a multi-head self-attention layer; input the feature code into the load forecasting model to obtain the power load forecast value output by the load forecasting model; wherein, during the operation of the load forecasting model, the multi-head self-attention layer adjusts the self-attention weight corresponding to each input feature based on the key time information; the input feature refers to the feature input to the multi-head self-attention layer. In the above manner, using the load forecasting model trained by deep learning, load forecasting based on multi-dimensional feature coding can better understand and process the complex, multi-dimensional and dynamically changing data in the power system, understand the nonlinear characteristics of the power load and the complex interactions between various influencing factors, thereby improving the accuracy of the load forecasting of the power system. Among them, the use of a load forecasting model including a multi-head self-attention layer and the self-attention mechanism can effectively capture long-term time dependencies and provide more accurate results in long-time series load forecasting; the use of a multi-head attention mechanism can effectively integrate and utilize a variety of complex features that affect power load. In addition, by introducing external key time information into the load forecasting model and emphasizing key factors, the load forecasting model pays more attention to the time points that have the greatest impact on the forecast results, thereby improving the accuracy of load forecasting for the power system. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0043] FIG1 is an application environment diagram of a load forecasting method for a power system in one embodiment;
[0044] FIG2 is a schematic flow chart of a method for load forecasting of a power system in one embodiment;
[0045] FIG3 is a block diagram of a load prediction device for a power system in one embodiment;
[0046] FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0047] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0048] It is understandable that in the field of power load forecasting, traditional forecasting methods have been widely studied and applied, such as time series analysis, trend analysis, regression analysis, exponential smoothing, and grey forecasting models.
[0049] These traditional forecasting methods each have their own characteristics and scope of application, but they also have some limitations. For example, the time series analysis method focuses on analyzing the continuous historical data sequence of power load that changes over time, and establishes a mathematical model to describe the relationship between load value and time to predict future load. Although this method requires relatively little data and can provide continuous forecast results, it is mainly suitable for short-term power load forecasting, and it considers more periodic factors and less uncertain factors such as holidays and weather.
[0050] The trend analysis method is to fit a function through historical data to predict the power system load at a certain point in the future. This method often does not take into account random errors when fitting historical data, so it is easily affected by emergencies and the prediction accuracy may be affected.
[0051] Regression analysis, also known as statistical analysis, is used to determine the relationship between the predicted value and a variety of influencing factors, such as weather, regional economic level and industrial structure. This method is simple and direct, with fewer parameters and faster prediction speed, but it has high requirements for historical data and it is difficult to take into account a large number of influencing factors.
[0052] Exponential smoothing is similar to regression analysis in that it builds a forecasting model based on time series and load values, but it is more flexible in processing data and has better fitting performance. It predicts future load values by taking a weighted average of past load data.
[0053] The grey prediction model is a method for predicting power load for systems with uncertain factors. It generates time series data with strong regularity by identifying the uncertain factors in the system and the degree of change between these factors to predict the power load trend.
[0054] Although these traditional forecasting methods can provide load forecasting results to a certain extent, with the rapid development and changes of the power system, especially in the context of increasing nonlinearity and uncertainty in power loads, traditional methods face more and more challenges. These methods are often unable to predict complex power load changes well when faced with complex power systems. Therefore, it is necessary to optimize and improve the forecasting methods according to actual conditions, consider the influence of external factors such as climate and weather, and achieve more accurate and stable forecasts of power loads.
[0055] Machine learning methods are widely used due to their excellent nonlinear mapping capabilities, and they effectively handle nonlinear problems in power load forecasting. Compared with traditional forecasting methods, machine learning methods can use less data to handle complex nonlinear problems and have achieved significant improvements in forecasting accuracy. Support vector machine (SVM) in machine learning is a powerful tool for dealing with nonlinear problems, especially for small sample data sets. It effectively handles classification and regression problems by finding an optimal hyperplane to minimize the loss value of the data to the plane. The main advantage of SVM is its ability to handle small samples and nonlinear problems, but the difficulty of parameter selection is also one of its disadvantages. Support vector machines are widely used in various time periods of power load forecasting, from ultra-short-term to long-term forecasts.
[0056] As an intuitive machine learning method, decision tree has shown good performance in classification and regression problems. It builds decision models by minimizing training data and loss functions. It has the advantages of fast classification speed and simple generation pattern, but it is also susceptible to irrelevant attributes in training data. In power load forecasting, decision trees are suitable for short-term and long-term forecasting, especially showing improvement potential in reducing data heterogeneity and improving data similarity.
[0057] As a powerful ensemble learning algorithm, random forest improves the accuracy and generalization ability of the model by constructing multiple decision trees and combining their prediction results. This method has a high tolerance for outliers and is not prone to overfitting, but it may reduce classification accuracy in the case of imbalanced data. Random forest is used in short-term, medium-term and long-term power load forecasting, and by combining with other machine learning methods, the accuracy and stability of the model are further improved.
[0058] In general, although traditional machine learning-based forecasting methods have achieved remarkable results in improving forecasting accuracy, these methods are still insufficient in data feature mining when faced with complex power systems, and cannot fully utilize the interrelationships and complex dynamics between multiple factors. Therefore, in practical applications, these machine learning methods still need to be optimized and improved for specific power systems and forecasting needs.
[0059] The load forecasting method for the power system provided in the embodiment of the present application can be applied in the application environment shown in Figure 1. Among them, the computer device 102 communicates with the power system management device 104 through the network, regularly obtains multiple load-related data through the data interface of the power system management device 104, executes the steps of the load forecasting method for the power system provided in this application, and realizes the prediction of the load of the power system. The power system management device 104 collects the operating data of the power system through various sensors installed in the power system, and stores it through a data storage system. The data storage system can be integrated on the power system management device 104, or it can be placed on the cloud or other network servers. Among them, the computer device 102 can be, but is not limited to, various personal computers, laptops, and servers. The server can use an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides cloud computing services.
[0060] In an exemplary embodiment, as shown in FIG2 , a load forecasting method for a power system is provided, and the method is described by taking the computer device 102 in FIG1 as an example, including:
[0061] Step 202, obtaining multiple load-related data of the power system within a set time period.
[0062] The power system is an electric energy production and consumption system consisting of power generation, transformation, transmission, distribution and consumption. Computer equipment regularly reads data from the power system management equipment, including multiple load-related data within a set time period. The set time period is a parameter set in advance and can be adjusted according to actual conditions, for example, within the past day, within the past month, within the past three months, within the past six months, etc.
[0063] Multiple load-related data refer to multi-dimensional data that affect the load of the power system, including: geographical location, production process, electricity consumption behavior, external electrical parameters and environmental parameters, etc.
[0064] Step 204 , pre-processing the multiple load-related data respectively to obtain multiple feature codes.
[0065] Among them, for each load-related data, the data is converted into a feature code that can be applied to the model through preprocessing operations.
[0066] Step 206, load the trained load forecasting model and obtain key time information corresponding to multiple load-related data; the load forecasting model includes at least a multi-head self-attention layer.
[0067] The load forecasting model is a deep learning model trained in advance, including at least a multi-head self-attention layer. The key time information corresponding to multiple load-related data can be set manually according to the power consumption law of the power system, or can be the key time information automatically evaluated by statistical power consumption of the power system, which is not limited in this embodiment.
[0068] Optionally, the load forecasting model is a time-fused Transformer load characteristic model (hereinafter referred to as the TFT model), which aims to provide a more powerful and flexible forecasting tool that can process real-time or near-real-time data and generate accurate load forecasts. The TFT model uses its deep learning architecture, especially the self-attention mechanism, to enhance the processing ability of complex nonlinear data relationships. This mechanism enables the model to effectively capture long-term temporal dependencies, thereby providing more accurate results in load forecasting for long time series. At the same time, the advanced feature processing capabilities of TFT, such as the gating mechanism and the multi-head attention mechanism, make the model more efficient in feature fusion and selection, and can effectively integrate and utilize a variety of complex features that affect power load. The TFT model not only has significant advantages in improving forecasting accuracy, but also provides a more advanced and comprehensive solution in processing complex data relationships, capturing long-term dependencies, and feature fusion and selection. In this way, the forecasting challenges in modern power systems can be more effectively addressed, providing a more comprehensive, flexible and efficient tool for power load forecasting.
[0069] Step 208, input the feature code into the load forecasting model to obtain the power load forecast value output by the load forecasting model; wherein, during the operation of the load forecasting model, the multi-head self-attention layer adjusts the self-attention weight corresponding to each input feature based on the key time information; the input feature refers to the feature input to the multi-head self-attention layer.
[0070] The preprocessed feature code is input into the trained load forecasting model, and the model makes predictions based on the input feature code and outputs the power load forecast value. The multi-head self-attention layer can emphasize key factors by adjusting the self-attention weights, dynamically adjust the model's attention to different time points, and improve the model's understanding and prediction capabilities of complex power system dynamics. For example, for geographic locations, if the data at a certain time point is particularly important for predicting power demand at a specific geographic location, the model will increase the weights of these time points. By adjusting the self-attention weights associated with the geographic location (optionally, the query ( ) and keys ( ) value), the model can pay more attention to those time points that have the greatest impact on the prediction results. For production processes, similarly, the model will identify and increase the weights of time points related to specific production processes, and adjust the self-attention weights of these points to reflect the impact of different processes on electricity demand. For electricity consumption behavior, for peak or low electricity periods, the model highlights their importance by increasing the weights of these periods. For external electrical parameters and environmental parameters: the model will appropriately adjust the weights of these moments according to the importance of changes in grid status or environmental conditions. For example, under extreme weather conditions, queries at relevant time points ( ) and keys ( ) values will be adjusted to reflect the impact of these conditions on power demand.
[0071] In an optional implementation, during the model deployment phase, the trained load forecasting model is applied to the actual power system to forecast the power load. 1. Hardware environment configuration: Set up a server with good performance, with sufficient CPU (central processing unit), GPU (graphics processing unit, which is very important for deep learning models), memory and storage space. Ensure that the server has a stable network connection to receive data from the power system database or real-time data stream. 2. Data reception and processing: Regularly obtain power load data, geographic location data, production process data, power consumption behavior data, external electrical parameters and environmental parameters through the power system's data interface (such as API or database connection). Clean, standardize and feature encode the acquired data, which can be done using data processing libraries in Python such as Pandas and NumPy. Use data formats suitable for deep learning (such as TensorFlow's tf.data.Dataset or PyTorch's DataLoader) to load the processed data. 3. Model operation and prediction output: Load the trained load forecasting model on the server. The model can be built and trained using deep learning frameworks such as TensorFlow or PyTorch. 4. Real-time prediction: The server continuously receives the latest data, and the model generates power load forecasts based on real-time data. 5. Forecast result output: The forecast results can be output to the database or sent to the power system manager through the network interface. The forecast results can be displayed using visualization tools (such as Tableau or Power BI) or customized dashboards. 6. Application and monitoring: The forecast results are used to support grid operation and planning decisions, such as load scheduling, maintenance plans, and demand response strategy formulation. To monitor the performance of the model and ensure the accuracy of the forecast, it is necessary to regularly check the model output and compare it with the actual load data to evaluate the model performance. According to the model performance and changes in the power system, the model parameters are regularly updated or the model is retrained.
[0072] Optionally, the load forecasting model will use the following formula to generate forecast results:
[0073] ;
[0074] The model is in time The predicted load value; It is an input vector containing all relevant features, including geographic location, production process, electricity consumption behavior, external electrical parameters, and environmental parameters; are model parameters; is a transformation function (usually a fully connected layer) that transforms the output of the TFT model into the final predicted value.
[0075] In the load forecasting method of the above-mentioned power system, multiple load-related data of the power system within a set time period are obtained; multiple load-related data are preprocessed respectively to obtain multiple feature codes; the trained load forecasting model is loaded, and the key time information corresponding to the multiple load-related data is obtained; the load forecasting model includes at least a multi-head self-attention layer; the feature code is input into the load forecasting model to obtain the power load forecast value output by the load forecasting model; wherein, during the operation of the load forecasting model, the multi-head self-attention layer adjusts the self-attention weight corresponding to each input feature based on the key time information; the input feature refers to the feature input to the multi-head self-attention layer. In the above manner, using the load forecasting model trained by deep learning, load forecasting based on multi-dimensional feature coding can better understand and process complex, multi-dimensional, and dynamically changing data in the power system, understand the nonlinear characteristics of the power load and the complex interactions between various influencing factors, thereby improving the accuracy of load forecasting of the power system. Among them, using a load forecasting model including a multi-head self-attention layer, using the self-attention mechanism, it can effectively capture long-term time dependencies and provide more accurate results in the load forecasting of long time series; using the multi-head attention mechanism, effectively integrate and utilize a variety of complex features that affect the power load. In addition, by introducing external key time information into the load forecasting model and emphasizing key factors, the load forecasting model pays more attention to the time points that have the greatest impact on the forecast results, thereby improving the accuracy of load forecasting for the power system.
[0076] In an exemplary embodiment, the method also includes: collecting training samples and load value labels of the power system within a historical time period; preprocessing the training samples to obtain sample codes; inputting the sample codes into the load prediction model to obtain training prediction values; calculating the loss function values corresponding to the training prediction values and the load value labels; when the loss function value is greater than a set threshold, adjusting the model parameters of the load prediction model, and continuing to iterate the training of the load prediction model until the calculated loss function value is less than or equal to the set threshold, thereby obtaining a trained load prediction model.
[0077] In the model training and optimization phase of this embodiment, a suitable loss function is used to train the model, and the model parameters are adjusted through the optimization algorithm. The loss function is used to measure the error between the predicted value and the true value. By minimizing the loss function, the difference between the predicted load value and the actual load value can be minimized. The mean square error (MSE) can be used as the loss function of the regression task, and the formula is as follows:
[0078] ;
[0079] In the formula, is the load value predicted by the model, is the actual load value, is the sample size.
[0080] Use an optimizer to adjust the model parameters of the load forecasting model to reduce the loss function. Commonly used optimizers include Adam, SGD, etc. With Adam, the model parameters can be updated based on the following formula:
[0081] ;
[0082] In the formula, represents the model parameters, is the gradient of the loss function with respect to the parameters.
[0083] It can be understood that the set threshold is a critical value set in advance for evaluating the size of the loss function value. If the loss function value is greater than the set threshold, it indicates that the difference between the predicted load value and the actual load value is large, and the model parameters need to be readjusted; if the loss function value is less than or equal to the set threshold, it indicates that the difference between the predicted load value and the actual load value is small, the training goal has been achieved, and a trained load forecasting model has been obtained.
[0084] In an exemplary embodiment, the multiple load-related data include geographic location data, production process data, electricity consumption behavior data, external electrical data and environmental data; each load-related data is arranged in chronological order.
[0085] Among them, the geographic location data includes multiple geographic locations arranged in chronological order, and each geographic location is used to represent an area or city with electricity demand (which can be a geographic location where the electricity demand exceeds a certain value) at the corresponding time. The production process data includes multiple production processes arranged in chronological order, and each production process is used to represent the use of electricity at the corresponding time, for example, the type of place where electricity is supplied. The electricity consumption behavior data includes multiple user behaviors arranged in chronological order, reflecting the user's electricity consumption at different times. The external electrical data includes multiple external electrical parameters arranged in chronological order. The external electrical parameters are grid load, power supply capacity, etc., which can reflect the power supply situation of the power system at different times. The environmental data includes multiple environmental parameters arranged in chronological order. Environmental parameters such as temperature and humidity reflect the environmental conditions of the power system at different times.
[0086] In an exemplary embodiment, step 204 includes: using one-hot encoding or label encoding to represent different geographic areas in the geographic location data to obtain a geographic location code; classifying each production process in the production process data according to energy consumption characteristics, and encoding each production process according to the classification result to obtain a production process code; encoding each electricity usage behavior according to the category of the electricity usage behavior data to obtain an electricity usage behavior code; normalizing or standardizing the numerical value of the external electrical data to obtain an electrical parameter code; normalizing or standardizing the numerical value of the environmental data to obtain an environmental parameter code.
[0087] Among them, the specific methods of data preprocessing and feature encoding can be: time features (such as hours, weeks, and months) are key factors in power load forecasting. In order for the model to understand these features, they need to be converted into numerical forms that the model can process. For example, encode the week as a number from 0 to 6. For geographic location data, one-hot encoding or label encoding can be used to represent different geographical areas, so that different power grid areas or cities can be assigned different codes. For production processes and electricity consumption behaviors, they are encoded according to type. For example, different types of industrial activities can be classified and encoded according to their energy consumption characteristics. For external electrical parameters and environmental parameters, since these parameters are generally in numerical form, they need to be normalized or standardized. For time series data, it is necessary to ensure that all input features are aligned in time, that is, all features corresponding to the same prediction moment should be organized together.
[0088] Through the preprocessing and feature encoding steps of this embodiment, the quality of the data and the consistency of the model input are ensured, laying the foundation for the subsequent training and use of the deep learning model.
[0089] In an exemplary embodiment, the load forecasting model includes an encoding layer, a multi-head self-attention layer, a gated recurrent network layer, a feature fusion layer and a prediction output layer; wherein: the encoding layer is used to compile multiple feature encodings respectively and output a first feature; the multi-head self-attention layer is used to adjust the self-attention weight corresponding to the first feature based on key time information, and convert the first feature into a first intermediate feature based on the self-attention weight; the gated recurrent network layer is used to select the second intermediate feature that is most important for load forecasting from the first feature; the feature fusion layer is used to fuse the first intermediate feature and the second intermediate feature to obtain the target feature; the prediction output layer is used to predict based on the target feature and output the power load prediction value.
[0090] This embodiment does not limit the specific structure of the encoding layer, and an LSTM encoder may be used.
[0091] Among them, the multi-head self-attention layer adopts the self-attention mechanism and the multi-head attention mechanism. The self-attention mechanism captures and emphasizes the key factors in the power system by adjusting the weights of the time points related to specific parameters. This process involves ,key Sum The following steps can be included: 1. Self-attention weight adjustment process. 2. Calculation of attention weight: The model calculates the query by the following formula and key The dot product between them is used to determine the relationship between the points in the sequence, thereby measuring the correlation between each point in the sequence and other points.
[0092] ;
[0093] in, and The query, key, and value vectors represent different points in the input sequence, is the dimension of the key vector. Through this mechanism, the model is able to assign a weight to each point in the input sequence, which reflects the degree of association between the point and other points in the sequence.
[0094] 3. Adjust the query corresponding to the first feature based on the key time information and key .
[0095] 4. Weights are applied to values (V):
[0096] The model applies these previously determined weights to the values , to generate a weighted output representation that captures the comprehensive information of all points in the input sequence, with particular emphasis on those factors that are most critical for prediction.
[0097] Based on the self-attention mechanism, the model's attention to different time points can be dynamically adjusted, thereby ensuring that the model fully considers the influence of key factors such as geographical location, production process, electricity consumption behavior, external electrical parameters and environmental parameters when predicting power load, thereby improving the model's understanding and prediction capabilities of the dynamics of complex power systems.
[0098] The multi-head attention mechanism allows the model to focus on multiple different aspects or features at the same time when processing the input sequence. This means that the model can capture the complex relationship between multiple factors at the same time and improve the overall understanding of the data. The core formula of the multi-head attention mechanism is as follows:
[0099] ;
[0100] In the formula, There are separate attention "heads" that focus on different subsets of features. and is a learnable weight matrix.
[0101] For the processing of geographic location, the multi-head attention mechanism can specifically configure one or more "heads" to focus on the characteristics of geographic location. The formula is as follows:
[0102] ;
[0103] In the formula, It is the weight matrix for geographical location features.
[0104] To handle the impact of different production processes on power demand, the model can assign a dedicated "head" to analyze these characteristics, as follows:
[0105] ;
[0106] In the formula, It is the weight matrix related to the production process.
[0107] For electricity consumption behavior, especially the electricity consumption patterns during peak and off-peak hours, the model can assign a dedicated "head" to analyze these characteristics, as follows:
[0108] ;
[0109] In the formula, It is the weight matrix corresponding to the electricity consumption behavior characteristics.
[0110] For external electrical parameters, such as grid load or supply capacity, the model can be assigned a dedicated "head" to analyze these characteristics, with the following formula:
[0111] ;
[0112] In the formula, is the weight matrix corresponding to the external electrical parameter characteristics.
[0113] For environmental parameters, such as weather conditions, the model can assign a dedicated "head" to analyze these features, as follows:
[0114] ;
[0115] In the formula, is the weight matrix corresponding to the environmental parameters.
[0116] The multi-head attention mechanism can focus on multiple key factors at the same time. Each factor is specially processed through its corresponding weight matrix, so that the model can comprehensively and meticulously analyze various complex factors in the power system and provide more accurate and comprehensive load forecasting.
[0117] Among them, the load forecasting model uses a gated network to integrate and optimize the key factors of the power system. The gated network is used to control the flow of information so that the model can handle different types of data inputs more flexibly. This is especially important when integrating multi-dimensional features because it allows the model to dynamically select the most important features for prediction and adjust its processing accordingly. The gated network used in this embodiment is a gated loop unit (GRU), and the formula is as follows:
[0118] ;
[0119] In the formula, is the input of the current time step, is the hidden state at the previous time step, is the candidate hidden state for the current time step, is the update gate, which is used to decide how much historical information to retain.
[0120] According to the specific electricity demand characteristics of different geographical locations, the gating network can adjust the weights to emphasize or weaken the data of certain areas. The formula is as follows:
[0121] ;
[0122] In the formula, is the input feature related to the geographic location, and are the hidden states for the geographic location at the previous time step and the current time step respectively.
[0123] For different production processes, the gating network can identify and adjust the characteristics of these processes. The formula is as follows:
[0124] ;
[0125] in, are input features related to the production process, and are the hidden states of the production process at the previous time step and the current time step respectively.
[0126] The gating network can emphasize features related to electricity usage behavior. The formula is as follows:
[0127] ;
[0128] in, is the input feature related to electricity consumption behavior, and are the hidden states of electricity consumption behavior at the previous time step and the current time step, respectively.
[0129] In response to changes in grid load or power supply capacity, the gating network can handle these parameters through the following formula:
[0130] ;
[0131] in, are input characteristics related to external electrical parameters, and are the hidden states of the previous time step and the current time step for external electrical parameters, respectively.
[0132] Based on the above formula, the gating network can effectively integrate and process complex data from different sources, so that the load forecasting model can take into account the influence of multiple key factors when predicting power load, thereby improving the accuracy and reliability of the forecast.
[0133] Among them, the feature fusion layer combines various features processed by the self-attention mechanism and the gated network, integrating multiple key factors such as geographical location, production process, power consumption behavior, external electrical parameters and environmental parameters. The prediction output layer uses various input features in the model to generate the final load forecast. The formula is as follows:
[0134] ;
[0135] in, It's at the time The predicted load value, is the input vector containing all relevant features, are model parameters. Function Usually a fully connected layer, which is used to transform the output of the load forecasting model into the final forecast value.
[0136] It can be understood that this embodiment is based on the Transformer architecture, and has key components such as self-attention mechanism, multi-head attention mechanism and gating network to process time series data and capture the association between different features. The model accepts multiple feature inputs, including geographic location, production process, electricity consumption behavior, external electrical parameters and environmental parameters, etc. These multivariate features are integrated into the model to improve prediction accuracy. The model introduces time encoding to retain time information. The model can better capture trends and periodicity in time series data, especially long-term dependencies, so as to more accurately predict the time characteristics of loads. Gating networks and multi-head attention mechanisms allow the model to dynamically select and combine different features to better capture the relationship between multivariate features. Deep learning technology is used for model training and optimization, using loss functions suitable for regression tasks, and selecting appropriate optimization algorithms to improve model training efficiency.
[0137] In an exemplary embodiment, after step 208, the method further includes: evaluating the output performance of the load prediction model according to the power load prediction value and the power load monitoring value to obtain an evaluation result; and adjusting the model parameters of the load prediction model according to the evaluation result.
[0138] Among them, the power load monitoring value is the actual value obtained from the power system management equipment, and the power load prediction value and the power load monitoring value are for the same moment of the power system. Using evaluation indicators such as the root mean square error (RMSE), the index value between the power load prediction value and the power load monitoring value is calculated to obtain the evaluation result. If the RMSE value is large, it means that the prediction error of the model is large and needs further optimization. The parameters of the model are gradually adjusted using parameter adjustment strategies such as genetic algorithms, and the output performance changes after each adjustment are observed, and the output performance of the model is re-evaluated using the evaluation indicators. If the evaluation index value improves, it means that the parameter adjustment is effective; if the evaluation index value does not improve significantly or even deteriorates, other adjustment strategies are reconsidered to adjust the model parameters. Through performance monitoring and continuous optimization of the model, it helps to respond to data drift and environmental changes in real time, and improves the availability and robustness of the model.
[0139] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0140] Based on the same inventive concept, the embodiment of the present application also provides a load forecasting device for an electric power system for implementing the load forecasting method for an electric power system involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in the embodiments of the load forecasting device for one or more electric power systems provided below can refer to the limitations of the load forecasting method for an electric power system above, and will not be repeated here.
[0141] In an exemplary embodiment, as shown in FIG3 , a load forecasting device for a power system is provided, comprising:
[0142] The acquisition module 302 is used to acquire multiple load-related data of the power system within a set time period.
[0143] The preprocessing module 304 is used to preprocess multiple load-related data respectively to obtain multiple feature codes.
[0144] The loading module 306 is used to load the trained load forecasting model and obtain key time information corresponding to multiple load-related data; the load forecasting model includes at least a multi-head self-attention layer.
[0145] The prediction module 308 is used to input the feature code into the load prediction model to obtain the power load prediction value output by the load prediction model; wherein, during the operation of the load prediction model, the multi-head self-attention layer adjusts the self-attention weight corresponding to each input feature based on the key time information; the input feature refers to the feature input to the multi-head self-attention layer.
[0146] In the load forecasting device of the above-mentioned power system, multiple load-related data of the power system within a set time period are obtained; multiple load-related data are preprocessed respectively to obtain multiple feature codes; a trained load forecasting model is loaded, and key time information corresponding to multiple load-related data is obtained; the load forecasting model includes at least a multi-head self-attention layer; the feature code is input into the load forecasting model to obtain the power load forecast value output by the load forecasting model; wherein, during the operation of the load forecasting model, the multi-head self-attention layer adjusts the self-attention weight corresponding to each input feature based on the key time information; the input feature refers to the feature input to the multi-head self-attention layer. In the above manner, using the load forecasting model trained by deep learning, load forecasting based on multi-dimensional feature coding can better understand and process complex, multi-dimensional, and dynamically changing data in the power system, understand the nonlinear characteristics of the power load and the complex interactions between various influencing factors, thereby improving the accuracy of load forecasting of the power system. Among them, using a load forecasting model including a multi-head self-attention layer, using the self-attention mechanism, it can effectively capture long-term time dependencies and provide more accurate results in the load forecasting of long time series; using the multi-head attention mechanism, effectively integrate and utilize a variety of complex features that affect the power load. In addition, by introducing external key time information into the load forecasting model and emphasizing key factors, the load forecasting model pays more attention to the time points that have the greatest impact on the forecast results, thereby improving the accuracy of load forecasting for the power system.
[0147] In an exemplary embodiment, the load prediction device of the power system also includes a training module; the training module is used to collect training samples and load value labels of the power system within a historical time period; preprocess the training samples to obtain sample codes; input the sample codes into the load prediction model to obtain training prediction values; calculate the loss function values corresponding to the training prediction values and the load value labels; when the loss function value is greater than a set threshold, adjust the model parameters of the load prediction model, and continue to iterate the training of the load prediction model until the calculated loss function value is less than or equal to the set threshold, thereby obtaining a trained load prediction model.
[0148] In an exemplary embodiment, the multiple load-related data include geographic location data, production process data, electricity consumption behavior data, external electrical data and environmental data; each load-related data is arranged in chronological order.
[0149] In an exemplary embodiment, the preprocessing module 304 is also used to use one-hot encoding or label encoding to represent different geographic areas in the geographic location data to obtain a geographic location code; classify each production process in the production process data according to energy consumption characteristics, and encode each production process according to the classification result to obtain a production process code; encode according to the category of each electricity usage behavior in the electricity usage behavior data to obtain an electricity usage behavior code; normalize or standardize the numerical value of the external electrical data to obtain an electrical parameter code; normalize or standardize the numerical value of the environmental data to obtain an environmental parameter code.
[0150] In an exemplary embodiment, the load forecasting model includes an encoding layer, a multi-head self-attention layer, a gated recurrent network layer, a feature fusion layer and a prediction output layer; wherein: the encoding layer is used to compile multiple feature encodings respectively and output a first feature; the multi-head self-attention layer is used to adjust the self-attention weight corresponding to the first feature based on key time information, and convert the first feature into a first intermediate feature based on the self-attention weight; the gated recurrent network layer is used to select the second intermediate feature that is most important for load forecasting from the first feature; the feature fusion layer is used to fuse the first intermediate feature and the second intermediate feature to obtain the target feature; the prediction output layer is used to predict based on the target feature and output the power load prediction value.
[0151] In an exemplary embodiment, the load forecasting device of the power system also includes an optimization module; the optimization module is used to evaluate the output performance of the load forecasting model based on the power load forecast value and the power load monitoring value to obtain an evaluation result; and adjust the model parameters of the load forecasting model based on the evaluation result.
[0152] Each module in the load forecasting device of the above-mentioned power system can be implemented in whole or in part by software, hardware and a combination thereof. Each of the above-mentioned modules can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.
[0153] In an exemplary embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be shown in FIG4. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. The processor, the memory and the input / output interface are connected via a system bus, and the communication interface is connected to the system bus via the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a load forecasting method for a power system is implemented.
[0154] Those skilled in the art will understand that the structure shown in FIG. 4 is merely a block diagram of a partial structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.
[0155] In an exemplary embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the following steps when executing the computer program: obtaining multiple load-related data of the power system within a set time period; preprocessing the multiple load-related data respectively to obtain multiple feature codes; loading a trained load forecasting model and obtaining key time information corresponding to the multiple load-related data; the load forecasting model includes at least a multi-head self-attention layer; inputting the feature code into the load forecasting model to obtain the power load forecast value output by the load forecasting model; wherein, during the operation of the load forecasting model, the multi-head self-attention layer adjusts the self-attention weight corresponding to each input feature based on the key time information; the input feature refers to the feature input to the multi-head self-attention layer.
[0156] In one embodiment, when the processor executes the computer program, the following steps are also implemented: collecting training samples and load value labels of the power system within a historical time period; preprocessing the training samples to obtain sample codes; inputting the sample codes into the load forecasting model to obtain training prediction values; calculating the loss function values corresponding to the training prediction values and the load value labels; when the loss function value is greater than a set threshold, adjusting the model parameters of the load forecasting model, and continuing to iterate the training of the load forecasting model until the calculated loss function value is less than or equal to the set threshold, thereby obtaining a trained load forecasting model.
[0157] In one embodiment, when the processor executes the computer program, the following steps are also implemented: using one-hot encoding or label encoding to represent different geographic areas in the geographic location data to obtain a geographic location code; classifying each production process in the production process data according to energy consumption characteristics, and encoding each production process according to the classification result to obtain a production process code; encoding each electricity usage behavior according to the category of the electricity usage behavior data to obtain an electricity usage behavior code; normalizing or standardizing the numerical value of the external electrical data to obtain an electrical parameter code; normalizing or standardizing the numerical value of the environmental data to obtain an environmental parameter code.
[0158] In one embodiment, when the processor executes the computer program, the following steps are also implemented: based on the power load prediction value and the power load monitoring value, the output performance of the load prediction model is evaluated to obtain an evaluation result; based on the evaluation result, the model parameters of the load prediction model are adjusted.
[0159] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented: obtaining multiple load-related data of the power system within a set time period; preprocessing the multiple load-related data respectively to obtain multiple feature codes; loading a trained load forecasting model, and obtaining key time information corresponding to the multiple load-related data; the load forecasting model includes at least a multi-head self-attention layer; inputting the feature code into the load forecasting model to obtain the power load forecast value output by the load forecasting model; wherein, during the operation of the load forecasting model, the multi-head self-attention layer adjusts the self-attention weight corresponding to each input feature based on the key time information; the input feature refers to the feature input to the multi-head self-attention layer.
[0160] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: collecting training samples and load value labels of the power system within a historical time period; preprocessing the training samples to obtain sample codes; inputting the sample codes into the load forecasting model to obtain training prediction values; calculating the loss function values corresponding to the training prediction values and the load value labels; when the loss function value is greater than a set threshold, adjusting the model parameters of the load forecasting model, and continuing to iterate the training of the load forecasting model until the calculated loss function value is less than or equal to the set threshold, thereby obtaining a trained load forecasting model.
[0161] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: using one-hot encoding or label encoding to represent different geographic areas in the geographic location data to obtain a geographic location code; classifying each production process in the production process data according to energy consumption characteristics, and encoding each production process according to the classification result to obtain a production process code; encoding each electricity usage behavior according to the category of the electricity usage behavior data to obtain an electricity usage behavior code; normalizing or standardizing the numerical value of the external electrical data to obtain an electrical parameter code; normalizing or standardizing the numerical value of the environmental data to obtain an environmental parameter code.
[0162] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: based on the power load prediction value and the power load monitoring value, the output performance of the load prediction model is evaluated to obtain an evaluation result; based on the evaluation result, the model parameters of the load prediction model are adjusted.
[0163] In one embodiment, a computer program product is provided, including a computer program, which implements the following steps when executed by a processor: obtaining multiple load-related data of a power system within a set time period; preprocessing the multiple load-related data respectively to obtain multiple feature codes; loading a trained load forecasting model and obtaining key time information corresponding to the multiple load-related data; the load forecasting model includes at least a multi-head self-attention layer; inputting the feature code into the load forecasting model to obtain the power load forecast value output by the load forecasting model; wherein, during the operation of the load forecasting model, the multi-head self-attention layer adjusts the self-attention weight corresponding to each input feature based on the key time information; the input feature refers to the feature input to the multi-head self-attention layer.
[0164] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: collecting training samples and load value labels of the power system within a historical time period; preprocessing the training samples to obtain sample codes; inputting the sample codes into the load forecasting model to obtain training prediction values; calculating the loss function values corresponding to the training prediction values and the load value labels; when the loss function value is greater than a set threshold, adjusting the model parameters of the load forecasting model, and continuing to iterate the training of the load forecasting model until the calculated loss function value is less than or equal to the set threshold, thereby obtaining a trained load forecasting model.
[0165] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: using one-hot encoding or label encoding to represent different geographic areas in the geographic location data to obtain a geographic location code; classifying each production process in the production process data according to energy consumption characteristics, and encoding each production process according to the classification result to obtain a production process code; encoding each electricity usage behavior according to the category of the electricity usage behavior data to obtain an electricity usage behavior code; normalizing or standardizing the numerical value of the external electrical data to obtain an electrical parameter code; normalizing or standardizing the numerical value of the environmental data to obtain an environmental parameter code.
[0166] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: based on the power load prediction value and the power load monitoring value, the output performance of the load prediction model is evaluated to obtain an evaluation result; based on the evaluation result, the model parameters of the load prediction model are adjusted.
[0167] 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, stored data, displayed data, 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 relevant data must comply with relevant regulations.
[0168] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory 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. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.
[0169] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, 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 application.
[0170] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A load forecasting method for a power system, characterized in that: The method comprises: Obtain multiple load-related data of the power system within a set time period; Preprocessing the multiple load-related data respectively to obtain multiple feature codes; Loading a trained load forecasting model and obtaining key time information corresponding to the multiple load-related data; the load forecasting model at least includes a multi-head self-attention layer; The feature code is input into the load forecasting model to obtain the power load forecast value output by the load forecasting model; wherein, during the operation of the load forecasting model, the multi-head self-attention layer adjusts the self-attention weight corresponding to each input feature based on the key time information; the input feature refers to the feature input into the multi-head self-attention layer.
2. The method according to claim 1, characterized in that The method further comprises: Collecting training samples and load value labels of the power system in a historical time period; Preprocessing the training samples to obtain sample codes; Inputting the sample code into the load forecasting model to obtain a training forecast value; Calculating the loss function value corresponding to the training prediction value and the load value label; When the loss function value is greater than a set threshold, the model parameters of the load forecasting model are adjusted, and the load forecasting model is continuously iterated and trained until the calculated loss function value is less than or equal to the set threshold, thereby obtaining a trained load forecasting model.
3. The method according to claim 1, characterized in that The multiple load-related data include geographic location data, production process data, electricity consumption behavior data, external electrical data and environmental data; each load-related data is arranged in chronological order.
4. The method according to claim 3, characterized in that The plurality of load-related data are preprocessed respectively to obtain a plurality of feature codes, including: Using one-hot encoding or label encoding to represent different geographical areas in the geographical location data to obtain geographical location codes; Classifying each production process in the production process data according to energy consumption characteristics, and encoding each production process according to the classification result to obtain a production process code; Encoding each electricity usage behavior according to the category of each electricity usage behavior in the electricity usage behavior data to obtain an electricity usage behavior code; Normalizing or standardizing the values of external electrical data to obtain electrical parameter coding; The numerical values of the environmental data are normalized or standardized to obtain the environmental parameter code.
5. The method according to any one of claims 1 to 4, characterized in that: The load forecasting model includes a coding layer, a multi-head self-attention layer, a gated recurrent network layer, a feature fusion layer and a prediction output layer; wherein: The encoding layer is used to compile the multiple feature codes respectively and output the first feature; The multi-head self-attention layer is used to adjust the self-attention weight corresponding to the first feature based on the key time information, and convert the first feature into a first intermediate feature based on the self-attention weight; The gated recurrent network layer is used to select the second intermediate feature that is most important for load forecasting from the first features; The feature fusion layer is used to fuse the first intermediate feature and the second intermediate feature to obtain a target feature; The prediction output layer is used to make predictions based on the target features and output power load prediction values.
6. The method according to any one of claims 1 to 4, characterized in that After inputting the feature code into the load prediction model to obtain the power load prediction value output by the load prediction model, the method further includes: According to the power load prediction value and the power load monitoring value, the output performance of the load prediction model is evaluated to obtain an evaluation result; According to the evaluation result, the model parameters of the load prediction model are adjusted.
7. A load forecasting device for a power system, characterized in that: The device comprises: An acquisition module is used to acquire multiple load-related data of the power system within a set time period; A preprocessing module, used for preprocessing the multiple load-related data respectively to obtain multiple feature codes; A loading module, used to load a trained load forecasting model and obtain key time information corresponding to the multiple load-related data; the load forecasting model at least includes a multi-head self-attention layer; A prediction module is used to input the feature code into the load prediction model to obtain the power load prediction value output by the load prediction model; wherein, during the operation of the load prediction model, the multi-head self-attention layer adjusts the self-attention weight corresponding to each input feature based on the key time information; the input feature refers to the feature input to the multi-head self-attention layer.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Electric vehicle charging demand prediction method and device
CN114331542A
Short-term power load prediction method based on power consumption behavior similarity between users
CN115099502A
Short-term load prediction method based on hybrid neural network model
CN115238999A
Power load prediction method and system based on deep learning
CN117455256A
Cited By
Multi-scale power load prediction method and system
CN120354984A