Electricity price and load prediction method and system based on multi-scale feature fusion

By repairing and reconstructing historical transaction data of the electricity market, extracting multi-scale feature data, and utilizing a load-electricity price joint forecasting model that integrates multi-dimensional features, the problem of low accuracy in load and electricity price forecasts is solved, achieving more accurate forecasts.

CN120611833APending Publication Date: 2025-09-09GUANGZHOU POWER SUPPLY BUREAU GUANGDONG POWER GRID CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510777741.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-11
Publication Date
2025-09-09

AI Technical Summary

Technical Problem

Existing technologies fail to effectively consider the mutual impact between load and electricity price, resulting in low accuracy of load and electricity price forecasts.

Method used

By repairing and reconstructing historical transaction data of the electricity market, extracting multi-scale feature data, and using a load-electricity price joint prediction model that integrates multi-dimensional features, predictions are made considering the mutual influence between load changes and electricity price changes.

Benefits of technology

It improves the accuracy of load and electricity price forecasts, provides forecast values ​​that are more in line with actual conditions, and supports optimized decision-making in the power market.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120611833A_ABST
    Figure CN120611833A_ABST
Patent Text Reader

Abstract

The invention discloses an electricity price and load prediction method and system based on multi-scale feature fusion, and belongs to the technical field of electric power spot transaction, and the method comprises the steps: carrying out the data restoration and data reconstruction of the obtained historical transaction data of an electric power market, and obtaining a multi-scale data matrix; performing correlation analysis on the multi-scale data matrix based on the influence of meteorological factors and time factors on the output of the distributed power supply and the time-of-use electricity price, and extracting and fusing characteristics related to electricity price change and load change to obtain multi-dimensional characteristic data; and inputting the multi-dimensional feature data into a preset load-electricity price combined prediction model, and predicting the load and the electricity price by considering the mutual influence between the load change and the electricity price change to obtain a load prediction value and an electricity price prediction value. Therefore, by implementing the method and the device, the problem that the accuracy of the predicted load and the predicted electricity price is relatively low due to the fact that mutual influence between the load and the electricity price is not considered in the prior art can be solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of electricity spot trading technology, and specifically relates to a method and system for electricity price and load forecasting based on multi-scale feature fusion. Background Art

[0002] In the modern electricity market, load forecasting is not only crucial to the stability and reliability of the power grid but also forms the foundation of electricity market transactions. Accurate load forecasting helps power companies rationally plan power generation, avoid oversupply or shortages, and effectively control costs and reduce carbon emissions. Electricity price forecasting impacts power companies' revenues and profits and is directly related to consumers' electricity costs and behavior. However, the increasing proportion of renewable energy and the development of smart grid technologies have increased the volatility of load curves and electricity prices, significantly increasing the uncertainty of load and electricity price forecasts.

[0003] Traditional load and electricity price forecasting is based on relatively static supply and demand models. While these factors, such as time-varying clearing prices and changes in distributed energy output due to weather and time of day, which can lead to changes in load data, are considered, they rarely consider the close relationship between load and electricity prices. Fluctuations in load demand directly impact clearing prices, and price fluctuations can affect user electricity consumption, which in turn impacts load. Therefore, as the proportion of renewable energy generation increases significantly, accurately forecasting load and electricity prices based on the complex interactions between load demand fluctuations and dynamic electricity price changes presents a significant challenge for the current power market. Summary of the Invention

[0004] This application proposes a method and system for electricity price and load forecasting based on multi-scale feature fusion, which can solve the problem that the existing technology does not take into account the mutual influence between load and electricity price, resulting in low accuracy of predicted load and electricity price.

[0005] A first aspect of the present application provides an electricity price and load forecasting method based on multi-scale feature fusion, the method comprising:

[0006] Performing data repair and data reconstruction on the acquired historical transaction data of the power market to obtain a multi-scale data matrix; wherein the historical transaction data includes historical electricity price time series data, historical meteorological data, historical clearing electricity price data, and historical load data;

[0007] Based on the impact of meteorological and time factors on distributed power output and time-of-use electricity prices, a correlation analysis is performed on the multi-scale data matrix, and features related to electricity price changes and load changes are extracted and integrated to obtain multi-dimensional feature data.

[0008] The multi-dimensional feature data is input into the preset load-electricity price joint forecasting model. By considering the mutual influence between load changes and electricity price changes, the load and electricity price are predicted respectively to obtain the load forecast value and electricity price forecast value.

[0009] The above solution first performs data repair operations on the acquired historical transaction data, such as filling missing values ​​and removing outliers. It then reconstructs the historical transaction data based on data dimensions, extracting feature data that correlates load changes with electricity price changes, reducing redundant data and improving the efficiency of subsequent data analysis. Then, considering that meteorological factors can affect the output of photovoltaic and wind power generation in distributed renewable energy sources, as well as the influence of time factors on the setting of time-of-use electricity prices in the power market, a correlation analysis is performed on the resulting multi-scale data matrix. The aim is to quantify the strength of associations between different variables, extract features that strongly correlate with load and electricity price changes, and fuse these features to effectively integrate data information from different scales and dimensions. Finally, a load-price joint forecasting model is used to capture the temporal and spatial dependencies between load patterns and electricity prices in the multi-dimensional feature data, accurately quantifying the mutual influence between load and electricity price changes, and obtaining electricity price and load forecasts that are more consistent with actual conditions.

[0010] In a possible implementation method of the first aspect, data repair and data reconstruction are performed on the acquired historical transaction data of the power market to obtain a multi-scale data matrix, specifically:

[0011] Data repair is completed by sequentially removing outliers and filling missing values ​​in the historical transaction data;

[0012] According to the preset sampling nodes, the historical transaction data after data repair is resampled to obtain a multi-scale data matrix.

[0013] The above solution removes outliers from the acquired data and fills in missing values, thereby improving data quality and reducing the impact of outliers on subsequent data analysis.

[0014] In a possible implementation method of the first aspect, outliers are removed from the historical transaction data in sequence, specifically:

[0015] The historical transaction data is randomly divided using the lonely forest algorithm to obtain several subsets;

[0016] Constructing a corresponding random forest based on the subset, and calculating the path length of each data point in the historical transaction data in the random forest;

[0017] The abnormality degree of each data point in the historical transaction data is calculated according to the path length, and the abnormal points in the historical transaction data are determined.

[0018] The above solution uses the lonely forest method to remove obvious outliers from historical transaction data. This method primarily involves randomly partitioning historical transaction data to isolate different data points and observe outliers whose attributes differ from those of other data points, thus achieving rapid segmentation of outlier data.

[0019] In a possible implementation method of the first aspect, the historical transaction data after data repair is resampled according to preset sampling nodes to obtain a multi-scale data matrix, specifically:

[0020] Based on the actual situation of the electricity market, the first threshold sampling nodes are determined from the perspectives of time, meteorological factors and energy types;

[0021] According to the sampling nodes, the historical transaction data after data repair is resampled in units of preset sampling time to construct a multi-scale data matrix based on time series; wherein the first threshold number of sampling nodes corresponds to a column vector in the multi-scale data matrix.

[0022] When resampling historical transaction data, the above scheme not only samples clearing electricity price data and load data, but also collects time, meteorological factors and energy types involved in power generation that are correlated with electricity price and load changes based on the actual situation of the electricity market. The multi-scale data matrix obtained based on the above sampling can provide data support for subsequent accurate prediction of load and electricity prices.

[0023] In one possible implementation method of the first aspect, based on the impact of meteorological and time factors on the output of distributed power sources and time-of-use electricity prices, a correlation analysis is performed on a multi-scale data matrix, and features related to electricity price changes and load changes are extracted and integrated to obtain multi-dimensional feature data, specifically:

[0024] Setting electricity price and load as target variables, and calculating the correlation coefficient between each characteristic data in the multi-scale data matrix and the target variables based on the influence of meteorological factors and time factors on the output of distributed power sources and time-of-use electricity prices;

[0025] Extracting and fusing strongly correlated features from the multi-scale data matrix to obtain multi-dimensional feature data; wherein the strongly correlated features are the feature data whose correlation coefficients satisfy a preset strongly correlated range.

[0026] The above scheme uses electricity price and load as target variables at the same time. By analyzing the correlation strength between each feature data in the multi-scale data matrix and these two target variables, a data screening is performed to obtain features with a greater relationship with the target variables, providing a key basis for subsequent efficient data prediction.

[0027] In a possible implementation method of the first aspect, the correlation coefficient is specifically:

[0028] The calculation formula of the correlation coefficient is:

[0029]

[0030] Where, ρ X,Y is the correlation coefficient between variables X and Y, cov is the covariance, and σ is the standard deviation.

[0031] In one possible implementation method of the first aspect, multi-dimensional feature data is input into a preset load-electricity price joint forecasting model. By considering the mutual influence between load changes and electricity price changes, the load and electricity price are predicted respectively to obtain load forecast values ​​and electricity price forecast values, specifically:

[0032] The load-electricity price joint prediction model includes an input layer, a task learning layer, a prediction layer and an output layer;

[0033] Inputting the multi-dimensional feature data into the input layer of the load-electricity price joint prediction model to obtain a feature vector sequence of the multi-dimensional feature data;

[0034] Capturing the coupling relationship between load forecasting and electricity price forecasting in the feature vector sequence through the task learning layer;

[0035] The load forecast and the electricity price forecast are performed respectively through the forecast layer and the coupling relationship, and then the load forecast value and the electricity price forecast value are output through the output layer.

[0036] In the load-electricity price joint prediction model, the above scheme analyzes the coupling relationship between load changes and electricity price changes through the task learning layer, considers the impact of load on electricity price to make electricity price predictions, and considers the impact of electricity price on load to make load predictions, thereby achieving accurate prediction of load and electricity price.

[0037] In a possible implementation method of the first aspect, the method further includes:

[0038] Calculating the losses corresponding to the load forecast and the electricity price forecast respectively through the loss function of the load-electricity price joint forecast model;

[0039] All the losses are weighted summed, and the learning weights of the learning task layer are updated according to the weighted summation result.

[0040] The above scheme updates the learning weights in the model through the weighted summation results to further improve the balance between the model's load forecasting and electricity price forecasting, thereby improving the model's prediction accuracy.

[0041] A second aspect of the present application provides an electricity price and load forecasting system based on multi-scale feature fusion, the system comprising: a multi-scale data processing module, a correlation analysis module, and a load-electricity price forecasting module;

[0042] The multi-scale data processing module is used to perform data repair and data reconstruction on the acquired historical transaction data of the power market to obtain a multi-scale data matrix; wherein the historical transaction data includes historical electricity price time series data, historical meteorological data, historical clearing electricity price data and historical load data;

[0043] The correlation analysis module is used to perform correlation analysis on the multi-scale data matrix based on the impact of meteorological and time factors on the output of distributed power sources and time-of-use electricity prices, extract and fuse features related to electricity price changes and load changes, and obtain multi-dimensional feature data;

[0044] The load-electricity price forecasting module is used to input multi-dimensional feature data into the preset load-electricity price joint forecasting model, and predict the load and electricity price respectively by considering the mutual influence between load changes and electricity price changes to obtain load forecast values ​​and electricity price forecast values.

[0045] A third aspect of the present application provides a terminal device, which includes: a terminal device including a processor and a memory, the memory storing a computer program, and the processor implementing the steps of an electricity price and load forecasting method based on multi-scale feature fusion as described in any one of the embodiments of the present application when executing the computer program. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] In order to more clearly illustrate the technical solution of the present application, the following is a brief introduction to the drawings required for use in the implementation. Obviously, the drawings described below are only some implementation methods of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0047] Figure 1 This is a schematic diagram of a specific process of a method for electricity price and load forecasting based on multi-scale feature fusion provided in an embodiment of the present application;

[0048] Figure 2 This is a correlation analysis result diagram of an electricity price and load forecasting method based on multi-scale feature fusion provided in a certain embodiment of the present application;

[0049] Figure 3 This is a structural diagram of an electricity price and load forecasting system based on multi-scale feature fusion provided in one embodiment of the present application;

[0050] Figure 4A structural diagram of a terminal device is provided for a certain embodiment of the present application. DETAILED DESCRIPTION

[0051] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.

[0052] It should be understood that the step numbers used herein are only for convenience of description and are not intended to limit the order in which the steps are to be executed.

[0053] First embodiment

[0054] As more and more distributed renewable energy sources are introduced into the power system, the increasing proportion of renewable energy introduces uncertainty into load and electricity price forecasts. However, in addition to factors such as weather, energy type, and time of day that can affect load changes and electricity price fluctuations, there is also an interaction between load and electricity price. The embodiments of this application take this interaction into account by jointly forecasting electricity prices and loads, providing optimal decisions for power market transactions.

[0055] like Figure 1 As shown, in order to solve the problem in the prior art that the mutual influence between load and electricity price is not taken into account, resulting in low accuracy of the predicted load and electricity price, the first embodiment of the present application provides a specific flow chart of the electricity price and load forecasting method based on multi-scale feature fusion. The electricity price and load forecasting method based on multi-scale feature fusion in this embodiment includes steps S1 to S3, which are detailed as follows:

[0056] Step S1: Perform data repair and data reconstruction on the acquired historical transaction data of the electricity market to obtain a multi-scale data matrix.

[0057] In an embodiment of the present application, a large amount of historical transaction data of the electricity market is obtained to obtain characteristic data of multiple scales, including historical electricity price time series data, historical meteorological data, historical clearing electricity price data, and historical load data.

[0058] For example, the following table shows some historical transaction data extracted from January to June 2023 in the embodiment of this application, with a sampling granularity of 10 minutes, as follows:

[0059] Table 1

[0060]

[0061] Among them, at 0:50 on February 1, 2023, the clearing electricity price was 278.17 yuan / MWh, and the load was 34,407.6 kWh.

[0062] These historical transaction data may have some outliers or missing data due to problems with the collection equipment. Therefore, it is necessary to first repair the historical transaction data and then obtain a multi-scale data matrix through data reconstruction.

[0063] Data repair is mainly divided into outlier removal and missing value filling. The embodiment of the present application uses the lonely forest algorithm to remove outliers and fills missing values ​​through interpolation.

[0064] The Lonely Forest algorithm is a highly effective outlier detection method, particularly suitable for high-dimensional datasets. Its core concept is to isolate outliers by constructing a random binary tree (i.e., a "forest"). Because outliers often have distinct properties from other normal data points, they are more easily isolated during the random partitioning of data, enabling rapid location of outliers. The steps for removing outliers from historical trading data using the Lonely Forest algorithm are as follows:

[0065] (1) Randomly select a feature data in the historical transaction data and randomly select a cutting point within the feature value range;

[0066] (2) Using the selected feature data and cut points as segmentation rules, the historical transaction data is divided into two subsets;

[0067] (3) Recursively repeat the above two steps to obtain several subsets until there is only one data point in each subset or the preset maximum tree depth is reached, then stop splitting;

[0068] (4) construct random trees based on the obtained subsets, and form a random forest through all random trees;

[0069] (5) Calculate the path length of each data point in the random forest in the historical transaction data, that is, the average number of edges from the root node of the random forest to the data point;

[0070] (6) The abnormality degree of the corresponding data point is measured according to the path length. Generally, a shorter path length indicates an abnormal data point that is easily isolated, while a longer path length indicates a normal data point in the historical transaction data;

[0071] (7) Screening data points based on a preset abnormality threshold to identify and eliminate abnormal data points in historical transaction data.

[0072] Through the above process, we can finally obtain the historical transaction data with outliers removed.

[0073] Optionally, in the embodiment of the present application, the maximum tree depth of the lonely forest is set to 8, and the maximum number of random trees is set to 100. In other embodiments, it can be flexibly adjusted according to the needs of a specific data set.

[0074] Then, the interpolation method is used to fill in the historical transaction data after the outliers are eliminated. In the embodiment of the present application, a cubic sample interpolation function is selected for filling.

[0075] Specifically, if there exists a cubic sample interpolation function S(x)∈C 2 [a,b], in each small interval [x i ,x i+1 ] is a cubic polynomial, where a=x0 <x1<…<x n =b,y j =f(x j )(j=0,1,…,n), then the interpolation on the missing data points of historical transaction data is expressed as follows:

[0076] S(x j )=y j ,j=0,1,…,n;

[0077] Where x j is the jth missing data point in the historical transaction data, y j For x j The padding value inserted above.

[0078] Then, a number of sampling points are selected and the historical transaction data after data repair is resampled according to the sampling points to obtain a multi-scale data matrix.

[0079] Specifically, based on transaction conditions and data in the power market, sampling points are selected from multiple time windows in historical electricity price time series data, multiple meteorological factors in historical meteorological data, and different energy types in historical load data. This is because users have different electricity consumption characteristics in different time windows. For example, in summer, load demand is higher due to users running air conditioners, and time-of-use electricity prices are different during peak and low-peak periods. Furthermore, different meteorological factors such as sunlight and rainfall can affect the output of distributed power sources, which in turn affects load data.

[0080] For example, the time window used in this embodiment includes year, month, day, hour, and minute; the meteorological factors include dew point, temperature, wind speed, and wind direction; the energy types include wind power output data and photovoltaic output data; and the load data also includes system load data and tie line load data. Therefore, this embodiment sets a total of 11 sampling points. The data obtained from the historical transaction data at these 11 sampling points at sampling time t can form a column vector, specifically:

[0081] x t =[·x 1,t ·x 2,t ...x 11,t ] T ;

[0082] Where x t is the data corresponding to the 11 sampling points obtained at the tth sampling time.

[0083] As the sampling time increases, the column vector data also increases, so the following time series X can be constructed:

[0084] X=[x1,x2…x t …];

[0085] Then all the data in the obtained time series are standardized. The specific formula is as follows:

[0086]

[0087] Where x' is the standardized data of x, μ is the mean of x, and δ is the standard deviation of x.

[0088] Optionally, the embodiment of the present application also uses a 0-1 normalization method to perform dimension elimination processing on the time series. In other embodiments, a normalization method can be used to perform dimension elimination processing on the time series.

[0089] By setting up multiple sampling points to extract features from historical transaction data, we can effectively integrate data information from different scales and dimensions, and obtain a multi-scale data matrix containing multiple feature quantities, providing strong data support for subsequent exploration of the correlation between feature data and load changes and electricity price changes.

[0090] Step S2: Based on the impact of meteorological factors and time factors on the output of distributed power sources and time-of-use electricity prices, correlation analysis is performed on the multi-scale data matrix, and features related to electricity price changes and load changes are extracted and integrated to obtain multi-dimensional feature data.

[0091] In an embodiment of the present application, electricity price and load are set as target variables. By analyzing the correlation between other features in the multi-scale data matrix and the target variables, features that are strongly correlated with the target variables are found, providing data with a positive impact on load forecasting and electricity price forecasting.

[0092] Correlation refers to the degree of relationship between two or more variables. In data analysis, the correlation coefficient is usually used to measure the degree of correlation between variables. Common correlation coefficients include Pearson's correlation coefficient, Spearman's correlation coefficient, Chebyshev's correlation coefficient, etc. The present application embodiment adopts the Pearson's correlation coefficient (hereinafter referred to as the correlation coefficient), and in other embodiments, other related data mentioned above can be used to perform correlation analysis on the multi-scale data matrix.

[0093] The Pearson correlation coefficient can be used to measure the degree of linear relationship between two variables. If there are two variables, X and Y, the correlation coefficient calculated between X and Y can be understood as follows: when the correlation coefficient is 0, there is no relationship between X and Y; when the value of X increases (decreases), the value of Y also increases (decreases), and the two variables are positively correlated, with a correlation coefficient between 0.00 and 1.00; when the value of X increases (decreases), the value of Y decreases (increases), and the two variables are negatively correlated, with a correlation coefficient between -1.00 and 0.00.

[0094] The larger the absolute value of the correlation coefficient, the stronger the correlation; the closer the correlation coefficient is to 1 or -1, the stronger the correlation; the closer the correlation coefficient is to 0, the weaker the correlation.

[0095] By calculating the correlation coefficient between each feature data in the multi-scale data matrix and the set target variable, the correlation degree between these feature data and the target variable is obtained. The calculation formula of the correlation degree is:

[0096]

[0097] Where, ρ X,Y is the correlation coefficient between variables X and Y, cov is the covariance, and σ is the standard deviation.

[0098] The correlation coefficient is screened by a set strong correlation range to select feature data that is strongly correlated with the target variable.

[0099] Optionally, the strong correlation range set in the embodiment of the present application is 0.6 to 1.0. If the correlation coefficient is between 0.8 and 1.0, it indicates that there is an extremely strong correlation between the corresponding feature data and the target variable; if the correlation coefficient is between 0.6 and 0.8, it indicates that there is a relatively strong correlation between the corresponding feature data and the target variable; if the correlation coefficient is between 0.4 and 0.6, it indicates that there is a moderate degree of correlation between the corresponding feature data and the target variable; if the correlation coefficient is between 0.2 and 0.4, it indicates that there is a weak correlation between the corresponding feature data and the target variable; if the correlation coefficient is between 0.0 and 0.2, it indicates that there is an extremely weak correlation or no correlation between the corresponding feature data and the target variable.

[0100] Through the preset strong correlation range, the strong correlation features are determined, and then the strong correlation features are extracted and fused from the multi-scale data matrix to obtain multi-dimensional feature data.

[0101] Based on the impact of meteorological and time factors on distributed power output and time-of-use electricity prices, a correlation analysis of the multi-scale data matrix is ​​performed using the Pearson correlation coefficient. This aims to quantify the correlation strength between feature data and effectively screen out features that have significant correlation with the target variable, providing key data for load forecasting and electricity price forecasting, and further improving the accuracy of the forecast.

[0102] Figure 2 The correlation analysis results of some data provided for this application show the correlation coefficients between the seven dimensions of multiple selected time windows, system load data and clearing electricity prices. It can be seen that the correlation between clearing electricity prices, system load data, monthly characteristics and time characteristics is relatively large, while the correlation between other factors is relatively small.

[0103] In step S3, the multi-dimensional feature data is input into a preset load-electricity price joint prediction model, and the load and electricity price are predicted respectively by considering the mutual influence between load changes and electricity price changes to obtain load prediction values ​​and electricity price prediction values.

[0104] In this embodiment, a joint load-price forecasting model is constructed based on the Multi-Gate Mixture of Experts (MMoE) network. The MMoE network, also known as a Multi-Gate Mixture of Experts (MMI), is a model that enables multi-objective learning and effectively handles the dependencies between multiple tasks by learning knowledge from them.

[0105] The load-price joint forecasting model based on the MMoE network includes the input layer, task learning layer, forecasting layer, and output layer, specifically:

[0106] (1) The input layer is used to receive the multi-dimensional feature data input into the model, and then transmits this data to the GRU layer. The gated recurrent unit is used to encode the input data, capture the long-term dependencies between the data, and obtain a feature vector sequence of the multi-dimensional feature data. Among them, the GRU layer controls the information flow by updating the gate and resetting the gate to avoid the gradient vanishing problem while maintaining the context information in the sequence. GRU stands for Gated Recurrent Units, also known as gated recurrent units. It is a recurrent neural network unit that can be used to process sequence data;

[0107] (2) The task learning layer is built based on the MMoE network. After receiving the feature vector sequence output by the GRU layer, it creates multiple task modules to learn different features. The outputs of these task modules are shared, and all modules can learn the output content. In this embodiment of the application, two task modules can be set to learn load forecasting and electricity price forecasting.

[0108] A gating layer is set after the task learning layer to assign different learning weights to each task module. The input of the gating layer is the content of the task module output, and the output is the learning weight of each task module. The learning weight can determine how to combine the output of each task module. The learning weight can reflect the coupling relationship between the load forecast and the electricity price forecast in the feature vector sequence; wherein, the coupling relationship includes changes in load demand leading to changes in clearing electricity prices, such as higher power generation costs during peak electricity consumption periods, leading to rising electricity prices; and also includes the impact of changes in clearing electricity prices on load, such as rising clearing electricity prices will lead to reduced electricity consumption by users during peak periods, thereby reducing load;

[0109] (3) The prediction layer receives the output from the task learning layer and is used to process the specific features of the specific task and generate the final prediction. For example, it calculates the load forecast value based on the features related to load forecasting. The input of the prediction layer is the output of the task module after the learning weights are added.

[0110] (4) The output layer can select the output mode according to the requirements of the prediction task; in the embodiment of the present application, classification output and regression output can be used; the classification output uses the softmax activation function for multi-category classification, and the regression output uses the linear activation function for numerical prediction.

[0111] As an improvement to the above scheme, the loss function of the load-electricity price joint prediction model is used to calculate the losses corresponding to the load prediction and the electricity price prediction respectively, and then all the losses are weightedly summed, and the learning weights of the learning task layer are updated according to the weighted summation result.

[0112] Optionally, the embodiment of the present application adopts mean square error as the loss function.

[0113] The multi-dimensional feature data is input into the trained load-electricity price joint prediction model. By considering the mutual influence between load and electricity price, the load and electricity price are predicted respectively to obtain the load prediction value and electricity price prediction value.

[0114] The implementation of the embodiments of the present application has the following beneficial effects:

[0115] The embodiment of the present application first performs data repair operations such as missing value filling and outlier removal on the acquired historical transaction data, and then reconstructs the historical transaction data according to the data dimension, extracts feature data associated with load changes and electricity price changes, reduces redundant data, and improves the efficiency of subsequent data analysis. Then, considering that meteorological factors will affect the output of photovoltaic power generation and wind power generation in distributed new energy, and that time factors in the electricity market affect the setting of time-of-use electricity prices, a correlation analysis is performed on the obtained multi-scale data matrix, aiming to quantify the correlation strength between different variables, extract features that are strongly correlated with load changes and electricity price changes, and fuse these features to effectively integrate data information from different scales and dimensions. Finally, the load-electricity price joint prediction model is used to capture the temporal and spatial dependence of load patterns and electricity prices in multi-dimensional feature data, accurately quantify the mutual influence between load changes and electricity price changes, and obtain electricity price forecast values ​​and load forecast values ​​that are more in line with actual conditions.

[0116] Second embodiment

[0117] Furthermore, in order to implement the electricity price and load forecasting system based on multi-scale feature fusion corresponding to the above method embodiment to achieve the corresponding functions and technical effects, Figure 3 A structural diagram of an electricity price and load forecasting system based on multi-scale feature fusion is provided. For ease of explanation, only the parts related to this embodiment are shown. The electricity price and load forecasting system based on multi-scale feature fusion provided by the embodiment of the present application includes:

[0118] The multi-scale data processing module 201 is used to perform data repair and data reconstruction on the acquired historical transaction data of the power market to obtain a multi-scale data matrix; among them, historical electricity price time series data, historical meteorological data, historical clearing electricity price data and historical load data.

[0119] In the embodiment of the present application, data repair is completed by sequentially removing outliers and filling missing values ​​in the historical transaction data;

[0120] According to the preset sampling nodes, the historical transaction data after data repair is resampled to obtain a multi-scale data matrix.

[0121] The correlation analysis module 202 is used to perform correlation analysis on the multi-scale data matrix based on the impact of meteorological factors and time factors on the output of distributed power sources and time-of-use electricity prices, extract and fuse features related to electricity price changes and load changes, and obtain multi-dimensional feature data.

[0122] In an embodiment of the present application, electricity price and load are set as target variables. By analyzing the correlation between other features in the multi-scale data matrix and the target variables, features that are strongly correlated with the target variables are found, providing data with a positive impact on load forecasting and electricity price forecasting.

[0123] Correlation refers to the degree of relationship between two or more variables. In data analysis, the correlation coefficient is usually used to measure the degree of correlation between variables. Common correlation coefficients include Pearson's correlation coefficient, Spearman's correlation coefficient, Chebyshev's correlation coefficient, etc. The present application embodiment adopts the Pearson's correlation coefficient (hereinafter referred to as the correlation coefficient), and in other embodiments, other related data mentioned above can be used to perform correlation analysis on the multi-scale data matrix.

[0124] The Pearson correlation coefficient can be used to measure the degree of linear relationship between two variables. If there are two variables, X and Y, the correlation coefficient calculated between X and Y can be understood as follows: when the correlation coefficient is 0, there is no relationship between X and Y; when the value of X increases (decreases), the value of Y also increases (decreases), and the two variables are positively correlated, with a correlation coefficient between 0.00 and 1.00; when the value of X increases (decreases), the value of Y decreases (increases), and the two variables are negatively correlated, with a correlation coefficient between -1.00 and 0.00.

[0125] The larger the absolute value of the correlation coefficient, the stronger the correlation; the closer the correlation coefficient is to 1 or -1, the stronger the correlation; the closer the correlation coefficient is to 0, the weaker the correlation.

[0126] By calculating the correlation coefficient between each feature data in the multi-scale data matrix and the set target variable, the correlation degree between these feature data and the target variable is obtained. The calculation formula of the correlation degree is:

[0127]

[0128] Where, ρ X,Y is the correlation coefficient between variables X and Y, cov is the covariance, and σ is the standard deviation.

[0129] The correlation coefficient is screened by a set strong correlation range to select feature data that is strongly correlated with the target variable.

[0130] Optionally, the strong correlation range set in the embodiment of the present application is 0.6 to 1.0. If the correlation coefficient is between 0.8 and 1.0, it indicates that there is an extremely strong correlation between the corresponding feature data and the target variable; if the correlation coefficient is between 0.6 and 0.8, it indicates that there is a relatively strong correlation between the corresponding feature data and the target variable; if the correlation coefficient is between 0.4 and 0.6, it indicates that there is a moderate degree of correlation between the corresponding feature data and the target variable; if the correlation coefficient is between 0.2 and 0.4, it indicates that there is a weak correlation between the corresponding feature data and the target variable; if the correlation coefficient is between 0.0 and 0.2, it indicates that there is an extremely weak correlation or no correlation between the corresponding feature data and the target variable.

[0131] Through the preset strong correlation range, the strong correlation features are determined, and then the strong correlation features are extracted and fused from the multi-scale data matrix to obtain multi-dimensional feature data.

[0132] Based on the impact of meteorological and time factors on distributed power output and time-of-use electricity prices, a correlation analysis of the multi-scale data matrix is ​​performed using the Pearson correlation coefficient. This aims to quantify the correlation strength between feature data and effectively screen out features that have significant correlation with the target variable, providing key data for load forecasting and electricity price forecasting, and further improving the accuracy of the forecast.

[0133] The load-electricity price prediction module 203 is used to input the multi-dimensional feature data into a preset load-electricity price joint prediction model, and predict the load and electricity price respectively by considering the mutual influence between load changes and electricity price changes to obtain load prediction values ​​and electricity price prediction values.

[0134] In this embodiment, a joint load-price forecasting model is constructed based on the Multi-Gate Mixture of Experts (MMoE) network. The MMoE network, also known as a Multi-Gate Mixture of Experts (MMI), is a model that enables multi-objective learning and effectively handles the dependencies between multiple tasks by learning knowledge from them.

[0135] The load-price joint forecasting model based on the MMoE network includes the input layer, task learning layer, forecasting layer, and output layer, specifically:

[0136] (1) The input layer is used to receive the multi-dimensional feature data input into the model, and then transmits this data to the GRU layer. The gated recurrent unit is used to encode the input data, capture the long-term dependencies between the data, and obtain a feature vector sequence of the multi-dimensional feature data. Among them, the GRU layer controls the information flow by updating the gate and resetting the gate to avoid the gradient vanishing problem while maintaining the context information in the sequence. GRU stands for Gated Recurrent Units, also known as gated recurrent units. It is a recurrent neural network unit that can be used to process sequence data;

[0137] (2) The task learning layer is built based on the MMoE network. After receiving the feature vector sequence output by the GRU layer, it creates multiple task modules to learn different features. The outputs of these task modules are shared, and all modules can learn the output content. In this embodiment of the application, two task modules can be set to learn load forecasting and electricity price forecasting.

[0138] A gating layer is set after the task learning layer to assign different learning weights to each task module. The input of the gating layer is the content of the task module output, and the output is the learning weight of each task module. The learning weight can determine how to combine the output of each task module. The learning weight can reflect the coupling relationship between the load forecast and the electricity price forecast in the feature vector sequence; wherein, the coupling relationship includes changes in load demand leading to changes in clearing electricity prices, such as higher power generation costs during peak electricity consumption periods, leading to rising electricity prices; and also includes the impact of changes in clearing electricity prices on load, such as rising clearing electricity prices will lead to reduced electricity consumption by users during peak periods, thereby reducing load;

[0139] (3) The prediction layer receives the output from the task learning layer and is used to process the specific features of the specific task and generate the final prediction. For example, it calculates the load forecast value based on the features related to load forecasting. The input of the prediction layer is the output of the task module after the learning weights are added.

[0140] (4) The output layer can select the output mode according to the requirements of the prediction task; in the embodiment of the present application, classification output and regression output can be used; the classification output uses the softmax activation function for multi-category classification, and the regression output uses the linear activation function for numerical prediction.

[0141] As an improvement to the above scheme, the loss function of the load-electricity price joint prediction model is used to calculate the losses corresponding to the load prediction and the electricity price prediction respectively, and then all the losses are weightedly summed, and the learning weights of the learning task layer are updated according to the weighted summation result.

[0142] Optionally, the embodiment of the present application adopts mean square error as the loss function.

[0143] The multi-dimensional feature data is input into the trained load-electricity price joint prediction model. By considering the mutual influence between load and electricity price, the load and electricity price are predicted respectively to obtain the load prediction value and electricity price prediction value.

[0144] In some embodiments, the multi-scale data processing module 201 is specifically:

[0145] Obtain a large amount of historical transaction data from the electricity market and obtain characteristic data at multiple scales, including historical electricity price time series data, historical meteorological data, historical clearing electricity price data, and historical load data.

[0146] These historical transaction data may have some outliers or missing data due to problems with the collection equipment. Therefore, it is necessary to first repair the historical transaction data and then obtain a multi-scale data matrix through data reconstruction.

[0147] Data repair is mainly divided into outlier removal and missing value filling. The embodiment of the present application uses the lonely forest algorithm to remove outliers and fills missing values ​​through interpolation.

[0148] The Lonely Forest algorithm is a highly effective outlier detection method, particularly suitable for high-dimensional datasets. Its core concept is to isolate outliers by constructing a random binary tree (i.e., a "forest"). Because outliers often have distinct properties from other normal data points, they are more easily isolated during the random partitioning of data, enabling rapid location of outliers. The steps for removing outliers from historical trading data using the Lonely Forest algorithm are as follows:

[0149] (1) Randomly select a feature data in the historical transaction data and randomly select a cutting point within the feature value range;

[0150] (2) Using the selected feature data and cut points as segmentation rules, the historical transaction data is divided into two subsets;

[0151] (3) Recursively repeat the above two steps to obtain several subsets until there is only one data point in each subset or the preset maximum tree depth is reached, then stop splitting;

[0152] (4) construct random trees based on the obtained subsets, and form a random forest through all random trees;

[0153] (5) Calculate the path length of each data point in the random forest in the historical transaction data, that is, the average number of edges from the root node of the random forest to the data point;

[0154] (6) The abnormality degree of the corresponding data point is measured according to the path length. Generally, a shorter path length indicates an abnormal data point that is easily isolated, while a longer path length indicates a normal data point in the historical transaction data;

[0155] (7) Screening data points based on a preset abnormality threshold to identify and eliminate abnormal data points in historical transaction data.

[0156] Through the above process, we can finally obtain the historical transaction data with outliers removed.

[0157] Optionally, in the embodiment of the present application, the maximum tree depth of the lonely forest is set to 8, and the maximum number of random trees is set to 100. In other embodiments, it can be flexibly adjusted according to the needs of a specific data set.

[0158] Then, the interpolation method is used to fill in the historical transaction data after the outliers are eliminated. In the embodiment of the present application, a cubic sample interpolation function is selected for filling.

[0159] Specifically, if there exists a cubic sample interpolation function S(x)∈C 2 [a,b], in each small interval [x i ,x i+1 ] is a cubic polynomial, where a=x0 <x1<…<x n =b,y j =f(x j )(j=0,1,…,n), then the interpolation on the missing data points of historical transaction data is expressed as follows:

[0160] S(x j )=y j ,j=0,1,…,n;

[0161] Where x j is the jth missing data point in the historical transaction data, y j For x j The padding value inserted above.

[0162] Then, a number of sampling points are selected and the historical transaction data after data repair is resampled according to the sampling points to obtain a multi-scale data matrix.

[0163] Specifically, based on transaction conditions and data in the power market, sampling points are selected from multiple time windows in historical electricity price time series data, multiple meteorological factors in historical meteorological data, and different energy types in historical load data. This is because users have different electricity consumption characteristics in different time windows. For example, in summer, load demand is higher due to users running air conditioners, and time-of-use electricity prices are different during peak and low-peak periods. Furthermore, different meteorological factors such as sunlight and rainfall can affect the output of distributed power sources, which in turn affects load data.

[0164] For example, the time window used in this embodiment includes year, month, day, hour, and minute; the meteorological factors include dew point, temperature, wind speed, and wind direction; the energy types include wind power output data and photovoltaic output data; and the load data also includes system load data and tie line load data. Therefore, this embodiment sets a total of 11 sampling points. The data obtained from the historical transaction data at these 11 sampling points at sampling time t can form a column vector, specifically:

[0165] x t =[·x 1,t ·x 2,t ...x 11,t ] T ;

[0166] Where x t is the data corresponding to the 11 sampling points obtained at the tth sampling time.

[0167] As the sampling time increases, the column vector data also increases, so the following time series X can be constructed:

[0168] X=[x1,x2…x t …];

[0169] Then all the data in the obtained time series are standardized. The specific formula is as follows:

[0170]

[0171] Where x' is the standardized data of x, μ is the mean of x, and δ is the standard deviation of x.

[0172] Optionally, the embodiment of the present application also uses a 0-1 normalization method to perform dimension elimination processing on the time series. In other embodiments, a normalization method can be used to perform dimension elimination processing on the time series.

[0173] By setting up multiple sampling points to extract features from historical transaction data, we can effectively integrate data information from different scales and dimensions, and obtain a multi-scale data matrix containing multiple feature quantities, providing strong data support for subsequent exploration of the correlation between feature data and load changes and electricity price changes.

[0174] The implementation of the embodiments of the present application has the following beneficial effects:

[0175] The embodiment of the present application first performs data repair operations such as missing value filling and outlier removal on the acquired historical transaction data, and then reconstructs the historical transaction data according to the data dimension, extracts feature data associated with load changes and electricity price changes, reduces redundant data, and improves the efficiency of subsequent data analysis. Then, considering that meteorological factors will affect the output of photovoltaic power generation and wind power generation in distributed new energy, and that time factors in the electricity market affect the setting of time-of-use electricity prices, a correlation analysis is performed on the obtained multi-scale data matrix, aiming to quantify the correlation strength between different variables, extract features that are strongly correlated with load changes and electricity price changes, and fuse these features to effectively integrate data information from different scales and dimensions. Finally, the load-electricity price joint prediction model is used to capture the temporal and spatial dependence of load patterns and electricity prices in multi-dimensional feature data, accurately quantify the mutual influence between load changes and electricity price changes, and obtain electricity price forecast values ​​and load forecast values ​​that are more in line with actual conditions.

[0176] Further, Figure 4 This is a structural diagram of a terminal device provided in one embodiment of the present application. Figure 4 As shown, the terminal device 3 of this embodiment includes: at least one processor 30 (in Figure 4 Only one is shown) and a memory 31 and a computer program 32 stored in the memory 31 and executable on the at least one processor. When the processor 30 executes the computer program 32, the steps of a method for electricity price and load forecasting based on multi-scale feature fusion as described in any one of the embodiments of the present application can be implemented.

[0177] The terminal device 3 may be a computing device such as a desktop computer, a cloud server, or a laptop computer. The computing device may include but is not limited to a processor 30 and a memory 31 . Figure 4 This is merely an example of the terminal device 3 and does not constitute a limitation on the terminal device 3 , which may include more or fewer components than those shown in the figure.

[0178] The specific embodiments described above further illustrate the purpose, technical solutions, and beneficial effects of this application. It should be understood that the above description is merely a specific embodiment of this application and is not intended to limit the scope of protection of this application. In particular, it should be noted that for those skilled in the art, any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of this application should be included in the scope of protection of this application.

Claims

1. A method for electricity price and load forecasting based on multi-scale feature fusion, characterized in that: include: Performing data repair and data reconstruction on the acquired historical transaction data of the power market to obtain a multi-scale data matrix; wherein the historical transaction data includes historical electricity price time series data, historical meteorological data, historical clearing electricity price data, and historical load data; Based on the impact of meteorological and time factors on distributed power output and time-of-use electricity prices, a correlation analysis is performed on the multi-scale data matrix, and features related to electricity price changes and load changes are extracted and integrated to obtain multi-dimensional feature data. The multi-dimensional feature data is input into the preset load-electricity price joint forecasting model. By considering the mutual influence between load changes and electricity price changes, the load and electricity price are predicted respectively to obtain the load forecast value and electricity price forecast value.

2. The method for electricity price and load forecasting based on multi-scale feature fusion according to claim 1, characterized in that: The data repair and data reconstruction of the acquired historical transaction data of the power market are performed to obtain a multi-scale data matrix, specifically: Data repair is completed by sequentially removing outliers and filling missing values ​​in the historical transaction data; According to the preset sampling nodes, the historical transaction data after data repair is resampled to obtain a multi-scale data matrix.

3. The method for electricity price and load forecasting based on multi-scale feature fusion according to claim 2, characterized in that: The above-mentioned outlier removal is carried out in sequence on the historical transaction data, specifically: The historical transaction data is randomly divided using the lonely forest algorithm to obtain several subsets; Constructing a corresponding random forest based on the subset, and calculating the path length of each data point in the historical transaction data in the random forest; The abnormality degree of each data point in the historical transaction data is calculated according to the path length, and the abnormal points in the historical transaction data are determined.

4. The method for electricity price and load forecasting based on multi-scale feature fusion according to claim 2, characterized in that: According to the preset sampling nodes, the historical transaction data after data repair is resampled to obtain a multi-scale data matrix, specifically: Based on the actual situation of the electricity market, the first threshold sampling nodes are determined from the perspectives of time, meteorological factors and energy types; According to the sampling nodes, the historical transaction data after data repair is resampled in units of preset sampling time to construct a multi-scale data matrix based on time series; wherein the first threshold number of sampling nodes corresponds to a column vector in the multi-scale data matrix.

5. The method for electricity price and load forecasting based on multi-scale feature fusion according to claim 1, characterized in that: Based on the impact of meteorological and time factors on the output of distributed power sources and time-of-use electricity prices, a correlation analysis is performed on the multi-scale data matrix, and features related to electricity price changes and load changes are extracted and integrated to obtain multi-dimensional feature data, specifically: Setting electricity price and load as target variables, and calculating the correlation coefficient between each characteristic data in the multi-scale data matrix and the target variables based on the influence of meteorological factors and time factors on the output of distributed power sources and time-of-use electricity prices; Extracting and fusing strongly correlated features from the multi-scale data matrix to obtain multi-dimensional feature data; wherein the strongly correlated features are the feature data whose correlation coefficients satisfy a preset strongly correlated range.

6. The method for electricity price and load forecasting based on multi-scale feature fusion according to claim 5, characterized in that: The correlation coefficient is specifically: The calculation formula of the correlation coefficient is: Where, ρ X,Y is the correlation coefficient between variables X and Y, cov is the covariance, and σ is the standard deviation.

7. The method for electricity price and load forecasting based on multi-scale feature fusion according to claim 1, characterized in that: The multi-dimensional feature data is input into the preset load-electricity price joint prediction model, and the load and electricity price are predicted respectively by considering the mutual influence between load changes and electricity price changes to obtain load prediction values ​​and electricity price prediction values, specifically: The load-electricity price joint prediction model includes an input layer, a task learning layer, a prediction layer and an output layer; Inputting the multi-dimensional feature data into the input layer of the load-electricity price joint prediction model to obtain a feature vector sequence of the multi-dimensional feature data; Capturing the coupling relationship between load forecasting and electricity price forecasting in the feature vector sequence through the task learning layer; The load forecast and the electricity price forecast are performed respectively through the forecast layer and the coupling relationship, and then the load forecast value and the electricity price forecast value are output through the output layer.

8. The method for electricity price and load forecasting based on multi-scale feature fusion according to claim 7, characterized in that: Also includes: Calculating the losses corresponding to the load forecast and the electricity price forecast respectively through the loss function of the load-electricity price joint forecast model; All the losses are weighted summed, and the learning weights of the learning task layer are updated according to the weighted summation result.

9. An electricity price and load forecasting system based on multi-scale feature fusion, characterized in that: include: Multi-scale data processing module, correlation analysis module and load-electricity price prediction module; The multi-scale data processing module is used to perform data repair and data reconstruction on the acquired historical transaction data of the power market to obtain a multi-scale data matrix; wherein the historical transaction data includes historical electricity price time series data, historical meteorological data, historical clearing electricity price data and historical load data; The correlation analysis module is used to perform correlation analysis on the multi-scale data matrix based on the impact of meteorological and time factors on distributed power output and time-of-use electricity prices, extract and fuse features related to electricity price changes and load changes, and obtain multi-dimensional feature data; The load-electricity price forecasting module is used to input multi-dimensional feature data into the preset load-electricity price joint forecasting model, and predict the load and electricity price respectively by considering the mutual influence between load changes and electricity price changes to obtain load forecast values ​​and electricity price forecast values.

10. A terminal device, characterized in that: The method comprises a processor and a memory, wherein the memory stores a computer program, and when the processor executes the computer program, the method implements the steps of an electricity price and load forecasting method based on multi-scale feature fusion according to any one of claims 1 to 8.