Short-term electricity price prediction method and system based on MIC-TCN-Transform model

By using the MIC-TCN-Transformer model, combining MIC for feature selection, TCN captures time series features, and Transformer captures global dependencies, solving the problem of low electricity price prediction accuracy in the existing technology, and achieving more efficient and accurate electricity price prediction.

CN119398829APending Publication Date: 2025-02-07XI AN JIAOTONG UNIV +1
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411532380.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-30
Publication Date
2025-02-07

AI Technical Summary

Technical Problem

It is difficult for the prior art to accurately predict the short-term electricity price in the power market, especially when facing a variety of complex influencing factors, the prediction accuracy is low.

Method used

The short-term electricity price prediction method based on the MIC-TCN-Transformer model is adopted to select features through the maximum information coefficient (MIC), and combine the time convolution network (TCN) and the Transformer model to capture the local and global features in the electricity price data.

Benefits of technology

It significantly improves the accuracy and reliability of electricity price prediction, can better capture the complexity and dynamics of the power market, and is suitable for scenarios with high volatility in the power market.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119398829A_ABST
    Figure CN119398829A_ABST
Patent Text Reader

Abstract

The invention discloses a short-term electricity price prediction method and system based on an MIC-TCN-Transform model, and the method comprises the steps: obtaining electricity price prediction data from different data sources, and integrating the electricity price prediction data into a unified format and structure; performing integrity, continuity, consistency and rationality check on the data, cleaning unqualified data, performing feature extraction and selection on a data set, performing normalization processing on all the data, and segmenting the data set into a training set, a verification set and a test set; the method comprises the following steps: defining a TCN model and a Transform model, and creating an MIC-TCN-Transform model; an optimizer and a loss function are configured, the MIC-TCN-Transform model is trained by using the training set, and the MIC-TCN-Transform model is evaluated by using the verification set; and the test set is inputted into the trained MIC-TCN-Transformer model, and a prediction result is obtained. Reasonable configuration and utilization of renewable energy sources can be effectively promoted, and the reliability and stability of a power system are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of electricity price prediction in the power market, and specifically relates to a short-term electricity price prediction method and system based on a MIC-TCN-Transformer model. Background Art

[0002] With the deepening of global energy transformation and power industry reform, the power market is undergoing unprecedented changes. This change is not only reflected in the technical and economic aspects, but also involves the long-term goals of social and environmental development. In this context, the volatility and uncertainty of electricity prices are not only closely related to traditional supply and demand relationships, fuel prices and other factors, but also affected by a variety of internal and external factors such as the "dual carbon" goals (i.e. carbon peak and carbon neutrality), new energy development, the behavior of market participants, and macroeconomic policies.

[0003] First, the "dual carbon" goal points out the direction for the development of the electricity market, requiring the energy structure to gradually shift from fossil fuels to renewable energy. This shift directly affects the production cost and supply stability of electricity, and increases the volatility of electricity prices. For example, new energy generation such as wind and solar power is intermittent and volatile, and their large-scale access makes the balance of electricity supply and demand more complicated.

[0004] Secondly, the rapid development of new energy has changed the competitive landscape of the electricity market. On the one hand, the cost of new energy power generation has gradually decreased, improving its competitiveness in the market; on the other hand, the subsidy policy and incentive mechanism for new energy are also constantly adjusting. These policy changes directly affect the return on investment and market participation of new energy power generation. In addition, with the advancement of battery energy storage technology and the reduction of costs, the responsiveness of the user side has been enhanced, further increasing the dynamism and uncertainty of the market.

[0005] Furthermore, the market power of power generators is also an important factor affecting electricity prices. In some cases, power generators with a large market share may influence market prices by manipulating supply, which may lead to abnormal fluctuations in electricity prices. Therefore, regulators need to pay close attention to market dynamics and formulate corresponding policy measures to prevent market manipulation and unfair competition.

[0006] Finally, changes in macroeconomic policies and the external environment will also have an impact on electricity prices. For example, adjustments in monetary policy will affect the financing costs of power projects, while changes in the international trade situation may affect the cost of importing fuels. These factors will be reflected in electricity prices by affecting the supply and demand relationship in the electricity market.

[0007] Faced with these complex and changing influencing factors, traditional forecasting methods are obviously unable to meet the needs of accurately predicting electricity prices. Therefore, using deep learning technology, especially combining advanced technologies such as long short-term memory networks (LSTM) and convolutional neural networks (CNN), to build more comprehensive and flexible forecasting models has become a research focus. These models can better capture and analyze nonlinear relationships and long-term dependency features in historical data, thereby improving the accuracy of electricity price forecasts. However, even the most advanced models still face challenges when dealing with such multi-dimensional and highly uncertain data, and need to be continuously optimized and improved. Summary of the invention

[0008] The technical problem to be solved by the present invention is to provide a short-term electricity price forecasting method and system based on the MIC-TCN-Transformer model to address the deficiencies in the above-mentioned prior art, combining the maximum information coefficient (MIC), temporal convolutional network (TCN) and Transformer's innovative model structure to better capture the local and global features in electricity price data, significantly improve the forecasting accuracy, and solve the technical problems of large volatility and low forecasting accuracy in the electricity market.

[0009] The present invention adopts the following technical solutions: A short-term electricity price forecasting method based on the MIC-TCN-Transformer model includes the following steps: Obtain electricity price forecast data from different data sources and integrate the electricity price forecast data into a unified format and structure; Check the data for completeness, continuity, consistency, and rationality, clean unqualified data, extract and select features from the data set, normalize all data, and split the data set into training, validation, and test sets; Define TCN and Transformer models and create MIC-TCN-Transformer model; Configure the optimizer and loss function, train the MIC-TCN-Transformer model using the training set, and evaluate the MIC-TCN-Transformer model using the validation set; The test set is input into the trained MIC-TCN-Transformer model to obtain the prediction results.

[0010] Preferably, the electricity price forecast data includes historical electricity price data, primary energy and new energy output information, historical load data, fuel prices, temperature, humidity, and date type.

[0011] Preferably, the electricity price forecast data is integrated into a unified format and structure as follows: Arrange the feature factor sequence by columns, with the last column as the feature factor sequence to be predicted, ensuring that all data are aligned on the time axis.

[0012] Preferably, the data is checked for integrity, continuity, consistency, and rationality, unqualified data is cleaned, feature extraction and selection are performed on the data set, all data are normalized, and the data set is divided into a training set, a validation set, and a test set. Specifically: Check the integrity of the data to see if there are any missing values; check the continuity of the data to see if the data is continuous in time; check the consistency of the data to see if the units of the same type of data are consistent; check the rationality of the data and use the interquartile range method to check if there are any outliers in the data; The missing values ​​of the data are filled using spline interpolation. After removing the outliers, the original positions are filled using spline interpolation. Extract time features and screen MIC multi-dimensional features from the data set; Normalize the data of each factor affecting electricity price; The dataset is split into training set, validation set, and test set in a ratio of 80:10:10.

[0013] Preferably, the four-quartile method is used to check whether there are outliers in the data: Calculate the quartiles, represents the first quartile, which is 25% of the data; Indicates the third quartile, which is 75% of the data; calculates the upper limit of the data ; Calculate the lower limit of data ;in, Outliers are judged based on the obtained data upper and lower limits. When a data point is less than the lower limit or greater than the upper limit, it is an outlier.

[0014] Preferably, the time feature extraction and MIC multi-dimensional feature screening of the data set are specifically performed as follows: Calculate the correlation of historical electricity data with the same position number in any dimension and historical electricity price dimension, arrange the multidimensional influencing factors and the MIC values ​​of historical electricity prices from large to small, and select characteristic factors with MIC values ​​greater than 0.3 as input data of the prediction model; when the model evaluation performance determination coefficient is less than 0.88 or the mean absolute percentage error is greater than 10%, select characteristic factors with MIC greater than 0.5; extract hour, day of the week, month, season, and weekday features from the date information and add them to the data set as additional characteristic factors.

[0015] Preferably, the MIC-TCN-Transformer model is specifically: The Transformer model includes input embedding, position encoding, multi-head self-attention mechanism, feedforward neural network, residual connection and normalization, and output layer; Set the number of encoder and decoder layers of the Transformer model; set the feature space dimensions, set the dimensions of the hidden layer of the feedforward neural network; Set the number of heads of the multi-head attention mechanism and the dropout rate of the dropout layer; Create the input layer, defining the model’s input shape and the number of data features per time step; Create two TCN modules, which contain causal convolutional layers, dilated convolutional layers, residual connections, regularization, and activation; define a convolutional block of the TCN module to extract temporal features of time series data, using a list of different dilation factors to capture multiple temporal dependencies; the number of convolutional kernels in the second one is greater than the number of convolutional kernels in the first one; Create a Transformer output layer and use the output of the second TCN module as the input of the Transformer model.

[0016] Preferably, the MIC-TCN-Transformer model is optimized using the Adam optimizer, using the mean square error as the loss function; multiple rounds of iterations are performed using the training set, and the parameters are updated by the specified batch size; after each iteration, the MIC-TCN-Transformer model is evaluated by the validation set.

[0017] Preferably, the predicted results and actual values ​​are denormalized and restored to the original scale; the determination coefficient, mean absolute error, mean square error, root mean square error, and mean absolute percentage error are used for evaluation, as follows:

[0018]

[0019]

[0020]

[0021] in, represents the actual value, represents the predicted value, is the selected number of hours, is the average of the actual values.

[0022] In a second aspect, an embodiment of the present invention provides a short-term electricity price prediction system based on a MIC-TCN-Transformer model, comprising: The data module obtains electricity price forecast data from different data sources and integrates the electricity price forecast data into a unified format and structure; The preprocessing module checks the integrity, continuity, consistency, and rationality of the obtained data, cleans unqualified data, extracts and selects features from the data set, normalizes all data, and divides the data set into training set, validation set, and test set; Build modules, define TCN and Transformer models, and create a MIC-TCN-Transformer model; The training module configures the optimizer and loss function, trains the MIC-TCN-Transformer model using the training set, and evaluates the MIC-TCN-Transformer model using the validation set; The prediction module inputs the test set into the trained MIC-TCN-Transformer model to obtain the prediction results.

[0023] In a third aspect, a computer device comprises a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above-mentioned short-term electricity price forecasting method based on the MIC-TCN-Transformer model when executing the computer program.

[0024] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, comprising a computer program, which, when executed by a processor, implements the steps of the above-mentioned short-term electricity price forecasting method based on the MIC-TCN-Transformer model.

[0025] In a fifth aspect, a chip comprises a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above-mentioned short-term electricity price forecasting method based on the MIC-TCN-Transformer model when executing the computer program.

[0026] In a sixth aspect, an embodiment of the present invention provides an electronic device, including a computer program, which, when executed by the electronic device, implements the steps of the above-mentioned short-term electricity price prediction method based on the MIC-TCN-Transformer model.

[0027] Compared with the prior art, the present invention has at least the following beneficial effects: A short-term electricity price forecasting method based on the MIC-TCN-Transformer model excels in dimensionality reduction, complexity management, and capturing local and global dependencies. Feature selection and dimensionality reduction using the maximum information coefficient (MIC) effectively reduce the dimensionality of the input data, significantly reduce the complexity of the model, and improve computational efficiency. The temporal convolutional network (TCN) module captures local dependencies in time series data and accurately models short-term electricity price fluctuations. The Transformer module uses a self-attention mechanism to simultaneously capture global dependencies and identify potential patterns and trends over long time spans. This combination retains sensitivity to local details while ensuring a deep understanding of global changes, thereby significantly improving the accuracy and reliability of electricity price forecasts.

[0028] Furthermore, the purpose of setting the electricity price forecast data is to fully capture the multidimensional factors that affect electricity price fluctuations and improve the accuracy and stability of the forecast. Since electricity prices have time series and periodic characteristics, the fluctuations usually have daily, weekly, monthly, seasonal and other periodic laws, so historical electricity price data provides an important reference. Changes in the output of primary energy (such as coal, natural gas) and new energy (such as wind energy, solar energy) directly affect the power supply, thereby affecting electricity prices. Historical load data can help the model predict future load trends. Changes in fuel prices are an important driving factor for electricity price fluctuations, directly affecting the cost of power generation, and thus affecting electricity prices. Temperature and humidity are important meteorological factors that affect electricity demand. When the temperature is high, the demand for air conditioning electricity increases, and humidity affects energy consumption efficiency, which also indirectly affects electricity demand. The date type reflects the different electricity consumption patterns on weekdays, weekends and holidays. The date type will affect load demand and electricity price fluctuations.

[0029] Furthermore, the electricity price forecast data is integrated into a unified format and structure, with the aim of providing consistency and standardization for the model input, so as to give full play to the characteristics of the time series model and improve the prediction accuracy. By arranging the various feature data in columns and arranging the time series as rows, a matrix structure is formed. Each column represents a feature factor, and the last column is the target sequence to be predicted. This arrangement ensures that all input data are aligned in the time dimension, which helps the model understand the correlation between different features at different time points. The key to time alignment is to ensure that the feature information of each time point (such as electricity price, load, temperature, etc. at the same time) is input into the model at the same time to avoid the impact of data lag or disorder on the prediction. The time alignment of all data ensures that the model can correctly capture the regularity in the time series.

[0030] Furthermore, the data is checked for integrity, continuity, consistency, and rationality, unqualified data is cleaned, features are extracted and selected for the data set, all data are normalized, and the data set is divided into training, validation, and test sets. The integrity check can ensure that all input data has corresponding values ​​at each time point to avoid errors caused by missing data during model training. By filling missing values, the model can obtain complete input and avoid information loss. The continuity check can ensure that the data is continuous in time and avoid breakpoints or jumps in time series data, thereby ensuring that the model can correctly capture the time series pattern. The consistency check avoids the imbalance of feature weights caused by numerical differences, and improves the learning efficiency and prediction accuracy of the model. The rationality check eliminates outliers to avoid extreme values ​​from misleading the model or the model overfitting to noise data.

[0031] Spline interpolation is used to smoothly fill in missing data to ensure data continuity while retaining the trend and volatility of the time series.

[0032] Extract time features (such as hours, days of the week, holidays, etc.) and use MIC (maximum information coefficient) to filter the most relevant features, reduce redundant features, and improve the learning efficiency of the model.

[0033] Normalization processing normalizes the data of all factors affecting electricity prices so that the eigenvalues ​​fall within the same numerical range, avoiding the situation where some eigenvalues ​​are too large and the model assigns them higher weights.

[0034] By dividing the dataset into a training set (80%), a validation set (10%), and a test set (10%), we can ensure that the model is properly evaluated at different stages. The training set is used to train the model, the validation set is used to adjust parameters and prevent overfitting, and the test set is used to evaluate the generalization ability of the model.

[0035] Furthermore, the four-quartile method is used to check whether there are outliers in the data. The purpose is to effectively remove extreme points far away from most of the data to prevent these outliers from causing deviations in the distribution of data and model learning. Specifically, removing outliers helps reduce noise interference and avoid overfitting of the model to extreme data, thereby improving the ability to learn the overall trend. By removing outliers, the data becomes more stable and consistent, and the model can more accurately capture normal fluctuations, ultimately improving the accuracy and robustness of electricity price forecasts.

[0036] Furthermore, the data set is subjected to time feature extraction and MIC multidimensional feature screening settings, the purpose of which is to improve the accuracy and robustness of short-term electricity price forecasts. Through time feature extraction, the implicit periodicity and trend information in the data set can be captured, helping the model to better understand the law of electricity price changes over time. MIC multidimensional feature screening helps to select the most relevant features to electricity prices from multiple dimensions, reduce the interference of redundant information, and further improve the prediction accuracy. This method combines time and multidimensional feature screening to enable the model to more effectively adapt to electricity price fluctuations in different market environments.

[0037] Furthermore, the MIC-TCN-Transformer model effectively handles the complexity of the power market by using MIC to reduce dimensions, TCN to capture short-term fluctuations, and Transformer to identify global trends, and can provide reliable decision support for power generators and users. The model performs well in short-term electricity price forecasting and is suitable for actual market demand.

[0038] Furthermore, the Adam optimizer optimizes the MIC-TCN-Transformer model, using the mean square error as the loss function; uses the training set for multiple rounds of iterations, and updates the parameters through the specified batch size; after each iteration, the MIC-TCN-Transformer model is evaluated through the validation set, the purpose of which is to dynamically adjust the learning rate by estimating the first-order and second-order momentum of the gradient of each parameter. Compared with the traditional gradient descent method, Adam can perform more stably in a high-noise data environment, accelerate convergence, and reduce the model from being trapped in the local optimal solution.

[0039] MSE penalizes large deviations between the predicted value and the true value, encouraging the model to continuously reduce the error through iteration, thereby making the model's prediction of electricity prices more accurate. Using MSE as a loss function can intuitively reflect the prediction effect of the model, especially for regression tasks. Its sensitivity to large errors can prompt the model to quickly correct large deviations and improve the accuracy of electricity price prediction.

[0040] The model is trained through multiple epochs, and the model parameters are gradually optimized. At the same time, a specified batch size is used for mini-batch gradient descent to control the amount of data to update the parameters in each iteration. Each iteration uses the entire training set for parameter update, and with mini-batch gradient descent, the model uses a random portion of the data for training at each update, which can avoid excessive gradient oscillation and improve the stability of training.

[0041] Evaluating the model through the validation set can help monitor the training effect, optimize the hyperparameter settings, and prevent the model from overfitting the training set, thereby improving the model's generalization ability and prediction accuracy.

[0042] Furthermore, the prediction results and actual values ​​are denormalized and restored to their original scale; the determination coefficient, mean absolute error, mean square error, root mean square error, and mean absolute percentage error are used to evaluate the prediction accuracy and stability of the MIC-TCN-Transformer model. R² evaluates the degree of fit of the model to the actual electricity price, MAE and MAPE provide evaluations of the average error and percentage error, and MSE and RMSE focus more on the impact of large errors, ensuring that the model can not only accurately predict the trend of electricity prices, but also effectively reduce large deviations and improve its reliability and performance in practical applications.

[0043] It can be understood that the beneficial effects of the second to sixth aspects mentioned above can be found in the relevant description of the first aspect mentioned above, and will not be repeated here.

[0044] In summary, the present invention can effectively promote the rational allocation and utilization of renewable energy and improve the reliability and stability of the power system.

[0045] The technical solution of the present invention is further described in detail below through the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] Figure 1 It is the schematic diagram of the module of the method of the present invention; Figure 2 It is a flowchart of the overall process of the method of the present invention; Figure 3 It is a flow chart of the preprocessing module of the method of the present invention; Figure 4 A schematic diagram of a computer device provided by an embodiment of the present invention; Figure 5 A block diagram of a chip provided according to an embodiment of the present invention; Figure 6 This is the error histogram of the TCN-Transformer model; Figure 7 It is the scatter fitting diagram of the TCN-Transformer model; Figure 8 This is the loss graph of the TCN-Transformer model; Fig. 9 This is a diagram of electricity price forecast data for the Australian electricity market according to an embodiment of the present invention. DETAILED DESCRIPTION

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

[0048] In the description of the present invention, it should be understood that the terms “include” and “comprises” indicate the presence of described features, wholes, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or collections thereof.

[0049] It should also be understood that the terms used in the present specification are only for the purpose of describing specific embodiments and are not intended to limit the present invention. As used in the present specification and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.

[0050] It should be further understood that the term "and / or" used in the present specification and the appended claims refers to any combination of one or more of the associated listed items and all possible combinations, and includes these combinations. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in the present invention generally indicates that the associated objects are in an "or" relationship.

[0051] It should be understood that, although the terms first, second, third, etc. may be used to describe preset ranges, etc. in the embodiments of the present invention, these preset ranges should not be limited to these terms. These terms are only used to distinguish preset ranges from each other. For example, without departing from the scope of the embodiments of the present invention, the first preset range may also be referred to as the second preset range, and similarly, the second preset range may also be referred to as the first preset range.

[0052] The word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrases "if it is determined" or "if (stated condition or event) is detected" may be interpreted as "when it is determined" or "in response to determining" or "when detecting (stated condition or event)" or "in response to detecting (stated condition or event)", depending on the context.

[0053] Various structural schematic diagrams of the embodiments disclosed in the present invention are shown in the accompanying drawings. These figures are not drawn to scale, and some details are magnified and some details may be omitted for the purpose of clear expression. The shapes of various regions and layers shown in the figures and the relative sizes and positional relationships therebetween are only exemplary, and may deviate in practice due to manufacturing tolerances or technical limitations, and those skilled in the art may additionally design regions / layers with different shapes, sizes, and relative positions according to actual needs.

[0054] The present invention provides a short-term electricity price forecasting method based on the MIC-TCN-Transformer model. The MIC module screens multi-dimensional features that are highly correlated with electricity price changes, fully captures complex nonlinear relationships, and uses a temporal convolutional network (TCN) for feature extraction to capture the time dependency of electricity market data. Combined with the self-attention mechanism of the Transformer model, it predicts future electricity prices in a more efficient and accurate manner. By analyzing historical electricity price data, meteorological data, and high-dimensional information such as market supply and demand, the model can accurately capture complex market dynamics and provide optimized decision-making basis for power generators and users. Power generators can reasonably arrange power generation plans and improve economic benefits through accurate electricity price forecasts; users can optimize electricity consumption strategies and reduce electricity bills through forecast results. In the context of energy transformation, the present invention can effectively promote the rational allocation and utilization of renewable energy and improve the reliability and stability of the power system.

[0055] See also Figure 2 The present invention provides a short-term electricity price prediction method based on the MIC-TCN-Transformer model, comprising the following steps: S1. Obtain various data required for electricity price forecasting from different data sources, including historical electricity price data, primary energy and new energy output information, historical load data, fuel prices, temperature, humidity, and date types, and integrate them into a unified format and structure; Arrange the feature factor sequence by columns, with the last column as the feature factor sequence to be predicted, ensuring that all data are aligned on the time axis.

[0056] S2. Check the integrity, continuity, consistency, and rationality of the collected data, clean the unqualified data, extract and select features of the data set, normalize all data, and segment the data set; S201, data check, check the integrity of the data, check whether there are missing values ​​in the data; check the continuity of the data, check whether the data is continuous in time; check the consistency of the data, check whether the units of the same type of data are consistent, check the rationality of the data, and use the four-quarter distance method to check whether there are outliers in the data; Use the interquartile range method to check whether there are outliers in the data: S2011, Calculate quartiles represents the first quartile, which is 25% of the data; It represents the third quartile, which is 75% of the data.

[0057] S2012, calculation of data upper limit;

[0058] S2013, data lower limit;

[0059] S2014. Determine abnormal values.

[0060] Outliers are judged based on the obtained data upper and lower limits. When a data point is less than the lower limit or greater than the upper limit, it is considered an outlier.

[0061] S202, data cleaning, using spline interpolation to fill missing values ​​in the data, and after removing outliers, using spline interpolation to fill the original positions; S203, feature engineering, extracting time features from the data set and screening MIC multi-dimensional features; S2031. Calculate the correlation of any dimension with the historical electricity price dimension position number, arrange the multi-dimensional influencing factors and the MIC values ​​of the historical electricity price from large to small, and select the characteristic factors with a MIC value greater than 0.3 as the input data of the prediction model; if the model evaluation performance determination coefficient is less than 0.88 or the mean absolute percentage error is greater than 10%, select the characteristic factors with a MIC greater than 0.5; S2032. Extract hour, day of the week, month, season, and weekday features from the date information and add them to the data set as additional feature factors.

[0062] S204, data normalization, used to normalize the data of each electricity price influencing factor; S205, data set segmentation, the data set is segmented into a training set, a validation set, and a test set in a ratio of 80:10:10.

[0063] S3. Define TCN and Transformer models and create a MIC-TCN-Transformer model. Create a Transformer model. The global sequence modeling module (Transformer) includes input embedding, position encoding, multi-head self-attention mechanism, feedforward neural network, residual connection and normalization, and output layer. Set the number of encoder and decoder layers of the Transformer model; set the feature space dimension, set the dimension of the hidden layer of the feedforward neural network; set the number of heads of the multi-head attention mechanism, and set the dropout rate of the Dropout layer. Create the input layer, defining the model’s input shape and the number of data features per time step; Create two TCN modules. The temporal feature extraction part (TCN) contains causal convolutional layers, dilated convolutional layers, residual connections, regularization and activation. Define a convolution block of the TCN module to extract temporal features of time series data. Use different dilation factor lists to capture multiple temporal dependencies. The number of convolution kernels in the second convolution needs to be larger than the first one, and the dilation factor list may be further increased to further expand the receptive field. Create a Transformer output layer and use the output of the second TCN module as the input of the Transformer model.

[0064] S4, configure the optimizer and loss function of the model, use the training set obtained in step S2 to train the MIC-TCN-Transformer model, and use the validation set obtained in step S2 to validate the MIC-TCN-Transformer model to evaluate the model performance; The Adam optimizer is used to optimize the MIC-TCN-Transformer model, and the mean squared error (MSE) is used as the loss function. The model training part uses the training set data for multiple rounds of iterations and updates the model parameters through the specified batch size. After each iteration, the MIC-TCN-Transformer model is evaluated through the validation set to detect the performance of the MIC-TCN-Transformer model during the training process and help monitor whether there is overfitting or underfitting.

[0065] S5. Input the test set obtained in step S2 into the MIC-TCN-Transformer model trained in step S4 to obtain the prediction result.

[0066] Denormalize the predicted results and actual values ​​to restore them to their original scale; The determination coefficient (R square), mean absolute error (MAE), mean square error (MAE), root mean square error (RMSE), and mean absolute percentage error (MAPE) were used for evaluation, as follows:

[0067]

[0068]

[0069]

[0070] in, represents the actual value, Represents the predicted value.

[0071] In another embodiment of the present invention, a short-term electricity price forecasting system based on the MIC-TCN-Transformer model is provided. The system can be used to implement the above-mentioned short-term electricity price forecasting method based on the MIC-TCN-Transformer model. Specifically, the short-term electricity price forecasting system based on the MIC-TCN-Transformer model includes a data module, a preprocessing module, a construction module, a training module and a prediction module.

[0072] Among them, the data module obtains electricity price forecast data from different data sources and integrates the electricity price forecast data into a unified format and structure; The preprocessing module checks the integrity, continuity, consistency, and rationality of the obtained data, cleans unqualified data, extracts and selects features from the data set, normalizes all data, and divides the data set into training set, validation set, and test set; Build modules, define TCN and Transformer models, and create a MIC-TCN-Transformer model; The training module configures the optimizer and loss function, trains the MIC-TCN-Transformer model using the training set, and evaluates the MIC-TCN-Transformer model using the validation set; The prediction module inputs the test set into the trained MIC-TCN-Transformer model to obtain the prediction results.

[0073] In another embodiment of the present invention, a terminal device is provided, the terminal device including a processor and a memory, the memory is used to store a computer program, the computer program includes program instructions, and the processor is used to execute the program instructions stored in the computer storage medium. The processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc., which are the computing core and control core of the terminal, which are suitable for implementing one or more instructions, and are specifically suitable for loading and executing one or more instructions to implement the corresponding method flow or corresponding functions; the processor described in the embodiment of the present invention can be used for the operation of the short-term electricity price prediction method based on the MIC-TCN-Transformer model, including: Obtain electricity price forecast data from different data sources and integrate the electricity price forecast data into a unified format and structure; check the data for integrity, continuity, consistency, and rationality, clean up unqualified data, extract and select features from the data set, normalize all data, and split the data set into training set, validation set, and test set; define TCN and Transformer models, and create a MIC-TCN-Transformer model; configure the optimizer and loss function, train the MIC-TCN-Transformer model using the training set, and evaluate the MIC-TCN-Transformer model using the validation set; input the test set into the trained MIC-TCN-Transformer model to obtain the prediction results.

[0074] See also Figure 4 , the terminal device is a computer device. The computer device 60 of this embodiment includes: a processor 61, a memory 62, and a computer program 63 stored in the memory 62 and executable on the processor 61. When the computer program 63 is executed by the processor 61, the method for calculating the fluid composition in the reservoir transformation wellbore in the embodiment is implemented. To avoid repetition, it is not described one by one here. Alternatively, when the computer program 63 is executed by the processor 61, the functions of each model / unit in the short-term electricity price prediction system based on the MIC-TCN-Transformer model in the embodiment are implemented. To avoid repetition, it is not described one by one here.

[0075] The computer device 60 may be a computing device such as a desktop computer, a notebook, a PDA, or a cloud server. The computer device 60 may include, but is not limited to, a processor 61 and a memory 62. Those skilled in the art will appreciate that Figure 4 This is only an example of the computer device 60 and does not constitute a limitation of the computer device 60. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the computer device may also include input and output devices, network access devices, buses, etc.

[0076] The processor 61 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.

[0077] The memory 62 may be an internal storage unit of the computer device 60, such as a hard disk or memory of the computer device 60. The memory 62 may also be an external storage device of the computer device 60, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc., equipped on the computer device 60.

[0078] Furthermore, the memory 62 may include both an internal storage unit of the computer device 60 and an external storage device. The memory 62 is used to store computer programs and other programs and data required by the computer device. The memory 62 may also be used to temporarily store data that has been output or is to be output.

[0079] See also Figure 5 , the terminal device is a chip, and the chip 600 of this embodiment includes a processor 622, which may be one or more, and a memory 632 for storing a computer program executable by the processor 622. The computer program stored in the memory 632 may include one or more modules, each corresponding to a set of instructions. In addition, the processor 622 may be configured to execute the computer program to execute the above-mentioned short-term electricity price prediction method based on the MIC-TCN-Transformer model.

[0080] In addition, the chip 600 may further include a power supply component 626 and a communication component 650, wherein the power supply component 626 may be configured to perform power management of the chip 600, and the communication component 650 may be configured to implement communication, for example, wired or wireless communication, of the chip 600. In addition, the chip 600 may further include an input / output interface 658. The chip 600 may operate based on an operating system stored in the memory 632.

[0081] In another embodiment of the present invention, the present invention also provides a storage medium, specifically a computer-readable storage medium, which is a memory device in a terminal device for storing programs and data. It can be understood that the computer-readable storage medium here can include both the built-in storage medium in the terminal device and the extended storage medium supported by the terminal device. The computer-readable storage medium provides a storage space, which stores the operating system of the terminal. In addition, one or more instructions suitable for being loaded and executed by the processor are also stored in the storage space, and these instructions can be one or more computer programs. It should be noted that the computer-readable storage medium here can be a high-speed RAM memory, or a non-volatile memory (Non-VolatileMemory), such as at least one disk memory.

[0082] The processor may load and execute one or more instructions stored in the computer-readable storage medium to implement the corresponding steps of the short-term electricity price prediction method based on the MIC-TCN-Transformer model in the above embodiment; the processor may load and execute the following steps: Obtain electricity price forecast data from different data sources and integrate the electricity price forecast data into a unified format and structure; check the data for integrity, continuity, consistency, and rationality, clean up unqualified data, extract and select features from the data set, normalize all data, and split the data set into training set, validation set, and test set; define TCN and Transformer models, and create a MIC-TCN-Transformer model; configure the optimizer and loss function, train the MIC-TCN-Transformer model using the training set, and evaluate the MIC-TCN-Transformer model using the validation set; input the test set into the trained MIC-TCN-Transformer model to obtain the prediction results.

[0083] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all of the embodiments. The components of the embodiments of the present invention described and shown in the drawings here can usually be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present invention provided in the drawings is not intended to limit the scope of the claimed invention, but merely represents selected embodiments of the present invention. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.

[0084] See also Fig. 9 This embodiment uses electricity price forecast data from the Australian electricity market. The data includes historical electricity price data, output information of primary energy and new energy, historical load data, fuel prices, meteorological data (such as temperature and humidity), and date type information in multiple dimensions. The data span is one year of historical data, and the time interval is the hourly electricity price change.

[0085] The following are the prediction results: Coefficient of determination (R²): 0.908; Mean absolute error (MAE): 1.92; Mean square error (MSE): 6.69; Root mean square error (RMSE): 2.58; Mean absolute percentage error (MAPE): 8.35%.

[0086] See also Figure 6 , Figure 7 and Figure 8 The prediction model shows high accuracy and stability in the Australian electricity market, with R² reaching 0.91 and good error indicators. The model effectively handles the complexity of the electricity market through MIC dimensionality reduction, TCN capturing short-term fluctuations, and Transformer identifying global trends, and can provide reliable decision support for power generators and users. The model performs well in short-term electricity price forecasting and is suitable for actual market demand.

[0087] In summary, the present invention provides a short-term electricity price forecasting method and system based on the MIC-TCN-Transformer model, which is highly efficient and widely applicable. It is suitable for various power market environments and meteorological conditions, and is particularly suitable for scenarios where the power market is highly volatile and requires high-precision electricity price forecasting.

[0088] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.

[0089] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0090] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed in the present invention can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0091] In the embodiments provided by the present invention, it should be understood that the disclosed devices / terminals and methods can be implemented in other ways. For example, the device / terminal embodiments described above are only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0092] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0093] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0094] If the integrated module / unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present invention implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium, etc. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.

[0095] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices, and computer program products according to the embodiments of the present application. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0096] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0097] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0098] The above contents are only for explaining the technical idea of ​​the present invention and cannot be used to limit the protection scope of the present invention. Any changes made on the basis of the technical solution in accordance with the technical idea proposed by the present invention shall fall within the protection scope of the claims of the present invention.

Claims

1. A short-term electricity price forecasting method based on MIC-TCN-Transformer model, characterized in that: The following steps are involved: S1. Obtain electricity price forecast data from different data sources and integrate the electricity price forecast data into a unified format and structure; S2, check the integrity, continuity, consistency, and rationality of the data obtained in step S1, clean up unqualified data, extract and select features of the data set, normalize all data, and divide the data set into a training set, a validation set, and a test set; S3. Define TCN and Transformer models and create a MIC-TCN-Transformer model. S4, configure the optimizer and loss function, train the MIC-TCN-Transformer model using the training set obtained in step S2, and evaluate the MIC-TCN-Transformer model using the validation set obtained in step S2; S5. Input the test set obtained in step S2 into the MIC-TCN-Transformer model trained in step S4 to obtain the prediction result.

2. The short-term electricity price forecasting method based on the MIC-TCN-Transformer model according to claim 1 is characterized in that: Electricity price forecast data includes historical electricity price data, primary energy and new energy output information, historical load data, fuel prices, temperature, humidity, and date type.

3. The short-term electricity price forecasting method based on the MIC-TCN-Transformer model according to claim 2 is characterized in that: Integrate electricity price forecast data into a unified format and structure as follows: Arrange the feature factor sequence by columns, with the last column as the feature factor sequence to be predicted, ensuring that all data are aligned on the time axis.

4. The short-term electricity price forecasting method based on the MIC-TCN-Transformer model according to claim 1 is characterized in that: Check the data for completeness, continuity, consistency, and rationality, clean up unqualified data, extract and select features from the data set, normalize all data, and split the data set into training set, validation set, and test set. Specifically: Check the integrity of the data to see if there are any missing values; check the continuity of the data to see if the data is continuous in time; check the consistency of the data to see if the units of the same type of data are consistent; check the rationality of the data and use the interquartile range method to check if there are any outliers in the data; The missing values ​​of the data are filled using spline interpolation. After removing the outliers, the original positions are filled using spline interpolation. Extract time features and screen MIC multi-dimensional features from the data set; Normalize the data of each factor affecting electricity price; The dataset is split into training set, validation set, and test set in a ratio of 80:10:

10.

5. The short-term electricity price forecasting method based on the MIC-TCN-Transformer model according to claim 4 is characterized in that: Use the interquartile range method to check whether there are outliers in the data: Calculate the quartiles, represents the first quartile, which is 25% of the data; Indicates the third quartile, which is 75% of the data; calculates the upper limit of the data ; Calculate the lower limit of data ;in, Outliers are judged based on the obtained data upper and lower limits. When a data point is less than the lower limit or greater than the upper limit, it is an outlier.

6. The short-term electricity price forecasting method based on the MIC-TCN-Transformer model according to claim 4 is characterized in that: The specific steps for extracting time features and screening MIC multi-dimensional features of the data set are as follows: Calculate the correlation of historical electricity data with the same position number in any dimension and historical electricity price dimension, arrange the multidimensional influencing factors and the MIC values ​​of historical electricity prices from large to small, and select characteristic factors with MIC values ​​greater than 0.3 as input data of the prediction model; when the model evaluation performance determination coefficient is less than 0.88 or the mean absolute percentage error is greater than 10%, select characteristic factors with MIC greater than 0.5; extract hour, day of the week, month, season, and weekday features from the date information and add them to the data set as additional characteristic factors.

7. The short-term electricity price forecasting method based on the MIC-TCN-Transformer model according to claim 1 is characterized in that: The MIC-TCN-Transformer model is as follows: The Transformer model includes input embedding, position encoding, multi-head self-attention mechanism, feedforward neural network, residual connection and normalization, and output layer; Set the number of encoder and decoder layers of the Transformer model; Set the feature space dimension and the dimension of the hidden layer of the feedforward neural network; Set the number of heads of the multi-head attention mechanism and the dropout rate of the dropout layer; Create the input layer, defining the model’s input shape and the number of data features per time step; Create two TCN modules, which contain causal convolutional layers, dilated convolutional layers, residual connections, regularization, and activation; define a convolutional block of the TCN module to extract temporal features of time series data, using a list of different dilation factors to capture multiple temporal dependencies; the number of convolutional kernels in the second one is greater than the number of convolutional kernels in the first one; Create a Transformer output layer and use the output of the second TCN module as the input of the Transformer model.

8. The short-term electricity price forecasting method based on the MIC-TCN-Transformer model according to claim 1 is characterized in that: The MIC-TCN-Transformer model is optimized using the Adam optimizer, with mean square error as the loss function. The training set is used for multiple rounds of iterations, and the parameters are updated with the specified batch size. After each iteration, the MIC-TCN-Transformer model is evaluated using the validation set.

9. The short-term electricity price forecasting method based on the MIC-TCN-Transformer model according to claim 1 is characterized in that: The predicted results and actual values ​​are denormalized and restored to the original scale; the determination coefficient, mean absolute error, mean square error, root mean square error, and mean absolute percentage error are used for evaluation, as follows: in, represents the actual value, represents the predicted value, is the selected number of hours, is the average of the actual values.

10. A short-term electricity price forecasting system based on the MIC-TCN-Transformer model, characterized in that: include: The data module obtains electricity price forecast data from different data sources and integrates the electricity price forecast data into a unified format and structure; The preprocessing module checks the integrity, continuity, consistency, and rationality of the obtained data, cleans unqualified data, extracts and selects features from the data set, normalizes all data, and divides the data set into training set, validation set, and test set; Build modules, define TCN and Transformer models, and create a MIC-TCN-Transformer model; The training module configures the model's optimizer and loss function, trains the MIC-TCN-Transformer model using the training set, and evaluates the MIC-TCN-Transformer model using the validation set; In the prediction module, the test set is input into the trained MIC-TCN-Transformer model to obtain the prediction result.

Citation Information

Cited By

  • Non-invasive blood glucose dynamic detection system

    CN119700102A